diff --git a/stella/src/emucore/CartE0.cxx b/stella/src/emucore/CartE0.cxx index 935374c9a..247dab76d 100644 --- a/stella/src/emucore/CartE0.cxx +++ b/stella/src/emucore/CartE0.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartE0.cxx,v 1.6 2005-06-28 01:15:17 urchlay Exp $ +// $Id: CartE0.cxx,v 1.7 2005-06-28 01:31:32 urchlay Exp $ //============================================================================ #include @@ -135,6 +135,7 @@ void CartridgeE0::poke(uInt16 address, uInt8) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool CartridgeE0::patch(uInt16 address, uInt8 value) { + address = address & 0x0FFF; myImage[(myCurrentSlice[address >> 10] << 10) + (address & 0x03FF)] = value; return true; } diff --git a/stella/src/emucore/CartE7.cxx b/stella/src/emucore/CartE7.cxx index e0be44325..c2c05fd74 100644 --- a/stella/src/emucore/CartE7.cxx +++ b/stella/src/emucore/CartE7.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartE7.cxx,v 1.8 2005-06-28 01:15:17 urchlay Exp $ +// $Id: CartE7.cxx,v 1.9 2005-06-28 01:31:32 urchlay Exp $ //============================================================================ #include @@ -140,7 +140,9 @@ void CartridgeE7::poke(uInt16 address, uInt8) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool CartridgeE7::patch(uInt16 address, uInt8 value) { + address = address & 0x0FFF; myImage[(myCurrentSlice[address >> 11] << 11) + (address & 0x07FF)] = value; + bank(myCurrentSlice[0]); return true; } diff --git a/stella/src/emucore/CartF8.cxx b/stella/src/emucore/CartF8.cxx index d212978d6..b2fcfe0f3 100644 --- a/stella/src/emucore/CartF8.cxx +++ b/stella/src/emucore/CartF8.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartF8.cxx,v 1.6 2005-06-27 23:40:36 urchlay Exp $ +// $Id: CartF8.cxx,v 1.7 2005-06-28 01:31:32 urchlay Exp $ //============================================================================ #include @@ -126,7 +126,9 @@ void CartridgeF8::poke(uInt16 address, uInt8) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool CartridgeF8::patch(uInt16 address, uInt8 value) { + address &= 0xfff; myImage[myCurrentBank * 4096 + address] = value; + bank(myCurrentBank); return true; }