Skip to content

Commit

Permalink
Merge pull request #302 from Hzbeta/retroarch-cheat-compatibility
Browse files Browse the repository at this point in the history
Tools: Allow RetroArch to search game memory for cheats
  • Loading branch information
LibretroAdmin authored Nov 12, 2024
2 parents 734afd3 + 089ae1b commit 747362c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/platform/libretro/libretro.c
Original file line number Diff line number Diff line change
Expand Up @@ -1750,12 +1750,14 @@ static void _setupMaps(struct mCore* core) {
descs[0].start = GBA_BASE_IWRAM;
descs[0].len = GBA_SIZE_IWRAM;
descs[0].select = 0xFF000000;
descs[0].flags = RETRO_MEMDESC_SYSTEM_RAM; // Allow RetroArch to access this memory for cheats

/* Map working RAM */
descs[1].ptr = gba->memory.wram;
descs[1].start = GBA_BASE_EWRAM;
descs[1].len = GBA_SIZE_EWRAM;
descs[1].select = 0xFF000000;
descs[1].flags = RETRO_MEMDESC_SYSTEM_RAM; // Allow RetroArch to access this memory for cheats

/* Map save RAM */
/* TODO: if SRAM is flash, use start=0 addrspace="S" instead */
Expand Down Expand Up @@ -1851,12 +1853,14 @@ static void _setupMaps(struct mCore* core) {
descs[i].ptr = gb->memory.wram;
descs[i].start = GB_BASE_WORKING_RAM_BANK0;
descs[i].len = GB_SIZE_WORKING_RAM_BANK0;
descs[i].flags = RETRO_MEMDESC_SYSTEM_RAM; // Allow RetroArch to access this memory for cheats
i++;

descs[i].ptr = gb->memory.wram;
descs[i].offset = GB_SIZE_WORKING_RAM_BANK0;
descs[i].start = GB_BASE_WORKING_RAM_BANK1;
descs[i].len = GB_SIZE_WORKING_RAM_BANK0;
descs[i].flags = RETRO_MEMDESC_SYSTEM_RAM; // Allow RetroArch to access this memory for cheats
i++;

/* Map OAM */
Expand All @@ -1877,6 +1881,7 @@ static void _setupMaps(struct mCore* core) {
descs[i].start = GB_BASE_HRAM;
descs[i].len = GB_SIZE_HRAM;
descs[i].select = 0xFFFFFF80;
descs[i].flags = RETRO_MEMDESC_SYSTEM_RAM; // Allow RetroArch to access this memory for cheats
i++;

/* Map IE Register */
Expand All @@ -1901,6 +1906,7 @@ static void _setupMaps(struct mCore* core) {
descs[i].start = 0x10000;
descs[i].len = GB_SIZE_WORKING_RAM - 0x2000;
descs[i].select = 0xFFFFA000;
descs[i].flags = RETRO_MEMDESC_SYSTEM_RAM; // Allow RetroArch to access this memory for cheats
i++;
}

Expand Down

0 comments on commit 747362c

Please sign in to comment.