From f1576fd15ad272148068c76b9af32aa5a5afb123 Mon Sep 17 00:00:00 2001 From: NewRisingSun <8vytz1+dhp372pv94ebg@sharklasers.com> Date: Thu, 11 Sep 2025 00:20:34 +0200 Subject: [PATCH] Add mapper 549. --- src/boards/549.c | 33 +++++++++++++++++++++++++++++++++ src/boards/asic_latch.c | 3 ++- src/ines.c | 1 + src/ines.h | 1 + 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 src/boards/549.c diff --git a/src/boards/549.c b/src/boards/549.c new file mode 100644 index 0000000..3d62dae --- /dev/null +++ b/src/boards/549.c @@ -0,0 +1,33 @@ +/* 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 "asic_latch.h" + +static void sync () { + setprg8(0x6000, Latch_address >>2 | Latch_address >>3 &0x04); + setprg32(0x8000, 2); + setchr8(0); +} + +void Mapper549_Init (CartInfo *info) { + Latch_init(info, sync, 0x8000, 0xFFFF, NULL); + info->Reset = Latch_clear; +} diff --git a/src/boards/asic_latch.c b/src/boards/asic_latch.c index f94286b..538ccd0 100644 --- a/src/boards/asic_latch.c +++ b/src/boards/asic_latch.c @@ -48,7 +48,8 @@ void Latch_clear () { } static void Latch_setHandlers() { - SetReadHandler(0x8000, 0xFFFF, CartBR); + SetReadHandler(0x6000, 0xFFFF, CartBR); + SetWriteHandler(0x6000, 0x7FFF, CartBW); SetWriteHandler(Latch_from, Latch_to, Latch_write); } diff --git a/src/ines.c b/src/ines.c index 5d8a1b2..fe5448a 100644 --- a/src/ines.c +++ b/src/ines.c @@ -959,6 +959,7 @@ INES_BOARD_BEGIN() INES_BOARD( "JYV610 830626C", 542, Mapper542_Init ) INES_BOARD( "5-in-1 (CH-501)", 543, Mapper543_Init ) INES_BOARD( "WAIXING FS306", 544, Mapper544_Init ) + INES_BOARD( "Kaiser KS-7016B", 549, Mapper549_Init ) INES_BOARD( "", 550, Mapper550_Init ) INES_BOARD( "", 551, Mapper178_Init ) INES_BOARD( "TAITO X1-017", 552, Mapper552_Init ) diff --git a/src/ines.h b/src/ines.h index e7fd9f1..bcaff87 100644 --- a/src/ines.h +++ b/src/ines.h @@ -428,6 +428,7 @@ void Mapper541_Init(CartInfo *); void Mapper542_Init(CartInfo *); void Mapper543_Init(CartInfo *); void Mapper544_Init(CartInfo *); +void Mapper549_Init(CartInfo *); void Mapper550_Init(CartInfo *); void Mapper552_Init(CartInfo *); void Mapper553_Init(CartInfo *);