diff --git a/src/emucore/Settings.cxx b/src/emucore/Settings.cxx index cbfe15fee..551ca1dbe 100644 --- a/src/emucore/Settings.cxx +++ b/src/emucore/Settings.cxx @@ -144,6 +144,23 @@ Settings::Settings(OSystem& osystem) setInternal("dis.relocate", "false"); #endif + // player settings + setInternal("plr.settings", "false"); + setInternal("plr.stats", "false"); + setInternal("plr.bankrandom", "true"); + setInternal("plr.ramrandom", "true"); + setInternal("plr.cpurandom", "SAXYP"); + setInternal("plr.colorloss", "true"); + setInternal("plr.tv.jitter", "true"); + setInternal("plr.tv.jitter_recovery", "2"); + setInternal("plr.debugcolors", "false"); + setInternal("plr.tiadriven", "true"); + setInternal("plr.console", "2600"); // 7800 + setInternal("plr.rewind", false); + setInternal("plr.rewind.size", 100); + setInternal("plr.rewind.interval", 2); // = 1 frame + setInternal("plr.rewind.horizon", 3); // = ~10 seconds + // developer settings setInternal("dev.settings", "false"); setInternal("dev.stats", "false"); @@ -311,6 +328,18 @@ void Settings::validate() i = getInt("dev.rewind.horizon"); if(i < 0 || i > 6) setInternal("dev.rewind.horizon", 3); + i = getInt("plr.tv.jitter_recovery"); + if(i < 1 || i > 20) setInternal("plr.tv.jitter_recovery", "10"); + + i = getInt("plr.rewind.size"); + if(i < 100 || i > 1000) setInternal("plr.rewind.size", 100); + + i = getInt("plr.rewind.interval"); + if(i < 0 || i > 5) setInternal("plr.rewind.interval", 2); + + i = getInt("plr.rewind.horizon"); + if(i < 0 || i > 6) setInternal("plr.rewind.horizon", 3); + #ifdef SOUND_SUPPORT i = getInt("volume"); if(i < 0 || i > 100) setInternal("volume", "100"); @@ -509,8 +538,22 @@ void Settings::usage() const << " -height Sets the 'Display.Height' property\n" << " -pp Sets the 'Display.Phosphor' property\n" << " -ppblend Sets the 'Display.PPBlend' property\n" + << endl #endif + << " Various development related parameters for player settings mode\n" + << endl + << " -plr.console <2600|7800> Select console for B/W and Pause key handling\n" + << " -plr.stats <1|0> Overlay console info during emulation\n" + << " -plr.tiadriven <1|0> Drive unused TIA pins randomly on a read/peek\n" + << " -plr.cpurandom <1|0> Randomize the contents of CPU registers on reset\n" + << " -plr.ramrandom <1|0> Randomize the contents of RAM on reset\n" + << " -plr.colorloss <1|0> Enable PAL color-loss effect\n" + << " -plr.tv.jitter <1|0> Enable TV jitter effect\n" + << " -plr.tv.jitter_recovery <1-20> Set recovery time for TV jitter effect\n" + << " -plr.debugcolors <1|0> Enable debug colors\n" + << endl + << " The same parameters but for developer settings mode\n" << " -dev.console <2600|7800> Select console for B/W and Pause key handling\n" << " -dev.stats <1|0> Overlay console info during emulation\n" << " -dev.tiadriven <1|0> Drive unused TIA pins randomly on a read/peek\n" diff --git a/src/gui/Widget.cxx b/src/gui/Widget.cxx index 98a7f6d13..21e597935 100644 --- a/src/gui/Widget.cxx +++ b/src/gui/Widget.cxx @@ -568,128 +568,6 @@ void CheckboxWidget::drawWidget(bool hilite) isEnabled() ? kTextColor : kColor); } -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -/* 8x8 radiobutton bitmap */ -static uInt32 radio_img_outercircle[14] = -{ - 0b00001111110000, - 0b00111111111100, - 0b01110000001110, - 0b01100000000110, - 0b11000000000011, - 0b11000000000011, - 0b11000000000011, - 0b11000000000011, - 0b11000000000011, - 0b11000000000011, - 0b01100000000110, - 0b01110000001110, - 0b00111111111100, - 0b00001111110000 -}; - -static uInt32 radio_img_innercircle[10] = -{ - 0b0011111100, - 0b0111111110, - 0b1111111111, - 0b1111111111, - 0b1111111111, - 0b1111111111, - 0b1111111111, - 0b1111111111, - 0b0111111110, - 0b0011111100 -}; - -static uInt32 radio_img_active[8] = -{ - 0b00111100, - 0b01111110, - 0b11111111, - 0b11111111, - 0b11111111, - 0b11111111, - 0b01111110, - 0b00111100 -}; - -static uInt32 radio_img_inactive[8] = -{ - 0b00111100, - 0b01111110, - 0b11100111, - 0b11000011, - 0b11000011, - 0b11100111, - 0b01111110, - 0b00111100 -}; - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -RadioButtonWidget::RadioButtonWidget(GuiObject* boss, const GUI::Font& font, - int x, int y, const string& label, - int cmd) - : CheckboxWidget(boss, font, x, y, label, cmd) -{ - _flags = WIDGET_ENABLED; - _bgcolor = _bgcolorhi = kWidColor; - - _editable = true; - - if(label == "") - _w = 14; - else - _w = font.getStringWidth(label) + 20; - _h = font.getFontHeight() < 14 ? 14 : font.getFontHeight(); - - - // Depending on font size, either the font or box will need to be - // centered vertically - if(_h > 14) // center box - _boxY = (_h - 14) / 2; - else // center text - _textY = (14 - _font.getFontHeight()) / 2; - - setFill(CheckboxWidget::Normal); -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void RadioButtonWidget::setFill(FillType type) -{ - switch(type) - { - case CheckboxWidget::Normal: - _img = radio_img_active; - break; - case CheckboxWidget::Inactive: - _img = radio_img_inactive; - break; - default: - break; - } -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void RadioButtonWidget::drawWidget(bool hilite) -{ - FBSurface& s = _boss->dialog().surface(); - - // Draw the outer bounding circle - s.drawBitmap(radio_img_outercircle, _x, _y + _boxY, kShadowColor, 14, 14); - - // Draw the inner bounding circle with enabled color - s.drawBitmap(radio_img_innercircle, _x + 2, _y + _boxY + 2, isEnabled() ? _bgcolor : kColor, 10, 10); - - // draw state - if(_state) - s.drawBitmap(_img, _x + 3, _y + _boxY + 3, isEnabled() ? kCheckColor : kShadowColor); - - // Finally draw the label - s.drawString(_font, _label, _x + 20, _y + _textY, _w, - isEnabled() ? kTextColor : kColor); -} - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SliderWidget::SliderWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h, diff --git a/src/gui/Widget.hxx b/src/gui/Widget.hxx index 5b67cdebb..dd40d07fe 100644 --- a/src/gui/Widget.hxx +++ b/src/gui/Widget.hxx @@ -279,8 +279,6 @@ class CheckboxWidget : public ButtonWidget int _boxY; int _textY; - private: - private: // Following constructors and assignment operators not supported CheckboxWidget() = delete; @@ -290,26 +288,6 @@ class CheckboxWidget : public ButtonWidget CheckboxWidget& operator=(CheckboxWidget&&) = delete; }; -class RadioButtonWidget : public CheckboxWidget -{ -public: - RadioButtonWidget(GuiObject* boss, const GUI::Font& font, int x, int y, - const string& label, int cmd = 0); - -protected: - void setFill(FillType type); - void drawWidget(bool hilite) override; - -private: - // Following constructors and assignment operators not supported - RadioButtonWidget() = delete; - RadioButtonWidget(const RadioButtonWidget&) = delete; - RadioButtonWidget(RadioButtonWidget&&) = delete; - RadioButtonWidget& operator=(const RadioButtonWidget&) = delete; - RadioButtonWidget& operator=(RadioButtonWidget&&) = delete; -}; - - /* SliderWidget */ class SliderWidget : public ButtonWidget { diff --git a/src/gui/module.mk b/src/gui/module.mk index 8cdc561a7..06a8f46c5 100644 --- a/src/gui/module.mk +++ b/src/gui/module.mk @@ -36,6 +36,7 @@ MODULE_OBJS := \ src/gui/OptionsDialog.o \ src/gui/PopUpWidget.o \ src/gui/ProgressDialog.o \ + src/gui/RadioButtonWidget.o \ src/gui/RomAuditDialog.o \ src/gui/RomInfoWidget.o \ src/gui/ScrollBarWidget.o \ diff --git a/src/windows/Stella.vcxproj b/src/windows/Stella.vcxproj index 43c607ee9..df7f4978e 100644 --- a/src/windows/Stella.vcxproj +++ b/src/windows/Stella.vcxproj @@ -340,6 +340,7 @@ + @@ -634,6 +635,7 @@ + diff --git a/src/windows/Stella.vcxproj.filters b/src/windows/Stella.vcxproj.filters index 000ccd26b..008a2aa21 100644 --- a/src/windows/Stella.vcxproj.filters +++ b/src/windows/Stella.vcxproj.filters @@ -870,6 +870,9 @@ Source Files\debugger + + Source Files\gui + @@ -1772,6 +1775,9 @@ Header Files\gui + + Header Files\gui +