This commit is contained in:
thrust26 2020-05-24 23:37:00 +02:00
commit 3f9ef8026b
19 changed files with 56 additions and 37 deletions

View File

@ -169,8 +169,13 @@ class Cartridge : public Device
scheme defines banks in a standard format (ie, 0 for first bank, scheme defines banks in a standard format (ie, 0 for first bank,
1 for second, etc). Carts which will handle their own bankswitching 1 for second, etc). Carts which will handle their own bankswitching
completely or non-bankswitched carts can ignore this method. completely or non-bankswitched carts can ignore this method.
@param bank The bank that should be installed in the system
@param segment The segment the bank should be using
@return true, if bank has changed
*/ */
virtual bool bank(uInt16) { return false; } virtual bool bank(uInt16 bank, uInt16 segment = 0) { return false; }
/** /**
Get the current bank for the provided address. Carts which have only Get the current bank for the provided address. Carts which have only
@ -197,7 +202,6 @@ class Cartridge : public Device
*/ */
virtual uInt16 romBankCount() const { return 1; } virtual uInt16 romBankCount() const { return 1; }
/** /**
Query the number of RAM 'banks' supported by the cartridge. Note that Query the number of RAM 'banks' supported by the cartridge. Note that
this information is cart-specific, where each cart basically defines this information is cart-specific, where each cart basically defines

View File

@ -392,7 +392,7 @@ void CartridgeAR::loadIntoRAM(uInt8 load)
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeAR::bank(uInt16 bank) bool CartridgeAR::bank(uInt16 bank, uInt16)
{ {
if(!bankLocked()) if(!bankLocked())
return bankConfiguration(uInt8(bank)); return bankConfiguration(uInt8(bank));

View File

@ -73,9 +73,12 @@ class CartridgeAR : public Cartridge
/** /**
Install pages for the specified bank in the system. Install pages for the specified bank in the system.
@param bank The bank that should be installed in the system @param bank The bank that should be installed in the system
@param segment The segment the bank should be using
@return true, if bank has changed
*/ */
bool bank(uInt16 bank) override; bool bank(uInt16 bank, uInt16 segment = 0) override;
/** /**
Get the current bank. Get the current bank.

View File

@ -429,7 +429,7 @@ bool CartridgeBUS::poke(uInt16 address, uInt8 value)
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeBUS::bank(uInt16 bank) bool CartridgeBUS::bank(uInt16 bank, uInt16)
{ {
if(bankLocked()) return false; if(bankLocked()) return false;

View File

@ -84,9 +84,12 @@ class CartridgeBUS : public Cartridge
/** /**
Install pages for the specified bank in the system. Install pages for the specified bank in the system.
@param bank The bank that should be installed in the system @param bank The bank that should be installed in the system
@param segment The segment the bank should be using
@return true, if bank has changed
*/ */
bool bank(uInt16 bank) override; bool bank(uInt16 bank, uInt16 segment = 0) override;
/** /**
Get the current bank. Get the current bank.

View File

@ -402,7 +402,7 @@ bool CartridgeCDF::poke(uInt16 address, uInt8 value)
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeCDF::bank(uInt16 bank) bool CartridgeCDF::bank(uInt16 bank, uInt16)
{ {
if(bankLocked()) return false; if(bankLocked()) return false;

View File

@ -90,9 +90,12 @@ class CartridgeCDF : public Cartridge
/** /**
Install pages for the specified bank in the system. Install pages for the specified bank in the system.
@param bank The bank that should be installed in the system @param bank The bank that should be installed in the system
@param segment The segment the bank should be using
@return true, if bank has changed
*/ */
bool bank(uInt16 bank) override; bool bank(uInt16 bank, uInt16 segment = 0) override;
/** /**
Get the current bank. Get the current bank.

View File

@ -98,7 +98,7 @@ uInt8 CartridgeCM::column() const
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeCM::bank(uInt16 bank) bool CartridgeCM::bank(uInt16 bank, uInt16)
{ {
if(bankLocked()) return false; if(bankLocked()) return false;

View File

@ -141,9 +141,12 @@ class CartridgeCM : public Cartridge
/** /**
Install pages for the specified bank in the system. Install pages for the specified bank in the system.
@param bank The bank that should be installed in the system @param bank The bank that should be installed in the system
@param segment The segment the bank should be using
@return true, if bank has changed
*/ */
bool bank(uInt16 bank) override; bool bank(uInt16 bank, uInt16 segment = 0) override;
/** /**
Get the current bank. Get the current bank.

View File

@ -229,7 +229,7 @@ bool CartridgeCTY::poke(uInt16 address, uInt8 value)
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeCTY::bank(uInt16 bank) bool CartridgeCTY::bank(uInt16 bank, uInt16)
{ {
if(bankLocked()) return false; if(bankLocked()) return false;

View File

@ -139,9 +139,12 @@ class CartridgeCTY : public Cartridge
/** /**
Install pages for the specified bank in the system. Install pages for the specified bank in the system.
@param bank The bank that should be installed in the system @param bank The bank that should be installed in the system
@param segment The segment the bank should be using
@return true, if bank has changed
*/ */
bool bank(uInt16 bank) override; bool bank(uInt16 bank, uInt16 segment = 0) override;
/** /**
Get the current bank. Get the current bank.

View File

@ -591,7 +591,7 @@ bool CartridgeDPCPlus::poke(uInt16 address, uInt8 value)
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeDPCPlus::bank(uInt16 bank) bool CartridgeDPCPlus::bank(uInt16 bank, uInt16)
{ {
if(bankLocked()) return false; if(bankLocked()) return false;

View File

@ -86,9 +86,12 @@ class CartridgeDPCPlus : public Cartridge
/** /**
Install pages for the specified bank in the system. Install pages for the specified bank in the system.
@param bank The bank that should be installed in the system @param bank The bank that should be installed in the system
@param segment The segment the bank should be using
@return true, if bank has changed
*/ */
bool bank(uInt16 bank) override; bool bank(uInt16 bank, uInt16 segment = 0) override;
/** /**
Get the current bank. Get the current bank.

View File

@ -70,16 +70,7 @@ class CartridgeEnhanced : public Cartridge
@return true, if bank has changed @return true, if bank has changed
*/ */
virtual bool bank(uInt16 bank, uInt16 segment); bool bank(uInt16 bank, uInt16 segment = 0) override;
/**
Install pages for the specified bank in the system.
@param bank The bank that should be installed in the system
@return true, if bank has changed
*/
bool bank(uInt16 bank) override { return this->bank(bank, 0); }
/** /**
Get the current bank. Get the current bank.

View File

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

View File

@ -73,9 +73,12 @@ class CartridgeMDM : public CartridgeEnhanced
/** /**
Install pages for the specified bank in the system. Install pages for the specified bank in the system.
@param bank The bank that should be installed in the system @param bank The bank that should be installed in the system
@param segment The segment the bank should be using
@return true, if bank has changed
*/ */
bool bank(uInt16 bank) override; bool bank(uInt16 bank, uInt16 segment = 0) override;
/** /**
Save the current state of this cart to the given Serializer. Save the current state of this cart to the given Serializer.

View File

@ -201,7 +201,7 @@ void CartridgeMNetwork::bankRAM(uInt16 bank)
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeMNetwork::bank(uInt16 bank) bool CartridgeMNetwork::bank(uInt16 bank, uInt16)
{ {
if(bankLocked()) return false; if(bankLocked()) return false;

View File

@ -94,9 +94,12 @@ class CartridgeMNetwork : public Cartridge
/** /**
Install pages for the specified bank in the system. Install pages for the specified bank in the system.
@param bank The bank that should be installed in the system @param bank The bank that should be installed in the system
@param segment The segment the bank should be using
@return true, if bank has changed
*/ */
bool bank(uInt16 bank) override; bool bank(uInt16 bank, uInt16 segment = 0) override;
/** /**
Get the current bank. Get the current bank.

View File

@ -414,7 +414,7 @@ string OSystem::createConsole(const FilesystemNode& rom, const string& md5sum,
} }
catch(const runtime_error& e) catch(const runtime_error& e)
{ {
buf << "ERROR: Couldn't create console (" << e.what() << ")"; buf << "ERROR: " << e.what();
Logger::error(buf.str()); Logger::error(buf.str());
return buf.str(); return buf.str();
} }