From b800c05db5a55a8766eb6c409c93d6b38b90f4e7 Mon Sep 17 00:00:00 2001 From: NewRisingSun <8vytz1+dhp372pv94ebg@sharklasers.com> Date: Thu, 10 Apr 2025 01:13:33 +0200 Subject: [PATCH] Add mapper 520. --- src/boards/520.c | 32 ++++++++++++++++++++++++++++++++ src/ines.c | 1 + src/ines.h | 1 + 3 files changed, 34 insertions(+) create mode 100644 src/boards/520.c diff --git a/src/boards/520.c b/src/boards/520.c new file mode 100644 index 0000000..e87fdd1 --- /dev/null +++ b/src/boards/520.c @@ -0,0 +1,32 @@ +/* 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 void sync () { + VRC24_syncPRG(0x1F, VRC24_chr[0] <<2 &0x20); + VRC24_syncCHR(0x07, 0x00); + VRC24_syncMirror(); +} + +void Mapper520_Init (CartInfo *info) { + VRC24_init(info, sync, 0x04, 0x08, 1, 1, 0); +} diff --git a/src/ines.c b/src/ines.c index 5e034cb..de8aa66 100644 --- a/src/ines.c +++ b/src/ines.c @@ -867,6 +867,7 @@ INES_BOARD_BEGIN() INES_BOARD( "Brilliant Com Cocoma Pack", 516, Mapper516_Init ) INES_BOARD( "DANCE2000", 518, UNLD2000_Init ) INES_BOARD( "EH8813A", 519, UNLEH8813A_Init ) + INES_BOARD( "YuYuHakusho+DBZ", 520, Mapper520_Init ) INES_BOARD( "DREAMTECH01", 521, DreamTech01_Init ) INES_BOARD( "LH10", 522, LH10_Init ) INES_BOARD( "Jncota KT-???", 523, Mapper523_Init ) diff --git a/src/ines.h b/src/ines.h index d54c85f..d3706fa 100644 --- a/src/ines.h +++ b/src/ines.h @@ -375,6 +375,7 @@ void Mapper500_Init(CartInfo *); void Mapper501_Init(CartInfo *); void Mapper502_Init(CartInfo *); void Mapper516_Init(CartInfo *); +void Mapper520_Init(CartInfo *); void Mapper523_Init(CartInfo *); void Mapper528_Init(CartInfo *); void Mapper533_Init(CartInfo *);