From 21979314851bba25523158763145f7c3fd3558a5 Mon Sep 17 00:00:00 2001 From: NewRisingSun <8vytz1+dhp372pv94ebg@sharklasers.com> Date: Fri, 12 Sep 2025 01:41:42 +0200 Subject: [PATCH] Replaced mapper 461 with Wuzi Gun 6-in-1 (previous mapper 461 was reassigned to to 61 for a long time). --- src/boards/461.c | 60 ++++++++++++++++++++++++++++++++++++++++++ src/boards/addrlatch.c | 18 ------------- src/ines.c | 2 +- 3 files changed, 61 insertions(+), 19 deletions(-) create mode 100644 src/boards/461.c diff --git a/src/boards/461.c b/src/boards/461.c new file mode 100644 index 0000000..47d20c8 --- /dev/null +++ b/src/boards/461.c @@ -0,0 +1,60 @@ +/* FCEUmm - NES/Famicom Emulator + * + * Copyright notice for this file: + * Copyright (C) 2020 + * + * 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 + * + * + */ + +#include "mapinc.h" +#include "asic_mmc1.h" + +static uint8 reg; + +static void sync () { + if (reg &0x04) { + MMC1_syncPRG(reg &0x08? 0x07: 0x03, reg &0x0C); + MMC1_syncCHR(0x1F, reg <<2 &0x20); + } else { + setprg16(0x8000, reg &0x03); + setprg16(0xC000, reg &0x03); + MMC1_syncCHR(0x07, 0x40); + } + MMC1_syncMirror(); +} + +static DECLFW (writeReg) { + reg = A &0xFF; + sync(); +} + +static void reset () { + reg = 0; + MMC1_clear(); +} + +static void power () { + reg = 0; + MMC1_power(); +} + +void Mapper461_Init (CartInfo *info) { + MMC1_init(info, sync, MMC1_TYPE_MMC1A, NULL, NULL, NULL, writeReg); + info->Power = power; + info->Reset = reset; + AddExState(®, 1, 0, "EXPR"); +} diff --git a/src/boards/addrlatch.c b/src/boards/addrlatch.c index 6178337..ea3c0ed 100644 --- a/src/boards/addrlatch.c +++ b/src/boards/addrlatch.c @@ -832,24 +832,6 @@ void Mapper459_Init(CartInfo *info) { Latch_Init(info, M459Sync, NULL, 0x0000, 0x8000, 0xFFFF, 1); } -/*------------------ Map 461 ---------------------------*/ -static void M461Sync(void) { - int p =latche <<1 | latche >>5 &1; - int c =latche >>8; - if (latche &0x10) { - setprg16(0x8000, p); - setprg16(0xC000, p); - } else { - setprg32(0x8000, p >>1); - } - setchr8(c); - setmirror(latche &0x80? MI_H: MI_V); -} - -void Mapper461_Init(CartInfo *info) { - Latch_Init(info, M461Sync, NULL, 0x0000, 0x8000, 0xFFFF, 1); -} - /*------------------ Map 464 ---------------------------*/ static void M464Sync(void) { int p =latche >>7; diff --git a/src/ines.c b/src/ines.c index ae50efc..70222f9 100644 --- a/src/ines.c +++ b/src/ines.c @@ -892,7 +892,7 @@ INES_BOARD_BEGIN() INES_BOARD( "", 458, Mapper458_Init ) INES_BOARD( "8-in-1", 459, Mapper459_Init ) INES_BOARD( "FC-29-40/K-3101", 460, Mapper460_Init ) - INES_BOARD( "0324", 461, Mapper461_Init ) + INES_BOARD( "CM-9309", 461, Mapper461_Init ) INES_BOARD( "BMC-971107-00G", 462, Mapper462_Init ) INES_BOARD( "YH810X1", 463, Mapper463_Init ) INES_BOARD( "NTDEC 9012", 464, Mapper464_Init )