diff --git a/stella/src/debugger/Debugger.cxx b/stella/src/debugger/Debugger.cxx index 0cb24f048..7120f6a9d 100644 --- a/stella/src/debugger/Debugger.cxx +++ b/stella/src/debugger/Debugger.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: Debugger.cxx,v 1.97 2005-10-11 19:38:10 stephena Exp $ +// $Id: Debugger.cxx,v 1.98 2005-10-12 03:32:28 urchlay Exp $ //============================================================================ #include "bspf.hxx" @@ -673,9 +673,11 @@ int Debugger::step() saveOldState(); int cyc = mySystem->cycles(); - mySystem->unlockDataBus(); + // mySystem->unlockDataBus(); + unlockState(); myOSystem->console().mediaSource().updateScanlineByStep(); - mySystem->lockDataBus(); + // mySystem->lockDataBus(); + unlockState(); return mySystem->cycles() - cyc; } @@ -700,9 +702,11 @@ int Debugger::trace() int cyc = mySystem->cycles(); int targetPC = myCpuDebug->pc() + 3; // return address - mySystem->unlockDataBus(); + // mySystem->unlockDataBus(); + unlockState(); myOSystem->console().mediaSource().updateScanlineByTrace(targetPC); - mySystem->lockDataBus(); + // mySystem->lockDataBus(); + lockState(); return mySystem->cycles() - cyc; } else { @@ -834,18 +838,22 @@ void Debugger::disassemble(IntArray& addr, StringList& addrLabel, void Debugger::nextScanline(int lines) { saveOldState(); - mySystem->unlockDataBus(); + // mySystem->unlockDataBus(); + unlockState(); myTiaOutput->advanceScanline(lines); - mySystem->lockDataBus(); + // mySystem->lockDataBus(); + lockState(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Debugger::nextFrame(int frames) { saveOldState(); - mySystem->unlockDataBus(); + // mySystem->unlockDataBus(); + unlockState(); myTiaOutput->advance(frames); - mySystem->lockDataBus(); + // mySystem->lockDataBus(); + lockState(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -946,14 +954,16 @@ void Debugger::saveOldState() void Debugger::setStartState() { // Lock the bus each time the debugger is entered, so we don't disturb anything - mySystem->lockDataBus(); + // mySystem->lockDataBus(); + lockState(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Debugger::setQuitState() { // Bus must be unlocked for normal operation when leaving debugger mode - mySystem->unlockDataBus(); + // mySystem->unlockDataBus(); + unlockState(); // execute one instruction on quit. If we're // sitting at a breakpoint/trap, this will get us past it. @@ -1116,3 +1126,15 @@ bool Debugger::saveROM(string filename) delete out; return res; } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Debugger::lockState() { + mySystem->lockDataBus(); + myConsole->cartridge().lockBank(); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Debugger::unlockState() { + mySystem->unlockDataBus(); + myConsole->cartridge().unlockBank(); +} diff --git a/stella/src/debugger/Debugger.hxx b/stella/src/debugger/Debugger.hxx index 7bc632f23..9bea278d8 100644 --- a/stella/src/debugger/Debugger.hxx +++ b/stella/src/debugger/Debugger.hxx @@ -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: Debugger.hxx,v 1.79 2005-10-11 17:14:34 stephena Exp $ +// $Id: Debugger.hxx,v 1.80 2005-10-12 03:32:28 urchlay Exp $ //============================================================================ #ifndef DEBUGGER_HXX @@ -79,7 +79,7 @@ typedef uInt16 (Debugger::*DEBUGGER_WORD_METHOD)(); for all debugging operations in Stella (parser, 6502 debugger, etc). @author Stephen Anthony - @version $Id: Debugger.hxx,v 1.79 2005-10-11 17:14:34 stephena Exp $ + @version $Id: Debugger.hxx,v 1.80 2005-10-12 03:32:28 urchlay Exp $ */ class Debugger : public DialogContainer { @@ -278,6 +278,9 @@ class Debugger : public DialogContainer bool setBank(int bank); bool patchROM(int addr, int value); + void lockState(); + void unlockState(); + private: /** Save state of each debugger subsystem diff --git a/stella/src/debugger/gui/RomWidget.cxx b/stella/src/debugger/gui/RomWidget.cxx index 7facd7119..f7eb8d4d5 100644 --- a/stella/src/debugger/gui/RomWidget.cxx +++ b/stella/src/debugger/gui/RomWidget.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: RomWidget.cxx,v 1.8 2005-10-06 17:28:55 stephena Exp $ +// $Id: RomWidget.cxx,v 1.9 2005-10-12 03:32:28 urchlay Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -138,6 +138,18 @@ void RomWidget::loadConfig() // Take mirroring of PC into account int pc = dbg.cpuDebug().pc() | 0xe000; AddrToLine::iterator iter = myLineList.find(pc); + + // if current PC not found, do an update (we're executing what + // we thought was an operand) + + // This doesn't help, and seems to actually hurt. + /* + if(iter == myLineList.end()) { + incrementalUpdate(myRomList->currentPos(), myRomList->rows()); + iter = myLineList.find(pc); + } + */ + if(iter != myLineList.end()) myRomList->setHighlighted(iter->second); } diff --git a/stella/src/emucore/Cart.hxx b/stella/src/emucore/Cart.hxx index ea1ebf4bb..a7c0c5442 100644 --- a/stella/src/emucore/Cart.hxx +++ b/stella/src/emucore/Cart.hxx @@ -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: Cart.hxx,v 1.8 2005-07-30 16:25:48 urchlay Exp $ +// $Id: Cart.hxx,v 1.9 2005-10-12 03:32:28 urchlay Exp $ //============================================================================ #ifndef CARTRIDGE_HXX @@ -32,7 +32,7 @@ class System; game and handles any bankswitching performed by the cartridge. @author Bradford W. Mott - @version $Id: Cart.hxx,v 1.8 2005-07-30 16:25:48 urchlay Exp $ + @version $Id: Cart.hxx,v 1.9 2005-10-12 03:32:28 urchlay Exp $ */ class Cartridge : public Device { @@ -66,8 +66,16 @@ class Cartridge : public Device virtual bool patch(uInt16 address, uInt8 value); // yes, this writes to ROM bool save(ofstream& out); // need a way to save patched ROMs virtual uInt8* getImage(int& size); // save() uses this + void lockBank() { bankLocked = true; } + void unlockBank() { bankLocked = false; } + + protected: + // If bankLocked is true, ignore attempts at bankswitching. This is used + // by the debugger, when disassembling/dumping ROM. + bool bankLocked; private: + /** Try to auto-detect the bankswitching type of the cartridge diff --git a/stella/src/emucore/Cart3E.cxx b/stella/src/emucore/Cart3E.cxx index cbe6bbd62..d8ca5637d 100644 --- a/stella/src/emucore/Cart3E.cxx +++ b/stella/src/emucore/Cart3E.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: Cart3E.cxx,v 1.7 2005-10-09 17:31:47 stephena Exp $ +// $Id: Cart3E.cxx,v 1.8 2005-10-12 03:32:28 urchlay Exp $ //============================================================================ #include @@ -162,6 +162,8 @@ bool Cartridge3E::patch(uInt16 address, uInt8 value) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Cartridge3E::bank(uInt16 bank) { + if(bankLocked) return; + if(bank < 256) { // Make sure the bank they're asking for is reasonable diff --git a/stella/src/emucore/Cart3F.cxx b/stella/src/emucore/Cart3F.cxx index 15de4bd7c..6fd267449 100644 --- a/stella/src/emucore/Cart3F.cxx +++ b/stella/src/emucore/Cart3F.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: Cart3F.cxx,v 1.10 2005-07-30 16:58:22 urchlay Exp $ +// $Id: Cart3F.cxx,v 1.11 2005-10-12 03:32:28 urchlay Exp $ //============================================================================ #include @@ -140,6 +140,8 @@ bool Cartridge3F::patch(uInt16 address, uInt8 value) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Cartridge3F::bank(uInt16 bank) { + if(bankLocked) return; + // Make sure the bank they're asking for is reasonable if((uInt32)bank * 2048 < mySize) { diff --git a/stella/src/emucore/CartAR.cxx b/stella/src/emucore/CartAR.cxx index f305ee2e1..3655e604e 100644 --- a/stella/src/emucore/CartAR.cxx +++ b/stella/src/emucore/CartAR.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: CartAR.cxx,v 1.11 2005-10-09 17:31:47 stephena Exp $ +// $Id: CartAR.cxx,v 1.12 2005-10-12 03:32:28 urchlay Exp $ //============================================================================ #include @@ -299,6 +299,8 @@ void CartridgeAR::bankConfiguration(uInt8 configuration) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void CartridgeAR::bank(uInt16 b) { + if(bankLocked) return; + bankConfiguration(b); } diff --git a/stella/src/emucore/CartDPC.cxx b/stella/src/emucore/CartDPC.cxx index 1646c0f51..0d4f890a8 100644 --- a/stella/src/emucore/CartDPC.cxx +++ b/stella/src/emucore/CartDPC.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: CartDPC.cxx,v 1.13 2005-10-09 17:31:47 stephena Exp $ +// $Id: CartDPC.cxx,v 1.14 2005-10-12 03:32:28 urchlay Exp $ //============================================================================ #include @@ -438,6 +438,8 @@ bool CartridgeDPC::patch(uInt16 address, uInt8 value) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void CartridgeDPC::bank(uInt16 bank) { + if(bankLocked) return; + // Remember what bank we're in myCurrentBank = bank; uInt16 offset = myCurrentBank * 4096; diff --git a/stella/src/emucore/CartE0.cxx b/stella/src/emucore/CartE0.cxx index a8ef4f180..e04955970 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.8 2005-07-30 16:58:22 urchlay Exp $ +// $Id: CartE0.cxx,v 1.9 2005-10-12 03:32:28 urchlay Exp $ //============================================================================ #include @@ -95,18 +95,20 @@ uInt8 CartridgeE0::peek(uInt16 address) { address = address & 0x0FFF; - // Switch banks if necessary - if((address >= 0x0FE0) && (address <= 0x0FE7)) - { - segmentZero(address & 0x0007); - } - else if((address >= 0x0FE8) && (address <= 0x0FEF)) - { - segmentOne(address & 0x0007); - } - else if((address >= 0x0FF0) && (address <= 0x0FF7)) - { - segmentTwo(address & 0x0007); + if(!bankLocked) { + // Switch banks if necessary + if((address >= 0x0FE0) && (address <= 0x0FE7)) + { + segmentZero(address & 0x0007); + } + else if((address >= 0x0FE8) && (address <= 0x0FEF)) + { + segmentOne(address & 0x0007); + } + else if((address >= 0x0FF0) && (address <= 0x0FF7)) + { + segmentTwo(address & 0x0007); + } } return myImage[(myCurrentSlice[address >> 10] << 10) + (address & 0x03FF)]; @@ -117,18 +119,20 @@ void CartridgeE0::poke(uInt16 address, uInt8) { address = address & 0x0FFF; - // Switch banks if necessary - if((address >= 0x0FE0) && (address <= 0x0FE7)) - { - segmentZero(address & 0x0007); - } - else if((address >= 0x0FE8) && (address <= 0x0FEF)) - { - segmentOne(address & 0x0007); - } - else if((address >= 0x0FF0) && (address <= 0x0FF7)) - { - segmentTwo(address & 0x0007); + if(!bankLocked) { + // Switch banks if necessary + if((address >= 0x0FE0) && (address <= 0x0FE7)) + { + segmentZero(address & 0x0007); + } + else if((address >= 0x0FE8) && (address <= 0x0FEF)) + { + segmentOne(address & 0x0007); + } + else if((address >= 0x0FF0) && (address <= 0x0FF7)) + { + segmentTwo(address & 0x0007); + } } } diff --git a/stella/src/emucore/CartE7.cxx b/stella/src/emucore/CartE7.cxx index 6aec485e3..6d97c6566 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.11 2005-10-09 17:31:47 stephena Exp $ +// $Id: CartE7.cxx,v 1.12 2005-10-12 03:32:28 urchlay Exp $ //============================================================================ #include @@ -149,6 +149,8 @@ bool CartridgeE7::patch(uInt16 address, uInt8 value) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void CartridgeE7::bank(uInt16 slice) { + if(bankLocked) return; + // Remember what bank we're in myCurrentSlice[0] = slice; uInt16 offset = slice << 11; diff --git a/stella/src/emucore/CartF4.cxx b/stella/src/emucore/CartF4.cxx index 8601b8a81..1ce945135 100644 --- a/stella/src/emucore/CartF4.cxx +++ b/stella/src/emucore/CartF4.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: CartF4.cxx,v 1.5 2005-07-30 16:58:22 urchlay Exp $ +// $Id: CartF4.cxx,v 1.6 2005-10-12 03:32:28 urchlay Exp $ //============================================================================ #include @@ -113,6 +113,8 @@ bool CartridgeF4::patch(uInt16 address, uInt8 value) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void CartridgeF4::bank(uInt16 bank) { + if(bankLocked) return; + // Remember what bank we're in myCurrentBank = bank; uInt16 offset = myCurrentBank * 4096; diff --git a/stella/src/emucore/CartF4SC.cxx b/stella/src/emucore/CartF4SC.cxx index 8d1884917..bfbd1d487 100644 --- a/stella/src/emucore/CartF4SC.cxx +++ b/stella/src/emucore/CartF4SC.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: CartF4SC.cxx,v 1.8 2005-10-09 17:31:47 stephena Exp $ +// $Id: CartF4SC.cxx,v 1.9 2005-10-12 03:32:28 urchlay Exp $ //============================================================================ #include @@ -143,6 +143,8 @@ bool CartridgeF4SC::patch(uInt16 address, uInt8 value) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void CartridgeF4SC::bank(uInt16 bank) { + if(bankLocked) return; + // Remember what bank we're in myCurrentBank = bank; uInt16 offset = myCurrentBank * 4096; diff --git a/stella/src/emucore/CartF6.cxx b/stella/src/emucore/CartF6.cxx index b836369bc..0001a620d 100644 --- a/stella/src/emucore/CartF6.cxx +++ b/stella/src/emucore/CartF6.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: CartF6.cxx,v 1.8 2005-07-30 16:58:22 urchlay Exp $ +// $Id: CartF6.cxx,v 1.9 2005-10-12 03:32:28 urchlay Exp $ //============================================================================ #include @@ -154,6 +154,8 @@ bool CartridgeF6::patch(uInt16 address, uInt8 value) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void CartridgeF6::bank(uInt16 bank) { + if(bankLocked) return; + // Remember what bank we're in myCurrentBank = bank; uInt16 offset = myCurrentBank * 4096; diff --git a/stella/src/emucore/CartF6SC.cxx b/stella/src/emucore/CartF6SC.cxx index 8787c73d6..b7857d46a 100644 --- a/stella/src/emucore/CartF6SC.cxx +++ b/stella/src/emucore/CartF6SC.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: CartF6SC.cxx,v 1.8 2005-10-09 17:31:47 stephena Exp $ +// $Id: CartF6SC.cxx,v 1.9 2005-10-12 03:32:28 urchlay Exp $ //============================================================================ #include @@ -187,6 +187,8 @@ bool CartridgeF6SC::patch(uInt16 address, uInt8 value) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void CartridgeF6SC::bank(uInt16 bank) { + if(bankLocked) return; + // Remember what bank we're in myCurrentBank = bank; uInt16 offset = myCurrentBank * 4096; diff --git a/stella/src/emucore/CartF8.cxx b/stella/src/emucore/CartF8.cxx index d9be244ab..3b59cec55 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.8 2005-07-30 16:58:22 urchlay Exp $ +// $Id: CartF8.cxx,v 1.9 2005-10-12 03:32:28 urchlay Exp $ //============================================================================ #include @@ -135,6 +135,10 @@ bool CartridgeF8::patch(uInt16 address, uInt8 value) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void CartridgeF8::bank(uInt16 bank) { + if(bankLocked) return; + + cerr << "CartF8: switching bank..." << endl; + // Remember what bank we're in myCurrentBank = bank; uInt16 offset = myCurrentBank * 4096; diff --git a/stella/src/emucore/CartF8SC.cxx b/stella/src/emucore/CartF8SC.cxx index 22069c4d3..d8def5b9b 100644 --- a/stella/src/emucore/CartF8SC.cxx +++ b/stella/src/emucore/CartF8SC.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: CartF8SC.cxx,v 1.7 2005-10-09 17:31:47 stephena Exp $ +// $Id: CartF8SC.cxx,v 1.8 2005-10-12 03:32:28 urchlay Exp $ //============================================================================ #include @@ -106,21 +106,23 @@ uInt8 CartridgeF8SC::peek(uInt16 address) { address = address & 0x0FFF; - // Switch banks if necessary - switch(address) - { - case 0x0FF8: - // Set the current bank to the lower 4k bank - bank(0); - break; - - case 0x0FF9: - // Set the current bank to the upper 4k bank - bank(1); - break; - - default: - break; + if(!bankLocked) { + // Switch banks if necessary + switch(address) + { + case 0x0FF8: + // Set the current bank to the lower 4k bank + bank(0); + break; + + case 0x0FF9: + // Set the current bank to the upper 4k bank + bank(1); + break; + + default: + break; + } } // NOTE: This does not handle accessing RAM, however, this function @@ -134,21 +136,23 @@ void CartridgeF8SC::poke(uInt16 address, uInt8) { address = address & 0x0FFF; - // Switch banks if necessary - switch(address) - { - case 0x0FF8: - // Set the current bank to the lower 4k bank - bank(0); - break; - - case 0x0FF9: - // Set the current bank to the upper 4k bank - bank(1); - break; - - default: - break; + if(!bankLocked) { + // Switch banks if necessary + switch(address) + { + case 0x0FF8: + // Set the current bank to the lower 4k bank + bank(0); + break; + + case 0x0FF9: + // Set the current bank to the upper 4k bank + bank(1); + break; + + default: + break; + } } // NOTE: This does not handle accessing RAM, however, this function diff --git a/stella/src/emucore/CartFASC.cxx b/stella/src/emucore/CartFASC.cxx index 5d8da5ec0..834a47647 100644 --- a/stella/src/emucore/CartFASC.cxx +++ b/stella/src/emucore/CartFASC.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: CartFASC.cxx,v 1.7 2005-10-09 17:31:47 stephena Exp $ +// $Id: CartFASC.cxx,v 1.8 2005-10-12 03:32:28 urchlay Exp $ //============================================================================ #include @@ -177,6 +177,8 @@ bool CartridgeFASC::patch(uInt16 address, uInt8 value) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void CartridgeFASC::bank(uInt16 bank) { + if(bankLocked) return; + // Remember what bank we're in myCurrentBank = bank; uInt16 offset = myCurrentBank * 4096; diff --git a/stella/src/emucore/CartMB.cxx b/stella/src/emucore/CartMB.cxx index bbf4ae2e1..aff415a6b 100644 --- a/stella/src/emucore/CartMB.cxx +++ b/stella/src/emucore/CartMB.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: CartMB.cxx,v 1.6 2005-07-30 16:58:22 urchlay Exp $ +// $Id: CartMB.cxx,v 1.7 2005-10-12 03:32:28 urchlay Exp $ //============================================================================ #include @@ -108,6 +108,8 @@ bool CartridgeMB::patch(uInt16 address, uInt8 value) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void CartridgeMB::incbank() { + if(bankLocked) return; + // Remember what bank we're in myCurrentBank ++; myCurrentBank &= 0x0F; diff --git a/stella/src/emucore/CartUA.cxx b/stella/src/emucore/CartUA.cxx index 0bce66891..900227822 100644 --- a/stella/src/emucore/CartUA.cxx +++ b/stella/src/emucore/CartUA.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: CartUA.cxx,v 1.5 2005-07-30 16:58:22 urchlay Exp $ +// $Id: CartUA.cxx,v 1.6 2005-10-12 03:32:28 urchlay Exp $ //============================================================================ #include @@ -149,6 +149,8 @@ bool CartridgeUA::patch(uInt16 address, uInt8 value) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void CartridgeUA::bank(uInt16 bank) { + if(bankLocked) return; + // Remember what bank we're in myCurrentBank = bank; uInt16 offset = myCurrentBank * 4096;