diff --git a/src/common/FSNodeZIP.cxx b/src/common/FSNodeZIP.cxx index d7ac74d56..738cd9567 100644 --- a/src/common/FSNodeZIP.cxx +++ b/src/common/FSNodeZIP.cxx @@ -105,7 +105,9 @@ FilesystemNodeZIP::FilesystemNodeZIP(const string& p) FilesystemNodeZIP::FilesystemNodeZIP( const string& zipfile, const string& virtualpath, shared_ptr realnode, bool isdir) - : _isDirectory(isdir), + : _error(ZIPERR_NONE), + _numFiles(0), + _isDirectory(isdir), _isFile(!isdir) { setFlags(zipfile, virtualpath, realnode); diff --git a/src/common/FrameBufferSDL2.hxx b/src/common/FrameBufferSDL2.hxx index f7db9bab0..31efe9b4d 100644 --- a/src/common/FrameBufferSDL2.hxx +++ b/src/common/FrameBufferSDL2.hxx @@ -175,9 +175,6 @@ class FrameBufferSDL2 : public FrameBuffer // Used by mapRGB (when palettes are created) SDL_PixelFormat* myPixelFormat; - // The depth of the render buffer - uInt32 myDepth; - // Indicates that the renderer has been modified, and should be redrawn bool myDirtyFlag; diff --git a/src/common/SoundSDL2.cxx b/src/common/SoundSDL2.cxx index afe898f6a..684db8f30 100644 --- a/src/common/SoundSDL2.cxx +++ b/src/common/SoundSDL2.cxx @@ -41,6 +41,8 @@ SoundSDL2::SoundSDL2(OSystem& osystem) myLastRegisterSetCycle(0), myNumChannels(0), myFragmentSizeLogBase2(0), + myFragmentSizeLogDiv1(0), + myFragmentSizeLogDiv2(0), myIsMuted(true), myVolume(100) { diff --git a/src/common/Stack.hxx b/src/common/Stack.hxx index b35d1529a..d1c3d487f 100644 --- a/src/common/Stack.hxx +++ b/src/common/Stack.hxx @@ -33,6 +33,10 @@ namespace Common { template class FixedStack { + protected: + T _stack[MAX_SIZE]; + int _size; + public: FixedStack() : _size(0) { } @@ -63,10 +67,6 @@ class FixedStack return _stack[i]; } - protected: - T _stack[MAX_SIZE]; - int _size; - private: // Following constructors and assignment operators not supported FixedStack(const FixedStack&) = delete; diff --git a/src/debugger/DiStella.cxx b/src/debugger/DiStella.cxx index 16895e1dc..d0083ab59 100644 --- a/src/debugger/DiStella.cxx +++ b/src/debugger/DiStella.cxx @@ -107,10 +107,10 @@ DiStella::DiStella(const CartDebug& dbg, CartDebug::DisassemblyList& list, while(!myAddressQueue.empty()) { myPC = myAddressQueue.front(); - myPCBeg = myPC; + uInt16 pcBeg = myPC; myAddressQueue.pop(); disasm(myPC, 1); - if(myPCBeg <= myPCEnd) + if(pcBeg <= myPCEnd) { // Tentatively mark all addresses in the range as CODE // 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 // in the emulation core indicate that the CODE range has finished // 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) & (CartDebug::DATA|CartDebug::GFX|CartDebug::PGFX)) diff --git a/src/debugger/DiStella.hxx b/src/debugger/DiStella.hxx index 736a754d1..046cc3dc0 100644 --- a/src/debugger/DiStella.hxx +++ b/src/debugger/DiStella.hxx @@ -118,7 +118,7 @@ class DiStella CartDebug::ReservedEquates& myReserved; stringstream myDisasmBuf; queue myAddressQueue; - uInt16 myOffset, myPC, myPCBeg, myPCEnd; + uInt16 myOffset, myPC, myPCEnd; struct resource { uInt16 start; diff --git a/src/debugger/gui/RomListWidget.cxx b/src/debugger/gui/RomListWidget.cxx index 87917136c..1fbe88634 100644 --- a/src/debugger/gui/RomListWidget.cxx +++ b/src/debugger/gui/RomListWidget.cxx @@ -37,7 +37,10 @@ RomListWidget::RomListWidget(GuiObject* boss, const GUI::Font& lfont, _selectedItem(-1), _highlightedItem(-1), _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; _bgcolor = kWidColor; diff --git a/src/emucore/Cart3E.cxx b/src/emucore/Cart3E.cxx index 6485e8f16..a22ef42a4 100644 --- a/src/emucore/Cart3E.cxx +++ b/src/emucore/Cart3E.cxx @@ -28,7 +28,8 @@ Cartridge3E::Cartridge3E(const uInt8* image, uInt32 size, const Settings& settings) : Cartridge(settings), myImage(nullptr), - mySize(size) + mySize(size), + myCurrentBank(0) { // Allocate array for the ROM image myImage = new uInt8[mySize]; diff --git a/src/emucore/Cart3E.hxx b/src/emucore/Cart3E.hxx index c8fce2002..5d6d18d1e 100644 --- a/src/emucore/Cart3E.hxx +++ b/src/emucore/Cart3E.hxx @@ -184,9 +184,6 @@ class Cartridge3E : public Cartridge bool poke(uInt16 address, uInt8 value) override; private: - // Indicates which bank is currently active for the first segment - uInt16 myCurrentBank; - // Pointer to a dynamically allocated ROM image of the cartridge uInt8* myImage; @@ -196,6 +193,9 @@ class Cartridge3E : public Cartridge // Size of the ROM image uInt32 mySize; + // Indicates which bank is currently active for the first segment + uInt16 myCurrentBank; + private: // Following constructors and assignment operators not supported Cartridge3E() = delete; diff --git a/src/emucore/Cart3F.cxx b/src/emucore/Cart3F.cxx index 9e31888a0..ab923b575 100644 --- a/src/emucore/Cart3F.cxx +++ b/src/emucore/Cart3F.cxx @@ -28,7 +28,8 @@ Cartridge3F::Cartridge3F(const uInt8* image, uInt32 size, const Settings& settings) : Cartridge(settings), myImage(nullptr), - mySize(size) + mySize(size), + myCurrentBank(0) { // Allocate array for the ROM image myImage = new uInt8[mySize]; diff --git a/src/emucore/Cart3F.hxx b/src/emucore/Cart3F.hxx index 8bca1d991..46ffd2a9b 100644 --- a/src/emucore/Cart3F.hxx +++ b/src/emucore/Cart3F.hxx @@ -161,15 +161,15 @@ class Cartridge3F : public Cartridge bool poke(uInt16 address, uInt8 value) override; private: - // Indicates which bank is currently active for the first segment - uInt16 myCurrentBank; - // Pointer to a dynamically allocated ROM image of the cartridge uInt8* myImage; // Size of the ROM image uInt32 mySize; + // Indicates which bank is currently active for the first segment + uInt16 myCurrentBank; + private: // Following constructors and assignment operators not supported Cartridge3F() = delete; diff --git a/src/emucore/Cart4A50.cxx b/src/emucore/Cart4A50.cxx index bd91bc86e..76a6d0a9a 100644 --- a/src/emucore/Cart4A50.cxx +++ b/src/emucore/Cart4A50.cxx @@ -28,7 +28,13 @@ Cartridge4A50::Cartridge4A50(const uInt8* image, uInt32 size, const Settings& 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 // Supported file sizes are 32/64/128K, which are duplicated if necessary diff --git a/src/emucore/Cart4KSC.cxx b/src/emucore/Cart4KSC.cxx index 4df3afdc9..6aef5ad77 100644 --- a/src/emucore/Cart4KSC.cxx +++ b/src/emucore/Cart4KSC.cxx @@ -146,7 +146,6 @@ bool Cartridge4KSC::save(Serializer& out) const try { out.putString(name()); - out.putShort(myCurrentBank); out.putByteArray(myRAM, 128); } catch(...) @@ -166,7 +165,6 @@ bool Cartridge4KSC::load(Serializer& in) if(in.getString() != name()) return false; - myCurrentBank = in.getShort(); in.getByteArray(myRAM, 128); } catch(...) @@ -175,8 +173,5 @@ bool Cartridge4KSC::load(Serializer& in) return false; } - // Remember what bank we were in - bank(myCurrentBank); - return true; } diff --git a/src/emucore/Cart4KSC.hxx b/src/emucore/Cart4KSC.hxx index 101418e44..3c3bf4184 100644 --- a/src/emucore/Cart4KSC.hxx +++ b/src/emucore/Cart4KSC.hxx @@ -29,8 +29,7 @@ class System; #endif /** - Cartridge class used for 4KSC games with - 128 bytes of RAM. There are two 4K banks. + Cartridge class used for 4K games with 128 bytes of RAM. */ class Cartridge4KSC : public Cartridge @@ -130,15 +129,12 @@ class Cartridge4KSC : public Cartridge 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 + @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: - // Indicates which bank is currently active - uInt16 myCurrentBank; - // The 8K ROM image of the cartridge uInt8 myImage[4096]; diff --git a/src/emucore/CartAR.cxx b/src/emucore/CartAR.cxx index c028a7f50..4a1c1f000 100644 --- a/src/emucore/CartAR.cxx +++ b/src/emucore/CartAR.cxx @@ -28,7 +28,14 @@ CartridgeAR::CartridgeAR(const uInt8* image, uInt32 size, const Settings& settings) : Cartridge(settings), 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 myLoadImages = new uInt8[mySize]; @@ -69,9 +76,9 @@ void CartridgeAR::reset() // Initialize SC BIOS ROM initializeROM(); + myWriteEnabled = false; myPower = true; myPowerRomCycle = mySystem->cycles(); - myWriteEnabled = false; myDataHoldRegister = 0; myNumberOfDistinctAccesses = 0; diff --git a/src/emucore/CartAR.hxx b/src/emucore/CartAR.hxx index ac51221eb..e589564c9 100644 --- a/src/emucore/CartAR.hxx +++ b/src/emucore/CartAR.hxx @@ -225,6 +225,7 @@ class CartridgeAR : public Cartridge // Indicates if a write is pending or not bool myWritePending; + // Indicates which bank is currently active uInt16 myCurrentBank; // Fake SC-BIOS code to simulate the Supercharger load bars diff --git a/src/emucore/CartBF.cxx b/src/emucore/CartBF.cxx index ab241566a..564702424 100644 --- a/src/emucore/CartBF.cxx +++ b/src/emucore/CartBF.cxx @@ -24,7 +24,8 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeBF::CartridgeBF(const uInt8* image, uInt32 size, const Settings& settings) - : Cartridge(settings) + : Cartridge(settings), + myCurrentBank(0) { // Copy the ROM image into my buffer memcpy(myImage, image, BSPF_min(262144u, size)); diff --git a/src/emucore/CartBF.hxx b/src/emucore/CartBF.hxx index 3d5235bf7..187ec8890 100644 --- a/src/emucore/CartBF.hxx +++ b/src/emucore/CartBF.hxx @@ -156,12 +156,12 @@ class CartridgeBF : public Cartridge bool poke(uInt16 address, uInt8 value) override; private: - // Indicates which bank is currently active - uInt16 myCurrentBank; - // The 256K ROM image of the cartridge uInt8 myImage[64 * 4096]; + // Indicates which bank is currently active + uInt16 myCurrentBank; + private: // Following constructors and assignment operators not supported CartridgeBF() = delete; diff --git a/src/emucore/CartBFSC.cxx b/src/emucore/CartBFSC.cxx index 7a69e47f9..746ca6964 100644 --- a/src/emucore/CartBFSC.cxx +++ b/src/emucore/CartBFSC.cxx @@ -24,7 +24,8 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeBFSC::CartridgeBFSC(const uInt8* image, uInt32 size, const Settings& settings) - : Cartridge(settings) + : Cartridge(settings), + myCurrentBank(0) { // Copy the ROM image into my buffer memcpy(myImage, image, BSPF_min(262144u, size)); diff --git a/src/emucore/CartBFSC.hxx b/src/emucore/CartBFSC.hxx index 567ae7a5b..faadc6cfb 100644 --- a/src/emucore/CartBFSC.hxx +++ b/src/emucore/CartBFSC.hxx @@ -155,15 +155,15 @@ class CartridgeBFSC : public Cartridge bool poke(uInt16 address, uInt8 value) override; private: - // Indicates which bank is currently active - uInt16 myCurrentBank; - // The 256K ROM image of the cartridge uInt8 myImage[64 * 4096]; // The 128 bytes of RAM uInt8 myRAM[128]; + // Indicates which bank is currently active + uInt16 myCurrentBank; + private: // Following constructors and assignment operators not supported CartridgeBFSC() = delete; diff --git a/src/emucore/CartCM.cxx b/src/emucore/CartCM.cxx index c8ab4b9b3..7cd4b3c00 100644 --- a/src/emucore/CartCM.cxx +++ b/src/emucore/CartCM.cxx @@ -26,15 +26,15 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 memcpy(myImage, image, BSPF_min(16384u, size)); createCodeAccessBase(16384); - // On powerup, portA is all 1's, so the last bank of ROM is enabled and - // RAM is disabled - mySWCHA = 0xff; + // On powerup, the last bank of ROM is enabled and RAM is disabled myStartBank = mySWCHA & 0x3; } diff --git a/src/emucore/CartCM.hxx b/src/emucore/CartCM.hxx index a2492f4fe..1c51bacc6 100644 --- a/src/emucore/CartCM.hxx +++ b/src/emucore/CartCM.hxx @@ -242,9 +242,6 @@ class CartridgeCM : public Cartridge // The CompuMate device which interacts with this cartridge shared_ptr myCompuMate; - // Indicates which bank is currently active - uInt16 myCurrentBank; - // The 16K ROM image of the cartridge uInt8 myImage[16384]; @@ -254,7 +251,10 @@ class CartridgeCM : public Cartridge // Current copy of SWCHA (controls ROM/RAM accesses) uInt8 mySWCHA; - private: + // Indicates which bank is currently active + uInt16 myCurrentBank; + +private: // Following constructors and assignment operators not supported CartridgeCM() = delete; CartridgeCM(const CartridgeCM&) = delete; diff --git a/src/emucore/CartCTY.cxx b/src/emucore/CartCTY.cxx index 6c646527b..796058e99 100644 --- a/src/emucore/CartCTY.cxx +++ b/src/emucore/CartCTY.cxx @@ -35,7 +35,8 @@ CartridgeCTY::CartridgeCTY(const uInt8* image, uInt32 size, const OSystem& osyst myRandomNumber(0x2B435044), myRamAccessTimeout(0), mySystemCycles(0), - myFractionalClocks(0.0) + myFractionalClocks(0.0), + myCurrentBank(0) { // Copy the ROM image into my buffer memcpy(myImage, image, BSPF_min(32768u, size)); diff --git a/src/emucore/CartCTY.hxx b/src/emucore/CartCTY.hxx index 7403d4eaa..254f71bda 100644 --- a/src/emucore/CartCTY.hxx +++ b/src/emucore/CartCTY.hxx @@ -272,9 +272,6 @@ class CartridgeCTY : public Cartridge // OSsytem currently in use const OSystem& myOSystem; - // Indicates which bank is currently active - uInt16 myCurrentBank; - // The 32K ROM image of the cartridge uInt8 myImage[32768]; @@ -313,6 +310,9 @@ class CartridgeCTY : public Cartridge // Fractional DPC music OSC clocks unused during the last update double myFractionalClocks; + // Indicates which bank is currently active + uInt16 myCurrentBank; + private: // Following constructors and assignment operators not supported CartridgeCTY() = delete; diff --git a/src/emucore/CartDF.cxx b/src/emucore/CartDF.cxx index 1ba9b9901..063e6c139 100644 --- a/src/emucore/CartDF.cxx +++ b/src/emucore/CartDF.cxx @@ -24,7 +24,8 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeDF::CartridgeDF(const uInt8* image, uInt32 size, const Settings& settings) - : Cartridge(settings) + : Cartridge(settings), + myCurrentBank(0) { // Copy the ROM image into my buffer memcpy(myImage, image, BSPF_min(131072u, size)); diff --git a/src/emucore/CartDF.hxx b/src/emucore/CartDF.hxx index fba60b105..3cfac6827 100644 --- a/src/emucore/CartDF.hxx +++ b/src/emucore/CartDF.hxx @@ -156,13 +156,13 @@ class CartridgeDF : public Cartridge bool poke(uInt16 address, uInt8 value) override; private: - // Indicates which bank is currently active - uInt16 myCurrentBank; - // The 128K ROM image of the cartridge uInt8 myImage[32 * 4096]; - private: + // Indicates which bank is currently active + uInt16 myCurrentBank; + +private: // Following constructors and assignment operators not supported CartridgeDF() = delete; CartridgeDF(const CartridgeDF&) = delete; diff --git a/src/emucore/CartDFSC.cxx b/src/emucore/CartDFSC.cxx index 0d4dc0303..366cfd505 100644 --- a/src/emucore/CartDFSC.cxx +++ b/src/emucore/CartDFSC.cxx @@ -24,7 +24,8 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeDFSC::CartridgeDFSC(const uInt8* image, uInt32 size, const Settings& settings) - : Cartridge(settings) + : Cartridge(settings), + myCurrentBank(0) { // Copy the ROM image into my buffer memcpy(myImage, image, BSPF_min(131072u, size)); diff --git a/src/emucore/CartDFSC.hxx b/src/emucore/CartDFSC.hxx index e2a0e2a77..1d6c5d16b 100644 --- a/src/emucore/CartDFSC.hxx +++ b/src/emucore/CartDFSC.hxx @@ -155,15 +155,15 @@ class CartridgeDFSC : public Cartridge bool poke(uInt16 address, uInt8 value) override; private: - // Indicates which bank is currently active - uInt16 myCurrentBank; - // The 128K ROM image of the cartridge uInt8 myImage[32 * 4096]; // The 128 bytes of RAM uInt8 myRAM[128]; + // Indicates which bank is currently active + uInt16 myCurrentBank; + private: // Following constructors and assignment operators not supported CartridgeDFSC() = delete; diff --git a/src/emucore/CartDPC.cxx b/src/emucore/CartDPC.cxx index 1297a9078..5fc71905b 100644 --- a/src/emucore/CartDPC.cxx +++ b/src/emucore/CartDPC.cxx @@ -28,7 +28,8 @@ CartridgeDPC::CartridgeDPC(const uInt8* image, uInt32 size, : Cartridge(settings), mySize(size), mySystemCycles(0), - myFractionalClocks(0.0) + myFractionalClocks(0.0), + myCurrentBank(0) { // Make a copy of the entire image memcpy(myImage, image, BSPF_min(size, 8192u + 2048u + 256u)); diff --git a/src/emucore/CartDPC.hxx b/src/emucore/CartDPC.hxx index f40091f65..7c0058c4b 100644 --- a/src/emucore/CartDPC.hxx +++ b/src/emucore/CartDPC.hxx @@ -191,9 +191,6 @@ class CartridgeDPC : public Cartridge // Pointer to the 2K display ROM image of the cartridge uInt8* myDisplayImage; - // Indicates which bank is currently active - uInt16 myCurrentBank; - // The top registers for the data fetchers uInt8 myTops[8]; @@ -218,6 +215,9 @@ class CartridgeDPC : public Cartridge // Fractional DPC music OSC clocks unused during the last update double myFractionalClocks; + // Indicates which bank is currently active + uInt16 myCurrentBank; + private: // Following constructors and assignment operators not supported CartridgeDPC() = delete; diff --git a/src/emucore/CartDPCPlus.cxx b/src/emucore/CartDPCPlus.cxx index 4380e2ab1..4f6747070 100644 --- a/src/emucore/CartDPCPlus.cxx +++ b/src/emucore/CartDPCPlus.cxx @@ -35,7 +35,8 @@ CartridgeDPCPlus::CartridgeDPCPlus(const uInt8* image, uInt32 size, myLDAimmediate(false), myParameterPointer(0), mySystemCycles(0), - myFractionalClocks(0.0) + myFractionalClocks(0.0), + myCurrentBank(0) { // Store image, making sure it's at least 29KB uInt32 minsize = 4096 * 6 + 4096 + 1024 + 255; diff --git a/src/emucore/CartDPCPlus.hxx b/src/emucore/CartDPCPlus.hxx index 060153ee5..bf5875388 100644 --- a/src/emucore/CartDPCPlus.hxx +++ b/src/emucore/CartDPCPlus.hxx @@ -222,9 +222,6 @@ class CartridgeDPCPlus : public Cartridge // Pointer to the 1K frequency table uInt8* myFrequencyImage; - // Indicates which bank is currently active - uInt16 myCurrentBank; - // The top registers for the data fetchers uInt8 myTops[8]; @@ -270,6 +267,9 @@ class CartridgeDPCPlus : public Cartridge // Fractional DPC music OSC clocks unused during the last update double myFractionalClocks; + // Indicates which bank is currently active + uInt16 myCurrentBank; + private: // Following constructors and assignment operators not supported CartridgeDPCPlus() = delete; diff --git a/src/emucore/CartE7.cxx b/src/emucore/CartE7.cxx index 727bee60e..3cf76b2b7 100644 --- a/src/emucore/CartE7.cxx +++ b/src/emucore/CartE7.cxx @@ -24,7 +24,8 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeE7::CartridgeE7(const uInt8* image, uInt32 size, const Settings& settings) - : Cartridge(settings) + : Cartridge(settings), + myCurrentRAM(0) { // Copy the ROM image into my buffer memcpy(myImage, image, BSPF_min(16384u, size)); diff --git a/src/emucore/CartE7.hxx b/src/emucore/CartE7.hxx index c7b9c2b54..59f813139 100644 --- a/src/emucore/CartE7.hxx +++ b/src/emucore/CartE7.hxx @@ -189,18 +189,18 @@ class CartridgeE7 : public Cartridge void bankRAM(uInt16 bank); 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 uInt8 myImage[16384]; // The 2048 bytes of RAM 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: // Following constructors and assignment operators not supported CartridgeE7() = delete; diff --git a/src/emucore/CartEF.cxx b/src/emucore/CartEF.cxx index db8452b48..ec75acc25 100644 --- a/src/emucore/CartEF.cxx +++ b/src/emucore/CartEF.cxx @@ -24,7 +24,8 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeEF::CartridgeEF(const uInt8* image, uInt32 size, const Settings& settings) - : Cartridge(settings) + : Cartridge(settings), + myCurrentBank(0) { // Copy the ROM image into my buffer memcpy(myImage, image, BSPF_min(65536u, size)); diff --git a/src/emucore/CartEF.hxx b/src/emucore/CartEF.hxx index dcca3c72e..5469b5160 100644 --- a/src/emucore/CartEF.hxx +++ b/src/emucore/CartEF.hxx @@ -159,12 +159,12 @@ class CartridgeEF : public Cartridge bool poke(uInt16 address, uInt8 value) override; private: - // Indicates which bank is currently active - uInt16 myCurrentBank; - // The 64K ROM image of the cartridge uInt8 myImage[65536]; + // Indicates which bank is currently active + uInt16 myCurrentBank; + private: // Following constructors and assignment operators not supported CartridgeEF() = delete; diff --git a/src/emucore/CartEFSC.cxx b/src/emucore/CartEFSC.cxx index 1bdb49ffa..930ee0264 100644 --- a/src/emucore/CartEFSC.cxx +++ b/src/emucore/CartEFSC.cxx @@ -17,14 +17,13 @@ // $Id$ //============================================================================ -#include - #include "System.hxx" #include "CartEFSC.hxx" // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeEFSC::CartridgeEFSC(const uInt8* image, uInt32 size, const Settings& settings) - : Cartridge(settings) + : Cartridge(settings), + myCurrentBank(0) { // Copy the ROM image into my buffer memcpy(myImage, image, BSPF_min(65536u, size)); diff --git a/src/emucore/CartEFSC.hxx b/src/emucore/CartEFSC.hxx index 8f1ae63c1..577e17eea 100644 --- a/src/emucore/CartEFSC.hxx +++ b/src/emucore/CartEFSC.hxx @@ -159,15 +159,15 @@ class CartridgeEFSC : public Cartridge bool poke(uInt16 address, uInt8 value) override; private: - // Indicates which bank is currently active - uInt16 myCurrentBank; - // The 64K ROM image of the cartridge uInt8 myImage[65536]; // The 128 bytes of RAM uInt8 myRAM[128]; + // Indicates which bank is currently active + uInt16 myCurrentBank; + private: // Following constructors and assignment operators not supported CartridgeEFSC() = delete; diff --git a/src/emucore/CartF0.cxx b/src/emucore/CartF0.cxx index 0474c3e7a..5697e6ed7 100644 --- a/src/emucore/CartF0.cxx +++ b/src/emucore/CartF0.cxx @@ -24,7 +24,8 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeF0::CartridgeF0(const uInt8* image, uInt32 size, const Settings& settings) - : Cartridge(settings) + : Cartridge(settings), + myCurrentBank(0) { // Copy the ROM image into my buffer memcpy(myImage, image, BSPF_min(65536u, size)); diff --git a/src/emucore/CartF0.hxx b/src/emucore/CartF0.hxx index c99c44ff8..a8d7aac91 100644 --- a/src/emucore/CartF0.hxx +++ b/src/emucore/CartF0.hxx @@ -162,12 +162,12 @@ class CartridgeF0 : public Cartridge void incbank(); private: - // Indicates which bank is currently active - uInt16 myCurrentBank; - // The 64K ROM image of the cartridge uInt8 myImage[65536]; + // Indicates which bank is currently active + uInt16 myCurrentBank; + private: // Following constructors and assignment operators not supported CartridgeF0() = delete; diff --git a/src/emucore/CartF4.cxx b/src/emucore/CartF4.cxx index b260079c7..4ffd6472d 100644 --- a/src/emucore/CartF4.cxx +++ b/src/emucore/CartF4.cxx @@ -25,7 +25,8 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeF4::CartridgeF4(const uInt8* image, uInt32 size, const Settings& settings) - : Cartridge(settings) + : Cartridge(settings), + myCurrentBank(0) { // Copy the ROM image into my buffer memcpy(myImage, image, BSPF_min(32768u, size)); diff --git a/src/emucore/CartF4.hxx b/src/emucore/CartF4.hxx index 95dc8796d..7611f4577 100644 --- a/src/emucore/CartF4.hxx +++ b/src/emucore/CartF4.hxx @@ -155,12 +155,12 @@ class CartridgeF4 : public Cartridge bool poke(uInt16 address, uInt8 value) override; private: - // Indicates which bank is currently active - uInt16 myCurrentBank; - // The 32K ROM image of the cartridge uInt8 myImage[32768]; + // Indicates which bank is currently active + uInt16 myCurrentBank; + private: // Following constructors and assignment operators not supported CartridgeF4() = delete; diff --git a/src/emucore/CartF4SC.cxx b/src/emucore/CartF4SC.cxx index b92bbeb39..2998f15e6 100644 --- a/src/emucore/CartF4SC.cxx +++ b/src/emucore/CartF4SC.cxx @@ -24,7 +24,8 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeF4SC::CartridgeF4SC(const uInt8* image, uInt32 size, const Settings& settings) - : Cartridge(settings) + : Cartridge(settings), + myCurrentBank(0) { // Copy the ROM image into my buffer memcpy(myImage, image, BSPF_min(32768u, size)); diff --git a/src/emucore/CartF4SC.hxx b/src/emucore/CartF4SC.hxx index fa0c83738..3fda8db15 100644 --- a/src/emucore/CartF4SC.hxx +++ b/src/emucore/CartF4SC.hxx @@ -155,15 +155,15 @@ class CartridgeF4SC : public Cartridge bool poke(uInt16 address, uInt8 value) override; private: - // Indicates which bank is currently active - uInt16 myCurrentBank; - // The 32K ROM image of the cartridge uInt8 myImage[32768]; // The 128 bytes of RAM uInt8 myRAM[128]; + // Indicates which bank is currently active + uInt16 myCurrentBank; + private: // Following constructors and assignment operators not supported CartridgeF4SC() = delete; diff --git a/src/emucore/CartF6.cxx b/src/emucore/CartF6.cxx index 3a103b29c..715c7dcb2 100644 --- a/src/emucore/CartF6.cxx +++ b/src/emucore/CartF6.cxx @@ -24,7 +24,8 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeF6::CartridgeF6(const uInt8* image, uInt32 size, const Settings& settings) - : Cartridge(settings) + : Cartridge(settings), + myCurrentBank(0) { // Copy the ROM image into my buffer memcpy(myImage, image, BSPF_min(16384u, size)); diff --git a/src/emucore/CartF6.hxx b/src/emucore/CartF6.hxx index e2351c209..27d1fcc3c 100644 --- a/src/emucore/CartF6.hxx +++ b/src/emucore/CartF6.hxx @@ -155,12 +155,12 @@ class CartridgeF6 : public Cartridge bool poke(uInt16 address, uInt8 value) override; private: - // Indicates which bank is currently active - uInt16 myCurrentBank; - // The 16K ROM image of the cartridge uInt8 myImage[16384]; + // Indicates which bank is currently active + uInt16 myCurrentBank; + private: // Following constructors and assignment operators not supported CartridgeF6() = delete; diff --git a/src/emucore/CartF6SC.cxx b/src/emucore/CartF6SC.cxx index bbeb687f4..afe8cb97a 100644 --- a/src/emucore/CartF6SC.cxx +++ b/src/emucore/CartF6SC.cxx @@ -24,7 +24,8 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeF6SC::CartridgeF6SC(const uInt8* image, uInt32 size, const Settings& settings) - : Cartridge(settings) + : Cartridge(settings), + myCurrentBank(0) { // Copy the ROM image into my buffer memcpy(myImage, image, BSPF_min(16384u, size)); diff --git a/src/emucore/CartF6SC.hxx b/src/emucore/CartF6SC.hxx index af1878b87..adc499692 100644 --- a/src/emucore/CartF6SC.hxx +++ b/src/emucore/CartF6SC.hxx @@ -155,15 +155,15 @@ class CartridgeF6SC : public Cartridge bool poke(uInt16 address, uInt8 value) override; private: - // Indicates which bank is currently active - uInt16 myCurrentBank; - // The 16K ROM image of the cartridge uInt8 myImage[16384]; // The 128 bytes of RAM uInt8 myRAM[128]; + // Indicates which bank is currently active + uInt16 myCurrentBank; + private: // Following constructors and assignment operators not supported CartridgeF6SC() = delete; diff --git a/src/emucore/CartF8.cxx b/src/emucore/CartF8.cxx index 4555ab216..164f176ab 100644 --- a/src/emucore/CartF8.cxx +++ b/src/emucore/CartF8.cxx @@ -25,7 +25,8 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeF8::CartridgeF8(const uInt8* image, uInt32 size, const string& md5, const Settings& settings) - : Cartridge(settings) + : Cartridge(settings), + myCurrentBank(0) { // Copy the ROM image into my buffer memcpy(myImage, image, BSPF_min(8192u, size)); diff --git a/src/emucore/CartF8.hxx b/src/emucore/CartF8.hxx index befe02f34..632fb5f09 100644 --- a/src/emucore/CartF8.hxx +++ b/src/emucore/CartF8.hxx @@ -157,12 +157,12 @@ class CartridgeF8 : public Cartridge bool poke(uInt16 address, uInt8 value) override; private: - // Indicates which bank is currently active - uInt16 myCurrentBank; - // The 8K ROM image of the cartridge uInt8 myImage[8192]; + // Indicates which bank is currently active + uInt16 myCurrentBank; + private: // Following constructors and assignment operators not supported CartridgeF8() = delete; diff --git a/src/emucore/CartF8SC.cxx b/src/emucore/CartF8SC.cxx index 3230634e0..e5b9ee197 100644 --- a/src/emucore/CartF8SC.cxx +++ b/src/emucore/CartF8SC.cxx @@ -24,7 +24,8 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeF8SC::CartridgeF8SC(const uInt8* image, uInt32 size, const Settings& settings) - : Cartridge(settings) + : Cartridge(settings), + myCurrentBank(0) { // Copy the ROM image into my buffer memcpy(myImage, image, BSPF_min(8192u, size)); diff --git a/src/emucore/CartF8SC.hxx b/src/emucore/CartF8SC.hxx index 51f9298c5..8d52cfa51 100644 --- a/src/emucore/CartF8SC.hxx +++ b/src/emucore/CartF8SC.hxx @@ -155,15 +155,15 @@ class CartridgeF8SC : public Cartridge bool poke(uInt16 address, uInt8 value) override; private: - // Indicates which bank is currently active - uInt16 myCurrentBank; - // The 8K ROM image of the cartridge uInt8 myImage[8192]; // The 128 bytes of RAM uInt8 myRAM[128]; + // Indicates which bank is currently active + uInt16 myCurrentBank; + private: // Following constructors and assignment operators not supported CartridgeF8SC() = delete; diff --git a/src/emucore/CartFA.cxx b/src/emucore/CartFA.cxx index d62d316c7..1ba965fca 100644 --- a/src/emucore/CartFA.cxx +++ b/src/emucore/CartFA.cxx @@ -24,7 +24,8 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeFA::CartridgeFA(const uInt8* image, uInt32 size, const Settings& settings) - : Cartridge(settings) + : Cartridge(settings), + myCurrentBank(0) { // Copy the ROM image into my buffer memcpy(myImage, image, BSPF_min(12288u, size)); diff --git a/src/emucore/CartFA.hxx b/src/emucore/CartFA.hxx index 792291453..3529c4a24 100644 --- a/src/emucore/CartFA.hxx +++ b/src/emucore/CartFA.hxx @@ -155,15 +155,15 @@ class CartridgeFA : public Cartridge bool poke(uInt16 address, uInt8 value) override; private: - // Indicates which bank is currently active - uInt16 myCurrentBank; - // The 12K ROM image of the cartridge uInt8 myImage[12288]; // The 256 bytes of RAM on the cartridge uInt8 myRAM[256]; + // Indicates which bank is currently active + uInt16 myCurrentBank; + private: // Following constructors and assignment operators not supported CartridgeFA() = delete; diff --git a/src/emucore/CartFA2.cxx b/src/emucore/CartFA2.cxx index fe972dd3c..1ae014a27 100644 --- a/src/emucore/CartFA2.cxx +++ b/src/emucore/CartFA2.cxx @@ -17,8 +17,6 @@ // $Id$ //============================================================================ -#include - #include "OSystem.hxx" #include "Serializer.hxx" #include "System.hxx" @@ -29,7 +27,7 @@ CartridgeFA2::CartridgeFA2(const uInt8* image, uInt32 size, const OSystem& osyst : Cartridge(osystem.settings()), myOSystem(osystem), myRamAccessTimeout(0), - mySize(size) + myCurrentBank(0) { // 29/32K version of FA2 has valid data @ 1K - 29K if(size >= 29 * 1024) @@ -37,6 +35,8 @@ CartridgeFA2::CartridgeFA2(const uInt8* image, uInt32 size, const OSystem& osyst image += 1024; mySize = 28 * 1024; } + else + mySize = BSPF_min(28 * 1024u, size); // Copy the ROM image into my buffer memcpy(myImage, image, mySize); diff --git a/src/emucore/CartFA2.hxx b/src/emucore/CartFA2.hxx index d2f461e23..64700020e 100644 --- a/src/emucore/CartFA2.hxx +++ b/src/emucore/CartFA2.hxx @@ -193,12 +193,12 @@ class CartridgeFA2 : public Cartridge // OSsytem currently in use const OSystem& myOSystem; - // Indicates which bank is currently active - uInt16 myCurrentBank; - // The 24K/28K ROM image of the cartridge uInt8 myImage[28 * 1024]; + // Actual usable size of the ROM image + uInt32 mySize; + // The 256 bytes of RAM on the cartridge uInt8 myRAM[256]; @@ -212,8 +212,8 @@ class CartridgeFA2 : public Cartridge // of internal RAM to Harmony cart flash string myFlashFile; - // Size of the ROM image - uInt32 mySize; + // Indicates which bank is currently active + uInt16 myCurrentBank; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/CartMDM.cxx b/src/emucore/CartMDM.cxx index 2bced4388..ba8c581e9 100644 --- a/src/emucore/CartMDM.cxx +++ b/src/emucore/CartMDM.cxx @@ -27,6 +27,7 @@ CartridgeMDM::CartridgeMDM(const uInt8* image, uInt32 size, const Settings& sett : Cartridge(settings), myImage(nullptr), mySize(size), + myCurrentBank(0), myBankingDisabled(false) { // Allocate array for the ROM image diff --git a/src/emucore/CartMDM.hxx b/src/emucore/CartMDM.hxx index 750d3965d..d478bee67 100644 --- a/src/emucore/CartMDM.hxx +++ b/src/emucore/CartMDM.hxx @@ -172,12 +172,12 @@ class CartridgeMDM : public Cartridge // Size of the ROM image uInt32 mySize; - // Indicates which bank is currently active - uInt16 myCurrentBank; - // Previous Device's page access System::PageAccess myHotSpotPageAccess[8]; + // Indicates which bank is currently active + uInt16 myCurrentBank; + // Indicates whether banking has been disabled due to a bankswitch // above bank 127 bool myBankingDisabled; diff --git a/src/emucore/CartSB.cxx b/src/emucore/CartSB.cxx index 094f04972..8086c2356 100644 --- a/src/emucore/CartSB.cxx +++ b/src/emucore/CartSB.cxx @@ -27,7 +27,8 @@ CartridgeSB::CartridgeSB(const uInt8* image, uInt32 size, const Settings& settings) : Cartridge(settings), myImage(nullptr), - mySize(size) + mySize(size), + myCurrentBank(0) { // Allocate array for the ROM image myImage = new uInt8[mySize]; diff --git a/src/emucore/CartUA.cxx b/src/emucore/CartUA.cxx index 507845233..74a91e268 100644 --- a/src/emucore/CartUA.cxx +++ b/src/emucore/CartUA.cxx @@ -24,7 +24,8 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeUA::CartridgeUA(const uInt8* image, uInt32 size, const Settings& settings) - : Cartridge(settings) + : Cartridge(settings), + myCurrentBank(0) { // Copy the ROM image into my buffer memcpy(myImage, image, BSPF_min(8192u, size)); diff --git a/src/emucore/CartUA.hxx b/src/emucore/CartUA.hxx index a26ac284c..bfc757496 100644 --- a/src/emucore/CartUA.hxx +++ b/src/emucore/CartUA.hxx @@ -155,15 +155,15 @@ class CartridgeUA : public Cartridge bool poke(uInt16 address, uInt8 value) override; private: - // Indicates which bank is currently active - uInt16 myCurrentBank; - // The 8K ROM image of the cartridge uInt8 myImage[8192]; // Previous Device's page access System::PageAccess myHotSpotPageAccess; + // Indicates which bank is currently active + uInt16 myCurrentBank; + private: // Following constructors and assignment operators not supported CartridgeUA() = delete; diff --git a/src/emucore/CartWD.cxx b/src/emucore/CartWD.cxx index f8bc1e701..503c9808b 100644 --- a/src/emucore/CartWD.cxx +++ b/src/emucore/CartWD.cxx @@ -28,7 +28,10 @@ CartridgeWD::CartridgeWD(const uInt8* image, uInt32 size, const Settings& 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 memcpy(myImage, image, mySize); diff --git a/src/emucore/CartWD.hxx b/src/emucore/CartWD.hxx index 23fb84d67..a2670e726 100644 --- a/src/emucore/CartWD.hxx +++ b/src/emucore/CartWD.hxx @@ -214,15 +214,12 @@ class CartridgeWD : public Cartridge void segmentThree(uInt8 slice, bool map3bytes); private: - // Indicates which bank is currently active - uInt16 myCurrentBank; + // The 8K ROM image of the cartridge + uInt8 myImage[8195]; // Indicates the actual size of the ROM image (either 8K or 8K + 3) uInt32 mySize; - // The 8K ROM image of the cartridge - uInt8 myImage[8195]; - // The 64 bytes RAM of the cartridge uInt8 myRAM[64]; @@ -238,6 +235,9 @@ class CartridgeWD : public Cartridge // Indicates the bank we wish to switch to in the future uInt16 myPendingBank; + // Indicates which bank is currently active + uInt16 myCurrentBank; + // The arrangement of banks to use on each hotspot read struct BankOrg { uInt8 zero, one, two, three; diff --git a/src/emucore/CartX07.cxx b/src/emucore/CartX07.cxx index 4580fa86c..c3b118591 100644 --- a/src/emucore/CartX07.cxx +++ b/src/emucore/CartX07.cxx @@ -26,7 +26,8 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeX07::CartridgeX07(const uInt8* image, uInt32 size, const Settings& settings) - : Cartridge(settings) + : Cartridge(settings), + myCurrentBank(0) { // Copy the ROM image into my buffer memcpy(myImage, image, BSPF_min(65536u, size)); diff --git a/src/emucore/CartX07.hxx b/src/emucore/CartX07.hxx index e4f6bcc4a..7c3a254ab 100644 --- a/src/emucore/CartX07.hxx +++ b/src/emucore/CartX07.hxx @@ -165,12 +165,12 @@ class CartridgeX07 : public Cartridge bool poke(uInt16 address, uInt8 value) override; private: - // Indicates which bank is currently active - uInt16 myCurrentBank; - // The 64K ROM image of the cartridge uInt8 myImage[65536]; + // Indicates which bank is currently active + uInt16 myCurrentBank; + private: // Following constructors and assignment operators not supported CartridgeX07() = delete; diff --git a/src/emucore/CompuMate.cxx b/src/emucore/CompuMate.cxx index 6a1e81148..852ed4c90 100644 --- a/src/emucore/CompuMate.cxx +++ b/src/emucore/CompuMate.cxx @@ -25,7 +25,9 @@ CompuMate::CompuMate(const Console& console, const Event& event, const System& system) : myConsole(console), - myEvent(event) + myEvent(event), + myColumn(0), + myKeyTable(nullptr) { // These controller pointers will be retrieved by the Console, which will // also take ownership of them @@ -74,7 +76,7 @@ void CompuMate::update() rp.myDigitalPinState[Controller::Three] = true; rp.myDigitalPinState[Controller::Four] = true; - switch(myColumn) + switch(myColumn) // This is updated outside the class { case 0: if (myKeyTable[KBDK_7]) lp.myDigitalPinState[Controller::Six] = false; diff --git a/src/emucore/EventHandler.cxx b/src/emucore/EventHandler.cxx index 9edcc707c..fd47d511b 100644 --- a/src/emucore/EventHandler.cxx +++ b/src/emucore/EventHandler.cxx @@ -63,7 +63,9 @@ EventHandler::EventHandler(OSystem& osystem) myAllowAllDirectionsFlag(false), myFryingFlag(false), myUseCtrlKeyFlag(true), - mySkipMouseMotion(true) + mySkipMouseMotion(true), + myContSnapshotInterval(0), + myContSnapshotCounter(0) { // Erase the key mapping array for(int i = 0; i < KBDK_LAST; ++i) diff --git a/src/emucore/FrameBuffer.cxx b/src/emucore/FrameBuffer.cxx index 6f81f674e..d1e722669 100644 --- a/src/emucore/FrameBuffer.cxx +++ b/src/emucore/FrameBuffer.cxx @@ -49,7 +49,8 @@ FrameBuffer::FrameBuffer(OSystem& osystem) : myOSystem(osystem), myInitializedCount(0), - myPausedCount(0) + myPausedCount(0), + myCurrentModeList(nullptr) { myMsg.surface = myStatsMsg.surface = nullptr; myMsg.enabled = myStatsMsg.enabled = false; diff --git a/src/emucore/KidVid.cxx b/src/emucore/KidVid.cxx index f12e4eef5..27e170934 100644 --- a/src/emucore/KidVid.cxx +++ b/src/emucore/KidVid.cxx @@ -26,8 +26,16 @@ KidVid::KidVid(Jack jack, const Event& event, const System& system, const string& rommd5) : Controller(jack, event, system, Controller::KidVid), myEnabled(myJack == Right), + mySampleFile(nullptr), + mySharedSampleFile(nullptr), myFileOpened(false), + myTapeBusy(false), + myFilePointer(0), mySongCounter(0), + myBeep(false), + mySharedData(false), + mySampleByte(0), + myGame(0), myTape(0), myIdx(0), myBlock(0), diff --git a/src/emucore/M6502.cxx b/src/emucore/M6502.cxx index 333c897c5..4e9b32b53 100644 --- a/src/emucore/M6502.cxx +++ b/src/emucore/M6502.cxx @@ -49,6 +49,8 @@ M6502::M6502(const Settings& settings) : myExecutionStatus(0), mySystem(nullptr), 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), myNumberOfDistinctAccesses(0), myLastAddress(0), diff --git a/src/emucore/M6502.hxx b/src/emucore/M6502.hxx index 01a972779..f47b16598 100644 --- a/src/emucore/M6502.hxx +++ b/src/emucore/M6502.hxx @@ -273,21 +273,6 @@ class M6502 : public Serializable void interruptHandler(); 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 handled such as stopping execution, fatal errors, maskable interrupts @@ -308,6 +293,21 @@ class M6502 : public Serializable /// Reference to the settings 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 bool myLastAccessWasRead; diff --git a/src/emucore/M6532.cxx b/src/emucore/M6532.cxx index 93398f7f6..4d4eb00f8 100644 --- a/src/emucore/M6532.cxx +++ b/src/emucore/M6532.cxx @@ -31,6 +31,9 @@ M6532::M6532(const Console& console, const Settings& settings) : myConsole(console), mySettings(settings), + myTimer(0), myIntervalShift(0), myCyclesWhenTimerSet(0), + myDDRA(0), myDDRB(0), myOutA(0), myOutB(0), + myInterruptFlag(false), myTimerFlagValid(false), myEdgeDetectPositive(false) { diff --git a/src/gui/DialogContainer.cxx b/src/gui/DialogContainer.cxx index cee47da8f..cbb3f371b 100644 --- a/src/gui/DialogContainer.cxx +++ b/src/gui/DialogContainer.cxx @@ -29,7 +29,12 @@ DialogContainer::DialogContainer(OSystem& osystem) : myOSystem(osystem), myBaseDialog(nullptr), - myTime(0) + myTime(0), + myKeyRepeatTime(0), + myClickRepeatTime(0), + myButtonRepeatTime(0), + myAxisRepeatTime(0), + myHatRepeatTime(0) { reset(); } diff --git a/src/gui/EventMappingWidget.cxx b/src/gui/EventMappingWidget.cxx index 21058dceb..588983ead 100644 --- a/src/gui/EventMappingWidget.cxx +++ b/src/gui/EventMappingWidget.cxx @@ -40,6 +40,10 @@ EventMappingWidget::EventMappingWidget(GuiObject* boss, const GUI::Font& font, myEventMode(mode), myActionSelected(-1), myRemapStatus(false), + myLastStick(0), + myLastAxis(0), + myLastHat(0), + myLastValue(0), myFirstTime(true) { const int fontHeight = font.getFontHeight(), diff --git a/src/gui/LauncherDialog.cxx b/src/gui/LauncherDialog.cxx index 958eb123a..9d69449d5 100644 --- a/src/gui/LauncherDialog.cxx +++ b/src/gui/LauncherDialog.cxx @@ -53,6 +53,7 @@ LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent, myOptionsButton(nullptr), myQuitButton(nullptr), myList(nullptr), + myPattern(nullptr), myRomInfoWidget(nullptr), mySelectedItem(0) { diff --git a/src/unix/FSNodePOSIX.cxx b/src/unix/FSNodePOSIX.cxx index 60916a8e6..de939ddfc 100644 --- a/src/unix/FSNodePOSIX.cxx +++ b/src/unix/FSNodePOSIX.cxx @@ -40,17 +40,19 @@ void FilesystemNodePOSIX::setFlags() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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) + : _isValid(true), + _isFile(false), + _isDirectory(true) { // Default to home directory _path = p.length() > 0 ? p : "~"; diff --git a/src/unix/FSNodePOSIX.hxx b/src/unix/FSNodePOSIX.hxx index 9a6834e12..ef0b42e9d 100644 --- a/src/unix/FSNodePOSIX.hxx +++ b/src/unix/FSNodePOSIX.hxx @@ -79,11 +79,11 @@ class FilesystemNodePOSIX : public AbstractFSNode AbstractFSNode* getParent() const override; protected: - string _displayName; string _path; - bool _isDirectory; - bool _isFile; + string _displayName; bool _isValid; + bool _isFile; + bool _isDirectory; private: /**