From 38e0f03cf1131c2d6456666b126e17dcc835670c Mon Sep 17 00:00:00 2001 From: NewRisingSun <8vytz1+dhp372pv94ebg@sharklasers.com> Date: Fri, 11 Apr 2025 16:10:27 +0200 Subject: [PATCH] Mapper 023: Add support for odd-sized Contra hacks. --- src/boards/21_22_23_25.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/boards/21_22_23_25.c b/src/boards/21_22_23_25.c index 1524858..da73aa8 100644 --- a/src/boards/21_22_23_25.c +++ b/src/boards/21_22_23_25.c @@ -23,9 +23,10 @@ static void sync () { VRC24_syncWRAM(0); - VRC24_syncPRG(0x01F, 0x000); + VRC24_syncPRG(0x03F, 0x000); /* A real VRC4 has a PRG-ROM maximum of 256 KiB, but some hacks use more than that. */ VRC24_syncCHR(0x1FF, 0x000); VRC24_syncMirror(); + if (ROM_size &1) setprg16(0xC000, ROM_size -1); /* A number of Contra hacks have a PRG-ROM size of 400 KiB, expecting the last 16 KiB to be determined via subtraction. They would not work on real hardware. */ } void Mapper21_Init (CartInfo *info) {