Added mapper 467

This commit is contained in:
NewRisingSun
2022-04-02 22:03:41 +02:00
parent 12157b4f82
commit cfbe777f61
3 changed files with 76 additions and 0 deletions

74
src/boards/467.c Normal file
View File

@@ -0,0 +1,74 @@
/* FCEUmm - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2022 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 "mmc3.h"
static void Mapper467_PRGWrap(uint32 A, uint8 V) {
if (EXPREGS[0] &0x20) {
int prgAND =EXPREGS[0] &0x40? 0x0F: 0x03;
int prgOR =EXPREGS[0] <<1 &0x3C | 0x40;
setprg8(A, V &prgAND | prgOR &~prgAND);
} else
if (~A &0x2000)
setprg16(A, EXPREGS[0] &0x1F);
}
static void Mapper467_CHRWrap(uint32 A, uint8 V) {
if (~A &0x0800) {
A =A &~0x400 | A <<1 &0x800;
if (EXPREGS[0] &0x40)
setchr2(A, V |0x100);
else
setchr2(A, V &~3 | A >>11 &3);
}
}
static DECLFW(Mapper467_WriteExtra) {
EXPREGS[0] =V;
FixMMC3PRG(MMC3_cmd &0x3F);
FixMMC3CHR(MMC3_cmd &0x3F);
setmirror(EXPREGS[0] &0x80? MI_H: MI_V);
}
static DECLFW(Mapper467_WriteMMC3) {
if (~A &1) V &=0x3F;
MMC3_CMDWrite(A, V);
}
static void Mapper467_Reset(void) {
EXPREGS[0] =0;
MMC3RegReset();
}
static void Mapper467_Power(void) {
EXPREGS[0] =0;
GenMMC3Power();
SetWriteHandler(0x8000, 0x8FFF, Mapper467_WriteMMC3);
SetWriteHandler(0x9000, 0x9FFF, Mapper467_WriteExtra);
}
void Mapper467_Init(CartInfo *info) {
GenMMC3_Init(info, 256, 256, 0, 0);
cwrap = Mapper467_CHRWrap;
pwrap = Mapper467_PRGWrap;
info->Power = Mapper467_Power;
info->Reset = Mapper467_Reset;
AddExState(EXPREGS, 1, 0, "EXPR");
}

View File

@@ -817,6 +817,7 @@ INES_BOARD_BEGIN()
INES_BOARD( "NC-7000M/NC-8000M", 444, Mapper444_Init )
INES_BOARD( "DS-9-27", 452, Mapper452_Init )
INES_BOARD( "K6C3001A", 456, Mapper456_Init )
INES_BOARD( "47-2", 467, Mapper467_Init )
INES_BOARD( "SA-9602B", 513, SA9602B_Init )
INES_BOARD( "Brilliant Com Cocoma Pack", 516, Mapper516_Init )
INES_BOARD( "DANCE2000", 518, UNLD2000_Init )

View File

@@ -327,6 +327,7 @@ void Mapper443_Init(CartInfo *);
void Mapper444_Init(CartInfo *);
void Mapper452_Init(CartInfo *);
void Mapper456_Init(CartInfo *);
void Mapper467_Init(CartInfo *);
void Mapper516_Init(CartInfo *);
void Mapper523_Init(CartInfo *);
void Mapper533_Init(CartInfo *);