diff --git a/docs/index.html b/docs/index.html index e98355786..c5149a9da 100644 --- a/docs/index.html +++ b/docs/index.html @@ -846,6 +846,11 @@ and always allows all 4 directions. + +
-usemouse <1|0>
+ Enable using the mouse for various controllers (paddle, driving, etc). + +
-pspeed <number>
Speed for digital emulation of paddles (1-15). @@ -2774,12 +2779,12 @@ Ms Pac-Man (Stella extended codes): 2K 64-2048 byte Atari 3E 32K Tigervision 3F 512K Tigervision - 4A50 ¹²64K 4A50 + ram + 4A50 ¹64K 4A50 + ram 4K 4K Atari - AR ²Supercharger + AR Supercharger CV Commavid extra ram - DPC ²Pitfall II - DPC+ ²Enhanced DPC + DPC Pitfall II + DPC+Enhanced DPC E0 8K Parker Bros E7 16K M-network EF 64K Homestar Runner @@ -2796,7 +2801,7 @@ Ms Pac-Man (Stella extended codes): MC ¹²C. Wilkson Megacart SB 128-256k SUPERbanking UA 8K UA Ltd. - X07 ¹²64K AtariAge + X07 ¹64K AtariAge diff --git a/src/emucore/Cart.cxx b/src/emucore/Cart.cxx index 2db7fb96c..014e62288 100644 --- a/src/emucore/Cart.cxx +++ b/src/emucore/Cart.cxx @@ -241,7 +241,7 @@ bool Cartridge::save(ofstream& out) { int size = -1; - uInt8* image = getImage(size); + const uInt8* image = getImage(size); if(image == 0 || size <= 0) { cerr << "save not supported" << endl; diff --git a/src/emucore/Cart.hxx b/src/emucore/Cart.hxx index 70d41456d..e318c6781 100644 --- a/src/emucore/Cart.hxx +++ b/src/emucore/Cart.hxx @@ -132,7 +132,7 @@ class Cartridge : public Device /** Get the current bank. */ - virtual int bank() = 0; + virtual uInt16 bank() const = 0; /** Query the number of banks supported by the cartridge. Note that @@ -142,7 +142,7 @@ class Cartridge : public Device Such cases occur when pages of ROM can be swapped in and out, yet the 4K image is considered the same. */ - virtual int bankCount() = 0; + virtual uInt16 bankCount() const = 0; /** Patch the cartridge ROM. @@ -159,7 +159,7 @@ class Cartridge : public Device @param size Set to the size of the internal ROM image data @return A pointer to the internal ROM image data */ - virtual uInt8* getImage(int& size) = 0; + virtual const uInt8* getImage(int& size) const = 0; /** Save the current state of this device to the given Serializer. diff --git a/src/emucore/Cart0840.cxx b/src/emucore/Cart0840.cxx index 1cb2474b5..08a722f2c 100644 --- a/src/emucore/Cart0840.cxx +++ b/src/emucore/Cart0840.cxx @@ -169,13 +169,13 @@ void Cartridge0840::bank(uInt16 bank) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int Cartridge0840::bank() +uInt16 Cartridge0840::bank() const { return myCurrentBank; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int Cartridge0840::bankCount() +uInt16 Cartridge0840::bankCount() const { return 2; } @@ -188,7 +188,7 @@ bool Cartridge0840::patch(uInt16 address, uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt8* Cartridge0840::getImage(int& size) +const uInt8* Cartridge0840::getImage(int& size) const { size = 8192; return myImage; diff --git a/src/emucore/Cart0840.hxx b/src/emucore/Cart0840.hxx index 8621020e5..adcba7db2 100644 --- a/src/emucore/Cart0840.hxx +++ b/src/emucore/Cart0840.hxx @@ -68,12 +68,12 @@ class Cartridge0840 : public Cartridge /** Get the current bank. */ - int bank(); + uInt16 bank() const; /** Query the number of banks supported by the cartridge. */ - int bankCount(); + uInt16 bankCount() const; /** Patch the cartridge ROM. @@ -90,7 +90,7 @@ class Cartridge0840 : public Cartridge @param size Set to the size of the internal ROM image data @return A pointer to the internal ROM image data */ - uInt8* getImage(int& size); + const uInt8* getImage(int& size) const; /** Save the current state of this cart to the given Serializer. diff --git a/src/emucore/Cart2K.cxx b/src/emucore/Cart2K.cxx index 899f24ae0..5e97e702e 100644 --- a/src/emucore/Cart2K.cxx +++ b/src/emucore/Cart2K.cxx @@ -104,14 +104,14 @@ void Cartridge2K::bank(uInt16 bank) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int Cartridge2K::bank() +uInt16 Cartridge2K::bank() const { // Doesn't support bankswitching return 0; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int Cartridge2K::bankCount() +uInt16 Cartridge2K::bankCount() const { return 1; } @@ -124,7 +124,7 @@ bool Cartridge2K::patch(uInt16 address, uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt8* Cartridge2K::getImage(int& size) +const uInt8* Cartridge2K::getImage(int& size) const { size = mySize; return myImage; diff --git a/src/emucore/Cart2K.hxx b/src/emucore/Cart2K.hxx index 13a78dc60..0053dfb11 100644 --- a/src/emucore/Cart2K.hxx +++ b/src/emucore/Cart2K.hxx @@ -72,12 +72,12 @@ class Cartridge2K : public Cartridge /** Get the current bank. */ - int bank(); + uInt16 bank() const; /** Query the number of banks supported by the cartridge. */ - int bankCount(); + uInt16 bankCount() const; /** Patch the cartridge ROM. @@ -94,7 +94,7 @@ class Cartridge2K : public Cartridge @param size Set to the size of the internal ROM image data @return A pointer to the internal ROM image data */ - uInt8* getImage(int& size); + const uInt8* getImage(int& size) const; /** Save the current state of this cart to the given Serializer. diff --git a/src/emucore/Cart3E.cxx b/src/emucore/Cart3E.cxx index c8337c3fc..0830381b0 100644 --- a/src/emucore/Cart3E.cxx +++ b/src/emucore/Cart3E.cxx @@ -224,13 +224,13 @@ void Cartridge3E::bank(uInt16 bank) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int Cartridge3E::bank() +uInt16 Cartridge3E::bank() const { return myCurrentBank; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int Cartridge3E::bankCount() +uInt16 Cartridge3E::bankCount() const { // Because the RAM banks always start at 256 and above, we require the // number of ROM banks to be 256 @@ -259,7 +259,7 @@ bool Cartridge3E::patch(uInt16 address, uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt8* Cartridge3E::getImage(int& size) +const uInt8* Cartridge3E::getImage(int& size) const { size = mySize; return myImage; diff --git a/src/emucore/Cart3E.hxx b/src/emucore/Cart3E.hxx index 5e50e307e..3f5d078d1 100644 --- a/src/emucore/Cart3E.hxx +++ b/src/emucore/Cart3E.hxx @@ -100,12 +100,12 @@ class Cartridge3E : public Cartridge /** Get the current bank. */ - int bank(); + uInt16 bank() const; /** Query the number of banks supported by the cartridge. */ - int bankCount(); + uInt16 bankCount() const; /** Patch the cartridge ROM. @@ -122,7 +122,7 @@ class Cartridge3E : public Cartridge @param size Set to the size of the internal ROM image data @return A pointer to the internal ROM image data */ - uInt8* getImage(int& size); + const uInt8* getImage(int& size) const; /** Save the current state of this cart to the given Serializer. diff --git a/src/emucore/Cart3F.cxx b/src/emucore/Cart3F.cxx index 330e408ae..171586ddb 100644 --- a/src/emucore/Cart3F.cxx +++ b/src/emucore/Cart3F.cxx @@ -156,13 +156,13 @@ void Cartridge3F::bank(uInt16 bank) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int Cartridge3F::bank() +uInt16 Cartridge3F::bank() const { return myCurrentBank; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int Cartridge3F::bankCount() +uInt16 Cartridge3F::bankCount() const { return mySize >> 11; } @@ -181,7 +181,7 @@ bool Cartridge3F::patch(uInt16 address, uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt8* Cartridge3F::getImage(int& size) +const uInt8* Cartridge3F::getImage(int& size) const { size = mySize; return myImage; diff --git a/src/emucore/Cart3F.hxx b/src/emucore/Cart3F.hxx index e14f916e4..ffc16306a 100644 --- a/src/emucore/Cart3F.hxx +++ b/src/emucore/Cart3F.hxx @@ -76,15 +76,13 @@ class Cartridge3F : public Cartridge /** Get the current bank. - - @return The current bank, or -1 if bankswitching not supported */ - int bank(); + uInt16 bank() const; /** Query the number of banks supported by the cartridge. */ - int bankCount(); + uInt16 bankCount() const; /** Patch the cartridge ROM. @@ -101,7 +99,7 @@ class Cartridge3F : public Cartridge @param size Set to the size of the internal ROM image data @return A pointer to the internal ROM image data */ - uInt8* getImage(int& size); + const uInt8* getImage(int& size) const; /** Save the current state of this cart to the given Serializer. diff --git a/src/emucore/Cart4A50.cxx b/src/emucore/Cart4A50.cxx index c18be80b2..05a9d55f6 100644 --- a/src/emucore/Cart4A50.cxx +++ b/src/emucore/Cart4A50.cxx @@ -314,14 +314,14 @@ void Cartridge4A50::bank(uInt16) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int Cartridge4A50::bank() +uInt16 Cartridge4A50::bank() const { // Doesn't support bankswitching in the normal sense return 0; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int Cartridge4A50::bankCount() +uInt16 Cartridge4A50::bankCount() const { // Doesn't support bankswitching in the normal sense // There is one 'virtual' bank that can change in many different ways @@ -361,7 +361,7 @@ bool Cartridge4A50::patch(uInt16 address, uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt8* Cartridge4A50::getImage(int& size) +const uInt8* Cartridge4A50::getImage(int& size) const { size = 131072; return myImage; diff --git a/src/emucore/Cart4A50.hxx b/src/emucore/Cart4A50.hxx index 46d146391..b7fc41943 100644 --- a/src/emucore/Cart4A50.hxx +++ b/src/emucore/Cart4A50.hxx @@ -85,12 +85,12 @@ class Cartridge4A50 : public Cartridge /** Get the current bank. */ - int bank(); + uInt16 bank() const; /** Query the number of banks supported by the cartridge. */ - int bankCount(); + uInt16 bankCount() const; /** Patch the cartridge ROM. @@ -107,7 +107,7 @@ class Cartridge4A50 : public Cartridge @param size Set to the size of the internal ROM image data @return A pointer to the internal ROM image data */ - uInt8* getImage(int& size); + const uInt8* getImage(int& size) const; /** Save the current state of this cart to the given Serializer. diff --git a/src/emucore/Cart4K.cxx b/src/emucore/Cart4K.cxx index 0ee016780..d854dc791 100644 --- a/src/emucore/Cart4K.cxx +++ b/src/emucore/Cart4K.cxx @@ -82,14 +82,14 @@ void Cartridge4K::bank(uInt16) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int Cartridge4K::bank() +uInt16 Cartridge4K::bank() const { // Doesn't support bankswitching return 0; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int Cartridge4K::bankCount() +uInt16 Cartridge4K::bankCount() const { return 1; } @@ -102,7 +102,7 @@ bool Cartridge4K::patch(uInt16 address, uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt8* Cartridge4K::getImage(int& size) +const uInt8* Cartridge4K::getImage(int& size) const { size = 4096; return myImage; diff --git a/src/emucore/Cart4K.hxx b/src/emucore/Cart4K.hxx index 0f0aa2c47..0075c90e1 100644 --- a/src/emucore/Cart4K.hxx +++ b/src/emucore/Cart4K.hxx @@ -70,12 +70,12 @@ class Cartridge4K : public Cartridge /** Get the current bank. */ - int bank(); + uInt16 bank() const; /** Query the number of banks supported by the cartridge. */ - int bankCount(); + uInt16 bankCount() const; /** Patch the cartridge ROM. @@ -92,7 +92,7 @@ class Cartridge4K : public Cartridge @param size Set to the size of the internal ROM image data @return A pointer to the internal ROM image data */ - uInt8* getImage(int& size); + const uInt8* getImage(int& size) const; /** Save the current state of this cart to the given Serializer. diff --git a/src/emucore/CartAR.cxx b/src/emucore/CartAR.cxx index a33314e16..94f848b1d 100644 --- a/src/emucore/CartAR.cxx +++ b/src/emucore/CartAR.cxx @@ -413,13 +413,13 @@ void CartridgeAR::bank(uInt16 bank) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeAR::bank() +uInt16 CartridgeAR::bank() const { return myCurrentBank; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeAR::bankCount() +uInt16 CartridgeAR::bankCount() const { return 32; } @@ -432,9 +432,9 @@ bool CartridgeAR::patch(uInt16 address, uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt8* CartridgeAR::getImage(int& size) +const uInt8* CartridgeAR::getImage(int& size) const { - size = sizeof(myLoadImages); + size = myNumberOfLoadImages * 8448; return myLoadImages; } diff --git a/src/emucore/CartAR.hxx b/src/emucore/CartAR.hxx index 38144efd9..79cb19d61 100644 --- a/src/emucore/CartAR.hxx +++ b/src/emucore/CartAR.hxx @@ -86,12 +86,12 @@ class CartridgeAR : public Cartridge /** Get the current bank. */ - int bank(); + uInt16 bank() const; /** Query the number of banks supported by the cartridge. */ - int bankCount(); + uInt16 bankCount() const; /** Patch the cartridge ROM. @@ -108,7 +108,7 @@ class CartridgeAR : public Cartridge @param size Set to the size of the internal ROM image data @return A pointer to the internal ROM image data */ - uInt8* getImage(int& size); + const uInt8* getImage(int& size) const; /** Save the current state of this cart to the given Serializer. diff --git a/src/emucore/CartCV.cxx b/src/emucore/CartCV.cxx index 40e86dcf8..49cbe7c77 100644 --- a/src/emucore/CartCV.cxx +++ b/src/emucore/CartCV.cxx @@ -22,9 +22,6 @@ #include "System.hxx" #include "CartCV.hxx" -// TODO - Port to new CartDebug/disassembler scheme -// Add bankchanged code - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeCV::CartridgeCV(const uInt8* image, uInt32 size) : myInitialRAM(0), @@ -154,14 +151,14 @@ void CartridgeCV::bank(uInt16 bank) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeCV::bank() +uInt16 CartridgeCV::bank() const { // Doesn't support bankswitching return 0; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeCV::bankCount() +uInt16 CartridgeCV::bankCount() const { return 1; } @@ -186,7 +183,7 @@ bool CartridgeCV::patch(uInt16 address, uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt8* CartridgeCV::getImage(int& size) +const uInt8* CartridgeCV::getImage(int& size) const { size = 2048; return myImage; diff --git a/src/emucore/CartCV.hxx b/src/emucore/CartCV.hxx index 462fb5f35..8f3a50cce 100644 --- a/src/emucore/CartCV.hxx +++ b/src/emucore/CartCV.hxx @@ -73,12 +73,12 @@ class CartridgeCV : public Cartridge /** Get the current bank. */ - int bank(); + uInt16 bank() const; /** Query the number of banks supported by the cartridge. */ - int bankCount(); + uInt16 bankCount() const; /** Patch the cartridge ROM. @@ -95,7 +95,7 @@ class CartridgeCV : public Cartridge @param size Set to the size of the internal ROM image data @return A pointer to the internal ROM image data */ - uInt8* getImage(int& size); + const uInt8* getImage(int& size) const; /** Save the current state of this cart to the given Serializer. diff --git a/src/emucore/CartDPC.cxx b/src/emucore/CartDPC.cxx index a6e9d4f87..f922eab91 100644 --- a/src/emucore/CartDPC.cxx +++ b/src/emucore/CartDPC.cxx @@ -443,13 +443,13 @@ void CartridgeDPC::bank(uInt16 bank) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeDPC::bank() +uInt16 CartridgeDPC::bank() const { return myCurrentBank; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeDPC::bankCount() +uInt16 CartridgeDPC::bankCount() const { return 2; } @@ -470,7 +470,7 @@ bool CartridgeDPC::patch(uInt16 address, uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt8* CartridgeDPC::getImage(int& size) +const uInt8* CartridgeDPC::getImage(int& size) const { size = 8192 + 2048 + 255; return myImageCopy; diff --git a/src/emucore/CartDPC.hxx b/src/emucore/CartDPC.hxx index 383a6bdc3..bbc10cd61 100644 --- a/src/emucore/CartDPC.hxx +++ b/src/emucore/CartDPC.hxx @@ -78,12 +78,12 @@ class CartridgeDPC : public Cartridge /** Get the current bank. */ - int bank(); + uInt16 bank() const; /** Query the number of banks supported by the cartridge. */ - int bankCount(); + uInt16 bankCount() const; /** Patch the cartridge ROM. @@ -100,7 +100,7 @@ class CartridgeDPC : public Cartridge @param size Set to the size of the internal ROM image data @return A pointer to the internal ROM image data */ - uInt8* getImage(int& size); + const uInt8* getImage(int& size) const; /** Save the current state of this cart to the given Serializer. diff --git a/src/emucore/CartDPCPlus.cxx b/src/emucore/CartDPCPlus.cxx index 787b628a8..add24125f 100644 --- a/src/emucore/CartDPCPlus.cxx +++ b/src/emucore/CartDPCPlus.cxx @@ -560,13 +560,13 @@ void CartridgeDPCPlus::bank(uInt16 bank) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeDPCPlus::bank() +uInt16 CartridgeDPCPlus::bank() const { return myCurrentBank; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeDPCPlus::bankCount() +uInt16 CartridgeDPCPlus::bankCount() const { return 6; } @@ -587,7 +587,7 @@ bool CartridgeDPCPlus::patch(uInt16 address, uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt8* CartridgeDPCPlus::getImage(int& size) +const uInt8* CartridgeDPCPlus::getImage(int& size) const { size = 4096 * 6 + 4096 + 255; return myImageCopy; diff --git a/src/emucore/CartDPCPlus.hxx b/src/emucore/CartDPCPlus.hxx index 47d04ea2c..67d83ab49 100644 --- a/src/emucore/CartDPCPlus.hxx +++ b/src/emucore/CartDPCPlus.hxx @@ -78,12 +78,12 @@ class CartridgeDPCPlus : public Cartridge /** Get the current bank. */ - int bank(); + uInt16 bank() const; /** Query the number of banks supported by the cartridge. */ - int bankCount(); + uInt16 bankCount() const; /** Patch the cartridge ROM. @@ -100,7 +100,7 @@ class CartridgeDPCPlus : public Cartridge @param size Set to the size of the internal ROM image data @return A pointer to the internal ROM image data */ - uInt8* getImage(int& size); + const uInt8* getImage(int& size) const; /** Save the current state of this cart to the given Serializer. diff --git a/src/emucore/CartE0.cxx b/src/emucore/CartE0.cxx index 1ac6c68e6..220a0aa3c 100644 --- a/src/emucore/CartE0.cxx +++ b/src/emucore/CartE0.cxx @@ -201,16 +201,17 @@ void CartridgeE0::bank(uInt16) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeE0::bank() +uInt16 CartridgeE0::bank() const { // Doesn't support bankswitching in the normal sense return 0; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeE0::bankCount() +uInt16 CartridgeE0::bankCount() const { // Doesn't support bankswitching in the normal sense + // There is one 'virtual' bank that can change in many different ways return 1; } @@ -223,7 +224,7 @@ bool CartridgeE0::patch(uInt16 address, uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt8* CartridgeE0::getImage(int& size) +const uInt8* CartridgeE0::getImage(int& size) const { size = 8192; return myImage; diff --git a/src/emucore/CartE0.hxx b/src/emucore/CartE0.hxx index 8457c206c..8a2aa18c6 100644 --- a/src/emucore/CartE0.hxx +++ b/src/emucore/CartE0.hxx @@ -79,12 +79,12 @@ class CartridgeE0 : public Cartridge /** Get the current bank. */ - int bank(); + uInt16 bank() const; /** Query the number of banks supported by the cartridge. */ - int bankCount(); + uInt16 bankCount() const; /** Patch the cartridge ROM. @@ -101,7 +101,7 @@ class CartridgeE0 : public Cartridge @param size Set to the size of the internal ROM image data @return A pointer to the internal ROM image data */ - uInt8* getImage(int& size); + const uInt8* getImage(int& size) const; /** Save the current state of this cart to the given Serializer. diff --git a/src/emucore/CartE7.cxx b/src/emucore/CartE7.cxx index 1237e184f..0b9413232 100644 --- a/src/emucore/CartE7.cxx +++ b/src/emucore/CartE7.cxx @@ -243,13 +243,13 @@ void CartridgeE7::bank(uInt16 slice) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeE7::bank() +uInt16 CartridgeE7::bank() const { return myCurrentSlice[0]; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeE7::bankCount() +uInt16 CartridgeE7::bankCount() const { return 8; } @@ -285,7 +285,7 @@ bool CartridgeE7::patch(uInt16 address, uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt8* CartridgeE7::getImage(int& size) +const uInt8* CartridgeE7::getImage(int& size) const { size = 16384; return myImage; diff --git a/src/emucore/CartE7.hxx b/src/emucore/CartE7.hxx index b6b30de75..4e4e6ad5a 100644 --- a/src/emucore/CartE7.hxx +++ b/src/emucore/CartE7.hxx @@ -96,12 +96,12 @@ class CartridgeE7 : public Cartridge /** Get the current bank. */ - int bank(); + uInt16 bank() const; /** Query the number of banks supported by the cartridge. */ - int bankCount(); + uInt16 bankCount() const; /** Patch the cartridge ROM. @@ -118,7 +118,7 @@ class CartridgeE7 : public Cartridge @param size Set to the size of the internal ROM image data @return A pointer to the internal ROM image data */ - uInt8* getImage(int& size); + const uInt8* getImage(int& size) const; /** Save the current state of this cart to the given Serializer. diff --git a/src/emucore/CartEF.cxx b/src/emucore/CartEF.cxx index 17cfd47ea..764d04a5d 100644 --- a/src/emucore/CartEF.cxx +++ b/src/emucore/CartEF.cxx @@ -119,13 +119,13 @@ void CartridgeEF::bank(uInt16 bank) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeEF::bank() +uInt16 CartridgeEF::bank() const { return myCurrentBank; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeEF::bankCount() +uInt16 CartridgeEF::bankCount() const { return 16; } @@ -138,7 +138,7 @@ bool CartridgeEF::patch(uInt16 address, uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt8* CartridgeEF::getImage(int& size) +const uInt8* CartridgeEF::getImage(int& size) const { size = 65536; return myImage; diff --git a/src/emucore/CartEF.hxx b/src/emucore/CartEF.hxx index ca23c71ff..09a7c9ba3 100644 --- a/src/emucore/CartEF.hxx +++ b/src/emucore/CartEF.hxx @@ -74,12 +74,12 @@ class CartridgeEF : public Cartridge /** Get the current bank. */ - int bank(); + uInt16 bank() const; /** Query the number of banks supported by the cartridge. */ - int bankCount(); + uInt16 bankCount() const; /** Patch the cartridge ROM. @@ -96,7 +96,7 @@ class CartridgeEF : public Cartridge @param size Set to the size of the internal ROM image data @return A pointer to the internal ROM image data */ - uInt8* getImage(int& size); + const uInt8* getImage(int& size) const; /** Save the current state of this cart to the given Serializer. diff --git a/src/emucore/CartEFSC.cxx b/src/emucore/CartEFSC.cxx index fc2fd46fe..045df47d0 100644 --- a/src/emucore/CartEFSC.cxx +++ b/src/emucore/CartEFSC.cxx @@ -162,13 +162,13 @@ void CartridgeEFSC::bank(uInt16 bank) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeEFSC::bank() +uInt16 CartridgeEFSC::bank() const { return myCurrentBank; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeEFSC::bankCount() +uInt16 CartridgeEFSC::bankCount() const { return 16; } @@ -192,7 +192,7 @@ bool CartridgeEFSC::patch(uInt16 address, uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt8* CartridgeEFSC::getImage(int& size) +const uInt8* CartridgeEFSC::getImage(int& size) const { size = 65536; return myImage; diff --git a/src/emucore/CartEFSC.hxx b/src/emucore/CartEFSC.hxx index 54ac263a8..168ba4b97 100644 --- a/src/emucore/CartEFSC.hxx +++ b/src/emucore/CartEFSC.hxx @@ -74,12 +74,12 @@ class CartridgeEFSC : public Cartridge /** Get the current bank. */ - int bank(); + uInt16 bank() const; /** Query the number of banks supported by the cartridge. */ - int bankCount(); + uInt16 bankCount() const; /** Patch the cartridge ROM. @@ -96,7 +96,7 @@ class CartridgeEFSC : public Cartridge @param size Set to the size of the internal ROM image data @return A pointer to the internal ROM image data */ - uInt8* getImage(int& size); + const uInt8* getImage(int& size) const; /** Save the current state of this cart to the given Serializer. diff --git a/src/emucore/CartF0.cxx b/src/emucore/CartF0.cxx index b2ab28434..b465ab4c5 100644 --- a/src/emucore/CartF0.cxx +++ b/src/emucore/CartF0.cxx @@ -131,13 +131,13 @@ void CartridgeF0::bank(uInt16 bank) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeF0::bank() +uInt16 CartridgeF0::bank() const { return myCurrentBank; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeF0::bankCount() +uInt16 CartridgeF0::bankCount() const { return 16; } @@ -150,7 +150,7 @@ bool CartridgeF0::patch(uInt16 address, uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt8* CartridgeF0::getImage(int& size) +const uInt8* CartridgeF0::getImage(int& size) const { size = 65536; return myImage; diff --git a/src/emucore/CartF0.hxx b/src/emucore/CartF0.hxx index 059fa9634..91cc60ccf 100644 --- a/src/emucore/CartF0.hxx +++ b/src/emucore/CartF0.hxx @@ -71,12 +71,12 @@ class CartridgeF0 : public Cartridge /** Get the current bank. */ - int bank(); + uInt16 bank() const; /** Query the number of banks supported by the cartridge. */ - int bankCount(); + uInt16 bankCount() const; /** Patch the cartridge ROM. @@ -93,7 +93,7 @@ class CartridgeF0 : public Cartridge @param size Set to the size of the internal ROM image data @return A pointer to the internal ROM image data */ - uInt8* getImage(int& size); + const uInt8* getImage(int& size) const; /** Save the current state of this cart to the given Serializer. diff --git a/src/emucore/CartF4.cxx b/src/emucore/CartF4.cxx index c837b80de..fae73be51 100644 --- a/src/emucore/CartF4.cxx +++ b/src/emucore/CartF4.cxx @@ -124,13 +124,13 @@ void CartridgeF4::bank(uInt16 bank) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeF4::bank() +uInt16 CartridgeF4::bank() const { return myCurrentBank; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeF4::bankCount() +uInt16 CartridgeF4::bankCount() const { return 8; } @@ -143,7 +143,7 @@ bool CartridgeF4::patch(uInt16 address, uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt8* CartridgeF4::getImage(int& size) +const uInt8* CartridgeF4::getImage(int& size) const { size = 32768; return myImage; diff --git a/src/emucore/CartF4.hxx b/src/emucore/CartF4.hxx index 4bcf7fdea..8b6c44717 100644 --- a/src/emucore/CartF4.hxx +++ b/src/emucore/CartF4.hxx @@ -70,12 +70,12 @@ class CartridgeF4 : public Cartridge /** Get the current bank. */ - int bank(); + uInt16 bank() const; /** Query the number of banks supported by the cartridge. */ - int bankCount(); + uInt16 bankCount() const; /** Patch the cartridge ROM. @@ -92,7 +92,7 @@ class CartridgeF4 : public Cartridge @param size Set to the size of the internal ROM image data @return A pointer to the internal ROM image data */ - uInt8* getImage(int& size); + const uInt8* getImage(int& size) const; /** Save the current state of this cart to the given Serializer. diff --git a/src/emucore/CartF4SC.cxx b/src/emucore/CartF4SC.cxx index 789c79e60..bf7f2e1f3 100644 --- a/src/emucore/CartF4SC.cxx +++ b/src/emucore/CartF4SC.cxx @@ -165,13 +165,13 @@ void CartridgeF4SC::bank(uInt16 bank) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeF4SC::bank() +uInt16 CartridgeF4SC::bank() const { return myCurrentBank; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeF4SC::bankCount() +uInt16 CartridgeF4SC::bankCount() const { return 8; } @@ -195,7 +195,7 @@ bool CartridgeF4SC::patch(uInt16 address, uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt8* CartridgeF4SC::getImage(int& size) +const uInt8* CartridgeF4SC::getImage(int& size) const { size = 32768; return myImage; diff --git a/src/emucore/CartF4SC.hxx b/src/emucore/CartF4SC.hxx index 4658f43a5..4a8fe7aec 100644 --- a/src/emucore/CartF4SC.hxx +++ b/src/emucore/CartF4SC.hxx @@ -70,12 +70,12 @@ class CartridgeF4SC : public Cartridge /** Get the current bank. */ - int bank(); + uInt16 bank() const; /** Query the number of banks supported by the cartridge. */ - int bankCount(); + uInt16 bankCount() const; /** Patch the cartridge ROM. @@ -92,7 +92,7 @@ class CartridgeF4SC : public Cartridge @param size Set to the size of the internal ROM image data @return A pointer to the internal ROM image data */ - uInt8* getImage(int& size); + const uInt8* getImage(int& size) const; /** Save the current state of this cart to the given Serializer. diff --git a/src/emucore/CartF6.cxx b/src/emucore/CartF6.cxx index 6e708c8e1..210f1733c 100644 --- a/src/emucore/CartF6.cxx +++ b/src/emucore/CartF6.cxx @@ -164,13 +164,13 @@ void CartridgeF6::bank(uInt16 bank) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeF6::bank() +uInt16 CartridgeF6::bank() const { return myCurrentBank; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeF6::bankCount() +uInt16 CartridgeF6::bankCount() const { return 4; } @@ -183,7 +183,7 @@ bool CartridgeF6::patch(uInt16 address, uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt8* CartridgeF6::getImage(int& size) +const uInt8* CartridgeF6::getImage(int& size) const { size = 16384; return myImage; diff --git a/src/emucore/CartF6.hxx b/src/emucore/CartF6.hxx index 149ef03ac..b99b1e173 100644 --- a/src/emucore/CartF6.hxx +++ b/src/emucore/CartF6.hxx @@ -70,12 +70,12 @@ class CartridgeF6 : public Cartridge /** Get the current bank. */ - int bank(); + uInt16 bank() const; /** Query the number of banks supported by the cartridge. */ - int bankCount(); + uInt16 bankCount() const; /** Patch the cartridge ROM. @@ -92,7 +92,7 @@ class CartridgeF6 : public Cartridge @param size Set to the size of the internal ROM image data @return A pointer to the internal ROM image data */ - uInt8* getImage(int& size); + const uInt8* getImage(int& size) const; /** Save the current state of this cart to the given Serializer. diff --git a/src/emucore/CartF6SC.cxx b/src/emucore/CartF6SC.cxx index 6c1792667..877994360 100644 --- a/src/emucore/CartF6SC.cxx +++ b/src/emucore/CartF6SC.cxx @@ -208,13 +208,13 @@ void CartridgeF6SC::bank(uInt16 bank) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeF6SC::bank() +uInt16 CartridgeF6SC::bank() const { return myCurrentBank; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeF6SC::bankCount() +uInt16 CartridgeF6SC::bankCount() const { return 4; } @@ -238,7 +238,7 @@ bool CartridgeF6SC::patch(uInt16 address, uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt8* CartridgeF6SC::getImage(int& size) +const uInt8* CartridgeF6SC::getImage(int& size) const { size = 16384; return myImage; diff --git a/src/emucore/CartF6SC.hxx b/src/emucore/CartF6SC.hxx index dab3b0514..88e7cba66 100644 --- a/src/emucore/CartF6SC.hxx +++ b/src/emucore/CartF6SC.hxx @@ -70,12 +70,12 @@ class CartridgeF6SC : public Cartridge /** Get the current bank. */ - int bank(); + uInt16 bank() const; /** Query the number of banks supported by the cartridge. */ - int bankCount(); + uInt16 bankCount() const; /** Patch the cartridge ROM. @@ -92,7 +92,7 @@ class CartridgeF6SC : public Cartridge @param size Set to the size of the internal ROM image data @return A pointer to the internal ROM image data */ - uInt8* getImage(int& size); + const uInt8* getImage(int& size) const; /** Save the current state of this cart to the given Serializer. diff --git a/src/emucore/CartF8.cxx b/src/emucore/CartF8.cxx index 76a91b522..5c00b1b10 100644 --- a/src/emucore/CartF8.cxx +++ b/src/emucore/CartF8.cxx @@ -145,13 +145,13 @@ void CartridgeF8::bank(uInt16 bank) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeF8::bank() +uInt16 CartridgeF8::bank() const { return myCurrentBank; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeF8::bankCount() +uInt16 CartridgeF8::bankCount() const { return 2; } @@ -164,7 +164,7 @@ bool CartridgeF8::patch(uInt16 address, uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt8* CartridgeF8::getImage(int& size) +const uInt8* CartridgeF8::getImage(int& size) const { size = 8192; return myImage; diff --git a/src/emucore/CartF8.hxx b/src/emucore/CartF8.hxx index 7e33fce9a..e1920fc1e 100644 --- a/src/emucore/CartF8.hxx +++ b/src/emucore/CartF8.hxx @@ -71,12 +71,12 @@ class CartridgeF8 : public Cartridge /** Get the current bank. */ - int bank(); + uInt16 bank() const; /** Query the number of banks supported by the cartridge. */ - int bankCount(); + uInt16 bankCount() const; /** Patch the cartridge ROM. @@ -93,7 +93,7 @@ class CartridgeF8 : public Cartridge @param size Set to the size of the internal ROM image data @return A pointer to the internal ROM image data */ - uInt8* getImage(int& size); + const uInt8* getImage(int& size) const; /** Save the current state of this cart to the given Serializer. diff --git a/src/emucore/CartF8SC.cxx b/src/emucore/CartF8SC.cxx index d10315c88..54dc025b1 100644 --- a/src/emucore/CartF8SC.cxx +++ b/src/emucore/CartF8SC.cxx @@ -188,13 +188,13 @@ void CartridgeF8SC::bank(uInt16 bank) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeF8SC::bank() +uInt16 CartridgeF8SC::bank() const { return myCurrentBank; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeF8SC::bankCount() +uInt16 CartridgeF8SC::bankCount() const { return 2; } @@ -218,7 +218,7 @@ bool CartridgeF8SC::patch(uInt16 address, uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt8* CartridgeF8SC::getImage(int& size) +const uInt8* CartridgeF8SC::getImage(int& size) const { size = 8192; return myImage; diff --git a/src/emucore/CartF8SC.hxx b/src/emucore/CartF8SC.hxx index 45cf40b9e..7b645ada7 100644 --- a/src/emucore/CartF8SC.hxx +++ b/src/emucore/CartF8SC.hxx @@ -70,12 +70,12 @@ class CartridgeF8SC : public Cartridge /** Get the current bank. */ - int bank(); + uInt16 bank() const; /** Query the number of banks supported by the cartridge. */ - int bankCount(); + uInt16 bankCount() const; /** Patch the cartridge ROM. @@ -92,7 +92,7 @@ class CartridgeF8SC : public Cartridge @param size Set to the size of the internal ROM image data @return A pointer to the internal ROM image data */ - uInt8* getImage(int& size); + const uInt8* getImage(int& size) const; /** Save the current state of this cart to the given Serializer. diff --git a/src/emucore/CartFA.cxx b/src/emucore/CartFA.cxx index 29750ad0d..8161b071d 100644 --- a/src/emucore/CartFA.cxx +++ b/src/emucore/CartFA.cxx @@ -198,13 +198,13 @@ void CartridgeFA::bank(uInt16 bank) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeFA::bank() +uInt16 CartridgeFA::bank() const { return myCurrentBank; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeFA::bankCount() +uInt16 CartridgeFA::bankCount() const { return 3; } @@ -228,7 +228,7 @@ bool CartridgeFA::patch(uInt16 address, uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt8* CartridgeFA::getImage(int& size) +const uInt8* CartridgeFA::getImage(int& size) const { size = 12288; return myImage; diff --git a/src/emucore/CartFA.hxx b/src/emucore/CartFA.hxx index b5c5c3c44..8b9791201 100644 --- a/src/emucore/CartFA.hxx +++ b/src/emucore/CartFA.hxx @@ -70,12 +70,12 @@ class CartridgeFA : public Cartridge /** Get the current bank. */ - int bank(); + uInt16 bank() const; /** Query the number of banks supported by the cartridge. */ - int bankCount(); + uInt16 bankCount() const; /** Patch the cartridge ROM. @@ -92,7 +92,7 @@ class CartridgeFA : public Cartridge @param size Set to the size of the internal ROM image data @return A pointer to the internal ROM image data */ - uInt8* getImage(int& size); + const uInt8* getImage(int& size) const; /** Save the current state of this cart to the given Serializer. diff --git a/src/emucore/CartFE.cxx b/src/emucore/CartFE.cxx index 3d21cb9b9..bbc104c8b 100644 --- a/src/emucore/CartFE.cxx +++ b/src/emucore/CartFE.cxx @@ -87,14 +87,14 @@ void CartridgeFE::bank(uInt16 b) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeFE::bank() +uInt16 CartridgeFE::bank() const { // The current bank depends on the last address accessed return ((myLastAddress1 & 0x2000) == 0) ? 1 : 0; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeFE::bankCount() +uInt16 CartridgeFE::bankCount() const { return 2; } @@ -128,7 +128,7 @@ bool CartridgeFE::patch(uInt16 address, uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt8* CartridgeFE::getImage(int& size) +const uInt8* CartridgeFE::getImage(int& size) const { size = 8192; return myImage; diff --git a/src/emucore/CartFE.hxx b/src/emucore/CartFE.hxx index f56df0b54..7e1bd0205 100644 --- a/src/emucore/CartFE.hxx +++ b/src/emucore/CartFE.hxx @@ -85,12 +85,12 @@ class CartridgeFE : public Cartridge /** Get the current bank. */ - int bank(); + uInt16 bank() const; /** Query the number of banks supported by the cartridge. */ - int bankCount(); + uInt16 bankCount() const; /** Answer whether the bank has changed since the last time this @@ -115,7 +115,7 @@ class CartridgeFE : public Cartridge @param size Set to the size of the internal ROM image data @return A pointer to the internal ROM image data */ - uInt8* getImage(int& size); + const uInt8* getImage(int& size) const; /** Save the current state of this cart to the given Serializer. diff --git a/src/emucore/CartMC.cxx b/src/emucore/CartMC.cxx index fcca1fcc1..06ba84e86 100644 --- a/src/emucore/CartMC.cxx +++ b/src/emucore/CartMC.cxx @@ -210,14 +210,14 @@ void CartridgeMC::bank(uInt16 b) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeMC::bank() +uInt16 CartridgeMC::bank() const { // TODO - add support for debugger return 0; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeMC::bankCount() +uInt16 CartridgeMC::bankCount() const { // TODO - add support for debugger return 1; @@ -231,7 +231,7 @@ bool CartridgeMC::patch(uInt16 address, uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt8* CartridgeMC::getImage(int& size) +const uInt8* CartridgeMC::getImage(int& size) const { size = 128 * 1024; // FIXME: keep track of original size return myImage; diff --git a/src/emucore/CartMC.hxx b/src/emucore/CartMC.hxx index eb0536a7e..9213cf468 100644 --- a/src/emucore/CartMC.hxx +++ b/src/emucore/CartMC.hxx @@ -177,12 +177,12 @@ class CartridgeMC : public Cartridge /** Get the current bank. */ - int bank(); + uInt16 bank() const; /** Query the number of banks supported by the cartridge. */ - int bankCount(); + uInt16 bankCount() const; /** Patch the cartridge ROM. @@ -199,7 +199,7 @@ class CartridgeMC : public Cartridge @param size Set to the size of the internal ROM image data @return A pointer to the internal ROM image data */ - uInt8* getImage(int& size); + const uInt8* getImage(int& size) const; /** Save the current state of this cart to the given Serializer. diff --git a/src/emucore/CartSB.cxx b/src/emucore/CartSB.cxx index 7ab9de97e..30f3dadba 100644 --- a/src/emucore/CartSB.cxx +++ b/src/emucore/CartSB.cxx @@ -148,13 +148,13 @@ void CartridgeSB::bank(uInt16 bank) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeSB::bank() +uInt16 CartridgeSB::bank() const { return myCurrentBank; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeSB::bankCount() +uInt16 CartridgeSB::bankCount() const { return mySize >> 12; } @@ -167,7 +167,7 @@ bool CartridgeSB::patch(uInt16 address, uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt8* CartridgeSB::getImage(int& size) +const uInt8* CartridgeSB::getImage(int& size) const { size = mySize; return myImage; diff --git a/src/emucore/CartSB.hxx b/src/emucore/CartSB.hxx index 07c32d99f..9feeebfec 100644 --- a/src/emucore/CartSB.hxx +++ b/src/emucore/CartSB.hxx @@ -68,12 +68,12 @@ class CartridgeSB : public Cartridge /** Get the current bank. */ - int bank(); + uInt16 bank() const; /** Query the number of banks supported by the cartridge. */ - int bankCount(); + uInt16 bankCount() const; /** Patch the cartridge ROM. @@ -90,7 +90,7 @@ class CartridgeSB : public Cartridge @param size Set to the size of the internal ROM image data @return A pointer to the internal ROM image data */ - uInt8* getImage(int& size); + const uInt8* getImage(int& size) const; /** Save the current state of this cart to the given Serializer. diff --git a/src/emucore/CartUA.cxx b/src/emucore/CartUA.cxx index 8f0d6dfd0..223986e9a 100644 --- a/src/emucore/CartUA.cxx +++ b/src/emucore/CartUA.cxx @@ -156,13 +156,13 @@ void CartridgeUA::bank(uInt16 bank) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeUA::bank() +uInt16 CartridgeUA::bank() const { return myCurrentBank; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeUA::bankCount() +uInt16 CartridgeUA::bankCount() const { return 2; } @@ -175,7 +175,7 @@ bool CartridgeUA::patch(uInt16 address, uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt8* CartridgeUA::getImage(int& size) +const uInt8* CartridgeUA::getImage(int& size) const { size = 8192; return myImage; diff --git a/src/emucore/CartUA.hxx b/src/emucore/CartUA.hxx index 52542ccff..25de777e6 100644 --- a/src/emucore/CartUA.hxx +++ b/src/emucore/CartUA.hxx @@ -71,12 +71,12 @@ class CartridgeUA : public Cartridge /** Get the current bank. */ - int bank(); + uInt16 bank() const; /** Query the number of banks supported by the cartridge. */ - int bankCount(); + uInt16 bankCount() const; /** Patch the cartridge ROM. @@ -93,7 +93,7 @@ class CartridgeUA : public Cartridge @param size Set to the size of the internal ROM image data @return A pointer to the internal ROM image data */ - uInt8* getImage(int& size); + const uInt8* getImage(int& size) const; /** Save the current state of this cart to the given Serializer. diff --git a/src/emucore/CartX07.cxx b/src/emucore/CartX07.cxx index 483776220..75a70e615 100644 --- a/src/emucore/CartX07.cxx +++ b/src/emucore/CartX07.cxx @@ -142,13 +142,13 @@ void CartridgeX07::bank(uInt16 bank) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeX07::bank() +uInt16 CartridgeX07::bank() const { return myCurrentBank; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartridgeX07::bankCount() +uInt16 CartridgeX07::bankCount() const { return 16; } @@ -161,7 +161,7 @@ bool CartridgeX07::patch(uInt16 address, uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt8* CartridgeX07::getImage(int& size) +const uInt8* CartridgeX07::getImage(int& size) const { size = 65536; return myImage; diff --git a/src/emucore/CartX07.hxx b/src/emucore/CartX07.hxx index cbb5e30c0..db48373d8 100644 --- a/src/emucore/CartX07.hxx +++ b/src/emucore/CartX07.hxx @@ -80,12 +80,12 @@ class CartridgeX07 : public Cartridge /** Get the current bank. */ - int bank(); + uInt16 bank() const; /** Query the number of banks supported by the cartridge. */ - int bankCount(); + uInt16 bankCount() const; /** Patch the cartridge ROM. @@ -102,7 +102,7 @@ class CartridgeX07 : public Cartridge @param size Set to the size of the internal ROM image data @return A pointer to the internal ROM image data */ - uInt8* getImage(int& size); + const uInt8* getImage(int& size) const; /** Save the current state of this cart to the given Serializer.