diff --git a/src/boards/addrlatch.c b/src/boards/addrlatch.c index a1d1dfd..9aa62ed 100644 --- a/src/boards/addrlatch.c +++ b/src/boards/addrlatch.c @@ -472,6 +472,36 @@ void Mapper242_Init(CartInfo *info) { Latch_Init(info, M242Sync, NULL, 0x0000, 0x8000, 0xFFFF, 1); } +/*------------------ Map 288 ---------------------------*/ +/* NES 2.0 Mapper 288 is used for two GKCX1 21-in-1 multicarts + * - 21-in-1 (GA-003) + * - 64-in-1 (CF-015) + */ +static void M288Sync(void) { + setchr8(latche & 7); + setprg32(0x8000, (latche >> 3) & 3); +} + +static DECLFR(M288Read) { + uint8 ret = CartBR(A); + if (latche & 0x20) + ret |= (dipswitch << 2); + return ret; +} + +static void M288Reset(void) { + dipswitch++; + dipswitch &= 3; + M288Sync(); +} + +void Mapper288_Init(CartInfo *info) { + dipswitch = 0; + Latch_Init(info, M288Sync, M288Read, 0x0000, 0x8000, 0xFFFF, 0); + info->Reset = M288Reset; + AddExState(&dipswitch, 1, 0, "DIPSW"); +} + /*------------------ Map 541 ---------------------------*/ /* LittleCom 160-in-1 multicart */ static void M541Sync(void) { diff --git a/src/ines.c b/src/ines.c index e9f058d..0866d2b 100644 --- a/src/ines.c +++ b/src/ines.c @@ -660,6 +660,7 @@ static BMAPPINGLocal bmap[] = { {(uint8_t*)"HUMMER/JY-052", 281, Mapper281_Init}, {(uint8_t*)"GN-45", 366, GN45_Init}, + {(uint8_t*)"GKCX1", 288, Mapper288_Init }, {(uint8_t*)"Bit Corp 4-in-1", 357, Mapper357_Init }, {(uint8_t*)"MMC3 PIRATE SFC-12", 372, Mapper372_Init }, {(uint8_t*)"KN-42", 381, Mapper381_Init }, diff --git a/src/ines.h b/src/ines.h index 2047761..ad42db6 100644 --- a/src/ines.h +++ b/src/ines.h @@ -243,6 +243,7 @@ void Bs5652_Init(CartInfo *); void NC7000M_Init(CartInfo *); void J2282_Init(CartInfo *); +void Mapper288_Init(CartInfo *); void Mapper357_Init(CartInfo *); void Mapper372_Init(CartInfo *); void Mapper381_Init(CartInfo *);