Convert Cart classes to receive 'md5' parameter.

That's an *awful* lot of work to simply pass info to each class :)
This commit is contained in:
Stephen Anthony 2018-12-18 10:24:40 -03:30
parent dea62573f8
commit 56669c5449
89 changed files with 257 additions and 178 deletions

View File

@ -26,16 +26,13 @@
#include "Cart.hxx" #include "Cart.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cartridge::Cartridge(const Settings& settings) Cartridge::Cartridge(const Settings& settings, const string& md5)
: mySettings(settings), : mySettings(settings),
myBankChanged(true), myBankChanged(true),
myCodeAccessBase(nullptr), myCodeAccessBase(nullptr),
myStartBank(0), myStartBank(0),
myBankLocked(false) myBankLocked(false)
{ {
// TODO - get md5 from parameter
string md5 = "d30b89fcc488b7ac2fcbd96c06cb932e";
auto to_uInt32 = [](const string& s, uInt32 pos) { auto to_uInt32 = [](const string& s, uInt32 pos) {
return uInt32(std::stoul(s.substr(pos, 8), nullptr, 16)); return uInt32(std::stoul(s.substr(pos, 8), nullptr, 16));
}; };

View File

@ -47,8 +47,9 @@ class Cartridge : public Device
Create a new cartridge Create a new cartridge
@param settings A reference to the various settings (read-only) @param settings A reference to the various settings (read-only)
@param md5 The md5sum of the cart image
*/ */
Cartridge(const Settings& settings); Cartridge(const Settings& settings, const string& md5);
virtual ~Cartridge() = default; virtual ~Cartridge() = default;
/** /**

View File

@ -20,8 +20,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cartridge0840::Cartridge0840(const BytePtr& image, uInt32 size, Cartridge0840::Cartridge0840(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
myBankOffset(0) myBankOffset(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer

View File

@ -42,9 +42,11 @@ class Cartridge0840 : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
Cartridge0840(const BytePtr& image, uInt32 size, const Settings& settings); Cartridge0840(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~Cartridge0840() = default; virtual ~Cartridge0840() = default;
public: public:

View File

@ -20,8 +20,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cartridge2K::Cartridge2K(const BytePtr& image, uInt32 size, Cartridge2K::Cartridge2K(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings) : Cartridge(settings, md5)
{ {
// Size can be a maximum of 2K // Size can be a maximum of 2K
if(size > 2048) size = 2048; if(size > 2048) size = 2048;

View File

@ -45,9 +45,11 @@ class Cartridge2K : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image (<= 2048 bytes) @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 settings A reference to the various settings (read-only)
*/ */
Cartridge2K(const BytePtr& image, uInt32 size, const Settings& settings); Cartridge2K(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~Cartridge2K() = default; virtual ~Cartridge2K() = default;
public: public:

View File

@ -21,8 +21,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cartridge3E::Cartridge3E(const BytePtr& image, uInt32 size, Cartridge3E::Cartridge3E(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
mySize(size), mySize(size),
myCurrentBank(0) myCurrentBank(0)
{ {

View File

@ -71,9 +71,11 @@ class Cartridge3E : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
Cartridge3E(const BytePtr& image, uInt32 size, const Settings& settings); Cartridge3E(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~Cartridge3E() = default; virtual ~Cartridge3E() = default;
public: public:

View File

@ -21,8 +21,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cartridge3EPlus::Cartridge3EPlus(const BytePtr& image, uInt32 size, Cartridge3EPlus::Cartridge3EPlus(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
mySize(size) mySize(size)
{ {
// Allocate array for the ROM image // Allocate array for the ROM image

View File

@ -51,9 +51,11 @@ class Cartridge3EPlus: public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
Cartridge3EPlus(const BytePtr& image, uInt32 size, const Settings& settings); Cartridge3EPlus(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~Cartridge3EPlus() = default; virtual ~Cartridge3EPlus() = default;
public: public:

View File

@ -21,8 +21,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cartridge3F::Cartridge3F(const BytePtr& image, uInt32 size, Cartridge3F::Cartridge3F(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
mySize(size), mySize(size),
myCurrentBank(0) myCurrentBank(0)
{ {

View File

@ -48,9 +48,11 @@ class Cartridge3F : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
Cartridge3F(const BytePtr& image, uInt32 size, const Settings& settings); Cartridge3F(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~Cartridge3F() = default; virtual ~Cartridge3F() = default;
public: public:

View File

@ -22,8 +22,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cartridge4A50::Cartridge4A50(const BytePtr& image, uInt32 size, Cartridge4A50::Cartridge4A50(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
mySize(size), mySize(size),
mySliceLow(0), mySliceLow(0),
mySliceMiddle(0), mySliceMiddle(0),

View File

@ -62,9 +62,11 @@ class Cartridge4A50 : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
Cartridge4A50(const BytePtr& image, uInt32 size, const Settings& settings); Cartridge4A50(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~Cartridge4A50() = default; virtual ~Cartridge4A50() = default;
public: public:

View File

@ -20,8 +20,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cartridge4K::Cartridge4K(const BytePtr& image, uInt32 size, Cartridge4K::Cartridge4K(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings) : Cartridge(settings, md5)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
memcpy(myImage, image.get(), std::min(4096u, size)); memcpy(myImage, image.get(), std::min(4096u, size));

View File

@ -42,9 +42,11 @@ class Cartridge4K : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
Cartridge4K(const BytePtr& image, uInt32 size, const Settings& settings); Cartridge4K(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~Cartridge4K() = default; virtual ~Cartridge4K() = default;
public: public:

View File

@ -20,8 +20,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cartridge4KSC::Cartridge4KSC(const BytePtr& image, uInt32 size, Cartridge4KSC::Cartridge4KSC(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings) : Cartridge(settings, md5)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
memcpy(myImage, image.get(), std::min(4096u, size)); memcpy(myImage, image.get(), std::min(4096u, size));

View File

@ -41,9 +41,11 @@ class Cartridge4KSC : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
Cartridge4KSC(const BytePtr& image, uInt32 size, const Settings& settings); Cartridge4KSC(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~Cartridge4KSC() = default; virtual ~Cartridge4KSC() = default;
public: public:

View File

@ -21,8 +21,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeAR::CartridgeAR(const BytePtr& image, uInt32 size, CartridgeAR::CartridgeAR(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
mySize(std::max(size, 8448u)), mySize(std::max(size, 8448u)),
myWriteEnabled(false), myWriteEnabled(false),
myPower(true), myPower(true),

View File

@ -49,9 +49,11 @@ class CartridgeAR : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeAR(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeAR(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeAR() = default; virtual ~CartridgeAR() = default;
public: public:

View File

@ -20,8 +20,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeBF::CartridgeBF(const BytePtr& image, uInt32 size, CartridgeBF::CartridgeBF(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
myBankOffset(0) myBankOffset(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer

View File

@ -43,9 +43,11 @@ class CartridgeBF : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeBF(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeBF(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeBF() = default; virtual ~CartridgeBF() = default;
public: public:

View File

@ -20,8 +20,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeBFSC::CartridgeBFSC(const BytePtr& image, uInt32 size, CartridgeBFSC::CartridgeBFSC(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
myBankOffset(0) myBankOffset(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer

View File

@ -43,9 +43,11 @@ class CartridgeBFSC : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeBFSC(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeBFSC(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeBFSC() = default; virtual ~CartridgeBFSC() = default;
public: public:

View File

@ -42,8 +42,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeBUS::CartridgeBUS(const BytePtr& image, uInt32 size, CartridgeBUS::CartridgeBUS(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
myAudioCycles(0), myAudioCycles(0),
myARMCycles(0), myARMCycles(0),
myFractionalClocks(0.0) myFractionalClocks(0.0)

View File

@ -51,9 +51,11 @@ class CartridgeBUS : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeBUS(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeBUS(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeBUS() = default; virtual ~CartridgeBUS() = default;
public: public:

View File

@ -43,8 +43,8 @@ const uInt16 WAVEFORM[] = {0x07F0, 0x01B0};
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeCDF::CartridgeCDF(const BytePtr& image, uInt32 size, CartridgeCDF::CartridgeCDF(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
myAudioCycles(0), myAudioCycles(0),
myARMCycles(0), myARMCycles(0),
myFractionalClocks(0.0) myFractionalClocks(0.0)

View File

@ -51,9 +51,11 @@ class CartridgeCDF : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeCDF(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeCDF(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeCDF() = default; virtual ~CartridgeCDF() = default;
public: public:

View File

@ -22,8 +22,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeCM::CartridgeCM(const BytePtr& image, uInt32 size, CartridgeCM::CartridgeCM(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
mySWCHA(0xFF), // portA is all 1's mySWCHA(0xFF), // portA is all 1's
myBankOffset(0) myBankOffset(0)
{ {

View File

@ -117,9 +117,11 @@ class CartridgeCM : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeCM(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeCM(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeCM() = default; virtual ~CartridgeCM() = default;
public: public:

View File

@ -22,8 +22,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeCTY::CartridgeCTY(const BytePtr& image, uInt32 size, CartridgeCTY::CartridgeCTY(const BytePtr& image, uInt32 size,
const OSystem& osystem) const string& md5, const OSystem& osystem)
: Cartridge(osystem.settings()), : Cartridge(osystem.settings(), md5),
myOSystem(osystem), myOSystem(osystem),
myOperationType(0), myOperationType(0),
myTunePosition(0), myTunePosition(0),

View File

@ -27,8 +27,6 @@ class System;
#endif #endif
/** /**
FIXME: This scheme is not yet fully implemented.
The 'Chetiry' bankswitch scheme was developed by Chris D. Walton for a The 'Chetiry' bankswitch scheme was developed by Chris D. Walton for a
Tetris clone game by the same name. It makes use of a Harmony cart, Tetris clone game by the same name. It makes use of a Harmony cart,
whereby ARM code in bank 0 is executed to implement the bankswitch scheme. whereby ARM code in bank 0 is executed to implement the bankswitch scheme.
@ -117,9 +115,11 @@ class CartridgeCTY : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @param size The size of the ROM image
@param md5 The md5sum of the ROM image
@param osystem A reference to the OSystem currently in use @param osystem A reference to the OSystem currently in use
*/ */
CartridgeCTY(const BytePtr& image, uInt32 size, const OSystem& osystem); CartridgeCTY(const BytePtr& image, uInt32 size, const string& md5,
const OSystem& osystem);
virtual ~CartridgeCTY() = default; virtual ~CartridgeCTY() = default;
public: public:

View File

@ -20,8 +20,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeCV::CartridgeCV(const BytePtr& image, uInt32 size, CartridgeCV::CartridgeCV(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
mySize(size) mySize(size)
{ {
if(mySize == 2048) if(mySize == 2048)

View File

@ -45,9 +45,11 @@ class CartridgeCV : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeCV(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeCV(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeCV() = default; virtual ~CartridgeCV() = default;
public: public:

View File

@ -21,8 +21,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeCVPlus::CartridgeCVPlus(const BytePtr& image, uInt32 size, CartridgeCVPlus::CartridgeCVPlus(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
mySize(size), mySize(size),
myCurrentBank(0) myCurrentBank(0)
{ {

View File

@ -57,7 +57,8 @@ class CartridgeCVPlus : public Cartridge
@param size The size of the ROM image @param size The size of the ROM image
@param settings A reference to the various settings (read-only) @param settings A reference to the various settings (read-only)
*/ */
CartridgeCVPlus(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeCVPlus(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeCVPlus() = default; virtual ~CartridgeCVPlus() = default;
public: public:

View File

@ -21,8 +21,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeDASH::CartridgeDASH(const BytePtr& image, uInt32 size, CartridgeDASH::CartridgeDASH(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
mySize(size) mySize(size)
{ {
// Allocate array for the ROM image // Allocate array for the ROM image

View File

@ -133,9 +133,11 @@ class CartridgeDASH: public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeDASH(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeDASH(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeDASH() = default; virtual ~CartridgeDASH() = default;
public: public:

View File

@ -20,8 +20,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeDF::CartridgeDF(const BytePtr& image, uInt32 size, CartridgeDF::CartridgeDF(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
myBankOffset(0) myBankOffset(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer

View File

@ -43,9 +43,11 @@ class CartridgeDF : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeDF(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeDF(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeDF() = default; virtual ~CartridgeDF() = default;
public: public:

View File

@ -20,8 +20,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeDFSC::CartridgeDFSC(const BytePtr& image, uInt32 size, CartridgeDFSC::CartridgeDFSC(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
myBankOffset(0) myBankOffset(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer

View File

@ -43,9 +43,11 @@ class CartridgeDFSC : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeDFSC(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeDFSC(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeDFSC() = default; virtual ~CartridgeDFSC() = default;
public: public:

View File

@ -20,8 +20,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeDPC::CartridgeDPC(const BytePtr& image, uInt32 size, CartridgeDPC::CartridgeDPC(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
mySize(size), mySize(size),
myAudioCycles(0), myAudioCycles(0),
myFractionalClocks(0.0), myFractionalClocks(0.0),

View File

@ -47,9 +47,11 @@ class CartridgeDPC : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeDPC(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeDPC(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeDPC() = default; virtual ~CartridgeDPC() = default;
public: public:

View File

@ -26,8 +26,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeDPCPlus::CartridgeDPCPlus(const BytePtr& image, uInt32 size, CartridgeDPCPlus::CartridgeDPCPlus(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
mySize(std::min(size, 32768u)), mySize(std::min(size, 32768u)),
myFastFetch(false), myFastFetch(false),
myLDAimmediate(false), myLDAimmediate(false),

View File

@ -53,9 +53,11 @@ class CartridgeDPCPlus : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeDPCPlus(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeDPCPlus(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeDPCPlus() = default; virtual ~CartridgeDPCPlus() = default;
public: public:

View File

@ -246,89 +246,89 @@ CartDetector::createFromImage(const BytePtr& image, uInt32 size, Bankswitch::Typ
switch(type) switch(type)
{ {
case Bankswitch::Type::_0840: case Bankswitch::Type::_0840:
return make_unique<Cartridge0840>(image, size, osystem.settings()); return make_unique<Cartridge0840>(image, size, md5, osystem.settings());
case Bankswitch::Type::_2K: case Bankswitch::Type::_2K:
return make_unique<Cartridge2K>(image, size, osystem.settings()); return make_unique<Cartridge2K>(image, size, md5, osystem.settings());
case Bankswitch::Type::_3E: case Bankswitch::Type::_3E:
return make_unique<Cartridge3E>(image, size, osystem.settings()); return make_unique<Cartridge3E>(image, size, md5, osystem.settings());
case Bankswitch::Type::_3EP: case Bankswitch::Type::_3EP:
return make_unique<Cartridge3EPlus>(image, size, osystem.settings()); return make_unique<Cartridge3EPlus>(image, size, md5, osystem.settings());
case Bankswitch::Type::_3F: case Bankswitch::Type::_3F:
return make_unique<Cartridge3F>(image, size, osystem.settings()); return make_unique<Cartridge3F>(image, size, md5, osystem.settings());
case Bankswitch::Type::_4A50: case Bankswitch::Type::_4A50:
return make_unique<Cartridge4A50>(image, size, osystem.settings()); return make_unique<Cartridge4A50>(image, size, md5, osystem.settings());
case Bankswitch::Type::_4K: case Bankswitch::Type::_4K:
return make_unique<Cartridge4K>(image, size, osystem.settings()); return make_unique<Cartridge4K>(image, size, md5, osystem.settings());
case Bankswitch::Type::_4KSC: case Bankswitch::Type::_4KSC:
return make_unique<Cartridge4KSC>(image, size, osystem.settings()); return make_unique<Cartridge4KSC>(image, size, md5, osystem.settings());
case Bankswitch::Type::_AR: case Bankswitch::Type::_AR:
return make_unique<CartridgeAR>(image, size, osystem.settings()); return make_unique<CartridgeAR>(image, size, md5, osystem.settings());
case Bankswitch::Type::_BF: case Bankswitch::Type::_BF:
return make_unique<CartridgeBF>(image, size, osystem.settings()); return make_unique<CartridgeBF>(image, size, md5, osystem.settings());
case Bankswitch::Type::_BFSC: case Bankswitch::Type::_BFSC:
return make_unique<CartridgeBFSC>(image, size, osystem.settings()); return make_unique<CartridgeBFSC>(image, size, md5, osystem.settings());
case Bankswitch::Type::_BUS: case Bankswitch::Type::_BUS:
return make_unique<CartridgeBUS>(image, size, osystem.settings()); return make_unique<CartridgeBUS>(image, size, md5, osystem.settings());
case Bankswitch::Type::_CDF: case Bankswitch::Type::_CDF:
return make_unique<CartridgeCDF>(image, size, osystem.settings()); return make_unique<CartridgeCDF>(image, size, md5, osystem.settings());
case Bankswitch::Type::_CM: case Bankswitch::Type::_CM:
return make_unique<CartridgeCM>(image, size, osystem.settings()); return make_unique<CartridgeCM>(image, size, md5, osystem.settings());
case Bankswitch::Type::_CTY: case Bankswitch::Type::_CTY:
return make_unique<CartridgeCTY>(image, size, osystem); return make_unique<CartridgeCTY>(image, size, md5, osystem);
case Bankswitch::Type::_CV: case Bankswitch::Type::_CV:
return make_unique<CartridgeCV>(image, size, osystem.settings()); return make_unique<CartridgeCV>(image, size, md5, osystem.settings());
case Bankswitch::Type::_CVP: case Bankswitch::Type::_CVP:
return make_unique<CartridgeCVPlus>(image, size, osystem.settings()); return make_unique<CartridgeCVPlus>(image, size, md5, osystem.settings());
case Bankswitch::Type::_DASH: case Bankswitch::Type::_DASH:
return make_unique<CartridgeDASH>(image, size, osystem.settings()); return make_unique<CartridgeDASH>(image, size, md5, osystem.settings());
case Bankswitch::Type::_DF: case Bankswitch::Type::_DF:
return make_unique<CartridgeDF>(image, size, osystem.settings()); return make_unique<CartridgeDF>(image, size, md5, osystem.settings());
case Bankswitch::Type::_DFSC: case Bankswitch::Type::_DFSC:
return make_unique<CartridgeDFSC>(image, size, osystem.settings()); return make_unique<CartridgeDFSC>(image, size, md5, osystem.settings());
case Bankswitch::Type::_DPC: case Bankswitch::Type::_DPC:
return make_unique<CartridgeDPC>(image, size, osystem.settings()); return make_unique<CartridgeDPC>(image, size, md5, osystem.settings());
case Bankswitch::Type::_DPCP: case Bankswitch::Type::_DPCP:
return make_unique<CartridgeDPCPlus>(image, size, osystem.settings()); return make_unique<CartridgeDPCPlus>(image, size, md5, osystem.settings());
case Bankswitch::Type::_E0: case Bankswitch::Type::_E0:
return make_unique<CartridgeE0>(image, size, osystem.settings()); return make_unique<CartridgeE0>(image, size, md5, osystem.settings());
case Bankswitch::Type::_E7: case Bankswitch::Type::_E7:
return make_unique<CartridgeE7>(image, size, osystem.settings()); return make_unique<CartridgeE7>(image, size, md5, osystem.settings());
case Bankswitch::Type::_E78K: case Bankswitch::Type::_E78K:
return make_unique<CartridgeE78K>(image, size, osystem.settings()); return make_unique<CartridgeE78K>(image, size, md5, osystem.settings());
case Bankswitch::Type::_EF: case Bankswitch::Type::_EF:
return make_unique<CartridgeEF>(image, size, osystem.settings()); return make_unique<CartridgeEF>(image, size, md5, osystem.settings());
case Bankswitch::Type::_EFSC: case Bankswitch::Type::_EFSC:
return make_unique<CartridgeEFSC>(image, size, osystem.settings()); return make_unique<CartridgeEFSC>(image, size, md5, osystem.settings());
case Bankswitch::Type::_F0: case Bankswitch::Type::_F0:
return make_unique<CartridgeF0>(image, size, osystem.settings()); return make_unique<CartridgeF0>(image, size, md5, osystem.settings());
case Bankswitch::Type::_F4: case Bankswitch::Type::_F4:
return make_unique<CartridgeF4>(image, size, osystem.settings()); return make_unique<CartridgeF4>(image, size, md5, osystem.settings());
case Bankswitch::Type::_F4SC: case Bankswitch::Type::_F4SC:
return make_unique<CartridgeF4SC>(image, size, osystem.settings()); return make_unique<CartridgeF4SC>(image, size, md5, osystem.settings());
case Bankswitch::Type::_F6: case Bankswitch::Type::_F6:
return make_unique<CartridgeF6>(image, size, osystem.settings()); return make_unique<CartridgeF6>(image, size, md5, osystem.settings());
case Bankswitch::Type::_F6SC: case Bankswitch::Type::_F6SC:
return make_unique<CartridgeF6SC>(image, size, osystem.settings()); return make_unique<CartridgeF6SC>(image, size, md5, osystem.settings());
case Bankswitch::Type::_F8: case Bankswitch::Type::_F8:
return make_unique<CartridgeF8>(image, size, md5, osystem.settings()); return make_unique<CartridgeF8>(image, size, md5, osystem.settings());
case Bankswitch::Type::_F8SC: case Bankswitch::Type::_F8SC:
return make_unique<CartridgeF8SC>(image, size, osystem.settings()); return make_unique<CartridgeF8SC>(image, size, md5, osystem.settings());
case Bankswitch::Type::_FA: case Bankswitch::Type::_FA:
return make_unique<CartridgeFA>(image, size, osystem.settings()); return make_unique<CartridgeFA>(image, size, md5, osystem.settings());
case Bankswitch::Type::_FA2: case Bankswitch::Type::_FA2:
return make_unique<CartridgeFA2>(image, size, osystem); return make_unique<CartridgeFA2>(image, size, md5, osystem);
case Bankswitch::Type::_FE: case Bankswitch::Type::_FE:
return make_unique<CartridgeFE>(image, size, osystem.settings()); return make_unique<CartridgeFE>(image, size, md5, osystem.settings());
case Bankswitch::Type::_MDM: case Bankswitch::Type::_MDM:
return make_unique<CartridgeMDM>(image, size, osystem.settings()); return make_unique<CartridgeMDM>(image, size, md5, osystem.settings());
case Bankswitch::Type::_UA: case Bankswitch::Type::_UA:
return make_unique<CartridgeUA>(image, size, osystem.settings()); return make_unique<CartridgeUA>(image, size, md5, osystem.settings());
case Bankswitch::Type::_SB: case Bankswitch::Type::_SB:
return make_unique<CartridgeSB>(image, size, osystem.settings()); return make_unique<CartridgeSB>(image, size, md5, osystem.settings());
case Bankswitch::Type::_WD: case Bankswitch::Type::_WD:
return make_unique<CartridgeWD>(image, size, osystem.settings()); return make_unique<CartridgeWD>(image, size, md5, osystem.settings());
case Bankswitch::Type::_X07: case Bankswitch::Type::_X07:
return make_unique<CartridgeX07>(image, size, osystem.settings()); return make_unique<CartridgeX07>(image, size, md5, osystem.settings());
default: default:
return nullptr; // The remaining types have already been handled return nullptr; // The remaining types have already been handled
} }

View File

@ -20,8 +20,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeE0::CartridgeE0(const BytePtr& image, uInt32 size, CartridgeE0::CartridgeE0(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings) : Cartridge(settings, md5)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
memcpy(myImage, image.get(), std::min(8192u, size)); memcpy(myImage, image.get(), std::min(8192u, size));

View File

@ -51,9 +51,11 @@ class CartridgeE0 : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeE0(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeE0(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeE0() = default; virtual ~CartridgeE0() = default;
public: public:

View File

@ -20,8 +20,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeE7::CartridgeE7(const BytePtr& image, uInt32 size, CartridgeE7::CartridgeE7(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: CartridgeMNetwork(image, size, settings) : CartridgeMNetwork(image, size, md5, settings)
{ {
initialize(image, size); initialize(image, size);
} }

View File

@ -40,9 +40,11 @@ class CartridgeE7 : public CartridgeMNetwork
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeE7(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeE7(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeE7() = default; virtual ~CartridgeE7() = default;
public: public:

View File

@ -20,8 +20,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeE78K::CartridgeE78K(const BytePtr& image, uInt32 size, CartridgeE78K::CartridgeE78K(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: CartridgeMNetwork(image, size, settings) : CartridgeMNetwork(image, size, md5, settings)
{ {
initialize(image, size); initialize(image, size);
} }

View File

@ -38,9 +38,11 @@ class CartridgeE78K : public CartridgeMNetwork
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeE78K(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeE78K(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeE78K() = default; virtual ~CartridgeE78K() = default;
public: public:

View File

@ -20,8 +20,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeEF::CartridgeEF(const BytePtr& image, uInt32 size, CartridgeEF::CartridgeEF(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
myBankOffset(0) myBankOffset(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer

View File

@ -43,9 +43,11 @@ class CartridgeEF : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeEF(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeEF(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeEF() = default; virtual ~CartridgeEF() = default;
public: public:

View File

@ -20,8 +20,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeEFSC::CartridgeEFSC(const BytePtr& image, uInt32 size, CartridgeEFSC::CartridgeEFSC(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
myBankOffset(0) myBankOffset(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer

View File

@ -44,9 +44,11 @@ class CartridgeEFSC : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeEFSC(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeEFSC(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeEFSC() = default; virtual ~CartridgeEFSC() = default;
public: public:

View File

@ -20,8 +20,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeF0::CartridgeF0(const BytePtr& image, uInt32 size, CartridgeF0::CartridgeF0(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
myBankOffset(0) myBankOffset(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer

View File

@ -43,9 +43,11 @@ class CartridgeF0 : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeF0(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeF0(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeF0() = default; virtual ~CartridgeF0() = default;
public: public:

View File

@ -21,8 +21,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeF4::CartridgeF4(const BytePtr& image, uInt32 size, CartridgeF4::CartridgeF4(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
myBankOffset(0) myBankOffset(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer

View File

@ -42,9 +42,11 @@ class CartridgeF4 : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeF4(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeF4(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeF4() = default; virtual ~CartridgeF4() = default;
public: public:

View File

@ -20,8 +20,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeF4SC::CartridgeF4SC(const BytePtr& image, uInt32 size, CartridgeF4SC::CartridgeF4SC(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
myBankOffset(0) myBankOffset(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer

View File

@ -43,9 +43,11 @@ class CartridgeF4SC : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeF4SC(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeF4SC(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeF4SC() = default; virtual ~CartridgeF4SC() = default;
public: public:

View File

@ -20,8 +20,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeF6::CartridgeF6(const BytePtr& image, uInt32 size, CartridgeF6::CartridgeF6(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
myBankOffset(0) myBankOffset(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer

View File

@ -42,9 +42,11 @@ class CartridgeF6 : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeF6(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeF6(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeF6() = default; virtual ~CartridgeF6() = default;
public: public:

View File

@ -20,8 +20,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeF6SC::CartridgeF6SC(const BytePtr& image, uInt32 size, CartridgeF6SC::CartridgeF6SC(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
myBankOffset(0) myBankOffset(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer

View File

@ -43,9 +43,11 @@ class CartridgeF6SC : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeF6SC(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeF6SC(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeF6SC() = default; virtual ~CartridgeF6SC() = default;
public: public:

View File

@ -19,9 +19,9 @@
#include "CartF8.hxx" #include "CartF8.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeF8::CartridgeF8(const BytePtr& image, uInt32 size, const string& md5, CartridgeF8::CartridgeF8(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
myBankOffset(0) myBankOffset(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer

View File

@ -42,7 +42,7 @@ class CartridgeF8 : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @param size The size of the ROM image
@param md5 MD5sum of the ROM image @param md5 The md5sum of the ROM image
@param settings A reference to the various settings (read-only) @param settings A reference to the various settings (read-only)
*/ */
CartridgeF8(const BytePtr& image, uInt32 size, const string& md5, CartridgeF8(const BytePtr& image, uInt32 size, const string& md5,

View File

@ -20,8 +20,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeF8SC::CartridgeF8SC(const BytePtr& image, uInt32 size, CartridgeF8SC::CartridgeF8SC(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
myBankOffset(0) myBankOffset(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer

View File

@ -43,9 +43,11 @@ class CartridgeF8SC : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeF8SC(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeF8SC(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeF8SC() = default; virtual ~CartridgeF8SC() = default;
public: public:

View File

@ -20,8 +20,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeFA::CartridgeFA(const BytePtr& image, uInt32 size, CartridgeFA::CartridgeFA(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
myBankOffset(0) myBankOffset(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer

View File

@ -43,9 +43,11 @@ class CartridgeFA : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeFA(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeFA(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeFA() = default; virtual ~CartridgeFA() = default;
public: public:

View File

@ -22,8 +22,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeFA2::CartridgeFA2(const BytePtr& image, uInt32 size, CartridgeFA2::CartridgeFA2(const BytePtr& image, uInt32 size,
const OSystem& osystem) const string& md5, const OSystem& osystem)
: Cartridge(osystem.settings()), : Cartridge(osystem.settings(), md5),
myOSystem(osystem), myOSystem(osystem),
mySize(28 * 1024), mySize(28 * 1024),
myRamAccessTimeout(0), myRamAccessTimeout(0),

View File

@ -55,9 +55,11 @@ class CartridgeFA2 : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @param size The size of the ROM image
@param md5 The md5sum of the ROM image
@param osystem A reference to the OSystem currently in use @param osystem A reference to the OSystem currently in use
*/ */
CartridgeFA2(const BytePtr& image, uInt32 size, const OSystem& osystem); CartridgeFA2(const BytePtr& image, uInt32 size, const string& md5,
const OSystem& osystem);
virtual ~CartridgeFA2() = default; virtual ~CartridgeFA2() = default;
public: public:

View File

@ -21,8 +21,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeFE::CartridgeFE(const BytePtr& image, uInt32 size, CartridgeFE::CartridgeFE(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
myBankOffset(0), myBankOffset(0),
myLastAccessWasFE(false) myLastAccessWasFE(false)
{ {

View File

@ -85,9 +85,11 @@ class CartridgeFE : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeFE(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeFE(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeFE() = default; virtual ~CartridgeFE() = default;
public: public:

View File

@ -20,8 +20,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeMDM::CartridgeMDM(const BytePtr& image, uInt32 size, CartridgeMDM::CartridgeMDM(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
mySize(size), mySize(size),
myBankOffset(0), myBankOffset(0),
myBankingDisabled(false) myBankingDisabled(false)

View File

@ -54,9 +54,11 @@ class CartridgeMDM : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeMDM(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeMDM(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeMDM() = default; virtual ~CartridgeMDM() = default;
public: public:

View File

@ -20,8 +20,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeMNetwork::CartridgeMNetwork(const BytePtr& image, uInt32 size, CartridgeMNetwork::CartridgeMNetwork(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
mySize(size), mySize(size),
myCurrentRAM(0), myCurrentRAM(0),
myRAMSlice(0) myRAMSlice(0)

View File

@ -70,9 +70,11 @@ class CartridgeMNetwork : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeMNetwork(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeMNetwork(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeMNetwork() = default; virtual ~CartridgeMNetwork() = default;
public: public:

View File

@ -20,8 +20,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeSB::CartridgeSB(const BytePtr& image, uInt32 size, CartridgeSB::CartridgeSB(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
mySize(size), mySize(size),
myBankOffset(0) myBankOffset(0)
{ {

View File

@ -43,9 +43,11 @@ class CartridgeSB : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeSB(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeSB(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeSB() = default; virtual ~CartridgeSB() = default;
public: public:

View File

@ -20,8 +20,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeUA::CartridgeUA(const BytePtr& image, uInt32 size, CartridgeUA::CartridgeUA(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
myBankOffset(0) myBankOffset(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer

View File

@ -42,9 +42,11 @@ class CartridgeUA : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeUA(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeUA(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeUA() = default; virtual ~CartridgeUA() = default;
public: public:

View File

@ -22,8 +22,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeWD::CartridgeWD(const BytePtr& image, uInt32 size, CartridgeWD::CartridgeWD(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
mySize(std::min(8195u, size)), mySize(std::min(8195u, size)),
myCyclesAtBankswitchInit(0), myCyclesAtBankswitchInit(0),
myPendingBank(0), myPendingBank(0),

View File

@ -71,9 +71,11 @@ class CartridgeWD : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeWD(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeWD(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeWD() = default; virtual ~CartridgeWD() = default;
public: public:

View File

@ -22,8 +22,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeX07::CartridgeX07(const BytePtr& image, uInt32 size, CartridgeX07::CartridgeX07(const BytePtr& image, uInt32 size,
const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings), : Cartridge(settings, md5),
myCurrentBank(0) myCurrentBank(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer

View File

@ -52,9 +52,11 @@ class CartridgeX07 : public Cartridge
@param image Pointer to the ROM image @param image Pointer to the ROM image
@param size The size of the ROM image @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 settings A reference to the various settings (read-only)
*/ */
CartridgeX07(const BytePtr& image, uInt32 size, const Settings& settings); CartridgeX07(const BytePtr& image, uInt32 size, const string& md5,
const Settings& settings);
virtual ~CartridgeX07() = default; virtual ~CartridgeX07() = default;
public: public: