mirror of https://github.com/stella-emu/stella.git
some minor cleanup and preparation for more options
This commit is contained in:
parent
78f2211f1f
commit
2dde406bb9
|
@ -155,7 +155,7 @@ Settings::Settings(OSystem& osystem)
|
||||||
setInternal("dev.cpurandom", "SAXYP");
|
setInternal("dev.cpurandom", "SAXYP");
|
||||||
setInternal("dev.colorloss", "true");
|
setInternal("dev.colorloss", "true");
|
||||||
setInternal("dev.tv.jitter", "true");
|
setInternal("dev.tv.jitter", "true");
|
||||||
setInternal("dev.tv.jitter_recovery", "1");
|
setInternal("dev.tv.jitter_recovery", "2");
|
||||||
setInternal("dev.debugcolors", "false");
|
setInternal("dev.debugcolors", "false");
|
||||||
setInternal("dev.tiadriven", "true");
|
setInternal("dev.tiadriven", "true");
|
||||||
|
|
||||||
|
|
|
@ -59,8 +59,8 @@ DeveloperDialog::DeveloperDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
WidgetArray wid;
|
WidgetArray wid;
|
||||||
|
|
||||||
/*ypos = VBORDER;
|
/*ypos = VBORDER;
|
||||||
myDevSettings = new CheckboxWidget(this, font, HBORDER, ypos, "Enable developer settings", kDevOptions);
|
myDevSettings0 = new CheckboxWidget(this, font, HBORDER, ypos, "Enable developer settings", kDevSettings0);
|
||||||
wid.push_back(myDevSettings);
|
wid.push_back(myDevSettings0);
|
||||||
addToFocusList(wid);*/
|
addToFocusList(wid);*/
|
||||||
|
|
||||||
// The tab widget
|
// The tab widget
|
||||||
|
@ -97,8 +97,8 @@ void DeveloperDialog::addEmulationTab(const GUI::Font& font)
|
||||||
tabID = myTab->addTab(" Emulation ");
|
tabID = myTab->addTab(" Emulation ");
|
||||||
|
|
||||||
ypos = VBORDER;
|
ypos = VBORDER;
|
||||||
myDevSettings = new CheckboxWidget(myTab, font, HBORDER, ypos, "Enable developer settings", kDevOptions);
|
myDevSettings0 = new CheckboxWidget(myTab, font, HBORDER, ypos, "Enable developer settings", kDevSettings0);
|
||||||
wid.push_back(myDevSettings);
|
wid.push_back(myDevSettings0);
|
||||||
|
|
||||||
ypos += lineHeight + VGAP;
|
ypos += lineHeight + VGAP;
|
||||||
|
|
||||||
|
@ -188,6 +188,32 @@ void DeveloperDialog::addVideoTab(const GUI::Font& font)
|
||||||
addToFocusList(wid, myTab, tabID);
|
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)
|
void DeveloperDialog::addDebuggerTab(const GUI::Font& font)
|
||||||
{
|
{
|
||||||
|
@ -312,18 +338,6 @@ void DeveloperDialog::addUITab(const GUI::Font& font)
|
||||||
addToFocusList(wid, myTab, tabID);
|
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)
|
void DeveloperDialog::addDefaultOKCancelButtons(const GUI::Font& font)
|
||||||
{
|
{
|
||||||
|
@ -342,7 +356,7 @@ void DeveloperDialog::addDefaultOKCancelButtons(const GUI::Font& font)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void DeveloperDialog::loadConfig()
|
void DeveloperDialog::loadConfig()
|
||||||
{
|
{
|
||||||
myDevSettings->setState(instance().settings().getBool("dev.settings"));
|
myDevSettings0->setState(instance().settings().getBool("dev.settings"));
|
||||||
|
|
||||||
myRandomBank->setState(instance().settings().getBool("dev.bankrandom"));
|
myRandomBank->setState(instance().settings().getBool("dev.bankrandom"));
|
||||||
myRandomizeRAM->setState(instance().settings().getBool("dev.ramrandom"));
|
myRandomizeRAM->setState(instance().settings().getBool("dev.ramrandom"));
|
||||||
|
@ -397,7 +411,7 @@ void DeveloperDialog::saveConfig()
|
||||||
// - thumbexception (commandline only yet)
|
// - thumbexception (commandline only yet)
|
||||||
// - debugcolors (no effect yet)
|
// - debugcolors (no effect yet)
|
||||||
|
|
||||||
bool devSettings = myDevSettings->getState();
|
bool devSettings = myDevSettings0->getState();
|
||||||
instance().settings().setValue("dev.settings", devSettings);
|
instance().settings().setValue("dev.settings", devSettings);
|
||||||
|
|
||||||
instance().settings().setValue("dev.bankrandom", myRandomBank->getState());
|
instance().settings().setValue("dev.bankrandom", myRandomBank->getState());
|
||||||
|
@ -460,7 +474,7 @@ void DeveloperDialog::saveConfig()
|
||||||
|
|
||||||
void DeveloperDialog::setDefaults()
|
void DeveloperDialog::setDefaults()
|
||||||
{
|
{
|
||||||
myDevSettings->setState(false);
|
myDevSettings0->setState(false);
|
||||||
|
|
||||||
switch(myTab->getActiveTab())
|
switch(myTab->getActiveTab())
|
||||||
{
|
{
|
||||||
|
@ -475,7 +489,7 @@ void DeveloperDialog::setDefaults()
|
||||||
myColorLoss->setState(true);
|
myColorLoss->setState(true);
|
||||||
// jitter
|
// jitter
|
||||||
myTVJitter->setState(true);
|
myTVJitter->setState(true);
|
||||||
myTVJitterRec->setValue(1);
|
myTVJitterRec->setValue(2);
|
||||||
// debug colors
|
// debug colors
|
||||||
myDebugColors->setState(false);
|
myDebugColors->setState(false);
|
||||||
// Undriven TIA pins
|
// Undriven TIA pins
|
||||||
|
@ -513,7 +527,12 @@ void DeveloperDialog::handleCommand(CommandSender* sender, int cmd, int data, in
|
||||||
{
|
{
|
||||||
switch(cmd)
|
switch(cmd)
|
||||||
{
|
{
|
||||||
case kDevOptions:
|
case kDevSettings0:
|
||||||
|
myDevSettings1->setState(myDevSettings0->getState());
|
||||||
|
enableOptions();
|
||||||
|
break;
|
||||||
|
case kDevSettings1:
|
||||||
|
myDevSettings0->setState(myDevSettings1->getState());
|
||||||
enableOptions();
|
enableOptions();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -582,7 +601,7 @@ void DeveloperDialog::handleCommand(CommandSender* sender, int cmd, int data, in
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void DeveloperDialog::enableOptions()
|
void DeveloperDialog::enableOptions()
|
||||||
{
|
{
|
||||||
bool enable = myDevSettings->getState();
|
bool enable = myDevSettings0->getState();
|
||||||
|
|
||||||
// CPU
|
// CPU
|
||||||
myLoadingROMLabel->setEnabled(enable);
|
myLoadingROMLabel->setEnabled(enable);
|
||||||
|
@ -611,7 +630,7 @@ void DeveloperDialog::handleTVJitterChange(bool enable)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void DeveloperDialog::handleDebugColors()
|
void DeveloperDialog::handleDebugColors()
|
||||||
{
|
{
|
||||||
if(instance().hasConsole() && myDevSettings->getState())
|
if(instance().hasConsole() && myDevSettings0->getState())
|
||||||
{
|
{
|
||||||
bool fixed = instance().console().tia().usingFixedColors();
|
bool fixed = instance().console().tia().usingFixedColors();
|
||||||
if(fixed != myDebugColors->getState())
|
if(fixed != myDebugColors->getState())
|
||||||
|
|
|
@ -58,22 +58,26 @@ class DeveloperDialog : public Dialog
|
||||||
private:
|
private:
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
kDevOptions = 'DVop',
|
kDevSettings0 = 'DVs0',
|
||||||
kRandRAMID = 'DVrm',
|
kRandRAMID = 'DVrm',
|
||||||
kRandCPUID = 'DVcp',
|
kRandCPUID = 'DVcp',
|
||||||
kTVJitter = 'DVjt',
|
kTVJitter = 'DVjt',
|
||||||
kTVJitterChanged = 'DVjr',
|
kTVJitterChanged = 'DVjr',
|
||||||
kPPinCmd = 'DVpn',
|
kPPinCmd = 'DVpn',
|
||||||
|
kDevSettings1 = 'DVs1',
|
||||||
|
#ifdef DEBUGGER_SUPPORT
|
||||||
kDWidthChanged = 'UIdw',
|
kDWidthChanged = 'UIdw',
|
||||||
kDHeightChanged = 'UIdh',
|
kDHeightChanged = 'UIdh',
|
||||||
kDSmallSize = 'UIds',
|
kDSmallSize = 'UIds',
|
||||||
kDMediumSize = 'UIdm',
|
kDMediumSize = 'UIdm',
|
||||||
kDLargeSize = 'UIdl'
|
kDLargeSize = 'UIdl'
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
TabWidget* myTab;
|
TabWidget* myTab;
|
||||||
|
|
||||||
CheckboxWidget* myDevSettings;
|
CheckboxWidget* myDevSettings0;
|
||||||
|
CheckboxWidget* myDevSettings1;
|
||||||
|
|
||||||
StaticTextWidget* myLoadingROMLabel;
|
StaticTextWidget* myLoadingROMLabel;
|
||||||
CheckboxWidget* myRandomBank;
|
CheckboxWidget* myRandomBank;
|
||||||
|
|
Loading…
Reference in New Issue