Combine UNIF AB-G1L, WELL-NO-DG450 and TF2740 into NES 2.0 Mapper 428.

This commit is contained in:
NewRisingSun
2021-04-14 19:16:57 +02:00
parent 04a5d87a98
commit cf476194ce
5 changed files with 20 additions and 82 deletions

View File

@@ -25,7 +25,6 @@
static uint8 regs[4];
static uint8 hrd_flag;
static void(*Sync)(void);
static SFORMAT StateRegs[] =
{
@@ -34,7 +33,8 @@ static SFORMAT StateRegs[] =
{ 0 }
};
static void SyncAbG1l(void) {
static void Sync(void) {
int mask = reg[2] >> 6; /* There is an CNROM mode that takes either two or four inner CHR banks from a CNROM-like latch register at $8000-$FFFF. */
if (regs[1] & 0x10)
setprg32(0x8000,(regs[1] & 0xC0) >> 6);
@@ -44,48 +44,36 @@ static void SyncAbG1l(void) {
setprg16(0xC000, (regs[1] & 0xE0) >> 5);
}
/* FIXME: 2020-10-26 */
switch (regs[2] & 0xC0) {
case 0xC0: /* Pipe Dream */
setchr8((regs[0] & 0x03) | (regs[1] & ~0x03));
break;
case 0x40: /* Goonies */
setchr8((regs[0] & 0x01) | (regs[1] & 0x07));
break;
default:
setchr8(regs[1]);
break;
}
setchr8((regs[1] & 0x07) & ~mask) | reg[0] & mask);
setmirror((regs[1] & 0x8) ? 0 : 1);
}
static DECLFW(AbG1lWriteHi) {
static DECLFW(WriteHi) {
regs[0] = V;
/* setchr8(((regs[2] & 0xC0) >> 7) << 2 | (regs[0] & 0x03)); */
Sync();
}
static DECLFW(AbG1lWriteLo) {
static DECLFW(WriteLo) {
regs[A & 0x03] = V;
Sync();
}
static DECLFR(AbG1lReadLo) {
static DECLFR(ReadLo) {
return hrd_flag;
}
static void AbG1lPower(void) {
hrd_flag = 0;
static void Power(void) {
hrd_flag = 0; /* Solder pad, selecting different menus */
regs[0] = 0;
regs[1] = 0;
regs[2] = 0;
Sync();
SetWriteHandler(0x8000, 0xFFFF, AbG1lWriteHi);
SetWriteHandler(0x6001, 0x6002, AbG1lWriteLo);
SetReadHandler(0x6000, 0x7FFF, AbG1lReadLo);
SetWriteHandler(0x8000, 0xFFFF, WriteHi);
SetWriteHandler(0x6001, 0x6002, WriteLo);
SetReadHandler(0x6000, 0x7FFF, ReadLo);
SetReadHandler(0x8000, 0xFFFF, CartBR);
}
@@ -93,7 +81,7 @@ static void StateRestore(int version) {
Sync();
}
static void AbG1lReset(void) {
static void Reset(void) {
hrd_flag++;
hrd_flag &= 3;
@@ -104,64 +92,14 @@ static void AbG1lReset(void) {
Sync();
}
void AbG1l_Init(CartInfo *info) {
Sync = SyncAbG1l;
void Mapper428_Init(CartInfo *info) {
hrd_flag = 0;
Sync();
info->Power = AbG1lPower;
info->Reset = AbG1lReset;
info->Power = Power;
info->Reset = Reset;
AddExState(&StateRegs, ~0, 0, 0);
GameStateRestore = StateRestore;
}
static void SyncWellNoDG450(void) {
if (regs[1] & 0x10)
setprg32(0x8000, (regs[1]) >> 6);
else
{
setprg16(0x8000, (regs[1]) >> 5);
setprg16(0xC000, (regs[1]) >> 5);
}
setchr8(regs[1] & 0x0F);
setmirror((regs[1] & 0x8) ? 0 : 1);
}
static void WellNoDG450Power(void) {
hrd_flag = 0;
regs[0] = 0;
regs[1] = 0;
regs[2] = 0;
Sync();
SetWriteHandler(0x6001, 0x6002, AbG1lWriteLo);
SetReadHandler(0x6000, 0x7FFF, AbG1lReadLo);
SetReadHandler(0x8000, 0xFFFF, CartBR);
}
static void WellNoDG450Reset(void) {
hrd_flag++;
hrd_flag &= 3;
regs[0] = 0;
regs[1] = 0;
regs[2] = 0;
Sync();
}
void WellNoDG450_Init(CartInfo *info) {
Sync = SyncWellNoDG450;
info->Power = WellNoDG450Power;
info->Reset = WellNoDG450Reset;
AddExState(&StateRegs, ~0, 0, 0);
GameStateRestore = StateRestore;
}

View File

@@ -788,6 +788,7 @@ INES_BOARD_BEGIN()
INES_BOARD( "YY850439C", 397, Mapper397_Init )
INES_BOARD( "831019C J-2282", 402, J2282_Init )
INES_BOARD( "SC871115C", 421, Mapper421_Init )
INES_BOARD( "AB-G1L/WELL-NO-DG450", 428, Mapper422_Init )
INES_BOARD( "SA-9602B", 513, SA9602B_Init )
INES_BOARD( "DANCE2000", 518, UNLD2000_Init )
INES_BOARD( "EH8813A", 519, UNLEH8813A_Init )

View File

@@ -282,6 +282,7 @@ void Mapper401_Init(CartInfo *);
void Mapper411_Init(CartInfo *);
void Mapper421_Init(CartInfo *);
void Mapper422_Init(CartInfo *);
void Mapper428_Init(CartInfo *);
void Mapper516_Init(CartInfo *);
void Mapper533_Init(CartInfo *);
void Mapper534_Init(CartInfo *);

View File

@@ -438,7 +438,7 @@ static BMAPPING bmap[] = {
{ "8237A", 215, UNL8237A_Init, 0 },
{ "830118C", 348, BMC830118C_Init, 0 },
{ "A65AS", 285, BMCA65AS_Init, 0 },
{ "AB-G1L", NO_INES, AbG1l_Init, 0 },
{ "AB-G1L", 428, Mapper428_Init, 0 },
{ "AC08", 42, AC08_Init, 0 },
{ "ANROM", 7, ANROM_Init, 0 },
{ "AX5705", 530, UNLAX5705_Init, 0 },
@@ -559,7 +559,7 @@ static BMAPPING bmap[] = {
{ "UNROM-512-32", 30, UNROM512_Init, BMCFLAG_32KCHRR },
{ "UOROM", 2, UNROM_Init, 0 },
{ "VRC7", 85, UNLVRC7_Init, 0 },
{ "WELL-NO-DG450", NO_INES, WellNoDG450_Init, 0 },
{ "WELL-NO-DG450", 428, Mapper428_Init, 0 },
{ "YOKO", 264, UNLYOKO_Init, 0 },
{ "COOLBOY", 268, COOLBOY_Init, BMCFLAG_256KCHRR },
{ "158B", 258, UNL158B_Init, 0 },

View File

@@ -189,8 +189,6 @@ void BMC830134C_Init(CartInfo *info); /* m315 */
void BMCGN26_Init(CartInfo *info); /* m344 */
void BS110_Init(CartInfo *info);
void WellNoDG450_Init(CartInfo *info);
void AbG1l_Init(CartInfo *info);
void KG256_Init(CartInfo *info);
void WAIXINGFS005_Init(CartInfo *info);