diff --git a/Changes.txt b/Changes.txt index 27eb65a84..507bfc84f 100644 --- a/Changes.txt +++ b/Changes.txt @@ -14,6 +14,8 @@ 6.2 to 6.2.1: (XXX xx, 2020) + * Fixed Pitfall II ROM not working correctly. + * A ROM properties file may now be placed next to the ROM (with the same name as the ROM, except ending in .pro), and Stella will automatically apply the properties to the ROM. [NOTE: this was present in 6.2, but diff --git a/src/emucore/Cart0840.cxx b/src/emucore/Cart0840.cxx index 894b8eed7..c560b0a1b 100644 --- a/src/emucore/Cart0840.cxx +++ b/src/emucore/Cart0840.cxx @@ -20,8 +20,9 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Cartridge0840::Cartridge0840(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : CartridgeEnhanced(image, size, 8_KB, md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : CartridgeEnhanced(image, size, md5, settings, bsSize) { } diff --git a/src/emucore/Cart0840.hxx b/src/emucore/Cart0840.hxx index af1977485..0d120aad4 100644 --- a/src/emucore/Cart0840.hxx +++ b/src/emucore/Cart0840.hxx @@ -44,9 +44,10 @@ class Cartridge0840 : public CartridgeEnhanced @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme */ Cartridge0840(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 8_KB); virtual ~Cartridge0840() = default; public: diff --git a/src/emucore/Cart2K.cxx b/src/emucore/Cart2K.cxx index c70cc373f..ee0974549 100644 --- a/src/emucore/Cart2K.cxx +++ b/src/emucore/Cart2K.cxx @@ -20,7 +20,8 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Cartridge2K::Cartridge2K(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : CartridgeEnhanced(image, size, 2_KB, md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : CartridgeEnhanced(image, size, md5, settings, bsSize) { } diff --git a/src/emucore/Cart2K.hxx b/src/emucore/Cart2K.hxx index 0ed6fedef..878df4714 100644 --- a/src/emucore/Cart2K.hxx +++ b/src/emucore/Cart2K.hxx @@ -47,9 +47,10 @@ class Cartridge2K : public CartridgeEnhanced @param size The size of the ROM image (<= 2048 bytes) @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme */ Cartridge2K(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 2_KB); virtual ~Cartridge2K() = default; public: diff --git a/src/emucore/Cart3E.cxx b/src/emucore/Cart3E.cxx index a79e79167..e3d049eea 100644 --- a/src/emucore/Cart3E.cxx +++ b/src/emucore/Cart3E.cxx @@ -21,15 +21,10 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Cartridge3E::Cartridge3E(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : Cartridge3E(image, size, BSPF::nextMultipleOf(size, 2_KB), md5, settings) -{ -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Cartridge3E::Cartridge3E(const ByteBuffer& image, size_t size, size_t bsSize, - const string& md5, const Settings& settings) - : CartridgeEnhanced(image, size, bsSize, md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : CartridgeEnhanced(image, size, md5, settings, + bsSize == 0 ? BSPF::nextMultipleOf(size, 2_KB) : bsSize) { myBankShift = BANK_SHIFT; myRamSize = RAM_SIZE; diff --git a/src/emucore/Cart3E.hxx b/src/emucore/Cart3E.hxx index 96fc7b28b..60e50613a 100644 --- a/src/emucore/Cart3E.hxx +++ b/src/emucore/Cart3E.hxx @@ -71,26 +71,13 @@ class Cartridge3E : public CartridgeEnhanced @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme + (where 0 means variable-sized ROM) */ Cartridge3E(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 0); virtual ~Cartridge3E() = default; - protected: - /** - Create a new cartridge using the specified image and size. - This is an alternate version of the constructor, meant to be used - only by classes inheriting from this class. - - @param image Pointer to the ROM image - @param size The size of the ROM image - @param bsSize The size specified by the bankswitching scheme - @param md5 The md5sum of the ROM image - @param settings A reference to the various settings (read-only) - */ - Cartridge3E(const ByteBuffer& image, size_t size, size_t bsSize, - const string& md5, const Settings& settings); - public: /** diff --git a/src/emucore/Cart3EPlus.cxx b/src/emucore/Cart3EPlus.cxx index 818d48c1f..2233b0d71 100644 --- a/src/emucore/Cart3EPlus.cxx +++ b/src/emucore/Cart3EPlus.cxx @@ -21,8 +21,10 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Cartridge3EPlus::Cartridge3EPlus(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : Cartridge3E(image, size, BSPF::nextMultipleOf(size, 1_KB), md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : Cartridge3E(image, size, md5, settings, + bsSize == 0 ? BSPF::nextMultipleOf(size, 1_KB) : bsSize) { myBankShift = BANK_SHIFT; myRamSize = RAM_SIZE; diff --git a/src/emucore/Cart3EPlus.hxx b/src/emucore/Cart3EPlus.hxx index fe6a0a263..9abd5cb09 100644 --- a/src/emucore/Cart3EPlus.hxx +++ b/src/emucore/Cart3EPlus.hxx @@ -100,9 +100,11 @@ class Cartridge3EPlus: public Cartridge3E @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme + (where 0 means variable-sized ROM) */ Cartridge3EPlus(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 0); virtual ~Cartridge3EPlus() = default; public: diff --git a/src/emucore/Cart3F.cxx b/src/emucore/Cart3F.cxx index 20d9cef1d..a44c28a5e 100644 --- a/src/emucore/Cart3F.cxx +++ b/src/emucore/Cart3F.cxx @@ -21,8 +21,10 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Cartridge3F::Cartridge3F(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : CartridgeEnhanced(image, size, BSPF::nextPowerOfTwo(size), md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : CartridgeEnhanced(image, size, md5, settings, + bsSize == 0 ? BSPF::nextPowerOfTwo(size) : bsSize) { myBankShift = BANK_SHIFT; } diff --git a/src/emucore/Cart3F.hxx b/src/emucore/Cart3F.hxx index 7bdcbd99c..f5eeac809 100644 --- a/src/emucore/Cart3F.hxx +++ b/src/emucore/Cart3F.hxx @@ -50,9 +50,11 @@ class Cartridge3F : public CartridgeEnhanced @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme + (where 0 means variable-sized ROM) */ Cartridge3F(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 0); virtual ~Cartridge3F() = default; public: diff --git a/src/emucore/Cart4K.cxx b/src/emucore/Cart4K.cxx index 0a3e27bdc..830cffd49 100644 --- a/src/emucore/Cart4K.cxx +++ b/src/emucore/Cart4K.cxx @@ -20,7 +20,8 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Cartridge4K::Cartridge4K(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : CartridgeEnhanced(image, size, 4_KB, md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : CartridgeEnhanced(image, size, md5, settings, bsSize) { } diff --git a/src/emucore/Cart4K.hxx b/src/emucore/Cart4K.hxx index 1a7c428f4..cc2bb5aef 100644 --- a/src/emucore/Cart4K.hxx +++ b/src/emucore/Cart4K.hxx @@ -44,9 +44,10 @@ class Cartridge4K : public CartridgeEnhanced @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme */ Cartridge4K(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 4_KB); virtual ~Cartridge4K() = default; public: diff --git a/src/emucore/Cart4KSC.cxx b/src/emucore/Cart4KSC.cxx index 92d2e946e..50ad78e8b 100644 --- a/src/emucore/Cart4KSC.cxx +++ b/src/emucore/Cart4KSC.cxx @@ -20,8 +20,9 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Cartridge4KSC::Cartridge4KSC(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : Cartridge4K(image, size, md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : Cartridge4K(image, size, md5, settings, bsSize) { myRamSize = RAM_SIZE; } diff --git a/src/emucore/Cart4KSC.hxx b/src/emucore/Cart4KSC.hxx index 3f28de9ce..a2197e018 100644 --- a/src/emucore/Cart4KSC.hxx +++ b/src/emucore/Cart4KSC.hxx @@ -45,9 +45,10 @@ class Cartridge4KSC : public Cartridge4K @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme */ Cartridge4KSC(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 4_KB); virtual ~Cartridge4KSC() = default; public: diff --git a/src/emucore/CartBF.cxx b/src/emucore/CartBF.cxx index 065b657dc..cd815c518 100644 --- a/src/emucore/CartBF.cxx +++ b/src/emucore/CartBF.cxx @@ -20,8 +20,9 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeBF::CartridgeBF(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : CartridgeEnhanced(image, size, 256_KB, md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : CartridgeEnhanced(image, size, md5, settings, bsSize) { } diff --git a/src/emucore/CartBF.hxx b/src/emucore/CartBF.hxx index 23c51f760..5190f73da 100644 --- a/src/emucore/CartBF.hxx +++ b/src/emucore/CartBF.hxx @@ -45,9 +45,10 @@ class CartridgeBF : public CartridgeEnhanced @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme */ CartridgeBF(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 256_KB); virtual ~CartridgeBF() = default; public: diff --git a/src/emucore/CartBFSC.cxx b/src/emucore/CartBFSC.cxx index bd9793893..ac8a105b3 100644 --- a/src/emucore/CartBFSC.cxx +++ b/src/emucore/CartBFSC.cxx @@ -20,8 +20,9 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeBFSC::CartridgeBFSC(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : CartridgeBF(image, size, md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : CartridgeBF(image, size, md5, settings, bsSize) { myRamSize = RAM_SIZE; } diff --git a/src/emucore/CartBFSC.hxx b/src/emucore/CartBFSC.hxx index 9bb22aa0a..4a660ecc8 100644 --- a/src/emucore/CartBFSC.hxx +++ b/src/emucore/CartBFSC.hxx @@ -45,9 +45,10 @@ class CartridgeBFSC : public CartridgeBF @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme */ CartridgeBFSC(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 256_KB); virtual ~CartridgeBFSC() = default; /** diff --git a/src/emucore/CartCV.cxx b/src/emucore/CartCV.cxx index 8e8e6504e..8fe746f1a 100644 --- a/src/emucore/CartCV.cxx +++ b/src/emucore/CartCV.cxx @@ -20,8 +20,9 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeCV::CartridgeCV(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : CartridgeEnhanced(image, size, 2_KB, md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : CartridgeEnhanced(image, size, md5, settings, bsSize) { myBankShift = BANK_SHIFT; myRamSize = RAM_SIZE; diff --git a/src/emucore/CartCV.hxx b/src/emucore/CartCV.hxx index a5403b19f..809d9b373 100644 --- a/src/emucore/CartCV.hxx +++ b/src/emucore/CartCV.hxx @@ -47,9 +47,10 @@ class CartridgeCV : public CartridgeEnhanced @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme */ CartridgeCV(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 2_KB); virtual ~CartridgeCV() = default; public: diff --git a/src/emucore/CartDF.cxx b/src/emucore/CartDF.cxx index f95ebcc93..58206a3b5 100644 --- a/src/emucore/CartDF.cxx +++ b/src/emucore/CartDF.cxx @@ -20,8 +20,9 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeDF::CartridgeDF(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : CartridgeEnhanced(image, size, 128_KB, md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : CartridgeEnhanced(image, size, md5, settings, bsSize) { } diff --git a/src/emucore/CartDF.hxx b/src/emucore/CartDF.hxx index 3c33e8bff..18d0f2489 100644 --- a/src/emucore/CartDF.hxx +++ b/src/emucore/CartDF.hxx @@ -45,9 +45,10 @@ class CartridgeDF : public CartridgeEnhanced @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme */ CartridgeDF(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 128_KB); virtual ~CartridgeDF() = default; public: diff --git a/src/emucore/CartDFSC.cxx b/src/emucore/CartDFSC.cxx index f759136a7..4dafe3bb7 100644 --- a/src/emucore/CartDFSC.cxx +++ b/src/emucore/CartDFSC.cxx @@ -20,8 +20,9 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeDFSC::CartridgeDFSC(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : CartridgeDF(image, size, md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : CartridgeDF(image, size, md5, settings, bsSize) { myRamSize = RAM_SIZE; } diff --git a/src/emucore/CartDFSC.hxx b/src/emucore/CartDFSC.hxx index 637dde3da..efc6d30e8 100644 --- a/src/emucore/CartDFSC.hxx +++ b/src/emucore/CartDFSC.hxx @@ -45,9 +45,10 @@ class CartridgeDFSC : public CartridgeDF @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme */ CartridgeDFSC(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 128_KB); virtual ~CartridgeDFSC() = default; public: diff --git a/src/emucore/CartDPC.cxx b/src/emucore/CartDPC.cxx index bc8962b1b..c77aacd8a 100644 --- a/src/emucore/CartDPC.cxx +++ b/src/emucore/CartDPC.cxx @@ -22,8 +22,9 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeDPC::CartridgeDPC(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : CartridgeF8(image, size, md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : CartridgeF8(image, size, md5, settings, bsSize) { } diff --git a/src/emucore/CartDPC.hxx b/src/emucore/CartDPC.hxx index e0a1b866e..4d90fb140 100644 --- a/src/emucore/CartDPC.hxx +++ b/src/emucore/CartDPC.hxx @@ -46,9 +46,10 @@ class CartridgeDPC : public CartridgeF8 @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme */ CartridgeDPC(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 10_KB); virtual ~CartridgeDPC() = default; public: diff --git a/src/emucore/CartE0.cxx b/src/emucore/CartE0.cxx index 7a10c3e34..9204d5619 100644 --- a/src/emucore/CartE0.cxx +++ b/src/emucore/CartE0.cxx @@ -20,8 +20,9 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeE0::CartridgeE0(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : CartridgeEnhanced(image, size, 8_KB, md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : CartridgeEnhanced(image, size, md5, settings, bsSize) { myBankShift = BANK_SHIFT; } diff --git a/src/emucore/CartE0.hxx b/src/emucore/CartE0.hxx index 84c9ae667..70af8f85d 100644 --- a/src/emucore/CartE0.hxx +++ b/src/emucore/CartE0.hxx @@ -53,9 +53,10 @@ class CartridgeE0 : public CartridgeEnhanced @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme */ CartridgeE0(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 8_KB); virtual ~CartridgeE0() = default; public: diff --git a/src/emucore/CartEF.cxx b/src/emucore/CartEF.cxx index 175b42263..c063b0c05 100644 --- a/src/emucore/CartEF.cxx +++ b/src/emucore/CartEF.cxx @@ -20,8 +20,9 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeEF::CartridgeEF(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : CartridgeEnhanced(image, size, 64_KB, md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : CartridgeEnhanced(image, size, md5, settings, bsSize) { } diff --git a/src/emucore/CartEF.hxx b/src/emucore/CartEF.hxx index ff71b9909..2c86d0d71 100644 --- a/src/emucore/CartEF.hxx +++ b/src/emucore/CartEF.hxx @@ -45,9 +45,10 @@ class CartridgeEF : public CartridgeEnhanced @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme */ CartridgeEF(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 64_KB); virtual ~CartridgeEF() = default; public: diff --git a/src/emucore/CartEFSC.cxx b/src/emucore/CartEFSC.cxx index c70cff194..f73557245 100644 --- a/src/emucore/CartEFSC.cxx +++ b/src/emucore/CartEFSC.cxx @@ -20,8 +20,9 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeEFSC::CartridgeEFSC(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : CartridgeEF(image, size, md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : CartridgeEF(image, size, md5, settings, bsSize) { myRamSize = RAM_SIZE; } diff --git a/src/emucore/CartEFSC.hxx b/src/emucore/CartEFSC.hxx index f6c7e40ea..ac95c9e2c 100644 --- a/src/emucore/CartEFSC.hxx +++ b/src/emucore/CartEFSC.hxx @@ -46,9 +46,10 @@ class CartridgeEFSC : public CartridgeEF @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme */ CartridgeEFSC(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 64_KB); virtual ~CartridgeEFSC() = default; public: diff --git a/src/emucore/CartEnhanced.cxx b/src/emucore/CartEnhanced.cxx index 00c7334ed..574dacca8 100644 --- a/src/emucore/CartEnhanced.cxx +++ b/src/emucore/CartEnhanced.cxx @@ -21,8 +21,8 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeEnhanced::CartridgeEnhanced(const ByteBuffer& image, size_t size, - size_t bsSize, const string& md5, - const Settings& settings) + const string& md5, const Settings& settings, + size_t bsSize) : Cartridge(settings, md5) { // ROMs are not always at the 'legal' size for their associated diff --git a/src/emucore/CartEnhanced.hxx b/src/emucore/CartEnhanced.hxx index cd398be11..e15fb8ba1 100644 --- a/src/emucore/CartEnhanced.hxx +++ b/src/emucore/CartEnhanced.hxx @@ -41,12 +41,13 @@ class CartridgeEnhanced : public Cartridge @param image Pointer to the ROM image @param size The size of the ROM image - @param bsSize The size specified by the bankswitching scheme @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme */ - CartridgeEnhanced(const ByteBuffer& image, size_t size, size_t bsSize, - const string& md5, const Settings& settings); + CartridgeEnhanced(const ByteBuffer& image, size_t size, + const string& md5, const Settings& settings, + size_t bsSize); virtual ~CartridgeEnhanced() = default; public: diff --git a/src/emucore/CartF0.cxx b/src/emucore/CartF0.cxx index f21bba07e..0429109e3 100644 --- a/src/emucore/CartF0.cxx +++ b/src/emucore/CartF0.cxx @@ -19,8 +19,9 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeF0::CartridgeF0(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : CartridgeEnhanced(image, size, 64_KB, md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : CartridgeEnhanced(image, size, md5, settings, bsSize) { } diff --git a/src/emucore/CartF0.hxx b/src/emucore/CartF0.hxx index 0d5837066..e49b8ce31 100644 --- a/src/emucore/CartF0.hxx +++ b/src/emucore/CartF0.hxx @@ -42,9 +42,10 @@ class CartridgeF0 : public CartridgeEnhanced @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme */ CartridgeF0(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 64_KB); virtual ~CartridgeF0() = default; public: diff --git a/src/emucore/CartF4.cxx b/src/emucore/CartF4.cxx index 609fd0b03..c00163efb 100644 --- a/src/emucore/CartF4.cxx +++ b/src/emucore/CartF4.cxx @@ -19,8 +19,9 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeF4::CartridgeF4(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : CartridgeEnhanced(image, size, 32_KB, md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : CartridgeEnhanced(image, size, md5, settings, bsSize) { } diff --git a/src/emucore/CartF4.hxx b/src/emucore/CartF4.hxx index d44e96640..81a5e176e 100644 --- a/src/emucore/CartF4.hxx +++ b/src/emucore/CartF4.hxx @@ -41,9 +41,10 @@ class CartridgeF4 : public CartridgeEnhanced @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme */ CartridgeF4(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 32_KB); virtual ~CartridgeF4() = default; public: diff --git a/src/emucore/CartF4SC.cxx b/src/emucore/CartF4SC.cxx index 4fe6e13eb..d012874c6 100644 --- a/src/emucore/CartF4SC.cxx +++ b/src/emucore/CartF4SC.cxx @@ -19,9 +19,10 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeF4SC::CartridgeF4SC(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : CartridgeF4(image, size, md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : CartridgeF4(image, size, md5, settings, bsSize) { myRamSize = RAM_SIZE; - myRamMask = RAM_SIZE - 1; + myRamMask = RAM_SIZE - 1; } diff --git a/src/emucore/CartF4SC.hxx b/src/emucore/CartF4SC.hxx index 58b255e42..49f1278ac 100644 --- a/src/emucore/CartF4SC.hxx +++ b/src/emucore/CartF4SC.hxx @@ -42,9 +42,10 @@ class CartridgeF4SC : public CartridgeF4 @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme */ CartridgeF4SC(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 32_KB); virtual ~CartridgeF4SC() = default; public: diff --git a/src/emucore/CartF6.cxx b/src/emucore/CartF6.cxx index 572909952..0e4bcf678 100644 --- a/src/emucore/CartF6.cxx +++ b/src/emucore/CartF6.cxx @@ -19,8 +19,9 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeF6::CartridgeF6(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : CartridgeEnhanced(image, size, 16_KB, md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : CartridgeEnhanced(image, size, md5, settings, bsSize) { } diff --git a/src/emucore/CartF6.hxx b/src/emucore/CartF6.hxx index 16faeebab..7707f1ef6 100644 --- a/src/emucore/CartF6.hxx +++ b/src/emucore/CartF6.hxx @@ -41,9 +41,10 @@ class CartridgeF6 : public CartridgeEnhanced @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme */ CartridgeF6(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 16_KB); virtual ~CartridgeF6() = default; public: diff --git a/src/emucore/CartF6SC.cxx b/src/emucore/CartF6SC.cxx index 15613a357..084091d12 100644 --- a/src/emucore/CartF6SC.cxx +++ b/src/emucore/CartF6SC.cxx @@ -19,9 +19,10 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeF6SC::CartridgeF6SC(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : CartridgeF6(image, size, md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : CartridgeF6(image, size, md5, settings, bsSize) { myRamSize = RAM_SIZE; - myRamMask = RAM_SIZE - 1; + myRamMask = RAM_SIZE - 1; } diff --git a/src/emucore/CartF6SC.hxx b/src/emucore/CartF6SC.hxx index c61c9715f..4365036bb 100644 --- a/src/emucore/CartF6SC.hxx +++ b/src/emucore/CartF6SC.hxx @@ -42,9 +42,10 @@ class CartridgeF6SC : public CartridgeF6 @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme */ CartridgeF6SC(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 16_KB); virtual ~CartridgeF6SC() = default; public: diff --git a/src/emucore/CartF8.cxx b/src/emucore/CartF8.cxx index 7ea1216a5..732cb306d 100644 --- a/src/emucore/CartF8.cxx +++ b/src/emucore/CartF8.cxx @@ -19,8 +19,9 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeF8::CartridgeF8(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : CartridgeEnhanced(image, size, 8_KB, md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : CartridgeEnhanced(image, size, md5, settings, bsSize) { } diff --git a/src/emucore/CartF8.hxx b/src/emucore/CartF8.hxx index 29b308808..90b34497a 100644 --- a/src/emucore/CartF8.hxx +++ b/src/emucore/CartF8.hxx @@ -41,9 +41,10 @@ class CartridgeF8 : public CartridgeEnhanced @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme */ CartridgeF8(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 8_KB); virtual ~CartridgeF8() = default; public: diff --git a/src/emucore/CartF8SC.cxx b/src/emucore/CartF8SC.cxx index 98ce4357f..9607d9687 100644 --- a/src/emucore/CartF8SC.cxx +++ b/src/emucore/CartF8SC.cxx @@ -19,8 +19,9 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeF8SC::CartridgeF8SC(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : CartridgeF8(image, size, md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : CartridgeF8(image, size, md5, settings, bsSize) { myRamSize = RAM_SIZE; } diff --git a/src/emucore/CartF8SC.hxx b/src/emucore/CartF8SC.hxx index c5a005543..3eb3539ae 100644 --- a/src/emucore/CartF8SC.hxx +++ b/src/emucore/CartF8SC.hxx @@ -42,9 +42,10 @@ class CartridgeF8SC : public CartridgeF8 @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme */ CartridgeF8SC(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 8_KB); virtual ~CartridgeF8SC() = default; public: diff --git a/src/emucore/CartFA.cxx b/src/emucore/CartFA.cxx index bc82dec84..ec242f615 100644 --- a/src/emucore/CartFA.cxx +++ b/src/emucore/CartFA.cxx @@ -20,8 +20,9 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeFA::CartridgeFA(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : CartridgeEnhanced(image, size, 12_KB, md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : CartridgeEnhanced(image, size, md5, settings, bsSize) { myRamSize = RAM_SIZE; } diff --git a/src/emucore/CartFA.hxx b/src/emucore/CartFA.hxx index a2f197b75..d234de743 100644 --- a/src/emucore/CartFA.hxx +++ b/src/emucore/CartFA.hxx @@ -45,9 +45,10 @@ class CartridgeFA : public CartridgeEnhanced @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme */ CartridgeFA(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 12_KB); virtual ~CartridgeFA() = default; public: diff --git a/src/emucore/CartFA2.cxx b/src/emucore/CartFA2.cxx index 14c8f2156..2443b106a 100644 --- a/src/emucore/CartFA2.cxx +++ b/src/emucore/CartFA2.cxx @@ -20,8 +20,9 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeFA2::CartridgeFA2(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : CartridgeFA(image, size, md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : CartridgeFA(image, size, md5, settings, bsSize) { // 29/32K version of FA2 has valid data @ 1K - 29K const uInt8* img_ptr = image.get(); diff --git a/src/emucore/CartFA2.hxx b/src/emucore/CartFA2.hxx index 16d33bf2b..ea60fbe45 100644 --- a/src/emucore/CartFA2.hxx +++ b/src/emucore/CartFA2.hxx @@ -57,9 +57,10 @@ class CartridgeFA2 : public CartridgeFA @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the settings object + @param bsSize The size specified by the bankswitching scheme */ CartridgeFA2(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 28_KB); virtual ~CartridgeFA2() = default; public: diff --git a/src/emucore/CartFC.cxx b/src/emucore/CartFC.cxx index 9b945c666..1b431592e 100644 --- a/src/emucore/CartFC.cxx +++ b/src/emucore/CartFC.cxx @@ -20,8 +20,10 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeFC::CartridgeFC(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : CartridgeEnhanced(image, size, BSPF::nextPowerOfTwo(size), md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : CartridgeEnhanced(image, size, md5, settings, + bsSize == 0 ? BSPF::nextPowerOfTwo(size) : bsSize) { } diff --git a/src/emucore/CartFC.hxx b/src/emucore/CartFC.hxx index 5858ae85a..92be2a421 100644 --- a/src/emucore/CartFC.hxx +++ b/src/emucore/CartFC.hxx @@ -47,9 +47,11 @@ class CartridgeFC : public CartridgeEnhanced @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme + (where 0 means variable-sized ROM) */ CartridgeFC(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 0); virtual ~CartridgeFC() = default; public: diff --git a/src/emucore/CartFE.cxx b/src/emucore/CartFE.cxx index a9602e88a..d0c01886b 100644 --- a/src/emucore/CartFE.cxx +++ b/src/emucore/CartFE.cxx @@ -21,8 +21,9 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeFE::CartridgeFE(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : CartridgeEnhanced(image, size, 8_KB, md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : CartridgeEnhanced(image, size, md5, settings, bsSize) { myDirectPeek = false; } diff --git a/src/emucore/CartFE.hxx b/src/emucore/CartFE.hxx index 6c453d284..77ebee767 100644 --- a/src/emucore/CartFE.hxx +++ b/src/emucore/CartFE.hxx @@ -87,9 +87,10 @@ class CartridgeFE : public CartridgeEnhanced @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme */ CartridgeFE(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 8_KB); virtual ~CartridgeFE() = default; public: diff --git a/src/emucore/CartMDM.cxx b/src/emucore/CartMDM.cxx index 022bc1bdb..f92563ec2 100644 --- a/src/emucore/CartMDM.cxx +++ b/src/emucore/CartMDM.cxx @@ -20,8 +20,10 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeMDM::CartridgeMDM(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : CartridgeEnhanced(image, size, BSPF::nextPowerOfTwo(size), md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : CartridgeEnhanced(image, size, md5, settings, + bsSize == 0 ? BSPF::nextPowerOfTwo(size) : bsSize) { } diff --git a/src/emucore/CartMDM.hxx b/src/emucore/CartMDM.hxx index fe17ae628..4e12571e1 100644 --- a/src/emucore/CartMDM.hxx +++ b/src/emucore/CartMDM.hxx @@ -56,9 +56,11 @@ class CartridgeMDM : public CartridgeEnhanced @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme + (where 0 means variable-sized ROM) */ CartridgeMDM(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 0); virtual ~CartridgeMDM() = default; public: diff --git a/src/emucore/CartSB.cxx b/src/emucore/CartSB.cxx index 8ad55f28d..18d160cff 100644 --- a/src/emucore/CartSB.cxx +++ b/src/emucore/CartSB.cxx @@ -20,8 +20,10 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeSB::CartridgeSB(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : CartridgeEnhanced(image, size, BSPF::nextPowerOfTwo(size), md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : CartridgeEnhanced(image, size, md5, settings, + bsSize == 0 ? BSPF::nextPowerOfTwo(size) : bsSize) { } diff --git a/src/emucore/CartSB.hxx b/src/emucore/CartSB.hxx index 85c8e9ccb..17cea387c 100644 --- a/src/emucore/CartSB.hxx +++ b/src/emucore/CartSB.hxx @@ -45,9 +45,11 @@ class CartridgeSB : public CartridgeEnhanced @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme + (where 0 means variable-sized ROM) */ CartridgeSB(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 0); virtual ~CartridgeSB() = default; public: diff --git a/src/emucore/CartTVBoy.cxx b/src/emucore/CartTVBoy.cxx index 0626da0aa..50d66cb57 100644 --- a/src/emucore/CartTVBoy.cxx +++ b/src/emucore/CartTVBoy.cxx @@ -20,8 +20,9 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeTVBoy::CartridgeTVBoy(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : CartridgeEnhanced(image, size, 512_KB, md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : CartridgeEnhanced(image, size, md5, settings, bsSize) { } diff --git a/src/emucore/CartTVBoy.hxx b/src/emucore/CartTVBoy.hxx index 90072a08d..d1787e55b 100644 --- a/src/emucore/CartTVBoy.hxx +++ b/src/emucore/CartTVBoy.hxx @@ -44,9 +44,10 @@ class CartridgeTVBoy : public CartridgeEnhanced @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme */ CartridgeTVBoy(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 512_KB); virtual ~CartridgeTVBoy() = default; public: diff --git a/src/emucore/CartUA.cxx b/src/emucore/CartUA.cxx index 23caa5091..e73f166db 100644 --- a/src/emucore/CartUA.cxx +++ b/src/emucore/CartUA.cxx @@ -22,7 +22,7 @@ CartridgeUA::CartridgeUA(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings, bool swapHotspots) - : CartridgeEnhanced(image, size, 8_KB, md5, settings), + : CartridgeEnhanced(image, size, md5, settings, 8_KB), mySwappedHotspots(swapHotspots) { } diff --git a/src/emucore/CartWD.cxx b/src/emucore/CartWD.cxx index f9c7463f3..d985abd00 100644 --- a/src/emucore/CartWD.cxx +++ b/src/emucore/CartWD.cxx @@ -22,8 +22,9 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeWD::CartridgeWD(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : CartridgeEnhanced(image, size, 8_KB, md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : CartridgeEnhanced(image, size, md5, settings, bsSize) { // Copy the ROM image into my buffer if(size == 8_KB + 3) diff --git a/src/emucore/CartWD.hxx b/src/emucore/CartWD.hxx index 398571a52..4c1d9d3d9 100644 --- a/src/emucore/CartWD.hxx +++ b/src/emucore/CartWD.hxx @@ -65,9 +65,10 @@ class CartridgeWD : public CartridgeEnhanced @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme */ CartridgeWD(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 8_KB); virtual ~CartridgeWD() = default; public: diff --git a/src/emucore/CartX07.cxx b/src/emucore/CartX07.cxx index e28869920..4f3294d5c 100644 --- a/src/emucore/CartX07.cxx +++ b/src/emucore/CartX07.cxx @@ -22,8 +22,9 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeX07::CartridgeX07(const ByteBuffer& image, size_t size, - const string& md5, const Settings& settings) - : CartridgeEnhanced(image, size, 64_KB, md5, settings) + const string& md5, const Settings& settings, + size_t bsSize) + : CartridgeEnhanced(image, size, md5, settings, bsSize) { } diff --git a/src/emucore/CartX07.hxx b/src/emucore/CartX07.hxx index 3cde4efdf..3f59ca7c3 100644 --- a/src/emucore/CartX07.hxx +++ b/src/emucore/CartX07.hxx @@ -54,9 +54,10 @@ class CartridgeX07 : public CartridgeEnhanced @param size The size of the ROM image @param md5 The md5sum of the ROM image @param settings A reference to the various settings (read-only) + @param bsSize The size specified by the bankswitching scheme */ CartridgeX07(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); + const Settings& settings, size_t bsSize = 64_KB); virtual ~CartridgeX07() = default; public: