diff --git a/src/emucore/CartBFSC.cxx b/src/emucore/CartBFSC.cxx index a06b3406f..5ee1e585f 100644 --- a/src/emucore/CartBFSC.cxx +++ b/src/emucore/CartBFSC.cxx @@ -88,6 +88,7 @@ uInt8 CartridgeBFSC::peek(uInt16 address) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool CartridgeBFSC::poke(uInt16 address, uInt8 value) { + uInt16 pokeAddress = address; address &= 0x0FFF; // Switch banks if necessary @@ -97,7 +98,7 @@ bool CartridgeBFSC::poke(uInt16 address, uInt8 value) return false; } - pokeRAM(myRAM[address & 0x007F], address, value); + pokeRAM(myRAM[address & 0x007F], pokeAddress, value); return true; } diff --git a/src/emucore/CartDFSC.cxx b/src/emucore/CartDFSC.cxx index afb4e3b2a..2af3860e3 100644 --- a/src/emucore/CartDFSC.cxx +++ b/src/emucore/CartDFSC.cxx @@ -88,6 +88,7 @@ uInt8 CartridgeDFSC::peek(uInt16 address) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool CartridgeDFSC::poke(uInt16 address, uInt8 value) { + uInt16 pokeAddress = address; address &= 0x0FFF; // Switch banks if necessary @@ -97,7 +98,7 @@ bool CartridgeDFSC::poke(uInt16 address, uInt8 value) return false; } - pokeRAM(myRAM[address & 0x007F], address, value); + pokeRAM(myRAM[address & 0x007F], pokeAddress, value); return true; } diff --git a/src/emucore/CartEFSC.cxx b/src/emucore/CartEFSC.cxx index 271ea1029..9f8f6a676 100644 --- a/src/emucore/CartEFSC.cxx +++ b/src/emucore/CartEFSC.cxx @@ -88,6 +88,7 @@ uInt8 CartridgeEFSC::peek(uInt16 address) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool CartridgeEFSC::poke(uInt16 address, uInt8 value) { + uInt16 pokeAddress = address; address &= 0x0FFF; // Switch banks if necessary @@ -97,7 +98,7 @@ bool CartridgeEFSC::poke(uInt16 address, uInt8 value) return false; } - pokeRAM(myRAM[address & 0x007F], address, value); + pokeRAM(myRAM[address & 0x007F], pokeAddress, value); return true; } diff --git a/src/emucore/CartF4SC.cxx b/src/emucore/CartF4SC.cxx index 856f806cd..82291f1a2 100644 --- a/src/emucore/CartF4SC.cxx +++ b/src/emucore/CartF4SC.cxx @@ -88,6 +88,7 @@ uInt8 CartridgeF4SC::peek(uInt16 address) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool CartridgeF4SC::poke(uInt16 address, uInt8 value) { + uInt16 pokeAddress = address; address &= 0x0FFF; // Switch banks if necessary @@ -97,7 +98,7 @@ bool CartridgeF4SC::poke(uInt16 address, uInt8 value) return false; } - pokeRAM(myRAM[address & 0x007F], address, value); + pokeRAM(myRAM[address & 0x007F], pokeAddress, value); return true; } diff --git a/src/emucore/CartF6SC.cxx b/src/emucore/CartF6SC.cxx index 56903242a..011c9b535 100644 --- a/src/emucore/CartF6SC.cxx +++ b/src/emucore/CartF6SC.cxx @@ -111,10 +111,8 @@ uInt8 CartridgeF6SC::peek(uInt16 address) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool CartridgeF6SC::poke(uInt16 address, uInt8 value) { - address &= 0x0FFF; - // Switch banks if necessary - switch(address) + switch(address & 0x0FFF) { case 0x0FF6: // Set the current bank to the first 4k bank