diff --git a/src/boards/177.c b/src/boards/177.c index bc87196..38828f8 100644 --- a/src/boards/177.c +++ b/src/boards/177.c @@ -59,6 +59,11 @@ static void M177Close(void) { WRAM = NULL; } +static void M177Reset(void) { + reg = 0; + Sync(); +} + static void StateRestore(int version) { Sync(); } @@ -66,6 +71,7 @@ static void StateRestore(int version) { void Mapper177_Init(CartInfo *info) { info->Power = M177Power; info->Close = M177Close; + info->Reset = M177Reset; GameStateRestore = StateRestore; WRAMSIZE = 8192; diff --git a/src/boards/36.c b/src/boards/36.c index 9ffed93..afc1c87 100644 --- a/src/boards/36.c +++ b/src/boards/36.c @@ -1,7 +1,8 @@ -/* FCE Ultra - NES/Famicom Emulator +/* FCEUmm - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2012 CaH4e3 + * 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 @@ -18,38 +19,65 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * TXC/Micro Genius simplified mapper + * updated 06-2019 http://wiki.nesdev.com/w/index.php/INES_Mapper_036 + * + * Known games: + * - Strike Wolf (Asia) (Unl) + * - Policeman (Gluk Video) (unl) + * - F-15 City War (Spain) (Gluk Video) (Unl) */ #include "mapinc.h" -static uint8 latche; +static uint8 regs[5]; static SFORMAT StateRegs[] = { - { &latche, 1, "LATC" }, + { regs, 5, "REGS" }, { 0 } }; static void Sync(void) { - setprg32(0x8000, latche >> 4); - setchr8(latche & 0xf); + setprg32(0x8000, regs[0] >> 4); + setchr8(regs[4] & 0x0F); } -static DECLFW(M36Write) { - latche = V; +static DECLFW(M36Write4100) { + switch(A & 0xE103) { + case 0x4100: + if(regs[3] & 0x10) + regs[0]++; + else + regs[0] = regs[2]; + break; + case 0x4101: + case 0x4102: + case 0x4103: + regs[A & 0x03] = V; + break; + } +} + +static DECLFW(M36Write4200) { + regs[4] = V; + Sync(); +} + +static DECLFW(M36WriteHi) { Sync(); } static DECLFR(M36Read) { - return latche; /* Need by Strike Wolf, being simplified mapper, this cart still uses some TCX mapper features andrely on it */ + return ((X.DB & 0xCF) | (regs[0] & 0x30)); } static void M36Power(void) { - latche = 0; Sync(); SetReadHandler(0x4100, 0x4100, M36Read); SetReadHandler(0x8000, 0xFFFF, CartBR); - SetWriteHandler(0x8000, 0xFFFE, M36Write); /* Actually, BUS conflict there preventing from triggering the wrong banks */ + SetWriteHandler(0x4100, 0x4103, M36Write4100); + SetWriteHandler(0x4200, 0x4200, M36Write4200); + SetWriteHandler(0x8000, 0xFFFF, M36WriteHi); } static void M36Restore(int version) { diff --git a/src/boards/addrlatch.c b/src/boards/addrlatch.c index 7bda0c1..ee18af9 100644 --- a/src/boards/addrlatch.c +++ b/src/boards/addrlatch.c @@ -541,3 +541,36 @@ static void BMCG146Sync(void) { void BMCG146_Init(CartInfo *info) { Latch_Init(info, BMCG146Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0); } + +/*-------------- BMC-TJ-03 ------------------------*/ +/* NES 2.0 mapper 341 is used for a simple 4-in-1 multicart */ + +static void BMCTJ03Sync(void) { + uint8 mirr = ((latche >> 1) & 1) ^ 1; + uint8 bank = (latche >> 8) & 7; + + setprg32(0x8000, bank); + setchr8(bank); + + if (bank == 3) mirr ^= 1; /* Twin Bee has incorrect mirroring */ + SetupCartMirroring(mirr, 1, NULL); +} + +void BMCTJ03_Init(CartInfo *info) { + Latch_Init(info, BMCTJ03Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0); +} + +/*-------------- BMC-SA005-A ------------------------*/ +/* NES 2.0 mapper 338 is used for a 16-in-1 and a 200/300/600/1000-in-1 multicart. + * http://wiki.nesdev.com/w/index.php/NES_2.0_Mapper_338 */ + +static void BMCSA005ASync(void) { + setprg16(0x8000, latche & 0x0F); + setprg16(0xC000, latche & 0x0F); + setchr8(latche & 0x0F); + SetupCartMirroring((latche >> 3) & 1, 1, NULL); +} + +void BMCSA005A_Init(CartInfo *info) { + Latch_Init(info, BMCSA005ASync, NULL, 0x0000, 0x8000, 0xFFFF, 0); +} diff --git a/src/boards/bcmk3006.c b/src/boards/bcmk3006.c new file mode 100644 index 0000000..ab3e539 --- /dev/null +++ b/src/boards/bcmk3006.c @@ -0,0 +1,70 @@ +/* FCEUmm - NES/Famicom Emulator + * + * 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 + * + */ + +/* NES 2.0 mapper 339 is used for a 21-in-1 multicart. + * Its UNIF board name is BMC-K-3006. + * http://wiki.nesdev.com/w/index.php/NES_2.0_Mapper_339 + */ + +#include "mapinc.h" +#include "mmc3.h" + +static void BMCK3006CW(uint32 A, uint8 V) { + setchr1(A, (V & 0x7F) | (EXPREGS[0] & 0x18) << 4); +} + +static void BMCK3006PW(uint32 A, uint8 V) { + if (EXPREGS[0] & 0x20) { /* MMC3 mode */ + setprg8(A, (V & 0x0F) | (EXPREGS[0] & 0x18) << 1); + } else { + if ((EXPREGS[0] & 0x07) == 0x06) { /* NROM-256 */ + setprg32(0x8000, (EXPREGS[0] >> 1) & 0x0F); + } else { /* NROM-128 */ + setprg16(0x8000, EXPREGS[0] & 0x1F); + setprg16(0xC000, EXPREGS[0] & 0x1F); + } + } +} + +static DECLFW(BMCK3006Write) { + EXPREGS[0] = A & 0x3F; + FixMMC3PRG(MMC3_cmd); + FixMMC3CHR(MMC3_cmd); +} + +static void BMCK3006Reset(void) { + EXPREGS[0] = 0; + MMC3RegReset(); +} + +static void BMCK3006Power(void) { + EXPREGS[0] = 0; + GenMMC3Power(); + SetWriteHandler(0x6000, 0x7FFF, BMCK3006Write); +} + +void BMCK3006_Init(CartInfo *info) { + GenMMC3_Init(info, 512, 512, 8, 0); + pwrap = BMCK3006PW; + cwrap = BMCK3006CW; + info->Power = BMCK3006Power; + info->Reset = BMCK3006Reset; + AddExState(EXPREGS, 1, 0, "EXPR"); +} diff --git a/src/boards/bmc830425C4391t.c b/src/boards/bmc830425C4391t.c new file mode 100644 index 0000000..db18618 --- /dev/null +++ b/src/boards/bmc830425C4391t.c @@ -0,0 +1,101 @@ +/* FCEUmm - NES/Famicom Emulator + * + * 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 + * + */ + +/* NES 2.0 Mapper 320 is used for the Super HiK 6-in-1 A-030 multicart. + * Basically UxROM with an address-latch-based outer bank register. + * UNIF board name is BMC-830425C-4391T. Mirroring is hard-wired. + * http://wiki.nesdev.com/w/index.php/NES_2.0_Mapper_320 + */ + +#include "mapinc.h" + +static uint8 regs[2]; +static uint8 isMermaid = 0; + +static SFORMAT StateRegs[] = +{ + { regs, 2, "REGS" }, + { &isMermaid, 1, "MERM" }, + { 0 } +}; + +static void Sync(void) { + uint8 bank_size = (regs[0] & 0x80) ? 0x07: 0x0F; + uint8 outer_bank = !isMermaid ? (regs[0] & 0x78) : 0x04; + uint8 inner_bank = regs[1]; + uint8 game_block = regs[0] & 0x78; + + /* TODO: Hacky and forced mapping of outer banks(game block)... */ + if (!isMermaid) { + switch(game_block) { + case 0x00: /* botb outerbank=0 */ + case 0x10: /* rocketeer outerbank=1 */ + case 0x20: /* contra outerbank=2 */ + case 0x28: /* ducktales outerbank=3 */ + case 0x38: /* school fight outerbank=5 */ + outer_bank = (game_block >> 4) + ((game_block & 0x08) ? 0x01 : 0x00); + outer_bank |= (game_block >> 3) & 1; + break; + case 0x30: + /* Mermaid game block is tricky (to me at least). Aim here is + * when this register is selected, ignore any other outer bank reg changes */ + isMermaid = 1; + outer_bank = 0x04; + break; + } + } + + setprg16r(outer_bank, 0x8000, (inner_bank & bank_size)); + setprg16r(outer_bank, 0xC000, bank_size); + setchr8(0); +} + +static DECLFW(M320Write) { + if ((A & 0xF0E0) == 0xF0E0) { + regs[0] = (A & 0x1F) << 3; + } + regs[1] = V & 0x0F; + Sync(); +} + +static void M320Power(void) { + regs[0] = regs[1] = 0; + isMermaid = 0; + Sync(); + SetReadHandler(0x8000, 0xFFFF, CartBR); + SetWriteHandler(0x8000, 0xFFFF, M320Write); +} + +static void M320Reset(void) { + regs[0] = regs[1] = 0; + isMermaid = 0; + Sync(); +} + +static void StateRestore(int version) { + Sync(); +} + +void BMC830425C4391T_Init(CartInfo *info) { + info->Power = M320Power; + info->Reset = M320Reset; + GameStateRestore = StateRestore; + AddExState(&StateRegs, ~0, 0, 0); +} diff --git a/src/boards/bmcctc09.c b/src/boards/bmcctc09.c new file mode 100644 index 0000000..185576c --- /dev/null +++ b/src/boards/bmcctc09.c @@ -0,0 +1,74 @@ +/* FCEUmm - NES/Famicom Emulator + * + * 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 + * + */ + +/* NES 2.0 mapper 335 is used for a 10-in-1 multicart. + * Its UNIF board name is BMC-CTC-09. + * http://wiki.nesdev.com/w/index.php/NES_2.0_Mapper_335 */ + +#include "mapinc.h" + +#define PRG 0 +#define CHR 1 + +static uint8 regs[2]; + +static SFORMAT StateRegs[] = +{ + { regs, 2, "REGS" }, + { 0 } +}; + +static void Sync(void) { + if (regs[PRG] & 0x10) { + setprg16(0x8000, ((regs[PRG] & 0x07) << 1) | ((regs[PRG] >> 3) & 1)); + setprg16(0xC000, ((regs[PRG] & 0x07) << 1) | ((regs[PRG] >> 3) & 1)); + } else + setprg32(0x8000, regs[PRG] & 0x07); + + setchr8(regs[CHR] & 0x0F); + SetupCartMirroring(((regs[PRG] >> 5) & 1) ^ 1, 1, NULL); +} + +static DECLFW(WritePRG) { + regs[PRG] = V; + Sync(); +} + +static DECLFW(WriteCHR) { + regs[CHR] = V; + Sync(); +} + +static void BMCCTC09Power(void) { + Sync(); + SetReadHandler(0x8000, 0xFFFF, CartBR); + SetWriteHandler(0x8000, 0xBFFF, WriteCHR); + SetWriteHandler(0xC000, 0xFFFF, WritePRG); +} + +static void StateRestore(int version) { + Sync(); +} + +void BMCCTC09_Init(CartInfo *info) { + info->Power = BMCCTC09Power; + GameStateRestore = StateRestore; + AddExState(&StateRegs, ~0, 0, 0); +} diff --git a/src/boards/bmck3036.c b/src/boards/bmck3036.c new file mode 100644 index 0000000..2e716e0 --- /dev/null +++ b/src/boards/bmck3036.c @@ -0,0 +1,75 @@ +/* FCEUmm - NES/Famicom Emulator + * + * 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 + * + */ + +/* NES 2.0 mapper 340 is used for a 35-in-1 multicart. + * Its UNIF board name is BMC-K-3036. + * http://wiki.nesdev.com/w/index.php/NES_2.0_Mapper_340 + * TODO: Some games are not working... + */ + +#include "mapinc.h" + +static uint8 regs[2]; + +static SFORMAT StateRegs[] = +{ + { regs, 2, "REGS" }, + { 0 } +}; + +static void Sync(void) { + if (regs[0] & 0x20) { /* NROM-128 */ + setprg16(0x8000, regs[0] & 0x1F); + setprg16(0xC000, regs[0] & 0x1F); + } else { /* UNROM */ + setprg16(0x8000, regs[0] & 0x1F | regs[1] & 0x07); + setprg16(0xC000, regs[0] & 0x1F | 0x07); + } + setchr8(0); + SetupCartMirroring(((regs[0] & 0x25) == 0x25 ? MI_H : MI_V), 1, NULL); +} + +static DECLFW(M340Write) { + regs[0] = A & 0xFF; + regs[1] = V & 0xFF; + Sync(); +} + +static void BMCK3036Power(void) { + Sync(); + SetReadHandler(0x8000, 0xFFFF, CartBR); + SetWriteHandler(0x8000, 0xBFFF, M340Write); +} + +static void BMCK3036Reset(void) { + regs[0] = regs[1] = 0; + Sync(); +} + +static void StateRestore(int version) { + Sync(); +} + +void BMCK3036_Init(CartInfo *info) { + info->Power = BMCK3036Power; + info->Reset = BMCK3036Reset; + GameStateRestore = StateRestore; + AddExState(&StateRegs, ~0, 0, 0); +} diff --git a/src/boards/coolboy.c b/src/boards/coolboy.c index b0f8649..5482550 100644 --- a/src/boards/coolboy.c +++ b/src/boards/coolboy.c @@ -42,7 +42,7 @@ static void COOLBOYCW(uint32 A, uint8 V) { } } /* Highest bit goes from MMC3 registers when EXPREGS[3]&0x80==0 or from EXPREGS[0]&0x08 otherwise */ - setchr1(A, + setchr1(A, (V & 0x80 & mask) | ((((EXPREGS[0] & 0x08) << 4) & ~mask)) /* 7th bit */ | ((EXPREGS[2] & 0x0F) << 3) /* 6-3 bits */ | ((A >> 10) & 7) /* 2-0 bits */ @@ -107,7 +107,7 @@ static DECLFW(COOLBOYWrite) { CartBW(A,V); /* Deny any further writes when 7th bit is 1 AND 4th is 0 */ - if ((EXPREGS[3] & 0x90) != 0x80) { + if ((EXPREGS[3] & 0x90) != 0x80) { EXPREGS[A & 3] = V; FixMMC3PRG(MMC3_cmd); FixMMC3CHR(MMC3_cmd); @@ -150,3 +150,27 @@ void COOLBOY_Init(CartInfo *info) { info->Reset = COOLBOYReset; AddExState(EXPREGS, 4, 0, "EXPR"); } + +/*------------------ MINDKIDS ---------------------------*/ +/* A COOLBOY variant that works identically but puts the outer bank registers + * in the $5xxx range instead of the $6xxx range. + * The UNIF board name is MINDKIDS (submapper 1). + * http://wiki.nesdev.com/w/index.php/NES_2.0_Mapper_268 + */ + +static void MINDKIDSPower(void) { + GenMMC3Power(); + EXPREGS[0] = EXPREGS[1] = EXPREGS[2] = EXPREGS[3] = 0; + FixMMC3PRG(MMC3_cmd); + FixMMC3CHR(MMC3_cmd); + SetWriteHandler(0x5000, 0x5fff, COOLBOYWrite); +} + +void MINDKIDS_Init(CartInfo *info) { + GenMMC3_Init(info, 2048, 256, 8, info->battery); + pwrap = COOLBOYPW; + cwrap = COOLBOYCW; + info->Power = MINDKIDSPower; + info->Reset = COOLBOYReset; + AddExState(EXPREGS, 4, 0, "EXPR"); +} diff --git a/src/boards/datalatch.c b/src/boards/datalatch.c index 4a563f3..1846bb7 100644 --- a/src/boards/datalatch.c +++ b/src/boards/datalatch.c @@ -527,3 +527,17 @@ static void BMC11160Sync(void) { void BMC11160_Init(CartInfo *info) { Latch_Init(info, BMC11160Sync, 0, 0x8000, 0xFFFF, 0, 0); } + +/*------------------ BMC-K-3046 ---------------------------*/ +/* NES 2.0 mapper 336 is used for an 11-in-1 multicart + * http://wiki.nesdev.com/w/index.php/NES_2.0_Mapper_336 */ + +static void BMCK3046Sync(void) { + setprg16(0x8000, latche); + setprg16(0xC000, latche | 0x07); + setchr8(0); +} + +void BMCK3046_Init(CartInfo *info) { + Latch_Init(info, BMCK3046Sync, 0, 0x8000, 0xFFFF, 0, 0); +} diff --git a/src/boards/lh51.c b/src/boards/lh51.c new file mode 100644 index 0000000..3236485 --- /dev/null +++ b/src/boards/lh51.c @@ -0,0 +1,87 @@ +/* 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 + */ + +/* FDS Conversion + * NES 2.0 Mapper 309 is used for Whirlwind Manu's ROM cartridge conversion + * of game 愛戦士ニコル (Ai Senshi Nicol, cartridge code LH51). + * Its UNIF board name is UNL-LH51. + * https://wiki.nesdev.com/w/index.php/NES_2.0_Mapper_309 + */ + +#include "mapinc.h" + +static uint8 reg, mirr; +static uint8 *WRAM = NULL; +static uint32 WRAMSIZE; + +static SFORMAT StateRegs[] = +{ + { ®, 1, "REG" }, + { &mirr, 1, "MIRR" }, + { 0 } +}; + +static void Sync(void) { + setchr8(0); + setprg8r(0x10, 0x6000, 0); + setprg8(0x8000, reg & 0x0F); + setprg8(0xA000, 13); + setprg8(0xC000, 14); + setprg8(0xE000, 15); + setmirror(((mirr >> 3) & 1) ^ 1); +} + +static DECLFW(LH51Write) { + switch (A & 0xF000) { + case 0x8000: reg = V; Sync(); break; + case 0xF000: mirr = V; Sync(); break; + } +} + +static void LH51Power(void) { + Sync(); + SetReadHandler(0x6000, 0xFFFF, CartBR); + SetWriteHandler(0x6000, 0x7FFF, CartBW); + SetWriteHandler(0x8000, 0xFFFF, LH51Write); + FCEU_CheatAddRAM(WRAMSIZE >> 10, 0x6000, WRAM); +} + +static void LH51Close(void) { + if (WRAM) + FCEU_gfree(WRAM); + WRAM = NULL; +} + +static void StateRestore(int version) { + Sync(); +} + +void LH51_Init(CartInfo *info) { + info->Power = LH51Power; + info->Close = LH51Close; + GameStateRestore = StateRestore; + + WRAMSIZE = 8192; + WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE); + SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1); + AddExState(WRAM, WRAMSIZE, 0, "WRAM"); + + AddExState(&StateRegs, ~0, 0, 0); +} diff --git a/src/boards/mmc1.c b/src/boards/mmc1.c index 5a4d343..4dc4f69 100644 --- a/src/boards/mmc1.c +++ b/src/boards/mmc1.c @@ -36,13 +36,17 @@ static uint8 *WRAM = NULL; static uint8 *CHRRAM = NULL; static int is155, is171; +static uint8 MMC1WRAMEnabled(void) { + return !(DRegs[3] & 0x10); +} + static DECLFW(MBWRAM) { - if (!(DRegs[3] & 0x10) || is155) + if (MMC1WRAMEnabled() || is155) Page[A >> 11][A] = V; /* WRAM is enabled. */ } static DECLFR(MAWRAM) { - if ((DRegs[3] & 0x10) && !is155) + if (!MMC1WRAMEnabled() && !is155) return X.DB; /* WRAM is disabled */ return(Page[A >> 11][A]); } @@ -395,4 +399,47 @@ void SOROM_Init(CartInfo *info) { GenMMC1Init(info, 256, 0, 16, info->battery); } +/* ----------------------- FARID_SLROM_8-IN-1 -----------------------*/ +/* NES 2.0 Mapper 323 - UNIF FARID_SLROM_8-IN-1 */ + +static uint8 reg, lock; + +static void FARIDSLROM8IN1PRGHook(uint32 A, uint8 V) { + setprg16(A, (V & 0x07) | (reg << 3)); +} + +static void FARIDSLROM8IN1CHRHook(uint32 A, uint8 V) { + setchr4(A, (V & 0x1F) | (reg << 5)); +} + +static DECLFW(FARIDSLROM8IN1Write) { + if (MMC1WRAMEnabled() && !lock) { + lock = (V & 0x08) >> 3; + reg = (V & 0xF0) >> 4; + MMC1MIRROR(); + MMC1CHR(); + MMC1PRG(); + } +} + +static void FARIDSLROM8IN1Power(void) { + reg = lock = 0; + GenMMC1Power(); + SetWriteHandler(0x6000, 0x7FFF, FARIDSLROM8IN1Write); +} + +static void FARIDSLROM8IN1Reset(void) { + reg = lock = 0; + MMC1CMReset(); +} + +void FARIDSLROM8IN1_Init(CartInfo *info) { + GenMMC1Init(info, 1024, 256, 8, 0); + MMC1CHRHook4 = FARIDSLROM8IN1CHRHook; + MMC1PRGHook16 = FARIDSLROM8IN1PRGHook; + info->Power = FARIDSLROM8IN1Power; + info->Reset = FARIDSLROM8IN1Reset; + AddExState(lock, 1, 0, "LOCK"); + AddExState(reg, 1, 0, "REG6"); +} diff --git a/src/boards/resetnromxin1.c b/src/boards/resetnromxin1.c new file mode 100644 index 0000000..c97837d --- /dev/null +++ b/src/boards/resetnromxin1.c @@ -0,0 +1,86 @@ +/* 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 + */ + +/* BMC-RESETNROM-XIN1 + * - Sheng Tian 2-in-1(Unl,ResetBase)[p1] - Kung Fu (Spartan X), Super Mario Bros (alt) + * - Sheng Tian 2-in-1(Unl,ResetBase)[p2] - B-Wings, Twin-bee + * + * BMC-KS106C + * - Kaiser 4-in-1(Unl,KS106C)[p1] - B-Wings, Kung Fu, 1942, SMB1 (wrong mirroring) + */ + +#include "mapinc.h" + +static uint8 gameblock, limit; + +static SFORMAT StateRegs[] = +{ + { &gameblock, 1, "GAME" }, + { 0 } +}; + +static void Sync(void) { + setchr8r(gameblock, 0); + setprg32r(gameblock, 0x8000, 0); +} + +static void BMCRESETNROMXIN1Power(void) { + gameblock = 0; + Sync(); + SetReadHandler(0x8000, 0xFFFF, CartBR); +} + +static void BMCRESETNROMXIN1Reset(void) { + gameblock++; + gameblock &= limit; + Sync(); +} + +static void StateRestore(int version) { + Sync(); +} + +void BMCRESETNROMXIN1_Init(CartInfo *info) { + uint8 x; + uint64 partialmd5; + + for (x = 0; x < 8; x++) + partialmd5 |= (uint64)info->MD5[15 - x] << (x * 8); + + /* Mirroring override - these boards have incorrect mirroring for some reasons in their headers */ + if (partialmd5 == 0x616851e56946893bLL) /* Sheng Tian 2-in-1(Unl,ResetBase)[p1].unf */ + SetupCartMirroring(1, 1, NULL); + else if (partialmd5 == 0x4cd729b5ae23a3cfLL) /* Sheng Tian 2-in-1(Unl,ResetBase)[p2].unf */ + SetupCartMirroring(0, 1, NULL); + + limit = 0x01; + info->Power = BMCRESETNROMXIN1Power; + info->Reset = BMCRESETNROMXIN1Reset; + GameStateRestore = StateRestore; + AddExState(&StateRegs, ~0, 0, 0); +} + +void BMCKS106C_Init(CartInfo *info) { + limit = 0x03; + info->Power = BMCRESETNROMXIN1Power; + info->Reset = BMCRESETNROMXIN1Reset; + GameStateRestore = StateRestore; + AddExState(&StateRegs, ~0, 0, 0); +} diff --git a/src/boards/resettxrom.c b/src/boards/resettxrom.c new file mode 100644 index 0000000..fdf1d1b --- /dev/null +++ b/src/boards/resettxrom.c @@ -0,0 +1,57 @@ +/* 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 + */ + +/* NES 2.0 Mapper 313 is used for MMC3-based multicarts that switch + * between 128 KiB PRG-ROM/128 KiB CHR-ROM-sized games on each reset and + * thus require no additional registers. + * Its UNIF board name is BMC-RESET-TXROM. + */ + +#include "mapinc.h" +#include "mmc3.h" + +static void M313CW(uint32 A, uint8 V) { + setchr1r(EXPREGS[0], A, V & 0x7F); +} + +static void M313PW(uint32 A, uint8 V) { + setprg8r(EXPREGS[0], A, V & 0x0F); +} + +static void M313Reset(void) { + EXPREGS[0]++; + EXPREGS[0] &= 0x03; + MMC3RegReset(); +} + +static void M313Power(void) { + EXPREGS[0] = 0; + GenMMC3Power(); +} + +/* NES 2.0 313, UNIF BMC-RESET-TXROM */ +void BMCRESETTXROM_Init(CartInfo *info) { + GenMMC3_Init(info, 512, 256, 0, 0); + cwrap = M313CW; + pwrap = M313PW; + info->Power = M313Power; + info->Reset = M313Reset; + AddExState(EXPREGS, 1, 0, "EXPR"); +} diff --git a/src/boards/vrc2and4.c b/src/boards/vrc2and4.c index 7ff7ce7..b26d804 100644 --- a/src/boards/vrc2and4.c +++ b/src/boards/vrc2and4.c @@ -158,14 +158,20 @@ static DECLFW(M23Write) { VRC24Write(A, V); } -static void M21Power(void) { +static void VRC24PowerCommon(void (*WRITEFUNC)(uint32 A, uint8 V)) { Sync(); - setprg8r(0x10, 0x6000, 0); + setprg8r(0x10, 0x6000, 0); /* Only two Goemon games are have battery backed RAM, three more shooters + * (Parodius Da!, Gradius 2 and Crisis Force uses 2k or SRAM at 6000-67FF only + */ SetReadHandler(0x6000, 0x7FFF, CartBR); SetWriteHandler(0x6000, 0x7FFF, CartBW); - FCEU_CheatAddRAM(WRAMSIZE >> 10, 0x6000, WRAM); SetReadHandler(0x8000, 0xFFFF, CartBR); - SetWriteHandler(0x8000, 0xFFFF, M21Write); + SetWriteHandler(0x8000, 0xFFFF, WRITEFUNC); + FCEU_CheatAddRAM(WRAMSIZE >> 10, 0x6000, WRAM); +} + +static void M21Power(void) { + VRC24PowerCommon(M21Write); } static void M22Power(void) { @@ -176,26 +182,12 @@ static void M22Power(void) { static void M23Power(void) { big_bank = 0x20; - Sync(); - setprg8r(0x10, 0x6000, 0); /* Only two Goemon games are have battery backed RAM, three more shooters - * (Parodius Da!, Gradius 2 and Crisis Force uses 2k or SRAM at 6000-67FF only - */ - SetReadHandler(0x6000, 0x7FFF, CartBR); - SetWriteHandler(0x6000, 0x7FFF, CartBW); - SetReadHandler(0x8000, 0xFFFF, CartBR); - SetWriteHandler(0x8000, 0xFFFF, M23Write); - FCEU_CheatAddRAM(WRAMSIZE >> 10, 0x6000, WRAM); + VRC24PowerCommon(M23Write); } static void M25Power(void) { big_bank = 0x20; - Sync(); - setprg8r(0x10, 0x6000, 0); - SetReadHandler(0x6000, 0x7FFF, CartBR); - SetWriteHandler(0x6000, 0x7FFF, CartBW); - SetReadHandler(0x8000, 0xFFFF, CartBR); - SetWriteHandler(0x8000, 0xFFFF, M22Write); - FCEU_CheatAddRAM(WRAMSIZE >> 10, 0x6000, WRAM); + VRC24PowerCommon(M22Write); } void FP_FASTAPASS(1) VRC24IRQHook(int a) { @@ -279,3 +271,99 @@ void UNLT230_Init(CartInfo *info) { info->Power = M23Power; VRC24_Init(info); } + +/* -------------------- UNL-TH2131-1 -------------------- */ +/* https://wiki.nesdev.com/w/index.php/NES_2.0_Mapper_308 + * NES 2.0 Mapper 308 is used for a bootleg version of the Sunsoft game Batman + * similar to Mapper 23 Submapper 3) with custom IRQ functionality. + * UNIF board name is UNL-TH2131-1. + */ + +static DECLFW(TH2131Write) { + switch (A & 0xF003) { + case 0xF000: X6502_IRQEnd(FCEU_IQEXT); IRQa = 0; IRQCount = 0; break; + case 0xF001: IRQa = 1; break; + case 0xF003: IRQLatch = (V & 0xF0) >> 4; break; + } +} + +void FP_FASTAPASS(1) TH2131IRQHook(int a) { + int count; + + if (!IRQa) + return; + + for (count = 0; count < a; count++) { + IRQCount++; + if ((IRQCount & 0x0FFF) == 2048) + IRQLatch--; + if (!IRQLatch && (IRQCount & 0x0FFF) < 2048) + X6502_IRQBegin(FCEU_IQEXT); + } +} + +static void TH2131Power(void) { + VRC24PowerCommon(VRC24Write); + SetWriteHandler(0xF000, 0xFFFF, TH2131Write); +} + +void UNLTH21311_Init(CartInfo *info) { + info->Power = TH2131Power; + VRC24_Init(info); + MapIRQHook = TH2131IRQHook; +} + +/* -------------------- UNL-KS7021A -------------------- */ +/* http://wiki.nesdev.com/w/index.php/NES_2.0_Mapper_525 + * NES 2.0 Mapper 525 is used for a bootleg version of versions of Contra and 月風魔伝 (Getsu Fūma Den). + * Its similar to Mapper 23 Submapper 3) with non-nibblized CHR-ROM bank registers. + */ + +static DECLFW(KS7021AWrite) { + switch (A & 0xB000) { + case 0xB000: chrreg[A & 0x07] = V; Sync(); break; + } +} + +static void KS7021APower(void) { + VRC24PowerCommon(VRC24Write); + SetWriteHandler(0xB000, 0xBFFF, KS7021AWrite); +} + +void UNLKS7021A_Init(CartInfo *info) { + info->Power = KS7021APower; + VRC24_Init(info); +} + +/* -------------------- BTL-900218 -------------------- */ +/* http://wiki.nesdev.com/w/index.php/UNIF/900218 + * NES 2.0 Mapper 524 describes the PCB used for the pirate port Lord of King or Axe of Fight. + * UNIF board name is BTL-900218. + */ + +static DECLFW(BTL900218Write) { + switch (A & 0xF00C) { + case 0xF008: IRQa = 1; break; + case 0xF00C: X6502_IRQEnd(FCEU_IQEXT); IRQa = 0; IRQCount = 0; break; + } +} + +void FP_FASTAPASS(1) BTL900218IRQHook(int a) { + if (!IRQa) + return; + + IRQCount += a; + if (IRQCount & 1024) + X6502_IRQBegin(FCEU_IQEXT); +} + +static void BTL900218Power(void) { + VRC24PowerCommon(VRC24Write); + SetWriteHandler(0xF000, 0xFFFF, BTL900218Write); +} + +void BTL900218_Init(CartInfo *info) { + info->Power = BTL900218Power; + VRC24_Init(info); + MapIRQHook = BTL900218IRQHook; +} diff --git a/src/ines-correct.h b/src/ines-correct.h index fd6a6c0..e26aa65 100644 --- a/src/ines-correct.h +++ b/src/ines-correct.h @@ -49,7 +49,7 @@ {0x52ab2d17, 1, 8}, /* Toukyou Pachi-Slot Adventure (Japan) (Rev 0) */ {0x934db14a, 1, -1},/* All-Pro Basketball */ {0xf74dfc91, 1, -1},/* Win, Lose, or Draw */ - {0xe6a477b2, 2, 0}, /* 3-D WorldRunner (USA) */ + {0xe6a477b2, 2, 1}, /* 3-D WorldRunner (USA) */ {0x9ea1dc76, 2, 0}, /* Rainbow Islands */ {0x6d65cac6, 2, 0}, /* Terra Cresta */ {0xe1b260da, 2, 1}, /* Argos no Senshi */ @@ -79,7 +79,7 @@ {0xbc065fc3, 3, 1}, /* Pipe Dream */ {0xc9ee15a7, 3, -1}, /* 3 is probably best. 41 WILL NOT WORK. */ {0x97b6cb19, 4, -1},/* Aladdin (SuperGame) (Mapper 4) [!] */ - {0xd97c31b0, 4, 1}, /* Rasaaru Ishii no Childs Quest (J) */ + {0xd97c31b0, 206, 1}, /* Rasaaru Ishii no Childs Quest (J) */ {0x404b2e8b, 4, 2}, /* Rad Racer 2 */ {0x15141401, 4, 8}, /* Asmik Kun Land */ {0x4cccd878, 4, 8}, /* Cat Ninden Teyandee */ @@ -116,24 +116,36 @@ {0x5555fca3, 32, 8}, {0x283ad224, 32, 8}, /* Ai Sensei no Oshiete */ {0x243a8735, 32, 0x10|4}, /* Major League */ - {0xbc7b1d0f, 33, -1}, /* Bakushou!! Jinsei Gekijou 2 (J) [!] */ + {0x8a7d0abe, 33, 8}, /* Akira (J) [!] */ + {0x376138d8, 33, 8}, /* Akira (J) [a1] */ + {0xadf606f6, 33, 8}, /* Bakushou!! Jinsei Gekijou (J) [!] */ + {0xbc7b1d0f, 33, 8}, /* Bakushou!! Jinsei Gekijou 2 (J) [!] */ + {0x7a497ae3, 33, 8}, /* Don Doko Don (J) [!] */ + {0xbaca10a9, 33, 8}, /* Golf Ko Open (J) [!] */ + {0xf80bdc50, 33, 8}, /* Insector X (J) [!] */ + {0x2a6559a1, 33, 8}, /* Operation Wolf (J) [!] */ + {0xaeb7fce9, 33, 8}, /* Power Blazer (J) [!] */ + {0xd920f9df, 33, 8}, /* Takeshi no Sengoku Fuuunji (J) [!] */ + {0x3cd4b420, 33, 8}, /* Takeshi no Sengoku Fuuunji (Japan) (Beta) */ {0x4c7c1af3, 34, 1}, /* Caesar's Palace */ {0x932ff06e, 34, 1}, /* Classic Concentration */ {0xf46ef39a, 37, -1}, /* Super Mario Bros. + Tetris + Nintendo World Cup (E) [!] */ {0x7ccb12a3, 43, -1}, /* SMB2j */ {0x6c71feae, 45, -1}, /* Kunio 8-in-1 */ - {0xe2c94bc2, 48, -1}, /* Super Bros 8 (Unl) [!] */ - {0xaebd6549, 48, 8}, /* Bakushou!! Jinsei Gekijou 3 */ - {0x6cdc0cd9, 48, 8}, /* Bubble Bobble 2 */ - {0x99c395f9, 48, 8}, /* Captain Saver */ - {0xa7b0536c, 48, 8}, /* Don Doko Don 2 */ {0x40c0ad47, 48, 8}, /* Flintstones 2 */ - {0x1500e835, 48, 8}, /* Jetsons (J) */ + {0xaebd6549, 48, 8}, /* Bakushou!! Jinsei Gekijou 3 (J) [!] */ + {0x6cdc0cd9, 48, 8}, /* Bubble Bobble 2 (J) */ + {0x99c395f9, 48, 8}, /* Captain Saver (J) */ + {0xa7b0536c, 48, 8}, /* Don Doko Don 2 (J) [!] */ + {0xb17c828a, 48, 8}, /* Don Doko Don 2 (J) [a1] */ + {0x10e24006, 48, 8}, /* Flintstones, The - The Rescue of Dino & Hoppy (J) */ + {0x1500e835, 48, 8}, /* Jetsons, The - Cogswell's Caper! (J) */ + {0xe2c94bc2, 48, 8}, /* Super Bros 8 (Unl) [!] */ {0xa912b064, 51|0x800, 8}, /* 11-in-1 Ball Games(has CHR ROM when it shouldn't) */ {0x39ab0fc7, 64, 8}, /* Hard Drivin' (USA) (Proto) (Unl) */ {0xb19a55dd, 64, 8}, /* Road Runner */ {0xf92be3ec, 64, -1}, /* Rolling Thunder */ - {0xd114f544, 66, 1}, /* AV Super Real Pachinko (Japan) (Unl) */ + {0xd114f544, 66, 0}, /* AV Super Real Pachinko (Japan) (Unl) */ {0xe84274c5, 66, 1}, /* Mississippi Satsujin Jiken (J) [h2] */ {0xbde3ae9b, 66, 1}, /* Doraemon */ {0x9552e8df, 66, 1}, /* Dragon Ball */ @@ -142,7 +154,7 @@ {0xdd8ed0f7, 70, 1}, /* Kamen Rider Club */ {0xbba58be5, 70, -1}, /* Family Trainer - Manhattan Police */ {0x370ceb65, 70, -1}, /* Family Trainer - Meiro Dai Sakusen */ - {0x86be4746, 71, -1}, /* Dooly Bravo Land (Korea) (Unl) */ + {0x86be4746, 2, -1}, /* Dooly Bravo Land (Korea) (Unl) */ {0xe62e3382, 71, -1}, /* Mig-29 Soviet Fighter */ {0xac7b0742, 71, -1}, /* Golden KTV (Ch) [!], not actually 71, but UNROM without BUS conflict */ {0x054bd3e9, 74, -1}, /* Di 4 Ci - Ji Qi Ren Dai Zhan (As) */ @@ -159,7 +171,8 @@ {0xd2699893, 88, 0}, /* Dragon Spirit */ {0xbb7c5f7a, 89, 8}, /* Mito Koumon or something similar */ {0x10119e6b, 93, 8}, /* Fantasy Zone (Japan) */ - {0x0da5e32e, 101, -1}, /* Uruusey Yatsura */ + {0x2b750bf9, 101, 1}, /* Urusei Yatsura - Lum no Wedding Bell (Japan) (Beta) */ + {0x0da5e32e, 101, 1}, /* Urusei Yatsura - Lum no Wedding Bell (Japan) */ {0x6096f84e, 104, 1}, /* Pegasus 5-in-1 (Golden Five) (Unl) */ {0x3d3ff543, 113, 0}, /* Kazama Jun to Asama Yuuko no AV Dragon Mahjong (Japan) (Unl) */ {0x68379fdb, 113, 1}, /* Pipemania (Australia) (HES) (Unl) */ @@ -167,7 +180,6 @@ {0x0d98db53, 114, -1}, /* Pocahontas */ {0x4e7729ff, 114, -1}, /* Super Donkey Kong */ {0xc5e5c5b2, 115, -1}, /* Bao Qing Tian (As).nes */ -/* {0xa1dc16c0, 116, -1}, Street Heroes (Sachen) [b1] */ {0xe40dfb7e, 116, -1}, /* Somari (P conf.) */ {0xc9371ebb, 116, -1}, /* Somari (W conf.) */ {0x78b657ac, 118, -1}, /* Armadillo */ @@ -296,7 +308,7 @@ {0x2447e03b, 210, 1}, /* Top Striker */ {0x1dc0f740, 210, 1}, /* Wagyan Land 2 */ {0xd323b806, 210, 1}, /* Wagyan Land 3 */ - {0xbd523011, 210, 0}, /* Dream Master */ + {0xbd523011, 210, 0}, /* Namco Prism Zone - Dream Master (Japan) */ {0x5daae69a, 211, -1}, /* Aladdin - Return of Jaffar, The (Unl) [!] */ {0x1ec1dfeb, 217, -1}, /* 255-in-1 (Cut version) [p1] */ {0x046d70cc, 217, -1}, /* 500-in-1 (Anim Splash, Alt Mapper)[p1][!] */ @@ -305,15 +317,15 @@ {0x62ef6c79, 232, 8}, /* Quattro Sports -Aladdin */ {0x2705eaeb, 234, -1}, /* Maxi 15 */ {0x6f12afc5, 235, -1}, /* Golden Game 150-in-1 */ - {0xfb2b6b10, 241, -1}, /* Fan Kong Jing Ying (Ch) */ - {0xb5e83c9a, 241, -1}, /* Xing Ji Zheng Ba (Ch) */ {0x2537b3e6, 241, -1}, /* Dance Xtreme - Prima (Unl) */ {0x11611e89, 241, -1}, /* Darkseed (Unl) [p1] */ {0x81a37827, 241, -1}, /* Darkseed (Unl) [p1][b1] */ - {0xc2730c30, 241, -1}, /* Deadly Towers (U) [!] */ - {0xa21e675c, 241, -1}, /* Mashou (J) [!] */ + {0xfb2b6b10, 241, -1}, /* Fan Kong Jing Ying (Ch) */ + {0xb5e83c9a, 241, -1}, /* Xing Ji Zheng Ba (Ch) */ {0x368c19a8, 241, -1}, /* LIKO Study Cartridge 3-in-1 (Unl) [!] */ {0x54d98b79, 241, -1}, /* Titanic 1912 (Unl) */ + {0xc2730c30, 34, 0}, /* Deadly Towers (U) [!] */ + {0xa21e675c, 34, 0}, /* Mashou (J) [!] */ {0x6bea1235, 245, -1}, /* MMC3 cart, but with nobanking applied to CHR-RAM, so let it be there */ {0x345ee51a, 245, -1}, /* DQ4c */ {0x57514c6c, 245, -1}, /* Yong Zhe Dou E Long - Dragon Quest VI (Ch) */ @@ -324,7 +336,7 @@ {0xe001de16, 224, 0}, /* Pokemon Platinum Alt title 2 (KT-008 PCB)(Ch)[!] */ {0xbdbe3c96, 238, 1}, /* Contra Fighter (Unl) */ {0xcfe02ada, 1, -1}, /* Darkman (E) [!] */ - {0xcb53c523, 1, -1}, /* King Neptune's Adventure (Color Dreams) [!] */ + {0xcb53c523, 11, 1}, /* King Neptune's Adventure (Color Dreams) [!] */ {0x6e149729, 189, -1}, /* Master Fighter II (Unl) [a1] */ {0x60bfeb0c, 90, -1}, /* Mortal Kombat 2 (Unl) [!] */ {0x247cc73d, 150, -1}, /* Poker II (Sachen) [!] */ @@ -341,10 +353,10 @@ {0x071e4ee8, 114, 0}, /* m114,submapper 1 test rom */ {0xfe3e03a1, 197, -1}, /* Mortal Kombat III Special (YY-030) (Ch) [!] */ {0x9151d311, 197, -1}, /* Mortal Kombat III 28 Peoples (NT-328) (Ch) [!] */ - {0xf6bd8e31, 281, 0}, /* 1997 Super HIK 4-in-1 (JY-052) [p1][!] */ /* ines mappers that uses iNes 2.0 numbers */ + {0xf6bd8e31, 281, 0}, /* 1997 Super HIK 4-in-1 (JY-052) [p1][!] */ {0x5aa23a15, 361, 0}, /* 4-in-1 (OK-411)[p1][!] */ {0xf6b9d088, 366, 0}, /* 4-in-1 (K-3131GS, GN-45) [p1][!] */ {0x503566b2, 366, 0}, /* 4-in-1 (K-3131SS, GN-45) [p1][!] */ diff --git a/src/ines.c b/src/ines.c index 41c4dcf..8edac57 100644 --- a/src/ines.c +++ b/src/ines.c @@ -237,7 +237,6 @@ void CheckBad(uint64 md5partial) { } } - struct CHINF { uint32 crc32; int32 mapper; diff --git a/src/unif.c b/src/unif.c index 8288a1e..2ff053e 100644 --- a/src/unif.c +++ b/src/unif.c @@ -473,6 +473,25 @@ static BMAPPING bmap[] = { { "WAIXING-FS005", BMCFK23C_Init, 0 }, /* https://wiki.nesdev.com/w/index.php/INES_Mapper_176 */ { "80013-B", BMC80013B_Init, 0 }, + { "TH2131-1", UNLTH21311_Init, 0 }, + { "LH51", LH51_Init, 0 }, + { "RESETNROM-XIN1", BMCRESETNROMXIN1_Init, 0 }, + { " BMC-RESET-TXROM", BMCRESETTXROM_Init, 0 }, + { "RESET-TXROM", BMCRESETTXROM_Init, 0 }, + { "K-3088", BMC411120C_Init, 0 }, + { "FARID_SLROM_8-IN-1", FARIDSLROM8IN1_Init, 0 }, + { "830425C-4391T", BMC830425C4391T_Init, 0 }, + { "TJ-03", BMCTJ03_Init, 0 }, + { "CTC-09", BMCCTC09_Init, 0 }, + { "K-3046", BMCK3046_Init, 0 }, + { "SA005-A", BMCSA005A_Init, 0 }, + { "K-3006", BMCK3006_Init, 0 }, + { "K-3036", BMCK3036_Init, 0 }, + { "MINDKIDS", MINDKIDS_Init, BMCFLAG_256KCHRR }, + { "KS7021A", UNLKS7021A_Init, 0 }, + { "KS106C", BMCKS106C_Init, 0 }, + { "900218", BTL900218_Init, 0 }, + #ifdef COPYFAMI { "COPYFAMI_MMC3", MapperCopyFamiMMC3_Init, 0 }, { "COPYFAMI", MapperCopyFami_Init, 0 }, diff --git a/src/unif.h b/src/unif.h index 5bb8a52..93b3df8 100644 --- a/src/unif.h +++ b/src/unif.h @@ -158,13 +158,28 @@ void UNLRT01_Init(CartInfo *info); void BMC810131C_Init(CartInfo *info); void BMC8IN1_Init(CartInfo *info); void BMC80013B_Init(CartInfo *info); - -/* additional boards */ void BMC60311C_Init(CartInfo *info); /* m289 */ void BMCWS_Init(CartInfo *info); /* m332 */ void UNLKS202_Init(CartInfo *info); /* m056 */ void BMCHPxx_Init(CartInfo *info); /* m260 */ +void BMCRESETNROMXIN1_Init(CartInfo *info); +void BMCKS106C_Init(CartInfo *info); +void UNLTH21311_Init(CartInfo *info); /* m308 */ +void LH51_Init(CartInfo *info); /* m309 */ +void BMCRESETTXROM_Init(CartInfo *info); /* m313 */ +void FARIDSLROM8IN1_Init(CartInfo *info); /* m323 */ +void BMC830425C4391T_Init(CartInfo *info); /* m320 */ +void BMCTJ03_Init(CartInfo *info); /* m341 */ +void BMCCTC09_Init(CartInfo *info); /* m335 */ +void BMCK3046_Init(CartInfo *info); /* m336 */ +void BMCSA005A_Init(CartInfo *info); /* m338 */ +void BMCK3006_Init(CartInfo *info); /* m339 */ +void BMCK3036_Init(CartInfo *info); /* m340 */ +void MINDKIDS_Init(CartInfo *info); /* m268 */ +void UNLKS7021A_Init(CartInfo *info); /* m525 */ +void BTL900218_Init(CartInfo *info); /* m524 */ + #ifdef COPYFAMI void MapperCopyFamiMMC3_Init(CartInfo *info); void MapperCopyFami_Init(CartInfo *info);