From a57d1d595548a994ad641f383011b97e20b09b80 Mon Sep 17 00:00:00 2001 From: NewRisingSun <8vytz1+dhp372pv94ebg@sharklasers.com> Date: Tue, 9 Sep 2025 00:30:58 +0200 Subject: [PATCH] Mapper 327: add submapper 1, used for Mario IV (Armadillo)'s 1-screen mirroring. --- src/boards/et-100.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/boards/et-100.c b/src/boards/et-100.c index 5e41622..1ad553c 100644 --- a/src/boards/et-100.c +++ b/src/boards/et-100.c @@ -41,6 +41,7 @@ #include "mapinc.h" #include "mmc3.h" +static uint8 submapper; static uint8 *CHRRAM = NULL; static uint32 CHRRAMSize; @@ -58,6 +59,16 @@ static void BMC1024CA1CW(uint32 A, uint8 V) { setchr1(A, V | ((EXPREGS[0] & 7) << 7)); else setchr1(A, (V&0x7F) | ((EXPREGS[0] & 7) << 7)); + + if (submapper == 1 && EXPREGS[0] &0x08) setmirror(DRegBuf[MMC3_cmd &0x80? 2: 0] &0x80? MI_1: MI_0); +} + +static void BMC1024CA1MW(uint8 V) { + A000B = V; + if (EXPREGS[0] &0x08) + setmirror(DRegBuf[MMC3_cmd &0x80? 2: 0] &0x80? MI_1: MI_0); + else + setmirror(V &1? MI_H: MI_V); } static DECLFW(BMC1024CA1Write) { @@ -90,6 +101,7 @@ static void BMC1024CA1Close(void) { } void BMC1024CA1_Init(CartInfo *info) { + submapper = info->submapper; GenMMC3_Init(info, 256, 256, 8, 0); CHRRAMSize = 8192; CHRRAM = (uint8*)FCEU_gmalloc(CHRRAMSize); @@ -97,6 +109,7 @@ void BMC1024CA1_Init(CartInfo *info) { AddExState(CHRRAM, CHRRAMSize, 0, "CHRR"); pwrap = BMC1024CA1PW; cwrap = BMC1024CA1CW; + if (submapper == 1) mwrap = BMC1024CA1MW; info->Power = BMC1024CA1Power; info->Reset = BMC1024CA1Reset; info->Close = BMC1024CA1Close;