From 436dc0b67a0e392ff0e0e1c05f16e9292f4245eb Mon Sep 17 00:00:00 2001 From: retro-wertz Date: Sat, 13 Jul 2019 22:11:29 +0800 Subject: [PATCH] Fix GBC memory map and add IO port range for cheevos --- libretro/libretro.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/libretro/libretro.c b/libretro/libretro.c index 54c79060..59dfdc44 100644 --- a/libretro/libretro.c +++ b/libretro/libretro.c @@ -425,21 +425,20 @@ static void init_for_current_model(unsigned id) descs[7].len = 0x4000; descs[7].flags = RETRO_MEMDESC_CONST; - descs[8].ptr = GB_get_direct_access(&gameboy[i], GB_DIRECT_ACCESS_OAM, &size, &bank); - descs[8].start = 0xFE00; - descs[8].select = 0xFFFFFF00; - descs[8].len = 0x00A0; + descs[8].ptr = GB_get_direct_access(&gameboy[i], GB_DIRECT_ACCESS_OAM, &size, &bank); + descs[8].start = 0xFE00; + descs[8].len = 0x00A0; + descs[8].select= 0xFFFFFF00; - descs[9].ptr = descs[2].ptr + 0x2000; /* GBC RAM bank 2 */ - descs[9].start = 0x10000; - descs[9].select = 0xFFFF0000; - descs[9].len = GB_is_cgb(&gameboy[i]) ? 0x6000 : 0; /* 0x1000 per bank (2-7), unmapped on GB */ + descs[9].ptr = descs[2].ptr + 0x2000; /* GBC RAM bank 2 */ + descs[9].start = 0x10000; + descs[9].len = GB_is_cgb(&gameboy[i]) ? 0x6000 : 0; /* 0x1000 per bank (2-7), unmapped on GB */ + descs[9].select= 0xFFFF0000; - descs[10].ptr = descs[8].ptr; - descs[10].offset = 0x100; - descs[10].start = 0xFF00; - descs[10].select = 0xFFFFFF00; - descs[10].len = 0x0080; + descs[10].ptr = GB_get_direct_access(&gameboy[i], GB_DIRECT_ACCESS_IO, &size, &bank); + descs[10].start = 0xFF00; + descs[10].len = 0x0080; + descs[10].select= 0xFFFFFF00; struct retro_memory_map mmaps; mmaps.descriptors = descs;