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

Add Memory Map Setup #545

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Next Next commit
add memory map setup
  • Loading branch information
JoshuaEagles committed Jul 23, 2024
commit 1ce47d9f0805327baebb0154e7aea6f1208b2b98
20 changes: 20 additions & 0 deletions mupen64plus-core/src/main/main.c
Original file line number Diff line number Diff line change
@@ -1703,6 +1703,8 @@ m64p_error main_run(void)
dd_rom_size,
&dd_disk, dd_idisk);

setup_libretro_memory_map();

// Attach rom to plugins
failure_rval = M64ERR_PLUGIN_FAIL;
if (!gfx.romOpen())
@@ -1873,3 +1875,21 @@ m64p_error close_pif(void)
g_start_address = UINT32_C(0xa4000040);
return M64ERR_SUCCESS;
}

void setup_libretro_memory_map() {
struct retro_memory_descriptor descs[1];
struct retro_memory_map retromap;

memset(descs, 0, sizeof(descs));

descs[0].flags = RETRO_MEMDESC_SYSTEM_RAM;
descs[0].ptr = g_dev.rdram.dram;
descs[0].start = 0;
descs[0].len = RDRAM_MAX_SIZE;
descs[0].select = 0;

retromap.descriptors = &descs;
retromap.num_descriptors = sizeof(descs) / sizeof(*descs);

environ_cb(RETRO_ENVIRONMENT_SET_MEMORY_MAPS, &retromap);
}