Add mappers 589 and 591.

This commit is contained in:
NewRisingSun
2025-09-08 23:32:43 +02:00
parent 2c0c3c1876
commit 4d48988cf4
6 changed files with 88 additions and 12 deletions

View File

@@ -38,11 +38,8 @@ static void sync () {
setmirror(Latch_address &0x80? MI_H: MI_V);
}
static void trapLatchWrite (uint16 *newAddress, uint8 *newValue, uint8 romValue) { /* The upper bits are only writable on a falling edge of A5. */
if (Latch_address &0x20 && !(*newAddress &0x20))
;
else
*newAddress = *newAddress &~0xC0 | Latch_address &0xC0;
static void trapLatchWrite (uint16 *newAddress, uint8 *newValue, uint8 romValue) { /* The upper two address bits are only updated on a falling edge of A5. */
if (!(Latch_address &0x20 && ~*newAddress &0x20)) *newAddress = *newAddress &~0xC0 | Latch_address &0xC0;
}
void Mapper581_Init (CartInfo *info) {

View File

@@ -22,12 +22,6 @@
static uint8 reg[2];
static SFORMAT stateRegs[] = {
{ &reg, 2, "REGS" },
{ 0 }
};
static void sync () {
setprg8(0x6000, reg[1] &0x07 |0x08);
setprg32(0x8000, reg[0] >>4 &0x07);
@@ -55,5 +49,5 @@ void Mapper588_Init (CartInfo *info) {
info->Reset = power;
info->Power = power;
GameStateRestore = stateRestore;
AddExState(stateRegs, ~0, 0, 0);
AddExState(reg, 2, 0, "REGS");
}

43
src/boards/589.c Normal file
View File

@@ -0,0 +1,43 @@
/* 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 &0x20) { /* First chip: 256 KiB */
setprg16(0x8000, Latch_address >>1 &0x08 | Latch_data &0x07);
setprg16(0xC000, Latch_address >>1 &0x08 | 0x07);
} else { /* Second chip: 128 KiB (boot) */
setprg16(0x8000, 0x10 | Latch_address >>1 &0x07);
setprg16(0xC000, 0x10 | Latch_address >>1 &0x07);
}
setchr8(0);
setmirror(Latch_address &1? MI_H: MI_V);
}
static void trapLatchWrite (uint16 *newAddress, uint8 *newValue, uint8 romValue) { /* The address bits are only updated on a falling edge of D3. */
if (!(Latch_data &0x08 && ~*newValue &0x08)) *newAddress = Latch_address;
}
void Mapper589_Init (CartInfo *info) {
Latch_init(info, sync, 0x8000, 0xFFFF, trapLatchWrite);
info->Reset = Latch_power;
}

38
src/boards/591.c Normal file
View File

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

View File

@@ -954,7 +954,9 @@ INES_BOARD_BEGIN()
INES_BOARD( "ET-82", 581, Mapper581_Init )
INES_BOARD( "HN-02", 586, Mapper586_Init )
INES_BOARD( "ET-81", 588, Mapper588_Init )
INES_BOARD( "810706", 589, Mapper589_Init )
INES_BOARD( "810430", 590, Mapper590_Init )
INES_BOARD( "07027/810543", 591, Mapper591_Init )
INES_BOARD( "8-in-1 1991", 592, Mapper592_Init )
INES_BOARD_END()

View File

@@ -419,7 +419,9 @@ void Mapper579_Init(CartInfo *);
void Mapper581_Init(CartInfo *);
void Mapper586_Init(CartInfo *);
void Mapper588_Init(CartInfo *);
void Mapper589_Init(CartInfo *);
void Mapper590_Init(CartInfo *);
void Mapper591_Init(CartInfo *);
void Mapper592_Init(CartInfo *);
void FFE_Init(CartInfo *);