diff --git a/Changes.txt b/Changes.txt index 80f7d1537..3f429b6c5 100644 --- a/Changes.txt +++ b/Changes.txt @@ -15,7 +15,9 @@ 4.1.1 to 4.2: (xxx xx, 2014) * Fixed 'MDM' scheme to trigger bankswitching on writes to hotspots - (previously it only triggered on reads). + (previously it only triggered on reads). Also, the scheme has been + modified as originally designed by E. Blink; hotspots are now in the + range $800-$BFF instead of $800-$FFF. -Have fun! diff --git a/src/emucore/CartMDM.cxx b/src/emucore/CartMDM.cxx index 13d0a5764..b1b43a85e 100644 --- a/src/emucore/CartMDM.cxx +++ b/src/emucore/CartMDM.cxx @@ -89,7 +89,8 @@ uInt8 CartridgeMDM::peek(uInt16 address) { // Because of the way we've set up accessing above, we can only // get here when the addresses are from 0x800 - 0xFFF - bank(address & 0x0FF); + if(address < 0xC00) + bank(address & 0x0FF); int hotspot = ((address & 0x0F00) >> 8) - 8; return myHotSpotPageAccess[hotspot].device->peek(address); @@ -102,7 +103,8 @@ bool CartridgeMDM::poke(uInt16 address, uInt8 value) // about those below $1000 if(!(address & 0x1000)) { - bank(address & 0x0FF); + if(address < 0xC00) + bank(address & 0x0FF); int hotspot = ((address & 0x0F00) >> 8) - 8; myHotSpotPageAccess[hotspot].device->poke(address, value); diff --git a/src/emucore/CartMDM.hxx b/src/emucore/CartMDM.hxx index 6c5b194af..ab1f90a9c 100644 --- a/src/emucore/CartMDM.hxx +++ b/src/emucore/CartMDM.hxx @@ -33,7 +33,10 @@ http://atariage.com/forums/topic/56073-cheap-2k4k-x-in-1-menu-driven-multicart-for-atari-2600 - The hotspots in this scheme are read/write at addresses $800 to $FFF, where + Note that this code implements a modified scheme (as designed by E. Blink). + In this version, the hotspots are from $800 to $BFF instead of $800 to $FFF. + + The hotspots in this scheme are read/write at addresses $800 to $BFF, where the lower byte determines the actual 4K bank switch to. In the current implementation, only 128 banks are supported, so selecting bank 128+ results in further bankswitching being locked. A reset line is used to reset to