From 5b634b99e7301ee53b2c5883dd599d63281be737 Mon Sep 17 00:00:00 2001 From: thrust26 Date: Tue, 9 Jun 2020 20:43:37 +0200 Subject: [PATCH] Revert "take care of odd ROM sizes (fixes #653)" This reverts commit baa47aec5712181b1d365396659915f4f389a1b2. --- src/emucore/CartEnhanced.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/emucore/CartEnhanced.cxx b/src/emucore/CartEnhanced.cxx index c462cbcc8..00c7334ed 100644 --- a/src/emucore/CartEnhanced.cxx +++ b/src/emucore/CartEnhanced.cxx @@ -348,7 +348,7 @@ bool CartridgeEnhanced::bank(uInt16 bank, uInt16 segment) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - uInt16 CartridgeEnhanced::getBank(uInt16 address) const { - return myCurrentSegOffset[std::min((address & ROM_MASK) >> myBankShift, romBankCount() - 1)] >> myBankShift; + return myCurrentSegOffset[(address & ROM_MASK) >> myBankShift] >> myBankShift; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -360,8 +360,7 @@ uInt16 CartridgeEnhanced::getSegmentBank(uInt16 segment) const // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - uInt16 CartridgeEnhanced::romBankCount() const { - // take care of too small ROMs - return uInt16((mySize + ((1 << myBankShift) - 1)) >> myBankShift); + return uInt16(mySize >> myBankShift); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -