changed FE bankswitching code to support up to 8 banks

This commit is contained in:
thrust26 2023-09-15 08:44:02 +02:00
parent 1f2b0152af
commit ec5e3fbe17
4 changed files with 4 additions and 4 deletions

View File

@ -32,7 +32,7 @@ string CartridgeFEWidget::description()
{
ostringstream info;
info << "FE (aka SCABS) cartridge, two 4K banks\n"
info << "FE (aka SCABS) cartridge, up to eight 4K banks\n"
<< "Monitors access to hotspot $01FE, and uses "
<< "upper 3 bits of databus for bank number:\n"
<< CartridgeEnhancedWidget::description();

View File

@ -308,7 +308,7 @@ CartCreator::createFromImage(const ByteBuffer& image, size_t size,
case Bankswitch::Type::_FC:
return make_unique<CartridgeFC>(image, size, md5, settings);
case Bankswitch::Type::_FE:
return make_unique<CartridgeFE>(image, size, md5, settings);
return make_unique<CartridgeFE>(image, size, md5, settings, size);
case Bankswitch::Type::_GL:
return make_unique<CartridgeGL>(image, size, md5, settings);
case Bankswitch::Type::_MDM:

View File

@ -52,7 +52,7 @@ bool CartridgeFE::checkSwitchBank(uInt16 address, uInt8 value)
{
if(myLastAccessWasFE)
{
bank((value & 0x20) ? 0 : 1);
bank((value >> 5) ^ 0b111);
myLastAccessWasFE = false; // was: address == 0x01FE;
return true;
}

View File

@ -91,7 +91,7 @@ class CartridgeFE : public CartridgeEnhanced
@param bsSize The size specified by the bankswitching scheme
*/
CartridgeFE(const ByteBuffer& image, size_t size, string_view md5,
const Settings& settings, size_t bsSize = 8_KB);
const Settings& settings, size_t bsSize);
~CartridgeFE() override = default;
public: