Advertise Jaguar memory map for RetroAchievements support#117
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds libretro memory-map advertisement for Atari Jaguar system RAM to enable RetroAchievements/rcheevos to resolve emulated addresses to host memory, and introduces a CI-backed test to validate the environment callbacks and exposed RAM mapping.
Changes:
- Advertise Jaguar main RAM via
RETRO_ENVIRONMENT_SET_MEMORY_MAPSduringretro_load_game. - Signal achievements support via
RETRO_ENVIRONMENT_SET_SUPPORT_ACHIEVEMENTSinretro_set_environment. - Add a new dynamic-loader test (
test_memory_map) and run it in CI on native non-Windows builds.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
libretro.c |
Adds achievements support flag and advertises a system RAM memory map descriptor. |
test/tools/test_memory_map.c |
New executable test that loads the core and validates memory-map + achievements environment calls. |
.github/workflows/c-cpp.yml |
Builds/runs the new memory map test in CI (native, non-Windows). |
.gitignore |
Ignores new test/tool binaries. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 8 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b940ebd to
816cfe9
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 8 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Call SET_MEMORY_MAPS in retro_load_game with 2 MB system RAM descriptor (BIGENDIAN | SYSTEM_RAM, start=0x000000, len=0x200000) - Use static storage for descriptors to prevent dangling pointers - Call SET_SUPPORT_ACHIEVEMENTS in retro_set_environment - Add test/tools/test_memory_map.c with 10 automated checks - Add memory map test to CI workflow for native platforms Made-with: Cursor
Download pinned rcheevos, build librcheevos.a, verify rc_libretro_memory_* against Virtual Jaguar with the same Jaguar console regions RetroArch uses. CI runs after the memory map contract test; respects matrix CC for i686. Made-with: Cursor
Made-with: Cursor
Co-authored-by: Copilot <[email protected]>
Guard before rc_libretro_memory_init; do not call with NULL g_mmap. If the map is absent or init fails, print SKIPPED and only destroy regions after a successful init. Made-with: Cursor
…ent review Made-with: Cursor
- test_memory_map: capture SET_SUPPORT_ACHIEVEMENTS data per libretro.h (non-NULL bool, true). - CI: actions/cache for build/rcheevos-static keyed by pin + OS + compiler + target. - CLAUDE.md: distinguish no RA server vs GitHub tarball fetch. Made-with: Cursor
… deps - Run Test 1 immediately after retro_set_environment so regressions that move the call into retro_init fail. - Document libdl on Linux for test_rcheevos_e2e.sh (dlopen via -ldl). Made-with: Cursor
Copilot: avoid UB if num_descriptors >= 1 but descriptors is NULL. Test 3 fails explicitly when num_descriptors==1 with NULL table; Tests 4–9 FAIL as a block in that case instead of crashing. Made-with: Cursor
Co-authored-by: Copilot <[email protected]>
509b6c8 to
932dd4e
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 8 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Summary
RETRO_ENVIRONMENT_SET_MEMORY_MAPSinretro_load_game, enabling RetroAchievements (rcheevos) memory lookupsRETRO_ENVIRONMENT_SET_SUPPORT_ACHIEVEMENTSinretro_set_environmentto signal achievement supportstaticstorage for the memory descriptor and map structs to prevent dangling pointers afterretro_load_gamereturnsMemory Map Descriptor
RETRO_MEMDESC_SYSTEM_RAM | RETRO_MEMDESC_BIGENDIANjaguarMainRAM(2 MB)0x0000000x200000"RAM"Test Plan
test/tools/test_memory_map.cwith 10 automated checks:SET_SUPPORT_ACHIEVEMENTScalled duringretro_set_environmentSET_MEMORY_MAPScalled duringretro_load_game0x0000000x200000RETRO_MEMDESC_SYSTEM_RAMflag setRETRO_MEMDESC_BIGENDIANflag setretro_get_memory_data(SYSTEM_RAM)retro_get_memory_size(SYSTEM_RAM)==0x200000Supersedes #112.
Made with Cursor