From 6babc7fdaf76d9d667f302fe050f511470768b68 Mon Sep 17 00:00:00 2001 From: negative Date: Mon, 6 Mar 2023 13:13:06 +0800 Subject: [PATCH] Mapper 78: Add submapper support --- src/boards/datalatch.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/boards/datalatch.cpp b/src/boards/datalatch.cpp index a5bbf544..624b5795 100644 --- a/src/boards/datalatch.cpp +++ b/src/boards/datalatch.cpp @@ -26,6 +26,7 @@ static uint16 addrreg0=0, addrreg1=0; static uint8 *WRAM = NULL; static uint32 WRAMSIZE=0; static void (*WSync)(void) = nullptr; +static uint8 submapper; static DECLFW(LatchWrite) { // FCEU_printf("bs %04x %02x\n",A,V); @@ -68,6 +69,7 @@ static void Latch_Init(CartInfo *info, void (*proc)(void), uint8 init, uint16 ad info->Power = LatchPower; info->Close = LatchClose; GameStateRestore = StateRestore; + submapper = info->submapper; if(info->ines2) if(info->battery_wram_size + info->wram_size > 0) wram = 1; @@ -295,7 +297,11 @@ static void M78Sync() { setprg16(0x8000, (latche & 7)); setprg16(0xc000, ~0); setchr8(latche >> 4); - setmirror(MI_0 + ((latche >> 3) & 1)); + if (submapper == 3) { + setmirror((latche >> 3) & 1); + } else { + setmirror(MI_0 + ((latche >> 3) & 1)); + } } void Mapper78_Init(CartInfo *info) {