Fix issues with VS project, minor warning from clang, and autoformat

code.
This commit is contained in:
Stephen Anthony 2019-11-02 11:03:15 -02:30
parent c198edbe51
commit e0f7051e5c
3 changed files with 118 additions and 116 deletions

View File

@ -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());

View File

@ -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<uInt8, 32_KB> myImage;
private:
// The 32K ROM image of the cartridge
std::array<uInt8, 32_KB> 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

View File

@ -436,6 +436,7 @@
<ClCompile Include="..\debugger\gui\CartF8Widget.cxx" />
<ClCompile Include="..\debugger\gui\CartFA2Widget.cxx" />
<ClCompile Include="..\debugger\gui\CartFAWidget.cxx" />
<ClCompile Include="..\debugger\gui\CartFCWidget.cxx" />
<ClCompile Include="..\debugger\gui\CartFEWidget.cxx" />
<ClCompile Include="..\debugger\gui\CartMDMWidget.cxx" />
<ClCompile Include="..\debugger\gui\CartMNetworkWidget.cxx" />
@ -471,6 +472,7 @@
<ClCompile Include="..\emucore\CartDF.cxx" />
<ClCompile Include="..\emucore\CartDFSC.cxx" />
<ClCompile Include="..\emucore\CartFA2.cxx" />
<ClCompile Include="..\emucore\CartFC.cxx" />
<ClCompile Include="..\emucore\CartMDM.cxx" />
<ClCompile Include="..\emucore\CartMNetwork.cxx" />
<ClCompile Include="..\emucore\CartE78K.cxx" />
@ -1142,6 +1144,7 @@
<ClInclude Include="..\debugger\gui\CartF8Widget.hxx" />
<ClInclude Include="..\debugger\gui\CartFA2Widget.hxx" />
<ClInclude Include="..\debugger\gui\CartFAWidget.hxx" />
<ClInclude Include="..\debugger\gui\CartFCWidget.hxx" />
<ClInclude Include="..\debugger\gui\CartFEWidget.hxx" />
<ClInclude Include="..\debugger\gui\CartMDMWidget.hxx" />
<ClInclude Include="..\debugger\gui\CartMNetworkWidget.hxx" />
@ -1183,6 +1186,7 @@
<ClInclude Include="..\emucore\CartDF.hxx" />
<ClInclude Include="..\emucore\CartDFSC.hxx" />
<ClInclude Include="..\emucore\CartFA2.hxx" />
<ClInclude Include="..\emucore\CartFC.hxx" />
<ClInclude Include="..\emucore\CartMDM.hxx" />
<ClInclude Include="..\emucore\CartMNetwork.hxx" />
<ClInclude Include="..\emucore\CartE78K.hxx" />