Some bugs indicated by running Stella through Coverity. Note that many

of these aren't actually bugs per-se, but are to follow good programming
practices.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3234 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2015-12-05 01:30:17 +00:00
parent 47911eff21
commit 9e23bc3580
77 changed files with 240 additions and 176 deletions

View File

@ -105,7 +105,9 @@ FilesystemNodeZIP::FilesystemNodeZIP(const string& p)
FilesystemNodeZIP::FilesystemNodeZIP( FilesystemNodeZIP::FilesystemNodeZIP(
const string& zipfile, const string& virtualpath, const string& zipfile, const string& virtualpath,
shared_ptr<AbstractFSNode> realnode, bool isdir) shared_ptr<AbstractFSNode> realnode, bool isdir)
: _isDirectory(isdir), : _error(ZIPERR_NONE),
_numFiles(0),
_isDirectory(isdir),
_isFile(!isdir) _isFile(!isdir)
{ {
setFlags(zipfile, virtualpath, realnode); setFlags(zipfile, virtualpath, realnode);

View File

@ -175,9 +175,6 @@ class FrameBufferSDL2 : public FrameBuffer
// Used by mapRGB (when palettes are created) // Used by mapRGB (when palettes are created)
SDL_PixelFormat* myPixelFormat; SDL_PixelFormat* myPixelFormat;
// The depth of the render buffer
uInt32 myDepth;
// Indicates that the renderer has been modified, and should be redrawn // Indicates that the renderer has been modified, and should be redrawn
bool myDirtyFlag; bool myDirtyFlag;

View File

@ -41,6 +41,8 @@ SoundSDL2::SoundSDL2(OSystem& osystem)
myLastRegisterSetCycle(0), myLastRegisterSetCycle(0),
myNumChannels(0), myNumChannels(0),
myFragmentSizeLogBase2(0), myFragmentSizeLogBase2(0),
myFragmentSizeLogDiv1(0),
myFragmentSizeLogDiv2(0),
myIsMuted(true), myIsMuted(true),
myVolume(100) myVolume(100)
{ {

View File

@ -33,6 +33,10 @@ namespace Common {
template <class T, int MAX_SIZE = 50> template <class T, int MAX_SIZE = 50>
class FixedStack class FixedStack
{ {
protected:
T _stack[MAX_SIZE];
int _size;
public: public:
FixedStack<T, MAX_SIZE>() : _size(0) { } FixedStack<T, MAX_SIZE>() : _size(0) { }
@ -63,10 +67,6 @@ class FixedStack
return _stack[i]; return _stack[i];
} }
protected:
T _stack[MAX_SIZE];
int _size;
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported
FixedStack(const FixedStack&) = delete; FixedStack(const FixedStack&) = delete;

View File

@ -107,10 +107,10 @@ DiStella::DiStella(const CartDebug& dbg, CartDebug::DisassemblyList& list,
while(!myAddressQueue.empty()) while(!myAddressQueue.empty())
{ {
myPC = myAddressQueue.front(); myPC = myAddressQueue.front();
myPCBeg = myPC; uInt16 pcBeg = myPC;
myAddressQueue.pop(); myAddressQueue.pop();
disasm(myPC, 1); disasm(myPC, 1);
if(myPCBeg <= myPCEnd) if(pcBeg <= myPCEnd)
{ {
// Tentatively mark all addresses in the range as CODE // Tentatively mark all addresses in the range as CODE
// Note that this is a 'best-effort' approach, since // Note that this is a 'best-effort' approach, since
@ -119,7 +119,7 @@ DiStella::DiStella(const CartDebug& dbg, CartDebug::DisassemblyList& list,
// However, addresses *specifically* marked as DATA/GFX/PGFX // However, addresses *specifically* marked as DATA/GFX/PGFX
// in the emulation core indicate that the CODE range has finished // in the emulation core indicate that the CODE range has finished
// Therefore, we stop at the first such address encountered // Therefore, we stop at the first such address encountered
for (uInt32 k = myPCBeg; k <= myPCEnd; k++) for (uInt32 k = pcBeg; k <= myPCEnd; k++)
{ {
if(Debugger::debugger().getAccessFlags(k) & if(Debugger::debugger().getAccessFlags(k) &
(CartDebug::DATA|CartDebug::GFX|CartDebug::PGFX)) (CartDebug::DATA|CartDebug::GFX|CartDebug::PGFX))

View File

@ -118,7 +118,7 @@ class DiStella
CartDebug::ReservedEquates& myReserved; CartDebug::ReservedEquates& myReserved;
stringstream myDisasmBuf; stringstream myDisasmBuf;
queue<uInt16> myAddressQueue; queue<uInt16> myAddressQueue;
uInt16 myOffset, myPC, myPCBeg, myPCEnd; uInt16 myOffset, myPC, myPCEnd;
struct resource { struct resource {
uInt16 start; uInt16 start;

View File

@ -37,7 +37,10 @@ RomListWidget::RomListWidget(GuiObject* boss, const GUI::Font& lfont,
_selectedItem(-1), _selectedItem(-1),
_highlightedItem(-1), _highlightedItem(-1),
_editMode(false), _editMode(false),
_currentKeyDown(KBDK_UNKNOWN) _currentKeyDown(KBDK_UNKNOWN),
_base(Common::Base::F_DEFAULT),
myDisasm(nullptr),
myBPState(nullptr)
{ {
_flags = WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS; _flags = WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS;
_bgcolor = kWidColor; _bgcolor = kWidColor;

View File

@ -28,7 +28,8 @@ Cartridge3E::Cartridge3E(const uInt8* image, uInt32 size,
const Settings& settings) const Settings& settings)
: Cartridge(settings), : Cartridge(settings),
myImage(nullptr), myImage(nullptr),
mySize(size) mySize(size),
myCurrentBank(0)
{ {
// Allocate array for the ROM image // Allocate array for the ROM image
myImage = new uInt8[mySize]; myImage = new uInt8[mySize];

View File

@ -184,9 +184,6 @@ class Cartridge3E : public Cartridge
bool poke(uInt16 address, uInt8 value) override; bool poke(uInt16 address, uInt8 value) override;
private: private:
// Indicates which bank is currently active for the first segment
uInt16 myCurrentBank;
// Pointer to a dynamically allocated ROM image of the cartridge // Pointer to a dynamically allocated ROM image of the cartridge
uInt8* myImage; uInt8* myImage;
@ -196,6 +193,9 @@ class Cartridge3E : public Cartridge
// Size of the ROM image // Size of the ROM image
uInt32 mySize; uInt32 mySize;
// Indicates which bank is currently active for the first segment
uInt16 myCurrentBank;
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported
Cartridge3E() = delete; Cartridge3E() = delete;

View File

@ -28,7 +28,8 @@ Cartridge3F::Cartridge3F(const uInt8* image, uInt32 size,
const Settings& settings) const Settings& settings)
: Cartridge(settings), : Cartridge(settings),
myImage(nullptr), myImage(nullptr),
mySize(size) mySize(size),
myCurrentBank(0)
{ {
// Allocate array for the ROM image // Allocate array for the ROM image
myImage = new uInt8[mySize]; myImage = new uInt8[mySize];

View File

@ -161,15 +161,15 @@ class Cartridge3F : public Cartridge
bool poke(uInt16 address, uInt8 value) override; bool poke(uInt16 address, uInt8 value) override;
private: private:
// Indicates which bank is currently active for the first segment
uInt16 myCurrentBank;
// Pointer to a dynamically allocated ROM image of the cartridge // Pointer to a dynamically allocated ROM image of the cartridge
uInt8* myImage; uInt8* myImage;
// Size of the ROM image // Size of the ROM image
uInt32 mySize; uInt32 mySize;
// Indicates which bank is currently active for the first segment
uInt16 myCurrentBank;
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported
Cartridge3F() = delete; Cartridge3F() = delete;

View File

@ -28,7 +28,13 @@
Cartridge4A50::Cartridge4A50(const uInt8* image, uInt32 size, Cartridge4A50::Cartridge4A50(const uInt8* image, uInt32 size,
const Settings& settings) const Settings& settings)
: Cartridge(settings), : Cartridge(settings),
mySize(size) mySize(size),
mySliceLow(0),
mySliceMiddle(0),
mySliceHigh(0),
myIsRomLow(true),
myIsRomMiddle(true),
myIsRomHigh(true)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
// Supported file sizes are 32/64/128K, which are duplicated if necessary // Supported file sizes are 32/64/128K, which are duplicated if necessary

View File

@ -146,7 +146,6 @@ bool Cartridge4KSC::save(Serializer& out) const
try try
{ {
out.putString(name()); out.putString(name());
out.putShort(myCurrentBank);
out.putByteArray(myRAM, 128); out.putByteArray(myRAM, 128);
} }
catch(...) catch(...)
@ -166,7 +165,6 @@ bool Cartridge4KSC::load(Serializer& in)
if(in.getString() != name()) if(in.getString() != name())
return false; return false;
myCurrentBank = in.getShort();
in.getByteArray(myRAM, 128); in.getByteArray(myRAM, 128);
} }
catch(...) catch(...)
@ -175,8 +173,5 @@ bool Cartridge4KSC::load(Serializer& in)
return false; return false;
} }
// Remember what bank we were in
bank(myCurrentBank);
return true; return true;
} }

View File

@ -29,8 +29,7 @@ class System;
#endif #endif
/** /**
Cartridge class used for 4KSC games with Cartridge class used for 4K games with 128 bytes of RAM.
128 bytes of RAM. There are two 4K banks.
*/ */
class Cartridge4KSC : public Cartridge class Cartridge4KSC : public Cartridge
@ -130,15 +129,12 @@ class Cartridge4KSC : public Cartridge
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 address The address where the value should be stored
@param value The value to be stored at the address @param value The value to be stored at the address
@return True if the poke changed the device address space, else false @return True if the poke changed the device address space, else false
*/ */
bool poke(uInt16 address, uInt8 value) override; bool poke(uInt16 address, uInt8 value) override;
private: private:
// Indicates which bank is currently active
uInt16 myCurrentBank;
// The 8K ROM image of the cartridge // The 8K ROM image of the cartridge
uInt8 myImage[4096]; uInt8 myImage[4096];

View File

@ -28,7 +28,14 @@ CartridgeAR::CartridgeAR(const uInt8* image, uInt32 size,
const Settings& settings) const Settings& settings)
: Cartridge(settings), : Cartridge(settings),
mySize(BSPF_max(size, 8448u)), mySize(BSPF_max(size, 8448u)),
myLoadImages(nullptr) myLoadImages(nullptr),
myWriteEnabled(false),
myPower(true),
myPowerRomCycle(0),
myDataHoldRegister(0),
myNumberOfDistinctAccesses(0),
myWritePending(false),
myCurrentBank(0)
{ {
// Create a load image buffer and copy the given image // Create a load image buffer and copy the given image
myLoadImages = new uInt8[mySize]; myLoadImages = new uInt8[mySize];
@ -69,9 +76,9 @@ void CartridgeAR::reset()
// Initialize SC BIOS ROM // Initialize SC BIOS ROM
initializeROM(); initializeROM();
myWriteEnabled = false;
myPower = true; myPower = true;
myPowerRomCycle = mySystem->cycles(); myPowerRomCycle = mySystem->cycles();
myWriteEnabled = false;
myDataHoldRegister = 0; myDataHoldRegister = 0;
myNumberOfDistinctAccesses = 0; myNumberOfDistinctAccesses = 0;

View File

@ -225,6 +225,7 @@ class CartridgeAR : public Cartridge
// Indicates if a write is pending or not // Indicates if a write is pending or not
bool myWritePending; bool myWritePending;
// Indicates which bank is currently active
uInt16 myCurrentBank; uInt16 myCurrentBank;
// Fake SC-BIOS code to simulate the Supercharger load bars // Fake SC-BIOS code to simulate the Supercharger load bars

View File

@ -24,7 +24,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeBF::CartridgeBF(const uInt8* image, uInt32 size, const Settings& settings) CartridgeBF::CartridgeBF(const uInt8* image, uInt32 size, const Settings& settings)
: Cartridge(settings) : Cartridge(settings),
myCurrentBank(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
memcpy(myImage, image, BSPF_min(262144u, size)); memcpy(myImage, image, BSPF_min(262144u, size));

View File

@ -156,12 +156,12 @@ class CartridgeBF : public Cartridge
bool poke(uInt16 address, uInt8 value) override; bool poke(uInt16 address, uInt8 value) override;
private: private:
// Indicates which bank is currently active
uInt16 myCurrentBank;
// The 256K ROM image of the cartridge // The 256K ROM image of the cartridge
uInt8 myImage[64 * 4096]; uInt8 myImage[64 * 4096];
// Indicates which bank is currently active
uInt16 myCurrentBank;
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported
CartridgeBF() = delete; CartridgeBF() = delete;

View File

@ -24,7 +24,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeBFSC::CartridgeBFSC(const uInt8* image, uInt32 size, const Settings& settings) CartridgeBFSC::CartridgeBFSC(const uInt8* image, uInt32 size, const Settings& settings)
: Cartridge(settings) : Cartridge(settings),
myCurrentBank(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
memcpy(myImage, image, BSPF_min(262144u, size)); memcpy(myImage, image, BSPF_min(262144u, size));

View File

@ -155,15 +155,15 @@ class CartridgeBFSC : public Cartridge
bool poke(uInt16 address, uInt8 value) override; bool poke(uInt16 address, uInt8 value) override;
private: private:
// Indicates which bank is currently active
uInt16 myCurrentBank;
// The 256K ROM image of the cartridge // The 256K ROM image of the cartridge
uInt8 myImage[64 * 4096]; uInt8 myImage[64 * 4096];
// The 128 bytes of RAM // The 128 bytes of RAM
uInt8 myRAM[128]; uInt8 myRAM[128];
// Indicates which bank is currently active
uInt16 myCurrentBank;
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported
CartridgeBFSC() = delete; CartridgeBFSC() = delete;

View File

@ -26,15 +26,15 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeCM::CartridgeCM(const uInt8* image, uInt32 size, const Settings& settings) CartridgeCM::CartridgeCM(const uInt8* image, uInt32 size, const Settings& settings)
: Cartridge(settings) : Cartridge(settings),
mySWCHA(0xFF), // portA is all 1's
myCurrentBank(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
memcpy(myImage, image, BSPF_min(16384u, size)); memcpy(myImage, image, BSPF_min(16384u, size));
createCodeAccessBase(16384); createCodeAccessBase(16384);
// On powerup, portA is all 1's, so the last bank of ROM is enabled and // On powerup, the last bank of ROM is enabled and RAM is disabled
// RAM is disabled
mySWCHA = 0xff;
myStartBank = mySWCHA & 0x3; myStartBank = mySWCHA & 0x3;
} }

View File

@ -242,9 +242,6 @@ class CartridgeCM : public Cartridge
// The CompuMate device which interacts with this cartridge // The CompuMate device which interacts with this cartridge
shared_ptr<CompuMate> myCompuMate; shared_ptr<CompuMate> myCompuMate;
// Indicates which bank is currently active
uInt16 myCurrentBank;
// The 16K ROM image of the cartridge // The 16K ROM image of the cartridge
uInt8 myImage[16384]; uInt8 myImage[16384];
@ -254,7 +251,10 @@ class CartridgeCM : public Cartridge
// Current copy of SWCHA (controls ROM/RAM accesses) // Current copy of SWCHA (controls ROM/RAM accesses)
uInt8 mySWCHA; uInt8 mySWCHA;
private: // Indicates which bank is currently active
uInt16 myCurrentBank;
private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported
CartridgeCM() = delete; CartridgeCM() = delete;
CartridgeCM(const CartridgeCM&) = delete; CartridgeCM(const CartridgeCM&) = delete;

View File

@ -35,7 +35,8 @@ CartridgeCTY::CartridgeCTY(const uInt8* image, uInt32 size, const OSystem& osyst
myRandomNumber(0x2B435044), myRandomNumber(0x2B435044),
myRamAccessTimeout(0), myRamAccessTimeout(0),
mySystemCycles(0), mySystemCycles(0),
myFractionalClocks(0.0) myFractionalClocks(0.0),
myCurrentBank(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
memcpy(myImage, image, BSPF_min(32768u, size)); memcpy(myImage, image, BSPF_min(32768u, size));

View File

@ -272,9 +272,6 @@ class CartridgeCTY : public Cartridge
// OSsytem currently in use // OSsytem currently in use
const OSystem& myOSystem; const OSystem& myOSystem;
// Indicates which bank is currently active
uInt16 myCurrentBank;
// The 32K ROM image of the cartridge // The 32K ROM image of the cartridge
uInt8 myImage[32768]; uInt8 myImage[32768];
@ -313,6 +310,9 @@ class CartridgeCTY : public Cartridge
// Fractional DPC music OSC clocks unused during the last update // Fractional DPC music OSC clocks unused during the last update
double myFractionalClocks; double myFractionalClocks;
// Indicates which bank is currently active
uInt16 myCurrentBank;
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported
CartridgeCTY() = delete; CartridgeCTY() = delete;

View File

@ -24,7 +24,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeDF::CartridgeDF(const uInt8* image, uInt32 size, const Settings& settings) CartridgeDF::CartridgeDF(const uInt8* image, uInt32 size, const Settings& settings)
: Cartridge(settings) : Cartridge(settings),
myCurrentBank(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
memcpy(myImage, image, BSPF_min(131072u, size)); memcpy(myImage, image, BSPF_min(131072u, size));

View File

@ -156,13 +156,13 @@ class CartridgeDF : public Cartridge
bool poke(uInt16 address, uInt8 value) override; bool poke(uInt16 address, uInt8 value) override;
private: private:
// Indicates which bank is currently active
uInt16 myCurrentBank;
// The 128K ROM image of the cartridge // The 128K ROM image of the cartridge
uInt8 myImage[32 * 4096]; uInt8 myImage[32 * 4096];
private: // Indicates which bank is currently active
uInt16 myCurrentBank;
private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported
CartridgeDF() = delete; CartridgeDF() = delete;
CartridgeDF(const CartridgeDF&) = delete; CartridgeDF(const CartridgeDF&) = delete;

View File

@ -24,7 +24,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeDFSC::CartridgeDFSC(const uInt8* image, uInt32 size, const Settings& settings) CartridgeDFSC::CartridgeDFSC(const uInt8* image, uInt32 size, const Settings& settings)
: Cartridge(settings) : Cartridge(settings),
myCurrentBank(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
memcpy(myImage, image, BSPF_min(131072u, size)); memcpy(myImage, image, BSPF_min(131072u, size));

View File

@ -155,15 +155,15 @@ class CartridgeDFSC : public Cartridge
bool poke(uInt16 address, uInt8 value) override; bool poke(uInt16 address, uInt8 value) override;
private: private:
// Indicates which bank is currently active
uInt16 myCurrentBank;
// The 128K ROM image of the cartridge // The 128K ROM image of the cartridge
uInt8 myImage[32 * 4096]; uInt8 myImage[32 * 4096];
// The 128 bytes of RAM // The 128 bytes of RAM
uInt8 myRAM[128]; uInt8 myRAM[128];
// Indicates which bank is currently active
uInt16 myCurrentBank;
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported
CartridgeDFSC() = delete; CartridgeDFSC() = delete;

View File

@ -28,7 +28,8 @@ CartridgeDPC::CartridgeDPC(const uInt8* image, uInt32 size,
: Cartridge(settings), : Cartridge(settings),
mySize(size), mySize(size),
mySystemCycles(0), mySystemCycles(0),
myFractionalClocks(0.0) myFractionalClocks(0.0),
myCurrentBank(0)
{ {
// Make a copy of the entire image // Make a copy of the entire image
memcpy(myImage, image, BSPF_min(size, 8192u + 2048u + 256u)); memcpy(myImage, image, BSPF_min(size, 8192u + 2048u + 256u));

View File

@ -191,9 +191,6 @@ class CartridgeDPC : public Cartridge
// Pointer to the 2K display ROM image of the cartridge // Pointer to the 2K display ROM image of the cartridge
uInt8* myDisplayImage; uInt8* myDisplayImage;
// Indicates which bank is currently active
uInt16 myCurrentBank;
// The top registers for the data fetchers // The top registers for the data fetchers
uInt8 myTops[8]; uInt8 myTops[8];
@ -218,6 +215,9 @@ class CartridgeDPC : public Cartridge
// Fractional DPC music OSC clocks unused during the last update // Fractional DPC music OSC clocks unused during the last update
double myFractionalClocks; double myFractionalClocks;
// Indicates which bank is currently active
uInt16 myCurrentBank;
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported
CartridgeDPC() = delete; CartridgeDPC() = delete;

View File

@ -35,7 +35,8 @@ CartridgeDPCPlus::CartridgeDPCPlus(const uInt8* image, uInt32 size,
myLDAimmediate(false), myLDAimmediate(false),
myParameterPointer(0), myParameterPointer(0),
mySystemCycles(0), mySystemCycles(0),
myFractionalClocks(0.0) myFractionalClocks(0.0),
myCurrentBank(0)
{ {
// Store image, making sure it's at least 29KB // Store image, making sure it's at least 29KB
uInt32 minsize = 4096 * 6 + 4096 + 1024 + 255; uInt32 minsize = 4096 * 6 + 4096 + 1024 + 255;

View File

@ -222,9 +222,6 @@ class CartridgeDPCPlus : public Cartridge
// Pointer to the 1K frequency table // Pointer to the 1K frequency table
uInt8* myFrequencyImage; uInt8* myFrequencyImage;
// Indicates which bank is currently active
uInt16 myCurrentBank;
// The top registers for the data fetchers // The top registers for the data fetchers
uInt8 myTops[8]; uInt8 myTops[8];
@ -270,6 +267,9 @@ class CartridgeDPCPlus : public Cartridge
// Fractional DPC music OSC clocks unused during the last update // Fractional DPC music OSC clocks unused during the last update
double myFractionalClocks; double myFractionalClocks;
// Indicates which bank is currently active
uInt16 myCurrentBank;
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported
CartridgeDPCPlus() = delete; CartridgeDPCPlus() = delete;

View File

@ -24,7 +24,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeE7::CartridgeE7(const uInt8* image, uInt32 size, const Settings& settings) CartridgeE7::CartridgeE7(const uInt8* image, uInt32 size, const Settings& settings)
: Cartridge(settings) : Cartridge(settings),
myCurrentRAM(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
memcpy(myImage, image, BSPF_min(16384u, size)); memcpy(myImage, image, BSPF_min(16384u, size));

View File

@ -189,18 +189,18 @@ class CartridgeE7 : public Cartridge
void bankRAM(uInt16 bank); void bankRAM(uInt16 bank);
private: private:
// Indicates which slice is in the segment
uInt16 myCurrentSlice[2];
// Indicates which 256 byte bank of RAM is being used
uInt16 myCurrentRAM;
// The 16K ROM image of the cartridge // The 16K ROM image of the cartridge
uInt8 myImage[16384]; uInt8 myImage[16384];
// The 2048 bytes of RAM // The 2048 bytes of RAM
uInt8 myRAM[2048]; uInt8 myRAM[2048];
// Indicates which slice is in the segment
uInt16 myCurrentSlice[2];
// Indicates which 256 byte bank of RAM is being used
uInt16 myCurrentRAM;
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported
CartridgeE7() = delete; CartridgeE7() = delete;

View File

@ -24,7 +24,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeEF::CartridgeEF(const uInt8* image, uInt32 size, const Settings& settings) CartridgeEF::CartridgeEF(const uInt8* image, uInt32 size, const Settings& settings)
: Cartridge(settings) : Cartridge(settings),
myCurrentBank(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
memcpy(myImage, image, BSPF_min(65536u, size)); memcpy(myImage, image, BSPF_min(65536u, size));

View File

@ -159,12 +159,12 @@ class CartridgeEF : public Cartridge
bool poke(uInt16 address, uInt8 value) override; bool poke(uInt16 address, uInt8 value) override;
private: private:
// Indicates which bank is currently active
uInt16 myCurrentBank;
// The 64K ROM image of the cartridge // The 64K ROM image of the cartridge
uInt8 myImage[65536]; uInt8 myImage[65536];
// Indicates which bank is currently active
uInt16 myCurrentBank;
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported
CartridgeEF() = delete; CartridgeEF() = delete;

View File

@ -17,14 +17,13 @@
// $Id$ // $Id$
//============================================================================ //============================================================================
#include <cstring>
#include "System.hxx" #include "System.hxx"
#include "CartEFSC.hxx" #include "CartEFSC.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeEFSC::CartridgeEFSC(const uInt8* image, uInt32 size, const Settings& settings) CartridgeEFSC::CartridgeEFSC(const uInt8* image, uInt32 size, const Settings& settings)
: Cartridge(settings) : Cartridge(settings),
myCurrentBank(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
memcpy(myImage, image, BSPF_min(65536u, size)); memcpy(myImage, image, BSPF_min(65536u, size));

View File

@ -159,15 +159,15 @@ class CartridgeEFSC : public Cartridge
bool poke(uInt16 address, uInt8 value) override; bool poke(uInt16 address, uInt8 value) override;
private: private:
// Indicates which bank is currently active
uInt16 myCurrentBank;
// The 64K ROM image of the cartridge // The 64K ROM image of the cartridge
uInt8 myImage[65536]; uInt8 myImage[65536];
// The 128 bytes of RAM // The 128 bytes of RAM
uInt8 myRAM[128]; uInt8 myRAM[128];
// Indicates which bank is currently active
uInt16 myCurrentBank;
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported
CartridgeEFSC() = delete; CartridgeEFSC() = delete;

View File

@ -24,7 +24,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeF0::CartridgeF0(const uInt8* image, uInt32 size, const Settings& settings) CartridgeF0::CartridgeF0(const uInt8* image, uInt32 size, const Settings& settings)
: Cartridge(settings) : Cartridge(settings),
myCurrentBank(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
memcpy(myImage, image, BSPF_min(65536u, size)); memcpy(myImage, image, BSPF_min(65536u, size));

View File

@ -162,12 +162,12 @@ class CartridgeF0 : public Cartridge
void incbank(); void incbank();
private: private:
// Indicates which bank is currently active
uInt16 myCurrentBank;
// The 64K ROM image of the cartridge // The 64K ROM image of the cartridge
uInt8 myImage[65536]; uInt8 myImage[65536];
// Indicates which bank is currently active
uInt16 myCurrentBank;
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported
CartridgeF0() = delete; CartridgeF0() = delete;

View File

@ -25,7 +25,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeF4::CartridgeF4(const uInt8* image, uInt32 size, const Settings& settings) CartridgeF4::CartridgeF4(const uInt8* image, uInt32 size, const Settings& settings)
: Cartridge(settings) : Cartridge(settings),
myCurrentBank(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
memcpy(myImage, image, BSPF_min(32768u, size)); memcpy(myImage, image, BSPF_min(32768u, size));

View File

@ -155,12 +155,12 @@ class CartridgeF4 : public Cartridge
bool poke(uInt16 address, uInt8 value) override; bool poke(uInt16 address, uInt8 value) override;
private: private:
// Indicates which bank is currently active
uInt16 myCurrentBank;
// The 32K ROM image of the cartridge // The 32K ROM image of the cartridge
uInt8 myImage[32768]; uInt8 myImage[32768];
// Indicates which bank is currently active
uInt16 myCurrentBank;
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported
CartridgeF4() = delete; CartridgeF4() = delete;

View File

@ -24,7 +24,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeF4SC::CartridgeF4SC(const uInt8* image, uInt32 size, const Settings& settings) CartridgeF4SC::CartridgeF4SC(const uInt8* image, uInt32 size, const Settings& settings)
: Cartridge(settings) : Cartridge(settings),
myCurrentBank(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
memcpy(myImage, image, BSPF_min(32768u, size)); memcpy(myImage, image, BSPF_min(32768u, size));

View File

@ -155,15 +155,15 @@ class CartridgeF4SC : public Cartridge
bool poke(uInt16 address, uInt8 value) override; bool poke(uInt16 address, uInt8 value) override;
private: private:
// Indicates which bank is currently active
uInt16 myCurrentBank;
// The 32K ROM image of the cartridge // The 32K ROM image of the cartridge
uInt8 myImage[32768]; uInt8 myImage[32768];
// The 128 bytes of RAM // The 128 bytes of RAM
uInt8 myRAM[128]; uInt8 myRAM[128];
// Indicates which bank is currently active
uInt16 myCurrentBank;
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported
CartridgeF4SC() = delete; CartridgeF4SC() = delete;

View File

@ -24,7 +24,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeF6::CartridgeF6(const uInt8* image, uInt32 size, const Settings& settings) CartridgeF6::CartridgeF6(const uInt8* image, uInt32 size, const Settings& settings)
: Cartridge(settings) : Cartridge(settings),
myCurrentBank(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
memcpy(myImage, image, BSPF_min(16384u, size)); memcpy(myImage, image, BSPF_min(16384u, size));

View File

@ -155,12 +155,12 @@ class CartridgeF6 : public Cartridge
bool poke(uInt16 address, uInt8 value) override; bool poke(uInt16 address, uInt8 value) override;
private: private:
// Indicates which bank is currently active
uInt16 myCurrentBank;
// The 16K ROM image of the cartridge // The 16K ROM image of the cartridge
uInt8 myImage[16384]; uInt8 myImage[16384];
// Indicates which bank is currently active
uInt16 myCurrentBank;
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported
CartridgeF6() = delete; CartridgeF6() = delete;

View File

@ -24,7 +24,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeF6SC::CartridgeF6SC(const uInt8* image, uInt32 size, const Settings& settings) CartridgeF6SC::CartridgeF6SC(const uInt8* image, uInt32 size, const Settings& settings)
: Cartridge(settings) : Cartridge(settings),
myCurrentBank(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
memcpy(myImage, image, BSPF_min(16384u, size)); memcpy(myImage, image, BSPF_min(16384u, size));

View File

@ -155,15 +155,15 @@ class CartridgeF6SC : public Cartridge
bool poke(uInt16 address, uInt8 value) override; bool poke(uInt16 address, uInt8 value) override;
private: private:
// Indicates which bank is currently active
uInt16 myCurrentBank;
// The 16K ROM image of the cartridge // The 16K ROM image of the cartridge
uInt8 myImage[16384]; uInt8 myImage[16384];
// The 128 bytes of RAM // The 128 bytes of RAM
uInt8 myRAM[128]; uInt8 myRAM[128];
// Indicates which bank is currently active
uInt16 myCurrentBank;
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported
CartridgeF6SC() = delete; CartridgeF6SC() = delete;

View File

@ -25,7 +25,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeF8::CartridgeF8(const uInt8* image, uInt32 size, const string& md5, CartridgeF8::CartridgeF8(const uInt8* image, uInt32 size, const string& md5,
const Settings& settings) const Settings& settings)
: Cartridge(settings) : Cartridge(settings),
myCurrentBank(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
memcpy(myImage, image, BSPF_min(8192u, size)); memcpy(myImage, image, BSPF_min(8192u, size));

View File

@ -157,12 +157,12 @@ class CartridgeF8 : public Cartridge
bool poke(uInt16 address, uInt8 value) override; bool poke(uInt16 address, uInt8 value) override;
private: private:
// Indicates which bank is currently active
uInt16 myCurrentBank;
// The 8K ROM image of the cartridge // The 8K ROM image of the cartridge
uInt8 myImage[8192]; uInt8 myImage[8192];
// Indicates which bank is currently active
uInt16 myCurrentBank;
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported
CartridgeF8() = delete; CartridgeF8() = delete;

View File

@ -24,7 +24,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeF8SC::CartridgeF8SC(const uInt8* image, uInt32 size, const Settings& settings) CartridgeF8SC::CartridgeF8SC(const uInt8* image, uInt32 size, const Settings& settings)
: Cartridge(settings) : Cartridge(settings),
myCurrentBank(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
memcpy(myImage, image, BSPF_min(8192u, size)); memcpy(myImage, image, BSPF_min(8192u, size));

View File

@ -155,15 +155,15 @@ class CartridgeF8SC : public Cartridge
bool poke(uInt16 address, uInt8 value) override; bool poke(uInt16 address, uInt8 value) override;
private: private:
// Indicates which bank is currently active
uInt16 myCurrentBank;
// The 8K ROM image of the cartridge // The 8K ROM image of the cartridge
uInt8 myImage[8192]; uInt8 myImage[8192];
// The 128 bytes of RAM // The 128 bytes of RAM
uInt8 myRAM[128]; uInt8 myRAM[128];
// Indicates which bank is currently active
uInt16 myCurrentBank;
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported
CartridgeF8SC() = delete; CartridgeF8SC() = delete;

View File

@ -24,7 +24,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeFA::CartridgeFA(const uInt8* image, uInt32 size, const Settings& settings) CartridgeFA::CartridgeFA(const uInt8* image, uInt32 size, const Settings& settings)
: Cartridge(settings) : Cartridge(settings),
myCurrentBank(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
memcpy(myImage, image, BSPF_min(12288u, size)); memcpy(myImage, image, BSPF_min(12288u, size));

View File

@ -155,15 +155,15 @@ class CartridgeFA : public Cartridge
bool poke(uInt16 address, uInt8 value) override; bool poke(uInt16 address, uInt8 value) override;
private: private:
// Indicates which bank is currently active
uInt16 myCurrentBank;
// The 12K ROM image of the cartridge // The 12K ROM image of the cartridge
uInt8 myImage[12288]; uInt8 myImage[12288];
// The 256 bytes of RAM on the cartridge // The 256 bytes of RAM on the cartridge
uInt8 myRAM[256]; uInt8 myRAM[256];
// Indicates which bank is currently active
uInt16 myCurrentBank;
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported
CartridgeFA() = delete; CartridgeFA() = delete;

View File

@ -17,8 +17,6 @@
// $Id$ // $Id$
//============================================================================ //============================================================================
#include <cstring>
#include "OSystem.hxx" #include "OSystem.hxx"
#include "Serializer.hxx" #include "Serializer.hxx"
#include "System.hxx" #include "System.hxx"
@ -29,7 +27,7 @@ CartridgeFA2::CartridgeFA2(const uInt8* image, uInt32 size, const OSystem& osyst
: Cartridge(osystem.settings()), : Cartridge(osystem.settings()),
myOSystem(osystem), myOSystem(osystem),
myRamAccessTimeout(0), myRamAccessTimeout(0),
mySize(size) myCurrentBank(0)
{ {
// 29/32K version of FA2 has valid data @ 1K - 29K // 29/32K version of FA2 has valid data @ 1K - 29K
if(size >= 29 * 1024) if(size >= 29 * 1024)
@ -37,6 +35,8 @@ CartridgeFA2::CartridgeFA2(const uInt8* image, uInt32 size, const OSystem& osyst
image += 1024; image += 1024;
mySize = 28 * 1024; mySize = 28 * 1024;
} }
else
mySize = BSPF_min(28 * 1024u, size);
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
memcpy(myImage, image, mySize); memcpy(myImage, image, mySize);

View File

@ -193,12 +193,12 @@ class CartridgeFA2 : public Cartridge
// OSsytem currently in use // OSsytem currently in use
const OSystem& myOSystem; const OSystem& myOSystem;
// Indicates which bank is currently active
uInt16 myCurrentBank;
// The 24K/28K ROM image of the cartridge // The 24K/28K ROM image of the cartridge
uInt8 myImage[28 * 1024]; uInt8 myImage[28 * 1024];
// Actual usable size of the ROM image
uInt32 mySize;
// The 256 bytes of RAM on the cartridge // The 256 bytes of RAM on the cartridge
uInt8 myRAM[256]; uInt8 myRAM[256];
@ -212,8 +212,8 @@ class CartridgeFA2 : public Cartridge
// of internal RAM to Harmony cart flash // of internal RAM to Harmony cart flash
string myFlashFile; string myFlashFile;
// Size of the ROM image // Indicates which bank is currently active
uInt32 mySize; uInt16 myCurrentBank;
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported

View File

@ -27,6 +27,7 @@ CartridgeMDM::CartridgeMDM(const uInt8* image, uInt32 size, const Settings& sett
: Cartridge(settings), : Cartridge(settings),
myImage(nullptr), myImage(nullptr),
mySize(size), mySize(size),
myCurrentBank(0),
myBankingDisabled(false) myBankingDisabled(false)
{ {
// Allocate array for the ROM image // Allocate array for the ROM image

View File

@ -172,12 +172,12 @@ class CartridgeMDM : public Cartridge
// Size of the ROM image // Size of the ROM image
uInt32 mySize; uInt32 mySize;
// Indicates which bank is currently active
uInt16 myCurrentBank;
// Previous Device's page access // Previous Device's page access
System::PageAccess myHotSpotPageAccess[8]; System::PageAccess myHotSpotPageAccess[8];
// Indicates which bank is currently active
uInt16 myCurrentBank;
// Indicates whether banking has been disabled due to a bankswitch // Indicates whether banking has been disabled due to a bankswitch
// above bank 127 // above bank 127
bool myBankingDisabled; bool myBankingDisabled;

View File

@ -27,7 +27,8 @@ CartridgeSB::CartridgeSB(const uInt8* image, uInt32 size,
const Settings& settings) const Settings& settings)
: Cartridge(settings), : Cartridge(settings),
myImage(nullptr), myImage(nullptr),
mySize(size) mySize(size),
myCurrentBank(0)
{ {
// Allocate array for the ROM image // Allocate array for the ROM image
myImage = new uInt8[mySize]; myImage = new uInt8[mySize];

View File

@ -24,7 +24,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeUA::CartridgeUA(const uInt8* image, uInt32 size, const Settings& settings) CartridgeUA::CartridgeUA(const uInt8* image, uInt32 size, const Settings& settings)
: Cartridge(settings) : Cartridge(settings),
myCurrentBank(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
memcpy(myImage, image, BSPF_min(8192u, size)); memcpy(myImage, image, BSPF_min(8192u, size));

View File

@ -155,15 +155,15 @@ class CartridgeUA : public Cartridge
bool poke(uInt16 address, uInt8 value) override; bool poke(uInt16 address, uInt8 value) override;
private: private:
// Indicates which bank is currently active
uInt16 myCurrentBank;
// The 8K ROM image of the cartridge // The 8K ROM image of the cartridge
uInt8 myImage[8192]; uInt8 myImage[8192];
// Previous Device's page access // Previous Device's page access
System::PageAccess myHotSpotPageAccess; System::PageAccess myHotSpotPageAccess;
// Indicates which bank is currently active
uInt16 myCurrentBank;
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported
CartridgeUA() = delete; CartridgeUA() = delete;

View File

@ -28,7 +28,10 @@
CartridgeWD::CartridgeWD(const uInt8* image, uInt32 size, CartridgeWD::CartridgeWD(const uInt8* image, uInt32 size,
const Settings& settings) const Settings& settings)
: Cartridge(settings), : Cartridge(settings),
mySize(BSPF_min(8195u, size)) mySize(BSPF_min(8195u, size)),
myCyclesAtBankswitchInit(0),
myPendingBank(0),
myCurrentBank(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
memcpy(myImage, image, mySize); memcpy(myImage, image, mySize);

View File

@ -214,15 +214,12 @@ class CartridgeWD : public Cartridge
void segmentThree(uInt8 slice, bool map3bytes); void segmentThree(uInt8 slice, bool map3bytes);
private: private:
// Indicates which bank is currently active // The 8K ROM image of the cartridge
uInt16 myCurrentBank; uInt8 myImage[8195];
// Indicates the actual size of the ROM image (either 8K or 8K + 3) // Indicates the actual size of the ROM image (either 8K or 8K + 3)
uInt32 mySize; uInt32 mySize;
// The 8K ROM image of the cartridge
uInt8 myImage[8195];
// The 64 bytes RAM of the cartridge // The 64 bytes RAM of the cartridge
uInt8 myRAM[64]; uInt8 myRAM[64];
@ -238,6 +235,9 @@ class CartridgeWD : public Cartridge
// Indicates the bank we wish to switch to in the future // Indicates the bank we wish to switch to in the future
uInt16 myPendingBank; uInt16 myPendingBank;
// Indicates which bank is currently active
uInt16 myCurrentBank;
// The arrangement of banks to use on each hotspot read // The arrangement of banks to use on each hotspot read
struct BankOrg { struct BankOrg {
uInt8 zero, one, two, three; uInt8 zero, one, two, three;

View File

@ -26,7 +26,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeX07::CartridgeX07(const uInt8* image, uInt32 size, const Settings& settings) CartridgeX07::CartridgeX07(const uInt8* image, uInt32 size, const Settings& settings)
: Cartridge(settings) : Cartridge(settings),
myCurrentBank(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
memcpy(myImage, image, BSPF_min(65536u, size)); memcpy(myImage, image, BSPF_min(65536u, size));

View File

@ -165,12 +165,12 @@ class CartridgeX07 : public Cartridge
bool poke(uInt16 address, uInt8 value) override; bool poke(uInt16 address, uInt8 value) override;
private: private:
// Indicates which bank is currently active
uInt16 myCurrentBank;
// The 64K ROM image of the cartridge // The 64K ROM image of the cartridge
uInt8 myImage[65536]; uInt8 myImage[65536];
// Indicates which bank is currently active
uInt16 myCurrentBank;
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported
CartridgeX07() = delete; CartridgeX07() = delete;

View File

@ -25,7 +25,9 @@
CompuMate::CompuMate(const Console& console, const Event& event, CompuMate::CompuMate(const Console& console, const Event& event,
const System& system) const System& system)
: myConsole(console), : myConsole(console),
myEvent(event) myEvent(event),
myColumn(0),
myKeyTable(nullptr)
{ {
// These controller pointers will be retrieved by the Console, which will // These controller pointers will be retrieved by the Console, which will
// also take ownership of them // also take ownership of them
@ -74,7 +76,7 @@ void CompuMate::update()
rp.myDigitalPinState[Controller::Three] = true; rp.myDigitalPinState[Controller::Three] = true;
rp.myDigitalPinState[Controller::Four] = true; rp.myDigitalPinState[Controller::Four] = true;
switch(myColumn) switch(myColumn) // This is updated outside the class
{ {
case 0: case 0:
if (myKeyTable[KBDK_7]) lp.myDigitalPinState[Controller::Six] = false; if (myKeyTable[KBDK_7]) lp.myDigitalPinState[Controller::Six] = false;

View File

@ -63,7 +63,9 @@ EventHandler::EventHandler(OSystem& osystem)
myAllowAllDirectionsFlag(false), myAllowAllDirectionsFlag(false),
myFryingFlag(false), myFryingFlag(false),
myUseCtrlKeyFlag(true), myUseCtrlKeyFlag(true),
mySkipMouseMotion(true) mySkipMouseMotion(true),
myContSnapshotInterval(0),
myContSnapshotCounter(0)
{ {
// Erase the key mapping array // Erase the key mapping array
for(int i = 0; i < KBDK_LAST; ++i) for(int i = 0; i < KBDK_LAST; ++i)

View File

@ -49,7 +49,8 @@
FrameBuffer::FrameBuffer(OSystem& osystem) FrameBuffer::FrameBuffer(OSystem& osystem)
: myOSystem(osystem), : myOSystem(osystem),
myInitializedCount(0), myInitializedCount(0),
myPausedCount(0) myPausedCount(0),
myCurrentModeList(nullptr)
{ {
myMsg.surface = myStatsMsg.surface = nullptr; myMsg.surface = myStatsMsg.surface = nullptr;
myMsg.enabled = myStatsMsg.enabled = false; myMsg.enabled = myStatsMsg.enabled = false;

View File

@ -26,8 +26,16 @@ KidVid::KidVid(Jack jack, const Event& event, const System& system,
const string& rommd5) const string& rommd5)
: Controller(jack, event, system, Controller::KidVid), : Controller(jack, event, system, Controller::KidVid),
myEnabled(myJack == Right), myEnabled(myJack == Right),
mySampleFile(nullptr),
mySharedSampleFile(nullptr),
myFileOpened(false), myFileOpened(false),
myTapeBusy(false),
myFilePointer(0),
mySongCounter(0), mySongCounter(0),
myBeep(false),
mySharedData(false),
mySampleByte(0),
myGame(0),
myTape(0), myTape(0),
myIdx(0), myIdx(0),
myBlock(0), myBlock(0),

View File

@ -49,6 +49,8 @@ M6502::M6502(const Settings& settings)
: myExecutionStatus(0), : myExecutionStatus(0),
mySystem(nullptr), mySystem(nullptr),
mySettings(settings), mySettings(settings),
A(0), X(0), Y(0), SP(0), IR(0), PC(0),
N(false), V(false), B(false), D(false), I(false), notZ(false), C(false),
myLastAccessWasRead(true), myLastAccessWasRead(true),
myNumberOfDistinctAccesses(0), myNumberOfDistinctAccesses(0),
myLastAddress(0), myLastAddress(0),

View File

@ -273,21 +273,6 @@ class M6502 : public Serializable
void interruptHandler(); void interruptHandler();
private: private:
uInt8 A; // Accumulator
uInt8 X; // X index register
uInt8 Y; // Y index register
uInt8 SP; // Stack Pointer
uInt8 IR; // Instruction register
uInt16 PC; // Program Counter
bool N; // N flag for processor status register
bool V; // V flag for processor status register
bool B; // B flag for processor status register
bool D; // D flag for processor status register
bool I; // I flag for processor status register
bool notZ; // Z flag complement for processor status register
bool C; // C flag for processor status register
/** /**
Bit fields used to indicate that certain conditions need to be Bit fields used to indicate that certain conditions need to be
handled such as stopping execution, fatal errors, maskable interrupts handled such as stopping execution, fatal errors, maskable interrupts
@ -308,6 +293,21 @@ class M6502 : public Serializable
/// Reference to the settings /// Reference to the settings
const Settings& mySettings; const Settings& mySettings;
uInt8 A; // Accumulator
uInt8 X; // X index register
uInt8 Y; // Y index register
uInt8 SP; // Stack Pointer
uInt8 IR; // Instruction register
uInt16 PC; // Program Counter
bool N; // N flag for processor status register
bool V; // V flag for processor status register
bool B; // B flag for processor status register
bool D; // D flag for processor status register
bool I; // I flag for processor status register
bool notZ; // Z flag complement for processor status register
bool C; // C flag for processor status register
/// Indicates if the last memory access was a read or not /// Indicates if the last memory access was a read or not
bool myLastAccessWasRead; bool myLastAccessWasRead;

View File

@ -31,6 +31,9 @@
M6532::M6532(const Console& console, const Settings& settings) M6532::M6532(const Console& console, const Settings& settings)
: myConsole(console), : myConsole(console),
mySettings(settings), mySettings(settings),
myTimer(0), myIntervalShift(0), myCyclesWhenTimerSet(0),
myDDRA(0), myDDRB(0), myOutA(0), myOutB(0),
myInterruptFlag(false),
myTimerFlagValid(false), myTimerFlagValid(false),
myEdgeDetectPositive(false) myEdgeDetectPositive(false)
{ {

View File

@ -29,7 +29,12 @@
DialogContainer::DialogContainer(OSystem& osystem) DialogContainer::DialogContainer(OSystem& osystem)
: myOSystem(osystem), : myOSystem(osystem),
myBaseDialog(nullptr), myBaseDialog(nullptr),
myTime(0) myTime(0),
myKeyRepeatTime(0),
myClickRepeatTime(0),
myButtonRepeatTime(0),
myAxisRepeatTime(0),
myHatRepeatTime(0)
{ {
reset(); reset();
} }

View File

@ -40,6 +40,10 @@ EventMappingWidget::EventMappingWidget(GuiObject* boss, const GUI::Font& font,
myEventMode(mode), myEventMode(mode),
myActionSelected(-1), myActionSelected(-1),
myRemapStatus(false), myRemapStatus(false),
myLastStick(0),
myLastAxis(0),
myLastHat(0),
myLastValue(0),
myFirstTime(true) myFirstTime(true)
{ {
const int fontHeight = font.getFontHeight(), const int fontHeight = font.getFontHeight(),

View File

@ -53,6 +53,7 @@ LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent,
myOptionsButton(nullptr), myOptionsButton(nullptr),
myQuitButton(nullptr), myQuitButton(nullptr),
myList(nullptr), myList(nullptr),
myPattern(nullptr),
myRomInfoWidget(nullptr), myRomInfoWidget(nullptr),
mySelectedItem(0) mySelectedItem(0)
{ {

View File

@ -40,17 +40,19 @@ void FilesystemNodePOSIX::setFlags()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilesystemNodePOSIX::FilesystemNodePOSIX() FilesystemNodePOSIX::FilesystemNodePOSIX()
: _path("/"), // The root dir.
_displayName(_path),
_isValid(true),
_isFile(false),
_isDirectory(true)
{ {
// The root dir.
_path = "/";
_displayName = _path;
_isValid = true;
_isDirectory = true;
_isFile = false;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilesystemNodePOSIX::FilesystemNodePOSIX(const string& p, bool verify) FilesystemNodePOSIX::FilesystemNodePOSIX(const string& p, bool verify)
: _isValid(true),
_isFile(false),
_isDirectory(true)
{ {
// Default to home directory // Default to home directory
_path = p.length() > 0 ? p : "~"; _path = p.length() > 0 ? p : "~";

View File

@ -79,11 +79,11 @@ class FilesystemNodePOSIX : public AbstractFSNode
AbstractFSNode* getParent() const override; AbstractFSNode* getParent() const override;
protected: protected:
string _displayName;
string _path; string _path;
bool _isDirectory; string _displayName;
bool _isFile;
bool _isValid; bool _isValid;
bool _isFile;
bool _isDirectory;
private: private:
/** /**