From ce317b00a1c5a8a025481dd436946fe9f1624c7b Mon Sep 17 00:00:00 2001 From: qeed Date: Sat, 8 Aug 2009 19:47:12 +0000 Subject: [PATCH] Fixed mapper 16, Dragon Ball Z 3 can now be played again --- src/boards/bandai.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/boards/bandai.cpp b/src/boards/bandai.cpp index 8604b3cc..ae34ea66 100644 --- a/src/boards/bandai.cpp +++ b/src/boards/bandai.cpp @@ -25,7 +25,8 @@ static uint8 reg[16], is153; static uint8 IRQa; -static uint16 IRQCount, IRQLatch; +static uint16 IRQLatch; +static int16 IRQCount; static uint8 *WRAM=NULL; static uint32 WRAMSIZE; @@ -95,9 +96,19 @@ static DECLFW(BandaiWrite) else switch(A) { + /* disch's docs say that the writing to 0x0B and 0x0C will change + * the counter value directly, not reload value + * but keep the old code here in case something goes wrong */ + /* case 0x0A: X6502_IRQEnd(FCEU_IQEXT); IRQa=V&1; IRQCount=IRQLatch; break; - case 0x0B: IRQLatch&=0xFF00; IRQLatch|=V; break; - case 0x0C: IRQLatch&=0xFF; IRQLatch|=V<<8; break; + case 0x0B: IRQLatch&=0xFF00; IRQLatch|=V; break; + case 0x0C: IRQLatch&=0xFF; IRQLatch|=V<<8; break; + */ + + case 0x0A: X6502_IRQEnd(FCEU_IQEXT); IRQa=V&1; break; + case 0x0B: IRQCount &= 0xFF00; IRQCount |= V; break; + case 0x0C: IRQCount &= 0xFF; IRQCount |= (V << 8); break; + case 0x0D: break;// Serial EEPROM control port } }