Crystal
Developer
Building on @TheRouLetteBoi's page_allocate additions in Mamba/Cobra, I've also added support for page freeing which fixes the issue where program crashes on exit. Any program that uses page_allocate will need to keep track of a page_table which is the kernel page address to user process page address mapping. See below code example of its usage that's based off of TheRouLetteBoi's and Crystal's example.
Code:#include <sys/process.h> #include <ps3mapi_ps3_lib.h> #define KB(n) (1024*n) #define MB(n) (1048576*n) char fret5[32] = {0xfb, 0xe1, 0xff, 0xf8, 0xf8, 0x21, 0xff, 0xc1, 0x7c, 0x3f, 0x0b, 0x78, 0x39, 0x20, 0x00, 0x05, 0x7d, 0x23, 0x4b, 0x78, 0x38, 0x3f, 0x00, 0x40, 0xeb, 0xe1, 0xff, 0xf8, 0x4e, 0x80, 0x00, 0x20}; uint64_t page_table[2]; int main(int argc, char *argv[]) { int ret = ps3mapi_page_allocate(sysProcessGetPid(), KB(650), PAGE_SIZE_AUTO, 0x2F, 1, page_table); // After ps3mapi_page_allocate return // page_table[0] holds program page_address mapping // page_table[1] holds kernel page_address allocation if (ret != 0) { printf("failed to allocate page\n"); return; } memcpy(page_table[0], fret5, sizeof(char)*32); int(*func)() = (int (*)())&page_table[0]; int result = func(); printf("fret5 result: %d\n", result); ps3mapi_process_page_free(sysProcessGetPid(), 0x2F, page_table); return 0; }
With some minor modifications to Retroarch's picodrive, I was able to get dynarec working which significantly sped up performance for 32x and Sega CD.
Star Wars Arcade runs at full speed no problem
![]()
Source code for these changes can be found below. Note that you will need the Mamba payload changes to get it to run after compiling.
https://github.com/OsirizX/Mamba/tree/page_table
https://github.com/OsirizX/ps3mapi-lib/tree/page_free
https://github.com/OsirizX/picodrive/tree/ps3_dynarec
credits: @TheRouLetteBoi, @Crystal, @bucanero
@aldostools Could you make that changes to your Mamba?