From 2dde406bb9cd8cc389344cf4859a6a6467682e02 Mon Sep 17 00:00:00 2001 From: thrust26 Date: Fri, 17 Nov 2017 17:26:42 +0100 Subject: [PATCH] some minor cleanup and preparation for more options --- src/emucore/Settings.cxx | 2 +- src/gui/DeveloperDialog.cxx | 67 ++++++++++++++++++++++++------------- src/gui/DeveloperDialog.hxx | 12 ++++--- 3 files changed, 52 insertions(+), 29 deletions(-) diff --git a/src/emucore/Settings.cxx b/src/emucore/Settings.cxx index 8492b3d30..2f10c6165 100644 --- a/src/emucore/Settings.cxx +++ b/src/emucore/Settings.cxx @@ -155,7 +155,7 @@ Settings::Settings(OSystem& osystem) setInternal("dev.cpurandom", "SAXYP"); setInternal("dev.colorloss", "true"); setInternal("dev.tv.jitter", "true"); - setInternal("dev.tv.jitter_recovery", "1"); + setInternal("dev.tv.jitter_recovery", "2"); setInternal("dev.debugcolors", "false"); setInternal("dev.tiadriven", "true"); diff --git a/src/gui/DeveloperDialog.cxx b/src/gui/DeveloperDialog.cxx index c21823407..47d70680d 100644 --- a/src/gui/DeveloperDialog.cxx +++ b/src/gui/DeveloperDialog.cxx @@ -31,7 +31,7 @@ #include "Font.hxx" #ifdef DEBUGGER_SUPPORT #include "DebuggerDialog.hxx" -#endif +#endif #include "Console.hxx" #include "TIA.hxx" #include "OSystem.hxx" @@ -59,8 +59,8 @@ DeveloperDialog::DeveloperDialog(OSystem& osystem, DialogContainer& parent, WidgetArray wid; /*ypos = VBORDER; - myDevSettings = new CheckboxWidget(this, font, HBORDER, ypos, "Enable developer settings", kDevOptions); - wid.push_back(myDevSettings); + myDevSettings0 = new CheckboxWidget(this, font, HBORDER, ypos, "Enable developer settings", kDevSettings0); + wid.push_back(myDevSettings0); addToFocusList(wid);*/ // The tab widget @@ -97,8 +97,8 @@ void DeveloperDialog::addEmulationTab(const GUI::Font& font) tabID = myTab->addTab(" Emulation "); ypos = VBORDER; - myDevSettings = new CheckboxWidget(myTab, font, HBORDER, ypos, "Enable developer settings", kDevOptions); - wid.push_back(myDevSettings); + myDevSettings0 = new CheckboxWidget(myTab, font, HBORDER, ypos, "Enable developer settings", kDevSettings0); + wid.push_back(myDevSettings0); ypos += lineHeight + VGAP; @@ -188,6 +188,32 @@ void DeveloperDialog::addVideoTab(const GUI::Font& font) addToFocusList(wid, myTab, tabID); }*/ +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void DeveloperDialog::addStatesTab(const GUI::Font& font) +{ + const int VGAP = 4; + const int INDENT = 13 + 3; + const int HBORDER = 10; + const int VBORDER = 8; + + int ypos; + int lineHeight = font.getLineHeight(); + StringList actions; + WidgetArray wid; + int fontWidth = font.getMaxCharWidth(), fontHeight = font.getFontHeight(); + + int tabID = myTab->addTab("States"); + + ypos = VBORDER; + myDevSettings1 = new CheckboxWidget(myTab, font, HBORDER, ypos, "Enable developer settings", kDevSettings1); + wid.push_back(myDevSettings1); + ypos += lineHeight + VGAP; + + new StaticTextWidget(myTab, font, HBORDER + INDENT, ypos, "TODO: Rewind-States"); + + addToFocusList(wid, myTab, tabID); +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void DeveloperDialog::addDebuggerTab(const GUI::Font& font) { @@ -312,18 +338,6 @@ void DeveloperDialog::addUITab(const GUI::Font& font) addToFocusList(wid, myTab, tabID); }*/ -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void DeveloperDialog::addStatesTab(const GUI::Font& font) -{ - int tabID = myTab->addTab("States"); - WidgetArray wid; - - new StaticTextWidget(myTab, font, 10, 10, "TODO: Rewind-States"); - - addToFocusList(wid, myTab, tabID); -} - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void DeveloperDialog::addDefaultOKCancelButtons(const GUI::Font& font) { @@ -342,7 +356,7 @@ void DeveloperDialog::addDefaultOKCancelButtons(const GUI::Font& font) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void DeveloperDialog::loadConfig() { - myDevSettings->setState(instance().settings().getBool("dev.settings")); + myDevSettings0->setState(instance().settings().getBool("dev.settings")); myRandomBank->setState(instance().settings().getBool("dev.bankrandom")); myRandomizeRAM->setState(instance().settings().getBool("dev.ramrandom")); @@ -397,7 +411,7 @@ void DeveloperDialog::saveConfig() // - thumbexception (commandline only yet) // - debugcolors (no effect yet) - bool devSettings = myDevSettings->getState(); + bool devSettings = myDevSettings0->getState(); instance().settings().setValue("dev.settings", devSettings); instance().settings().setValue("dev.bankrandom", myRandomBank->getState()); @@ -460,7 +474,7 @@ void DeveloperDialog::saveConfig() void DeveloperDialog::setDefaults() { - myDevSettings->setState(false); + myDevSettings0->setState(false); switch(myTab->getActiveTab()) { @@ -475,7 +489,7 @@ void DeveloperDialog::setDefaults() myColorLoss->setState(true); // jitter myTVJitter->setState(true); - myTVJitterRec->setValue(1); + myTVJitterRec->setValue(2); // debug colors myDebugColors->setState(false); // Undriven TIA pins @@ -513,7 +527,12 @@ void DeveloperDialog::handleCommand(CommandSender* sender, int cmd, int data, in { switch(cmd) { - case kDevOptions: + case kDevSettings0: + myDevSettings1->setState(myDevSettings0->getState()); + enableOptions(); + break; + case kDevSettings1: + myDevSettings0->setState(myDevSettings1->getState()); enableOptions(); break; @@ -582,7 +601,7 @@ void DeveloperDialog::handleCommand(CommandSender* sender, int cmd, int data, in // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void DeveloperDialog::enableOptions() { - bool enable = myDevSettings->getState(); + bool enable = myDevSettings0->getState(); // CPU myLoadingROMLabel->setEnabled(enable); @@ -611,7 +630,7 @@ void DeveloperDialog::handleTVJitterChange(bool enable) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void DeveloperDialog::handleDebugColors() { - if(instance().hasConsole() && myDevSettings->getState()) + if(instance().hasConsole() && myDevSettings0->getState()) { bool fixed = instance().console().tia().usingFixedColors(); if(fixed != myDebugColors->getState()) diff --git a/src/gui/DeveloperDialog.hxx b/src/gui/DeveloperDialog.hxx index 3e098e31c..f8eb5ac80 100644 --- a/src/gui/DeveloperDialog.hxx +++ b/src/gui/DeveloperDialog.hxx @@ -58,22 +58,26 @@ class DeveloperDialog : public Dialog private: enum { - kDevOptions = 'DVop', + kDevSettings0 = 'DVs0', kRandRAMID = 'DVrm', kRandCPUID = 'DVcp', kTVJitter = 'DVjt', kTVJitterChanged = 'DVjr', kPPinCmd = 'DVpn', + kDevSettings1 = 'DVs1', + #ifdef DEBUGGER_SUPPORT kDWidthChanged = 'UIdw', kDHeightChanged = 'UIdh', kDSmallSize = 'UIds', kDMediumSize = 'UIdm', kDLargeSize = 'UIdl' + #endif }; TabWidget* myTab; - CheckboxWidget* myDevSettings; + CheckboxWidget* myDevSettings0; + CheckboxWidget* myDevSettings1; StaticTextWidget* myLoadingROMLabel; CheckboxWidget* myRandomBank; @@ -89,14 +93,14 @@ class DeveloperDialog : public Dialog CheckboxWidget* myDebugColors; CheckboxWidget* myUndrivenPins; - #ifdef DEBUGGER_SUPPORT +#ifdef DEBUGGER_SUPPORT // Debugger options SliderWidget* myDebuggerWidthSlider; StaticTextWidget* myDebuggerWidthLabel; SliderWidget* myDebuggerHeightSlider; StaticTextWidget* myDebuggerHeightLabel; PopUpWidget* myDebuggerFontStyle; - #endif +#endif // Maximum width and height for this dialog int myMaxWidth, myMaxHeight;