-
Notifications
You must be signed in to change notification settings - Fork 43
Advertise Jaguar memory map for RetroAchievements support #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -994,6 +994,25 @@ bool retro_load_game(const struct retro_game_info *info) | |
| JaguarLoadFile((uint8_t*)info->data, info->size); | ||
| JaguarReset(); | ||
|
|
||
| /* Advertise the Jaguar memory map to the frontend so features like | ||
| * RetroAchievements (rcheevos) can resolve emulated addresses to | ||
| * the host buffers backing them. */ | ||
| { | ||
| struct retro_memory_descriptor descs[1]; | ||
| struct retro_memory_map memmap; | ||
|
|
||
| memset(descs, 0, sizeof(descs)); | ||
| descs[0].flags = RETRO_MEMDESC_SYSTEM_RAM | RETRO_MEMDESC_BIGENDIAN; | ||
| descs[0].ptr = jaguarMainRAM; | ||
| descs[0].start = 0x000000; | ||
| descs[0].len = 0x200000; | ||
| descs[0].addrspace = "RAM"; | ||
|
|
||
| memmap.descriptors = descs; | ||
| memmap.num_descriptors = sizeof(descs) / sizeof(descs[0]); | ||
| environ_cb(RETRO_ENVIRONMENT_SET_MEMORY_MAPS, &memmap); | ||
|
JoeMatt marked this conversation as resolved.
Outdated
|
||
| } | ||
|
Comment on lines
+1000
to
+1015
|
||
|
|
||
| /* The frontend will load .srm data into our save buffer (returned by | ||
| * retro_get_memory_data) after this function returns but before the | ||
| * first retro_run(). We unpack it on the first frame. */ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are magic constants for the main RAM mapping. To reduce the chance of future mismatches, prefer using a named constant (e.g.,
JAGUAR_MAIN_RAM_SIZE) orsizeof(ifjaguarMainRAMis a real array in this translation unit) forlen.