From fd823c40212ffb58723f7edd95d3189b200a5000 Mon Sep 17 00:00:00 2001 From: negativeExponent Date: Wed, 29 Jan 2020 01:09:31 +0800 Subject: [PATCH] Add mapper 374 --- src/boards/mmc1.c | 26 ++++++++++++++++++++++++++ src/ines.c | 1 + src/ines.h | 1 + 3 files changed, 28 insertions(+) diff --git a/src/boards/mmc1.c b/src/boards/mmc1.c index f3ef3c1..fd6ca8c 100644 --- a/src/boards/mmc1.c +++ b/src/boards/mmc1.c @@ -443,3 +443,29 @@ void FARIDSLROM8IN1_Init(CartInfo *info) { AddExState(&lock, 1, 0, "LOCK"); AddExState(®, 1, 0, "REG6"); } + +/* ---------------------------- Mapper 374 -------------------------------- */ +/* 1995 Super HiK 4-in-1 - 新系列機器戰警组合卡 (JY-022) + * 1996 Super HiK 4-in-1 - 新系列超級飛狼組合卡 (JY-051) + */ +static uint8 game = 0; +static void M374PRG(uint32 A, uint8 V) { + setprg16(A, (V & 0x07) | (game << 3)); +} + +static void M374CHR(uint32 A, uint8 V) { + setchr4(A, (V & 0x1F) | (game << 5)); +} + +static void M374Reset(void) { + game = (game + 1) & 3; + MMC1CMReset(); +} + +void Mapper374_Init(CartInfo *info) { + GenMMC1Init(info, 128, 128, 0, 0); + MMC1CHRHook4 = M374CHR; + MMC1PRGHook16 = M374PRG; + info->Reset = M374Reset; + AddExState(&game, 1, 0, "GAME"); +} \ No newline at end of file diff --git a/src/ines.c b/src/ines.c index 0866d2b..9cfa5a3 100644 --- a/src/ines.c +++ b/src/ines.c @@ -663,6 +663,7 @@ static BMAPPINGLocal bmap[] = { {(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*)"95/96 Super HiK 4-in-1", 374, Mapper374_Init }, {(uint8_t*)"KN-42", 381, Mapper381_Init }, {(uint8_t*)"60-1064-16L (FDS)", 538, Mapper538_Init }, {(uint8_t*)"LittleCom 160-in-1", 541, Mapper541_Init }, diff --git a/src/ines.h b/src/ines.h index ad42db6..f9b8814 100644 --- a/src/ines.h +++ b/src/ines.h @@ -246,6 +246,7 @@ void J2282_Init(CartInfo *); void Mapper288_Init(CartInfo *); void Mapper357_Init(CartInfo *); void Mapper372_Init(CartInfo *); +void Mapper374_Init(CartInfo *); void Mapper381_Init(CartInfo *); void Mapper538_Init(CartInfo *); void Mapper541_Init(CartInfo *);