Added mapper 472.

This commit is contained in:
NewRisingSun
2025-04-05 22:25:49 +02:00
committed by LibretroAdmin
parent bedeeebac7
commit 205b4417aa
3 changed files with 46 additions and 1 deletions

View File

@@ -21,7 +21,7 @@
*/
/* Code for emulating iNES mappers 4,12,44,45,47,49,52,74,114,115,116,118,
119,165,205,245,249,250,254,361,366,367,373,392,555
119,165,205,245,249,250,254,361,366,367,373,392,472,555
*/
#include "mapinc.h"
@@ -1471,6 +1471,49 @@ void Mapper254_Init(CartInfo *info) {
AddExState(EXPREGS, 2, 0, "EXPR");
}
/* ---------------------------- Mapper 472 ------------------------------ */
static void M472PW(uint32 A, uint8 V) {
setprg8(A, V &0x0F | EXPREGS[0] &0xF0);
}
static void M472CW(uint32 A, uint8 V) {
int chrAND =EXPREGS[0] &0x20? 0x7F: 0xFF;
setchr1(A, V &chrAND | EXPREGS[0] <<3 &~chrAND);
}
static DECLFR(M472Read) {
return EXPREGS[0];
}
static DECLFW(M472Write) {
EXPREGS[0] = EXPREGS[0] &0x80 | V &0x7F;
FixMMC3PRG(MMC3_cmd);
FixMMC3CHR(MMC3_cmd);
}
static void M472Reset(void) {
EXPREGS[0] =(EXPREGS[0] ^0x80) &0x80;
FixMMC3PRG(MMC3_cmd);
FixMMC3CHR(MMC3_cmd);
}
static void M472Power(void) {
EXPREGS[0] = 0;
GenMMC3Power();
SetReadHandler(0x6000, 0x7FFF, M472Read);
SetWriteHandler(0x6000, 0x7FFF, M472Write);
}
void Mapper472_Init(CartInfo *info) {
GenMMC3_Init(info, 128, 256, 8, 0);
pwrap = M472PW;
cwrap = M472CW;
info->Reset = M472Reset;
info->Power = M472Power;
AddExState(EXPREGS, 1, 0, "EXPR");
}
/* ---------------------------- Mapper 555 ------------------------------ */
static uint8 m555_reg[2];

View File

@@ -853,6 +853,7 @@ INES_BOARD_BEGIN()
INES_BOARD( "47-2", 467, Mapper467_Init )
INES_BOARD( "BlazePro CPLD", 468, Mapper468_Init )
INES_BOARD( "INX_007T_V01", 470, INX_007T_Init )
INES_BOARD( "830947", 472, Mapper472_Init )
INES_BOARD( "045N", 481, Mapper481_Init )
INES_BOARD( "AVE NINA-08", 487, Mapper487_Init )
INES_BOARD( "Yhc-000", 500, Mapper500_Init )

View File

@@ -364,6 +364,7 @@ void Mapper466_Init(CartInfo *);
void Mapper467_Init(CartInfo *);
void Mapper468_Init(CartInfo *);
void INX_007T_Init(CartInfo* info); /* Mapper 470 */
void Mapper472_Init(CartInfo *);
void Mapper481_Init(CartInfo *);
void Mapper487_Init(CartInfo *);
void Mapper500_Init(CartInfo *);