Merge pull request #67 from negativeExponent/fix_cheevos_support

Fix cheevos support
This commit is contained in:
Autechre 2020-04-05 12:01:35 +02:00 committed by GitHub
commit 514cb1e66b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 23 additions and 0 deletions

View File

@ -514,6 +514,27 @@ static void frame_time_cb(retro_usec_t usec)
frame_time = usec / 1000000.0;
}
static void set_memory_descriptors(void)
{
const uint64_t mem = RETRO_MEMORY_SYSTEM_RAM;
struct retro_memory_descriptor desc[9] = {
{ mem, iwram, 0x00000 + 0x8000, 0x3000000, 0, 0, 0x8000, NULL },
{ mem, ewram, 0x00000 + 0x8000, 0x2000000, 0, 0, 0x8000, NULL },
{ mem, ewram, 0x10000 + 0x8000, 0x2008000, 0, 0, 0x8000, NULL },
{ mem, ewram, 0x20000 + 0x8000, 0x2010000, 0, 0, 0x8000, NULL },
{ mem, ewram, 0x30000 + 0x8000, 0x2018000, 0, 0, 0x8000, NULL },
{ mem, ewram, 0x40000 + 0x8000, 0x2020000, 0, 0, 0x8000, NULL },
{ mem, ewram, 0x50000 + 0x8000, 0x2028000, 0, 0, 0x8000, NULL },
{ mem, ewram, 0x60000 + 0x8000, 0x2030000, 0, 0, 0x8000, NULL },
{ mem, ewram, 0x70000 + 0x8000, 0x2038000, 0, 0, 0x8000, NULL }
};
struct retro_memory_map retromap = {
desc,
sizeof(desc) / sizeof(desc[0])
};
environ_cb(RETRO_ENVIRONMENT_SET_MEMORY_MAPS, &retromap);
}
bool retro_load_game(const struct retro_game_info* info)
{
if (!info)
@ -604,6 +625,8 @@ bool retro_load_game(const struct retro_game_info* info)
init_context_switch();
set_memory_descriptors();
return true;
}