Skip to content
Permalink
Browse files

Libretro: Update GBC memory map

  • Loading branch information
retro-wertz
retro-wertz committed Jul 16, 2019
1 parent fa45ccd commit c5e6a3409a3d41ce0a9bf7476e7c2e6dbdfc81a9
Showing with 10 additions and 1 deletion.
  1. +10 −1 src/libretro/libretro.cpp
@@ -1463,7 +1463,7 @@ bool retro_load_game(const struct retro_game_info *game)
gb_init();

unsigned addr, i;
struct retro_memory_descriptor desc[16];
struct retro_memory_descriptor desc[17];
struct retro_memory_map retromap;

memset(desc, 0, sizeof(desc));
@@ -1495,6 +1495,15 @@ bool retro_load_game(const struct retro_game_info *game)
}
}

if (gbCgbMode) { // banks 2-7 of GBC work ram banks at $10000
desc[i].ptr = (void*)gbWram;
desc[i].offset = 0x2000;
desc[i].start = 0x10000;
desc[i].select = 0xFFFF0000;
desc[i].len = 0x6000;
i++;
}

retromap.descriptors = desc;
retromap.num_descriptors = i;
environ_cb(RETRO_ENVIRONMENT_SET_MEMORY_MAPS, &retromap);

0 comments on commit c5e6a34

Please sign in to comment.
You can’t perform that action at this time.