diff --git a/src/boards/384.c b/src/boards/384.c new file mode 100644 index 0000000..9333622 --- /dev/null +++ b/src/boards/384.c @@ -0,0 +1,62 @@ +/* FCE Ultra - NES/Famicom Emulator + * + * Copyright notice for this file: + * Copyright (C) 2025 NewRisingSun + * + * 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 "vrc2and4.h" + +static uint8 reg; + +static SFORMAT Mapper384_stateRegs[] ={ + { ®, 1, "EXP0" }, + { 0 } +}; + +static void sync () { + VRC24_syncPRG(0x0F, reg <<4); + VRC24_syncCHR(0x7F, reg <<7); + VRC24_syncMirror(); + VRC24_syncWRAM(0); +} + +DECLFW(Mapper384_writeReg) { + if (A &0x800 && ~reg &0x08) { + reg =V; + VRC24_Sync(); + } + CartBW(A, V); +} + +void Mapper384_power(void) { + reg =0; + VRC24_power(); +} + +void Mapper384_reset(void) { + reg =0; + VRC24_Sync(); +} + +void Mapper384_Init (CartInfo *info) { + VRC24_init(info, sync, 0x04, 0x08, 1, 0, 2); + VRC24_WRAMWrite =Mapper384_writeReg; + info->Power =Mapper384_power; + info->Reset =Mapper384_reset; + AddExState(Mapper384_stateRegs, ~0, 0, 0); +} diff --git a/src/ines.c b/src/ines.c index b54c5a5..97f5e85 100644 --- a/src/ines.c +++ b/src/ines.c @@ -788,6 +788,7 @@ INES_BOARD_BEGIN() INES_BOARD( "KN-42", 381, Mapper381_Init ) INES_BOARD( "830928C", 382, Mapper382_Init ) INES_BOARD( "YY840708C", 383, Mapper383_Init ) + INES_BOARD( "L1A16", 384, Mapper384_Init ) INES_BOARD( "NTDEC 2779", 385, Mapper385_Init ) INES_BOARD( "YY860729C", 386, Mapper386_Init ) INES_BOARD( "YY850735C", 387, Mapper387_Init ) diff --git a/src/ines.h b/src/ines.h index 2bea257..e4b361f 100644 --- a/src/ines.h +++ b/src/ines.h @@ -300,6 +300,7 @@ void Mapper380_Init(CartInfo *); void Mapper381_Init(CartInfo *); void Mapper382_Init(CartInfo *); void Mapper383_Init(CartInfo *); +void Mapper384_Init(CartInfo *); void Mapper385_Init(CartInfo *); void Mapper386_Init(CartInfo *); void Mapper387_Init(CartInfo *);