diff --git a/src/boards/224.c b/src/boards/224.c new file mode 100644 index 0000000..8fd7a19 --- /dev/null +++ b/src/boards/224.c @@ -0,0 +1,50 @@ +/* FCEUmm - NES/Famicom Emulator + * + * Copyright notice for this file: + * Copyright (C) 2019 Libretro Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/* 2019-05-29 - Mapper 224, KT-008 + * iNES Mapper 224 is used for the 晶科泰 (Jncota) KT-008 PCB. + * It's an MMC3 clone that supports 1024 KiB of PRG-ROM through an additional + * outer bank register at $5000. + * http://wiki.nesdev.com/w/index.php/INES_Mapper_224 */ + +#include "mapinc.h" +#include "mmc3.h" + +static void M224PW(uint32 A, uint8 V) { + setprg8(A, V & 0x3f | (EXPREGS[0] << 4) & 0x40); +} + +static DECLFW(Mapper224Write) { + EXPREGS[0] = V; + FixMMC3PRG(MMC3_cmd); +} + +static void M224Power(void) { + EXPREGS[0] = 0; + GenMMC3Power(); + SetWriteHandler(0x5000, 0x5000, Mapper224Write); +} + +void Mapper224_Init(CartInfo *info) { + GenMMC3_Init(info, 1024, 0, 8, 0); + pwrap = M224PW; + info->Power = M224Power; + AddExState(EXPREGS, 1, 0, "EXPR"); +} diff --git a/src/ines-correct.h b/src/ines-correct.h index 3c0a31a..77c041f 100644 --- a/src/ines-correct.h +++ b/src/ines-correct.h @@ -318,6 +318,12 @@ {0x345ee51a, 245, -1}, /* DQ4c */ {0x57514c6c, 245, -1}, /* Yong Zhe Dou E Long - Dragon Quest VI (Ch) */ {0xdb9d71b7, 114, -1}, /* Super Donkey Kong (Unl) [o1] */ + + {0x61fc4d20, 224, 0}, /* Pokemon HeartGold (KT-008 PCB)(Ch)[!] */ + {0x4d735cb1, 224, 0}, /* Pokemon Platinum (KT-008 PCB)(Ch)[!] */ + {0x4f427110, 224, 0}, /* Pokemon Platinum Alt title 1 (KT-008 PCB)(Ch)[!] */ + {0xe001de16, 224, 0}, /* Pokemon Platinum Alt title 2 (KT-008 PCB)(Ch)[!] */ + {0x00000000, -1, -1} #endif diff --git a/src/ines.c b/src/ines.c index acec60f..ee468e6 100644 --- a/src/ines.c +++ b/src/ines.c @@ -613,7 +613,7 @@ static BMAPPINGLocal bmap[] = { {(uint8_t*)"UNLN625092", 221, UNLN625092_Init}, {(uint8_t*)"", 222, Mapper222_Init}, /* {(uint8_t*)"", 223, Mapper223_Init}, */ -/* {(uint8_t*)"", 224, Mapper224_Init}, */ + {(uint8_t*)"KT-008", 224, Mapper224_Init}, {(uint8_t*)"", 225, Mapper225_Init}, {(uint8_t*)"BMC 22+20-in-1", 226, Mapper226_Init}, {(uint8_t*)"", 227, Mapper227_Init}, diff --git a/src/ines.h b/src/ines.h index 61402c2..3e44574 100644 --- a/src/ines.h +++ b/src/ines.h @@ -201,6 +201,7 @@ void Mapper216_Init(CartInfo *); void Mapper217_Init(CartInfo *); void Mapper220_Init(CartInfo *); void Mapper222_Init(CartInfo *); +void Mapper224_Init(CartInfo *); void Mapper225_Init(CartInfo *); void Mapper226_Init(CartInfo *); void Mapper227_Init(CartInfo *);