added bank locking in debugger to PlusROM (maybe we should rename it into hotspot locking?)

This commit is contained in:
Thomas Jentzsch 2021-10-16 17:18:10 +02:00
parent 6e49d1fe12
commit f5a29714a6
5 changed files with 13 additions and 6 deletions

View File

@ -114,7 +114,7 @@ CartridgeCDF::CartridgeCDF(const ByteBuffer& image, size_t size,
setInitialState();
myPlusROM = make_unique<PlusROM>(mySettings);
myPlusROM = make_unique<PlusROM>(mySettings, *this);
// Determine whether we have a PlusROM cart
myPlusROM->initialize(myImage, mySize);

View File

@ -80,7 +80,7 @@ CartridgeDPCPlus::CartridgeDPCPlus(const ByteBuffer& image, size_t size,
setInitialState();
myPlusROM = make_unique<PlusROM>(mySettings);
myPlusROM = make_unique<PlusROM>(mySettings, *this);
// Determine whether we have a PlusROM cart
myPlusROM->initialize(myImage, mySize);

View File

@ -56,7 +56,7 @@ CartridgeEnhanced::CartridgeEnhanced(const ByteBuffer& image, size_t size,
// space will be filled with 0's from above
std::copy_n(image.get(), std::min(mySize, size), myImage.get());
myPlusROM = make_unique<PlusROM>(mySettings);
myPlusROM = make_unique<PlusROM>(mySettings, *this);
// Determine whether we have a PlusROM cart
// PlusROM needs to call peek() method, so disable direct peeks

View File

@ -180,8 +180,9 @@ class PlusROMRequest {
};
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PlusROM::PlusROM(const Settings& settings)
: mySettings(settings)
PlusROM::PlusROM(const Settings& settings, const Cartridge& cart)
: mySettings(settings),
myCart(cart)
{
}
@ -229,6 +230,8 @@ bool PlusROM::initialize(const ByteBuffer& image, size_t size)
bool PlusROM::peekHotspot(uInt16 address, uInt8& value)
{
#if defined(HTTP_LIB_SUPPORT)
if(myCart.bankLocked()) return false;
switch(address & 0x1FFF)
{
// invalid reads from write addresses
@ -262,6 +265,8 @@ bool PlusROM::peekHotspot(uInt16 address, uInt8& value)
bool PlusROM::pokeHotspot(uInt16 address, uInt8 value)
{
#if defined(HTTP_LIB_SUPPORT)
if(myCart.bankLocked()) return false;
switch(address & 0x1FFF)
{
// valid writes

View File

@ -53,7 +53,7 @@ class PlusROMRequest;
class PlusROM : public Serializable
{
public:
PlusROM(const Settings& settings);
PlusROM(const Settings& settings, const Cartridge& cart);
~PlusROM() override = default;
public:
@ -145,6 +145,8 @@ class PlusROM : public Serializable
private:
const Settings& mySettings;
const Cartridge& myCart;
bool myIsPlusROM{false};
string myHost;
string myPath;