More default initialization updates, in the process making c'tors smaller/non-existent.

I've already found a few potential bugs where instance variables weren't being initialized at all.
This commit is contained in:
Stephen Anthony 2019-12-29 18:36:56 -03:30
parent 0a9b289b44
commit 54de3415ea
213 changed files with 823 additions and 1095 deletions

View File

@ -161,13 +161,13 @@ class AtariNTSC
struct init_t struct init_t
{ {
std::array<float, burst_count * 6> to_rgb; std::array<float, burst_count * 6> to_rgb{0.F};
std::array<float, gamma_size> to_float; std::array<float, gamma_size> to_float{0.F};
float contrast{0.F}; float contrast{0.F};
float brightness{0.F}; float brightness{0.F};
float artifacts{0.F}; float artifacts{0.F};
float fringing{0.F}; float fringing{0.F};
std::array<float, rescale_out * kernel_size * 2> kernel; std::array<float, rescale_out * kernel_size * 2> kernel{0.F};
init_t() { init_t() {
to_rgb.fill(0.0); to_rgb.fill(0.0);
@ -181,7 +181,7 @@ class AtariNTSC
{ {
int offset{0}; int offset{0};
float negate{0.F}; float negate{0.F};
std::array<float, 4> kernel; std::array<float, 4> kernel{0.F};
}; };
static const std::array<pixel_info_t, alignment_count> atari_ntsc_pixels; static const std::array<pixel_info_t, alignment_count> atari_ntsc_pixels;

View File

@ -40,10 +40,10 @@ class AudioWidget : public Widget, public CommandSender
kAUDVID kAUDVID
}; };
DataGridWidget* myAudF; DataGridWidget* myAudF{nullptr};
DataGridWidget* myAudC; DataGridWidget* myAudC{nullptr};
DataGridWidget* myAudV; DataGridWidget* myAudV{nullptr};
StaticTextWidget* myAudEffV; StaticTextWidget* myAudEffV{nullptr};
// Audio channels // Audio channels
enum enum

View File

@ -31,7 +31,7 @@ class BoosterWidget : public ControllerWidget
private: private:
enum { kJUp = 0, kJDown, kJLeft, kJRight, kJFire, kJBooster, kJTrigger }; enum { kJUp = 0, kJDown, kJLeft, kJRight, kJFire, kJBooster, kJTrigger };
std::array<CheckboxWidget*, 7> myPins; std::array<CheckboxWidget*, 7> myPins{nullptr};
static constexpr std::array<Controller::DigitalPin, 5> ourPinNo = {{ static constexpr std::array<Controller::DigitalPin, 5> ourPinNo = {{
Controller::DigitalPin::One, Controller::DigitalPin::Two, Controller::DigitalPin::One, Controller::DigitalPin::Two,
Controller::DigitalPin::Three, Controller::DigitalPin::Four, Controller::DigitalPin::Three, Controller::DigitalPin::Four,

View File

@ -34,7 +34,7 @@ class Cartridge0840Widget : public CartDebugWidget
private: private:
Cartridge0840& myCart; Cartridge0840& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
enum { kBankChanged = 'bkCH' }; enum { kBankChanged = 'bkCH' };

View File

@ -40,10 +40,10 @@ class Cartridge3EPlusWidget : public CartDebugWidget
private: private:
Cartridge3EPlus& myCart; Cartridge3EPlus& myCart;
std::array<PopUpWidget*, 4> myBankNumber; std::array<PopUpWidget*, 4> myBankNumber{nullptr};
std::array<PopUpWidget*, 4> myBankType; std::array<PopUpWidget*, 4> myBankType{nullptr};
std::array<ButtonWidget*, 4> myBankCommit; std::array<ButtonWidget*, 4> myBankCommit{nullptr};
std::array<EditTextWidget*, 8> myBankState; std::array<EditTextWidget*, 8> myBankState{nullptr};
struct CartState { struct CartState {
ByteArray internalram; ByteArray internalram;

View File

@ -34,9 +34,9 @@ class Cartridge3EWidget : public CartDebugWidget
private: private:
Cartridge3E& myCart; Cartridge3E& myCart;
const uInt32 myNumRomBanks; const uInt32 myNumRomBanks{0};
const uInt32 myNumRamBanks; const uInt32 myNumRamBanks{0};
PopUpWidget *myROMBank, *myRAMBank; PopUpWidget *myROMBank{nullptr}, *myRAMBank{nullptr};
struct CartState { struct CartState {
ByteArray internalram; ByteArray internalram;

View File

@ -34,7 +34,7 @@ class Cartridge3FWidget : public CartDebugWidget
private: private:
Cartridge3F& myCart; Cartridge3F& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
enum { kBankChanged = 'bkCH' }; enum { kBankChanged = 'bkCH' };

View File

@ -34,9 +34,9 @@ class Cartridge4A50Widget : public CartDebugWidget
private: private:
Cartridge4A50& myCart; Cartridge4A50& myCart;
PopUpWidget *myROMLower, *myRAMLower; PopUpWidget *myROMLower{nullptr}, *myRAMLower{nullptr};
PopUpWidget *myROMMiddle, *myRAMMiddle; PopUpWidget *myROMMiddle{nullptr}, *myRAMMiddle{nullptr};
PopUpWidget *myROMHigh, *myRAMHigh; PopUpWidget *myROMHigh{nullptr}, *myRAMHigh{nullptr};
enum { enum {
kROMLowerChanged = 'rmLW', kROMLowerChanged = 'rmLW',

View File

@ -34,7 +34,7 @@ class CartridgeARWidget : public CartDebugWidget
private: private:
CartridgeAR& myCart; CartridgeAR& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
enum { kBankChanged = 'bkCH' }; enum { kBankChanged = 'bkCH' };

View File

@ -34,11 +34,11 @@ class CartridgeBFSCWidget : public CartDebugWidget
private: private:
CartridgeBFSC& myCart; CartridgeBFSC& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
struct CartState { struct CartState {
ByteArray internalram; ByteArray internalram;
uInt16 bank; uInt16 bank{0};
}; };
CartState myOldState; CartState myOldState;

View File

@ -34,7 +34,7 @@ class CartridgeBFWidget : public CartDebugWidget
private: private:
CartridgeBF& myCart; CartridgeBF& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
enum { kBankChanged = 'bkCH' }; enum { kBankChanged = 'bkCH' };

View File

@ -46,26 +46,26 @@ class CartridgeBUSWidget : public CartDebugWidget
IntArray mwaves; IntArray mwaves;
IntArray mwavesizes; IntArray mwavesizes;
IntArray samplepointer; IntArray samplepointer;
uInt32 random; uInt32 random{0};
ByteArray internalram; ByteArray internalram;
}; };
CartridgeBUS& myCart; CartridgeBUS& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
DataGridWidget* myDatastreamPointers; DataGridWidget* myDatastreamPointers{nullptr};
DataGridWidget* myDatastreamIncrements; DataGridWidget* myDatastreamIncrements{nullptr};
DataGridWidget* myDatastreamPointers2; DataGridWidget* myDatastreamPointers2{nullptr};
DataGridWidget* myDatastreamIncrements2; DataGridWidget* myDatastreamIncrements2{nullptr};
DataGridWidget* myAddressMaps; DataGridWidget* myAddressMaps{nullptr};
DataGridWidget* myMusicCounters; DataGridWidget* myMusicCounters{nullptr};
DataGridWidget* myMusicFrequencies; DataGridWidget* myMusicFrequencies{nullptr};
DataGridWidget* myMusicWaveforms; DataGridWidget* myMusicWaveforms{nullptr};
DataGridWidget* myMusicWaveformSizes; DataGridWidget* myMusicWaveformSizes{nullptr};
DataGridWidget* mySamplePointer; DataGridWidget* mySamplePointer{nullptr};
CheckboxWidget* myBusOverdrive; CheckboxWidget* myBusOverdrive{nullptr};
CheckboxWidget* myDigitalSample; CheckboxWidget* myDigitalSample{nullptr};
std::array<StaticTextWidget*, 6> myDatastreamLabels; std::array<StaticTextWidget*, 6> myDatastreamLabels{nullptr};
CartState myOldState; CartState myOldState;
enum { kBankChanged = 'bkCH' }; enum { kBankChanged = 'bkCH' };

View File

@ -47,28 +47,28 @@ class CartridgeCDFWidget : public CartDebugWidget
IntArray mwaves; IntArray mwaves;
IntArray mwavesizes; IntArray mwavesizes;
IntArray samplepointer; IntArray samplepointer;
uInt32 random; uInt32 random{0};
ByteArray internalram; ByteArray internalram;
}; };
CartridgeCDF& myCart; CartridgeCDF& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
DataGridWidget* myDatastreamPointers; DataGridWidget* myDatastreamPointers{nullptr};
DataGridWidget* myDatastreamIncrements; DataGridWidget* myDatastreamIncrements{nullptr};
DataGridWidget* myCommandStreamPointer; DataGridWidget* myCommandStreamPointer{nullptr};
DataGridWidget* myCommandStreamIncrement; DataGridWidget* myCommandStreamIncrement{nullptr};
DataGridWidget* myJumpStreamPointers; DataGridWidget* myJumpStreamPointers{nullptr};
DataGridWidget* myJumpStreamIncrements; DataGridWidget* myJumpStreamIncrements{nullptr};
DataGridWidget* myMusicCounters; DataGridWidget* myMusicCounters{nullptr};
DataGridWidget* myMusicFrequencies; DataGridWidget* myMusicFrequencies{nullptr};
DataGridWidget* myMusicWaveforms; DataGridWidget* myMusicWaveforms{nullptr};
DataGridWidget* myMusicWaveformSizes; DataGridWidget* myMusicWaveformSizes{nullptr};
DataGridWidget* mySamplePointer; DataGridWidget* mySamplePointer{nullptr};
std::array<StaticTextWidget*, 10> myDatastreamLabels; std::array<StaticTextWidget*, 10> myDatastreamLabels{nullptr};
CheckboxWidget* myFastFetch; CheckboxWidget* myFastFetch{nullptr};
CheckboxWidget* myDigitalSample; CheckboxWidget* myDigitalSample{nullptr};
CartState myOldState; CartState myOldState;
enum { kBankChanged = 'bkCH' }; enum { kBankChanged = 'bkCH' };

View File

@ -38,21 +38,22 @@ class CartridgeCMWidget : public CartDebugWidget
private: private:
struct CartState { struct CartState {
uInt8 swcha; uInt8 swcha{0};
uInt8 column; uInt8 column{0};
ByteArray internalram; ByteArray internalram;
uInt16 bank; uInt16 bank{0};
}; };
CartridgeCM& myCart; CartridgeCM& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
ToggleBitWidget* mySWCHA; ToggleBitWidget* mySWCHA{nullptr};
DataGridWidget* myColumn; DataGridWidget* myColumn{nullptr};
CheckboxWidget *myAudIn, *myAudOut, *myIncrease, *myReset; CheckboxWidget *myAudIn{nullptr}, *myAudOut{nullptr},
CheckboxWidget *myFunc, *myShift; *myIncrease{nullptr}, *myReset{nullptr};
EditTextWidget* myRAM; CheckboxWidget *myFunc{nullptr}, *myShift{nullptr};
std::array<CheckboxWidget*, 4> myRow; EditTextWidget* myRAM{nullptr};
std::array<CheckboxWidget*, 4> myRow{nullptr};
CartState myOldState; CartState myOldState;

View File

@ -34,11 +34,11 @@ class CartridgeCTYWidget : public CartDebugWidget
private: private:
CartridgeCTY& myCart; CartridgeCTY& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
struct CartState { struct CartState {
ByteArray internalram; ByteArray internalram;
uInt16 bank; uInt16 bank{0};
}; };
CartState myOldState; CartState myOldState;

View File

@ -34,10 +34,10 @@ class CartridgeCVPlusWidget : public CartDebugWidget
private: private:
CartridgeCVPlus& myCart; CartridgeCVPlus& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
struct CartState { struct CartState {
ByteArray internalram; ByteArray internalram;
uInt16 bank; uInt16 bank{0};
}; };
CartState myOldState; CartState myOldState;

View File

@ -40,10 +40,10 @@ class CartridgeDASHWidget : public CartDebugWidget
private: private:
CartridgeDASH& myCart; CartridgeDASH& myCart;
std::array<PopUpWidget*, 4> myBankNumber; std::array<PopUpWidget*, 4> myBankNumber{nullptr};
std::array<PopUpWidget*, 4> myBankType; std::array<PopUpWidget*, 4> myBankType{nullptr};
std::array<ButtonWidget*, 4> myBankCommit; std::array<ButtonWidget*, 4> myBankCommit{nullptr};
std::array<EditTextWidget*, 8> myBankState; std::array<EditTextWidget*, 8> myBankState{nullptr};
struct CartState { struct CartState {
ByteArray internalram; ByteArray internalram;

View File

@ -34,11 +34,11 @@ class CartridgeDFSCWidget : public CartDebugWidget
private: private:
CartridgeDFSC& myCart; CartridgeDFSC& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
struct CartState { struct CartState {
ByteArray internalram; ByteArray internalram;
uInt16 bank; uInt16 bank{0};
}; };
CartState myOldState; CartState myOldState;

View File

@ -34,7 +34,7 @@ class CartridgeDFWidget : public CartDebugWidget
private: private:
CartridgeDF& myCart; CartridgeDF& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
enum { kBankChanged = 'bkCH' }; enum { kBankChanged = 'bkCH' };

View File

@ -45,26 +45,26 @@ class CartridgeDPCPlusWidget : public CartDebugWidget
IntArray mcounters; IntArray mcounters;
IntArray mfreqs; IntArray mfreqs;
IntArray mwaves; IntArray mwaves;
uInt32 random; uInt32 random{0};
ByteArray internalram; ByteArray internalram;
uInt16 bank; uInt16 bank{0};
}; };
CartridgeDPCPlus& myCart; CartridgeDPCPlus& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
DataGridWidget* myTops; DataGridWidget* myTops{nullptr};
DataGridWidget* myBottoms; DataGridWidget* myBottoms{nullptr};
DataGridWidget* myCounters; DataGridWidget* myCounters{nullptr};
DataGridWidget* myFracCounters; DataGridWidget* myFracCounters{nullptr};
DataGridWidget* myFracIncrements; DataGridWidget* myFracIncrements{nullptr};
DataGridWidget* myParameter; DataGridWidget* myParameter{nullptr};
DataGridWidget* myMusicCounters; DataGridWidget* myMusicCounters{nullptr};
DataGridWidget* myMusicFrequencies; DataGridWidget* myMusicFrequencies{nullptr};
DataGridWidget* myMusicWaveforms; DataGridWidget* myMusicWaveforms{nullptr};
CheckboxWidget* myFastFetch; CheckboxWidget* myFastFetch{nullptr};
CheckboxWidget* myIMLDA; CheckboxWidget* myIMLDA{nullptr};
DataGridWidget* myRandom; DataGridWidget* myRandom{nullptr};
CartState myOldState; CartState myOldState;

View File

@ -40,20 +40,20 @@ class CartridgeDPCWidget : public CartDebugWidget
IntArray counters; IntArray counters;
ByteArray flags; ByteArray flags;
BoolArray music; BoolArray music;
uInt8 random; uInt8 random{0};
ByteArray internalram; ByteArray internalram;
uInt16 bank; uInt16 bank{0};
}; };
CartridgeDPC& myCart; CartridgeDPC& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
DataGridWidget* myTops; DataGridWidget* myTops{nullptr};
DataGridWidget* myBottoms; DataGridWidget* myBottoms{nullptr};
DataGridWidget* myCounters; DataGridWidget* myCounters{nullptr};
DataGridWidget* myFlags; DataGridWidget* myFlags{nullptr};
DataGridWidget* myMusicMode; DataGridWidget* myMusicMode{nullptr};
DataGridWidget* myRandom; DataGridWidget* myRandom{nullptr};
CartState myOldState; CartState myOldState;

View File

@ -33,8 +33,9 @@ CartDebugWidget::CartDebugWidget(GuiObject* boss, const GUI::Font& lfont,
myFontWidth(lfont.getMaxCharWidth()), myFontWidth(lfont.getMaxCharWidth()),
myFontHeight(lfont.getFontHeight()), myFontHeight(lfont.getFontHeight()),
myLineHeight(lfont.getLineHeight()), myLineHeight(lfont.getLineHeight()),
myButtonHeight(myLineHeight + 4), myButtonHeight(myLineHeight + 4)
myDesc(nullptr) { } {
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int CartDebugWidget::addBaseInformation(size_t bytes, const string& manufacturer, int CartDebugWidget::addBaseInformation(size_t bytes, const string& manufacturer,

View File

@ -77,12 +77,12 @@ class CartDebugWidget : public Widget, public CommandSender
// These will be needed by most of the child classes; // These will be needed by most of the child classes;
// we may as well make them protected variables // 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; } ostringstream& buffer() { myBuffer.str(""); return myBuffer; }
private: private:
StringListWidget* myDesc; StringListWidget* myDesc{nullptr};
ostringstream myBuffer; ostringstream myBuffer;
private: private:

View File

@ -34,7 +34,7 @@ class CartridgeE0Widget : public CartDebugWidget
private: private:
CartridgeE0& myCart; CartridgeE0& myCart;
PopUpWidget *mySlice0, *mySlice1, *mySlice2; PopUpWidget *mySlice0{nullptr}, *mySlice1{nullptr}, *mySlice2{nullptr};
enum { enum {
kSlice0Changed = 's0CH', kSlice0Changed = 's0CH',

View File

@ -34,11 +34,11 @@ class CartridgeEFSCWidget : public CartDebugWidget
private: private:
CartridgeEFSC& myCart; CartridgeEFSC& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
struct CartState { struct CartState {
ByteArray internalram; ByteArray internalram;
uInt16 bank; uInt16 bank{0};
}; };
CartState myOldState; CartState myOldState;

View File

@ -34,7 +34,7 @@ class CartridgeEFWidget : public CartDebugWidget
private: private:
CartridgeEF& myCart; CartridgeEF& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
enum { kBankChanged = 'bkCH' }; enum { kBankChanged = 'bkCH' };

View File

@ -34,7 +34,7 @@ class CartridgeF0Widget : public CartDebugWidget
private: private:
CartridgeF0& myCart; CartridgeF0& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
enum { kBankChanged = 'bkCH' }; enum { kBankChanged = 'bkCH' };

View File

@ -34,11 +34,11 @@ class CartridgeF4SCWidget : public CartDebugWidget
private: private:
CartridgeF4SC& myCart; CartridgeF4SC& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
struct CartState { struct CartState {
ByteArray internalram; ByteArray internalram;
uInt16 bank; uInt16 bank{0};
}; };
CartState myOldState; CartState myOldState;

View File

@ -34,7 +34,7 @@ class CartridgeF4Widget : public CartDebugWidget
private: private:
CartridgeF4& myCart; CartridgeF4& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
enum { kBankChanged = 'bkCH' }; enum { kBankChanged = 'bkCH' };

View File

@ -35,10 +35,10 @@ class CartridgeF6SCWidget : public CartDebugWidget
private: private:
struct CartState { struct CartState {
ByteArray internalram; ByteArray internalram;
uInt16 bank; uInt16 bank{0};
}; };
CartridgeF6SC& myCart; CartridgeF6SC& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
CartState myOldState; CartState myOldState;
enum { kBankChanged = 'bkCH' }; enum { kBankChanged = 'bkCH' };

View File

@ -34,7 +34,7 @@ class CartridgeF6Widget : public CartDebugWidget
private: private:
CartridgeF6& myCart; CartridgeF6& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
enum { kBankChanged = 'bkCH' }; enum { kBankChanged = 'bkCH' };

View File

@ -34,11 +34,11 @@ class CartridgeF8SCWidget : public CartDebugWidget
private: private:
CartridgeF8SC& myCart; CartridgeF8SC& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
struct CartState { struct CartState {
ByteArray internalram; ByteArray internalram;
uInt16 bank; uInt16 bank{0};
}; };
CartState myOldState; CartState myOldState;

View File

@ -34,7 +34,7 @@ class CartridgeF8Widget : public CartDebugWidget
private: private:
CartridgeF8& myCart; CartridgeF8& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
enum { kBankChanged = 'bkCH' }; enum { kBankChanged = 'bkCH' };

View File

@ -35,12 +35,12 @@ class CartridgeFA2Widget : public CartDebugWidget
private: private:
CartridgeFA2& myCart; CartridgeFA2& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
ButtonWidget *myFlashErase, *myFlashLoad, *myFlashSave; ButtonWidget *myFlashErase{nullptr}, *myFlashLoad{nullptr}, *myFlashSave{nullptr};
struct CartState { struct CartState {
ByteArray internalram; ByteArray internalram;
uInt16 bank; uInt16 bank{0};
}; };
CartState myOldState; CartState myOldState;

View File

@ -34,11 +34,11 @@ class CartridgeFAWidget : public CartDebugWidget
private: private:
CartridgeFA& myCart; CartridgeFA& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
struct CartState { struct CartState {
ByteArray internalram; ByteArray internalram;
uInt16 bank; uInt16 bank{0};
}; };
CartState myOldState; CartState myOldState;

View File

@ -47,9 +47,8 @@ CartridgeFCWidget::CartridgeFCWidget(
" ($FFF8 = " + Variant(i & 0b11).toString() + " ($FFF8 = " + Variant(i & 0b11).toString() +
"/$FFF9 = " + Variant(i >> 2).toString() +")"); "/$FFF9 = " + Variant(i >> 2).toString() +")");
myBank = new PopUpWidget(boss, _font, xpos, ypos - 2,
myBank = _font.getStringWidth("7 ($FFF8 = 3/$FFF9 = 1)"),
new PopUpWidget(boss, _font, xpos, ypos - 2, _font.getStringWidth("7 ($FFF8 = 3/$FFF9 = 1)"),
myLineHeight, items, "Set bank ", myLineHeight, items, "Set bank ",
0, kBankChanged); 0, kBankChanged);
myBank->setTarget(this); myBank->setTarget(this);

View File

@ -25,20 +25,20 @@ class PopUpWidget;
class CartridgeFCWidget : public CartDebugWidget class CartridgeFCWidget : public CartDebugWidget
{ {
public: public:
CartridgeFCWidget(GuiObject* boss, const GUI::Font& lfont, CartridgeFCWidget(GuiObject* boss, const GUI::Font& lfont,
const GUI::Font& nfont, const GUI::Font& nfont,
int x, int y, int w, int h, int x, int y, int w, int h,
CartridgeFC& cart); CartridgeFC& cart);
virtual ~CartridgeFCWidget() = default; virtual ~CartridgeFCWidget() = default;
private: private:
CartridgeFC& myCart; CartridgeFC& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
enum { kBankChanged = 'bkCH' }; enum { kBankChanged = 'bkCH' };
private: private:
void loadConfig() override; void loadConfig() override;
void handleCommand(CommandSender* sender, int cmd, int data, int id) override; void handleCommand(CommandSender* sender, int cmd, int data, int id) override;

View File

@ -34,7 +34,7 @@ class CartridgeFEWidget : public CartDebugWidget
private: private:
CartridgeFE& myCart; CartridgeFE& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
enum { kBankChanged = 'bkCH' }; enum { kBankChanged = 'bkCH' };

View File

@ -35,8 +35,8 @@ class CartridgeMDMWidget : public CartDebugWidget
private: private:
CartridgeMDM& myCart; CartridgeMDM& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
CheckboxWidget* myBankDisabled; CheckboxWidget* myBankDisabled{nullptr};
enum { kBankChanged = 'bkCH', kBankDisabled = 'bkDI' }; enum { kBankChanged = 'bkCH', kBankDisabled = 'bkDI' };

View File

@ -37,13 +37,13 @@ class CartridgeMNetworkWidget : public CartDebugWidget
//CartridgeE7& myCart; //CartridgeE7& myCart;
CartridgeMNetwork& myCart; CartridgeMNetwork& myCart;
PopUpWidget *myLower2K, *myUpper256B; PopUpWidget *myLower2K{nullptr}, *myUpper256B{nullptr};
struct CartState struct CartState
{ {
ByteArray internalram; ByteArray internalram;
uInt16 lowerBank; uInt16 lowerBank{0};
uInt16 upperBank; uInt16 upperBank{0};
}; };
CartState myOldState; CartState myOldState;

View File

@ -48,7 +48,7 @@ class CartRamWidget : public Widget, public CommandSender
// These will be needed by most of the child classes; // These will be needed by most of the child classes;
// we may as well make them protected variables // we may as well make them protected variables
int myFontWidth, myFontHeight, myLineHeight, myButtonHeight; int myFontWidth{0}, myFontHeight{0}, myLineHeight{0}, myButtonHeight{0};
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported
@ -91,8 +91,8 @@ class CartRamWidget : public Widget, public CommandSender
}; };
private: private:
StringListWidget* myDesc; StringListWidget* myDesc{nullptr};
InternalRamWidget* myRam; InternalRamWidget* myRam{nullptr};
}; };
#endif #endif

View File

@ -34,7 +34,7 @@ class CartridgeSBWidget : public CartDebugWidget
private: private:
CartridgeSB& myCart; CartridgeSB& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
enum { kBankChanged = 'bkCH' }; enum { kBankChanged = 'bkCH' };

View File

@ -34,7 +34,7 @@ class CartridgeUAWidget : public CartDebugWidget
private: private:
CartridgeUA& myCart; CartridgeUA& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
bool mySwappedHotspots; bool mySwappedHotspots;

View File

@ -34,11 +34,11 @@ class CartridgeWDWidget : public CartDebugWidget
private: private:
CartridgeWD& myCart; CartridgeWD& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
struct CartState { struct CartState {
ByteArray internalram; ByteArray internalram;
uInt16 bank; // Current banking layout uInt16 bank{0}; // Current banking layout
}; };
CartState myOldState; CartState myOldState;

View File

@ -34,7 +34,7 @@ class CartridgeX07Widget : public CartDebugWidget
private: private:
CartridgeX07& myCart; CartridgeX07& myCart;
PopUpWidget* myBank; PopUpWidget* myBank{nullptr};
enum { kBankChanged = 'bkCH' }; enum { kBankChanged = 'bkCH' };

View File

@ -69,13 +69,13 @@ class CpuWidget : public Widget, public CommandSender
kPSRegC = 7 kPSRegC = 7
}; };
DataGridWidget* myPCGrid; DataGridWidget* myPCGrid{nullptr};
DataGridWidget* myCpuGrid; DataGridWidget* myCpuGrid{nullptr};
DataGridWidget* myCpuGridDecValue; DataGridWidget* myCpuGridDecValue{nullptr};
DataGridWidget* myCpuGridBinValue; DataGridWidget* myCpuGridBinValue{nullptr};
ToggleBitWidget* myPSRegister; ToggleBitWidget* myPSRegister{nullptr};
EditTextWidget* myPCLabel; EditTextWidget* myPCLabel{nullptr};
std::array<EditTextWidget*, 4> myCpuDataSrc; std::array<EditTextWidget*, 4> myCpuDataSrc{nullptr};
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported

View File

@ -22,14 +22,7 @@
DataGridOpsWidget::DataGridOpsWidget(GuiObject* boss, const GUI::Font& font, DataGridOpsWidget::DataGridOpsWidget(GuiObject* boss, const GUI::Font& font,
int x, int y) int x, int y)
: Widget(boss, font, x, y, 16, 16), : Widget(boss, font, x, y, 16, 16),
CommandSender(boss), CommandSender(boss)
_zeroButton(nullptr),
_invButton(nullptr),
_negButton(nullptr),
_incButton(nullptr),
_decButton(nullptr),
_shiftLeftButton(nullptr),
_shiftRightButton(nullptr)
{ {
const int bwidth = _font.getMaxCharWidth() * 4+2, const int bwidth = _font.getMaxCharWidth() * 4+2,
bheight = _font.getFontHeight() + 3, bheight = _font.getFontHeight() + 3,

View File

@ -42,13 +42,13 @@ class DataGridOpsWidget : public Widget, public CommandSender
void setEnabled(bool e); void setEnabled(bool e);
private: private:
ButtonWidget* _zeroButton; ButtonWidget* _zeroButton{nullptr};
ButtonWidget* _invButton; ButtonWidget* _invButton{nullptr};
ButtonWidget* _negButton; ButtonWidget* _negButton{nullptr};
ButtonWidget* _incButton; ButtonWidget* _incButton{nullptr};
ButtonWidget* _decButton; ButtonWidget* _decButton{nullptr};
ButtonWidget* _shiftLeftButton; ButtonWidget* _shiftLeftButton{nullptr};
ButtonWidget* _shiftRightButton; ButtonWidget* _shiftRightButton{nullptr};
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported

View File

@ -38,20 +38,12 @@ DataGridWidget::DataGridWidget(GuiObject* boss, const GUI::Font& font,
font.getLineHeight()*rows + 1), font.getLineHeight()*rows + 1),
_rows(rows), _rows(rows),
_cols(cols), _cols(cols),
_currentRow(0),
_currentCol(0),
_rowHeight(font.getLineHeight()), _rowHeight(font.getLineHeight()),
_colWidth(colchars * font.getMaxCharWidth() + 8), _colWidth(colchars * font.getMaxCharWidth() + 8),
_bits(bits), _bits(bits),
_crossGrid(false), _base(base)
_base(base),
_selectedItem(0),
_currentKeyDown(KBDK_UNKNOWN),
_opsWidget(nullptr),
_scrollBar(nullptr)
{ {
_flags = Widget::FLAG_ENABLED | Widget::FLAG_RETAIN_FOCUS | Widget::FLAG_WANTS_RAWDATA; _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 // The item is selected, thus _bgcolor is used to draw the caret and
// _textcolorhi to erase it // _textcolorhi to erase it

View File

@ -108,16 +108,16 @@ class DataGridWidget : public EditableWidget
void handleCommand(CommandSender* sender, int cmd, int data, int id) override; void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
protected: protected:
int _rows; int _rows{0};
int _cols; int _cols{0};
int _currentRow; int _currentRow{0};
int _currentCol; int _currentCol{0};
int _rowHeight; int _rowHeight{0};
int _colWidth; int _colWidth{0};
int _bits; int _bits{0};
int _lowerBound; int _lowerBound{0};
int _upperBound; int _upperBound{0};
bool _crossGrid; bool _crossGrid{false};
Common::Base::Fmt _base; Common::Base::Fmt _base;
@ -127,13 +127,13 @@ class DataGridWidget : public EditableWidget
BoolArray _changedList; BoolArray _changedList;
BoolArray _hiliteList; BoolArray _hiliteList;
bool _editMode; bool _editMode{false};
int _selectedItem; int _selectedItem{0};
StellaKey _currentKeyDown; StellaKey _currentKeyDown{KBDK_UNKNOWN};
string _backupString; string _backupString;
DataGridOpsWidget* _opsWidget; DataGridOpsWidget* _opsWidget{nullptr};
ScrollBarWidget* _scrollBar; ScrollBarWidget* _scrollBar{nullptr};
private: private:
/** Common operations on the currently selected cell */ /** Common operations on the currently selected cell */

View File

@ -51,11 +51,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DebuggerDialog::DebuggerDialog(OSystem& osystem, DialogContainer& parent, DebuggerDialog::DebuggerDialog(OSystem& osystem, DialogContainer& parent,
int x, int y, int w, int h) int x, int y, int w, int h)
: Dialog(osystem, parent, x, y, w, h), : Dialog(osystem, parent, x, y, w, h)
myTab(nullptr),
myRomTab(nullptr),
myFatalError(nullptr),
myFirstLoad(true)
{ {
createFont(); // Font is sized according to available space createFont(); // Font is sized according to available space

View File

@ -115,28 +115,28 @@ class DebuggerDialog : public Dialog
kDDOptionsCmd = 'DDop' kDDOptionsCmd = 'DDop'
}; };
TabWidget *myTab, *myRomTab; TabWidget *myTab{nullptr}, *myRomTab{nullptr};
PromptWidget* myPrompt; PromptWidget* myPrompt{nullptr};
TiaInfoWidget* myTiaInfo; TiaInfoWidget* myTiaInfo{nullptr};
TiaOutputWidget* myTiaOutput; TiaOutputWidget* myTiaOutput{nullptr};
TiaZoomWidget* myTiaZoom; TiaZoomWidget* myTiaZoom{nullptr};
CpuWidget* myCpu; CpuWidget* myCpu{nullptr};
RamWidget* myRam; RamWidget* myRam{nullptr};
RomWidget* myRom; RomWidget* myRom{nullptr};
CartDebugWidget* myCartInfo; CartDebugWidget* myCartInfo{nullptr};
CartDebugWidget* myCartDebug; CartDebugWidget* myCartDebug{nullptr};
CartRamWidget* myCartRam; CartRamWidget* myCartRam{nullptr};
EditTextWidget* myMessageBox; EditTextWidget* myMessageBox{nullptr};
ButtonWidget* myRewindButton; ButtonWidget* myRewindButton{nullptr};
ButtonWidget* myUnwindButton; ButtonWidget* myUnwindButton{nullptr};
unique_ptr<GUI::MessageBox> myFatalError; unique_ptr<GUI::MessageBox> myFatalError;
unique_ptr<OptionsDialog> myOptions; unique_ptr<OptionsDialog> myOptions;
unique_ptr<GUI::Font> myLFont; // used for labels unique_ptr<GUI::Font> myLFont; // used for labels
unique_ptr<GUI::Font> myNFont; // used for normal text unique_ptr<GUI::Font> myNFont; // used for normal text
bool myFirstLoad; bool myFirstLoad{true};
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported

View File

@ -21,8 +21,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DrivingWidget::DrivingWidget(GuiObject* boss, const GUI::Font& font, DrivingWidget::DrivingWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, Controller& controller) int x, int y, Controller& controller)
: ControllerWidget(boss, font, x, y, controller), : ControllerWidget(boss, font, x, y, controller)
myGrayIndex(0)
{ {
const string& label = getHeader(); const string& label = getHeader();

View File

@ -38,11 +38,11 @@ class DrivingWidget : public ControllerWidget
kGrayDownCmd = 'DWdn', kGrayDownCmd = 'DWdn',
kFireCmd = 'DWfr' kFireCmd = 'DWfr'
}; };
ButtonWidget *myGrayUp, *myGrayDown; ButtonWidget *myGrayUp{nullptr}, *myGrayDown{nullptr};
DataGridWidget* myGrayValue; DataGridWidget* myGrayValue{nullptr};
CheckboxWidget* myFire; CheckboxWidget* myFire{nullptr};
int myGrayIndex; int myGrayIndex{0};
static const std::array<uInt8, 4> ourGrayTable; static const std::array<uInt8, 4> ourGrayTable;

View File

@ -22,8 +22,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FlashWidget::FlashWidget(GuiObject* boss, const GUI::Font& font, FlashWidget::FlashWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, Controller& controller) int x, int y, Controller& controller)
: ControllerWidget(boss, font, x, y, controller), : ControllerWidget(boss, font, x, y, controller)
myEEPROMEraseCurrent(nullptr)
{ {
myPage.fill(nullptr); myPage.fill(nullptr);
} }

View File

@ -34,11 +34,11 @@ class FlashWidget : public ControllerWidget
void init(GuiObject* boss, const GUI::Font& font, int x, int y); void init(GuiObject* boss, const GUI::Font& font, int x, int y);
private: private:
ButtonWidget* myEEPROMEraseCurrent; ButtonWidget* myEEPROMEraseCurrent{nullptr};
enum { kEEPROMEraseCurrent = 'eeEC' }; enum { kEEPROMEraseCurrent = 'eeEC' };
static constexpr uInt32 MAX_PAGES = 5; static constexpr uInt32 MAX_PAGES = 5;
std::array<StaticTextWidget*, MAX_PAGES> myPage; std::array<StaticTextWidget*, MAX_PAGES> myPage{nullptr};
private: private:
void loadConfig() override; void loadConfig() override;

View File

@ -31,7 +31,7 @@ class GenesisWidget : public ControllerWidget
private: private:
enum { kJUp = 0, kJDown, kJLeft, kJRight, kJBbtn, kJCbtn }; enum { kJUp = 0, kJDown, kJLeft, kJRight, kJBbtn, kJCbtn };
std::array<CheckboxWidget*, 6> myPins; std::array<CheckboxWidget*, 6> myPins{nullptr};
static constexpr std::array<Controller::DigitalPin, 5> ourPinNo = {{ static constexpr std::array<Controller::DigitalPin, 5> ourPinNo = {{
Controller::DigitalPin::One, Controller::DigitalPin::Two, Controller::DigitalPin::One, Controller::DigitalPin::Two,
Controller::DigitalPin::Three, Controller::DigitalPin::Four, Controller::DigitalPin::Three, Controller::DigitalPin::Four,

View File

@ -31,7 +31,7 @@ class JoystickWidget : public ControllerWidget
private: private:
enum { kJUp = 0, kJDown, kJLeft, kJRight, kJFire }; enum { kJUp = 0, kJDown, kJLeft, kJRight, kJFire };
std::array<CheckboxWidget*, 5> myPins; std::array<CheckboxWidget*, 5> myPins{nullptr};
static constexpr std::array<Controller::DigitalPin, 5> ourPinNo = {{ static constexpr std::array<Controller::DigitalPin, 5> ourPinNo = {{
Controller::DigitalPin::One, Controller::DigitalPin::Two, Controller::DigitalPin::One, Controller::DigitalPin::Two,
Controller::DigitalPin::Three, Controller::DigitalPin::Four, Controller::DigitalPin::Three, Controller::DigitalPin::Four,

View File

@ -29,8 +29,8 @@ class KeyboardWidget : public ControllerWidget
virtual ~KeyboardWidget() = default; virtual ~KeyboardWidget() = default;
private: private:
std::array<CheckboxWidget*, 12> myBox; std::array<CheckboxWidget*, 12> myBox{nullptr};
const Event::Type* myEvent; const Event::Type* myEvent{nullptr};
static constexpr std::array<Event::Type, 12> ourLeftEvents = {{ static constexpr std::array<Event::Type, 12> ourLeftEvents = {{
Event::KeyboardZero1, Event::KeyboardZero2, Event::KeyboardZero3, Event::KeyboardZero1, Event::KeyboardZero2, Event::KeyboardZero3,

View File

@ -33,8 +33,8 @@ class PaddleWidget : public ControllerWidget
enum { kP0Changed = 'P0ch', kP1Changed = 'P1ch', enum { kP0Changed = 'P0ch', kP1Changed = 'P1ch',
kP0Fire = 'P0fr', kP1Fire = 'P1fr' }; kP0Fire = 'P0fr', kP1Fire = 'P1fr' };
SliderWidget *myP0Resistance, *myP1Resistance; SliderWidget *myP0Resistance{nullptr}, *myP1Resistance{nullptr};
CheckboxWidget *myP0Fire, *myP1Fire; CheckboxWidget *myP0Fire{nullptr}, *myP1Fire{nullptr};
private: private:
void loadConfig() override; void loadConfig() override;

View File

@ -39,11 +39,11 @@ class PointingDeviceWidget : public ControllerWidget
kTBDown = 'TWdn', kTBDown = 'TWdn',
kTBFire = 'TWfr' kTBFire = 'TWfr'
}; };
ButtonWidget *myGrayLeft, *myGrayRight; ButtonWidget *myGrayLeft{nullptr}, *myGrayRight{nullptr};
DataGridWidget* myGrayValueH; DataGridWidget* myGrayValueH{nullptr};
ButtonWidget *myGrayUp, *myGrayDown; ButtonWidget *myGrayUp{nullptr}, *myGrayDown{nullptr};
DataGridWidget* myGrayValueV; DataGridWidget* myGrayValueV{nullptr};
CheckboxWidget* myFire; CheckboxWidget* myFire{nullptr};
private: private:
virtual uInt8 getGrayCodeTable(const int index, const int direction) const = 0; virtual uInt8 getGrayCodeTable(const int index, const int direction) const = 0;

View File

@ -29,6 +29,7 @@
#define PROMPT "> " #define PROMPT "> "
// TODO: Github issue #361
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PromptWidget::PromptWidget(GuiObject* boss, const GUI::Font& font, PromptWidget::PromptWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h) int x, int y, int w, int h)

View File

@ -38,7 +38,6 @@ RamWidget::RamWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n
myFontHeight(lfont.getFontHeight()), myFontHeight(lfont.getFontHeight()),
myLineHeight(lfont.getLineHeight()), myLineHeight(lfont.getLineHeight()),
myButtonHeight(myLineHeight + 4), myButtonHeight(myLineHeight + 4),
myCurrentRamBank(0),
myRamSize(ramsize), myRamSize(ramsize),
myNumRows(numrows), myNumRows(numrows),
myPageSize(pagesize) myPageSize(pagesize)

View File

@ -68,7 +68,7 @@ class RamWidget : public Widget, public CommandSender
// These will be needed by most of the child classes; // These will be needed by most of the child classes;
// we may as well make them protected variables // we may as well make them protected variables
int myFontWidth, myFontHeight, myLineHeight, myButtonHeight; int myFontWidth{0}, myFontHeight{0}, myLineHeight{0}, myButtonHeight{0};
private: private:
enum { enum {
@ -84,27 +84,27 @@ class RamWidget : public Widget, public CommandSender
kRamBinID kRamBinID
}; };
uInt32 myUndoAddress, myUndoValue; uInt32 myUndoAddress{0}, myUndoValue{0};
uInt32 myCurrentRamBank; uInt32 myCurrentRamBank{0};
uInt32 myRamSize; uInt32 myRamSize{0};
uInt32 myNumRows; uInt32 myNumRows{0};
uInt32 myPageSize; uInt32 myPageSize{0};
unique_ptr<InputTextDialog> myInputBox; unique_ptr<InputTextDialog> myInputBox;
StaticTextWidget* myRamStart; StaticTextWidget* myRamStart{nullptr};
std::array<StaticTextWidget*, 16> myRamLabels; std::array<StaticTextWidget*, 16> myRamLabels{nullptr};
DataGridWidget* myRamGrid; DataGridWidget* myRamGrid{nullptr};
DataGridWidget* myDecValue; DataGridWidget* myDecValue{nullptr};
DataGridWidget* myBinValue; DataGridWidget* myBinValue{nullptr};
EditTextWidget* myLabel; EditTextWidget* myLabel{nullptr};
ButtonWidget* myRevertButton; ButtonWidget* myRevertButton{nullptr};
ButtonWidget* myUndoButton; ButtonWidget* myUndoButton{nullptr};
ButtonWidget* mySearchButton; ButtonWidget* mySearchButton{nullptr};
ButtonWidget* myCompareButton; ButtonWidget* myCompareButton{nullptr};
ButtonWidget* myRestartButton; ButtonWidget* myRestartButton{nullptr};
ByteArray myOldValueList; ByteArray myOldValueList;
IntArray mySearchAddr; IntArray mySearchAddr;

View File

@ -45,30 +45,30 @@ class RiotWidget : public Widget, public CommandSender
void loadConfig() override; void loadConfig() override;
private: private:
ToggleBitWidget* mySWCHAReadBits; ToggleBitWidget* mySWCHAReadBits{nullptr};
ToggleBitWidget* mySWCHAWriteBits; ToggleBitWidget* mySWCHAWriteBits{nullptr};
ToggleBitWidget* mySWACNTBits; ToggleBitWidget* mySWACNTBits{nullptr};
ToggleBitWidget* mySWCHBReadBits; ToggleBitWidget* mySWCHBReadBits{nullptr};
ToggleBitWidget* mySWCHBWriteBits; ToggleBitWidget* mySWCHBWriteBits{nullptr};
ToggleBitWidget* mySWBCNTBits; ToggleBitWidget* mySWBCNTBits{nullptr};
DataGridWidget* myLeftINPT; DataGridWidget* myLeftINPT{nullptr};
DataGridWidget* myRightINPT; DataGridWidget* myRightINPT{nullptr};
CheckboxWidget* myINPTLatch; CheckboxWidget* myINPTLatch{nullptr};
CheckboxWidget* myINPTDump; CheckboxWidget* myINPTDump{nullptr};
DataGridWidget* myTimWrite; DataGridWidget* myTimWrite{nullptr};
DataGridWidget* myTimRead; DataGridWidget* myTimRead{nullptr};
DataGridWidget* myTimDivider; DataGridWidget* myTimDivider{nullptr};
ControllerWidget *myLeftControl, *myRightControl; ControllerWidget *myLeftControl{nullptr}, *myRightControl{nullptr};
PopUpWidget *myP0Diff, *myP1Diff; PopUpWidget *myP0Diff{nullptr}, *myP1Diff{nullptr};
PopUpWidget *myTVType; PopUpWidget *myTVType{nullptr};
CheckboxWidget* mySelect; CheckboxWidget* mySelect{nullptr};
CheckboxWidget* myReset; CheckboxWidget* myReset{nullptr};
CheckboxWidget* myPause; CheckboxWidget* myPause{nullptr};
EditTextWidget* myConsole; EditTextWidget* myConsole{nullptr};
// ID's for the various widgets // ID's for the various widgets
// We need ID's, since there are more than one of several types of widgets // We need ID's, since there are more than one of several types of widgets

View File

@ -28,10 +28,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
RomListSettings::RomListSettings(GuiObject* boss, const GUI::Font& font) RomListSettings::RomListSettings(GuiObject* boss, const GUI::Font& font)
: Dialog(boss->instance(), boss->parent()), : Dialog(boss->instance(), boss->parent()),
CommandSender(boss), CommandSender(boss)
_xorig(0),
_yorig(0),
_item(0)
{ {
const int buttonWidth = font.getStringWidth("RunTo PC @ current line") + 20, const int buttonWidth = font.getStringWidth("RunTo PC @ current line") + 20,
buttonHeight = font.getLineHeight() + 4; buttonHeight = font.getLineHeight() + 4;

View File

@ -42,13 +42,13 @@ class RomListSettings : public Dialog, public CommandSender
void center() override; void center() override;
private: private:
uInt32 _xorig, _yorig; uInt32 _xorig{0}, _yorig{0};
int _item; // currently selected line number in the disassembly list int _item{0}; // currently selected line number in the disassembly list
CheckboxWidget* myShowTentative; CheckboxWidget* myShowTentative{nullptr};
CheckboxWidget* myShowAddresses; CheckboxWidget* myShowAddresses{nullptr};
CheckboxWidget* myShowGFXBinary; CheckboxWidget* myShowGFXBinary{nullptr};
CheckboxWidget* myUseRelocation; CheckboxWidget* myUseRelocation{nullptr};
private: private:
void loadConfig() override; void loadConfig() override;

View File

@ -30,16 +30,7 @@
RomListWidget::RomListWidget(GuiObject* boss, const GUI::Font& lfont, RomListWidget::RomListWidget(GuiObject* boss, const GUI::Font& lfont,
const GUI::Font& nfont, const GUI::Font& nfont,
int x, int y, int w, int h) int x, int y, int w, int h)
: EditableWidget(boss, nfont, x, y, 16, 16), : 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)//,
{ {
_flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG | Widget::FLAG_RETAIN_FOCUS; _flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG | Widget::FLAG_RETAIN_FOCUS;
_bgcolor = kWidColor; _bgcolor = kWidColor;

View File

@ -87,21 +87,21 @@ class RomListWidget : public EditableWidget
private: private:
unique_ptr<RomListSettings> myMenu; unique_ptr<RomListSettings> myMenu;
ScrollBarWidget* myScrollBar; ScrollBarWidget* myScrollBar{nullptr};
int _labelWidth; int _labelWidth{0};
int _bytesWidth; int _bytesWidth{0};
int _rows; int _rows{0};
int _cols; int _cols{0};
int _currentPos; // position of first line in visible window int _currentPos{0}; // position of first line in visible window
int _selectedItem; int _selectedItem{-1};
int _highlightedItem; int _highlightedItem{-1};
bool _editMode; bool _editMode{false};
StellaKey _currentKeyDown; StellaKey _currentKeyDown{KBDK_UNKNOWN};
Common::Base::Fmt _base; // base used during editing Common::Base::Fmt _base{Common::Base::Fmt::_DEFAULT}; // base used during editing
const CartDebug::Disassembly* myDisasm; const CartDebug::Disassembly* myDisasm{nullptr};
vector<CheckboxWidget*> myCheckList; vector<CheckboxWidget*> myCheckList{nullptr};
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported

View File

@ -33,8 +33,7 @@
RomWidget::RomWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont, RomWidget::RomWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h) int x, int y, int w, int h)
: Widget(boss, lfont, x, y, w, h), : Widget(boss, lfont, x, y, w, h),
CommandSender(boss), CommandSender(boss)
myListIsDirty(true)
{ {
int xpos, ypos; int xpos, ypos;
StaticTextWidget* t; StaticTextWidget* t;

View File

@ -55,10 +55,10 @@ class RomWidget : public Widget, public CommandSender
Common::Base::Fmt base); Common::Base::Fmt base);
private: private:
RomListWidget* myRomList; RomListWidget* myRomList{nullptr};
EditTextWidget* myBank; EditTextWidget* myBank{nullptr};
bool myListIsDirty; bool myListIsDirty{true};
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported

View File

@ -36,17 +36,17 @@ class TiaInfoWidget : public Widget, public CommandSender
void loadConfig() override; void loadConfig() override;
private: private:
EditTextWidget* myFrameCount; EditTextWidget* myFrameCount{nullptr};
EditTextWidget* myFrameCycles; EditTextWidget* myFrameCycles{nullptr};
EditTextWidget* myScanlineCount; EditTextWidget* myScanlineCount{nullptr};
EditTextWidget* myScanlineCountLast; EditTextWidget* myScanlineCountLast{nullptr};
EditTextWidget* myScanlineCycles; EditTextWidget* myScanlineCycles{nullptr};
EditTextWidget* myPixelPosition; EditTextWidget* myPixelPosition{nullptr};
EditTextWidget* myColorClocks; EditTextWidget* myColorClocks{nullptr};
CheckboxWidget* myVSync; CheckboxWidget* myVSync{nullptr};
CheckboxWidget* myVBlank; CheckboxWidget* myVBlank{nullptr};
private: private:
void handleMouseDown(int x, int y, MouseButton b, int clickCount) override; void handleMouseDown(int x, int y, MouseButton b, int clickCount) override;

View File

@ -38,10 +38,7 @@
TiaOutputWidget::TiaOutputWidget(GuiObject* boss, const GUI::Font& font, TiaOutputWidget::TiaOutputWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h) int x, int y, int w, int h)
: Widget(boss, font, x, y, w, h), : Widget(boss, font, x, y, w, h),
CommandSender(boss), CommandSender(boss)
myZoom(nullptr),
myClickX(0),
myClickY(0)
{ {
// Create context menu for commands // Create context menu for commands
VariantList l; VariantList l;

View File

@ -49,9 +49,9 @@ class TiaOutputWidget : public Widget, public CommandSender
*/ */
private: private:
unique_ptr<ContextMenu> myMenu; unique_ptr<ContextMenu> 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 // Create this buffer once, instead of allocating it each time the
// TIA image is redrawn // TIA image is redrawn

View File

@ -39,64 +39,64 @@ class TiaWidget : public Widget, public CommandSender
virtual ~TiaWidget() = default; virtual ~TiaWidget() = default;
private: private:
DataGridWidget* myColorRegs; DataGridWidget* myColorRegs{nullptr};
ColorWidget* myCOLUP0Color; ColorWidget* myCOLUP0Color{nullptr};
ColorWidget* myCOLUP1Color; ColorWidget* myCOLUP1Color{nullptr};
ColorWidget* myCOLUPFColor; ColorWidget* myCOLUPFColor{nullptr};
ColorWidget* myCOLUBKColor; ColorWidget* myCOLUBKColor{nullptr};
CheckboxWidget* myFixedEnabled; CheckboxWidget* myFixedEnabled{nullptr};
std::array<ColorWidget*, 8> myFixedColors; std::array<ColorWidget*, 8> myFixedColors{nullptr};
TogglePixelWidget* myGRP0; TogglePixelWidget* myGRP0{nullptr};
TogglePixelWidget* myGRP0Old; TogglePixelWidget* myGRP0Old{nullptr};
TogglePixelWidget* myGRP1; TogglePixelWidget* myGRP1{nullptr};
TogglePixelWidget* myGRP1Old; TogglePixelWidget* myGRP1Old{nullptr};
DataGridWidget* myPosP0; DataGridWidget* myPosP0{nullptr};
DataGridWidget* myPosP1; DataGridWidget* myPosP1{nullptr};
DataGridWidget* myPosM0; DataGridWidget* myPosM0{nullptr};
DataGridWidget* myPosM1; DataGridWidget* myPosM1{nullptr};
DataGridWidget* myPosBL; DataGridWidget* myPosBL{nullptr};
DataGridWidget* myHMP0; DataGridWidget* myHMP0{nullptr};
DataGridWidget* myHMP1; DataGridWidget* myHMP1{nullptr};
DataGridWidget* myHMM0; DataGridWidget* myHMM0{nullptr};
DataGridWidget* myHMM1; DataGridWidget* myHMM1{nullptr};
DataGridWidget* myHMBL; DataGridWidget* myHMBL{nullptr};
DataGridWidget* myNusizP0; DataGridWidget* myNusizP0{nullptr};
DataGridWidget* myNusizP1; DataGridWidget* myNusizP1{nullptr};
DataGridWidget* myNusizM0; DataGridWidget* myNusizM0{nullptr};
DataGridWidget* myNusizM1; DataGridWidget* myNusizM1{nullptr};
DataGridWidget* mySizeBL; DataGridWidget* mySizeBL{nullptr};
EditTextWidget* myNusizP0Text; EditTextWidget* myNusizP0Text{nullptr};
EditTextWidget* myNusizP1Text; EditTextWidget* myNusizP1Text{nullptr};
CheckboxWidget* myRefP0; CheckboxWidget* myRefP0{nullptr};
CheckboxWidget* myRefP1; CheckboxWidget* myRefP1{nullptr};
CheckboxWidget* myDelP0; CheckboxWidget* myDelP0{nullptr};
CheckboxWidget* myDelP1; CheckboxWidget* myDelP1{nullptr};
CheckboxWidget* myDelBL; CheckboxWidget* myDelBL{nullptr};
TogglePixelWidget* myEnaM0; TogglePixelWidget* myEnaM0{nullptr};
TogglePixelWidget* myEnaM1; TogglePixelWidget* myEnaM1{nullptr};
TogglePixelWidget* myEnaBL; TogglePixelWidget* myEnaBL{nullptr};
TogglePixelWidget* myEnaBLOld; TogglePixelWidget* myEnaBLOld{nullptr};
CheckboxWidget* myResMP0; CheckboxWidget* myResMP0{nullptr};
CheckboxWidget* myResMP1; CheckboxWidget* myResMP1{nullptr};
/** Collision register bits */ /** Collision register bits */
std::array<CheckboxWidget*, 15> myCollision; std::array<CheckboxWidget*, 15> myCollision{nullptr};
std::array<TogglePixelWidget*, 3> myPF; std::array<TogglePixelWidget*, 3> myPF{nullptr};
CheckboxWidget* myRefPF; CheckboxWidget* myRefPF{nullptr};
CheckboxWidget* myScorePF; CheckboxWidget* myScorePF{nullptr};
CheckboxWidget* myPriorityPF; CheckboxWidget* myPriorityPF{nullptr};
DelayQueueWidget* myDelayQueueWidget; DelayQueueWidget* myDelayQueueWidget{nullptr};
// ID's for the various widgets // ID's for the various widgets
// We need ID's, since there are more than one of several types of widgets // We need ID's, since there are more than one of several types of widgets

View File

@ -55,13 +55,13 @@ class TiaZoomWidget : public Widget, public CommandSender
private: private:
unique_ptr<ContextMenu> myMenu; unique_ptr<ContextMenu> myMenu;
int myZoomLevel; int myZoomLevel{0};
int myNumCols, myNumRows; int myNumCols{0}, myNumRows{0};
int myOffX, myOffY; int myOffX{0}, myOffY{0};
int myOffXLo, myOffYLo; int myOffXLo{0}, myOffYLo{0};
bool myMouseMoving; bool myMouseMoving{false};
int myClickX, myClickY; int myClickX{0}, myClickY{0};
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported

View File

@ -25,11 +25,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TogglePixelWidget::TogglePixelWidget(GuiObject* boss, const GUI::Font& font, TogglePixelWidget::TogglePixelWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int cols, int rows) int x, int y, int cols, int rows)
: ToggleWidget(boss, font, x, y, cols, rows, 1), : ToggleWidget(boss, font, x, y, cols, rows, 1)
_pixelColor(kNone),
_backgroundColor(kDlgColor),
_swapBits(false),
_crossBits(false)
{ {
_rowHeight = _colWidth = font.getLineHeight(); _rowHeight = _colWidth = font.getLineHeight();

View File

@ -41,9 +41,9 @@ class TogglePixelWidget : public ToggleWidget
void setCrossed(bool enable) { _crossBits = enable; } void setCrossed(bool enable) { _crossBits = enable; }
private: private:
ColorId _pixelColor, _backgroundColor; ColorId _pixelColor{kNone}, _backgroundColor{kDlgColor};
bool _swapBits; bool _swapBits{false};
bool _crossBits; bool _crossBits{false};
private: private:
void drawWidget(bool hilite) override; void drawWidget(bool hilite) override;

View File

@ -24,10 +24,7 @@
AtariVox::AtariVox(Jack jack, const Event& event, const System& system, AtariVox::AtariVox(Jack jack, const Event& event, const System& system,
const string& portname, const string& eepromfile, const string& portname, const string& eepromfile,
const onMessageCallback& callback) const onMessageCallback& callback)
: SaveKey(jack, event, system, eepromfile, callback, Controller::Type::AtariVox), : SaveKey(jack, event, system, eepromfile, callback, Controller::Type::AtariVox)
myShiftCount(0),
myShiftRegister(0),
myLastDataWriteCycle(0)
{ {
mySerialPort = MediaFactory::createSerialPort(); mySerialPort = MediaFactory::createSerialPort();
if(mySerialPort->openPort(portname)) if(mySerialPort->openPort(portname))

View File

@ -97,19 +97,19 @@ class AtariVox : public SaveKey
unique_ptr<SerialPort> mySerialPort; unique_ptr<SerialPort> mySerialPort;
// How many bits have been shifted into the shift register? // How many bits have been shifted into the shift register?
uInt8 myShiftCount; uInt8 myShiftCount{0};
// Shift register. Data comes in serially: // Shift register. Data comes in serially:
// 1 start bit, always 0 // 1 start bit, always 0
// 8 data bits, LSB first // 8 data bits, LSB first
// 1 stop bit, always 1 // 1 stop bit, always 1
uInt16 myShiftRegister; uInt16 myShiftRegister{0};
// When did the last data write start, in CPU cycles? // When did the last data write start, in CPU cycles?
// The real SpeakJet chip reads data at 19200 bits/sec. Alex's // The real SpeakJet chip reads data at 19200 bits/sec. Alex's
// driver code sends data at 62 CPU cycles per bit, which is // driver code sends data at 62 CPU cycles per bit, which is
// "close enough". // "close enough".
uInt64 myLastDataWriteCycle; uInt64 myLastDataWriteCycle{0};
// Holds information concerning serial port usage // Holds information concerning serial port usage
string myAboutString; string myAboutString;

View File

@ -20,8 +20,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BoosterGrip::BoosterGrip(Jack jack, const Event& event, const System& system) BoosterGrip::BoosterGrip(Jack jack, const Event& event, const System& system)
: Controller(jack, event, system, Controller::Type::BoosterGrip), : Controller(jack, event, system, Controller::Type::BoosterGrip)
myControlID(-1)
{ {
if(myJack == Jack::Left) if(myJack == Jack::Left)
{ {

View File

@ -80,7 +80,7 @@ class BoosterGrip : public Controller
myXAxisValue, myYAxisValue; myXAxisValue, myYAxisValue;
// Controller to emulate in normal mouse axis mode // Controller to emulate in normal mouse axis mode
int myControlID; int myControlID{-1};
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported

View File

@ -27,12 +27,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cartridge::Cartridge(const Settings& settings, const string& md5) Cartridge::Cartridge(const Settings& settings, const string& md5)
: mySettings(settings), : mySettings(settings)
myBankChanged(true),
myCodeAccessBase(nullptr),
myRamWriteAccess(0),
myStartBank(0),
myBankLocked(false)
{ {
auto to_uInt32 = [](const string& s, uInt32 pos) { auto to_uInt32 = [](const string& s, uInt32 pos) {
return uInt32(std::stoul(s.substr(pos, 8), nullptr, 16)); return uInt32(std::stoul(s.substr(pos, 8), nullptr, 16));

View File

@ -318,22 +318,22 @@ class Cartridge : public Device
const Settings& mySettings; const Settings& mySettings;
// Indicates if the bank has changed somehow (a bankswitch has occurred) // 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 // The array containing information about every byte of ROM indicating
// whether it is used as code. // whether it is used as code.
ByteBuffer myCodeAccessBase; ByteBuffer myCodeAccessBase;
// Contains address of illegal RAM write access or 0 // Contains address of illegal RAM write access or 0
uInt16 myRamWriteAccess; uInt16 myRamWriteAccess{0};
private: private:
// The startup bank to use (where to look for the reset vector address) // 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 // If myBankLocked is true, ignore attempts at bankswitching. This is used
// by the debugger, when disassembling/dumping ROM. // by the debugger, when disassembling/dumping ROM.
bool myBankLocked; bool myBankLocked{false};
// Semi-random values to use when a read from write port occurs // Semi-random values to use when a read from write port occurs
std::array<uInt8, 256> myRWPRandomValues; std::array<uInt8, 256> myRWPRandomValues;

View File

@ -21,8 +21,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cartridge0840::Cartridge0840(const ByteBuffer& image, size_t size, Cartridge0840::Cartridge0840(const ByteBuffer& image, size_t size,
const string& md5, const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings, md5), : Cartridge(settings, md5)
myBankOffset(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin()); std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());

View File

@ -156,7 +156,7 @@ class Cartridge0840 : public Cartridge
std::array<uInt8, 8_KB> myImage; std::array<uInt8, 8_KB> myImage;
// Indicates the offset into the ROM image (aligns to current bank) // Indicates the offset into the ROM image (aligns to current bank)
uInt16 myBankOffset; uInt16 myBankOffset{0};
// Previous Device's page access // Previous Device's page access
std::array<System::PageAccess, 8> myHotSpotPageAccess; std::array<System::PageAccess, 8> myHotSpotPageAccess;

View File

@ -130,10 +130,10 @@ class Cartridge2K : public Cartridge
ByteBuffer myImage; ByteBuffer myImage;
// Size of the ROM image // Size of the ROM image
size_t mySize; size_t mySize{0};
// Mask to use for mirroring // Mask to use for mirroring
uInt16 myMask; uInt16 myMask{0};
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported

View File

@ -23,8 +23,7 @@
Cartridge3E::Cartridge3E(const ByteBuffer& image, size_t size, Cartridge3E::Cartridge3E(const ByteBuffer& image, size_t size,
const string& md5, const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings, md5), : Cartridge(settings, md5),
mySize(size), mySize(size)
myCurrentBank(0)
{ {
// Allocate array for the ROM image // Allocate array for the ROM image
myImage = make_unique<uInt8[]>(mySize); myImage = make_unique<uInt8[]>(mySize);

View File

@ -188,10 +188,10 @@ class Cartridge3E : public Cartridge
std::array<uInt8, 32_KB> myRAM; std::array<uInt8, 32_KB> myRAM;
// Size of the ROM image // Size of the ROM image
size_t mySize; size_t mySize{0};
// Indicates which bank is currently active for the first segment // Indicates which bank is currently active for the first segment
uInt16 myCurrentBank; uInt16 myCurrentBank{0};
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported

View File

@ -191,7 +191,7 @@ class Cartridge3EPlus: public Cartridge
static constexpr uInt16 RAM_WRITE_OFFSET = 0x200; static constexpr uInt16 RAM_WRITE_OFFSET = 0x200;
ByteBuffer myImage; // Pointer to a dynamically allocated ROM image of the cartridge 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<uInt8, RAM_TOTAL_SIZE> myRAM; std::array<uInt8, RAM_TOTAL_SIZE> myRAM;
private: private:

View File

@ -23,8 +23,7 @@
Cartridge3F::Cartridge3F(const ByteBuffer& image, size_t size, Cartridge3F::Cartridge3F(const ByteBuffer& image, size_t size,
const string& md5, const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings, md5), : Cartridge(settings, md5),
mySize(size), mySize(size)
myCurrentBank(0)
{ {
// Allocate array for the ROM image // Allocate array for the ROM image
myImage = make_unique<uInt8[]>(mySize); myImage = make_unique<uInt8[]>(mySize);

View File

@ -162,10 +162,10 @@ class Cartridge3F : public Cartridge
ByteBuffer myImage; ByteBuffer myImage;
// Size of the ROM image // Size of the ROM image
size_t mySize; size_t mySize{0};
// Indicates which bank is currently active for the first segment // Indicates which bank is currently active for the first segment
uInt16 myCurrentBank; uInt16 myCurrentBank{0};
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported

View File

@ -24,15 +24,7 @@
Cartridge4A50::Cartridge4A50(const ByteBuffer& image, size_t size, Cartridge4A50::Cartridge4A50(const ByteBuffer& image, size_t size,
const string& md5, const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings, md5), : Cartridge(settings, md5),
mySize(size), mySize(size)
mySliceLow(0),
mySliceMiddle(0),
mySliceHigh(0),
myIsRomLow(true),
myIsRomMiddle(true),
myIsRomHigh(true),
myLastAddress(0),
myLastData(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
// Supported file sizes are 32/64/128K, which are duplicated if necessary // Supported file sizes are 32/64/128K, which are duplicated if necessary

View File

@ -225,21 +225,21 @@ class Cartridge4A50 : public Cartridge
std::array<uInt8, 32_KB> myRAM; std::array<uInt8, 32_KB> myRAM;
// (Actual) Size of the ROM image // (Actual) Size of the ROM image
size_t mySize; size_t mySize{0};
// Indicates the slice mapped into each of the three segments // Indicates the slice mapped into each of the three segments
uInt16 mySliceLow; /* index pointer for $1000-$17ff slice */ uInt16 mySliceLow{0}; // index pointer for $1000-$17ff slice
uInt16 mySliceMiddle; /* index pointer for $1800-$1dff slice */ uInt16 mySliceMiddle{0}; // index pointer for $1800-$1dff slice
uInt16 mySliceHigh; /* index pointer for $1e00-$1eff slice */ uInt16 mySliceHigh{0}; // index pointer for $1e00-$1eff slice
// Indicates whether the given slice is mapped to ROM or RAM // Indicates whether the given slice is mapped to ROM or RAM
bool myIsRomLow; /* true = ROM -- false = RAM at $1000-$17ff */ bool myIsRomLow{true}; // true = ROM -- false = RAM at $1000-$17ff
bool myIsRomMiddle; /* true = ROM -- false = RAM at $1800-$1dff */ bool myIsRomMiddle{true}; // true = ROM -- false = RAM at $1800-$1dff
bool myIsRomHigh; /* true = ROM -- false = RAM at $1e00-$1eFF */ bool myIsRomHigh{true}; // true = ROM -- false = RAM at $1e00-$1eFF
// The previous address and data values (from peek and poke) // The previous address and data values (from peek and poke)
uInt16 myLastAddress; uInt16 myLastAddress{0};
uInt8 myLastData; uInt8 myLastData{0};
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported

View File

@ -23,13 +23,7 @@
CartridgeAR::CartridgeAR(const ByteBuffer& image, size_t size, CartridgeAR::CartridgeAR(const ByteBuffer& image, size_t size,
const string& md5, const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings, md5), : Cartridge(settings, md5),
mySize(std::max<size_t>(size, 8448)), mySize(std::max<size_t>(size, 8448))
myWriteEnabled(false),
myPower(true),
myDataHoldRegister(0),
myNumberOfDistinctAccesses(0),
myWritePending(false),
myCurrentBank(0)
{ {
// Create a load image buffer and copy the given image // Create a load image buffer and copy the given image
myLoadImages = make_unique<uInt8[]>(mySize); myLoadImages = make_unique<uInt8[]>(mySize);
@ -38,7 +32,8 @@ CartridgeAR::CartridgeAR(const ByteBuffer& image, size_t size,
// Add header if image doesn't include it // Add header if image doesn't include it
if(size < 8448) 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 // We use System::PageAccess.codeAccessBase, but don't allow its use
// through a pointer, since the AR scheme doesn't support bankswitching // through a pointer, since the AR scheme doesn't support bankswitching

View File

@ -196,31 +196,31 @@ class CartridgeAR : public Cartridge
std::array<uInt8, 256> myHeader; std::array<uInt8, 256> myHeader;
// Size of the ROM image // Size of the ROM image
size_t mySize; size_t mySize{0};
// All of the 8448 byte loads associated with the game // All of the 8448 byte loads associated with the game
ByteBuffer myLoadImages; ByteBuffer myLoadImages;
// Indicates how many 8448 loads there are // Indicates how many 8448 loads there are
uInt8 myNumberOfLoadImages; uInt8 myNumberOfLoadImages{0};
// Indicates if the RAM is write enabled // Indicates if the RAM is write enabled
bool myWriteEnabled; bool myWriteEnabled{false};
// Indicates if the ROM's power is on or off // Indicates if the ROM's power is on or off
bool myPower; bool myPower{true};
// Data hold register used for writing // Data hold register used for writing
uInt8 myDataHoldRegister; uInt8 myDataHoldRegister{0};
// Indicates number of distinct accesses when data hold register was set // Indicates number of distinct accesses when data hold register was set
uInt32 myNumberOfDistinctAccesses; uInt32 myNumberOfDistinctAccesses{0};
// Indicates if a write is pending or not // Indicates if a write is pending or not
bool myWritePending; bool myWritePending{false};
// Indicates which bank is currently active // Indicates which bank is currently active
uInt16 myCurrentBank; uInt16 myCurrentBank{0};
// Fake SC-BIOS code to simulate the Supercharger load bars // Fake SC-BIOS code to simulate the Supercharger load bars
static std::array<uInt8, 294> ourDummyROMCode; static std::array<uInt8, 294> ourDummyROMCode;

View File

@ -21,8 +21,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeBF::CartridgeBF(const ByteBuffer& image, size_t size, CartridgeBF::CartridgeBF(const ByteBuffer& image, size_t size,
const string& md5, const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings, md5), : Cartridge(settings, md5)
myBankOffset(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin()); std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());

View File

@ -157,7 +157,7 @@ class CartridgeBF : public Cartridge
std::array<uInt8, 256_KB> myImage; std::array<uInt8, 256_KB> myImage;
// Indicates the offset into the ROM image (aligns to current bank) // Indicates the offset into the ROM image (aligns to current bank)
uInt32 myBankOffset; uInt32 myBankOffset{0};
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported

View File

@ -21,8 +21,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeBFSC::CartridgeBFSC(const ByteBuffer& image, size_t size, CartridgeBFSC::CartridgeBFSC(const ByteBuffer& image, size_t size,
const string& md5, const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings, md5), : Cartridge(settings, md5)
myBankOffset(0)
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin()); std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());

View File

@ -160,7 +160,7 @@ class CartridgeBFSC : public Cartridge
std::array<uInt8, 128> myRAM; std::array<uInt8, 128> myRAM;
// Indicates the offset into the ROM image (aligns to current bank) // Indicates the offset into the ROM image (aligns to current bank)
uInt32 myBankOffset; uInt32 myBankOffset{0};
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported

Some files were not shown because too many files have changed in this diff Show More