Merge pull request #411 from negativeExponent/nes2_overrides

Nes2 overrides
This commit is contained in:
Autechre
2020-11-17 02:14:54 +01:00
committed by GitHub
2 changed files with 18 additions and 26 deletions

View File

@@ -28,13 +28,13 @@
static uint8 dipswitch = 0;
static void M401CW(uint32 A, uint8 V) {
uint32 mask = (0xFF >> (~EXPREGS[2] &0xF));
uint32 bank = (EXPREGS[0] | ((EXPREGS[2] << 4) &0xF00));
uint32 mask = (0xFF >> (~EXPREGS[2] & 0xF));
uint32 bank = (EXPREGS[0] | ((EXPREGS[2] << 4) & 0xF00));
setchr1(A, (V & mask) | bank);
}
static void M401PW(uint32 A, uint8 V) {
if ((dipswitch & 1) && (EXPREGS[1] &0x80)) {
if ((dipswitch & 1) && (EXPREGS[1] & 0x80)) {
/* openbus */
} else {
uint32 mask = (~EXPREGS[3] & 0x1F);
@@ -92,5 +92,5 @@ void Mapper401_Init(CartInfo *info) {
info->Power = M401Power;
info->Reset = M401Reset;
AddExState(EXPREGS, 5, 0, "EXPR");
AddExState(dipswitch, 1, 0, "DPSW");
AddExState(&dipswitch, 1, 0, "DPSW");
}

View File

@@ -323,28 +323,21 @@ static void CheckHInfo(void) {
iNESCart.region = moo[x].region;
}
}
switch (moo[x].mapper) {
/* TODO: Eventually, all items from overrides should be considered as ines 2.0 compatible */
case 1:
case 5:
case 176:
case 293:
if (moo[x].prgram >= 0) {
tofix |= 32;
iNESCart.iNES2 = 1;
iNESCart.PRGRamSize = (moo[x].prgram & 0x0F) ? (64 << ((moo[x].prgram >> 0) & 0xF)) : 0;
iNESCart.PRGRamSaveSize = (moo[x].prgram & 0xF0) ? (64 << ((moo[x].prgram >> 4) & 0xF)) : 0;
}
if (moo[x].chrram >= 0) {
tofix |= 32;
iNESCart.iNES2 = 1;
iNESCart.CHRRamSize = (moo[x].chrram & 0x0F) ? (64 << ((moo[x].chrram >> 0) & 0xF)) : 0;
iNESCart.CHRRamSaveSize = (moo[x].chrram & 0xF0) ? (64 << ((moo[x].chrram >> 4) & 0xF)) : 0;
}
break;
default:
break;
if (moo[x].prgram >= 0) {
tofix |= 32;
iNESCart.iNES2 = 1;
iNESCart.PRGRamSize = (moo[x].prgram & 0x0F) ? (64 << ((moo[x].prgram >> 0) & 0xF)) : 0;
iNESCart.PRGRamSaveSize = (moo[x].prgram & 0xF0) ? (64 << ((moo[x].prgram >> 4) & 0xF)) : 0;
}
if (moo[x].chrram >= 0) {
tofix |= 32;
iNESCart.iNES2 = 1;
iNESCart.CHRRamSize = (moo[x].chrram & 0x0F) ? (64 << ((moo[x].chrram >> 0) & 0xF)) : 0;
iNESCart.CHRRamSaveSize = (moo[x].chrram & 0xF0) ? (64 << ((moo[x].chrram >> 4) & 0xF)) : 0;
}
break;
}
x++;
@@ -393,7 +386,6 @@ static void CheckHInfo(void) {
}
}
strcat(gigastr, "\n");
FCEU_printf("\n", gigastr);
FCEU_printf("%s\n", gigastr);
}