Add mapper 578.

This commit is contained in:
NewRisingSun
2025-09-09 00:51:25 +02:00
parent ced209604c
commit 7b4f084830
4 changed files with 66 additions and 4 deletions

View File

@@ -32,10 +32,10 @@ static DECLFR(readPad) {
}
static void sync() {
int prgAND =reg[1] &0x02? 0x0F: 0x1F;
int chrAND =reg[1] &0x20 && submapper == 3? 0x1FF: reg[1] &0x04? 0x7F: 0xFF;
int prgOR =reg[1] <<4 &0x10 | reg[1] <<1 &0x60;
int chrOR =reg[1] <<7 &0x80 | reg[1] <<5 &0x100 | reg[1] <<4 &0x200;
int prgAND = reg[1] &0x02? 0x0F: 0x1F;
int chrAND = reg[1] &0x20 && submapper == 3? 0x1FF: reg[1] &0x04? 0x7F: 0xFF;
int prgOR = reg[1] <<4 &0x10 | reg[1] <<1 &0x60;
int chrOR = reg[1] <<7 &0x80 | reg[1] <<5 &0x100 | reg[1] <<4 &0x200;
MMC3_syncPRG(prgAND, prgOR &~prgAND);
MMC3_syncCHR(chrAND, chrOR &~chrAND);
MMC3_syncMirror();

60
src/boards/578.c Normal file
View File

@@ -0,0 +1,60 @@
/* FCEUmm - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2020
*
* 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_mmc3.h"
static uint8 reg;
static void sync() {
int prgAND = reg &0x02 && reg &0x04? 0x1F: 0x0F;
int chrAND = reg &0x02 && reg &0x04? 0xFF: 0x7F;
int prgOR = reg <<4;
int chrOR = reg <<7;
MMC3_syncPRG(prgAND, prgOR &~prgAND);
MMC3_syncCHR(chrAND, chrOR &~chrAND);
MMC3_syncMirror();
}
static DECLFW(writeReg) {
reg = V;
sync();
}
static void reset() {
reg = 0;
sync();
}
static void power() {
int i;
reg = 0;
MMC3_power();
for (int i = 0x8000; i < 0xFFFF; i +=4) SetWriteHandler(i |2, i |3, writeReg);
}
void Mapper578_Init(CartInfo *info) {
MMC3_init(info, sync, MMC3_TYPE_AX5202P, NULL, NULL, NULL, writeReg);
info->Power = power;
info->Reset = reset;
AddExState(&reg, 1, 0, "EXPR");
}

View File

@@ -952,6 +952,7 @@ INES_BOARD_BEGIN()
INES_BOARD( "J-2020", 563, Mapper563_Init )
INES_BOARD( "Top Ten Variety (SF III)", 567, Mapper567_Init )
INES_BOARD( "5068", 573, Mapper573_Init )
INES_BOARD( "910610", 578, Mapper578_Init )
INES_BOARD( "T-215", 579, Mapper579_Init )
INES_BOARD( "ET-82", 581, Mapper581_Init )
INES_BOARD( "8203", 583, Mapper583_Init )

View File

@@ -417,6 +417,7 @@ void Mapper561_562_Init(CartInfo *);
void Mapper563_Init(CartInfo *);
void Mapper567_Init(CartInfo *);
void Mapper573_Init(CartInfo *);
void Mapper578_Init(CartInfo *);
void Mapper579_Init(CartInfo *);
void Mapper581_Init(CartInfo *);
void Mapper583_Init(CartInfo *);