Unify Cartridge::bank() and CartEnhanced::bank().

Otherwise, gcc complains of methods mirroring another with the same name.
This commit is contained in:
Stephen Anthony 2020-05-24 18:57:45 -02:30
parent ce3c9b9e8a
commit dbae9b8856
18 changed files with 55 additions and 36 deletions

View File

@ -169,8 +169,13 @@ class Cartridge : public Device
scheme defines banks in a standard format (ie, 0 for first bank,
1 for second, etc). Carts which will handle their own bankswitching
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
@ -197,7 +202,6 @@ class Cartridge : public Device
*/
virtual uInt16 romBankCount() const { return 1; }
/**
Query the number of RAM 'banks' supported by the cartridge. Note that
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())
return bankConfiguration(uInt8(bank));

View File

@ -73,9 +73,12 @@ class CartridgeAR : public Cartridge
/**
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.

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;

View File

@ -84,9 +84,12 @@ class CartridgeBUS : public Cartridge
/**
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.

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;

View File

@ -90,9 +90,12 @@ class CartridgeCDF : public Cartridge
/**
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.

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;

View File

@ -141,9 +141,12 @@ class CartridgeCM : public Cartridge
/**
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.

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;

View File

@ -139,9 +139,12 @@ class CartridgeCTY : public Cartridge
/**
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.

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;

View File

@ -86,9 +86,12 @@ class CartridgeDPCPlus : public Cartridge
/**
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.

View File

@ -70,16 +70,7 @@ class CartridgeEnhanced : public Cartridge
@return true, if bank has changed
*/
virtual bool bank(uInt16 bank, uInt16 segment);
/**
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); }
bool bank(uInt16 bank, uInt16 segment = 0) override;
/**
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;

View File

@ -73,9 +73,12 @@ class CartridgeMDM : public CartridgeEnhanced
/**
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.

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;

View File

@ -94,9 +94,12 @@ class CartridgeMNetwork : public Cartridge
/**
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.