From ca898191dbeebb96f279f9f7357c370fb409bdb6 Mon Sep 17 00:00:00 2001 From: NewRisingSun <8vytz1+dhp372pv94ebg@sharklasers.com> Date: Thu, 11 Sep 2025 23:11:47 +0200 Subject: [PATCH] Add mapper 363. --- src/boards/363.c | 39 +++++++++++++++++++++++++++++++++++++++ src/ines.c | 1 + src/ines.h | 1 + 3 files changed, 41 insertions(+) create mode 100644 src/boards/363.c diff --git a/src/boards/363.c b/src/boards/363.c new file mode 100644 index 0000000..2916e41 --- /dev/null +++ b/src/boards/363.c @@ -0,0 +1,39 @@ +/* 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 () { + setprg16(0x8000, Latch_address <<3 | Latch_data &0x07); + setprg16(0xC000, Latch_address <<3 | 0x07); + setchr8(0); + setmirror(Latch_address &0x20? MI_H: MI_V); +} + +static void trapLatchWrite (uint16 *newAddress, uint8 *newValue, uint8 romValue) { + if (!(~Latch_address &0x10 && *newAddress &0x10)) *newAddress = Latch_address; /* Address bits only latched on a rising edge of A4 */ + *newValue &= romValue; /* AND-type bus conflicts */ +} + +void Mapper363_Init (CartInfo *info) { + Latch_init(info, sync, 0x8000, 0xFFFF, trapLatchWrite); + info->Reset = Latch_clear; +} diff --git a/src/ines.c b/src/ines.c index 9a962ae..8e98837 100644 --- a/src/ines.c +++ b/src/ines.c @@ -807,6 +807,7 @@ INES_BOARD_BEGIN() INES_BOARD( "Bitcorp 31-in-1", 360, Mapper360_Init ) INES_BOARD( "OK-411", 361, GN45_Init ) /* OK-411 is emulated together with GN-45 */ INES_BOARD( "830506C", 362, Mapper362_Init ) + INES_BOARD( "5069", 363, Mapper363_Init ) INES_BOARD( "JY830832C", 364, Mapper364_Init ) INES_BOARD( "GN-45", 366, GN45_Init ) INES_BOARD( "JC-016-2 variant", 367, Mapper367_Init ) diff --git a/src/ines.h b/src/ines.h index 34a42bf..ee6f074 100644 --- a/src/ines.h +++ b/src/ines.h @@ -290,6 +290,7 @@ void Mapper358_Init(CartInfo *); void Mapper359_Init(CartInfo *); void Mapper360_Init(CartInfo *); void Mapper362_Init(CartInfo *); +void Mapper363_Init(CartInfo *); void Mapper364_Init(CartInfo *); void Mapper367_Init(CartInfo *); void Mapper368_Init(CartInfo *);