From aabeaf1d03b0218e2e22913fae36149ea7f0e0c1 Mon Sep 17 00:00:00 2001 From: NewRisingSun <8vytz1+dhp372pv94ebg@sharklasers.com> Date: Fri, 28 Nov 2025 12:08:57 +0100 Subject: [PATCH] Remove mapper 171, add mapper 1 submappers 7 and 8. --- src/boards/mmc1.c | 21 +++++++++++---------- src/ines.c | 2 +- src/ines.h | 1 - 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/boards/mmc1.c b/src/boards/mmc1.c index d6b004d..310c4a3 100644 --- a/src/boards/mmc1.c +++ b/src/boards/mmc1.c @@ -24,6 +24,7 @@ static void GenMMC1Power(void); static void GenMMC1Init(CartInfo *info, int prg, int chr, int wram, int saveram); +static uint8 submapper; static uint8 DRegs[4]; static uint8 Buffer, BufferShift; @@ -42,7 +43,7 @@ static void (*MMC1WRAMHook8)(void); static uint8 *WRAM = NULL; static uint8 *CHRRAM = NULL; -static int is155, is171; +static int is155; static uint32 MMC1GetCHRBank (uint32 bank) { if (DRegs[0] & 0x10) /* 4 KiB mode */ @@ -66,6 +67,10 @@ static DECLFR(MAWRAM) { return(Page[A >> 11][A]); } +static DECLFR(SFEXPROM_readBank) { + return DRegs[3] <<3 &0x70; +} + static void MMC1CHR(void) { if (MMC1WRAMHook8) /* Use custom wram hook, currently used for M543 */ MMC1WRAMHook8(); @@ -132,7 +137,7 @@ static void MMC1PRG(void) { } static void MMC1MIRROR(void) { - if (!is171) + if (submapper != 7) switch (DRegs[0] & 3) { case 2: setmirror(MI_V); break; case 3: setmirror(MI_H); break; @@ -297,7 +302,9 @@ static void GenMMC1Power(void) { SetReadHandler(0x6000, 0x7FFF, MAWRAM); SetWriteHandler(0x6000, 0x7FFF, MBWRAM); setprg8r(0x10, 0x6000, 0); - } + } else + if (submapper == 8) + SetReadHandler(0x6000, 0x6FFF, SFEXPROM_readBank); MMC1CMReset(); } @@ -311,6 +318,7 @@ static void GenMMC1Close(void) { } static void GenMMC1Init(CartInfo *info, int prg, int chr, int wram, int saveram) { + submapper = info->submapper; is155 = 0; info->Close = GenMMC1Close; @@ -357,13 +365,6 @@ void Mapper155_Init(CartInfo *info) { is155 = 1; } -/* Same as mapper 1, with different (or without) mirroring control. */ -/* Kaiser KS7058 board, KS203 custom chip */ -void Mapper171_Init(CartInfo *info) { - GenMMC1Init(info, 32, 32, 0, 0); - is171 = 1; -} - void SAROM_Init(CartInfo *info) { GenMMC1Init(info, 128, 64, 8, info->battery ? 8 : 0); } diff --git a/src/ines.c b/src/ines.c index c59a7ab..699cda9 100644 --- a/src/ines.c +++ b/src/ines.c @@ -624,7 +624,7 @@ INES_BOARD_BEGIN() INES_BOARD( "", 168, Mapper168_Init ) /* INES_BOARD( "", 169, Mapper169_Init ) */ INES_BOARD( "", 170, Mapper170_Init ) - INES_BOARD( "", 171, Mapper171_Init ) +/* INES_BOARD( "", 171, Mapper171_Init )*/ INES_BOARD( "Super Mega P-4070", 172, Mapper172_Init ) INES_BOARD( "Idea-Tek ET.xx", 173, Mapper173_Init ) INES_BOARD( "", 174, Mapper174_Init ) diff --git a/src/ines.h b/src/ines.h index b8f3d6f..78674eb 100644 --- a/src/ines.h +++ b/src/ines.h @@ -177,7 +177,6 @@ void Mapper166_Init(CartInfo *); void Mapper167_Init(CartInfo *); void Mapper168_Init(CartInfo *); void Mapper170_Init(CartInfo *); -void Mapper171_Init(CartInfo *); void Mapper172_Init(CartInfo *); void Mapper173_Init(CartInfo *); void Mapper174_Init(CartInfo *);