Skip to content
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

[request] implement RETRO_ENVIRONMENT_SET_MEMORY_MAPS for SMS (and other systems) #346

Open
beauxq opened this issue Mar 31, 2024 · 1 comment

Comments

@beauxq
Copy link

beauxq commented Mar 31, 2024

In RetroArch, I've been using the network commands READ_CORE_RAM and WRITE_CORE_RAM for something that they're not intended for.
And the people at RetroArch tell me I should be using READ_CORE_MEMORY and WRITE_CORE_MEMORY instead.
But I can't use those if the emulator doesn't implement RETRO_ENVIRONMENT_SET_MEMORY_MAPS

From this code, it looks like it's implemented for SYSTEM_MCD, but not for SMS or other systems.
But I'm not sure whether I'm understanding it correctly.

static void set_memory_maps(void)
{
if (system_hw == SYSTEM_MCD)
{
const size_t SCD_BIT = 1ULL << 31ULL;
const uint64_t mem = RETRO_MEMDESC_SYSTEM_RAM;
struct retro_memory_map mmaps;
struct retro_memory_descriptor descs[] = {
{ mem, work_ram, 0, 0xFF0000, 0, 0, 0x10000, "68KRAM" },
/* virtual address using SCD_BIT so all 512M of prg_ram can be accessed */
/* at address $80020000 */
{ mem, scd.prg_ram, 0, SCD_BIT | 0x020000, 0, 0, 0x80000, "PRGRAM" },
};
mmaps.descriptors = descs;
mmaps.num_descriptors = sizeof(descs) / sizeof(descs[0]);
environ_cb(RETRO_ENVIRONMENT_SET_MEMORY_MAPS, &mmaps);
}
}

It would be nice if I could use READ_CORE_MEMORY and WRITE_CORE_MEMORY with Genesis-Plus-GX (and SMS-Plus-GX), with SMS games.

@negativeExponent
Copy link

negativeExponent commented Jul 19, 2024

smsplus-gx do you mean this? https://github.com/libretro/smsplus-gx
i was the one who ported this standalone fork into libretro and used to maintain it. ill see what i can do to add the RAM in memory maps instead. cant remember why i ddnt do that before.

as memory_map in genplus-gx, i also add this MegaCD memory maps, there was a reason that the main RAM was not moved into mem_map (retroarchivement? different address location?) no promises there but i can look into smsplus.

quicklook: i think it should be safe to expose entire 68K ram instead of limiting it just on mega/sega CD
{ mem, work_ram, 0, 0xFF0000, 0, 0, 0x10000, "68KRAM" },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants