diff --git a/src/common/tv_filters/AtariNTSC.hxx b/src/common/tv_filters/AtariNTSC.hxx index 6cd24407f..e11c649ff 100644 --- a/src/common/tv_filters/AtariNTSC.hxx +++ b/src/common/tv_filters/AtariNTSC.hxx @@ -161,13 +161,13 @@ class AtariNTSC struct init_t { - std::array to_rgb; - std::array to_float; + std::array to_rgb{0.F}; + std::array to_float{0.F}; float contrast{0.F}; float brightness{0.F}; float artifacts{0.F}; float fringing{0.F}; - std::array kernel; + std::array kernel{0.F}; init_t() { to_rgb.fill(0.0); @@ -181,7 +181,7 @@ class AtariNTSC { int offset{0}; float negate{0.F}; - std::array kernel; + std::array kernel{0.F}; }; static const std::array atari_ntsc_pixels; diff --git a/src/debugger/gui/AudioWidget.hxx b/src/debugger/gui/AudioWidget.hxx index 8f8cd2bf4..072811463 100644 --- a/src/debugger/gui/AudioWidget.hxx +++ b/src/debugger/gui/AudioWidget.hxx @@ -40,10 +40,10 @@ class AudioWidget : public Widget, public CommandSender kAUDVID }; - DataGridWidget* myAudF; - DataGridWidget* myAudC; - DataGridWidget* myAudV; - StaticTextWidget* myAudEffV; + DataGridWidget* myAudF{nullptr}; + DataGridWidget* myAudC{nullptr}; + DataGridWidget* myAudV{nullptr}; + StaticTextWidget* myAudEffV{nullptr}; // Audio channels enum diff --git a/src/debugger/gui/BoosterWidget.hxx b/src/debugger/gui/BoosterWidget.hxx index 36aa2e0b0..5e66baa6f 100644 --- a/src/debugger/gui/BoosterWidget.hxx +++ b/src/debugger/gui/BoosterWidget.hxx @@ -31,7 +31,7 @@ class BoosterWidget : public ControllerWidget private: enum { kJUp = 0, kJDown, kJLeft, kJRight, kJFire, kJBooster, kJTrigger }; - std::array myPins; + std::array myPins{nullptr}; static constexpr std::array ourPinNo = {{ Controller::DigitalPin::One, Controller::DigitalPin::Two, Controller::DigitalPin::Three, Controller::DigitalPin::Four, diff --git a/src/debugger/gui/Cart0840Widget.hxx b/src/debugger/gui/Cart0840Widget.hxx index 6e3e95127..6e47cb353 100644 --- a/src/debugger/gui/Cart0840Widget.hxx +++ b/src/debugger/gui/Cart0840Widget.hxx @@ -34,7 +34,7 @@ class Cartridge0840Widget : public CartDebugWidget private: Cartridge0840& myCart; - PopUpWidget* myBank; + PopUpWidget* myBank{nullptr}; enum { kBankChanged = 'bkCH' }; diff --git a/src/debugger/gui/Cart3EPlusWidget.hxx b/src/debugger/gui/Cart3EPlusWidget.hxx index 9d3b57908..111461b10 100644 --- a/src/debugger/gui/Cart3EPlusWidget.hxx +++ b/src/debugger/gui/Cart3EPlusWidget.hxx @@ -40,10 +40,10 @@ class Cartridge3EPlusWidget : public CartDebugWidget private: Cartridge3EPlus& myCart; - std::array myBankNumber; - std::array myBankType; - std::array myBankCommit; - std::array myBankState; + std::array myBankNumber{nullptr}; + std::array myBankType{nullptr}; + std::array myBankCommit{nullptr}; + std::array myBankState{nullptr}; struct CartState { ByteArray internalram; diff --git a/src/debugger/gui/Cart3EWidget.hxx b/src/debugger/gui/Cart3EWidget.hxx index ee7c96189..f18d39475 100644 --- a/src/debugger/gui/Cart3EWidget.hxx +++ b/src/debugger/gui/Cart3EWidget.hxx @@ -34,9 +34,9 @@ class Cartridge3EWidget : public CartDebugWidget private: Cartridge3E& myCart; - const uInt32 myNumRomBanks; - const uInt32 myNumRamBanks; - PopUpWidget *myROMBank, *myRAMBank; + const uInt32 myNumRomBanks{0}; + const uInt32 myNumRamBanks{0}; + PopUpWidget *myROMBank{nullptr}, *myRAMBank{nullptr}; struct CartState { ByteArray internalram; diff --git a/src/debugger/gui/Cart3FWidget.hxx b/src/debugger/gui/Cart3FWidget.hxx index 413b15fed..9cb8958f9 100644 --- a/src/debugger/gui/Cart3FWidget.hxx +++ b/src/debugger/gui/Cart3FWidget.hxx @@ -34,7 +34,7 @@ class Cartridge3FWidget : public CartDebugWidget private: Cartridge3F& myCart; - PopUpWidget* myBank; + PopUpWidget* myBank{nullptr}; enum { kBankChanged = 'bkCH' }; diff --git a/src/debugger/gui/Cart4A50Widget.hxx b/src/debugger/gui/Cart4A50Widget.hxx index 7eda17ca1..b32b53970 100644 --- a/src/debugger/gui/Cart4A50Widget.hxx +++ b/src/debugger/gui/Cart4A50Widget.hxx @@ -34,9 +34,9 @@ class Cartridge4A50Widget : public CartDebugWidget private: Cartridge4A50& myCart; - PopUpWidget *myROMLower, *myRAMLower; - PopUpWidget *myROMMiddle, *myRAMMiddle; - PopUpWidget *myROMHigh, *myRAMHigh; + PopUpWidget *myROMLower{nullptr}, *myRAMLower{nullptr}; + PopUpWidget *myROMMiddle{nullptr}, *myRAMMiddle{nullptr}; + PopUpWidget *myROMHigh{nullptr}, *myRAMHigh{nullptr}; enum { kROMLowerChanged = 'rmLW', diff --git a/src/debugger/gui/CartARWidget.hxx b/src/debugger/gui/CartARWidget.hxx index 1ca38c3a4..ab05ca9ed 100644 --- a/src/debugger/gui/CartARWidget.hxx +++ b/src/debugger/gui/CartARWidget.hxx @@ -34,7 +34,7 @@ class CartridgeARWidget : public CartDebugWidget private: CartridgeAR& myCart; - PopUpWidget* myBank; + PopUpWidget* myBank{nullptr}; enum { kBankChanged = 'bkCH' }; diff --git a/src/debugger/gui/CartBFSCWidget.hxx b/src/debugger/gui/CartBFSCWidget.hxx index 47f51ca02..bec00c33b 100644 --- a/src/debugger/gui/CartBFSCWidget.hxx +++ b/src/debugger/gui/CartBFSCWidget.hxx @@ -34,11 +34,11 @@ class CartridgeBFSCWidget : public CartDebugWidget private: CartridgeBFSC& myCart; - PopUpWidget* myBank; + PopUpWidget* myBank{nullptr}; struct CartState { ByteArray internalram; - uInt16 bank; + uInt16 bank{0}; }; CartState myOldState; diff --git a/src/debugger/gui/CartBFWidget.hxx b/src/debugger/gui/CartBFWidget.hxx index bbf011a4a..903bcf6e2 100644 --- a/src/debugger/gui/CartBFWidget.hxx +++ b/src/debugger/gui/CartBFWidget.hxx @@ -34,7 +34,7 @@ class CartridgeBFWidget : public CartDebugWidget private: CartridgeBF& myCart; - PopUpWidget* myBank; + PopUpWidget* myBank{nullptr}; enum { kBankChanged = 'bkCH' }; diff --git a/src/debugger/gui/CartBUSWidget.hxx b/src/debugger/gui/CartBUSWidget.hxx index db9900472..e55723d0c 100644 --- a/src/debugger/gui/CartBUSWidget.hxx +++ b/src/debugger/gui/CartBUSWidget.hxx @@ -46,26 +46,26 @@ class CartridgeBUSWidget : public CartDebugWidget IntArray mwaves; IntArray mwavesizes; IntArray samplepointer; - uInt32 random; + uInt32 random{0}; ByteArray internalram; }; CartridgeBUS& myCart; - PopUpWidget* myBank; + PopUpWidget* myBank{nullptr}; - DataGridWidget* myDatastreamPointers; - DataGridWidget* myDatastreamIncrements; - DataGridWidget* myDatastreamPointers2; - DataGridWidget* myDatastreamIncrements2; - DataGridWidget* myAddressMaps; - DataGridWidget* myMusicCounters; - DataGridWidget* myMusicFrequencies; - DataGridWidget* myMusicWaveforms; - DataGridWidget* myMusicWaveformSizes; - DataGridWidget* mySamplePointer; - CheckboxWidget* myBusOverdrive; - CheckboxWidget* myDigitalSample; - std::array myDatastreamLabels; + DataGridWidget* myDatastreamPointers{nullptr}; + DataGridWidget* myDatastreamIncrements{nullptr}; + DataGridWidget* myDatastreamPointers2{nullptr}; + DataGridWidget* myDatastreamIncrements2{nullptr}; + DataGridWidget* myAddressMaps{nullptr}; + DataGridWidget* myMusicCounters{nullptr}; + DataGridWidget* myMusicFrequencies{nullptr}; + DataGridWidget* myMusicWaveforms{nullptr}; + DataGridWidget* myMusicWaveformSizes{nullptr}; + DataGridWidget* mySamplePointer{nullptr}; + CheckboxWidget* myBusOverdrive{nullptr}; + CheckboxWidget* myDigitalSample{nullptr}; + std::array myDatastreamLabels{nullptr}; CartState myOldState; enum { kBankChanged = 'bkCH' }; diff --git a/src/debugger/gui/CartCDFWidget.hxx b/src/debugger/gui/CartCDFWidget.hxx index 5d7e76429..4e1cdfeff 100644 --- a/src/debugger/gui/CartCDFWidget.hxx +++ b/src/debugger/gui/CartCDFWidget.hxx @@ -47,28 +47,28 @@ class CartridgeCDFWidget : public CartDebugWidget IntArray mwaves; IntArray mwavesizes; IntArray samplepointer; - uInt32 random; + uInt32 random{0}; ByteArray internalram; }; CartridgeCDF& myCart; - PopUpWidget* myBank; + PopUpWidget* myBank{nullptr}; - DataGridWidget* myDatastreamPointers; - DataGridWidget* myDatastreamIncrements; - DataGridWidget* myCommandStreamPointer; - DataGridWidget* myCommandStreamIncrement; - DataGridWidget* myJumpStreamPointers; - DataGridWidget* myJumpStreamIncrements; - DataGridWidget* myMusicCounters; - DataGridWidget* myMusicFrequencies; - DataGridWidget* myMusicWaveforms; - DataGridWidget* myMusicWaveformSizes; - DataGridWidget* mySamplePointer; - std::array myDatastreamLabels; + DataGridWidget* myDatastreamPointers{nullptr}; + DataGridWidget* myDatastreamIncrements{nullptr}; + DataGridWidget* myCommandStreamPointer{nullptr}; + DataGridWidget* myCommandStreamIncrement{nullptr}; + DataGridWidget* myJumpStreamPointers{nullptr}; + DataGridWidget* myJumpStreamIncrements{nullptr}; + DataGridWidget* myMusicCounters{nullptr}; + DataGridWidget* myMusicFrequencies{nullptr}; + DataGridWidget* myMusicWaveforms{nullptr}; + DataGridWidget* myMusicWaveformSizes{nullptr}; + DataGridWidget* mySamplePointer{nullptr}; + std::array myDatastreamLabels{nullptr}; - CheckboxWidget* myFastFetch; - CheckboxWidget* myDigitalSample; + CheckboxWidget* myFastFetch{nullptr}; + CheckboxWidget* myDigitalSample{nullptr}; CartState myOldState; enum { kBankChanged = 'bkCH' }; diff --git a/src/debugger/gui/CartCMWidget.hxx b/src/debugger/gui/CartCMWidget.hxx index b3bd4840f..30543fb65 100644 --- a/src/debugger/gui/CartCMWidget.hxx +++ b/src/debugger/gui/CartCMWidget.hxx @@ -38,21 +38,22 @@ class CartridgeCMWidget : public CartDebugWidget private: struct CartState { - uInt8 swcha; - uInt8 column; + uInt8 swcha{0}; + uInt8 column{0}; ByteArray internalram; - uInt16 bank; + uInt16 bank{0}; }; CartridgeCM& myCart; - PopUpWidget* myBank; + PopUpWidget* myBank{nullptr}; - ToggleBitWidget* mySWCHA; - DataGridWidget* myColumn; - CheckboxWidget *myAudIn, *myAudOut, *myIncrease, *myReset; - CheckboxWidget *myFunc, *myShift; - EditTextWidget* myRAM; - std::array myRow; + ToggleBitWidget* mySWCHA{nullptr}; + DataGridWidget* myColumn{nullptr}; + CheckboxWidget *myAudIn{nullptr}, *myAudOut{nullptr}, + *myIncrease{nullptr}, *myReset{nullptr}; + CheckboxWidget *myFunc{nullptr}, *myShift{nullptr}; + EditTextWidget* myRAM{nullptr}; + std::array myRow{nullptr}; CartState myOldState; diff --git a/src/debugger/gui/CartCTYWidget.hxx b/src/debugger/gui/CartCTYWidget.hxx index 5661f8fdc..4926f3a98 100644 --- a/src/debugger/gui/CartCTYWidget.hxx +++ b/src/debugger/gui/CartCTYWidget.hxx @@ -34,11 +34,11 @@ class CartridgeCTYWidget : public CartDebugWidget private: CartridgeCTY& myCart; - PopUpWidget* myBank; + PopUpWidget* myBank{nullptr}; struct CartState { ByteArray internalram; - uInt16 bank; + uInt16 bank{0}; }; CartState myOldState; diff --git a/src/debugger/gui/CartCVPlusWidget.hxx b/src/debugger/gui/CartCVPlusWidget.hxx index e4e0610dd..2fa390138 100644 --- a/src/debugger/gui/CartCVPlusWidget.hxx +++ b/src/debugger/gui/CartCVPlusWidget.hxx @@ -34,10 +34,10 @@ class CartridgeCVPlusWidget : public CartDebugWidget private: CartridgeCVPlus& myCart; - PopUpWidget* myBank; + PopUpWidget* myBank{nullptr}; struct CartState { ByteArray internalram; - uInt16 bank; + uInt16 bank{0}; }; CartState myOldState; diff --git a/src/debugger/gui/CartDASHWidget.hxx b/src/debugger/gui/CartDASHWidget.hxx index 04360d1c5..2a569fe0f 100644 --- a/src/debugger/gui/CartDASHWidget.hxx +++ b/src/debugger/gui/CartDASHWidget.hxx @@ -40,10 +40,10 @@ class CartridgeDASHWidget : public CartDebugWidget private: CartridgeDASH& myCart; - std::array myBankNumber; - std::array myBankType; - std::array myBankCommit; - std::array myBankState; + std::array myBankNumber{nullptr}; + std::array myBankType{nullptr}; + std::array myBankCommit{nullptr}; + std::array myBankState{nullptr}; struct CartState { ByteArray internalram; diff --git a/src/debugger/gui/CartDFSCWidget.hxx b/src/debugger/gui/CartDFSCWidget.hxx index 772c2e879..abd916306 100644 --- a/src/debugger/gui/CartDFSCWidget.hxx +++ b/src/debugger/gui/CartDFSCWidget.hxx @@ -34,11 +34,11 @@ class CartridgeDFSCWidget : public CartDebugWidget private: CartridgeDFSC& myCart; - PopUpWidget* myBank; + PopUpWidget* myBank{nullptr}; struct CartState { ByteArray internalram; - uInt16 bank; + uInt16 bank{0}; }; CartState myOldState; diff --git a/src/debugger/gui/CartDFWidget.hxx b/src/debugger/gui/CartDFWidget.hxx index 613f62ef7..4f813194c 100644 --- a/src/debugger/gui/CartDFWidget.hxx +++ b/src/debugger/gui/CartDFWidget.hxx @@ -34,7 +34,7 @@ class CartridgeDFWidget : public CartDebugWidget private: CartridgeDF& myCart; - PopUpWidget* myBank; + PopUpWidget* myBank{nullptr}; enum { kBankChanged = 'bkCH' }; diff --git a/src/debugger/gui/CartDPCPlusWidget.hxx b/src/debugger/gui/CartDPCPlusWidget.hxx index 314b236a9..6de671b79 100644 --- a/src/debugger/gui/CartDPCPlusWidget.hxx +++ b/src/debugger/gui/CartDPCPlusWidget.hxx @@ -45,26 +45,26 @@ class CartridgeDPCPlusWidget : public CartDebugWidget IntArray mcounters; IntArray mfreqs; IntArray mwaves; - uInt32 random; + uInt32 random{0}; ByteArray internalram; - uInt16 bank; + uInt16 bank{0}; }; CartridgeDPCPlus& myCart; - PopUpWidget* myBank; + PopUpWidget* myBank{nullptr}; - DataGridWidget* myTops; - DataGridWidget* myBottoms; - DataGridWidget* myCounters; - DataGridWidget* myFracCounters; - DataGridWidget* myFracIncrements; - DataGridWidget* myParameter; - DataGridWidget* myMusicCounters; - DataGridWidget* myMusicFrequencies; - DataGridWidget* myMusicWaveforms; - CheckboxWidget* myFastFetch; - CheckboxWidget* myIMLDA; - DataGridWidget* myRandom; + DataGridWidget* myTops{nullptr}; + DataGridWidget* myBottoms{nullptr}; + DataGridWidget* myCounters{nullptr}; + DataGridWidget* myFracCounters{nullptr}; + DataGridWidget* myFracIncrements{nullptr}; + DataGridWidget* myParameter{nullptr}; + DataGridWidget* myMusicCounters{nullptr}; + DataGridWidget* myMusicFrequencies{nullptr}; + DataGridWidget* myMusicWaveforms{nullptr}; + CheckboxWidget* myFastFetch{nullptr}; + CheckboxWidget* myIMLDA{nullptr}; + DataGridWidget* myRandom{nullptr}; CartState myOldState; diff --git a/src/debugger/gui/CartDPCWidget.hxx b/src/debugger/gui/CartDPCWidget.hxx index 6e05677e7..6ebce2e47 100644 --- a/src/debugger/gui/CartDPCWidget.hxx +++ b/src/debugger/gui/CartDPCWidget.hxx @@ -40,20 +40,20 @@ class CartridgeDPCWidget : public CartDebugWidget IntArray counters; ByteArray flags; BoolArray music; - uInt8 random; + uInt8 random{0}; ByteArray internalram; - uInt16 bank; + uInt16 bank{0}; }; CartridgeDPC& myCart; - PopUpWidget* myBank; + PopUpWidget* myBank{nullptr}; - DataGridWidget* myTops; - DataGridWidget* myBottoms; - DataGridWidget* myCounters; - DataGridWidget* myFlags; - DataGridWidget* myMusicMode; - DataGridWidget* myRandom; + DataGridWidget* myTops{nullptr}; + DataGridWidget* myBottoms{nullptr}; + DataGridWidget* myCounters{nullptr}; + DataGridWidget* myFlags{nullptr}; + DataGridWidget* myMusicMode{nullptr}; + DataGridWidget* myRandom{nullptr}; CartState myOldState; diff --git a/src/debugger/gui/CartDebugWidget.cxx b/src/debugger/gui/CartDebugWidget.cxx index 8f542e010..96f07e7f2 100644 --- a/src/debugger/gui/CartDebugWidget.cxx +++ b/src/debugger/gui/CartDebugWidget.cxx @@ -33,8 +33,9 @@ CartDebugWidget::CartDebugWidget(GuiObject* boss, const GUI::Font& lfont, myFontWidth(lfont.getMaxCharWidth()), myFontHeight(lfont.getFontHeight()), myLineHeight(lfont.getLineHeight()), - myButtonHeight(myLineHeight + 4), - myDesc(nullptr) { } + myButtonHeight(myLineHeight + 4) +{ +} // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - int CartDebugWidget::addBaseInformation(size_t bytes, const string& manufacturer, diff --git a/src/debugger/gui/CartDebugWidget.hxx b/src/debugger/gui/CartDebugWidget.hxx index 0b2d1af44..20775f202 100644 --- a/src/debugger/gui/CartDebugWidget.hxx +++ b/src/debugger/gui/CartDebugWidget.hxx @@ -77,12 +77,12 @@ class CartDebugWidget : public Widget, public CommandSender // These will be needed by most of the child classes; // we may as well make them protected variables - int myFontWidth, myFontHeight, myLineHeight, myButtonHeight; + int myFontWidth{0}, myFontHeight{0}, myLineHeight{0}, myButtonHeight{0}; ostringstream& buffer() { myBuffer.str(""); return myBuffer; } private: - StringListWidget* myDesc; + StringListWidget* myDesc{nullptr}; ostringstream myBuffer; private: diff --git a/src/debugger/gui/CartE0Widget.hxx b/src/debugger/gui/CartE0Widget.hxx index 94abe00b4..889642c7d 100644 --- a/src/debugger/gui/CartE0Widget.hxx +++ b/src/debugger/gui/CartE0Widget.hxx @@ -34,7 +34,7 @@ class CartridgeE0Widget : public CartDebugWidget private: CartridgeE0& myCart; - PopUpWidget *mySlice0, *mySlice1, *mySlice2; + PopUpWidget *mySlice0{nullptr}, *mySlice1{nullptr}, *mySlice2{nullptr}; enum { kSlice0Changed = 's0CH', diff --git a/src/debugger/gui/CartEFSCWidget.hxx b/src/debugger/gui/CartEFSCWidget.hxx index ede81f2e6..4fbe08683 100644 --- a/src/debugger/gui/CartEFSCWidget.hxx +++ b/src/debugger/gui/CartEFSCWidget.hxx @@ -34,11 +34,11 @@ class CartridgeEFSCWidget : public CartDebugWidget private: CartridgeEFSC& myCart; - PopUpWidget* myBank; + PopUpWidget* myBank{nullptr}; struct CartState { ByteArray internalram; - uInt16 bank; + uInt16 bank{0}; }; CartState myOldState; diff --git a/src/debugger/gui/CartEFWidget.hxx b/src/debugger/gui/CartEFWidget.hxx index 40b0b4d46..078e60bb5 100644 --- a/src/debugger/gui/CartEFWidget.hxx +++ b/src/debugger/gui/CartEFWidget.hxx @@ -34,7 +34,7 @@ class CartridgeEFWidget : public CartDebugWidget private: CartridgeEF& myCart; - PopUpWidget* myBank; + PopUpWidget* myBank{nullptr}; enum { kBankChanged = 'bkCH' }; diff --git a/src/debugger/gui/CartF0Widget.hxx b/src/debugger/gui/CartF0Widget.hxx index 136b066e8..2c2b98da8 100644 --- a/src/debugger/gui/CartF0Widget.hxx +++ b/src/debugger/gui/CartF0Widget.hxx @@ -34,7 +34,7 @@ class CartridgeF0Widget : public CartDebugWidget private: CartridgeF0& myCart; - PopUpWidget* myBank; + PopUpWidget* myBank{nullptr}; enum { kBankChanged = 'bkCH' }; diff --git a/src/debugger/gui/CartF4SCWidget.hxx b/src/debugger/gui/CartF4SCWidget.hxx index 58e8ea1d1..32b1b7733 100644 --- a/src/debugger/gui/CartF4SCWidget.hxx +++ b/src/debugger/gui/CartF4SCWidget.hxx @@ -34,11 +34,11 @@ class CartridgeF4SCWidget : public CartDebugWidget private: CartridgeF4SC& myCart; - PopUpWidget* myBank; + PopUpWidget* myBank{nullptr}; struct CartState { ByteArray internalram; - uInt16 bank; + uInt16 bank{0}; }; CartState myOldState; diff --git a/src/debugger/gui/CartF4Widget.hxx b/src/debugger/gui/CartF4Widget.hxx index 191c6a1c5..204e6c758 100644 --- a/src/debugger/gui/CartF4Widget.hxx +++ b/src/debugger/gui/CartF4Widget.hxx @@ -34,7 +34,7 @@ class CartridgeF4Widget : public CartDebugWidget private: CartridgeF4& myCart; - PopUpWidget* myBank; + PopUpWidget* myBank{nullptr}; enum { kBankChanged = 'bkCH' }; diff --git a/src/debugger/gui/CartF6SCWidget.hxx b/src/debugger/gui/CartF6SCWidget.hxx index 0c5188000..a5f572edd 100644 --- a/src/debugger/gui/CartF6SCWidget.hxx +++ b/src/debugger/gui/CartF6SCWidget.hxx @@ -35,10 +35,10 @@ class CartridgeF6SCWidget : public CartDebugWidget private: struct CartState { ByteArray internalram; - uInt16 bank; + uInt16 bank{0}; }; CartridgeF6SC& myCart; - PopUpWidget* myBank; + PopUpWidget* myBank{nullptr}; CartState myOldState; enum { kBankChanged = 'bkCH' }; diff --git a/src/debugger/gui/CartF6Widget.hxx b/src/debugger/gui/CartF6Widget.hxx index 5bf6e4551..13005e86e 100644 --- a/src/debugger/gui/CartF6Widget.hxx +++ b/src/debugger/gui/CartF6Widget.hxx @@ -34,7 +34,7 @@ class CartridgeF6Widget : public CartDebugWidget private: CartridgeF6& myCart; - PopUpWidget* myBank; + PopUpWidget* myBank{nullptr}; enum { kBankChanged = 'bkCH' }; diff --git a/src/debugger/gui/CartF8SCWidget.hxx b/src/debugger/gui/CartF8SCWidget.hxx index 821efb637..ed0912f16 100644 --- a/src/debugger/gui/CartF8SCWidget.hxx +++ b/src/debugger/gui/CartF8SCWidget.hxx @@ -34,11 +34,11 @@ class CartridgeF8SCWidget : public CartDebugWidget private: CartridgeF8SC& myCart; - PopUpWidget* myBank; + PopUpWidget* myBank{nullptr}; struct CartState { ByteArray internalram; - uInt16 bank; + uInt16 bank{0}; }; CartState myOldState; diff --git a/src/debugger/gui/CartF8Widget.hxx b/src/debugger/gui/CartF8Widget.hxx index 93ec94256..6accab62c 100644 --- a/src/debugger/gui/CartF8Widget.hxx +++ b/src/debugger/gui/CartF8Widget.hxx @@ -34,7 +34,7 @@ class CartridgeF8Widget : public CartDebugWidget private: CartridgeF8& myCart; - PopUpWidget* myBank; + PopUpWidget* myBank{nullptr}; enum { kBankChanged = 'bkCH' }; diff --git a/src/debugger/gui/CartFA2Widget.hxx b/src/debugger/gui/CartFA2Widget.hxx index db5045bd6..ebed7f883 100644 --- a/src/debugger/gui/CartFA2Widget.hxx +++ b/src/debugger/gui/CartFA2Widget.hxx @@ -35,12 +35,12 @@ class CartridgeFA2Widget : public CartDebugWidget private: CartridgeFA2& myCart; - PopUpWidget* myBank; - ButtonWidget *myFlashErase, *myFlashLoad, *myFlashSave; + PopUpWidget* myBank{nullptr}; + ButtonWidget *myFlashErase{nullptr}, *myFlashLoad{nullptr}, *myFlashSave{nullptr}; struct CartState { ByteArray internalram; - uInt16 bank; + uInt16 bank{0}; }; CartState myOldState; diff --git a/src/debugger/gui/CartFAWidget.hxx b/src/debugger/gui/CartFAWidget.hxx index 773683053..f148c37db 100644 --- a/src/debugger/gui/CartFAWidget.hxx +++ b/src/debugger/gui/CartFAWidget.hxx @@ -34,11 +34,11 @@ class CartridgeFAWidget : public CartDebugWidget private: CartridgeFA& myCart; - PopUpWidget* myBank; + PopUpWidget* myBank{nullptr}; struct CartState { ByteArray internalram; - uInt16 bank; + uInt16 bank{0}; }; CartState myOldState; diff --git a/src/debugger/gui/CartFCWidget.cxx b/src/debugger/gui/CartFCWidget.cxx index 22e8662c9..b356c846b 100644 --- a/src/debugger/gui/CartFCWidget.cxx +++ b/src/debugger/gui/CartFCWidget.cxx @@ -47,9 +47,8 @@ CartridgeFCWidget::CartridgeFCWidget( " ($FFF8 = " + Variant(i & 0b11).toString() + "/$FFF9 = " + Variant(i >> 2).toString() +")"); - - myBank = - new PopUpWidget(boss, _font, xpos, ypos - 2, _font.getStringWidth("7 ($FFF8 = 3/$FFF9 = 1)"), + myBank = new PopUpWidget(boss, _font, xpos, ypos - 2, + _font.getStringWidth("7 ($FFF8 = 3/$FFF9 = 1)"), myLineHeight, items, "Set bank ", 0, kBankChanged); myBank->setTarget(this); diff --git a/src/debugger/gui/CartFCWidget.hxx b/src/debugger/gui/CartFCWidget.hxx index b91f6327b..62583b442 100644 --- a/src/debugger/gui/CartFCWidget.hxx +++ b/src/debugger/gui/CartFCWidget.hxx @@ -25,31 +25,31 @@ class PopUpWidget; class CartridgeFCWidget : public CartDebugWidget { -public: - CartridgeFCWidget(GuiObject* boss, const GUI::Font& lfont, - const GUI::Font& nfont, - int x, int y, int w, int h, - CartridgeFC& cart); - virtual ~CartridgeFCWidget() = default; + public: + CartridgeFCWidget(GuiObject* boss, const GUI::Font& lfont, + const GUI::Font& nfont, + int x, int y, int w, int h, + CartridgeFC& cart); + virtual ~CartridgeFCWidget() = default; -private: - CartridgeFC& myCart; - PopUpWidget* myBank; + private: + CartridgeFC& myCart; + PopUpWidget* myBank{nullptr}; - enum { kBankChanged = 'bkCH' }; + enum { kBankChanged = 'bkCH' }; -private: - void loadConfig() override; - void handleCommand(CommandSender* sender, int cmd, int data, int id) override; + private: + void loadConfig() override; + void handleCommand(CommandSender* sender, int cmd, int data, int id) override; - string bankState() override; + string bankState() override; - // Following constructors and assignment operators not supported - CartridgeFCWidget() = delete; - CartridgeFCWidget(const CartridgeFCWidget&) = delete; - CartridgeFCWidget(CartridgeFCWidget&&) = delete; - CartridgeFCWidget& operator=(const CartridgeFCWidget&) = delete; - CartridgeFCWidget& operator=(CartridgeFCWidget&&) = delete; + // Following constructors and assignment operators not supported + CartridgeFCWidget() = delete; + CartridgeFCWidget(const CartridgeFCWidget&) = delete; + CartridgeFCWidget(CartridgeFCWidget&&) = delete; + CartridgeFCWidget& operator=(const CartridgeFCWidget&) = delete; + CartridgeFCWidget& operator=(CartridgeFCWidget&&) = delete; }; #endif diff --git a/src/debugger/gui/CartFEWidget.hxx b/src/debugger/gui/CartFEWidget.hxx index b6ff60ef8..a0d586c0e 100644 --- a/src/debugger/gui/CartFEWidget.hxx +++ b/src/debugger/gui/CartFEWidget.hxx @@ -34,7 +34,7 @@ class CartridgeFEWidget : public CartDebugWidget private: CartridgeFE& myCart; - PopUpWidget* myBank; + PopUpWidget* myBank{nullptr}; enum { kBankChanged = 'bkCH' }; diff --git a/src/debugger/gui/CartMDMWidget.hxx b/src/debugger/gui/CartMDMWidget.hxx index e82065836..e4beaf5b4 100644 --- a/src/debugger/gui/CartMDMWidget.hxx +++ b/src/debugger/gui/CartMDMWidget.hxx @@ -35,8 +35,8 @@ class CartridgeMDMWidget : public CartDebugWidget private: CartridgeMDM& myCart; - PopUpWidget* myBank; - CheckboxWidget* myBankDisabled; + PopUpWidget* myBank{nullptr}; + CheckboxWidget* myBankDisabled{nullptr}; enum { kBankChanged = 'bkCH', kBankDisabled = 'bkDI' }; diff --git a/src/debugger/gui/CartMNetworkWidget.hxx b/src/debugger/gui/CartMNetworkWidget.hxx index a1fff146e..ee04347c9 100644 --- a/src/debugger/gui/CartMNetworkWidget.hxx +++ b/src/debugger/gui/CartMNetworkWidget.hxx @@ -37,13 +37,13 @@ class CartridgeMNetworkWidget : public CartDebugWidget //CartridgeE7& myCart; CartridgeMNetwork& myCart; - PopUpWidget *myLower2K, *myUpper256B; + PopUpWidget *myLower2K{nullptr}, *myUpper256B{nullptr}; struct CartState { ByteArray internalram; - uInt16 lowerBank; - uInt16 upperBank; + uInt16 lowerBank{0}; + uInt16 upperBank{0}; }; CartState myOldState; diff --git a/src/debugger/gui/CartRamWidget.hxx b/src/debugger/gui/CartRamWidget.hxx index 286069820..09ca53d59 100644 --- a/src/debugger/gui/CartRamWidget.hxx +++ b/src/debugger/gui/CartRamWidget.hxx @@ -48,7 +48,7 @@ class CartRamWidget : public Widget, public CommandSender // These will be needed by most of the child classes; // we may as well make them protected variables - int myFontWidth, myFontHeight, myLineHeight, myButtonHeight; + int myFontWidth{0}, myFontHeight{0}, myLineHeight{0}, myButtonHeight{0}; private: // Following constructors and assignment operators not supported @@ -91,8 +91,8 @@ class CartRamWidget : public Widget, public CommandSender }; private: - StringListWidget* myDesc; - InternalRamWidget* myRam; + StringListWidget* myDesc{nullptr}; + InternalRamWidget* myRam{nullptr}; }; #endif diff --git a/src/debugger/gui/CartSBWidget.hxx b/src/debugger/gui/CartSBWidget.hxx index 7bf1a9356..dabd5bc31 100644 --- a/src/debugger/gui/CartSBWidget.hxx +++ b/src/debugger/gui/CartSBWidget.hxx @@ -34,7 +34,7 @@ class CartridgeSBWidget : public CartDebugWidget private: CartridgeSB& myCart; - PopUpWidget* myBank; + PopUpWidget* myBank{nullptr}; enum { kBankChanged = 'bkCH' }; diff --git a/src/debugger/gui/CartUAWidget.hxx b/src/debugger/gui/CartUAWidget.hxx index 33aa39324..379a9ac2b 100644 --- a/src/debugger/gui/CartUAWidget.hxx +++ b/src/debugger/gui/CartUAWidget.hxx @@ -34,7 +34,7 @@ class CartridgeUAWidget : public CartDebugWidget private: CartridgeUA& myCart; - PopUpWidget* myBank; + PopUpWidget* myBank{nullptr}; bool mySwappedHotspots; diff --git a/src/debugger/gui/CartWDWidget.hxx b/src/debugger/gui/CartWDWidget.hxx index 9fbd1fa7a..1da13f92c 100644 --- a/src/debugger/gui/CartWDWidget.hxx +++ b/src/debugger/gui/CartWDWidget.hxx @@ -34,11 +34,11 @@ class CartridgeWDWidget : public CartDebugWidget private: CartridgeWD& myCart; - PopUpWidget* myBank; + PopUpWidget* myBank{nullptr}; struct CartState { ByteArray internalram; - uInt16 bank; // Current banking layout + uInt16 bank{0}; // Current banking layout }; CartState myOldState; diff --git a/src/debugger/gui/CartX07Widget.hxx b/src/debugger/gui/CartX07Widget.hxx index 11c7990b2..677296e93 100644 --- a/src/debugger/gui/CartX07Widget.hxx +++ b/src/debugger/gui/CartX07Widget.hxx @@ -34,7 +34,7 @@ class CartridgeX07Widget : public CartDebugWidget private: CartridgeX07& myCart; - PopUpWidget* myBank; + PopUpWidget* myBank{nullptr}; enum { kBankChanged = 'bkCH' }; diff --git a/src/debugger/gui/CpuWidget.hxx b/src/debugger/gui/CpuWidget.hxx index 2a06cf3a0..4bdef9e8f 100644 --- a/src/debugger/gui/CpuWidget.hxx +++ b/src/debugger/gui/CpuWidget.hxx @@ -69,13 +69,13 @@ class CpuWidget : public Widget, public CommandSender kPSRegC = 7 }; - DataGridWidget* myPCGrid; - DataGridWidget* myCpuGrid; - DataGridWidget* myCpuGridDecValue; - DataGridWidget* myCpuGridBinValue; - ToggleBitWidget* myPSRegister; - EditTextWidget* myPCLabel; - std::array myCpuDataSrc; + DataGridWidget* myPCGrid{nullptr}; + DataGridWidget* myCpuGrid{nullptr}; + DataGridWidget* myCpuGridDecValue{nullptr}; + DataGridWidget* myCpuGridBinValue{nullptr}; + ToggleBitWidget* myPSRegister{nullptr}; + EditTextWidget* myPCLabel{nullptr}; + std::array myCpuDataSrc{nullptr}; private: // Following constructors and assignment operators not supported diff --git a/src/debugger/gui/DataGridOpsWidget.cxx b/src/debugger/gui/DataGridOpsWidget.cxx index e9fd01889..6bfebe186 100644 --- a/src/debugger/gui/DataGridOpsWidget.cxx +++ b/src/debugger/gui/DataGridOpsWidget.cxx @@ -22,14 +22,7 @@ DataGridOpsWidget::DataGridOpsWidget(GuiObject* boss, const GUI::Font& font, int x, int y) : Widget(boss, font, x, y, 16, 16), - CommandSender(boss), - _zeroButton(nullptr), - _invButton(nullptr), - _negButton(nullptr), - _incButton(nullptr), - _decButton(nullptr), - _shiftLeftButton(nullptr), - _shiftRightButton(nullptr) + CommandSender(boss) { const int bwidth = _font.getMaxCharWidth() * 4+2, bheight = _font.getFontHeight() + 3, diff --git a/src/debugger/gui/DataGridOpsWidget.hxx b/src/debugger/gui/DataGridOpsWidget.hxx index e68f6de3a..528ca7f95 100644 --- a/src/debugger/gui/DataGridOpsWidget.hxx +++ b/src/debugger/gui/DataGridOpsWidget.hxx @@ -42,13 +42,13 @@ class DataGridOpsWidget : public Widget, public CommandSender void setEnabled(bool e); private: - ButtonWidget* _zeroButton; - ButtonWidget* _invButton; - ButtonWidget* _negButton; - ButtonWidget* _incButton; - ButtonWidget* _decButton; - ButtonWidget* _shiftLeftButton; - ButtonWidget* _shiftRightButton; + ButtonWidget* _zeroButton{nullptr}; + ButtonWidget* _invButton{nullptr}; + ButtonWidget* _negButton{nullptr}; + ButtonWidget* _incButton{nullptr}; + ButtonWidget* _decButton{nullptr}; + ButtonWidget* _shiftLeftButton{nullptr}; + ButtonWidget* _shiftRightButton{nullptr}; private: // Following constructors and assignment operators not supported diff --git a/src/debugger/gui/DataGridWidget.cxx b/src/debugger/gui/DataGridWidget.cxx index 9b735708a..8627b865b 100644 --- a/src/debugger/gui/DataGridWidget.cxx +++ b/src/debugger/gui/DataGridWidget.cxx @@ -38,20 +38,12 @@ DataGridWidget::DataGridWidget(GuiObject* boss, const GUI::Font& font, font.getLineHeight()*rows + 1), _rows(rows), _cols(cols), - _currentRow(0), - _currentCol(0), _rowHeight(font.getLineHeight()), _colWidth(colchars * font.getMaxCharWidth() + 8), _bits(bits), - _crossGrid(false), - _base(base), - _selectedItem(0), - _currentKeyDown(KBDK_UNKNOWN), - _opsWidget(nullptr), - _scrollBar(nullptr) + _base(base) { _flags = Widget::FLAG_ENABLED | Widget::FLAG_RETAIN_FOCUS | Widget::FLAG_WANTS_RAWDATA; - _editMode = false; // The item is selected, thus _bgcolor is used to draw the caret and // _textcolorhi to erase it diff --git a/src/debugger/gui/DataGridWidget.hxx b/src/debugger/gui/DataGridWidget.hxx index 640b35959..1fe807f35 100644 --- a/src/debugger/gui/DataGridWidget.hxx +++ b/src/debugger/gui/DataGridWidget.hxx @@ -108,16 +108,16 @@ class DataGridWidget : public EditableWidget void handleCommand(CommandSender* sender, int cmd, int data, int id) override; protected: - int _rows; - int _cols; - int _currentRow; - int _currentCol; - int _rowHeight; - int _colWidth; - int _bits; - int _lowerBound; - int _upperBound; - bool _crossGrid; + int _rows{0}; + int _cols{0}; + int _currentRow{0}; + int _currentCol{0}; + int _rowHeight{0}; + int _colWidth{0}; + int _bits{0}; + int _lowerBound{0}; + int _upperBound{0}; + bool _crossGrid{false}; Common::Base::Fmt _base; @@ -127,13 +127,13 @@ class DataGridWidget : public EditableWidget BoolArray _changedList; BoolArray _hiliteList; - bool _editMode; - int _selectedItem; - StellaKey _currentKeyDown; + bool _editMode{false}; + int _selectedItem{0}; + StellaKey _currentKeyDown{KBDK_UNKNOWN}; string _backupString; - DataGridOpsWidget* _opsWidget; - ScrollBarWidget* _scrollBar; + DataGridOpsWidget* _opsWidget{nullptr}; + ScrollBarWidget* _scrollBar{nullptr}; private: /** Common operations on the currently selected cell */ diff --git a/src/debugger/gui/DebuggerDialog.cxx b/src/debugger/gui/DebuggerDialog.cxx index 5a9c27731..270806ff9 100644 --- a/src/debugger/gui/DebuggerDialog.cxx +++ b/src/debugger/gui/DebuggerDialog.cxx @@ -51,11 +51,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DebuggerDialog::DebuggerDialog(OSystem& osystem, DialogContainer& parent, int x, int y, int w, int h) - : Dialog(osystem, parent, x, y, w, h), - myTab(nullptr), - myRomTab(nullptr), - myFatalError(nullptr), - myFirstLoad(true) + : Dialog(osystem, parent, x, y, w, h) { createFont(); // Font is sized according to available space diff --git a/src/debugger/gui/DebuggerDialog.hxx b/src/debugger/gui/DebuggerDialog.hxx index 4a38930e8..559d1b5bb 100644 --- a/src/debugger/gui/DebuggerDialog.hxx +++ b/src/debugger/gui/DebuggerDialog.hxx @@ -115,28 +115,28 @@ class DebuggerDialog : public Dialog kDDOptionsCmd = 'DDop' }; - TabWidget *myTab, *myRomTab; + TabWidget *myTab{nullptr}, *myRomTab{nullptr}; - PromptWidget* myPrompt; - TiaInfoWidget* myTiaInfo; - TiaOutputWidget* myTiaOutput; - TiaZoomWidget* myTiaZoom; - CpuWidget* myCpu; - RamWidget* myRam; - RomWidget* myRom; - CartDebugWidget* myCartInfo; - CartDebugWidget* myCartDebug; - CartRamWidget* myCartRam; - EditTextWidget* myMessageBox; - ButtonWidget* myRewindButton; - ButtonWidget* myUnwindButton; + PromptWidget* myPrompt{nullptr}; + TiaInfoWidget* myTiaInfo{nullptr}; + TiaOutputWidget* myTiaOutput{nullptr}; + TiaZoomWidget* myTiaZoom{nullptr}; + CpuWidget* myCpu{nullptr}; + RamWidget* myRam{nullptr}; + RomWidget* myRom{nullptr}; + CartDebugWidget* myCartInfo{nullptr}; + CartDebugWidget* myCartDebug{nullptr}; + CartRamWidget* myCartRam{nullptr}; + EditTextWidget* myMessageBox{nullptr}; + ButtonWidget* myRewindButton{nullptr}; + ButtonWidget* myUnwindButton{nullptr}; unique_ptr myFatalError; unique_ptr myOptions; unique_ptr myLFont; // used for labels unique_ptr myNFont; // used for normal text - bool myFirstLoad; + bool myFirstLoad{true}; private: // Following constructors and assignment operators not supported diff --git a/src/debugger/gui/DrivingWidget.cxx b/src/debugger/gui/DrivingWidget.cxx index 572966d02..e7ee1c5ee 100644 --- a/src/debugger/gui/DrivingWidget.cxx +++ b/src/debugger/gui/DrivingWidget.cxx @@ -21,8 +21,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DrivingWidget::DrivingWidget(GuiObject* boss, const GUI::Font& font, int x, int y, Controller& controller) - : ControllerWidget(boss, font, x, y, controller), - myGrayIndex(0) + : ControllerWidget(boss, font, x, y, controller) { const string& label = getHeader(); diff --git a/src/debugger/gui/DrivingWidget.hxx b/src/debugger/gui/DrivingWidget.hxx index 1f4176af9..a701a6610 100644 --- a/src/debugger/gui/DrivingWidget.hxx +++ b/src/debugger/gui/DrivingWidget.hxx @@ -38,11 +38,11 @@ class DrivingWidget : public ControllerWidget kGrayDownCmd = 'DWdn', kFireCmd = 'DWfr' }; - ButtonWidget *myGrayUp, *myGrayDown; - DataGridWidget* myGrayValue; - CheckboxWidget* myFire; + ButtonWidget *myGrayUp{nullptr}, *myGrayDown{nullptr}; + DataGridWidget* myGrayValue{nullptr}; + CheckboxWidget* myFire{nullptr}; - int myGrayIndex; + int myGrayIndex{0}; static const std::array ourGrayTable; diff --git a/src/debugger/gui/FlashWidget.cxx b/src/debugger/gui/FlashWidget.cxx index da8b3815f..768c51440 100644 --- a/src/debugger/gui/FlashWidget.cxx +++ b/src/debugger/gui/FlashWidget.cxx @@ -22,8 +22,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FlashWidget::FlashWidget(GuiObject* boss, const GUI::Font& font, int x, int y, Controller& controller) - : ControllerWidget(boss, font, x, y, controller), - myEEPROMEraseCurrent(nullptr) + : ControllerWidget(boss, font, x, y, controller) { myPage.fill(nullptr); } diff --git a/src/debugger/gui/FlashWidget.hxx b/src/debugger/gui/FlashWidget.hxx index 963d7c842..9183dedcd 100644 --- a/src/debugger/gui/FlashWidget.hxx +++ b/src/debugger/gui/FlashWidget.hxx @@ -34,11 +34,11 @@ class FlashWidget : public ControllerWidget void init(GuiObject* boss, const GUI::Font& font, int x, int y); private: - ButtonWidget* myEEPROMEraseCurrent; + ButtonWidget* myEEPROMEraseCurrent{nullptr}; enum { kEEPROMEraseCurrent = 'eeEC' }; static constexpr uInt32 MAX_PAGES = 5; - std::array myPage; + std::array myPage{nullptr}; private: void loadConfig() override; diff --git a/src/debugger/gui/GenesisWidget.hxx b/src/debugger/gui/GenesisWidget.hxx index ca3be94fd..a21c8d40a 100644 --- a/src/debugger/gui/GenesisWidget.hxx +++ b/src/debugger/gui/GenesisWidget.hxx @@ -31,7 +31,7 @@ class GenesisWidget : public ControllerWidget private: enum { kJUp = 0, kJDown, kJLeft, kJRight, kJBbtn, kJCbtn }; - std::array myPins; + std::array myPins{nullptr}; static constexpr std::array ourPinNo = {{ Controller::DigitalPin::One, Controller::DigitalPin::Two, Controller::DigitalPin::Three, Controller::DigitalPin::Four, diff --git a/src/debugger/gui/JoystickWidget.hxx b/src/debugger/gui/JoystickWidget.hxx index c2d47535f..6bad9b63f 100644 --- a/src/debugger/gui/JoystickWidget.hxx +++ b/src/debugger/gui/JoystickWidget.hxx @@ -31,7 +31,7 @@ class JoystickWidget : public ControllerWidget private: enum { kJUp = 0, kJDown, kJLeft, kJRight, kJFire }; - std::array myPins; + std::array myPins{nullptr}; static constexpr std::array ourPinNo = {{ Controller::DigitalPin::One, Controller::DigitalPin::Two, Controller::DigitalPin::Three, Controller::DigitalPin::Four, diff --git a/src/debugger/gui/KeyboardWidget.hxx b/src/debugger/gui/KeyboardWidget.hxx index fcd7ce0e3..b91771057 100644 --- a/src/debugger/gui/KeyboardWidget.hxx +++ b/src/debugger/gui/KeyboardWidget.hxx @@ -29,8 +29,8 @@ class KeyboardWidget : public ControllerWidget virtual ~KeyboardWidget() = default; private: - std::array myBox; - const Event::Type* myEvent; + std::array myBox{nullptr}; + const Event::Type* myEvent{nullptr}; static constexpr std::array ourLeftEvents = {{ Event::KeyboardZero1, Event::KeyboardZero2, Event::KeyboardZero3, diff --git a/src/debugger/gui/PaddleWidget.hxx b/src/debugger/gui/PaddleWidget.hxx index e5cd356e8..1c868cc57 100644 --- a/src/debugger/gui/PaddleWidget.hxx +++ b/src/debugger/gui/PaddleWidget.hxx @@ -33,8 +33,8 @@ class PaddleWidget : public ControllerWidget enum { kP0Changed = 'P0ch', kP1Changed = 'P1ch', kP0Fire = 'P0fr', kP1Fire = 'P1fr' }; - SliderWidget *myP0Resistance, *myP1Resistance; - CheckboxWidget *myP0Fire, *myP1Fire; + SliderWidget *myP0Resistance{nullptr}, *myP1Resistance{nullptr}; + CheckboxWidget *myP0Fire{nullptr}, *myP1Fire{nullptr}; private: void loadConfig() override; diff --git a/src/debugger/gui/PointingDeviceWidget.hxx b/src/debugger/gui/PointingDeviceWidget.hxx index d03f88fa2..17997e913 100644 --- a/src/debugger/gui/PointingDeviceWidget.hxx +++ b/src/debugger/gui/PointingDeviceWidget.hxx @@ -39,11 +39,11 @@ class PointingDeviceWidget : public ControllerWidget kTBDown = 'TWdn', kTBFire = 'TWfr' }; - ButtonWidget *myGrayLeft, *myGrayRight; - DataGridWidget* myGrayValueH; - ButtonWidget *myGrayUp, *myGrayDown; - DataGridWidget* myGrayValueV; - CheckboxWidget* myFire; + ButtonWidget *myGrayLeft{nullptr}, *myGrayRight{nullptr}; + DataGridWidget* myGrayValueH{nullptr}; + ButtonWidget *myGrayUp{nullptr}, *myGrayDown{nullptr}; + DataGridWidget* myGrayValueV{nullptr}; + CheckboxWidget* myFire{nullptr}; private: virtual uInt8 getGrayCodeTable(const int index, const int direction) const = 0; diff --git a/src/debugger/gui/PromptWidget.cxx b/src/debugger/gui/PromptWidget.cxx index eca544869..77bef9b2b 100644 --- a/src/debugger/gui/PromptWidget.cxx +++ b/src/debugger/gui/PromptWidget.cxx @@ -29,6 +29,7 @@ #define PROMPT "> " +// TODO: Github issue #361 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PromptWidget::PromptWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h) diff --git a/src/debugger/gui/RamWidget.cxx b/src/debugger/gui/RamWidget.cxx index 0d77a4981..4f258e7ab 100644 --- a/src/debugger/gui/RamWidget.cxx +++ b/src/debugger/gui/RamWidget.cxx @@ -38,7 +38,6 @@ RamWidget::RamWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n myFontHeight(lfont.getFontHeight()), myLineHeight(lfont.getLineHeight()), myButtonHeight(myLineHeight + 4), - myCurrentRamBank(0), myRamSize(ramsize), myNumRows(numrows), myPageSize(pagesize) diff --git a/src/debugger/gui/RamWidget.hxx b/src/debugger/gui/RamWidget.hxx index 0b1af4c13..9b2776a2c 100644 --- a/src/debugger/gui/RamWidget.hxx +++ b/src/debugger/gui/RamWidget.hxx @@ -68,7 +68,7 @@ class RamWidget : public Widget, public CommandSender // These will be needed by most of the child classes; // we may as well make them protected variables - int myFontWidth, myFontHeight, myLineHeight, myButtonHeight; + int myFontWidth{0}, myFontHeight{0}, myLineHeight{0}, myButtonHeight{0}; private: enum { @@ -84,27 +84,27 @@ class RamWidget : public Widget, public CommandSender kRamBinID }; - uInt32 myUndoAddress, myUndoValue; - uInt32 myCurrentRamBank; - uInt32 myRamSize; - uInt32 myNumRows; - uInt32 myPageSize; + uInt32 myUndoAddress{0}, myUndoValue{0}; + uInt32 myCurrentRamBank{0}; + uInt32 myRamSize{0}; + uInt32 myNumRows{0}; + uInt32 myPageSize{0}; unique_ptr myInputBox; - StaticTextWidget* myRamStart; - std::array myRamLabels; + StaticTextWidget* myRamStart{nullptr}; + std::array myRamLabels{nullptr}; - DataGridWidget* myRamGrid; - DataGridWidget* myDecValue; - DataGridWidget* myBinValue; - EditTextWidget* myLabel; + DataGridWidget* myRamGrid{nullptr}; + DataGridWidget* myDecValue{nullptr}; + DataGridWidget* myBinValue{nullptr}; + EditTextWidget* myLabel{nullptr}; - ButtonWidget* myRevertButton; - ButtonWidget* myUndoButton; - ButtonWidget* mySearchButton; - ButtonWidget* myCompareButton; - ButtonWidget* myRestartButton; + ButtonWidget* myRevertButton{nullptr}; + ButtonWidget* myUndoButton{nullptr}; + ButtonWidget* mySearchButton{nullptr}; + ButtonWidget* myCompareButton{nullptr}; + ButtonWidget* myRestartButton{nullptr}; ByteArray myOldValueList; IntArray mySearchAddr; diff --git a/src/debugger/gui/RiotWidget.hxx b/src/debugger/gui/RiotWidget.hxx index 1c7d88e24..7ec9909a3 100644 --- a/src/debugger/gui/RiotWidget.hxx +++ b/src/debugger/gui/RiotWidget.hxx @@ -45,30 +45,30 @@ class RiotWidget : public Widget, public CommandSender void loadConfig() override; private: - ToggleBitWidget* mySWCHAReadBits; - ToggleBitWidget* mySWCHAWriteBits; - ToggleBitWidget* mySWACNTBits; - ToggleBitWidget* mySWCHBReadBits; - ToggleBitWidget* mySWCHBWriteBits; - ToggleBitWidget* mySWBCNTBits; + ToggleBitWidget* mySWCHAReadBits{nullptr}; + ToggleBitWidget* mySWCHAWriteBits{nullptr}; + ToggleBitWidget* mySWACNTBits{nullptr}; + ToggleBitWidget* mySWCHBReadBits{nullptr}; + ToggleBitWidget* mySWCHBWriteBits{nullptr}; + ToggleBitWidget* mySWBCNTBits{nullptr}; - DataGridWidget* myLeftINPT; - DataGridWidget* myRightINPT; - CheckboxWidget* myINPTLatch; - CheckboxWidget* myINPTDump; + DataGridWidget* myLeftINPT{nullptr}; + DataGridWidget* myRightINPT{nullptr}; + CheckboxWidget* myINPTLatch{nullptr}; + CheckboxWidget* myINPTDump{nullptr}; - DataGridWidget* myTimWrite; - DataGridWidget* myTimRead; - DataGridWidget* myTimDivider; + DataGridWidget* myTimWrite{nullptr}; + DataGridWidget* myTimRead{nullptr}; + DataGridWidget* myTimDivider{nullptr}; - ControllerWidget *myLeftControl, *myRightControl; - PopUpWidget *myP0Diff, *myP1Diff; - PopUpWidget *myTVType; - CheckboxWidget* mySelect; - CheckboxWidget* myReset; - CheckboxWidget* myPause; + ControllerWidget *myLeftControl{nullptr}, *myRightControl{nullptr}; + PopUpWidget *myP0Diff{nullptr}, *myP1Diff{nullptr}; + PopUpWidget *myTVType{nullptr}; + CheckboxWidget* mySelect{nullptr}; + CheckboxWidget* myReset{nullptr}; + CheckboxWidget* myPause{nullptr}; - EditTextWidget* myConsole; + EditTextWidget* myConsole{nullptr}; // ID's for the various widgets // We need ID's, since there are more than one of several types of widgets diff --git a/src/debugger/gui/RomListSettings.cxx b/src/debugger/gui/RomListSettings.cxx index dce8e86b2..d18b26572 100644 --- a/src/debugger/gui/RomListSettings.cxx +++ b/src/debugger/gui/RomListSettings.cxx @@ -28,10 +28,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - RomListSettings::RomListSettings(GuiObject* boss, const GUI::Font& font) : Dialog(boss->instance(), boss->parent()), - CommandSender(boss), - _xorig(0), - _yorig(0), - _item(0) + CommandSender(boss) { const int buttonWidth = font.getStringWidth("RunTo PC @ current line") + 20, buttonHeight = font.getLineHeight() + 4; diff --git a/src/debugger/gui/RomListSettings.hxx b/src/debugger/gui/RomListSettings.hxx index c603b7400..3aaeb460c 100644 --- a/src/debugger/gui/RomListSettings.hxx +++ b/src/debugger/gui/RomListSettings.hxx @@ -42,13 +42,13 @@ class RomListSettings : public Dialog, public CommandSender void center() override; private: - uInt32 _xorig, _yorig; - int _item; // currently selected line number in the disassembly list + uInt32 _xorig{0}, _yorig{0}; + int _item{0}; // currently selected line number in the disassembly list - CheckboxWidget* myShowTentative; - CheckboxWidget* myShowAddresses; - CheckboxWidget* myShowGFXBinary; - CheckboxWidget* myUseRelocation; + CheckboxWidget* myShowTentative{nullptr}; + CheckboxWidget* myShowAddresses{nullptr}; + CheckboxWidget* myShowGFXBinary{nullptr}; + CheckboxWidget* myUseRelocation{nullptr}; private: void loadConfig() override; diff --git a/src/debugger/gui/RomListWidget.cxx b/src/debugger/gui/RomListWidget.cxx index 5e6128c2d..6b6624cff 100644 --- a/src/debugger/gui/RomListWidget.cxx +++ b/src/debugger/gui/RomListWidget.cxx @@ -30,16 +30,7 @@ RomListWidget::RomListWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont, int x, int y, int w, int h) - : EditableWidget(boss, nfont, x, y, 16, 16), - _rows(0), - _cols(0), - _currentPos(0), - _selectedItem(-1), - _highlightedItem(-1), - _editMode(false), - _currentKeyDown(KBDK_UNKNOWN), - _base(Common::Base::Fmt::_DEFAULT), - myDisasm(nullptr)//, + : EditableWidget(boss, nfont, x, y, 16, 16) { _flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG | Widget::FLAG_RETAIN_FOCUS; _bgcolor = kWidColor; diff --git a/src/debugger/gui/RomListWidget.hxx b/src/debugger/gui/RomListWidget.hxx index a0455cbc4..19afa7753 100644 --- a/src/debugger/gui/RomListWidget.hxx +++ b/src/debugger/gui/RomListWidget.hxx @@ -87,21 +87,21 @@ class RomListWidget : public EditableWidget private: unique_ptr myMenu; - ScrollBarWidget* myScrollBar; + ScrollBarWidget* myScrollBar{nullptr}; - int _labelWidth; - int _bytesWidth; - int _rows; - int _cols; - int _currentPos; // position of first line in visible window - int _selectedItem; - int _highlightedItem; - bool _editMode; - StellaKey _currentKeyDown; - Common::Base::Fmt _base; // base used during editing + int _labelWidth{0}; + int _bytesWidth{0}; + int _rows{0}; + int _cols{0}; + int _currentPos{0}; // position of first line in visible window + int _selectedItem{-1}; + int _highlightedItem{-1}; + bool _editMode{false}; + StellaKey _currentKeyDown{KBDK_UNKNOWN}; + Common::Base::Fmt _base{Common::Base::Fmt::_DEFAULT}; // base used during editing - const CartDebug::Disassembly* myDisasm; - vector myCheckList; + const CartDebug::Disassembly* myDisasm{nullptr}; + vector myCheckList{nullptr}; private: // Following constructors and assignment operators not supported diff --git a/src/debugger/gui/RomWidget.cxx b/src/debugger/gui/RomWidget.cxx index adeded043..e13d25b9d 100644 --- a/src/debugger/gui/RomWidget.cxx +++ b/src/debugger/gui/RomWidget.cxx @@ -33,8 +33,7 @@ RomWidget::RomWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont, int x, int y, int w, int h) : Widget(boss, lfont, x, y, w, h), - CommandSender(boss), - myListIsDirty(true) + CommandSender(boss) { int xpos, ypos; StaticTextWidget* t; diff --git a/src/debugger/gui/RomWidget.hxx b/src/debugger/gui/RomWidget.hxx index f439dff12..0212457ef 100644 --- a/src/debugger/gui/RomWidget.hxx +++ b/src/debugger/gui/RomWidget.hxx @@ -55,10 +55,10 @@ class RomWidget : public Widget, public CommandSender Common::Base::Fmt base); private: - RomListWidget* myRomList; - EditTextWidget* myBank; + RomListWidget* myRomList{nullptr}; + EditTextWidget* myBank{nullptr}; - bool myListIsDirty; + bool myListIsDirty{true}; private: // Following constructors and assignment operators not supported diff --git a/src/debugger/gui/TiaInfoWidget.hxx b/src/debugger/gui/TiaInfoWidget.hxx index 8b06907d3..3f3531de5 100644 --- a/src/debugger/gui/TiaInfoWidget.hxx +++ b/src/debugger/gui/TiaInfoWidget.hxx @@ -36,17 +36,17 @@ class TiaInfoWidget : public Widget, public CommandSender void loadConfig() override; private: - EditTextWidget* myFrameCount; - EditTextWidget* myFrameCycles; + EditTextWidget* myFrameCount{nullptr}; + EditTextWidget* myFrameCycles{nullptr}; - EditTextWidget* myScanlineCount; - EditTextWidget* myScanlineCountLast; - EditTextWidget* myScanlineCycles; - EditTextWidget* myPixelPosition; - EditTextWidget* myColorClocks; + EditTextWidget* myScanlineCount{nullptr}; + EditTextWidget* myScanlineCountLast{nullptr}; + EditTextWidget* myScanlineCycles{nullptr}; + EditTextWidget* myPixelPosition{nullptr}; + EditTextWidget* myColorClocks{nullptr}; - CheckboxWidget* myVSync; - CheckboxWidget* myVBlank; + CheckboxWidget* myVSync{nullptr}; + CheckboxWidget* myVBlank{nullptr}; private: void handleMouseDown(int x, int y, MouseButton b, int clickCount) override; diff --git a/src/debugger/gui/TiaOutputWidget.cxx b/src/debugger/gui/TiaOutputWidget.cxx index f697f04c8..db614f0ec 100644 --- a/src/debugger/gui/TiaOutputWidget.cxx +++ b/src/debugger/gui/TiaOutputWidget.cxx @@ -38,10 +38,7 @@ TiaOutputWidget::TiaOutputWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h) : Widget(boss, font, x, y, w, h), - CommandSender(boss), - myZoom(nullptr), - myClickX(0), - myClickY(0) + CommandSender(boss) { // Create context menu for commands VariantList l; diff --git a/src/debugger/gui/TiaOutputWidget.hxx b/src/debugger/gui/TiaOutputWidget.hxx index 3b2177372..0b6f63bd2 100644 --- a/src/debugger/gui/TiaOutputWidget.hxx +++ b/src/debugger/gui/TiaOutputWidget.hxx @@ -49,9 +49,9 @@ class TiaOutputWidget : public Widget, public CommandSender */ private: unique_ptr myMenu; - TiaZoomWidget* myZoom; + TiaZoomWidget* myZoom{nullptr}; - int myClickX, myClickY; + int myClickX{0}, myClickY{0}; // Create this buffer once, instead of allocating it each time the // TIA image is redrawn diff --git a/src/debugger/gui/TiaWidget.hxx b/src/debugger/gui/TiaWidget.hxx index ba4100e5b..d1faa9ae2 100644 --- a/src/debugger/gui/TiaWidget.hxx +++ b/src/debugger/gui/TiaWidget.hxx @@ -39,64 +39,64 @@ class TiaWidget : public Widget, public CommandSender virtual ~TiaWidget() = default; private: - DataGridWidget* myColorRegs; + DataGridWidget* myColorRegs{nullptr}; - ColorWidget* myCOLUP0Color; - ColorWidget* myCOLUP1Color; - ColorWidget* myCOLUPFColor; - ColorWidget* myCOLUBKColor; + ColorWidget* myCOLUP0Color{nullptr}; + ColorWidget* myCOLUP1Color{nullptr}; + ColorWidget* myCOLUPFColor{nullptr}; + ColorWidget* myCOLUBKColor{nullptr}; - CheckboxWidget* myFixedEnabled; - std::array myFixedColors; + CheckboxWidget* myFixedEnabled{nullptr}; + std::array myFixedColors{nullptr}; - TogglePixelWidget* myGRP0; - TogglePixelWidget* myGRP0Old; - TogglePixelWidget* myGRP1; - TogglePixelWidget* myGRP1Old; + TogglePixelWidget* myGRP0{nullptr}; + TogglePixelWidget* myGRP0Old{nullptr}; + TogglePixelWidget* myGRP1{nullptr}; + TogglePixelWidget* myGRP1Old{nullptr}; - DataGridWidget* myPosP0; - DataGridWidget* myPosP1; - DataGridWidget* myPosM0; - DataGridWidget* myPosM1; - DataGridWidget* myPosBL; + DataGridWidget* myPosP0{nullptr}; + DataGridWidget* myPosP1{nullptr}; + DataGridWidget* myPosM0{nullptr}; + DataGridWidget* myPosM1{nullptr}; + DataGridWidget* myPosBL{nullptr}; - DataGridWidget* myHMP0; - DataGridWidget* myHMP1; - DataGridWidget* myHMM0; - DataGridWidget* myHMM1; - DataGridWidget* myHMBL; + DataGridWidget* myHMP0{nullptr}; + DataGridWidget* myHMP1{nullptr}; + DataGridWidget* myHMM0{nullptr}; + DataGridWidget* myHMM1{nullptr}; + DataGridWidget* myHMBL{nullptr}; - DataGridWidget* myNusizP0; - DataGridWidget* myNusizP1; - DataGridWidget* myNusizM0; - DataGridWidget* myNusizM1; - DataGridWidget* mySizeBL; - EditTextWidget* myNusizP0Text; - EditTextWidget* myNusizP1Text; + DataGridWidget* myNusizP0{nullptr}; + DataGridWidget* myNusizP1{nullptr}; + DataGridWidget* myNusizM0{nullptr}; + DataGridWidget* myNusizM1{nullptr}; + DataGridWidget* mySizeBL{nullptr}; + EditTextWidget* myNusizP0Text{nullptr}; + EditTextWidget* myNusizP1Text{nullptr}; - CheckboxWidget* myRefP0; - CheckboxWidget* myRefP1; - CheckboxWidget* myDelP0; - CheckboxWidget* myDelP1; - CheckboxWidget* myDelBL; + CheckboxWidget* myRefP0{nullptr}; + CheckboxWidget* myRefP1{nullptr}; + CheckboxWidget* myDelP0{nullptr}; + CheckboxWidget* myDelP1{nullptr}; + CheckboxWidget* myDelBL{nullptr}; - TogglePixelWidget* myEnaM0; - TogglePixelWidget* myEnaM1; - TogglePixelWidget* myEnaBL; - TogglePixelWidget* myEnaBLOld; + TogglePixelWidget* myEnaM0{nullptr}; + TogglePixelWidget* myEnaM1{nullptr}; + TogglePixelWidget* myEnaBL{nullptr}; + TogglePixelWidget* myEnaBLOld{nullptr}; - CheckboxWidget* myResMP0; - CheckboxWidget* myResMP1; + CheckboxWidget* myResMP0{nullptr}; + CheckboxWidget* myResMP1{nullptr}; /** Collision register bits */ - std::array myCollision; + std::array myCollision{nullptr}; - std::array myPF; - CheckboxWidget* myRefPF; - CheckboxWidget* myScorePF; - CheckboxWidget* myPriorityPF; + std::array myPF{nullptr}; + CheckboxWidget* myRefPF{nullptr}; + CheckboxWidget* myScorePF{nullptr}; + CheckboxWidget* myPriorityPF{nullptr}; - DelayQueueWidget* myDelayQueueWidget; + DelayQueueWidget* myDelayQueueWidget{nullptr}; // ID's for the various widgets // We need ID's, since there are more than one of several types of widgets diff --git a/src/debugger/gui/TiaZoomWidget.hxx b/src/debugger/gui/TiaZoomWidget.hxx index 6e1d04515..90f435528 100644 --- a/src/debugger/gui/TiaZoomWidget.hxx +++ b/src/debugger/gui/TiaZoomWidget.hxx @@ -55,13 +55,13 @@ class TiaZoomWidget : public Widget, public CommandSender private: unique_ptr myMenu; - int myZoomLevel; - int myNumCols, myNumRows; - int myOffX, myOffY; - int myOffXLo, myOffYLo; + int myZoomLevel{0}; + int myNumCols{0}, myNumRows{0}; + int myOffX{0}, myOffY{0}; + int myOffXLo{0}, myOffYLo{0}; - bool myMouseMoving; - int myClickX, myClickY; + bool myMouseMoving{false}; + int myClickX{0}, myClickY{0}; private: // Following constructors and assignment operators not supported diff --git a/src/debugger/gui/ToggleBitWidget.hxx b/src/debugger/gui/ToggleBitWidget.hxx index b7ef81181..c1fa1af45 100644 --- a/src/debugger/gui/ToggleBitWidget.hxx +++ b/src/debugger/gui/ToggleBitWidget.hxx @@ -35,8 +35,8 @@ class ToggleBitWidget : public ToggleWidget void drawWidget(bool hilite) override; protected: - StringList _offList; - StringList _onList; + StringList _offList; + StringList _onList; private: // Following constructors and assignment operators not supported diff --git a/src/debugger/gui/TogglePixelWidget.cxx b/src/debugger/gui/TogglePixelWidget.cxx index f917cc419..f4fe61468 100644 --- a/src/debugger/gui/TogglePixelWidget.cxx +++ b/src/debugger/gui/TogglePixelWidget.cxx @@ -25,11 +25,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TogglePixelWidget::TogglePixelWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int cols, int rows) - : ToggleWidget(boss, font, x, y, cols, rows, 1), - _pixelColor(kNone), - _backgroundColor(kDlgColor), - _swapBits(false), - _crossBits(false) + : ToggleWidget(boss, font, x, y, cols, rows, 1) { _rowHeight = _colWidth = font.getLineHeight(); diff --git a/src/debugger/gui/TogglePixelWidget.hxx b/src/debugger/gui/TogglePixelWidget.hxx index 7ee35847f..41766913e 100644 --- a/src/debugger/gui/TogglePixelWidget.hxx +++ b/src/debugger/gui/TogglePixelWidget.hxx @@ -41,9 +41,9 @@ class TogglePixelWidget : public ToggleWidget void setCrossed(bool enable) { _crossBits = enable; } private: - ColorId _pixelColor, _backgroundColor; - bool _swapBits; - bool _crossBits; + ColorId _pixelColor{kNone}, _backgroundColor{kDlgColor}; + bool _swapBits{false}; + bool _crossBits{false}; private: void drawWidget(bool hilite) override; diff --git a/src/emucore/AtariVox.cxx b/src/emucore/AtariVox.cxx index e877817bf..bc0dd1a4a 100644 --- a/src/emucore/AtariVox.cxx +++ b/src/emucore/AtariVox.cxx @@ -24,10 +24,7 @@ AtariVox::AtariVox(Jack jack, const Event& event, const System& system, const string& portname, const string& eepromfile, const onMessageCallback& callback) - : SaveKey(jack, event, system, eepromfile, callback, Controller::Type::AtariVox), - myShiftCount(0), - myShiftRegister(0), - myLastDataWriteCycle(0) + : SaveKey(jack, event, system, eepromfile, callback, Controller::Type::AtariVox) { mySerialPort = MediaFactory::createSerialPort(); if(mySerialPort->openPort(portname)) diff --git a/src/emucore/AtariVox.hxx b/src/emucore/AtariVox.hxx index 1dc4a840c..358e8655b 100644 --- a/src/emucore/AtariVox.hxx +++ b/src/emucore/AtariVox.hxx @@ -97,19 +97,19 @@ class AtariVox : public SaveKey unique_ptr mySerialPort; // How many bits have been shifted into the shift register? - uInt8 myShiftCount; + uInt8 myShiftCount{0}; // Shift register. Data comes in serially: // 1 start bit, always 0 // 8 data bits, LSB first // 1 stop bit, always 1 - uInt16 myShiftRegister; + uInt16 myShiftRegister{0}; // When did the last data write start, in CPU cycles? // The real SpeakJet chip reads data at 19200 bits/sec. Alex's // driver code sends data at 62 CPU cycles per bit, which is // "close enough". - uInt64 myLastDataWriteCycle; + uInt64 myLastDataWriteCycle{0}; // Holds information concerning serial port usage string myAboutString; diff --git a/src/emucore/Booster.cxx b/src/emucore/Booster.cxx index 29f90e924..3e931547c 100644 --- a/src/emucore/Booster.cxx +++ b/src/emucore/Booster.cxx @@ -20,8 +20,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - BoosterGrip::BoosterGrip(Jack jack, const Event& event, const System& system) - : Controller(jack, event, system, Controller::Type::BoosterGrip), - myControlID(-1) + : Controller(jack, event, system, Controller::Type::BoosterGrip) { if(myJack == Jack::Left) { diff --git a/src/emucore/Booster.hxx b/src/emucore/Booster.hxx index 79a5d932d..8aa1fb33d 100644 --- a/src/emucore/Booster.hxx +++ b/src/emucore/Booster.hxx @@ -80,7 +80,7 @@ class BoosterGrip : public Controller myXAxisValue, myYAxisValue; // Controller to emulate in normal mouse axis mode - int myControlID; + int myControlID{-1}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/Cart.cxx b/src/emucore/Cart.cxx index 319b9dcca..24af8697a 100644 --- a/src/emucore/Cart.cxx +++ b/src/emucore/Cart.cxx @@ -27,12 +27,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Cartridge::Cartridge(const Settings& settings, const string& md5) - : mySettings(settings), - myBankChanged(true), - myCodeAccessBase(nullptr), - myRamWriteAccess(0), - myStartBank(0), - myBankLocked(false) + : mySettings(settings) { auto to_uInt32 = [](const string& s, uInt32 pos) { return uInt32(std::stoul(s.substr(pos, 8), nullptr, 16)); diff --git a/src/emucore/Cart.hxx b/src/emucore/Cart.hxx index 220a9022f..69ed19a20 100644 --- a/src/emucore/Cart.hxx +++ b/src/emucore/Cart.hxx @@ -318,22 +318,22 @@ class Cartridge : public Device const Settings& mySettings; // Indicates if the bank has changed somehow (a bankswitch has occurred) - bool myBankChanged; + bool myBankChanged{true}; // The array containing information about every byte of ROM indicating // whether it is used as code. ByteBuffer myCodeAccessBase; // Contains address of illegal RAM write access or 0 - uInt16 myRamWriteAccess; + uInt16 myRamWriteAccess{0}; private: // The startup bank to use (where to look for the reset vector address) - uInt16 myStartBank; + uInt16 myStartBank{0}; // If myBankLocked is true, ignore attempts at bankswitching. This is used // by the debugger, when disassembling/dumping ROM. - bool myBankLocked; + bool myBankLocked{false}; // Semi-random values to use when a read from write port occurs std::array myRWPRandomValues; diff --git a/src/emucore/Cart0840.cxx b/src/emucore/Cart0840.cxx index bdce3222c..bc70f10d0 100644 --- a/src/emucore/Cart0840.cxx +++ b/src/emucore/Cart0840.cxx @@ -21,8 +21,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Cartridge0840::Cartridge0840(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) - : Cartridge(settings, md5), - myBankOffset(0) + : Cartridge(settings, md5) { // Copy the ROM image into my buffer std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin()); diff --git a/src/emucore/Cart0840.hxx b/src/emucore/Cart0840.hxx index 7da7c052c..c75c9c3e6 100644 --- a/src/emucore/Cart0840.hxx +++ b/src/emucore/Cart0840.hxx @@ -156,7 +156,7 @@ class Cartridge0840 : public Cartridge std::array myImage; // Indicates the offset into the ROM image (aligns to current bank) - uInt16 myBankOffset; + uInt16 myBankOffset{0}; // Previous Device's page access std::array myHotSpotPageAccess; diff --git a/src/emucore/Cart2K.hxx b/src/emucore/Cart2K.hxx index e3fc8834a..fe54bfb38 100644 --- a/src/emucore/Cart2K.hxx +++ b/src/emucore/Cart2K.hxx @@ -130,10 +130,10 @@ class Cartridge2K : public Cartridge ByteBuffer myImage; // Size of the ROM image - size_t mySize; + size_t mySize{0}; // Mask to use for mirroring - uInt16 myMask; + uInt16 myMask{0}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/Cart3E.cxx b/src/emucore/Cart3E.cxx index 8e86d7491..715d87358 100644 --- a/src/emucore/Cart3E.cxx +++ b/src/emucore/Cart3E.cxx @@ -23,8 +23,7 @@ Cartridge3E::Cartridge3E(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) : Cartridge(settings, md5), - mySize(size), - myCurrentBank(0) + mySize(size) { // Allocate array for the ROM image myImage = make_unique(mySize); diff --git a/src/emucore/Cart3E.hxx b/src/emucore/Cart3E.hxx index 5b755cc81..30620b452 100644 --- a/src/emucore/Cart3E.hxx +++ b/src/emucore/Cart3E.hxx @@ -188,10 +188,10 @@ class Cartridge3E : public Cartridge std::array myRAM; // Size of the ROM image - size_t mySize; + size_t mySize{0}; // Indicates which bank is currently active for the first segment - uInt16 myCurrentBank; + uInt16 myCurrentBank{0}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/Cart3EPlus.hxx b/src/emucore/Cart3EPlus.hxx index 5cecbf5c4..f61b5dc0d 100644 --- a/src/emucore/Cart3EPlus.hxx +++ b/src/emucore/Cart3EPlus.hxx @@ -191,7 +191,7 @@ class Cartridge3EPlus: public Cartridge static constexpr uInt16 RAM_WRITE_OFFSET = 0x200; ByteBuffer myImage; // Pointer to a dynamically allocated ROM image of the cartridge - size_t mySize; // Size of the ROM image + size_t mySize{0}; // Size of the ROM image std::array myRAM; private: diff --git a/src/emucore/Cart3F.cxx b/src/emucore/Cart3F.cxx index 85a36ee13..435a12057 100644 --- a/src/emucore/Cart3F.cxx +++ b/src/emucore/Cart3F.cxx @@ -23,8 +23,7 @@ Cartridge3F::Cartridge3F(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) : Cartridge(settings, md5), - mySize(size), - myCurrentBank(0) + mySize(size) { // Allocate array for the ROM image myImage = make_unique(mySize); diff --git a/src/emucore/Cart3F.hxx b/src/emucore/Cart3F.hxx index d26b396ea..b7ec2a4b4 100644 --- a/src/emucore/Cart3F.hxx +++ b/src/emucore/Cart3F.hxx @@ -162,10 +162,10 @@ class Cartridge3F : public Cartridge ByteBuffer myImage; // Size of the ROM image - size_t mySize; + size_t mySize{0}; // Indicates which bank is currently active for the first segment - uInt16 myCurrentBank; + uInt16 myCurrentBank{0}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/Cart4A50.cxx b/src/emucore/Cart4A50.cxx index 2e550e108..aaf376d62 100644 --- a/src/emucore/Cart4A50.cxx +++ b/src/emucore/Cart4A50.cxx @@ -24,15 +24,7 @@ Cartridge4A50::Cartridge4A50(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) : Cartridge(settings, md5), - mySize(size), - mySliceLow(0), - mySliceMiddle(0), - mySliceHigh(0), - myIsRomLow(true), - myIsRomMiddle(true), - myIsRomHigh(true), - myLastAddress(0), - myLastData(0) + mySize(size) { // Copy the ROM image into my buffer // Supported file sizes are 32/64/128K, which are duplicated if necessary diff --git a/src/emucore/Cart4A50.hxx b/src/emucore/Cart4A50.hxx index 90239aaee..40e1e9cee 100644 --- a/src/emucore/Cart4A50.hxx +++ b/src/emucore/Cart4A50.hxx @@ -225,21 +225,21 @@ class Cartridge4A50 : public Cartridge std::array myRAM; // (Actual) Size of the ROM image - size_t mySize; + size_t mySize{0}; // Indicates the slice mapped into each of the three segments - uInt16 mySliceLow; /* index pointer for $1000-$17ff slice */ - uInt16 mySliceMiddle; /* index pointer for $1800-$1dff slice */ - uInt16 mySliceHigh; /* index pointer for $1e00-$1eff slice */ + uInt16 mySliceLow{0}; // index pointer for $1000-$17ff slice + uInt16 mySliceMiddle{0}; // index pointer for $1800-$1dff slice + uInt16 mySliceHigh{0}; // index pointer for $1e00-$1eff slice // Indicates whether the given slice is mapped to ROM or RAM - bool myIsRomLow; /* true = ROM -- false = RAM at $1000-$17ff */ - bool myIsRomMiddle; /* true = ROM -- false = RAM at $1800-$1dff */ - bool myIsRomHigh; /* true = ROM -- false = RAM at $1e00-$1eFF */ + bool myIsRomLow{true}; // true = ROM -- false = RAM at $1000-$17ff + bool myIsRomMiddle{true}; // true = ROM -- false = RAM at $1800-$1dff + bool myIsRomHigh{true}; // true = ROM -- false = RAM at $1e00-$1eFF // The previous address and data values (from peek and poke) - uInt16 myLastAddress; - uInt8 myLastData; + uInt16 myLastAddress{0}; + uInt8 myLastData{0}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/CartAR.cxx b/src/emucore/CartAR.cxx index 094b2420f..642aa7213 100644 --- a/src/emucore/CartAR.cxx +++ b/src/emucore/CartAR.cxx @@ -23,13 +23,7 @@ CartridgeAR::CartridgeAR(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) : Cartridge(settings, md5), - mySize(std::max(size, 8448)), - myWriteEnabled(false), - myPower(true), - myDataHoldRegister(0), - myNumberOfDistinctAccesses(0), - myWritePending(false), - myCurrentBank(0) + mySize(std::max(size, 8448)) { // Create a load image buffer and copy the given image myLoadImages = make_unique(mySize); @@ -38,7 +32,8 @@ CartridgeAR::CartridgeAR(const ByteBuffer& image, size_t size, // Add header if image doesn't include it if(size < 8448) - std::copy_n(ourDefaultHeader.data(), ourDefaultHeader.size(), myLoadImages.get()+myImage.size()); + std::copy_n(ourDefaultHeader.data(), ourDefaultHeader.size(), + myLoadImages.get()+myImage.size()); // We use System::PageAccess.codeAccessBase, but don't allow its use // through a pointer, since the AR scheme doesn't support bankswitching diff --git a/src/emucore/CartAR.hxx b/src/emucore/CartAR.hxx index 2529c3e4a..3ad5495b8 100644 --- a/src/emucore/CartAR.hxx +++ b/src/emucore/CartAR.hxx @@ -196,31 +196,31 @@ class CartridgeAR : public Cartridge std::array myHeader; // Size of the ROM image - size_t mySize; + size_t mySize{0}; // All of the 8448 byte loads associated with the game ByteBuffer myLoadImages; // Indicates how many 8448 loads there are - uInt8 myNumberOfLoadImages; + uInt8 myNumberOfLoadImages{0}; // Indicates if the RAM is write enabled - bool myWriteEnabled; + bool myWriteEnabled{false}; // Indicates if the ROM's power is on or off - bool myPower; + bool myPower{true}; // Data hold register used for writing - uInt8 myDataHoldRegister; + uInt8 myDataHoldRegister{0}; // Indicates number of distinct accesses when data hold register was set - uInt32 myNumberOfDistinctAccesses; + uInt32 myNumberOfDistinctAccesses{0}; // Indicates if a write is pending or not - bool myWritePending; + bool myWritePending{false}; // Indicates which bank is currently active - uInt16 myCurrentBank; + uInt16 myCurrentBank{0}; // Fake SC-BIOS code to simulate the Supercharger load bars static std::array ourDummyROMCode; diff --git a/src/emucore/CartBF.cxx b/src/emucore/CartBF.cxx index 7ac9df7fc..4a0c4a567 100644 --- a/src/emucore/CartBF.cxx +++ b/src/emucore/CartBF.cxx @@ -21,8 +21,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeBF::CartridgeBF(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) - : Cartridge(settings, md5), - myBankOffset(0) + : Cartridge(settings, md5) { // Copy the ROM image into my buffer std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin()); diff --git a/src/emucore/CartBF.hxx b/src/emucore/CartBF.hxx index a5ede3780..183d797ed 100644 --- a/src/emucore/CartBF.hxx +++ b/src/emucore/CartBF.hxx @@ -157,7 +157,7 @@ class CartridgeBF : public Cartridge std::array myImage; // Indicates the offset into the ROM image (aligns to current bank) - uInt32 myBankOffset; + uInt32 myBankOffset{0}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/CartBFSC.cxx b/src/emucore/CartBFSC.cxx index 010e9fcf0..a756db956 100644 --- a/src/emucore/CartBFSC.cxx +++ b/src/emucore/CartBFSC.cxx @@ -21,8 +21,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeBFSC::CartridgeBFSC(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) - : Cartridge(settings, md5), - myBankOffset(0) + : Cartridge(settings, md5) { // Copy the ROM image into my buffer std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin()); diff --git a/src/emucore/CartBFSC.hxx b/src/emucore/CartBFSC.hxx index 6af2424ca..ec834a4b6 100644 --- a/src/emucore/CartBFSC.hxx +++ b/src/emucore/CartBFSC.hxx @@ -160,7 +160,7 @@ class CartridgeBFSC : public Cartridge std::array myRAM; // Indicates the offset into the ROM image (aligns to current bank) - uInt32 myBankOffset; + uInt32 myBankOffset{0}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/CartBUS.cxx b/src/emucore/CartBUS.cxx index 4f87e5b47..8560188be 100644 --- a/src/emucore/CartBUS.cxx +++ b/src/emucore/CartBUS.cxx @@ -43,10 +43,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeBUS::CartridgeBUS(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) - : Cartridge(settings, md5), - myAudioCycles(0), - myARMCycles(0), - myFractionalClocks(0.0) + : Cartridge(settings, md5) { // Copy the ROM image into my buffer std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin()); diff --git a/src/emucore/CartBUS.hxx b/src/emucore/CartBUS.hxx index 25a63194e..201b56ff8 100644 --- a/src/emucore/CartBUS.hxx +++ b/src/emucore/CartBUS.hxx @@ -214,13 +214,13 @@ class CartridgeBUS : public Cartridge std::array myImage; // Pointer to the 28K program ROM image of the cartridge - uInt8* myProgramImage; + uInt8* myProgramImage{nullptr}; // Pointer to the 4K display ROM image of the cartridge - uInt8* myDisplayImage; + uInt8* myDisplayImage{nullptr}; // Pointer to the 2K BUS driver image in RAM - uInt8* myBusDriverImage; + uInt8* myBusDriverImage{nullptr}; // The BUS 8k RAM image, used as: // $0000 - 2K BUS driver @@ -232,44 +232,44 @@ class CartridgeBUS : public Cartridge unique_ptr myThumbEmulator; // Indicates the offset into the ROM image (aligns to current bank) - uInt16 myBankOffset; + uInt16 myBankOffset{0}; // Address to override the bus for - uInt16 myBusOverdriveAddress; + uInt16 myBusOverdriveAddress{0}; // set to address of ZP if last byte peeked was $84 (STY ZP) - uInt16 mySTYZeroPageAddress; + uInt16 mySTYZeroPageAddress{0}; // set to address of the JMP operand if last byte peeked was 4C // *and* the next two bytes in ROM are 00 00 - uInt16 myJMPoperandAddress; + uInt16 myJMPoperandAddress{0}; // System cycle count from when the last update to music data fetchers occurred - uInt64 myAudioCycles; + uInt64 myAudioCycles{0}; // ARM cycle count from when the last callFunction() occurred - uInt64 myARMCycles; + uInt64 myARMCycles{0}; // The music mode counters - std::array myMusicCounters; + std::array myMusicCounters{0}; // The music frequency - std::array myMusicFrequencies; + std::array myMusicFrequencies{0}; // The music waveform sizes - std::array myMusicWaveformSize; + std::array myMusicWaveformSize{0}; // Fractional DPC music OSC clocks unused during the last update - double myFractionalClocks; + double myFractionalClocks{0.0}; // Controls mode, lower nybble sets Fast Fetch, upper nybble sets audio // -0 = Bus Stuffing ON // -F = Bus Stuffing OFF // 0- = Packed Digital Sample // F- = 3 Voice Music - uInt8 myMode; + uInt8 myMode{0}; - uInt8 myFastJumpActive; + uInt8 myFastJumpActive{false}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/CartCDF.cxx b/src/emucore/CartCDF.cxx index d14d3483c..144db7392 100644 --- a/src/emucore/CartCDF.cxx +++ b/src/emucore/CartCDF.cxx @@ -59,10 +59,7 @@ namespace { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeCDF::CartridgeCDF(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) - : Cartridge(settings, md5), - myAudioCycles(0), - myARMCycles(0), - myFractionalClocks(0.0) + : Cartridge(settings, md5) { // Copy the ROM image into my buffer std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin()); diff --git a/src/emucore/CartCDF.hxx b/src/emucore/CartCDF.hxx index 7c1e6aad4..002c31160 100644 --- a/src/emucore/CartCDF.hxx +++ b/src/emucore/CartCDF.hxx @@ -214,13 +214,13 @@ class CartridgeCDF : public Cartridge std::array myImage; // Pointer to the 28K program ROM image of the cartridge - uInt8* myProgramImage; + uInt8* myProgramImage{nullptr}; // Pointer to the 4K display ROM image of the cartridge - uInt8* myDisplayImage; + uInt8* myDisplayImage{nullptr}; // Pointer to the 2K CDF driver image in RAM - uInt8* myBusDriverImage; + uInt8* myBusDriverImage{nullptr}; // The CDF 8k RAM image, used as: // $0000 - 2K CDF driver @@ -232,13 +232,13 @@ class CartridgeCDF : public Cartridge unique_ptr myThumbEmulator; // Indicates the offset into the ROM image (aligns to current bank) - uInt16 myBankOffset; + uInt16 myBankOffset{0}; // System cycle count from when the last update to music data fetchers occurred - uInt64 myAudioCycles; + uInt64 myAudioCycles{0}; // ARM cycle count from when the last callFunction() occurred - uInt64 myARMCycles; + uInt64 myARMCycles{0}; // The audio routines in the driver run in 32-bit mode and take advantage // of the FIQ Shadow Registers which are not accessible to 16-bit thumb @@ -257,53 +257,53 @@ class CartridgeCDF : public Cartridge r14 = timer base */ // The music counters, ARM FIQ shadow registers r8, r9, r10 - std::array myMusicCounters; + std::array myMusicCounters{0}; // The music frequency, ARM FIQ shadow registers r11, r12, r13 - std::array myMusicFrequencies; + std::array myMusicFrequencies{0}; // The music waveform sizes - std::array myMusicWaveformSize; + std::array myMusicWaveformSize{0}; // Fractional CDF music, OSC clocks unused during the last update - double myFractionalClocks; + double myFractionalClocks{0.0}; // Controls mode, lower nybble sets Fast Fetch, upper nybble sets audio // -0 = Fast Fetch ON // -F = Fast Fetch OFF // 0- = Packed Digital Sample // F- = 3 Voice Music - uInt8 myMode; + uInt8 myMode{0xFF}; // set to address of #value if last byte peeked was A9 (LDA #) - uInt16 myLDAimmediateOperandAddress; + uInt16 myLDAimmediateOperandAddress{0}; // set to address of the JMP operand if last byte peeked was 4C // *and* the next two bytes in ROM are 00 00 - uInt16 myJMPoperandAddress; + uInt16 myJMPoperandAddress{0}; - uInt8 myFastJumpActive; + uInt8 myFastJumpActive{0}; // Pointer to the array of datastream pointers - uInt16 myDatastreamBase; + uInt16 myDatastreamBase{0}; // Pointer to the array of datastream increments - uInt16 myDatastreamIncrementBase; + uInt16 myDatastreamIncrementBase{0}; // Pointer to the beginning of the waveform data block - uInt16 myWaveformBase; + uInt16 myWaveformBase{0}; // Amplitude stream index - uInt8 myAmplitudeStream; + uInt8 myAmplitudeStream{0}; // Mask for determining the index of the datastream during fastjump - uInt8 myFastjumpStreamIndexMask; + uInt8 myFastjumpStreamIndexMask{0}; // The currently selected fastjump stream - uInt8 myFastJumpStream; + uInt8 myFastJumpStream{0}; // CDF subtype - CDFSubtype myCDFSubtype; + CDFSubtype myCDFSubtype{CDFSubtype::CDF0}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/CartCM.cxx b/src/emucore/CartCM.cxx index 37e889dd0..3bc41daba 100644 --- a/src/emucore/CartCM.cxx +++ b/src/emucore/CartCM.cxx @@ -23,9 +23,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeCM::CartridgeCM(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) - : Cartridge(settings, md5), - mySWCHA(0xFF), // portA is all 1's - myBankOffset(0) + : Cartridge(settings, md5) { // Copy the ROM image into my buffer std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin()); diff --git a/src/emucore/CartCM.hxx b/src/emucore/CartCM.hxx index 8b55be14a..8d5eeaac0 100644 --- a/src/emucore/CartCM.hxx +++ b/src/emucore/CartCM.hxx @@ -249,10 +249,10 @@ class CartridgeCM : public Cartridge std::array myRAM; // Current copy of SWCHA (controls ROM/RAM accesses) - uInt8 mySWCHA; + uInt8 mySWCHA{0xFF}; // Port A all 1's // Indicates the offset into the ROM image (aligns to current bank) - uInt16 myBankOffset; + uInt16 myBankOffset{0}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/CartCTY.cxx b/src/emucore/CartCTY.cxx index 2e9fd8390..966ade434 100644 --- a/src/emucore/CartCTY.cxx +++ b/src/emucore/CartCTY.cxx @@ -24,15 +24,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeCTY::CartridgeCTY(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) - : Cartridge(settings, md5), - myOperationType(0), - myTunePosition(0), - myLDAimmediate(false), - myRandomNumber(0x2B435044), - myRamAccessTimeout(0), - myAudioCycles(0), - myFractionalClocks(0.0), - myBankOffset(0) + : Cartridge(settings, md5) { // Copy the ROM image into my buffer std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin()); diff --git a/src/emucore/CartCTY.hxx b/src/emucore/CartCTY.hxx index 2766abad8..1ae33f0f8 100644 --- a/src/emucore/CartCTY.hxx +++ b/src/emucore/CartCTY.hxx @@ -269,45 +269,45 @@ class CartridgeCTY : public Cartridge std::array myRAM; // Operation type (written to $1000, used by hotspot $1FF4) - uInt8 myOperationType; + uInt8 myOperationType{0}; // Pointer to the 28K frequency table (points to the start of one // of seven 4K tunes in myTuneData) - const uInt8* myFrequencyImage; + const uInt8* myFrequencyImage{nullptr}; // The counter register for the data fetcher - uInt16 myTunePosition; + uInt16 myTunePosition{0}; // The music mode counters - std::array myMusicCounters; + std::array myMusicCounters{0}; // The music frequency - std::array myMusicFrequencies; + std::array myMusicFrequencies{0}; // Flags that last byte peeked was A9 (LDA #) - bool myLDAimmediate; + bool myLDAimmediate{false}; // The random number generator register - uInt32 myRandomNumber; + uInt32 myRandomNumber{0x2B435044}; // The time after which the first request of a load/save operation // will actually be completed // Due to Harmony EEPROM constraints, a read/write isn't instantaneous, // so we need to emulate the delay as well - uInt64 myRamAccessTimeout; + uInt64 myRamAccessTimeout{0}; // Full pathname of the file to use when emulating load/save // of internal RAM to Harmony cart EEPROM string myEEPROMFile; // System cycle count from when the last update to music data fetchers occurred - uInt64 myAudioCycles; + uInt64 myAudioCycles{0}; // Fractional DPC music OSC clocks unused during the last update - double myFractionalClocks; + double myFractionalClocks{0.0}; // Indicates the offset into the ROM image (aligns to current bank) - uInt16 myBankOffset; + uInt16 myBankOffset{0}; static const std::array ourFrequencyTable; diff --git a/src/emucore/CartCV.hxx b/src/emucore/CartCV.hxx index d0df0115f..746e2d86b 100644 --- a/src/emucore/CartCV.hxx +++ b/src/emucore/CartCV.hxx @@ -140,7 +140,7 @@ class CartridgeCV : public Cartridge std::array myImage; // Initial size of the cart data - size_t mySize; + size_t mySize{0}; // The 1024 bytes of RAM std::array myRAM; diff --git a/src/emucore/CartCVPlus.cxx b/src/emucore/CartCVPlus.cxx index 1f68e85f1..8cf305527 100644 --- a/src/emucore/CartCVPlus.cxx +++ b/src/emucore/CartCVPlus.cxx @@ -23,8 +23,7 @@ CartridgeCVPlus::CartridgeCVPlus(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) : Cartridge(settings, md5), - mySize(size), - myCurrentBank(0) + mySize(size) { // Allocate array for the ROM image myImage = make_unique(mySize); diff --git a/src/emucore/CartCVPlus.hxx b/src/emucore/CartCVPlus.hxx index 101018b51..c5da221d1 100644 --- a/src/emucore/CartCVPlus.hxx +++ b/src/emucore/CartCVPlus.hxx @@ -171,10 +171,10 @@ class CartridgeCVPlus : public Cartridge std::array myRAM; // Size of the ROM image - size_t mySize; + size_t mySize{0}; // Indicates which bank is currently active for the first segment - uInt16 myCurrentBank; + uInt16 myCurrentBank{0}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/CartDASH.hxx b/src/emucore/CartDASH.hxx index 8f2568e97..9f12e76db 100644 --- a/src/emucore/CartDASH.hxx +++ b/src/emucore/CartDASH.hxx @@ -121,7 +121,7 @@ class CartridgeDASHWidget; consecutive RAM (don't forget to copy your reset vectors!) @author Andrew Davie - */ +*/ class CartridgeDASH: public Cartridge { @@ -262,7 +262,7 @@ class CartridgeDASH: public Cartridge static constexpr uInt16 RAM_WRITE_OFFSET = 0x800; ByteBuffer myImage; // Pointer to a dynamically allocated ROM image of the cartridge - size_t mySize; // Size of the ROM image + size_t mySize{0}; // Size of the ROM image std::array myRAM; private: diff --git a/src/emucore/CartDF.cxx b/src/emucore/CartDF.cxx index 5114cda5f..83dc72fd1 100644 --- a/src/emucore/CartDF.cxx +++ b/src/emucore/CartDF.cxx @@ -21,8 +21,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeDF::CartridgeDF(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) - : Cartridge(settings, md5), - myBankOffset(0) + : Cartridge(settings, md5) { // Copy the ROM image into my buffer std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin()); diff --git a/src/emucore/CartDF.hxx b/src/emucore/CartDF.hxx index 55226a2b5..dbb42911b 100644 --- a/src/emucore/CartDF.hxx +++ b/src/emucore/CartDF.hxx @@ -157,7 +157,7 @@ class CartridgeDF : public Cartridge std::array myImage; // Indicates the offset into the ROM image (aligns to current bank) - uInt32 myBankOffset; + uInt32 myBankOffset{0}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/CartDFSC.cxx b/src/emucore/CartDFSC.cxx index 8978aa6a7..a6578bd1b 100644 --- a/src/emucore/CartDFSC.cxx +++ b/src/emucore/CartDFSC.cxx @@ -21,8 +21,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeDFSC::CartridgeDFSC(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) - : Cartridge(settings, md5), - myBankOffset(0) + : Cartridge(settings, md5) { // Copy the ROM image into my buffer std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin()); diff --git a/src/emucore/CartDFSC.hxx b/src/emucore/CartDFSC.hxx index 45635db46..5d02f69ec 100644 --- a/src/emucore/CartDFSC.hxx +++ b/src/emucore/CartDFSC.hxx @@ -160,7 +160,7 @@ class CartridgeDFSC : public Cartridge std::array myRAM; // Indicates the offset into the ROM image (aligns to current bank) - uInt32 myBankOffset; + uInt32 myBankOffset{0}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/CartDPC.cxx b/src/emucore/CartDPC.cxx index c3faaf0e4..02aa69060 100644 --- a/src/emucore/CartDPC.cxx +++ b/src/emucore/CartDPC.cxx @@ -23,11 +23,7 @@ CartridgeDPC::CartridgeDPC(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) : Cartridge(settings, md5), - mySize(size), - myAudioCycles(0), - myFractionalClocks(0.0), - myBankOffset(0), - myDpcPitch(0.0) + mySize(size) { // Make a copy of the entire image std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin()); @@ -38,18 +34,6 @@ CartridgeDPC::CartridgeDPC(const ByteBuffer& image, size_t size, // Pointer to the display ROM (2K @ 8K offset) myDisplayImage = myProgramImage + 8_KB; - - // Initialize the DPC data fetcher registers - myTops.fill(0); - myBottoms.fill(0); - myFlags.fill(0); - myCounters.fill(0); - - // None of the data fetchers are in music mode - myMusicMode.fill(false); - - // Initialize the DPC's random number generator register (must be non-zero) - myRandomNumber = 1; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/CartDPC.hxx b/src/emucore/CartDPC.hxx index 8a4018c35..87eaadfc9 100644 --- a/src/emucore/CartDPC.hxx +++ b/src/emucore/CartDPC.hxx @@ -175,43 +175,43 @@ class CartridgeDPC : public Cartridge std::array myImage; // (Actual) Size of the ROM image - size_t mySize; + size_t mySize{0}; // Pointer to the 8K program ROM image of the cartridge - uInt8* myProgramImage; + uInt8* myProgramImage{nullptr}; // Pointer to the 2K display ROM image of the cartridge - uInt8* myDisplayImage; + uInt8* myDisplayImage{nullptr}; // The top registers for the data fetchers - std::array myTops; + std::array myTops{0}; // The bottom registers for the data fetchers - std::array myBottoms; + std::array myBottoms{0}; // The counter registers for the data fetchers - std::array myCounters; + std::array myCounters{0}; // The flag registers for the data fetchers - std::array myFlags; + std::array myFlags{0}; // The music mode DF5, DF6, & DF7 enabled flags - std::array myMusicMode; + std::array myMusicMode{false}; // The random number generator register - uInt8 myRandomNumber; + uInt8 myRandomNumber{1}; // DPC's RNG register (must be non-zero) // System cycle count from when the last update to music data fetchers occurred - uInt64 myAudioCycles; + uInt64 myAudioCycles{0}; // Fractional DPC music OSC clocks unused during the last update - double myFractionalClocks; + double myFractionalClocks{0.0}; // Indicates the offset into the ROM image (aligns to current bank) - uInt16 myBankOffset; + uInt16 myBankOffset{0}; // DPC pitch - double myDpcPitch; + double myDpcPitch{0.0}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/CartDPCPlus.cxx b/src/emucore/CartDPCPlus.cxx index 7d0b884ef..0febf9bad 100644 --- a/src/emucore/CartDPCPlus.cxx +++ b/src/emucore/CartDPCPlus.cxx @@ -29,15 +29,7 @@ CartridgeDPCPlus::CartridgeDPCPlus(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) : Cartridge(settings, md5), - mySize(std::min(size, myImage.size())), - myFastFetch(false), - myLDAimmediate(false), - myParameterPointer(0), - myAudioCycles(0), - myARMCycles(0), - myFractionalClocks(0.0), - myBankOffset(0), - myFractionalLowMask(0x0F00FF) + mySize(std::min(size, myImage.size())) { // Image is always 32K, but in the case of ROM > 29K, the image is // copied to the end of the buffer diff --git a/src/emucore/CartDPCPlus.hxx b/src/emucore/CartDPCPlus.hxx index be833f922..6c77cb083 100644 --- a/src/emucore/CartDPCPlus.hxx +++ b/src/emucore/CartDPCPlus.hxx @@ -201,13 +201,13 @@ class CartridgeDPCPlus : public Cartridge private: // The ROM image and size std::array myImage; - size_t mySize; + size_t mySize{0}; // Pointer to the 24K program ROM image of the cartridge - uInt8* myProgramImage; + uInt8* myProgramImage{nullptr}; // Pointer to the 4K display ROM image of the cartridge - uInt8* myDisplayImage; + uInt8* myDisplayImage{nullptr}; // The DPC 8k RAM image, used as: // 3K DPC+ driver @@ -219,7 +219,7 @@ class CartridgeDPCPlus : public Cartridge unique_ptr myThumbEmulator; // Pointer to the 1K frequency table - uInt8* myFrequencyImage; + uInt8* myFrequencyImage{nullptr}; // The top registers for the data fetchers std::array myTops; @@ -237,16 +237,16 @@ class CartridgeDPCPlus : public Cartridge std::array myFractionalIncrements; // The Fast Fetcher Enabled flag - bool myFastFetch; + bool myFastFetch{false}; // Flags that last byte peeked was A9 (LDA #) - bool myLDAimmediate; + bool myLDAimmediate{false}; // Parameter for special functions std::array myParameter; // Parameter pointer for special functions - uInt8 myParameterPointer; + uInt8 myParameterPointer{0}; // The music mode counters std::array myMusicCounters; @@ -258,26 +258,26 @@ class CartridgeDPCPlus : public Cartridge std::array myMusicWaveforms; // The random number generator register - uInt32 myRandomNumber; + uInt32 myRandomNumber{1}; // System cycle count from when the last update to music data fetchers occurred - uInt64 myAudioCycles; + uInt64 myAudioCycles{0}; // System cycle count when the last Thumbulator::run() occurred - uInt64 myARMCycles; + uInt64 myARMCycles{0}; // Fractional DPC music OSC clocks unused during the last update - double myFractionalClocks; + double myFractionalClocks{0.0}; // Indicates the offset into the ROM image (aligns to current bank) - uInt16 myBankOffset; + uInt16 myBankOffset{0}; // Older DPC+ driver code had different behaviour wrt the mask used // to retrieve 'DFxFRACLOW' (fractional data pointer low byte) // ROMs built with an old DPC+ driver and using the newer mask can // result in 'jittering' in the playfield display // For current versions, this is 0x0F00FF; older versions need 0x0F0000 - uInt32 myFractionalLowMask; + uInt32 myFractionalLowMask{0x0F00FF}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/CartDetector.hxx b/src/emucore/CartDetector.hxx index f077e3ef4..7db39eeb4 100644 --- a/src/emucore/CartDetector.hxx +++ b/src/emucore/CartDetector.hxx @@ -260,7 +260,6 @@ class CartDetector */ static bool isProbablyX07(const ByteBuffer& image, size_t size); - private: // Following constructors and assignment operators not supported CartDetector() = delete; diff --git a/src/emucore/CartEF.cxx b/src/emucore/CartEF.cxx index 521e754c1..381d32eaa 100644 --- a/src/emucore/CartEF.cxx +++ b/src/emucore/CartEF.cxx @@ -21,8 +21,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeEF::CartridgeEF(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) - : Cartridge(settings, md5), - myBankOffset(0) + : Cartridge(settings, md5) { // Copy the ROM image into my buffer std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin()); diff --git a/src/emucore/CartEF.hxx b/src/emucore/CartEF.hxx index 558bf87f0..697746b78 100644 --- a/src/emucore/CartEF.hxx +++ b/src/emucore/CartEF.hxx @@ -157,7 +157,7 @@ class CartridgeEF : public Cartridge std::array myImage; // Indicates the offset into the ROM image (aligns to current bank) - uInt16 myBankOffset; + uInt16 myBankOffset{0}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/CartEFSC.cxx b/src/emucore/CartEFSC.cxx index 370beed68..376343b73 100644 --- a/src/emucore/CartEFSC.cxx +++ b/src/emucore/CartEFSC.cxx @@ -21,8 +21,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeEFSC::CartridgeEFSC(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) - : Cartridge(settings, md5), - myBankOffset(0) + : Cartridge(settings, md5) { // Copy the ROM image into my buffer std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin()); diff --git a/src/emucore/CartEFSC.hxx b/src/emucore/CartEFSC.hxx index 33bcd1857..a2c93b6dc 100644 --- a/src/emucore/CartEFSC.hxx +++ b/src/emucore/CartEFSC.hxx @@ -161,7 +161,7 @@ class CartridgeEFSC : public Cartridge std::array myRAM; // Indicates the offset into the ROM image (aligns to current bank) - uInt16 myBankOffset; + uInt16 myBankOffset{0}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/CartF0.cxx b/src/emucore/CartF0.cxx index 3677fa131..99fdea598 100644 --- a/src/emucore/CartF0.cxx +++ b/src/emucore/CartF0.cxx @@ -21,8 +21,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeF0::CartridgeF0(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) - : Cartridge(settings, md5), - myBankOffset(0) + : Cartridge(settings, md5) { // Copy the ROM image into my buffer std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin()); diff --git a/src/emucore/CartF0.hxx b/src/emucore/CartF0.hxx index 0ad75808b..a34459c96 100644 --- a/src/emucore/CartF0.hxx +++ b/src/emucore/CartF0.hxx @@ -163,7 +163,7 @@ class CartridgeF0 : public Cartridge std::array myImage; // Indicates the offset into the ROM image (aligns to current bank) - uInt16 myBankOffset; + uInt16 myBankOffset{0}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/CartF4.cxx b/src/emucore/CartF4.cxx index f24b19b91..01ede0ee1 100644 --- a/src/emucore/CartF4.cxx +++ b/src/emucore/CartF4.cxx @@ -22,8 +22,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeF4::CartridgeF4(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) - : Cartridge(settings, md5), - myBankOffset(0) + : Cartridge(settings, md5) { // Copy the ROM image into my buffer std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin()); diff --git a/src/emucore/CartF4.hxx b/src/emucore/CartF4.hxx index 2c03fcabd..a2b6af33c 100644 --- a/src/emucore/CartF4.hxx +++ b/src/emucore/CartF4.hxx @@ -156,7 +156,7 @@ class CartridgeF4 : public Cartridge std::array myImage; // Indicates the offset into the ROM image (aligns to current bank) - uInt16 myBankOffset; + uInt16 myBankOffset{0}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/CartF4SC.cxx b/src/emucore/CartF4SC.cxx index 42265636c..ef33a413b 100644 --- a/src/emucore/CartF4SC.cxx +++ b/src/emucore/CartF4SC.cxx @@ -21,8 +21,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeF4SC::CartridgeF4SC(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) - : Cartridge(settings, md5), - myBankOffset(0) + : Cartridge(settings, md5) { // Copy the ROM image into my buffer std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin()); diff --git a/src/emucore/CartF4SC.hxx b/src/emucore/CartF4SC.hxx index 155122d9e..18b85a289 100644 --- a/src/emucore/CartF4SC.hxx +++ b/src/emucore/CartF4SC.hxx @@ -160,7 +160,7 @@ class CartridgeF4SC : public Cartridge std::array myRAM; // Indicates the offset into the ROM image (aligns to current bank) - uInt16 myBankOffset; + uInt16 myBankOffset{0}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/CartF6.cxx b/src/emucore/CartF6.cxx index 133f58a1d..f0789a09f 100644 --- a/src/emucore/CartF6.cxx +++ b/src/emucore/CartF6.cxx @@ -21,8 +21,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeF6::CartridgeF6(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) - : Cartridge(settings, md5), - myBankOffset(0) + : Cartridge(settings, md5) { // Copy the ROM image into my buffer std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin()); diff --git a/src/emucore/CartF6.hxx b/src/emucore/CartF6.hxx index 275d0c57f..32d202168 100644 --- a/src/emucore/CartF6.hxx +++ b/src/emucore/CartF6.hxx @@ -156,7 +156,7 @@ class CartridgeF6 : public Cartridge std::array myImage; // Indicates the offset into the ROM image (aligns to current bank) - uInt16 myBankOffset; + uInt16 myBankOffset{0}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/CartF6SC.cxx b/src/emucore/CartF6SC.cxx index 05832809c..3e526bd6f 100644 --- a/src/emucore/CartF6SC.cxx +++ b/src/emucore/CartF6SC.cxx @@ -21,8 +21,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeF6SC::CartridgeF6SC(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) - : Cartridge(settings, md5), - myBankOffset(0) + : Cartridge(settings, md5) { // Copy the ROM image into my buffer std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin()); diff --git a/src/emucore/CartF6SC.hxx b/src/emucore/CartF6SC.hxx index d9a9d9493..641d1a108 100644 --- a/src/emucore/CartF6SC.hxx +++ b/src/emucore/CartF6SC.hxx @@ -160,7 +160,7 @@ class CartridgeF6SC : public Cartridge std::array myRAM; // Indicates the offset into the ROM image (aligns to current bank) - uInt16 myBankOffset; + uInt16 myBankOffset{0}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/CartF8.cxx b/src/emucore/CartF8.cxx index bfe4253c1..879eaccdc 100644 --- a/src/emucore/CartF8.cxx +++ b/src/emucore/CartF8.cxx @@ -21,8 +21,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeF8::CartridgeF8(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) - : Cartridge(settings, md5), - myBankOffset(0) + : Cartridge(settings, md5) { // Copy the ROM image into my buffer std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin()); diff --git a/src/emucore/CartF8.hxx b/src/emucore/CartF8.hxx index c72fd4db9..db57c0b25 100644 --- a/src/emucore/CartF8.hxx +++ b/src/emucore/CartF8.hxx @@ -156,7 +156,7 @@ class CartridgeF8 : public Cartridge std::array myImage; // Indicates the offset into the ROM image (aligns to current bank) - uInt16 myBankOffset; + uInt16 myBankOffset{0}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/CartF8SC.cxx b/src/emucore/CartF8SC.cxx index 0d148ed65..6c3738060 100644 --- a/src/emucore/CartF8SC.cxx +++ b/src/emucore/CartF8SC.cxx @@ -21,8 +21,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeF8SC::CartridgeF8SC(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) - : Cartridge(settings, md5), - myBankOffset(0) + : Cartridge(settings, md5) { // Copy the ROM image into my buffer std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin()); diff --git a/src/emucore/CartF8SC.hxx b/src/emucore/CartF8SC.hxx index 714c1ef44..9b8f5026f 100644 --- a/src/emucore/CartF8SC.hxx +++ b/src/emucore/CartF8SC.hxx @@ -160,7 +160,7 @@ class CartridgeF8SC : public Cartridge std::array myRAM; // Indicates the offset into the ROM image (aligns to current bank) - uInt16 myBankOffset; + uInt16 myBankOffset{0}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/CartFA.cxx b/src/emucore/CartFA.cxx index e62fea198..70219f518 100644 --- a/src/emucore/CartFA.cxx +++ b/src/emucore/CartFA.cxx @@ -21,8 +21,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeFA::CartridgeFA(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) - : Cartridge(settings, md5), - myBankOffset(0) + : Cartridge(settings, md5) { // Copy the ROM image into my buffer std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin()); diff --git a/src/emucore/CartFA.hxx b/src/emucore/CartFA.hxx index c5005fbf4..767f2e311 100644 --- a/src/emucore/CartFA.hxx +++ b/src/emucore/CartFA.hxx @@ -160,7 +160,7 @@ class CartridgeFA : public Cartridge std::array myRAM; // Indicates the offset into the ROM image (aligns to current bank) - uInt16 myBankOffset; + uInt16 myBankOffset{0}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/CartFA2.cxx b/src/emucore/CartFA2.cxx index c901f7e75..4af8c4360 100644 --- a/src/emucore/CartFA2.cxx +++ b/src/emucore/CartFA2.cxx @@ -24,10 +24,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeFA2::CartridgeFA2(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) - : Cartridge(settings, md5), - mySize(28_KB), - myRamAccessTimeout(0), - myBankOffset(0) + : Cartridge(settings, md5) { // 29/32K version of FA2 has valid data @ 1K - 29K const uInt8* img_ptr = image.get(); diff --git a/src/emucore/CartFA2.hxx b/src/emucore/CartFA2.hxx index 5f10b9651..86434688e 100644 --- a/src/emucore/CartFA2.hxx +++ b/src/emucore/CartFA2.hxx @@ -196,7 +196,7 @@ class CartridgeFA2 : public Cartridge std::array myImage; // Actual usable size of the ROM image - size_t mySize; + size_t mySize{28_KB}; // The 256 bytes of RAM on the cartridge std::array myRAM; @@ -205,14 +205,14 @@ class CartridgeFA2 : public Cartridge // will actually be completed // Due to flash RAM constraints, a read/write isn't instantaneous, // so we need to emulate the delay as well - uInt64 myRamAccessTimeout; + uInt64 myRamAccessTimeout{0}; // Full pathname of the file to use when emulating load/save // of internal RAM to Harmony cart flash string myFlashFile; // Indicates the offset into the ROM image (aligns to current bank) - uInt16 myBankOffset; + uInt16 myBankOffset{0}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/CartFC.cxx b/src/emucore/CartFC.cxx index f1d74f30d..c06320bff 100644 --- a/src/emucore/CartFC.cxx +++ b/src/emucore/CartFC.cxx @@ -22,10 +22,7 @@ CartridgeFC::CartridgeFC(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) : Cartridge(settings, md5), - mySize(size), - myBankOffset(0), - myCurrentBank(0), - myTargetBank(0) + mySize(size) { // Copy the ROM image into my buffer std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin()); diff --git a/src/emucore/CartFC.hxx b/src/emucore/CartFC.hxx index db9cb58e2..938aa40e9 100644 --- a/src/emucore/CartFC.hxx +++ b/src/emucore/CartFC.hxx @@ -159,16 +159,16 @@ class CartridgeFC : public Cartridge std::array myImage; // Size of the ROM image - size_t mySize; + size_t mySize{0}; // Indicates the offset into the ROM image (aligns to current bank) - uInt16 myBankOffset; + uInt16 myBankOffset{0}; // Indicates which bank is currently active for the first segment - uInt16 myCurrentBank; + uInt16 myCurrentBank{0}; // Target bank defined by writing to $1FF8/9 - uInt16 myTargetBank; + uInt16 myTargetBank{0}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/CartFE.cxx b/src/emucore/CartFE.cxx index a8458aea6..dec120238 100644 --- a/src/emucore/CartFE.cxx +++ b/src/emucore/CartFE.cxx @@ -22,9 +22,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeFE::CartridgeFE(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) - : Cartridge(settings, md5), - myBankOffset(0), - myLastAccessWasFE(false) + : Cartridge(settings, md5) { // Copy the ROM image into my buffer std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin()); diff --git a/src/emucore/CartFE.hxx b/src/emucore/CartFE.hxx index fc7e09af1..359b7497d 100644 --- a/src/emucore/CartFE.hxx +++ b/src/emucore/CartFE.hxx @@ -206,10 +206,10 @@ class CartridgeFE : public Cartridge std::array myImage; // Indicates the offset into the ROM image (aligns to current bank) - uInt16 myBankOffset; + uInt16 myBankOffset{0}; // Whether previous address by peek/poke equals $01FE (hotspot) - bool myLastAccessWasFE; + bool myLastAccessWasFE{false}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/CartMDM.cxx b/src/emucore/CartMDM.cxx index 3539a0167..7a67f67ef 100644 --- a/src/emucore/CartMDM.cxx +++ b/src/emucore/CartMDM.cxx @@ -21,10 +21,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeMDM::CartridgeMDM(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) - : Cartridge(settings, md5), - mySize(size), - myBankOffset(0), - myBankingDisabled(false) + : Cartridge(settings, md5) { // Allocate array for the ROM image myImage = make_unique(mySize); diff --git a/src/emucore/CartMDM.hxx b/src/emucore/CartMDM.hxx index 8006a24cb..7f60eec02 100644 --- a/src/emucore/CartMDM.hxx +++ b/src/emucore/CartMDM.hxx @@ -168,17 +168,17 @@ class CartridgeMDM : public Cartridge ByteBuffer myImage; // Size of the ROM image - size_t mySize; + size_t mySize{0}; // Previous Device's page access std::array myHotSpotPageAccess; // Indicates the offset into the ROM image (aligns to current bank) - uInt32 myBankOffset; + uInt32 myBankOffset{0}; // Indicates whether banking has been disabled due to a bankswitch // above bank 127 - bool myBankingDisabled; + bool myBankingDisabled{false}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/CartMNetwork.cxx b/src/emucore/CartMNetwork.cxx index 020f11e29..88a52ac95 100644 --- a/src/emucore/CartMNetwork.cxx +++ b/src/emucore/CartMNetwork.cxx @@ -22,9 +22,7 @@ CartridgeMNetwork::CartridgeMNetwork(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) : Cartridge(settings, md5), - mySize(size), - myCurrentRAM(0), - myRAMSlice(0) + mySize(size) { } diff --git a/src/emucore/CartMNetwork.hxx b/src/emucore/CartMNetwork.hxx index 6202c33ab..ec8c419b6 100644 --- a/src/emucore/CartMNetwork.hxx +++ b/src/emucore/CartMNetwork.hxx @@ -202,7 +202,7 @@ class CartridgeMNetwork : public Cartridge //uInt8 myImage[BANK_SIZE * 8]; // Size of the ROM image - size_t mySize; + size_t mySize{0}; // The 2K of RAM std::array myRAM; @@ -211,10 +211,10 @@ class CartridgeMNetwork : public Cartridge std::array myCurrentSlice; // Indicates which 256 byte bank of RAM is being used - uInt16 myCurrentRAM; + uInt16 myCurrentRAM{0}; // The number of the RAM slice (== bankCount() - 1) - uInt32 myRAMSlice; + uInt32 myRAMSlice{0}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/CartSB.cxx b/src/emucore/CartSB.cxx index c0464abec..a6c8eb9ab 100644 --- a/src/emucore/CartSB.cxx +++ b/src/emucore/CartSB.cxx @@ -21,9 +21,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeSB::CartridgeSB(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) - : Cartridge(settings, md5), - mySize(size), - myBankOffset(0) + : Cartridge(settings, md5) { // Allocate array for the ROM image myImage = make_unique(mySize); diff --git a/src/emucore/CartSB.hxx b/src/emucore/CartSB.hxx index b44f03db8..1a3841fb7 100644 --- a/src/emucore/CartSB.hxx +++ b/src/emucore/CartSB.hxx @@ -155,10 +155,10 @@ class CartridgeSB : public Cartridge private: // The 128-256K ROM image and size of the cartridge ByteBuffer myImage; - size_t mySize; + size_t mySize{0}; // Indicates the offset into the ROM image (aligns to current bank) - uInt32 myBankOffset; + uInt32 myBankOffset{0}; // Previous Device's page access std::array myHotSpotPageAccess; diff --git a/src/emucore/CartUA.cxx b/src/emucore/CartUA.cxx index 079ae8cc8..494b8fd76 100644 --- a/src/emucore/CartUA.cxx +++ b/src/emucore/CartUA.cxx @@ -23,7 +23,6 @@ CartridgeUA::CartridgeUA(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings, bool swapHotspots) : Cartridge(settings, md5), - myBankOffset(0), mySwappedHotspots(swapHotspots) { // Copy the ROM image into my buffer diff --git a/src/emucore/CartUA.hxx b/src/emucore/CartUA.hxx index 5b55d2e9c..a5277bc95 100644 --- a/src/emucore/CartUA.hxx +++ b/src/emucore/CartUA.hxx @@ -160,10 +160,10 @@ class CartridgeUA : public Cartridge std::array myHotSpotPageAccess; // Indicates the offset into the ROM image (aligns to current bank) - uInt16 myBankOffset; + uInt16 myBankOffset{0}; // Indicates if banks are swapped ("Mickey" cart) - bool mySwappedHotspots; + bool mySwappedHotspots{false}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/CartWD.cxx b/src/emucore/CartWD.cxx index 3bbf2ef6f..0baed893f 100644 --- a/src/emucore/CartWD.cxx +++ b/src/emucore/CartWD.cxx @@ -24,10 +24,7 @@ CartridgeWD::CartridgeWD(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) : Cartridge(settings, md5), - mySize(std::min(8_KB + 3, size)), - myCyclesAtBankswitchInit(0), - myPendingBank(0), - myCurrentBank(0) + mySize(std::min(8_KB + 3, size)) { // Copy the ROM image into my buffer if (mySize == 8_KB + 3) diff --git a/src/emucore/CartWD.hxx b/src/emucore/CartWD.hxx index 112e4bdfe..7b9e04742 100644 --- a/src/emucore/CartWD.hxx +++ b/src/emucore/CartWD.hxx @@ -207,7 +207,7 @@ class CartridgeWD : public Cartridge std::array myImage; // Indicates the actual size of the ROM image (either 8K or 8K + 3) - size_t mySize; + size_t mySize{0}; // The 64 bytes RAM of the cartridge std::array myRAM; @@ -219,13 +219,13 @@ class CartridgeWD : public Cartridge std::array myOffset; // Indicates the cycle at which a bankswitch was initiated - uInt64 myCyclesAtBankswitchInit; + uInt64 myCyclesAtBankswitchInit{0}; // Indicates the bank we wish to switch to in the future - uInt16 myPendingBank; + uInt16 myPendingBank{0}; // Indicates which bank is currently active - uInt16 myCurrentBank; + uInt16 myCurrentBank{0}; // The arrangement of banks to use on each hotspot read struct BankOrg { diff --git a/src/emucore/CartX07.cxx b/src/emucore/CartX07.cxx index 57b617e7d..02d394813 100644 --- a/src/emucore/CartX07.cxx +++ b/src/emucore/CartX07.cxx @@ -23,8 +23,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeX07::CartridgeX07(const ByteBuffer& image, size_t size, const string& md5, const Settings& settings) - : Cartridge(settings, md5), - myCurrentBank(0) + : Cartridge(settings, md5) { // Copy the ROM image into my buffer std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin()); diff --git a/src/emucore/CartX07.hxx b/src/emucore/CartX07.hxx index 04a995aba..2eaf7c751 100644 --- a/src/emucore/CartX07.hxx +++ b/src/emucore/CartX07.hxx @@ -166,7 +166,7 @@ class CartridgeX07 : public Cartridge std::array myImage; // Indicates which bank is currently active - uInt16 myCurrentBank; + uInt16 myCurrentBank{0}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/CompuMate.cxx b/src/emucore/CompuMate.cxx index 0620062c3..9f8fb6fb6 100644 --- a/src/emucore/CompuMate.cxx +++ b/src/emucore/CompuMate.cxx @@ -21,7 +21,6 @@ CompuMate::CompuMate(const Console& console, const Event& event, const System& system) : myConsole(console), - myColumn(0), myEvent(event) { // These controller pointers will be retrieved by the Console, which will diff --git a/src/emucore/CompuMate.hxx b/src/emucore/CompuMate.hxx index 3ba539593..f1dfe97ec 100644 --- a/src/emucore/CompuMate.hxx +++ b/src/emucore/CompuMate.hxx @@ -124,15 +124,13 @@ class CompuMate private: // Console and Event objects const Console& myConsole; + const Event& myEvent; // Left and right controllers unique_ptr myLeftController, myRightController; // Column currently active - uInt8 myColumn; - - /// Reference to the event object this controller uses - const Event& myEvent; + uInt8 myColumn{0}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/Console.cxx b/src/emucore/Console.cxx index 9387509be..5ac2a1479 100644 --- a/src/emucore/Console.cxx +++ b/src/emucore/Console.cxx @@ -77,11 +77,6 @@ Console::Console(OSystem& osystem, unique_ptr& cart, myEvent(osystem.eventHandler().event()), myProperties(props), myCart(std::move(cart)), - myDisplayFormat(""), // Unknown TV format @ start - myCurrentFormat(0), // Unknown format @ start, - myFormatAutodetected(false), - myUserPaletteDefined(false), - myConsoleTiming(ConsoleTiming::ntsc), myAudioSettings(audioSettings) { // Load user-defined palette for this ROM diff --git a/src/emucore/Console.hxx b/src/emucore/Console.hxx index 5a4eaeb67..55432a1ac 100644 --- a/src/emucore/Console.hxx +++ b/src/emucore/Console.hxx @@ -400,20 +400,20 @@ class Console : public Serializable, public ConsoleIO string myDisplayFormat; // Display format currently in use - uInt32 myCurrentFormat; + uInt32 myCurrentFormat{0}; // Is the TV format autodetected? - bool myFormatAutodetected; + bool myFormatAutodetected{false}; // Indicates whether an external palette was found and // successfully loaded - bool myUserPaletteDefined; + bool myUserPaletteDefined{false}; // Contains detailed info about this console ConsoleInfo myConsoleInfo; // Contains timing information for this console - ConsoleTiming myConsoleTiming; + ConsoleTiming myConsoleTiming{ConsoleTiming::ntsc}; // Emulation timing provider. This ties together the timing of the core emulation loop // and the parameters that govern audio synthesis diff --git a/src/emucore/Control.cxx b/src/emucore/Control.cxx index 569177f1f..09b291471 100644 --- a/src/emucore/Control.cxx +++ b/src/emucore/Control.cxx @@ -26,11 +26,8 @@ Controller::Controller(Jack jack, const Event& event, const System& system, : myJack(jack), myEvent(event), mySystem(system), - myType(type), - myOnAnalogPinUpdateCallback(nullptr) + myType(type) { - resetDigitalPins(); - resetAnalogPins(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/Control.hxx b/src/emucore/Control.hxx index 8b26f8588..aa85b9552 100644 --- a/src/emucore/Control.hxx +++ b/src/emucore/Control.hxx @@ -320,17 +320,17 @@ class Controller : public Serializable const System& mySystem; /// Specifies which type of controller this is (defined by child classes) - const Type myType; + const Type myType{Type::Unknown}; /// The callback that is dispatched whenver an analog pin has changed - onAnalogPinUpdateCallback myOnAnalogPinUpdateCallback; + onAnalogPinUpdateCallback myOnAnalogPinUpdateCallback{nullptr}; private: /// The boolean value on each digital pin - std::array myDigitalPinState; + std::array myDigitalPinState{true}; /// The analog value on each analog pin - std::array myAnalogPinValue; + std::array myAnalogPinValue{MAX_RESISTANCE}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/Driving.cxx b/src/emucore/Driving.cxx index 6332bdea6..5b634b15d 100644 --- a/src/emucore/Driving.cxx +++ b/src/emucore/Driving.cxx @@ -22,13 +22,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Driving::Driving(Jack jack, const Event& event, const System& system) - : Controller(jack, event, system, Controller::Type::Driving), - myCounter(0), - myGrayIndex(0), - myLastYaxis(0), - myControlID(-1), - myControlIDX(-1), - myControlIDY(-1) + : Controller(jack, event, system, Controller::Type::Driving) { if(myJack == Jack::Left) { diff --git a/src/emucore/Driving.hxx b/src/emucore/Driving.hxx index 911a6e170..8f64509a1 100644 --- a/src/emucore/Driving.hxx +++ b/src/emucore/Driving.hxx @@ -78,14 +78,14 @@ class Driving : public Controller private: // Counter to iterate through the gray codes - uInt32 myCounter; + uInt32 myCounter{0}; // Index into the gray code table - uInt32 myGrayIndex; + uInt32 myGrayIndex{0}; // Y axis value from last yaxis event that was used to generate a new // gray code - int myLastYaxis; + int myLastYaxis{0}; // Pre-compute the events we care about based on given port // This will eliminate test for left or right port in update() @@ -93,10 +93,10 @@ class Driving : public Controller myXAxisValue, myYAxisValue; // Controller to emulate in normal mouse axis mode - int myControlID; + int myControlID{-1}; // Controllers to emulate in 'specific' mouse axis mode - int myControlIDX, myControlIDY; + int myControlIDX{-1}, myControlIDY{-1}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/EmulationTiming.hxx b/src/emucore/EmulationTiming.hxx index 6f19db7c9..87d656539 100644 --- a/src/emucore/EmulationTiming.hxx +++ b/src/emucore/EmulationTiming.hxx @@ -25,7 +25,8 @@ class EmulationTiming { public: - EmulationTiming(FrameLayout frameLayout = FrameLayout::ntsc, ConsoleTiming consoleTiming = ConsoleTiming::ntsc); + EmulationTiming(FrameLayout frameLayout = FrameLayout::ntsc, + ConsoleTiming consoleTiming = ConsoleTiming::ntsc); EmulationTiming& updateFrameLayout(FrameLayout frameLayout); @@ -65,8 +66,8 @@ class EmulationTiming { private: - FrameLayout myFrameLayout; - ConsoleTiming myConsoleTiming; + FrameLayout myFrameLayout{FrameLayout::ntsc}; + ConsoleTiming myConsoleTiming{ConsoleTiming::ntsc}; uInt32 myPlaybackRate{44100}; uInt32 myPlaybackPeriod{512}; diff --git a/src/emucore/EventHandler.cxx b/src/emucore/EventHandler.cxx index dcb2cf696..88e9cc345 100644 --- a/src/emucore/EventHandler.cxx +++ b/src/emucore/EventHandler.cxx @@ -61,13 +61,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - EventHandler::EventHandler(OSystem& osystem) - : myOSystem(osystem), - myOverlay(nullptr), - myState(EventHandlerState::NONE), - myAllowAllDirectionsFlag(false), - myFryingFlag(false), - mySkipMouseMotion(true), - myIs7800(false) + : myOSystem(osystem) { // Create keyboard handler (to handle all physical keyboard functionality) myPKeyHandler = make_unique(osystem, *this); diff --git a/src/emucore/EventHandler.hxx b/src/emucore/EventHandler.hxx index f3eb0da56..c1cf384fe 100644 --- a/src/emucore/EventHandler.hxx +++ b/src/emucore/EventHandler.hxx @@ -416,7 +416,7 @@ class EventHandler private: // Structure used for action menu items struct ActionList { - Event::Type event; + Event::Type event{Event::NoType}; string action; string key; }; @@ -425,7 +425,7 @@ class EventHandler Event myEvent; // Indicates current overlay object - DialogContainer* myOverlay; + DialogContainer* myOverlay{nullptr}; // Handler for all keyboard-related events unique_ptr myPKeyHandler; @@ -438,21 +438,21 @@ class EventHandler unique_ptr myMouseControl; // Indicates the current state of the system (ie, which mode is current) - EventHandlerState myState; + EventHandlerState myState{EventHandlerState::NONE}; // Indicates whether the virtual joystick emulates 'impossible' directions - bool myAllowAllDirectionsFlag; + bool myAllowAllDirectionsFlag{false}; // Indicates whether or not we're in frying mode - bool myFryingFlag; + bool myFryingFlag{false}; // Sometimes an extraneous mouse motion event occurs after a video // state change; we detect when this happens and discard the event - bool mySkipMouseMotion; + bool mySkipMouseMotion{true}; // Whether the currently enabled console is emulating certain aspects // of the 7800 (for now, only the switches are notified) - bool myIs7800; + bool myIs7800{false}; // These constants are not meant to be used elsewhere; they are only used // here to make it easier for the reader to correctly size the list(s) diff --git a/src/emucore/Genesis.cxx b/src/emucore/Genesis.cxx index c26811a09..30e4055db 100644 --- a/src/emucore/Genesis.cxx +++ b/src/emucore/Genesis.cxx @@ -20,8 +20,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Genesis::Genesis(Jack jack, const Event& event, const System& system) - : Controller(jack, event, system, Controller::Type::Genesis), - myControlID(-1) + : Controller(jack, event, system, Controller::Type::Genesis) { if(myJack == Jack::Left) { diff --git a/src/emucore/Genesis.hxx b/src/emucore/Genesis.hxx index cb9b3dad1..fbf136660 100644 --- a/src/emucore/Genesis.hxx +++ b/src/emucore/Genesis.hxx @@ -81,7 +81,7 @@ class Genesis : public Controller myFire1Event, myFire2Event; // Controller to emulate in normal mouse axis mode - int myControlID; + int myControlID{-1}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/Joystick.cxx b/src/emucore/Joystick.cxx index 91af453b8..0a988eb73 100644 --- a/src/emucore/Joystick.cxx +++ b/src/emucore/Joystick.cxx @@ -20,8 +20,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Joystick::Joystick(Jack jack, const Event& event, const System& system) - : Controller(jack, event, system, Controller::Type::Joystick), - myControlID(-1) + : Controller(jack, event, system, Controller::Type::Joystick) { if(myJack == Jack::Left) { diff --git a/src/emucore/Joystick.hxx b/src/emucore/Joystick.hxx index 5af471000..eee7f0482 100644 --- a/src/emucore/Joystick.hxx +++ b/src/emucore/Joystick.hxx @@ -86,7 +86,7 @@ class Joystick : public Controller myXAxisValue, myYAxisValue, myFireEvent; // Controller to emulate in normal mouse axis mode - int myControlID; + int myControlID{-1}; static int _DEAD_ZONE; diff --git a/src/emucore/KidVid.cxx b/src/emucore/KidVid.cxx index 3c74b77d9..2181e73ca 100644 --- a/src/emucore/KidVid.cxx +++ b/src/emucore/KidVid.cxx @@ -24,21 +24,7 @@ KidVid::KidVid(Jack jack, const Event& event, const System& system, const string& romMd5) : Controller(jack, event, system, Controller::Type::KidVid), - myEnabled(myJack == Jack::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), - myBlockIdx(0) + myEnabled(myJack == Jack::Right) { // Right now, there are only two games that use the KidVid if(romMd5 == "ee6665683ebdb539e89ba620981cb0f6") diff --git a/src/emucore/KidVid.hxx b/src/emucore/KidVid.hxx index 30927c942..9c1812fe3 100644 --- a/src/emucore/KidVid.hxx +++ b/src/emucore/KidVid.hxx @@ -87,22 +87,22 @@ class KidVid : public Controller // Whether the KidVid device is enabled (only for games that it // supports, and if it's plugged into the right port - bool myEnabled; + bool myEnabled{false}; // The file handles for the WAV files // FILE *mySampleFile, *mySharedSampleFile; // Indicates if sample files have been successfully opened - bool myFileOpened; + bool myFileOpened{false}; // Is the tape currently 'busy' / in use? - bool myTapeBusy; + bool myTapeBusy{false}; - uInt32 myFilePointer, mySongCounter; - bool myBeep, mySharedData; - uInt8 mySampleByte; - uInt32 myGame, myTape; - uInt32 myIdx, myBlock, myBlockIdx; + uInt32 myFilePointer{0}, mySongCounter{0}; + bool myBeep{false}, mySharedData{false}; + uInt8 mySampleByte{0}; + uInt32 myGame{0}, myTape{0}; + uInt32 myIdx{0}, myBlock{0}, myBlockIdx{0}; // Number of blocks and data on tape static const std::array ourKVBlocks; diff --git a/src/emucore/M6532.cxx b/src/emucore/M6532.cxx index e0eb7ac11..7d80cbb34 100644 --- a/src/emucore/M6532.cxx +++ b/src/emucore/M6532.cxx @@ -30,13 +30,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - M6532::M6532(const ConsoleIO& console, const Settings& settings) : myConsole(console), - mySettings(settings), - myTimer(0), mySubTimer(0), myDivider(1), - myTimerWrapped(false), myWrappedThisCycle(false), - mySetTimerCycle(0), myLastCycle(0), - myDDRA(0), myDDRB(0), myOutA(0), myOutB(0), - myInterruptFlag(false), - myEdgeDetectPositive(false) + mySettings(settings) { } diff --git a/src/emucore/M6532.hxx b/src/emucore/M6532.hxx index 569dfda77..ed4937052 100644 --- a/src/emucore/M6532.hxx +++ b/src/emucore/M6532.hxx @@ -172,45 +172,45 @@ class M6532 : public Device std::array myRAM; // Current value of the timer - uInt8 myTimer; + uInt8 myTimer{0}; // Current number of clocks "queued" for the divider - uInt32 mySubTimer; + uInt32 mySubTimer{0}; // The divider - uInt32 myDivider; + uInt32 myDivider{1}; // Has the timer wrapped? - bool myTimerWrapped; - bool myWrappedThisCycle; + bool myTimerWrapped{false}; + bool myWrappedThisCycle{false}; // Cycle when the timer set. Debugging only. - uInt64 mySetTimerCycle; + uInt64 mySetTimerCycle{0}; // Last cycle considered in emu updates - uInt64 myLastCycle; + uInt64 myLastCycle{0}; // Data Direction Register for Port A - uInt8 myDDRA; + uInt8 myDDRA{0}; // Data Direction Register for Port B - uInt8 myDDRB; + uInt8 myDDRB{0}; // Last value written to Port A - uInt8 myOutA; + uInt8 myOutA{0}; // Last value written to Port B - uInt8 myOutB; + uInt8 myOutB{0}; // Interrupt Flag Register - uInt8 myInterruptFlag; + uInt8 myInterruptFlag{0}; // Used to determine whether an active transition on PA7 has occurred // True is positive edge-detect, false is negative edge-detect - bool myEdgeDetectPositive; + bool myEdgeDetectPositive{false}; // Last value written to the timer registers - std::array myOutTimer; + std::array myOutTimer{0}; // Accessible bits in the interrupt flag register // All other bits are always zeroed diff --git a/src/emucore/MT24LC256.cxx b/src/emucore/MT24LC256.cxx index 4c9cef8b9..349c3cb7b 100644 --- a/src/emucore/MT24LC256.cxx +++ b/src/emucore/MT24LC256.cxx @@ -47,27 +47,7 @@ MT24LC256::MT24LC256(const string& filename, const System& system, const Controller::onMessageCallback& callback) : mySystem(system), myCallback(callback), - mySDA(false), - mySCL(false), - myTimerActive(false), - myCyclesWhenTimerSet(0), - myCyclesWhenSDASet(0), - myCyclesWhenSCLSet(0), - myDataFile(filename), - myDataFileExists(false), - myDataChanged(false), - jpee_mdat(0), - jpee_sdat(0), - jpee_mclk(0), - jpee_sizemask(0), - jpee_pagemask(0), - jpee_smallmode(0), - jpee_logmode(0), - jpee_pptr(0), - jpee_state(0), - jpee_nb(0), - jpee_address(0), - jpee_ad_known(0) + myDataFile(filename) { // Load the data from an external file (if it exists) ifstream in(myDataFile, std::ios_base::binary); diff --git a/src/emucore/MT24LC256.hxx b/src/emucore/MT24LC256.hxx index feab2f36a..ff58dc777 100644 --- a/src/emucore/MT24LC256.hxx +++ b/src/emucore/MT24LC256.hxx @@ -98,31 +98,31 @@ class MT24LC256 std::array myPageHit; // Cached state of the SDA and SCL pins on the last write - bool mySDA, mySCL; + bool mySDA{false}, mySCL{false}; // Indicates that a timer has been set and hasn't expired yet - bool myTimerActive; + bool myTimerActive{false}; // Indicates when the timer was set - uInt64 myCyclesWhenTimerSet; + uInt64 myCyclesWhenTimerSet{0}; // Indicates when the SDA and SCL pins were set/written - uInt64 myCyclesWhenSDASet, myCyclesWhenSCLSet; + uInt64 myCyclesWhenSDASet{0}, myCyclesWhenSCLSet{0}; // The file containing the EEPROM data string myDataFile; // Indicates if a valid EEPROM data file exists/was successfully loaded - bool myDataFileExists; + bool myDataFileExists{false}; // Indicates if the EEPROM has changed since class invocation - bool myDataChanged; + bool myDataChanged{false}; // Required for I2C functionality - Int32 jpee_mdat, jpee_sdat, jpee_mclk; - Int32 jpee_sizemask, jpee_pagemask, jpee_smallmode, jpee_logmode; - Int32 jpee_pptr, jpee_state, jpee_nb; - uInt32 jpee_address, jpee_ad_known; + Int32 jpee_mdat{0}, jpee_sdat{0}, jpee_mclk{0}; + Int32 jpee_sizemask{0}, jpee_pagemask{0}, jpee_smallmode{0}, jpee_logmode{0}; + Int32 jpee_pptr{0}, jpee_state{0}, jpee_nb{0}; + uInt32 jpee_address{0}, jpee_ad_known{0}; std::array jpee_packet; private: diff --git a/src/emucore/MindLink.cxx b/src/emucore/MindLink.cxx index 481d13e65..bca8c92f1 100644 --- a/src/emucore/MindLink.cxx +++ b/src/emucore/MindLink.cxx @@ -20,10 +20,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - MindLink::MindLink(Jack jack, const Event& event, const System& system) - : Controller(jack, event, system, Controller::Type::MindLink), - myMindlinkPos(0x2800), - myMindlinkShift(1), - myMouseEnabled(false) + : Controller(jack, event, system, Controller::Type::MindLink) { setPin(DigitalPin::One, true); setPin(DigitalPin::Two, true); diff --git a/src/emucore/MindLink.hxx b/src/emucore/MindLink.hxx index 074f83eab..687b5daa5 100644 --- a/src/emucore/MindLink.hxx +++ b/src/emucore/MindLink.hxx @@ -107,13 +107,13 @@ class MindLink : public Controller private: // Position value in Mindlink controller // Gets transferred bitwise (16 bits) - int myMindlinkPos; + int myMindlinkPos{0x2800}; // Which bit to transfer next - int myMindlinkShift; + int myMindlinkShift{1}; // Whether to use the mouse to emulate this controller - int myMouseEnabled; + int myMouseEnabled{false}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/Paddles.cxx b/src/emucore/Paddles.cxx index df53a524c..601850018 100644 --- a/src/emucore/Paddles.cxx +++ b/src/emucore/Paddles.cxx @@ -23,10 +23,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Paddles::Paddles(Jack jack, const Event& event, const System& system, bool swappaddle, bool swapaxis, bool swapdir) - : Controller(jack, event, system, Controller::Type::Paddles), - myMPaddleID(-1), - myMPaddleIDX(-1), - myMPaddleIDY(-1) + : Controller(jack, event, system, Controller::Type::Paddles) { // We must start with minimum resistance; see commit // 38b452e1a047a0dca38c5bcce7c271d40f76736e for more information @@ -180,13 +177,6 @@ Paddles::Paddles(Jack jack, const Event& event, const System& system, setPin(DigitalPin::One, true); setPin(DigitalPin::Two, true); setPin(DigitalPin::Six, true); - - // Digital emulation of analog paddle movement - myKeyRepeat0 = myKeyRepeat1 = false; - myPaddleRepeat0 = myPaddleRepeat1 = myLastAxisX = myLastAxisY = 0; - - myCharge[0] = myCharge[1] = TRIGRANGE / 2; - myLastCharge[0] = myLastCharge[1] = 0; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/Paddles.hxx b/src/emucore/Paddles.hxx index 8eb510e17..e748b0509 100644 --- a/src/emucore/Paddles.hxx +++ b/src/emucore/Paddles.hxx @@ -132,6 +132,12 @@ class Paddles : public Controller static constexpr double MAX_RESISTANCE = 1400000.0; private: + // Range of values over which digital and mouse movement is scaled + // to paddle resistance + static constexpr int TRIGMIN = 1; + static constexpr int TRIGMAX = 4096; + static int TRIGRANGE; // This one is variable for the upper range + // Pre-compute the events we care about based on given port // This will eliminate test for left or right port in update() Event::Type myP0AxisValue, myP1AxisValue, @@ -141,20 +147,14 @@ class Paddles : public Controller myAxisMouseMotion; // The following are used for the various mouse-axis modes - int myMPaddleID; // paddle to emulate in 'automatic' mode - int myMPaddleIDX, myMPaddleIDY; // paddles to emulate in 'specific axis' mode + int myMPaddleID{-1}; // paddle to emulate in 'automatic' mode + int myMPaddleIDX{-1}, myMPaddleIDY{-1}; // paddles to emulate in 'specific axis' mode - bool myKeyRepeat0, myKeyRepeat1; - int myPaddleRepeat0, myPaddleRepeat1; - std::array myCharge, myLastCharge; - int myLastAxisX, myLastAxisY; - int myAxisDigitalZero, myAxisDigitalOne; - - // Range of values over which digital and mouse movement is scaled - // to paddle resistance - static constexpr int TRIGMIN = 1; - static constexpr int TRIGMAX = 4096; - static int TRIGRANGE; // This one is variable for the upper range + bool myKeyRepeat0{false}, myKeyRepeat1{false}; + int myPaddleRepeat0{0}, myPaddleRepeat1{0}; + std::array myCharge{TRIGRANGE / 2}, myLastCharge{0}; + int myLastAxisX{0}, myLastAxisY{0}; + int myAxisDigitalZero{0}, myAxisDigitalOne{0}; static int DIGITAL_SENSITIVITY, DIGITAL_DISTANCE; static int DEJITTER_BASE, DEJITTER_DIFF; diff --git a/src/emucore/PointingDevice.cxx b/src/emucore/PointingDevice.cxx index dfe357f48..507998730 100644 --- a/src/emucore/PointingDevice.cxx +++ b/src/emucore/PointingDevice.cxx @@ -27,14 +27,7 @@ PointingDevice::PointingDevice(Jack jack, const Event& event, const System& system, Controller::Type type, float sensitivity) : Controller(jack, event, system, type), - mySensitivity(sensitivity), - myHCounterRemainder(0.0), myVCounterRemainder(0.0), - myTrackBallLinesH(1), myTrackBallLinesV(1), - myTrackBallLeft(false), myTrackBallDown(false), - myCountH(0), myCountV(0), - myScanCountH(0), myScanCountV(0), - myFirstScanOffsetH(0), myFirstScanOffsetV(0), - myMouseEnabled(false) + mySensitivity(sensitivity) { // The code in ::read() is set up to always return IOPortA values in // the lower 4 bits data value diff --git a/src/emucore/PointingDevice.hxx b/src/emucore/PointingDevice.hxx index ffd27f6a4..820b4f1f7 100644 --- a/src/emucore/PointingDevice.hxx +++ b/src/emucore/PointingDevice.hxx @@ -95,8 +95,6 @@ class PointingDevice : public Controller // IOPortA values are calculated virtual uInt8 ioPortA(uInt8 countH, uInt8 countV, uInt8 left, uInt8 down) = 0; -// virtual string pointingDeviceName() const = 0; - private: void updateDirection(int counter, float& counterRemainder, bool& trackBallDir, int& trackBallLines, @@ -104,28 +102,28 @@ class PointingDevice : public Controller private: // Mouse input to sensitivity emulation - float mySensitivity, myHCounterRemainder, myVCounterRemainder; + float mySensitivity{0.F}, myHCounterRemainder{0.F}, myVCounterRemainder{0.F}; // How many lines to wait between sending new horz and vert values - int myTrackBallLinesH, myTrackBallLinesV; + int myTrackBallLinesH{1}, myTrackBallLinesV{1}; // Was TrackBall moved left or moved right instead - bool myTrackBallLeft; + bool myTrackBallLeft{false}; // Was TrackBall moved down or moved up instead - bool myTrackBallDown; + bool myTrackBallDown{false}; // Counter to iterate through the gray codes - uInt8 myCountH, myCountV; + uInt8 myCountH{0}, myCountV{0}; // Next scanline for change - int myScanCountH, myScanCountV; + int myScanCountH{0}, myScanCountV{0}; // Offset factor for first scanline, 0..(1 << 12 - 1) - int myFirstScanOffsetH, myFirstScanOffsetV; + int myFirstScanOffsetH{0}, myFirstScanOffsetV{0}; // Whether to use the mouse to emulate this controller - bool myMouseEnabled; + bool myMouseEnabled{false}; // User-defined sensitivity; adjustable since end-users may have different // mouse speeds diff --git a/src/emucore/Random.hxx b/src/emucore/Random.hxx index 5368cfb1e..3e8c18ad3 100644 --- a/src/emucore/Random.hxx +++ b/src/emucore/Random.hxx @@ -103,7 +103,7 @@ class Random : public Serializable // calling next() should change internal state (ie, the *logical* // state of the object shouldn't change just by asking for another // random number) - mutable uInt32 myValue; + mutable uInt32 myValue{0}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/SaveKey.cxx b/src/emucore/SaveKey.cxx index b9546b5cc..a73b4ac19 100644 --- a/src/emucore/SaveKey.cxx +++ b/src/emucore/SaveKey.cxx @@ -24,10 +24,9 @@ SaveKey::SaveKey(Jack jack, const Event& event, const System& system, const string& eepromfile, const onMessageCallback& callback, Type type) - : Controller(jack, event, system, type) + : Controller(jack, event, system, type), + myEEPROM(make_unique(eepromfile, system, callback)) { - myEEPROM = make_unique(eepromfile, system, callback); - setPin(DigitalPin::One, true); setPin(DigitalPin::Two, true); } diff --git a/src/emucore/Switches.cxx b/src/emucore/Switches.cxx index 2018d2806..802c31085 100644 --- a/src/emucore/Switches.cxx +++ b/src/emucore/Switches.cxx @@ -23,9 +23,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Switches::Switches(const Event& event, const Properties& properties, const Settings& settings) - : myEvent(event), - mySwitches(0xFF), - myIs7800(false) + : myEvent(event) { if(properties.get(PropType::Console_RightDiff) == "B") { diff --git a/src/emucore/Switches.hxx b/src/emucore/Switches.hxx index d5f6c5b5b..7ff5273cd 100644 --- a/src/emucore/Switches.hxx +++ b/src/emucore/Switches.hxx @@ -127,10 +127,10 @@ class Switches : public Serializable const Event& myEvent; // State of the console switches - uInt8 mySwitches; + uInt8 mySwitches{0xFF}; // Are we in 7800 or 2600 mode? - bool myIs7800; + bool myIs7800{false}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/TIASurface.cxx b/src/emucore/TIASurface.cxx index fede32436..2698a6cc9 100644 --- a/src/emucore/TIASurface.cxx +++ b/src/emucore/TIASurface.cxx @@ -37,11 +37,7 @@ namespace { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TIASurface::TIASurface(OSystem& system) : myOSystem(system), - myFB(system.frameBuffer()), - myTIA(nullptr), - myFilter(Filter::Normal), - myScanlinesEnabled(false), - mySaveSnapFlag(false) + myFB(system.frameBuffer()) { // Load NTSC filter settings myNTSCFilter.loadConfig(myOSystem.settings()); diff --git a/src/emucore/TIASurface.hxx b/src/emucore/TIASurface.hxx index 61635c61e..469c687dd 100644 --- a/src/emucore/TIASurface.hxx +++ b/src/emucore/TIASurface.hxx @@ -146,7 +146,7 @@ class TIASurface private: OSystem& myOSystem; FrameBuffer& myFB; - TIA* myTIA; + TIA* myTIA{nullptr}; shared_ptr myTiaSurface, mySLineSurface, myBaseTiaSurface; @@ -158,7 +158,7 @@ class TIASurface BlarggNormal = 0x10, BlarggPhosphor = 0x11 }; - Filter myFilter; + Filter myFilter{Filter::Normal}; // NTSC object to use in TIA rendering mode NTSCFilter myNTSCFilter; @@ -175,13 +175,13 @@ class TIASurface ///////////////////////////////////////////////////////////// // Use scanlines in TIA rendering mode - bool myScanlinesEnabled; + bool myScanlinesEnabled{false}; // Palette for normal TIA rendering mode PaletteArray myPalette; // Flag for saving a snapshot - bool mySaveSnapFlag; + bool mySaveSnapFlag{false}; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/Thumbulator.cxx b/src/emucore/Thumbulator.cxx index d03193b3d..2c65bb7d0 100644 --- a/src/emucore/Thumbulator.cxx +++ b/src/emucore/Thumbulator.cxx @@ -60,8 +60,6 @@ Thumbulator::Thumbulator(const uInt16* rom_ptr, uInt16* ram_ptr, uInt16 rom_size romSize(rom_size), decodedRom(make_unique(romSize / 2)), // NOLINT ram(ram_ptr), - T1TCR(0), - T1TC(0), configuration(configurefor), myCartridge(cartridge) { diff --git a/src/emucore/Thumbulator.hxx b/src/emucore/Thumbulator.hxx index 6e7168099..5085fb8fe 100644 --- a/src/emucore/Thumbulator.hxx +++ b/src/emucore/Thumbulator.hxx @@ -185,28 +185,28 @@ class Thumbulator int reset(); private: - const uInt16* rom; - uInt16 romSize; + const uInt16* rom{nullptr}; + uInt16 romSize{0}; const unique_ptr decodedRom; // NOLINT - uInt16* ram; + uInt16* ram{nullptr}; std::array reg_norm; // normal execution mode, do not have a thread mode - uInt32 cpsr, mamcr; - bool handler_mode; - uInt32 systick_ctrl, systick_reload, systick_count, systick_calibrate; + uInt32 cpsr{0}, mamcr{0}; + bool handler_mode{false}; + uInt32 systick_ctrl{0}, systick_reload{0}, systick_count{0}, systick_calibrate{0}; #ifndef UNSAFE_OPTIMIZATIONS - uInt64 instructions; + uInt64 instructions{0}; #endif #ifndef NO_THUMB_STATS - uInt64 fetches, reads, writes; + uInt64 fetches{0}, reads{0}, writes{0}; #endif // For emulation of LPC2103's timer 1, used for NTSC/PAL/SECAM detection. // Register names from documentation: // http://www.nxp.com/documents/user_manual/UM10161.pdf - uInt32 T1TCR; // Timer 1 Timer Control Register - uInt32 T1TC; // Timer 1 Timer Counter - double timing_factor; + uInt32 T1TCR{0}; // Timer 1 Timer Control Register + uInt32 T1TC{0}; // Timer 1 Timer Counter + double timing_factor{0.0}; #ifndef UNSAFE_OPTIMIZATIONS ostringstream statusMsg; diff --git a/src/emucore/tia/AudioChannel.cxx b/src/emucore/tia/AudioChannel.cxx index e5599df95..cdb68ccfe 100644 --- a/src/emucore/tia/AudioChannel.cxx +++ b/src/emucore/tia/AudioChannel.cxx @@ -17,12 +17,6 @@ #include "AudioChannel.hxx" -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -AudioChannel::AudioChannel() -{ - reset(); -} - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void AudioChannel::reset() { diff --git a/src/emucore/tia/AudioChannel.hxx b/src/emucore/tia/AudioChannel.hxx index 716fb2d30..793a4ebef 100644 --- a/src/emucore/tia/AudioChannel.hxx +++ b/src/emucore/tia/AudioChannel.hxx @@ -24,7 +24,7 @@ class AudioChannel : public Serializable { public: - AudioChannel(); + AudioChannel() = default; void reset(); @@ -45,18 +45,18 @@ class AudioChannel : public Serializable bool load(Serializer& in) override; private: - uInt8 myAudc; - uInt8 myAudv; - uInt8 myAudf; + uInt8 myAudc{0}; + uInt8 myAudv{0}; + uInt8 myAudf{0}; - bool myClockEnable; - bool myNoiseFeedback; - bool myNoiseCounterBit4; - bool myPulseCounterHold; + bool myClockEnable{false}; + bool myNoiseFeedback{false}; + bool myNoiseCounterBit4{false}; + bool myPulseCounterHold{false}; - uInt8 myDivCounter; - uInt8 myPulseCounter; - uInt8 myNoiseCounter; + uInt8 myDivCounter{0}; + uInt8 myPulseCounter{0}; + uInt8 myNoiseCounter{0}; private: AudioChannel(const AudioChannel&) = delete; diff --git a/src/emucore/tia/Ball.cxx b/src/emucore/tia/Ball.cxx index 631bc8a6a..620b88611 100644 --- a/src/emucore/tia/Ball.cxx +++ b/src/emucore/tia/Ball.cxx @@ -20,12 +20,8 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Ball::Ball(uInt32 collisionMask) - : myCollisionMaskDisabled(collisionMask), - myCollisionMaskEnabled(0xFFFF), - myIsSuppressed(false), - myTIA(nullptr) + : myCollisionMaskDisabled(collisionMask) { - reset(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -47,7 +43,6 @@ void Ball::reset() myIsRendering = false; myDebugEnabled = false; myRenderCounter = 0; - myIsEnabled = false; myInvertedPhaseClock = false; myUseInvertedPhaseClock = false; } diff --git a/src/emucore/tia/Ball.hxx b/src/emucore/tia/Ball.hxx index 3d7ff67b5..e0297ebb9 100644 --- a/src/emucore/tia/Ball.hxx +++ b/src/emucore/tia/Ball.hxx @@ -182,14 +182,14 @@ class Ball : public Serializable abused to store visibility (as the actual collision bit will always be zero if collisions are disabled). */ - uInt32 collision; + uInt32 collision{0}; /** The movement flag. This corresponds to the state of the movement latch for this sprite --- true while movement is active and ticks are still propagated to the counters, false otherwise. */ - bool isMoving; + bool isMoving{false}; private: @@ -220,113 +220,113 @@ class Ball : public Serializable Collision mask values for active / inactive states. Disabling collisions will change those. */ - uInt32 myCollisionMaskDisabled; - uInt32 myCollisionMaskEnabled; + uInt32 myCollisionMaskDisabled{0}; + uInt32 myCollisionMaskEnabled{0xFFFF}; /** Color value calculated by applyColors(). */ - uInt8 myColor; + uInt8 myColor{0}; /** Color configured by COLUPF */ - uInt8 myObjectColor; + uInt8 myObjectColor{0}; /** Color for debug mode. */ - uInt8 myDebugColor; + uInt8 myDebugColor{0}; /** Debug mode enabled? */ - bool myDebugEnabled; + bool myDebugEnabled{false}; /** "old" and "new" values of the enabled flag. */ - bool myIsEnabledOld; - bool myIsEnabledNew; + bool myIsEnabledOld{false}; + bool myIsEnabledNew{false}; /** Actual value of the enabled flag. Determined from the "old" and "new" values VDEL, debug settings etc. */ - bool myIsEnabled; + bool myIsEnabled{false}; /** Is the sprite turned off in the debugger? */ - bool myIsSuppressed; + bool myIsSuppressed{false}; /** Is VDEL active? */ - bool myIsDelaying; + bool myIsDelaying{false}; /** Is the ball sprite signal currently active? */ - bool mySignalActive; + bool mySignalActive{false}; /** HMM clocks before movement stops. Changed by writing to HMBL. */ - uInt8 myHmmClocks; + uInt8 myHmmClocks{0}; /** The sprite counter */ - uInt8 myCounter; + uInt8 myCounter{0}; /** Ball width, as configured by CTRLPF. */ - uInt8 myWidth; + uInt8 myWidth{1}; /** Effective width used for drawing. This is usually the same as myWidth, but my differ in starfield mode. */ - uInt8 myEffectiveWidth; + uInt8 myEffectiveWidth{1}; /** The value of the counter value at which the last movement tick occurred. This is used for simulating the starfield pattern. */ - uInt8 myLastMovementTick; + uInt8 myLastMovementTick{0}; /** Are we currently rendering? This is latched when the counter hits it decode value, or when RESBL is strobed. It is turned off once the render counter reaches its maximum (i.e. when the sprite has been fully displayed). */ - bool myIsRendering; + bool myIsRendering{false}; /** Rendering counter. It starts counting (below zero) when the counter hits the decode value, and the actual signal becomes active once it reaches 0. */ - Int8 myRenderCounter; + Int8 myRenderCounter{0}; /** This memorizes a movement tick outside HBLANK in inverted clock mode. It is latched durin ::movementTick() and processed during ::tick() where it inhibits the clock pulse. */ - bool myInvertedPhaseClock; + bool myInvertedPhaseClock{false}; /** Use "inverted movement clock phase" mode? This emulates an idiosyncracy of several newer TIA revisions (see the setter above for a deeper explanation). */ - bool myUseInvertedPhaseClock; + bool myUseInvertedPhaseClock{false}; /** TIA instance. Required for flushing the line cache and requesting collision updates. */ - TIA* myTIA; + TIA* myTIA{nullptr}; private: Ball() = delete; diff --git a/src/emucore/tia/DelayQueueIteratorImpl.hxx b/src/emucore/tia/DelayQueueIteratorImpl.hxx index 00e14a0ec..ac5bd5027 100644 --- a/src/emucore/tia/DelayQueueIteratorImpl.hxx +++ b/src/emucore/tia/DelayQueueIteratorImpl.hxx @@ -46,8 +46,8 @@ class DelayQueueIteratorImpl : public DelayQueueIterator private: const DelayQueue& myDelayQueue; - uInt8 myDelayCycle; - uInt8 myIndex; + uInt8 myDelayCycle{0}; + uInt8 myIndex{0}; }; // ############################################################################ @@ -59,9 +59,7 @@ template DelayQueueIteratorImpl::DelayQueueIteratorImpl( const DelayQueue& delayQueue ) - : myDelayQueue(delayQueue), - myDelayCycle(0), - myIndex(0) + : myDelayQueue(delayQueue) { while (myDelayQueue.myMembers[currentIndex()].mySize == 0 && isValid()) myDelayCycle++; diff --git a/src/emucore/tia/DrawCounterDecodes.hxx b/src/emucore/tia/DrawCounterDecodes.hxx index 834a15edd..2ff8135c3 100644 --- a/src/emucore/tia/DrawCounterDecodes.hxx +++ b/src/emucore/tia/DrawCounterDecodes.hxx @@ -36,9 +36,9 @@ class DrawCounterDecodes private: - uInt8* myPlayerDecodes[8]; + uInt8* myPlayerDecodes[8]{nullptr}; - uInt8* myMissileDecodes[8]; + uInt8* myMissileDecodes[8]{nullptr}; uInt8 myDecodes0[160], myDecodes1[160], myDecodes2[160], myDecodes3[160], myDecodes4[160], myDecodes6[160]; diff --git a/src/emucore/tia/LatchedInput.cxx b/src/emucore/tia/LatchedInput.cxx index 2c6dcf90d..9a2982296 100644 --- a/src/emucore/tia/LatchedInput.cxx +++ b/src/emucore/tia/LatchedInput.cxx @@ -17,12 +17,6 @@ #include "LatchedInput.hxx" -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -LatchedInput::LatchedInput() -{ - reset(); -} - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void LatchedInput::reset() { diff --git a/src/emucore/tia/LatchedInput.hxx b/src/emucore/tia/LatchedInput.hxx index 5cb066ad3..672dce625 100644 --- a/src/emucore/tia/LatchedInput.hxx +++ b/src/emucore/tia/LatchedInput.hxx @@ -24,7 +24,7 @@ class LatchedInput : public Serializable { public: - LatchedInput(); + LatchedInput() = default; public: @@ -42,8 +42,8 @@ class LatchedInput : public Serializable bool load(Serializer& in) override; private: - bool myModeLatched; - uInt8 myLatchedValue; + bool myModeLatched{false}; + uInt8 myLatchedValue{0}; private: LatchedInput(const LatchedInput&) = delete; diff --git a/src/emucore/tia/Missile.cxx b/src/emucore/tia/Missile.cxx index 89fdc607d..ceef11013 100644 --- a/src/emucore/tia/Missile.cxx +++ b/src/emucore/tia/Missile.cxx @@ -21,13 +21,8 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Missile::Missile(uInt32 collisionMask) - : myCollisionMaskDisabled(collisionMask), - myCollisionMaskEnabled(0xFFFF), - myIsSuppressed(false), - myDecodesOffset(0), - myTIA(nullptr) + : myCollisionMaskDisabled(collisionMask) { - reset(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/tia/Missile.hxx b/src/emucore/tia/Missile.hxx index 0edf68e2a..202c6c7cd 100644 --- a/src/emucore/tia/Missile.hxx +++ b/src/emucore/tia/Missile.hxx @@ -82,8 +82,8 @@ class Missile : public Serializable public: - uInt32 collision; - bool isMoving; + uInt32 collision{0}; + bool isMoving{false}; private: @@ -98,35 +98,35 @@ class Missile : public Serializable private: - uInt32 myCollisionMaskDisabled; - uInt32 myCollisionMaskEnabled; + uInt32 myCollisionMaskDisabled{0}; + uInt32 myCollisionMaskEnabled{0xFFFF}; - bool myIsEnabled; - bool myIsSuppressed; - bool myEnam; - uInt8 myResmp; + bool myIsEnabled{false}; + bool myIsSuppressed{false}; + bool myEnam{false}; + uInt8 myResmp{0}; - uInt8 myHmmClocks; - uInt8 myCounter; + uInt8 myHmmClocks{0}; + uInt8 myCounter{0}; - uInt8 myWidth; - uInt8 myEffectiveWidth; + uInt8 myWidth{1}; + uInt8 myEffectiveWidth{1}; - bool myIsRendering; - bool myIsVisible; - Int8 myRenderCounter; + bool myIsRendering{false}; + bool myIsVisible{false}; + Int8 myRenderCounter{0}; - const uInt8* myDecodes; - uInt8 myDecodesOffset; // needed for state saving + const uInt8* myDecodes{nullptr}; + uInt8 myDecodesOffset{0}; // needed for state saving - uInt8 myColor; - uInt8 myObjectColor, myDebugColor; - bool myDebugEnabled; + uInt8 myColor{0}; + uInt8 myObjectColor{0}, myDebugColor{0}; + bool myDebugEnabled{false}; - bool myInvertedPhaseClock; - bool myUseInvertedPhaseClock; + bool myInvertedPhaseClock{false}; + bool myUseInvertedPhaseClock{false}; - TIA *myTIA; + TIA *myTIA{nullptr}; private: Missile(const Missile&) = delete; diff --git a/src/emucore/tia/PaddleReader.cxx b/src/emucore/tia/PaddleReader.cxx index b03bc487d..63fcb9967 100644 --- a/src/emucore/tia/PaddleReader.cxx +++ b/src/emucore/tia/PaddleReader.cxx @@ -22,7 +22,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PaddleReader::PaddleReader() { - reset(0); + setConsoleTiming(ConsoleTiming::ntsc); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/tia/PaddleReader.hxx b/src/emucore/tia/PaddleReader.hxx index c169ed849..e76deb8d0 100644 --- a/src/emucore/tia/PaddleReader.hxx +++ b/src/emucore/tia/PaddleReader.hxx @@ -53,16 +53,16 @@ class PaddleReader : public Serializable private: - double myUThresh; - double myU; + double myUThresh{0.0}; + double myU{0.0}; - double myValue; - uInt64 myTimestamp; + double myValue{0.0}; + uInt64 myTimestamp{0}; ConsoleTiming myConsoleTiming; - double myClockFreq; + double myClockFreq{0.0}; - bool myIsDumped; + bool myIsDumped{false}; static constexpr double R0 = 1.5e3, diff --git a/src/emucore/tia/Player.cxx b/src/emucore/tia/Player.cxx index 2deb6ebac..9b763a842 100644 --- a/src/emucore/tia/Player.cxx +++ b/src/emucore/tia/Player.cxx @@ -21,13 +21,8 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Player::Player(uInt32 collisionMask) - : myCollisionMaskDisabled(collisionMask), - myCollisionMaskEnabled(0xFFFF), - myIsSuppressed(false), - myDecodesOffset(0), - myTIA(nullptr) + : myCollisionMaskDisabled(collisionMask) { - reset(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/tia/Player.hxx b/src/emucore/tia/Player.hxx index d44432f64..f50f05e22 100644 --- a/src/emucore/tia/Player.hxx +++ b/src/emucore/tia/Player.hxx @@ -93,8 +93,8 @@ class Player : public Serializable public: - uInt32 collision; - bool isMoving; + uInt32 collision{0}; + bool isMoving{false}; private: @@ -110,39 +110,39 @@ class Player : public Serializable private: - uInt32 myCollisionMaskDisabled; - uInt32 myCollisionMaskEnabled; + uInt32 myCollisionMaskDisabled{0}; + uInt32 myCollisionMaskEnabled{0xFFFF}; - uInt8 myColor; - uInt8 myObjectColor, myDebugColor; - bool myDebugEnabled; + uInt8 myColor{0}; + uInt8 myObjectColor{0}, myDebugColor{0}; + bool myDebugEnabled{0}; - bool myIsSuppressed; + bool myIsSuppressed{false}; - uInt8 myHmmClocks; - uInt8 myCounter; + uInt8 myHmmClocks{0}; + uInt8 myCounter{0}; - bool myIsRendering; - Int8 myRenderCounter; - Int8 myRenderCounterTripPoint; - uInt8 myDivider; - uInt8 myDividerPending; - uInt8 mySampleCounter; - Int8 myDividerChangeCounter; + bool myIsRendering{false}; + Int8 myRenderCounter{0}; + Int8 myRenderCounterTripPoint{0}; + uInt8 myDivider{0}; + uInt8 myDividerPending{0}; + uInt8 mySampleCounter{0}; + Int8 myDividerChangeCounter{-1}; - const uInt8* myDecodes; - uInt8 myDecodesOffset; // needed for state saving + const uInt8* myDecodes{nullptr}; + uInt8 myDecodesOffset{0}; // needed for state saving - uInt8 myPatternOld; - uInt8 myPatternNew; - uInt8 myPattern; + uInt8 myPatternOld{0}; + uInt8 myPatternNew{0}; + uInt8 myPattern{0}; - bool myIsReflected; - bool myIsDelaying; - bool myInvertedPhaseClock; - bool myUseInvertedPhaseClock; + bool myIsReflected{false}; + bool myIsDelaying{false}; + bool myInvertedPhaseClock{false}; + bool myUseInvertedPhaseClock{false}; - TIA* myTIA; + TIA* myTIA{nullptr}; private: Player(const Player&) = delete; diff --git a/src/emucore/tia/Playfield.cxx b/src/emucore/tia/Playfield.cxx index e600ccdfe..899462244 100644 --- a/src/emucore/tia/Playfield.cxx +++ b/src/emucore/tia/Playfield.cxx @@ -20,12 +20,8 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Playfield::Playfield(uInt32 collisionMask) - : myCollisionMaskDisabled(collisionMask), - myCollisionMaskEnabled(0xFFFF), - myIsSuppressed(false), - myTIA(nullptr) + : myCollisionMaskDisabled(collisionMask) { - reset(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/tia/Playfield.hxx b/src/emucore/tia/Playfield.hxx index c8389b90b..0e432e64f 100644 --- a/src/emucore/tia/Playfield.hxx +++ b/src/emucore/tia/Playfield.hxx @@ -139,7 +139,7 @@ class Playfield : public Serializable abused to store visibility (as the actual collision bit will always be zero if collisions are disabled). */ - uInt32 collision; + uInt32 collision{0}; private: @@ -166,77 +166,77 @@ class Playfield : public Serializable Collision mask values for active / inactive states. Disabling collisions will change those. */ - uInt32 myCollisionMaskDisabled; - uInt32 myCollisionMaskEnabled; + uInt32 myCollisionMaskDisabled{0}; + uInt32 myCollisionMaskEnabled{0xFFFF}; /** Enable / disable PF (debugging). */ - bool myIsSuppressed; + bool myIsSuppressed{false}; /** Left / right PF colors. Derifed from P0 / P1 color, COLUPF and playfield mode. */ - uInt8 myColorLeft; - uInt8 myColorRight; + uInt8 myColorLeft{0}; + uInt8 myColorRight{0}; /** P0 / P1 colors */ - uInt8 myColorP0; - uInt8 myColorP1; + uInt8 myColorP0{0}; + uInt8 myColorP1{0}; /** COLUPF and debug colors */ - uInt8 myObjectColor, myDebugColor; + uInt8 myObjectColor{0}, myDebugColor{0}; /** Debug colors enabled? */ - bool myDebugEnabled; + bool myDebugEnabled{false}; /** * Plafield mode. */ - ColorMode myColorMode; + ColorMode myColorMode{ColorMode::normal}; /** Pattern derifed from PF0, PF1, PF2 */ - uInt32 myPattern; + uInt32 myPattern{0}; /** "Effective pattern". Will be 0 if playfield is disabled (debug), otherwise the same as myPattern. */ - uInt32 myEffectivePattern; + uInt32 myEffectivePattern{0}; /** Reflected mode on / off. */ - bool myReflected; + bool myReflected{false}; /** * Are we currently drawing the reflected PF? */ - bool myRefp; + bool myRefp{false}; /** PF registers. */ - uInt8 myPf0; - uInt8 myPf1; - uInt8 myPf2; + uInt8 myPf0{0}; + uInt8 myPf1{0}; + uInt8 myPf2{0}; /** The current scanline position (0 .. 159). */ - uInt32 myX; + uInt32 myX{0}; /** TIA instance. Required for flushing the line cache. */ - TIA* myTIA; + TIA* myTIA{nullptr}; private: Playfield() = delete; diff --git a/src/emucore/tia/TIA.cxx b/src/emucore/tia/TIA.cxx index e3d8d9399..fa21a38c7 100644 --- a/src/emucore/tia/TIA.cxx +++ b/src/emucore/tia/TIA.cxx @@ -71,15 +71,12 @@ TIA::TIA(ConsoleIO& console, const ConsoleTimingProvider& timingProvider, : myConsole(console), myTimingProvider(timingProvider), mySettings(settings), - myFrameManager(nullptr), myPlayfield(~CollisionMask::playfield & 0x7FFF), myMissile0(~CollisionMask::missile0 & 0x7FFF), myMissile1(~CollisionMask::missile1 & 0x7FFF), myPlayer0(~CollisionMask::player0 & 0x7FFF), myPlayer1(~CollisionMask::player1 & 0x7FFF), - myBall(~CollisionMask::ball & 0x7FFF), - mySpriteEnabledBits(0xFF), - myCollisionsEnabledBits(0xFF) + myBall(~CollisionMask::ball & 0x7FFF) { myBackground.setTIA(this); myPlayfield.setTIA(this); diff --git a/src/emucore/tia/TIA.hxx b/src/emucore/tia/TIA.hxx index cd38905d1..4aaeb174e 100644 --- a/src/emucore/tia/TIA.hxx +++ b/src/emucore/tia/TIA.hxx @@ -713,16 +713,16 @@ class TIA : public Device /** Variable delay values for TIA writes. */ - uInt8 myPFBitsDelay; - uInt8 myPFColorDelay; - uInt8 myPlSwapDelay; - uInt8 myBlSwapDelay; + uInt8 myPFBitsDelay{0}; + uInt8 myPFColorDelay{0}; + uInt8 myPlSwapDelay{0}; + uInt8 myBlSwapDelay{0}; /** * The frame manager is responsible for detecting frame boundaries and the visible * region of each frame. */ - AbstractFrameManager* myFrameManager; + AbstractFrameManager* myFrameManager{nullptr}; /** * The various TIA objects. @@ -758,108 +758,108 @@ class TIA : public Device // We snapshot frame statistics when the back buffer is copied to the front buffer // and when the front buffer is copied to the frame buffer - uInt32 myFrontBufferScanlines, myFrameBufferScanlines; + uInt32 myFrontBufferScanlines{0}, myFrameBufferScanlines{0}; // Frames since the last time a frame was rendered to the render buffer - uInt32 myFramesSinceLastRender; + uInt32 myFramesSinceLastRender{0}; /** * Setting this to true injects random values into undefined reads. */ - bool myTIAPinsDriven; + bool myTIAPinsDriven{false}; /** * The current "line state" --- either hblank or frame. */ - HState myHstate; + HState myHstate{HState::blank}; /** * Master line counter */ - uInt8 myHctr; + uInt8 myHctr{0}; /** * Delta between master line counter and actual color clock. Nonzero after * RSYNC (before the scanline terminates) */ - Int32 myHctrDelta; + Int32 myHctrDelta{0}; /** * Electron beam x at rendering start (used for blanking out any pixels from * the last frame that are not overwritten) */ - uInt8 myXAtRenderingStart; + uInt8 myXAtRenderingStart{0}; /** * Do we need to update the collision mask this clock? */ - bool myCollisionUpdateRequired; + bool myCollisionUpdateRequired{false}; /** * Force schedule a collision update */ - bool myCollisionUpdateScheduled; + bool myCollisionUpdateScheduled{false}; /** * The collision latches are represented by 15 bits in a bitfield. */ - uInt32 myCollisionMask; + uInt32 myCollisionMask{0}; /** * The movement clock counts the extra ticks sent to the objects during * movement. */ - uInt32 myMovementClock; + uInt32 myMovementClock{0}; /** * Movement mode --- are we sending movement clocks? */ - bool myMovementInProgress; + bool myMovementInProgress{false}; /** * Do we have an extended hblank this line? Get set by strobing HMOVE and * cleared when the line wraps. */ - bool myExtendedHblank; + bool myExtendedHblank{false}; /** * Counts the number of line wraps since the last external TIA state change. * If at least two line breaks have passed, the TIA will suspend simulation * and just reuse the last line instead. */ - uInt32 myLinesSinceChange; + uInt32 myLinesSinceChange{0}; /** * The current mode of the priority encoder. */ - Priority myPriority; + Priority myPriority{Priority::normal}; /** * The index of the last CPU cycle that was included in the simulation. */ - uInt64 myLastCycle; + uInt64 myLastCycle{0}; /** * Keeps track of a possible fractional number of clocks that still need * to be simulated. */ - uInt8 mySubClock; + uInt8 mySubClock{0}; /** * Bitmasks that track which sprites / collisions are enabled / disabled. */ - uInt8 mySpriteEnabledBits; - uInt8 myCollisionsEnabledBits; + uInt8 mySpriteEnabledBits{0xFF}; + uInt8 myCollisionsEnabledBits{0xFF}; /** * The color used to highlight HMOVE blanks (if enabled). */ - uInt8 myColorHBlank; + uInt8 myColorHBlank{0}; /** * The total number of color clocks since emulation started. */ - uInt64 myTimestamp; + uInt64 myTimestamp{0}; /** * The "shadow registers" track the last written register value for the @@ -872,21 +872,21 @@ class TIA : public Device * occurs on PAL-like systems when the previous frame contains an odd * number of scanlines. */ - bool myColorLossEnabled; - bool myColorLossActive; + bool myColorLossEnabled{false}; + bool myColorLossActive{false}; std::array myColorCounts; /** * System cycles at the end of the previous frame / beginning of next frame. */ - uInt64 myCyclesAtFrameStart; + uInt64 myCyclesAtFrameStart{0}; /** * The frame manager can change during our lifetime, so we buffer those two. */ - bool myEnableJitter; - uInt8 myJitterFactor; + bool myEnableJitter{false}; + uInt8 myJitterFactor{0}; static constexpr uInt16 TIA_SIZE = 0x40, TIA_MASK = TIA_SIZE - 1, TIA_READ_MASK = 0x0f, TIA_BIT = 0x080, TIA_DELAY = 2;