diff --git a/src/emucore/CartDFSC.cxx b/src/emucore/CartDFSC.cxx index f65f97b11..86425c376 100644 --- a/src/emucore/CartDFSC.cxx +++ b/src/emucore/CartDFSC.cxx @@ -98,8 +98,19 @@ bool CartridgeDFSC::poke(uInt16 address, uInt8 value) return false; } - pokeRAM(myRAM[address & 0x007F], pokeAddress, value); - return true; + if(!(address & 0x080)) + { + pokeRAM(myRAM[address & 0x007F], pokeAddress, value); + return true; + } + else + { + // Writing to the read port should be ignored, but (TODO) trigger a break if option enabled + uInt8 dummy; + + pokeRAM(dummy, pokeAddress, value); + return false; + } } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/CartFA.cxx b/src/emucore/CartFA.cxx index 140277a93..2e888d393 100644 --- a/src/emucore/CartFA.cxx +++ b/src/emucore/CartFA.cxx @@ -128,8 +128,19 @@ bool CartridgeFA::poke(uInt16 address, uInt8 value) break; } - pokeRAM(myRAM[address & 0x00FF], address, value); - return true; + if (!(address & 0x100)) + { + pokeRAM(myRAM[address & 0x00FF], address, value); + return true; + } + else + { + // Writing to the read port should be ignored, but (TODO) trigger a break if option enabled + uInt8 dummy; + + pokeRAM(dummy, address, value); + return false; + } } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/CartFA2.cxx b/src/emucore/CartFA2.cxx index 038d72a07..2f51d4534 100644 --- a/src/emucore/CartFA2.cxx +++ b/src/emucore/CartFA2.cxx @@ -195,8 +195,19 @@ bool CartridgeFA2::poke(uInt16 address, uInt8 value) break; } - pokeRAM(myRAM[address & 0x00FF], address, value); - return true; + if(!(address & 0x100)) + { + pokeRAM(myRAM[address & 0x00FF], address, value); + return true; + } + else + { + // Writing to the read port should be ignored, but (TODO) trigger a break if option enabled + uInt8 dummy; + + pokeRAM(dummy, address, value); + return false; + } } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/CartWD.cxx b/src/emucore/CartWD.cxx index 1391ac0d9..1bb1914f3 100644 --- a/src/emucore/CartWD.cxx +++ b/src/emucore/CartWD.cxx @@ -129,9 +129,21 @@ bool CartridgeWD::poke(uInt16 address, uInt8 value) if(!(address & 0x1000)) // TIA addresses return mySystem->tia().poke(address, value); else - pokeRAM(myRAM[address & 0x003F], address, value); + { + if(address & 0x040) + { + pokeRAM(myRAM[address & 0x003F], address, value); + return true; + } + else + { + // Writing to the read port should be ignored, but (TODO) trigger a break if option enabled + uInt8 dummy; - return true; + pokeRAM(dummy, address, value); + return false; + } + } } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -