From 6a805ea424b204ccd7e3aac656591132fd8994c9 Mon Sep 17 00:00:00 2001 From: negativeExponent Date: Fri, 6 Mar 2020 20:07:15 +0800 Subject: [PATCH] mapper201: Add support for 21-in-1 (CF-043) (2006-V) (Unl) [p1] --- src/boards/addrlatch.c | 11 +++++++++-- src/ines-correct.h | 3 ++- src/ines.c | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/boards/addrlatch.c b/src/boards/addrlatch.c index 8f2f1ba..b61249a 100644 --- a/src/boards/addrlatch.c +++ b/src/boards/addrlatch.c @@ -274,18 +274,25 @@ void Mapper200_Init(CartInfo *info) { } /*------------------ Map 201 ---------------------------*/ - +/* 2020-3-6 - Support for 21-in-1 (CF-043) (2006-V) (Unl) [p1].nes which has mixed mirroring + * found at the time labeled as submapper 15 (negativeExponent) + * 0x05658DED 128K PRG, 32K CHR */ +static uint32 submapper = 0; static void M201Sync(void) { - if (latche & 8) { + if (latche & 8 || submapper == 15) { setprg32(0x8000, latche & 3); setchr8(latche & 3); } else { setprg32(0x8000, 0); setchr8(0); } + if (submapper == 15) + setmirror(((latche & 0x07) == 0x07) ? MI_V : MI_H); } void Mapper201_Init(CartInfo *info) { + if (info->CRC32 == 0x05658DED) + submapper = 15; Latch_Init(info, M201Sync, NULL, 0xFFFF, 0x8000, 0xFFFF, 0); } diff --git a/src/ines-correct.h b/src/ines-correct.h index 4a54218..3d9f059 100644 --- a/src/ines-correct.h +++ b/src/ines-correct.h @@ -294,7 +294,8 @@ {0xd871d3e6, 199, -1}, /* Dragon Ball Z 2 - Gekishin Freeza! (C) */ {0xed481b7c, 199, -1}, /* Dragon Ball Z Gaiden - Saiya Jin Zetsumetsu Keikaku (C) */ {0x44c20420, 199, -1}, /* San Guo Zhi 2 (C) */ - {0x4e1c1e3c, 206, 0}, /* Karnov */ + {0x44c20420, 199, -1}, /* San Guo Zhi 2 (C) */ + {0x05658DED, 201, -1}, /* 21-in-1 (CF-043) (2006-V) (Unl) [p1].nes, submapper 15 */ {0x276237b3, 206, 0}, /* Karnov */ {0xa5e6baf9, 206, 1}, /* Dragon Slayer 4 - Drasle Family (Japan) */ {0x4f2f1846, 206, 1}, /* Famista '89 - Kaimaku Han!! (J) */ diff --git a/src/ines.c b/src/ines.c index f0e2a8b..1d7f6dd 100644 --- a/src/ines.c +++ b/src/ines.c @@ -596,7 +596,7 @@ static BMAPPINGLocal bmap[] = { {(uint8_t*)"TW MMC3+VRAM Rev. E", 198, Mapper198_Init}, {(uint8_t*)"", 199, Mapper199_Init}, {(uint8_t*)"", 200, Mapper200_Init}, - {(uint8_t*)"", 201, Mapper201_Init}, + {(uint8_t*)"21-in-1", 201, Mapper201_Init}, {(uint8_t*)"", 202, Mapper202_Init}, {(uint8_t*)"", 203, Mapper203_Init}, {(uint8_t*)"", 204, Mapper204_Init},