diff --git a/src/emucore/CartFC.cxx b/src/emucore/CartFC.cxx index b2053ce8c..fdf2392f8 100644 --- a/src/emucore/CartFC.cxx +++ b/src/emucore/CartFC.cxx @@ -22,10 +22,10 @@ CartridgeFC::CartridgeFC(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) : Cartridge(settings, md5), - myBankOffset(0), - myCurrentBank(0), - mySize(size), - myTargetBank(0) + mySize(size), + myBankOffset(0), + myCurrentBank(0), + myTargetBank(0) { // Copy the ROM image into my buffer std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin()); diff --git a/src/emucore/CartFC.hxx b/src/emucore/CartFC.hxx index 6869d7915..db9cb58e2 100644 --- a/src/emucore/CartFC.hxx +++ b/src/emucore/CartFC.hxx @@ -22,8 +22,9 @@ class System; #include "bspf.hxx" #include "Cart.hxx" + #ifdef DEBUGGER_SUPPORT -#include "CartFCWidget.hxx" + #include "CartFCWidget.hxx" #endif /** @@ -38,147 +39,144 @@ class CartridgeFC : public Cartridge { friend class CartridgeFCWidget; -public: - /** - Create a new cartridge using the specified image + public: + /** + Create a new cartridge using the specified image - @param image Pointer to 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) - */ - CartridgeFC(const ByteBuffer& image, size_t size, const string& md5, - const Settings& settings); - virtual ~CartridgeFC() = default; + @param image Pointer to 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) + */ + CartridgeFC(const ByteBuffer& image, size_t size, const string& md5, + const Settings& settings); + virtual ~CartridgeFC() = default; -public: - /** - Reset device to its power-on state - */ - void reset() override; + public: + /** + Reset device to its power-on state + */ + void reset() override; - /** - Install cartridge in the specified system. Invoked by the system - when the cartridge is attached to it. + /** + Install cartridge in the specified system. Invoked by the system + when the cartridge is attached to it. - @param system The system the device should install itself in - */ - void install(System& system) override; + @param system The system the device should install itself in + */ + void install(System& system) override; - /** - Install pages for the specified bank in the system. + /** + Install pages for the specified bank in the system. - @param bank The bank that should be installed in the system - */ - bool bank(uInt16 bank) override; + @param bank The bank that should be installed in the system + */ + bool bank(uInt16 bank) override; - /** - Get the current bank. + /** + Get the current bank. - @param address The address to use when querying the bank - */ - uInt16 getBank(uInt16 address = 0) const override; + @param address The address to use when querying the bank + */ + uInt16 getBank(uInt16 address = 0) const override; - /** - Query the number of banks supported by the cartridge. - */ - uInt16 bankCount() const override; + /** + Query the number of banks supported by the cartridge. + */ + uInt16 bankCount() const override; - /** - Patch the cartridge ROM. + /** + Patch the cartridge ROM. - @param address The ROM address to patch - @param value The value to place into the address - @return Success or failure of the patch operation - */ - bool patch(uInt16 address, uInt8 value) override; + @param address The ROM address to patch + @param value The value to place into the address + @return Success or failure of the patch operation + */ + bool patch(uInt16 address, uInt8 value) override; - /** - Access the internal ROM image for this cartridge. + /** + Access the internal ROM image for this cartridge. - @param size Set to the size of the internal ROM image data - @return A pointer to the internal ROM image data - */ - const uInt8* getImage(size_t& size) const override; + @param size Set to the size of the internal ROM image data + @return A pointer to the internal ROM image data + */ + const uInt8* getImage(size_t& size) const override; - /** - Save the current state of this cart to the given Serializer. + /** + Save the current state of this cart to the given Serializer. - @param out The Serializer object to use - @return False on any errors, else true - */ - bool save(Serializer& out) const override; + @param out The Serializer object to use + @return False on any errors, else true + */ + bool save(Serializer& out) const override; - /** - Load the current state of this cart from the given Serializer. + /** + Load the current state of this cart from the given Serializer. - @param in The Serializer object to use - @return False on any errors, else true - */ - bool load(Serializer& in) override; + @param in The Serializer object to use + @return False on any errors, else true + */ + bool load(Serializer& in) override; - /** - Get a descriptor for the device name (used in error checking). + /** + Get a descriptor for the device name (used in error checking). - @return The name of the object - */ - string name() const override { return "CartridgeFC"; } + @return The name of the object + */ + string name() const override { return "CartridgeFC"; } -#ifdef DEBUGGER_SUPPORT - /** - Get debugger widget responsible for accessing the inner workings - of the cart. - */ - CartDebugWidget* debugWidget(GuiObject* boss, const GUI::Font& lfont, - const GUI::Font& nfont, int x, int y, int w, int h) override - { - return new CartridgeFCWidget(boss, lfont, nfont, x, y, w, h, *this); - } -#endif + #ifdef DEBUGGER_SUPPORT + /** + Get debugger widget responsible for accessing the inner workings + of the cart. + */ + CartDebugWidget* debugWidget(GuiObject* boss, const GUI::Font& lfont, + const GUI::Font& nfont, int x, int y, int w, int h) override + { + return new CartridgeFCWidget(boss, lfont, nfont, x, y, w, h, *this); + } + #endif -public: - /** - Get the byte at the specified address. + public: + /** + Get the byte at the specified address. - @return The byte at the specified address - */ - uInt8 peek(uInt16 address) override; + @return The byte at the specified address + */ + uInt8 peek(uInt16 address) override; - /** - Change the byte at the specified address to the given value + /** + Change the byte at the specified address to the given value - @param address The address where the value should be stored - @param value The value to be stored at the address - @return True if the poke changed the device address space, else false - */ - bool poke(uInt16 address, uInt8 value) override; + @param address The address where the value should be stored + @param value The value to be stored at the address + @return True if the poke changed the device address space, else false + */ + bool poke(uInt16 address, uInt8 value) override; -private: - // The 32K ROM image of the cartridge - std::array myImage; + private: + // The 32K ROM image of the cartridge + std::array myImage; - // Size of the ROM image - size_t mySize; + // Size of the ROM image + size_t mySize; + // Indicates the offset into the ROM image (aligns to current bank) + uInt16 myBankOffset; - // Indicates the offset into the ROM image (aligns to current bank) - uInt16 myBankOffset; + // Indicates which bank is currently active for the first segment + uInt16 myCurrentBank; - // Indicates which bank is currently active for the first segment - uInt16 myCurrentBank; + // Target bank defined by writing to $1FF8/9 + uInt16 myTargetBank; - - // Target bank defined by writing to $1FF8/9 - uInt16 myTargetBank; - -private: - // Following constructors and assignment operators not supported - CartridgeFC() = delete; - CartridgeFC(const CartridgeFC&) = delete; - CartridgeFC(CartridgeFC&&) = delete; - CartridgeFC& operator=(const CartridgeFC&) = delete; - CartridgeFC& operator=(CartridgeFC&&) = delete; + private: + // Following constructors and assignment operators not supported + CartridgeFC() = delete; + CartridgeFC(const CartridgeFC&) = delete; + CartridgeFC(CartridgeFC&&) = delete; + CartridgeFC& operator=(const CartridgeFC&) = delete; + CartridgeFC& operator=(CartridgeFC&&) = delete; }; #endif - diff --git a/src/windows/Stella.vcxproj b/src/windows/Stella.vcxproj index c62deae7e..2c506b04d 100644 --- a/src/windows/Stella.vcxproj +++ b/src/windows/Stella.vcxproj @@ -436,6 +436,7 @@ + @@ -471,6 +472,7 @@ + @@ -1142,6 +1144,7 @@ + @@ -1183,6 +1186,7 @@ +