Add mapper 586.

This commit is contained in:
NewRisingSun
2025-09-08 16:54:21 +02:00
parent 03c7199a42
commit 8b2d37d8c7
4 changed files with 41 additions and 1 deletions

37
src/boards/586.c Normal file
View File

@@ -0,0 +1,37 @@
/* 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 () {
if (Latch_address &0x08) {
setprg16(0x8000, Latch_address);
setprg16(0xC000, Latch_address);
} else
setprg32(0x8000, Latch_address >>1);
setchr8(Latch_address);
setmirror(Latch_address &0x08? MI_V: MI_H);
}
void Mapper586_Init (CartInfo *info) {
Latch_init(info, sync, 0x8000, 0xFFFF, NULL);
info->Reset = Latch_power;
}

View File

@@ -36,7 +36,7 @@ static SFORMAT Latch_state[] = {
DECLFW(Latch_write) {
uint16 newAddress = A &0xFFFF;
if (Latch_cbWrite) Latch_cbWrite(&newAddress, &V, CartBR(A));
Latch_address = A;
Latch_address = newAddress;
Latch_data = V;
Latch_cbSync();
}
@@ -48,6 +48,7 @@ static void Latch_clear () {
}
static void Latch_setHandlers() {
SetReadHandler(0x8000, 0xFFFF, CartBR);
SetWriteHandler(Latch_from, Latch_to, Latch_write);
}

View File

@@ -948,6 +948,7 @@ INES_BOARD_BEGIN()
INES_BOARD( "Bung Super Game Doctor", 561, Mapper561_562_Init )
INES_BOARD( "Venus Turbo Game Doctor", 562, Mapper561_562_Init )
INES_BOARD( "J-2020", 563, Mapper563_Init )
INES_BOARD( "HN-02", 586, Mapper586_Init )
INES_BOARD_END()
static uint32 iNES_get_mapper_id(void)

View File

@@ -413,6 +413,7 @@ void Mapper558_Init(CartInfo *);
void Mapper559_Init(CartInfo *);
void Mapper561_562_Init(CartInfo *);
void Mapper563_Init(CartInfo *);
void Mapper586_Init(CartInfo *);
void FFE_Init(CartInfo *);