mirror of https://github.com/stella-emu/stella.git
Debugger UI settings moved form UI to Developer Settings dialog
This commit is contained in:
parent
fbedb3beda
commit
78f2211f1f
|
@ -29,6 +29,9 @@
|
||||||
#include "TabWidget.hxx"
|
#include "TabWidget.hxx"
|
||||||
#include "Widget.hxx"
|
#include "Widget.hxx"
|
||||||
#include "Font.hxx"
|
#include "Font.hxx"
|
||||||
|
#ifdef DEBUGGER_SUPPORT
|
||||||
|
#include "DebuggerDialog.hxx"
|
||||||
|
#endif
|
||||||
#include "Console.hxx"
|
#include "Console.hxx"
|
||||||
#include "TIA.hxx"
|
#include "TIA.hxx"
|
||||||
#include "OSystem.hxx"
|
#include "OSystem.hxx"
|
||||||
|
@ -44,33 +47,33 @@ DeveloperDialog::DeveloperDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
const int lineHeight = font.getLineHeight(),
|
const int lineHeight = font.getLineHeight(),
|
||||||
fontWidth = font.getMaxCharWidth(),
|
fontWidth = font.getMaxCharWidth(),
|
||||||
buttonHeight = font.getLineHeight() + 4;
|
buttonHeight = font.getLineHeight() + 4;
|
||||||
const int VBORDER = 4+2;
|
const int VBORDER = 4;
|
||||||
const int HBORDER = 8;
|
//const int HBORDER = 8;
|
||||||
int xpos, ypos, tabID;
|
int xpos, ypos, tabID;
|
||||||
StringList actions;
|
StringList actions;
|
||||||
|
|
||||||
// Set real dimensions
|
// Set real dimensions
|
||||||
_w = std::min(54 * fontWidth + 10, max_w);
|
_w = std::min(51 * fontWidth + 10, max_w);
|
||||||
_h = std::min(16 * (lineHeight + 4) + 14, max_h);
|
_h = std::min(14 * (lineHeight + 4) + 14, max_h);
|
||||||
|
|
||||||
WidgetArray wid;
|
WidgetArray wid;
|
||||||
|
|
||||||
ypos = VBORDER;
|
/*ypos = VBORDER;
|
||||||
myDevSettings = new CheckboxWidget(this, font, HBORDER, ypos, "Enable developer settings", kDevOptions);
|
myDevSettings = new CheckboxWidget(this, font, HBORDER, ypos, "Enable developer settings", kDevOptions);
|
||||||
wid.push_back(myDevSettings);
|
wid.push_back(myDevSettings);
|
||||||
addToFocusList(wid);
|
addToFocusList(wid);*/
|
||||||
|
|
||||||
// The tab widget
|
// The tab widget
|
||||||
ypos += lineHeight + 2;
|
//ypos += lineHeight + 2;
|
||||||
xpos = 2;
|
xpos = 2; ypos = VBORDER;
|
||||||
myTab = new TabWidget(this, font, xpos, ypos, _w - 2 * xpos, _h - buttonHeight - 16 - ypos);
|
myTab = new TabWidget(this, font, xpos, ypos, _w - 2 * xpos, _h - buttonHeight - 16 - ypos);
|
||||||
addTabWidget(myTab);
|
addTabWidget(myTab);
|
||||||
|
|
||||||
addEmulationTab(font);
|
addEmulationTab(font);
|
||||||
//addVideoTab(font);
|
//addVideoTab(font);
|
||||||
//addDebuggerTab(font);
|
|
||||||
//addUITab(font);
|
//addUITab(font);
|
||||||
addStatesTab(font);
|
addStatesTab(font);
|
||||||
|
addDebuggerTab(font);
|
||||||
addDefaultOKCancelButtons(font);
|
addDefaultOKCancelButtons(font);
|
||||||
|
|
||||||
// Activate the first tab
|
// Activate the first tab
|
||||||
|
@ -94,36 +97,36 @@ 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);
|
myDevSettings = new CheckboxWidget(myTab, font, HBORDER, ypos, "Enable developer settings", kDevOptions);
|
||||||
wid.push_back(myDevSettings);
|
wid.push_back(myDevSettings);
|
||||||
|
|
||||||
ypos += lineHeight + VGAP;*/
|
ypos += lineHeight + VGAP;
|
||||||
|
|
||||||
// Randomize items
|
// Randomize items
|
||||||
myLoadingROMLabel = new StaticTextWidget(myTab, font, HBORDER + INDENT*0, ypos, "When loading a ROM:", kTextAlignLeft);
|
myLoadingROMLabel = new StaticTextWidget(myTab, font, HBORDER + INDENT*1, ypos, "When loading a ROM:", kTextAlignLeft);
|
||||||
wid.push_back(myLoadingROMLabel);
|
wid.push_back(myLoadingROMLabel);
|
||||||
|
|
||||||
ypos += lineHeight + VGAP;
|
ypos += lineHeight + VGAP;
|
||||||
myRandomBank = new CheckboxWidget(myTab, font, HBORDER + INDENT * 1, ypos + 1, "Random startup bank (TODO)");
|
myRandomBank = new CheckboxWidget(myTab, font, HBORDER + INDENT * 2, ypos + 1, "Random startup bank (TODO)");
|
||||||
wid.push_back(myRandomBank);
|
wid.push_back(myRandomBank);
|
||||||
|
|
||||||
// Randomize RAM
|
// Randomize RAM
|
||||||
ypos += lineHeight + VGAP;
|
ypos += lineHeight + VGAP;
|
||||||
myRandomizeRAM = new CheckboxWidget(myTab, font, HBORDER + INDENT * 1, ypos + 1,
|
myRandomizeRAM = new CheckboxWidget(myTab, font, HBORDER + INDENT * 2, ypos + 1,
|
||||||
"Randomize zero-page and extended RAM", kRandRAMID);
|
"Randomize zero-page and extended RAM", kRandRAMID);
|
||||||
wid.push_back(myRandomizeRAM);
|
wid.push_back(myRandomizeRAM);
|
||||||
|
|
||||||
// Randomize CPU
|
// Randomize CPU
|
||||||
ypos += lineHeight + VGAP;
|
ypos += lineHeight + VGAP;
|
||||||
int lwidth = font.getStringWidth("Randomize CPU ");
|
int lwidth = font.getStringWidth("Randomize CPU ");
|
||||||
myRandomizeCPULabel = new StaticTextWidget(myTab, font, HBORDER + INDENT * 1, ypos + 1, "Randomize CPU ");
|
myRandomizeCPULabel = new StaticTextWidget(myTab, font, HBORDER + INDENT * 2, ypos + 1, "Randomize CPU ");
|
||||||
wid.push_back(myRandomizeCPULabel);
|
wid.push_back(myRandomizeCPULabel);
|
||||||
|
|
||||||
int xpos = myRandomizeCPULabel->getRight() + 10;
|
int xpos = myRandomizeCPULabel->getRight() + 10;
|
||||||
const char* const cpuregs[] = { "SP", "A", "X", "Y", "PS" };
|
const char* const cpuregs[] = { "SP", "A", "X", "Y", "PS" };
|
||||||
for(int i = 0; i < 5; ++i)
|
for(int i = 0; i < 5; ++i)
|
||||||
{
|
{
|
||||||
myRandomizeCPU[i] = new CheckboxWidget(myTab, font, xpos, ypos + 1,
|
myRandomizeCPU[i] = new CheckboxWidget(myTab, font, xpos, ypos + 2,
|
||||||
cpuregs[i], kRandCPUID);
|
cpuregs[i], kRandCPUID);
|
||||||
//myRandomizeCPU[i]->setID(kRandCPUID);
|
//myRandomizeCPU[i]->setID(kRandCPUID);
|
||||||
//myRandomizeCPU[i]->setTarget(this);
|
//myRandomizeCPU[i]->setTarget(this);
|
||||||
|
@ -137,12 +140,12 @@ void DeveloperDialog::addEmulationTab(const GUI::Font& font)
|
||||||
wid.push_back(myThumbException);*/
|
wid.push_back(myThumbException);*/
|
||||||
|
|
||||||
//ypos += (lineHeight + VGAP) * 2;
|
//ypos += (lineHeight + VGAP) * 2;
|
||||||
myColorLoss = new CheckboxWidget(myTab, font, HBORDER + INDENT*0, ypos + 1, "PAL color-loss");
|
myColorLoss = new CheckboxWidget(myTab, font, HBORDER + INDENT*1, ypos + 1, "PAL color-loss");
|
||||||
wid.push_back(myColorLoss);
|
wid.push_back(myColorLoss);
|
||||||
|
|
||||||
// TV jitter effect
|
// TV jitter effect
|
||||||
ypos += lineHeight + VGAP;
|
ypos += lineHeight + VGAP;
|
||||||
myTVJitter = new CheckboxWidget(myTab, font, HBORDER + INDENT*0, ypos + 1, "Jitter/Roll Effect", kTVJitter);
|
myTVJitter = new CheckboxWidget(myTab, font, HBORDER + INDENT*1, ypos + 1, "Jitter/Roll Effect", kTVJitter);
|
||||||
wid.push_back(myTVJitter);
|
wid.push_back(myTVJitter);
|
||||||
myTVJitterRec = new SliderWidget(myTab, font,
|
myTVJitterRec = new SliderWidget(myTab, font,
|
||||||
myTVJitter->getRight()+ 16, ypos - 1,
|
myTVJitter->getRight()+ 16, ypos - 1,
|
||||||
|
@ -159,12 +162,12 @@ void DeveloperDialog::addEmulationTab(const GUI::Font& font)
|
||||||
|
|
||||||
// debug colors
|
// debug colors
|
||||||
ypos += lineHeight + VGAP;
|
ypos += lineHeight + VGAP;
|
||||||
myDebugColors = new CheckboxWidget(myTab, font, HBORDER + INDENT*0, ypos + 1, "Debug Colors");
|
myDebugColors = new CheckboxWidget(myTab, font, HBORDER + INDENT*1, ypos + 1, "Debug Colors");
|
||||||
wid.push_back(myDebugColors);
|
wid.push_back(myDebugColors);
|
||||||
|
|
||||||
// How to handle undriven TIA pins
|
// How to handle undriven TIA pins
|
||||||
ypos += lineHeight + VGAP;
|
ypos += lineHeight + VGAP;
|
||||||
myUndrivenPins = new CheckboxWidget(myTab, font, HBORDER + INDENT*0, ypos + 1,
|
myUndrivenPins = new CheckboxWidget(myTab, font, HBORDER + INDENT*1, ypos + 1,
|
||||||
"Drive unused TIA pins randomly on a read/peek");
|
"Drive unused TIA pins randomly on a read/peek");
|
||||||
wid.push_back(myUndrivenPins);
|
wid.push_back(myUndrivenPins);
|
||||||
|
|
||||||
|
@ -183,19 +186,123 @@ void DeveloperDialog::addVideoTab(const GUI::Font& font)
|
||||||
ypos += lineHeight + 4;
|
ypos += lineHeight + 4;
|
||||||
|
|
||||||
addToFocusList(wid, myTab, tabID);
|
addToFocusList(wid, myTab, tabID);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void DeveloperDialog::addDebuggerTab(const GUI::Font& font)
|
void DeveloperDialog::addDebuggerTab(const GUI::Font& font)
|
||||||
{
|
{
|
||||||
int tabID = myTab->addTab(" Debugger ");
|
int tabID = myTab->addTab(" Debugger UI ");
|
||||||
|
|
||||||
|
#ifdef DEBUGGER_SUPPORT
|
||||||
WidgetArray wid;
|
WidgetArray wid;
|
||||||
|
VariantList items;
|
||||||
|
int fontWidth = font.getMaxCharWidth(),
|
||||||
|
fontHeight = font.getFontHeight(),
|
||||||
|
buttonHeight = font.getLineHeight() + 4,
|
||||||
|
lineHeight = font.getLineHeight();
|
||||||
|
const int VGAP = 4;
|
||||||
|
const int VBORDER = 8;
|
||||||
|
const int HBORDER = 10;
|
||||||
|
int xpos, ypos;
|
||||||
|
int lwidth, pwidth = font.getStringWidth("Standard");
|
||||||
|
ButtonWidget* b;
|
||||||
|
const GUI::Size& ds = instance().frameBuffer().desktopSize();
|
||||||
|
|
||||||
|
lwidth = font.getStringWidth("Debugger Height ");
|
||||||
|
xpos = HBORDER;
|
||||||
|
ypos = VBORDER;
|
||||||
|
|
||||||
|
// Debugger width and height
|
||||||
|
myDebuggerWidthSlider = new SliderWidget(myTab, font, xpos, ypos, pwidth,
|
||||||
|
lineHeight, "Debugger Width ",
|
||||||
|
lwidth, kDWidthChanged);
|
||||||
|
myDebuggerWidthSlider->setMinValue(DebuggerDialog::kSmallFontMinW);
|
||||||
|
myDebuggerWidthSlider->setMaxValue(ds.w);
|
||||||
|
myDebuggerWidthSlider->setStepValue(10);
|
||||||
|
wid.push_back(myDebuggerWidthSlider);
|
||||||
|
myDebuggerWidthLabel =
|
||||||
|
new StaticTextWidget(myTab, font,
|
||||||
|
xpos + myDebuggerWidthSlider->getWidth() + 4,
|
||||||
|
ypos + 1, 4 * fontWidth, fontHeight, "", kTextAlignLeft);
|
||||||
|
myDebuggerWidthLabel->setFlags(WIDGET_CLEARBG);
|
||||||
|
ypos += lineHeight + VGAP;
|
||||||
|
|
||||||
|
myDebuggerHeightSlider = new SliderWidget(myTab, font, xpos, ypos, pwidth,
|
||||||
|
lineHeight, "Debugger Height ",
|
||||||
|
lwidth, kDHeightChanged);
|
||||||
|
myDebuggerHeightSlider->setMinValue(DebuggerDialog::kSmallFontMinH);
|
||||||
|
myDebuggerHeightSlider->setMaxValue(ds.h);
|
||||||
|
myDebuggerHeightSlider->setStepValue(10);
|
||||||
|
wid.push_back(myDebuggerHeightSlider);
|
||||||
|
myDebuggerHeightLabel =
|
||||||
|
new StaticTextWidget(myTab, font,
|
||||||
|
xpos + myDebuggerHeightSlider->getWidth() + 4,
|
||||||
|
ypos + 1, 4 * fontWidth, fontHeight, "", kTextAlignLeft);
|
||||||
|
myDebuggerHeightLabel->setFlags(WIDGET_CLEARBG);
|
||||||
|
|
||||||
|
// Add minimum window size buttons for different fonts
|
||||||
|
ypos += lineHeight + VGAP * 2;
|
||||||
|
StaticTextWidget* t = new StaticTextWidget(myTab, font, HBORDER, ypos + 3, "Reset debugger size for");
|
||||||
|
|
||||||
|
int fbwidth = font.getStringWidth("Medium font") + 20;
|
||||||
|
//xpos = (_w - fbwidth - 2 * VBORDER) / 2; ypos += 2 * lineHeight + 4;
|
||||||
|
xpos = t->getRight() + 8;
|
||||||
|
b = new ButtonWidget(myTab, font, xpos, ypos, fbwidth, buttonHeight,
|
||||||
|
"Small font", kDSmallSize);
|
||||||
|
wid.push_back(b);
|
||||||
|
ypos += b->getHeight() + VGAP;
|
||||||
|
b = new ButtonWidget(myTab, font, xpos, ypos, fbwidth, buttonHeight,
|
||||||
|
"Medium font", kDMediumSize);
|
||||||
|
wid.push_back(b);
|
||||||
|
ypos += b->getHeight() + VGAP;
|
||||||
|
b = new ButtonWidget(myTab, font, xpos, ypos, fbwidth, buttonHeight,
|
||||||
|
"Large font", kDLargeSize);
|
||||||
|
wid.push_back(b);
|
||||||
|
ypos += b->getHeight() + VGAP * 4;
|
||||||
|
|
||||||
|
// Font style (bold label vs. text, etc)
|
||||||
|
lwidth = font.getStringWidth("Font Style ");
|
||||||
|
pwidth = font.getStringWidth("Bold non-labels only");
|
||||||
|
xpos = VBORDER;
|
||||||
|
items.clear();
|
||||||
|
VarList::push_back(items, "All Normal font", "0");
|
||||||
|
VarList::push_back(items, "Bold labels only", "1");
|
||||||
|
VarList::push_back(items, "Bold non-labels only", "2");
|
||||||
|
VarList::push_back(items, "All Bold font", "3");
|
||||||
|
myDebuggerFontStyle =
|
||||||
|
new PopUpWidget(myTab, font, HBORDER, ypos + 1, pwidth, lineHeight, items,
|
||||||
|
"Font Style ", lwidth);
|
||||||
|
wid.push_back(myDebuggerFontStyle);
|
||||||
|
|
||||||
|
// Debugger is only realistically available in windowed modes 800x600 or greater
|
||||||
|
// (and when it's actually been compiled into the app)
|
||||||
|
bool debuggerAvailable =
|
||||||
|
#if defined(DEBUGGER_SUPPORT) && defined(WINDOWED_SUPPORT)
|
||||||
|
(ds.w >= 800 && ds.h >= 600); // TODO - maybe this logic can disappear?
|
||||||
|
#else
|
||||||
|
false;
|
||||||
|
#endif
|
||||||
|
if(!debuggerAvailable)
|
||||||
|
{
|
||||||
|
myDebuggerWidthSlider->clearFlags(WIDGET_ENABLED);
|
||||||
|
myDebuggerWidthLabel->clearFlags(WIDGET_ENABLED);
|
||||||
|
myDebuggerHeightSlider->clearFlags(WIDGET_ENABLED);
|
||||||
|
myDebuggerHeightLabel->clearFlags(WIDGET_ENABLED);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add items for tab 1
|
||||||
|
addToFocusList(wid, myTab, tabID);
|
||||||
|
#else
|
||||||
|
new StaticTextWidget(myTab, font, 0, 20, _w - 20, fontHeight,
|
||||||
|
"Debugger support not included", kTextAlignCenter);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
addToFocusList(wid, myTab, tabID);
|
addToFocusList(wid, myTab, tabID);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
/*// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void DeveloperDialog::addUITab(const GUI::Font& font)
|
void DeveloperDialog::addUITab(const GUI::Font& font)
|
||||||
{
|
{
|
||||||
int tabID = myTab->addTab("UI");
|
int tabID = myTab->addTab("UI");
|
||||||
|
@ -258,6 +365,27 @@ void DeveloperDialog::loadConfig()
|
||||||
|
|
||||||
enableOptions();
|
enableOptions();
|
||||||
|
|
||||||
|
#ifdef DEBUGGER_SUPPORT
|
||||||
|
uInt32 w, h;
|
||||||
|
|
||||||
|
// Debugger size
|
||||||
|
const GUI::Size& ds = instance().settings().getSize("dbg.res");
|
||||||
|
w = ds.w; h = ds.h;
|
||||||
|
w = std::max(w, uInt32(DebuggerDialog::kSmallFontMinW));
|
||||||
|
h = std::max(h, uInt32(DebuggerDialog::kSmallFontMinH));
|
||||||
|
w = std::min(w, ds.w);
|
||||||
|
h = std::min(h, ds.h);
|
||||||
|
|
||||||
|
myDebuggerWidthSlider->setValue(w);
|
||||||
|
myDebuggerWidthLabel->setValue(w);
|
||||||
|
myDebuggerHeightSlider->setValue(h);
|
||||||
|
myDebuggerHeightLabel->setValue(h);
|
||||||
|
|
||||||
|
// Debugger font style
|
||||||
|
int style = instance().settings().getInt("dbg.fontstyle");
|
||||||
|
myDebuggerFontStyle->setSelected(style, "0");
|
||||||
|
#endif
|
||||||
|
|
||||||
myTab->loadConfig();
|
myTab->loadConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -317,31 +445,67 @@ void DeveloperDialog::saveConfig()
|
||||||
|
|
||||||
// Finally, issue a complete framebuffer re-initialization
|
// Finally, issue a complete framebuffer re-initialization
|
||||||
instance().createFrameBuffer();
|
instance().createFrameBuffer();
|
||||||
|
|
||||||
|
#ifdef DEBUGGER_SUPPORT
|
||||||
|
// Debugger size
|
||||||
|
instance().settings().setValue("dbg.res",
|
||||||
|
GUI::Size(myDebuggerWidthSlider->getValue(),
|
||||||
|
myDebuggerHeightSlider->getValue()));
|
||||||
|
|
||||||
|
// Debugger font style
|
||||||
|
instance().settings().setValue("dbg.fontstyle",
|
||||||
|
myDebuggerFontStyle->getSelectedTag().toString());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeveloperDialog::setDefaults()
|
void DeveloperDialog::setDefaults()
|
||||||
{
|
{
|
||||||
myDevSettings->setState(false);
|
myDevSettings->setState(false);
|
||||||
|
|
||||||
myRandomBank->setState(true);
|
switch(myTab->getActiveTab())
|
||||||
myRandomizeRAM->setState(true);
|
{
|
||||||
for(int i = 0; i < 5; ++i)
|
case 0:
|
||||||
myRandomizeCPU[i]->setState(true);
|
myRandomBank->setState(true);
|
||||||
//myThumbException->setState(false);
|
myRandomizeRAM->setState(true);
|
||||||
|
for(int i = 0; i < 5; ++i)
|
||||||
|
myRandomizeCPU[i]->setState(true);
|
||||||
|
//myThumbException->setState(false);
|
||||||
|
|
||||||
// PAL color-loss effect
|
// PAL color-loss effect
|
||||||
myColorLoss->setState(true);
|
myColorLoss->setState(true);
|
||||||
// jitter
|
// jitter
|
||||||
myTVJitter->setState(true);
|
myTVJitter->setState(true);
|
||||||
myTVJitterRec->setValue(1);
|
myTVJitterRec->setValue(1);
|
||||||
// debug colors
|
// debug colors
|
||||||
myDebugColors->setState(false);
|
myDebugColors->setState(false);
|
||||||
// Undriven TIA pins
|
// Undriven TIA pins
|
||||||
myUndrivenPins->setState(true);
|
myUndrivenPins->setState(true);
|
||||||
|
|
||||||
enableOptions();
|
enableOptions();
|
||||||
handleTVJitterChange(false);
|
handleTVJitterChange(false);
|
||||||
handleDebugColors();
|
handleDebugColors();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1: // States
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2: // Debugger options
|
||||||
|
{
|
||||||
|
#ifdef DEBUGGER_SUPPORT
|
||||||
|
uInt32 w = std::min(instance().frameBuffer().desktopSize().w, uInt32(DebuggerDialog::kMediumFontMinW));
|
||||||
|
uInt32 h = std::min(instance().frameBuffer().desktopSize().h, uInt32(DebuggerDialog::kMediumFontMinH));
|
||||||
|
myDebuggerWidthSlider->setValue(w);
|
||||||
|
myDebuggerWidthLabel->setValue(w);
|
||||||
|
myDebuggerHeightSlider->setValue(h);
|
||||||
|
myDebuggerHeightLabel->setValue(h);
|
||||||
|
myDebuggerFontStyle->setSelected("0");
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -365,6 +529,37 @@ void DeveloperDialog::handleCommand(CommandSender* sender, int cmd, int data, in
|
||||||
instance().console().tia().driveUnusedPinsRandom(myUndrivenPins->getState());
|
instance().console().tia().driveUnusedPinsRandom(myUndrivenPins->getState());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef DEBUGGER_SUPPORT
|
||||||
|
case kDWidthChanged:
|
||||||
|
myDebuggerWidthLabel->setValue(myDebuggerWidthSlider->getValue());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case kDHeightChanged:
|
||||||
|
myDebuggerHeightLabel->setValue(myDebuggerHeightSlider->getValue());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case kDSmallSize:
|
||||||
|
myDebuggerWidthSlider->setValue(DebuggerDialog::kSmallFontMinW);
|
||||||
|
myDebuggerWidthLabel->setValue(DebuggerDialog::kSmallFontMinW);
|
||||||
|
myDebuggerHeightSlider->setValue(DebuggerDialog::kSmallFontMinH);
|
||||||
|
myDebuggerHeightLabel->setValue(DebuggerDialog::kSmallFontMinH);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case kDMediumSize:
|
||||||
|
myDebuggerWidthSlider->setValue(DebuggerDialog::kMediumFontMinW);
|
||||||
|
myDebuggerWidthLabel->setValue(DebuggerDialog::kMediumFontMinW);
|
||||||
|
myDebuggerHeightSlider->setValue(DebuggerDialog::kMediumFontMinH);
|
||||||
|
myDebuggerHeightLabel->setValue(DebuggerDialog::kMediumFontMinH);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case kDLargeSize:
|
||||||
|
myDebuggerWidthSlider->setValue(DebuggerDialog::kLargeFontMinW);
|
||||||
|
myDebuggerWidthLabel->setValue(DebuggerDialog::kLargeFontMinW);
|
||||||
|
myDebuggerHeightSlider->setValue(DebuggerDialog::kLargeFontMinH);
|
||||||
|
myDebuggerHeightLabel->setValue(DebuggerDialog::kLargeFontMinH);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
case GuiObject::kOKCmd:
|
case GuiObject::kOKCmd:
|
||||||
saveConfig();
|
saveConfig();
|
||||||
close();
|
close();
|
||||||
|
|
|
@ -39,7 +39,7 @@ class DeveloperDialog : public Dialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DeveloperDialog(OSystem& osystem, DialogContainer& parent,
|
DeveloperDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font, int max_w, int max_h);
|
const GUI::Font& font, int max_w, int max_h);
|
||||||
virtual ~DeveloperDialog() = default;
|
virtual ~DeveloperDialog() = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -63,7 +63,12 @@ class DeveloperDialog : public Dialog
|
||||||
kRandCPUID = 'DVcp',
|
kRandCPUID = 'DVcp',
|
||||||
kTVJitter = 'DVjt',
|
kTVJitter = 'DVjt',
|
||||||
kTVJitterChanged = 'DVjr',
|
kTVJitterChanged = 'DVjr',
|
||||||
kPPinCmd = 'DVpn'
|
kPPinCmd = 'DVpn',
|
||||||
|
kDWidthChanged = 'UIdw',
|
||||||
|
kDHeightChanged = 'UIdh',
|
||||||
|
kDSmallSize = 'UIds',
|
||||||
|
kDMediumSize = 'UIdm',
|
||||||
|
kDLargeSize = 'UIdl'
|
||||||
};
|
};
|
||||||
|
|
||||||
TabWidget* myTab;
|
TabWidget* myTab;
|
||||||
|
@ -84,13 +89,22 @@ class DeveloperDialog : public Dialog
|
||||||
CheckboxWidget* myDebugColors;
|
CheckboxWidget* myDebugColors;
|
||||||
CheckboxWidget* myUndrivenPins;
|
CheckboxWidget* myUndrivenPins;
|
||||||
|
|
||||||
|
#ifdef DEBUGGER_SUPPORT
|
||||||
|
// Debugger options
|
||||||
|
SliderWidget* myDebuggerWidthSlider;
|
||||||
|
StaticTextWidget* myDebuggerWidthLabel;
|
||||||
|
SliderWidget* myDebuggerHeightSlider;
|
||||||
|
StaticTextWidget* myDebuggerHeightLabel;
|
||||||
|
PopUpWidget* myDebuggerFontStyle;
|
||||||
|
#endif
|
||||||
|
|
||||||
// Maximum width and height for this dialog
|
// Maximum width and height for this dialog
|
||||||
int myMaxWidth, myMaxHeight;
|
int myMaxWidth, myMaxHeight;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void addEmulationTab(const GUI::Font& font);
|
void addEmulationTab(const GUI::Font& font);
|
||||||
//void addVideoTab(const GUI::Font& font);
|
//void addVideoTab(const GUI::Font& font);
|
||||||
//void addDebuggerTab(const GUI::Font& font);
|
void addDebuggerTab(const GUI::Font& font);
|
||||||
//void addUITab(const GUI::Font& font);
|
//void addUITab(const GUI::Font& font);
|
||||||
void addStatesTab(const GUI::Font& font);
|
void addStatesTab(const GUI::Font& font);
|
||||||
// Add Defaults, OK and Cancel buttons
|
// Add Defaults, OK and Cancel buttons
|
||||||
|
|
|
@ -27,9 +27,6 @@
|
||||||
#include "Settings.hxx"
|
#include "Settings.hxx"
|
||||||
#include "TabWidget.hxx"
|
#include "TabWidget.hxx"
|
||||||
#include "Widget.hxx"
|
#include "Widget.hxx"
|
||||||
#ifdef DEBUGGER_SUPPORT
|
|
||||||
#include "DebuggerDialog.hxx"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "UIDialog.hxx"
|
#include "UIDialog.hxx"
|
||||||
|
|
||||||
|
@ -139,95 +136,6 @@ UIDialog::UIDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
// Add items for tab 0
|
// Add items for tab 0
|
||||||
addToFocusList(wid, myTab, tabID);
|
addToFocusList(wid, myTab, tabID);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////
|
|
||||||
// 2) Debugger options
|
|
||||||
wid.clear();
|
|
||||||
tabID = myTab->addTab(" Debugger ");
|
|
||||||
#ifdef DEBUGGER_SUPPORT
|
|
||||||
lwidth = font.getStringWidth("Debugger Height ");
|
|
||||||
xpos = ypos = vBorder;
|
|
||||||
|
|
||||||
// Debugger width and height
|
|
||||||
myDebuggerWidthSlider = new SliderWidget(myTab, font, xpos, ypos, pwidth,
|
|
||||||
lineHeight, "Debugger Width ",
|
|
||||||
lwidth, kDWidthChanged);
|
|
||||||
myDebuggerWidthSlider->setMinValue(DebuggerDialog::kSmallFontMinW);
|
|
||||||
myDebuggerWidthSlider->setMaxValue(ds.w);
|
|
||||||
myDebuggerWidthSlider->setStepValue(10);
|
|
||||||
wid.push_back(myDebuggerWidthSlider);
|
|
||||||
myDebuggerWidthLabel =
|
|
||||||
new StaticTextWidget(myTab, font,
|
|
||||||
xpos + myDebuggerWidthSlider->getWidth() + 4,
|
|
||||||
ypos + 1, 4*fontWidth, fontHeight, "", kTextAlignLeft);
|
|
||||||
myDebuggerWidthLabel->setFlags(WIDGET_CLEARBG);
|
|
||||||
ypos += lineHeight + 4;
|
|
||||||
|
|
||||||
myDebuggerHeightSlider = new SliderWidget(myTab, font, xpos, ypos, pwidth,
|
|
||||||
lineHeight, "Debugger Height ",
|
|
||||||
lwidth, kDHeightChanged);
|
|
||||||
myDebuggerHeightSlider->setMinValue(DebuggerDialog::kSmallFontMinH);
|
|
||||||
myDebuggerHeightSlider->setMaxValue(ds.h);
|
|
||||||
myDebuggerHeightSlider->setStepValue(10);
|
|
||||||
wid.push_back(myDebuggerHeightSlider);
|
|
||||||
myDebuggerHeightLabel =
|
|
||||||
new StaticTextWidget(myTab, font,
|
|
||||||
xpos + myDebuggerHeightSlider->getWidth() + 4,
|
|
||||||
ypos + 1, 4*fontWidth, fontHeight, "", kTextAlignLeft);
|
|
||||||
myDebuggerHeightLabel->setFlags(WIDGET_CLEARBG);
|
|
||||||
|
|
||||||
// Add minimum window size buttons for different fonts
|
|
||||||
int fbwidth = font.getStringWidth("Set window size for medium font") + 20;
|
|
||||||
xpos = (_w - fbwidth - 2*vBorder)/2; ypos += 2*lineHeight + 4;
|
|
||||||
b = new ButtonWidget(myTab, font, xpos, ypos, fbwidth, buttonHeight,
|
|
||||||
"Set window size for small font", kDSmallSize);
|
|
||||||
wid.push_back(b);
|
|
||||||
ypos += b->getHeight() + 4;
|
|
||||||
b = new ButtonWidget(myTab, font, xpos, ypos, fbwidth, buttonHeight,
|
|
||||||
"Set window size for medium font", kDMediumSize);
|
|
||||||
wid.push_back(b);
|
|
||||||
ypos += b->getHeight() + 4;
|
|
||||||
b = new ButtonWidget(myTab, font, xpos, ypos, fbwidth, buttonHeight,
|
|
||||||
"Set window size for large font", kDLargeSize);
|
|
||||||
wid.push_back(b);
|
|
||||||
ypos += b->getHeight() + 12;
|
|
||||||
|
|
||||||
// Font style (bold label vs. text, etc)
|
|
||||||
lwidth = font.getStringWidth("Font Style ");
|
|
||||||
pwidth = font.getStringWidth("Bold non-labels only");
|
|
||||||
xpos = vBorder;
|
|
||||||
items.clear();
|
|
||||||
VarList::push_back(items, "All Normal font", "0");
|
|
||||||
VarList::push_back(items, "Bold labels only", "1");
|
|
||||||
VarList::push_back(items, "Bold non-labels only", "2");
|
|
||||||
VarList::push_back(items, "All Bold font", "3");
|
|
||||||
myDebuggerFontStyle =
|
|
||||||
new PopUpWidget(myTab, font, xpos, ypos+1, pwidth, lineHeight, items,
|
|
||||||
"Font Style ", lwidth);
|
|
||||||
wid.push_back(myDebuggerFontStyle);
|
|
||||||
|
|
||||||
// Debugger is only realistically available in windowed modes 800x600 or greater
|
|
||||||
// (and when it's actually been compiled into the app)
|
|
||||||
bool debuggerAvailable =
|
|
||||||
#if defined(DEBUGGER_SUPPORT) && defined(WINDOWED_SUPPORT)
|
|
||||||
(ds.w >= 800 && ds.h >= 600); // TODO - maybe this logic can disappear?
|
|
||||||
#else
|
|
||||||
false;
|
|
||||||
#endif
|
|
||||||
if(!debuggerAvailable)
|
|
||||||
{
|
|
||||||
myDebuggerWidthSlider->clearFlags(WIDGET_ENABLED);
|
|
||||||
myDebuggerWidthLabel->clearFlags(WIDGET_ENABLED);
|
|
||||||
myDebuggerHeightSlider->clearFlags(WIDGET_ENABLED);
|
|
||||||
myDebuggerHeightLabel->clearFlags(WIDGET_ENABLED);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add items for tab 1
|
|
||||||
addToFocusList(wid, myTab, tabID);
|
|
||||||
#else
|
|
||||||
new StaticTextWidget(myTab, font, 0, 20, _w-20, fontHeight,
|
|
||||||
"Debugger support not included", kTextAlignCenter);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////
|
||||||
// 3) Misc. options
|
// 3) Misc. options
|
||||||
wid.clear();
|
wid.clear();
|
||||||
|
@ -330,25 +238,6 @@ void UIDialog::loadConfig()
|
||||||
bool exitlauncher = instance().settings().getBool("exitlauncher");
|
bool exitlauncher = instance().settings().getBool("exitlauncher");
|
||||||
myLauncherExitPopup->setSelected(exitlauncher ? "1" : "0", "0");
|
myLauncherExitPopup->setSelected(exitlauncher ? "1" : "0", "0");
|
||||||
|
|
||||||
#ifdef DEBUGGER_SUPPORT
|
|
||||||
// Debugger size
|
|
||||||
const GUI::Size& ds = instance().settings().getSize("dbg.res");
|
|
||||||
w = ds.w; h = ds.h;
|
|
||||||
w = std::max(w, uInt32(DebuggerDialog::kSmallFontMinW));
|
|
||||||
h = std::max(h, uInt32(DebuggerDialog::kSmallFontMinH));
|
|
||||||
w = std::min(w, ds.w);
|
|
||||||
h = std::min(h, ds.h);
|
|
||||||
|
|
||||||
myDebuggerWidthSlider->setValue(w);
|
|
||||||
myDebuggerWidthLabel->setValue(w);
|
|
||||||
myDebuggerHeightSlider->setValue(h);
|
|
||||||
myDebuggerHeightLabel->setValue(h);
|
|
||||||
|
|
||||||
// Debugger font style
|
|
||||||
int style = instance().settings().getInt("dbg.fontstyle");
|
|
||||||
myDebuggerFontStyle->setSelected(style, "0");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// UI palette
|
// UI palette
|
||||||
const string& pal = instance().settings().getString("uipalette");
|
const string& pal = instance().settings().getString("uipalette");
|
||||||
myPalettePopup->setSelected(pal, "standard");
|
myPalettePopup->setSelected(pal, "standard");
|
||||||
|
@ -384,17 +273,6 @@ void UIDialog::saveConfig()
|
||||||
instance().settings().setValue("exitlauncher",
|
instance().settings().setValue("exitlauncher",
|
||||||
myLauncherExitPopup->getSelectedTag().toString());
|
myLauncherExitPopup->getSelectedTag().toString());
|
||||||
|
|
||||||
#ifdef DEBUGGER_SUPPORT
|
|
||||||
// Debugger size
|
|
||||||
instance().settings().setValue("dbg.res",
|
|
||||||
GUI::Size(myDebuggerWidthSlider->getValue(),
|
|
||||||
myDebuggerHeightSlider->getValue()));
|
|
||||||
|
|
||||||
// Debugger font style
|
|
||||||
instance().settings().setValue("dbg.fontstyle",
|
|
||||||
myDebuggerFontStyle->getSelectedTag().toString());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// UI palette
|
// UI palette
|
||||||
instance().settings().setValue("uipalette",
|
instance().settings().setValue("uipalette",
|
||||||
myPalettePopup->getSelectedTag().toString());
|
myPalettePopup->getSelectedTag().toString());
|
||||||
|
@ -429,21 +307,7 @@ void UIDialog::setDefaults()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 1: // Debugger options
|
case 1: // Misc. options
|
||||||
{
|
|
||||||
#ifdef DEBUGGER_SUPPORT
|
|
||||||
uInt32 w = std::min(instance().frameBuffer().desktopSize().w, uInt32(DebuggerDialog::kMediumFontMinW));
|
|
||||||
uInt32 h = std::min(instance().frameBuffer().desktopSize().h, uInt32(DebuggerDialog::kMediumFontMinH));
|
|
||||||
myDebuggerWidthSlider->setValue(w);
|
|
||||||
myDebuggerWidthLabel->setValue(w);
|
|
||||||
myDebuggerHeightSlider->setValue(h);
|
|
||||||
myDebuggerHeightLabel->setValue(h);
|
|
||||||
myDebuggerFontStyle->setSelected("0");
|
|
||||||
#endif
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case 2: // Misc. options
|
|
||||||
myPalettePopup->setSelected("standard");
|
myPalettePopup->setSelected("standard");
|
||||||
myListDelayPopup->setSelected("300");
|
myListDelayPopup->setSelected("300");
|
||||||
myWheelLinesPopup->setSelected("4");
|
myWheelLinesPopup->setSelected("4");
|
||||||
|
@ -469,37 +333,6 @@ void UIDialog::handleCommand(CommandSender* sender, int cmd, int data, int id)
|
||||||
myLauncherHeightLabel->setValue(myLauncherHeightSlider->getValue());
|
myLauncherHeightLabel->setValue(myLauncherHeightSlider->getValue());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef DEBUGGER_SUPPORT
|
|
||||||
case kDWidthChanged:
|
|
||||||
myDebuggerWidthLabel->setValue(myDebuggerWidthSlider->getValue());
|
|
||||||
break;
|
|
||||||
|
|
||||||
case kDHeightChanged:
|
|
||||||
myDebuggerHeightLabel->setValue(myDebuggerHeightSlider->getValue());
|
|
||||||
break;
|
|
||||||
|
|
||||||
case kDSmallSize:
|
|
||||||
myDebuggerWidthSlider->setValue(DebuggerDialog::kSmallFontMinW);
|
|
||||||
myDebuggerWidthLabel->setValue(DebuggerDialog::kSmallFontMinW);
|
|
||||||
myDebuggerHeightSlider->setValue(DebuggerDialog::kSmallFontMinH);
|
|
||||||
myDebuggerHeightLabel->setValue(DebuggerDialog::kSmallFontMinH);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case kDMediumSize:
|
|
||||||
myDebuggerWidthSlider->setValue(DebuggerDialog::kMediumFontMinW);
|
|
||||||
myDebuggerWidthLabel->setValue(DebuggerDialog::kMediumFontMinW);
|
|
||||||
myDebuggerHeightSlider->setValue(DebuggerDialog::kMediumFontMinH);
|
|
||||||
myDebuggerHeightLabel->setValue(DebuggerDialog::kMediumFontMinH);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case kDLargeSize:
|
|
||||||
myDebuggerWidthSlider->setValue(DebuggerDialog::kLargeFontMinW);
|
|
||||||
myDebuggerWidthLabel->setValue(DebuggerDialog::kLargeFontMinW);
|
|
||||||
myDebuggerHeightSlider->setValue(DebuggerDialog::kLargeFontMinH);
|
|
||||||
myDebuggerHeightLabel->setValue(DebuggerDialog::kLargeFontMinH);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case GuiObject::kOKCmd:
|
case GuiObject::kOKCmd:
|
||||||
saveConfig();
|
saveConfig();
|
||||||
close();
|
close();
|
||||||
|
|
|
@ -55,15 +55,6 @@ class UIDialog : public Dialog
|
||||||
PopUpWidget* myLauncherFontPopup;
|
PopUpWidget* myLauncherFontPopup;
|
||||||
PopUpWidget* myRomViewerPopup;
|
PopUpWidget* myRomViewerPopup;
|
||||||
|
|
||||||
#ifdef DEBUGGER_SUPPORT
|
|
||||||
// Debugger options
|
|
||||||
SliderWidget* myDebuggerWidthSlider;
|
|
||||||
StaticTextWidget* myDebuggerWidthLabel;
|
|
||||||
SliderWidget* myDebuggerHeightSlider;
|
|
||||||
StaticTextWidget* myDebuggerHeightLabel;
|
|
||||||
PopUpWidget* myDebuggerFontStyle;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Misc options
|
// Misc options
|
||||||
PopUpWidget* myPalettePopup;
|
PopUpWidget* myPalettePopup;
|
||||||
PopUpWidget* myListDelayPopup;
|
PopUpWidget* myListDelayPopup;
|
||||||
|
@ -72,12 +63,6 @@ class UIDialog : public Dialog
|
||||||
enum {
|
enum {
|
||||||
kLWidthChanged = 'UIlw',
|
kLWidthChanged = 'UIlw',
|
||||||
kLHeightChanged = 'UIlh',
|
kLHeightChanged = 'UIlh',
|
||||||
kDWidthChanged = 'UIdw',
|
|
||||||
kDHeightChanged = 'UIdh',
|
|
||||||
|
|
||||||
kDSmallSize = 'UIds',
|
|
||||||
kDMediumSize = 'UIdm',
|
|
||||||
kDLargeSize = 'UIdl'
|
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in New Issue