From fe12a1d308f15a8aedb751b094b72c8eb1e6c526 Mon Sep 17 00:00:00 2001 From: qeed Date: Mon, 2 Nov 2009 16:11:25 +0000 Subject: [PATCH] 76-in-1 seems to be playable now --- changelog.txt | 1 + src/boards/bmc42in1r.cpp | 30 +++++++++++++++++++++++------- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/changelog.txt b/changelog.txt index 430a2e29..cb3b62db 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,4 @@ +02-nov-2009 - qeed - fixed mapper 226, 76-in-1 seems to work now, also super 42 also seems to work with this fix, but people with save states with this game should make a new one. Since the the save state format for this game was changed a little. 31-oct-2009 - adelikat - win32 - Memwatch - Save Changes prompt - Selecting yes will do quicksave first, save as 2nd (instead of always defaulting to save as) 19-oct-2009 - qeed - Mapper 253 mostly implemented, known game [ES-1064] Qi Long Zhu (C) is mostly playable (some minor graphic glitches). Thanks to VirtualNESEX for reverse engineering this, gil for giving me the mapper src for implementation reference, and Dead_Body for figuring out this game had to use chr-ram 10-oct-2009 - qeed - fixed dragon's lair the mapper 4 europe version in new PPU diff --git a/src/boards/bmc42in1r.cpp b/src/boards/bmc42in1r.cpp index 5eabb8cc..15afeaf2 100644 --- a/src/boards/bmc42in1r.cpp +++ b/src/boards/bmc42in1r.cpp @@ -24,17 +24,21 @@ extern uint32 ROM_size; static uint8 hrd_sw; -static uint8 latche; +static uint8 latche[2]; static SFORMAT StateRegs[]= { {&hrd_sw, 1, "DIPSW"}, - {&latche, 1, "LATCHE"}, + {&latche, sizeof(latche), "LATCHE"}, {&hrd_sw, 1, "HRDSW"}, {0} }; static void Sync(void) { + int bank = (latche[0] >> 1 & 0x0F) | + (latche[0] >> 3 & 0x10) | + (latche[1] << 5 & 0x20); + /* if(!(latche&0x02)) setprg32r(0,0x8000,(latche&0x3F)>>1); else @@ -43,6 +47,8 @@ static void Sync(void) setprg16r(0,0xC000,latche&0x3f); } */ + /* the old one, doesnt work with 76 in 1 game + * since it doesn't account for all the PRG-ROM if(!(latche&0x20)) setprg32r(hrd_sw,0x8000,(latche>>1)&0x0f); else @@ -50,13 +56,23 @@ static void Sync(void) setprg16r(hrd_sw,0x8000,latche&0x1f); setprg16r(hrd_sw,0xC000,latche&0x1f); } - setmirror((latche>>6)&1); + setmirror((latche>>6)&1);*/ + if(!(latche[0] & 0x20)) + setprg32r(hrd_sw,0x8000,bank); + else + { + bank = (bank << 1) | (latche[0] & 1); + setprg16r(hrd_sw,0x8000,bank); + setprg16r(hrd_sw,0xC000,bank); + } + setmirror((latche[0] & 0x40) ? MI_V : MI_H); } static DECLFW(BMC42in1rWrite) { - latche=V; - Sync(); + latche[A & 1] = V; + //latche = V; + Sync(); } static void BMC42in1rReset(void) @@ -67,7 +83,7 @@ static void BMC42in1rReset(void) static void BMC42in1rPower(void) { - latche=0; + latche[0] = latche[1] = 0; hrd_sw=0; setchr8(0); Sync(); @@ -92,7 +108,7 @@ static void M226Power(void) { if(ROM_size==64) SetupCartPRGMapping(1,PRGptr[0]+512*1024,512,0); - latche=0; + latche[0] = 0; hrd_sw=0; setchr8(0); Sync();