renamed bank locked into hotspots locked

This commit is contained in:
Thomas Jentzsch 2021-10-16 17:30:39 +02:00
parent f5a29714a6
commit 6657f9de64
30 changed files with 67 additions and 67 deletions

View File

@ -1090,15 +1090,15 @@ string CartDebug::saveDisassembly(string path)
uInt16 oldBank = myConsole.cartridge().getBank(); uInt16 oldBank = myConsole.cartridge().getBank();
// prepare for switching banks // prepare for switching banks
myConsole.cartridge().unlockBank(); myConsole.cartridge().unlockHotspots();
uInt32 origin = 0; uInt32 origin = 0;
for(int bank = 0; bank < romBankCount; ++bank) for(int bank = 0; bank < romBankCount; ++bank)
{ {
// TODO: not every CartDebugWidget does it like that, we need a method // TODO: not every CartDebugWidget does it like that, we need a method
myConsole.cartridge().unlockBank(); myConsole.cartridge().unlockHotspots();
myConsole.cartridge().bank(bank); myConsole.cartridge().bank(bank);
myConsole.cartridge().lockBank(); myConsole.cartridge().lockHotspots();
BankInfo& info = myBankInfo[bank]; BankInfo& info = myBankInfo[bank];
@ -1196,9 +1196,9 @@ string CartDebug::saveDisassembly(string path)
buf << "\n"; buf << "\n";
} }
} }
myConsole.cartridge().unlockBank(); myConsole.cartridge().unlockHotspots();
myConsole.cartridge().bank(oldBank); myConsole.cartridge().bank(oldBank);
myConsole.cartridge().lockBank(); myConsole.cartridge().lockHotspots();
// Some boilerplate, similar to what DiStella adds // Some boilerplate, similar to what DiStella adds
auto timeinfo = BSPF::localTime(); auto timeinfo = BSPF::localTime();

View File

@ -917,14 +917,14 @@ void Debugger::getCompletions(const char* in, StringList& list) const
void Debugger::lockSystem() void Debugger::lockSystem()
{ {
mySystem.lockDataBus(); mySystem.lockDataBus();
myConsole.cartridge().lockBank(); myConsole.cartridge().lockHotspots();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Debugger::unlockSystem() void Debugger::unlockSystem()
{ {
mySystem.unlockDataBus(); mySystem.unlockDataBus();
myConsole.cartridge().unlockBank(); myConsole.cartridge().unlockHotspots();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -174,14 +174,14 @@ void Cartridge3EPlusWidget::handleCommand(CommandSender* sender,
uInt8 bank = myBankWidgets[segment]->getSelected(); uInt8 bank = myBankWidgets[segment]->getSelected();
myCart.unlockBank(); myCart.unlockHotspots();
if(myBankType[segment]->getSelectedTag() == "ROM") if(myBankType[segment]->getSelectedTag() == "ROM")
myCart.bank(bank, segment); myCart.bank(bank, segment);
else else
myCart.bank(bank + myCart.romBankCount(), segment); myCart.bank(bank + myCart.romBankCount(), segment);
myCart.lockBank(); myCart.lockHotspots();
invalidate(); invalidate();
updateUIState(); updateUIState();
break; break;

View File

@ -151,9 +151,9 @@ void Cartridge3EWidget::handleCommand(CommandSender* sender, int cmd, int data,
myBankWidgets[0]->setSelectedIndex(0); myBankWidgets[0]->setSelectedIndex(0);
} }
} }
myCart.unlockBank(); myCart.unlockHotspots();
myCart.bank(bank); myCart.bank(bank);
myCart.lockBank(); myCart.lockHotspots();
invalidate(); invalidate();
} }

View File

@ -169,7 +169,7 @@ void Cartridge4A50Widget::loadConfig()
void Cartridge4A50Widget::handleCommand(CommandSender* sender, void Cartridge4A50Widget::handleCommand(CommandSender* sender,
int cmd, int data, int id) int cmd, int data, int id)
{ {
myCart.unlockBank(); myCart.unlockHotspots();
switch(cmd) switch(cmd)
{ {
@ -261,7 +261,7 @@ void Cartridge4A50Widget::handleCommand(CommandSender* sender,
break; break;
} }
myCart.lockBank(); myCart.lockHotspots();
invalidate(); invalidate();
} }

View File

@ -98,9 +98,9 @@ void CartridgeARWidget::handleCommand(CommandSender* sender,
{ {
if(cmd == kBankChanged) if(cmd == kBankChanged)
{ {
myCart.unlockBank(); myCart.unlockHotspots();
myCart.bank(myBank->getSelected()); myCart.bank(myBank->getSelected());
myCart.lockBank(); myCart.lockHotspots();
invalidate(); invalidate();
} }
} }

View File

@ -380,9 +380,9 @@ void CartridgeBUSWidget::handleCommand(CommandSender* sender,
{ {
if(cmd == kBankChanged) if(cmd == kBankChanged)
{ {
myCart.unlockBank(); myCart.unlockHotspots();
myCart.bank(myBank->getSelected()); myCart.bank(myBank->getSelected());
myCart.lockBank(); myCart.lockHotspots();
invalidate(); invalidate();
} }
else else

View File

@ -393,9 +393,9 @@ void CartridgeCDFWidget::handleCommand(CommandSender* sender,
{ {
if(cmd == kBankChanged) if(cmd == kBankChanged)
{ {
myCart.unlockBank(); myCart.unlockHotspots();
myCart.bank(myBank->getSelected()); myCart.bank(myBank->getSelected());
myCart.lockBank(); myCart.lockHotspots();
invalidate(); invalidate();
} }
else else

View File

@ -210,11 +210,11 @@ void CartridgeCMWidget::handleCommand(CommandSender* sender,
{ {
if(cmd == kBankChanged) if(cmd == kBankChanged)
{ {
myCart.unlockBank(); myCart.unlockHotspots();
myCart.mySWCHA &= 0xFC; myCart.mySWCHA &= 0xFC;
myCart.mySWCHA |= myBank->getSelected(); myCart.mySWCHA |= myBank->getSelected();
myCart.bank(myCart.mySWCHA & 0x03); myCart.bank(myCart.mySWCHA & 0x03);
myCart.lockBank(); myCart.lockHotspots();
invalidate(); invalidate();
} }
} }

View File

@ -81,9 +81,9 @@ void CartridgeCTYWidget::handleCommand(CommandSender* sender,
{ {
if(cmd == kBankChanged) if(cmd == kBankChanged)
{ {
myCart.unlockBank(); myCart.unlockHotspots();
myCart.bank(myBank->getSelected()+1); myCart.bank(myBank->getSelected()+1);
myCart.lockBank(); myCart.lockHotspots();
invalidate(); invalidate();
} }
} }

View File

@ -321,9 +321,9 @@ void CartridgeDPCPlusWidget::handleCommand(CommandSender* sender,
{ {
if(cmd == kBankChanged) if(cmd == kBankChanged)
{ {
myCart.unlockBank(); myCart.unlockHotspots();
myCart.bank(myBank->getSelected()); myCart.bank(myBank->getSelected());
myCart.lockBank(); myCart.lockHotspots();
invalidate(); invalidate();
} }
else else

View File

@ -216,9 +216,9 @@ void CartridgeDPCWidget::handleCommand(CommandSender* sender,
{ {
if(cmd == kBankChanged) if(cmd == kBankChanged)
{ {
myCart.unlockBank(); myCart.unlockHotspots();
myCart.bank(myBank->getSelected()); myCart.bank(myBank->getSelected());
myCart.lockBank(); myCart.lockHotspots();
invalidate(); invalidate();
} }
} }

View File

@ -116,7 +116,7 @@ void CartridgeE7Widget::loadConfig()
void CartridgeE7Widget::handleCommand(CommandSender* sender, void CartridgeE7Widget::handleCommand(CommandSender* sender,
int cmd, int data, int id) int cmd, int data, int id)
{ {
myCart.unlockBank(); myCart.unlockHotspots();
switch(cmd) switch(cmd)
{ {
@ -130,7 +130,7 @@ void CartridgeE7Widget::handleCommand(CommandSender* sender,
break; break;
} }
myCart.lockBank(); myCart.lockHotspots();
invalidate(); invalidate();
} }

View File

@ -297,9 +297,9 @@ void CartridgeEnhancedWidget::handleCommand(CommandSender* sender,
{ {
if(cmd == kBankChanged) if(cmd == kBankChanged)
{ {
myCart.unlockBank(); myCart.unlockHotspots();
myCart.bank(myBankWidgets[id]->getSelected(), id); myCart.bank(myBankWidgets[id]->getSelected(), id);
myCart.lockBank(); myCart.lockHotspots();
invalidate(); invalidate();
} }
} }

View File

@ -100,7 +100,7 @@ uInt8 Cartridge::peekRAM(uInt8& dest, uInt16 address)
// Reading from the write port triggers an unwanted write // Reading from the write port triggers an unwanted write
// But this only happens when in normal emulation mode // But this only happens when in normal emulation mode
#ifdef DEBUGGER_SUPPORT #ifdef DEBUGGER_SUPPORT
if(!bankLocked() && !mySystem->autodetectMode()) if(!hotspotsLocked() && !mySystem->autodetectMode())
{ {
// Record access here; final determination will happen in ::pokeRAM() // Record access here; final determination will happen in ::pokeRAM()
myRamReadAccesses.push_back(address); myRamReadAccesses.push_back(address);

View File

@ -83,13 +83,13 @@ class Cartridge : public Device
bool saveROM(const FilesystemNode& out) const; bool saveROM(const FilesystemNode& out) const;
/** /**
Lock/unlock bankswitching capability. The debugger will lock Lock/unlock bankswitching and other hotspot capabilities. The debugger
the banks before querying the cart state, otherwise reading values will lock the hotspots before querying the cart state, otherwise reading
could inadvertantly cause a bankswitch to occur. values could inadvertantly cause e.g. a bankswitch to occur.
*/ */
void lockBank() { myBankLocked = true; } void lockHotspots() { myHotspotsLocked = true; }
void unlockBank() { myBankLocked = false; } void unlockHotspots() { myHotspotsLocked = false; }
bool bankLocked() const { return myBankLocked; } bool hotspotsLocked() const { return myHotspotsLocked; }
/** /**
Get the default startup bank for a cart. This is the bank where Get the default startup bank for a cart. This is the bank where
@ -420,9 +420,9 @@ class Cartridge : public Device
// The startup bank to use (where to look for the reset vector address) // The startup bank to use (where to look for the reset vector address)
uInt16 myStartBank{0}; uInt16 myStartBank{0};
// If myBankLocked is true, ignore attempts at bankswitching. This is used // If myHotspotsLocked is true, ignore attempts at bankswitching. This is used
// by the debugger, when disassembling/dumping ROM. // by the debugger, when disassembling/dumping ROM.
bool myBankLocked{false}; bool myHotspotsLocked{false};
// Semi-random values to use when a read from write port occurs // Semi-random values to use when a read from write port occurs
std::array<uInt8, 256> myRWPRandomValues; std::array<uInt8, 256> myRWPRandomValues;

View File

@ -112,7 +112,7 @@ uInt8 Cartridge4A50::peek(uInt16 address)
else if((address & 0x1f00) == 0x1f00) // 256B region from 0x1f00 - 0x1fff else if((address & 0x1f00) == 0x1f00) // 256B region from 0x1f00 - 0x1fff
{ {
value = myImage[(address & 0xff) + 0x1ff00]; value = myImage[(address & 0xff) + 0x1ff00];
if(!bankLocked() && ((myLastData & 0xe0) == 0x60) && if(!hotspotsLocked() && ((myLastData & 0xe0) == 0x60) &&
((myLastAddress >= 0x1000) || (myLastAddress < 0x200))) ((myLastAddress >= 0x1000) || (myLastAddress < 0x200)))
mySliceHigh = (mySliceHigh & 0xf0ff) | ((address & 0x8) << 8) | mySliceHigh = (mySliceHigh & 0xf0ff) | ((address & 0x8) << 8) |
((address & 0x70) << 4); ((address & 0x70) << 4);
@ -167,7 +167,7 @@ bool Cartridge4A50::poke(uInt16 address, uInt8 value)
} }
else if((address & 0x1f00) == 0x1f00) // 256B region at 0x1f00 - 0x1fff else if((address & 0x1f00) == 0x1f00) // 256B region at 0x1f00 - 0x1fff
{ {
if(!bankLocked() && ((myLastData & 0xe0) == 0x60) && if(!hotspotsLocked() && ((myLastData & 0xe0) == 0x60) &&
((myLastAddress >= 0x1000) || (myLastAddress < 0x200))) ((myLastAddress >= 0x1000) || (myLastAddress < 0x200)))
{ {
mySliceHigh = (mySliceHigh & 0xf0ff) | ((address & 0x8) << 8) | mySliceHigh = (mySliceHigh & 0xf0ff) | ((address & 0x8) << 8) |
@ -250,7 +250,7 @@ void Cartridge4A50::setAccessFlags(uInt16 address, Device::AccessFlags flags)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Cartridge4A50::checkBankSwitch(uInt16 address, uInt8 value) void Cartridge4A50::checkBankSwitch(uInt16 address, uInt8 value)
{ {
if(bankLocked()) return; if(hotspotsLocked()) return;
// This scheme contains so many hotspots that it's easier to just check // This scheme contains so many hotspots that it's easier to just check
// all of them // all of them

View File

@ -87,7 +87,7 @@ uInt8 CartridgeAR::peek(uInt16 addr)
{ {
// In debugger/bank-locked mode, we ignore all hotspots and in general // In debugger/bank-locked mode, we ignore all hotspots and in general
// anything that can change the internal state of the cart // anything that can change the internal state of the cart
if(bankLocked()) if(hotspotsLocked())
return myImage[(addr & 0x07FF) + myImageOffset[(addr & 0x0800) ? 1 : 0]]; return myImage[(addr & 0x07FF) + myImageOffset[(addr & 0x0800) ? 1 : 0]];
// Is the "dummy" SC BIOS hotspot for reading a load being accessed? // Is the "dummy" SC BIOS hotspot for reading a load being accessed?
@ -354,7 +354,7 @@ void CartridgeAR::loadIntoRAM(uInt8 load)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeAR::bank(uInt16 bank, uInt16) bool CartridgeAR::bank(uInt16 bank, uInt16)
{ {
if(!bankLocked()) if(!hotspotsLocked())
return bankConfiguration(uInt8(bank)); return bankConfiguration(uInt8(bank));
else else
return false; return false;

View File

@ -202,7 +202,7 @@ uInt8 CartridgeBUS::peek(uInt16 address)
// In debugger/bank-locked mode, we ignore all hotspots and in general // In debugger/bank-locked mode, we ignore all hotspots and in general
// anything that can change the internal state of the cart // anything that can change the internal state of the cart
if(bankLocked()) if(hotspotsLocked())
return peekvalue; return peekvalue;
// implement JMP FASTJMP which fetches the destination address from stream 17 // implement JMP FASTJMP which fetches the destination address from stream 17
@ -434,7 +434,7 @@ bool CartridgeBUS::poke(uInt16 address, uInt8 value)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeBUS::bank(uInt16 bank, uInt16) bool CartridgeBUS::bank(uInt16 bank, uInt16)
{ {
if(bankLocked()) return false; if(hotspotsLocked()) return false;
// Remember what bank we're in // Remember what bank we're in
myBankOffset = bank << 12; myBankOffset = bank << 12;

View File

@ -233,7 +233,7 @@ uInt8 CartridgeCDF::peek(uInt16 address)
// In debugger/bank-locked mode, we ignore all hotspots and in general // In debugger/bank-locked mode, we ignore all hotspots and in general
// anything that can change the internal state of the cart // anything that can change the internal state of the cart
if(bankLocked()) if(hotspotsLocked())
return peekvalue; return peekvalue;
// implement JMP FASTJMP which fetches the destination address from stream 33 // implement JMP FASTJMP which fetches the destination address from stream 33
@ -453,7 +453,7 @@ bool CartridgeCDF::poke(uInt16 address, uInt8 value)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeCDF::bank(uInt16 bank, uInt16) bool CartridgeCDF::bank(uInt16 bank, uInt16)
{ {
if(bankLocked()) return false; if(hotspotsLocked()) return false;
// Remember what bank we're in // Remember what bank we're in
myBankOffset = bank << 12; myBankOffset = bank << 12;

View File

@ -101,7 +101,7 @@ uInt8 CartridgeCM::column() const
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeCM::bank(uInt16 bank, uInt16) bool CartridgeCM::bank(uInt16 bank, uInt16)
{ {
if(bankLocked()) return false; if(hotspotsLocked()) return false;
// Remember what bank we're in // Remember what bank we're in
myBankOffset = bank << 12; myBankOffset = bank << 12;

View File

@ -103,7 +103,7 @@ uInt8 CartridgeCTY::peek(uInt16 address)
// In debugger/bank-locked mode, we ignore all hotspots and in general // In debugger/bank-locked mode, we ignore all hotspots and in general
// anything that can change the internal state of the cart // anything that can change the internal state of the cart
if(bankLocked()) if(hotspotsLocked())
return peekValue; return peekValue;
// Check for aliasing to 'LDA #$F2' // Check for aliasing to 'LDA #$F2'
@ -248,7 +248,7 @@ bool CartridgeCTY::poke(uInt16 address, uInt8 value)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeCTY::bank(uInt16 bank, uInt16) bool CartridgeCTY::bank(uInt16 bank, uInt16)
{ {
if(bankLocked()) return false; if(hotspotsLocked()) return false;
// Remember what bank we're in // Remember what bank we're in
myBankOffset = bank << 12; myBankOffset = bank << 12;
@ -382,7 +382,7 @@ uInt8 CartridgeCTY::ramReadWrite()
1 s for write). 1 s for write).
*/ */
if(bankLocked()) return 0xff; if(hotspotsLocked()) return 0xff;
// First access sets the timer // First access sets the timer
if(myRamAccessTimeout == 0) if(myRamAccessTimeout == 0)

View File

@ -143,7 +143,7 @@ uInt8 CartridgeDPC::peek(uInt16 address)
// In debugger/bank-locked mode, we ignore all hotspots and in general // In debugger/bank-locked mode, we ignore all hotspots and in general
// anything that can change the internal state of the cart // anything that can change the internal state of the cart
if(bankLocked()) if(hotspotsLocked())
return myImage[myCurrentSegOffset[0] + address]; return myImage[myCurrentSegOffset[0] + address];

View File

@ -240,7 +240,7 @@ uInt8 CartridgeDPCPlus::peek(uInt16 address)
// In debugger/bank-locked mode, we ignore all hotspots and in general // In debugger/bank-locked mode, we ignore all hotspots and in general
// anything that can change the internal state of the cart // anything that can change the internal state of the cart
if(bankLocked()) if(hotspotsLocked())
return peekvalue; return peekvalue;
// Check if we're in Fast Fetch mode and the prior byte was an A9 (LDA #value) // Check if we're in Fast Fetch mode and the prior byte was an A9 (LDA #value)
@ -614,7 +614,7 @@ bool CartridgeDPCPlus::poke(uInt16 address, uInt8 value)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeDPCPlus::bank(uInt16 bank, uInt16) bool CartridgeDPCPlus::bank(uInt16 bank, uInt16)
{ {
if(bankLocked()) return false; if(hotspotsLocked()) return false;
// Remember what bank we're in // Remember what bank we're in
myBankOffset = bank << 12; myBankOffset = bank << 12;

View File

@ -212,7 +212,7 @@ bool CartridgeE7::poke(uInt16 address, uInt8 value)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeE7::bankRAM(uInt16 bank) void CartridgeE7::bankRAM(uInt16 bank)
{ {
if(bankLocked()) return; if(hotspotsLocked()) return;
// Remember what bank we're in // Remember what bank we're in
myCurrentRAM = bank; myCurrentRAM = bank;
@ -230,7 +230,7 @@ void CartridgeE7::bankRAM(uInt16 bank)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeE7::bank(uInt16 bank, uInt16) bool CartridgeE7::bank(uInt16 bank, uInt16)
{ {
if(bankLocked()) return false; if(hotspotsLocked()) return false;
// Remember what bank we're in // Remember what bank we're in
myCurrentBank[0] = bank; myCurrentBank[0] = bank;

View File

@ -234,7 +234,7 @@ bool CartridgeEnhanced::poke(uInt16 address, uInt8 value)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeEnhanced::bank(uInt16 bank, uInt16 segment) bool CartridgeEnhanced::bank(uInt16 bank, uInt16 segment)
{ {
if(bankLocked()) return false; if(hotspotsLocked()) return false;
const uInt16 segmentOffset = segment << myBankShift; const uInt16 segmentOffset = segment << myBankShift;

View File

@ -57,7 +57,7 @@ uInt8 CartridgeFA2::peek(uInt16 address)
if((address & ROM_MASK) == 0x0FF4) if((address & ROM_MASK) == 0x0FF4)
{ {
// Load/save RAM to/from Harmony cart flash // Load/save RAM to/from Harmony cart flash
if(mySize == 28_KB && !bankLocked()) if(mySize == 28_KB && !hotspotsLocked())
return ramReadWrite(); return ramReadWrite();
} }
@ -70,7 +70,7 @@ bool CartridgeFA2::poke(uInt16 address, uInt8 value)
if((address & ROM_MASK) == 0x0FF4) if((address & ROM_MASK) == 0x0FF4)
{ {
// Load/save RAM to/from Harmony cart flash // Load/save RAM to/from Harmony cart flash
if(mySize == 28_KB && !bankLocked()) if(mySize == 28_KB && !hotspotsLocked())
ramReadWrite(); ramReadWrite();
return false; return false;
} }

View File

@ -92,7 +92,7 @@ bool CartridgeMDM::poke(uInt16 address, uInt8 value)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeMDM::bank(uInt16 bank, uInt16) bool CartridgeMDM::bank(uInt16 bank, uInt16)
{ {
if(bankLocked() || myBankingDisabled) return false; if(hotspotsLocked() || myBankingDisabled) return false;
CartridgeEnhanced::bank(bank); CartridgeEnhanced::bank(bank);

View File

@ -70,7 +70,7 @@ void CartridgeWD::install(System& system)
uInt8 CartridgeWD::peek(uInt16 address) uInt8 CartridgeWD::peek(uInt16 address)
{ {
// Is it time to do an actual bankswitch? // Is it time to do an actual bankswitch?
if(myPendingBank != 0xF0 && !bankLocked() && if(myPendingBank != 0xF0 && !hotspotsLocked() &&
mySystem->cycles() > (myCyclesAtBankswitchInit + 3)) mySystem->cycles() > (myCyclesAtBankswitchInit + 3))
{ {
bank(myPendingBank); bank(myPendingBank);
@ -82,7 +82,7 @@ uInt8 CartridgeWD::peek(uInt16 address)
// Hotspots at $30 - $3F // Hotspots at $30 - $3F
// Note that a hotspot read triggers a bankswitch after at least 3 cycles // Note that a hotspot read triggers a bankswitch after at least 3 cycles
// have passed, so we only initiate the switch here // have passed, so we only initiate the switch here
if(!bankLocked() && (address & 0x00FF) >= 0x30 && (address & 0x00FF) <= 0x3F) if(!hotspotsLocked() && (address & 0x00FF) >= 0x30 && (address & 0x00FF) <= 0x3F)
{ {
myCyclesAtBankswitchInit = mySystem->cycles(); myCyclesAtBankswitchInit = mySystem->cycles();
myPendingBank = address & 0x000F; myPendingBank = address & 0x000F;
@ -105,7 +105,7 @@ bool CartridgeWD::poke(uInt16 address, uInt8 value)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeWD::bank(uInt16 bank, uInt16) bool CartridgeWD::bank(uInt16 bank, uInt16)
{ {
if(bankLocked()) return false; if(hotspotsLocked()) return false;
myCurrentBank = bank % romBankCount(); myCurrentBank = bank % romBankCount();

View File

@ -230,7 +230,7 @@ bool PlusROM::initialize(const ByteBuffer& image, size_t size)
bool PlusROM::peekHotspot(uInt16 address, uInt8& value) bool PlusROM::peekHotspot(uInt16 address, uInt8& value)
{ {
#if defined(HTTP_LIB_SUPPORT) #if defined(HTTP_LIB_SUPPORT)
if(myCart.bankLocked()) return false; if(myCart.hotspotsLocked()) return false;
switch(address & 0x1FFF) switch(address & 0x1FFF)
{ {
@ -265,7 +265,7 @@ bool PlusROM::peekHotspot(uInt16 address, uInt8& value)
bool PlusROM::pokeHotspot(uInt16 address, uInt8 value) bool PlusROM::pokeHotspot(uInt16 address, uInt8 value)
{ {
#if defined(HTTP_LIB_SUPPORT) #if defined(HTTP_LIB_SUPPORT)
if(myCart.bankLocked()) return false; if(myCart.hotspotsLocked()) return false;
switch(address & 0x1FFF) switch(address & 0x1FFF)
{ {