diff --git a/Changes.txt b/Changes.txt
index 9f737ce0b..c706bbdc1 100644
--- a/Changes.txt
+++ b/Changes.txt
@@ -84,7 +84,7 @@
commandline arguments, and removed 'holdbutton0' argument.
- The ability to load the ROM directly from this dialog, after
- changing any settings.
+ changing any settings, and also to start in the debugger.
- Added more detailed information as to how to use this
functionality to the UI.
diff --git a/docs/graphics/launcher_override.png b/docs/graphics/launcher_override.png
index cf9d0b7fc..7a859508a 100644
Binary files a/docs/graphics/launcher_override.png and b/docs/graphics/launcher_override.png differ
diff --git a/docs/graphics/options_debugger.png b/docs/graphics/options_debugger.png
index 27f346276..d79ef10d0 100644
Binary files a/docs/graphics/options_debugger.png and b/docs/graphics/options_debugger.png differ
diff --git a/docs/index.html b/docs/index.html
index 2af0e1287..b22c4f101 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -2698,6 +2698,7 @@
Left Difficulty | -ld |
Right Difficulty | -rd |
TV Type | -tv |
+ Startup Mode | -debug |
Left joy items | -holdjoy0 |
Right joy items | -holdjoy1 |
Console: Select | -holdselect |
diff --git a/src/common/mainSDL.cxx b/src/common/mainSDL.cxx
index 8ea878a97..d5468feae 100644
--- a/src/common/mainSDL.cxx
+++ b/src/common/mainSDL.cxx
@@ -197,9 +197,6 @@ int main(int argc, char* argv[])
dbg.setBreakPoint(bp, true);
theOSystem->settings().setValue("break", "");
}
-
- if(theOSystem->settings().getBool("debug"))
- theOSystem->eventHandler().enterDebugMode();
#endif
}
diff --git a/src/emucore/OSystem.cxx b/src/emucore/OSystem.cxx
index cad1f7234..da508bea9 100644
--- a/src/emucore/OSystem.cxx
+++ b/src/emucore/OSystem.cxx
@@ -577,6 +577,10 @@ string OSystem::createConsole(const FilesystemNode& rom, const string& md5sum,
myEventHandler->handleEvent(Event::JoystickOneRight, 1);
if(BSPF_containsIgnoreCase(holdjoy1, "F"))
myEventHandler->handleEvent(Event::JoystickOneFire, 1);
+ #ifdef DEBUGGER_SUPPORT
+ if(mySettings->getBool("debug"))
+ myEventHandler->enterDebugMode();
+ #endif
}
return EmptyString;
}
diff --git a/src/gui/GlobalPropsDialog.cxx b/src/gui/GlobalPropsDialog.cxx
index 52a7ca3d2..64febe241 100644
--- a/src/gui/GlobalPropsDialog.cxx
+++ b/src/gui/GlobalPropsDialog.cxx
@@ -49,7 +49,7 @@ GlobalPropsDialog::GlobalPropsDialog(GuiObject* boss, const GUI::Font& font)
// Set real dimensions
_w = lwidth + pwidth + fontWidth*3 + 15;
- _h = 15 * (lineHeight + 4) + buttonHeight + 20;
+ _h = 17 * (lineHeight + 4) + buttonHeight + 20;
xpos = 10; ypos = 10;
@@ -106,7 +106,7 @@ GlobalPropsDialog::GlobalPropsDialog(GuiObject* boss, const GUI::Font& font)
ypos += lineHeight + 10;
// Left difficulty
- pwidth = font.getStringWidth("Default");
+ pwidth = font.getStringWidth("Debugger");
new StaticTextWidget(this, font, xpos, ypos+1, lwidth, fontHeight,
"Left Difficulty:", kTextAlignLeft);
items.clear();
@@ -139,6 +139,17 @@ GlobalPropsDialog::GlobalPropsDialog(GuiObject* boss, const GUI::Font& font)
wid.push_back(myTVType);
ypos += lineHeight + 10;
+ // Start in debugger mode
+ new StaticTextWidget(this, font, xpos, ypos+1, lwidth, fontHeight,
+ "Startup Mode:", kTextAlignLeft);
+ items.clear();
+ items.push_back("Console", "false");
+ items.push_back("Debugger", "true");
+ myDebug = new PopUpWidget(this, font, xpos+lwidth, ypos,
+ pwidth, lineHeight, items, "", 0, 0);
+ wid.push_back(myDebug);
+ ypos += lineHeight + 10;
+
// Start console with buttons held down
new StaticTextWidget(this, font, xpos, ypos+1,
font.getStringWidth("Start console with the following held down:"),
@@ -253,6 +264,7 @@ void GlobalPropsDialog::loadConfig()
myLeftDiff->setSelected(settings.getString("ld"), "DEFAULT");
myRightDiff->setSelected(settings.getString("rd"), "DEFAULT");
myTVType->setSelected(settings.getString("tv"), "DEFAULT");
+ myDebug->setSelected(settings.getBool("debug") ? "true" : "false");
const string& holdjoy0 = settings.getString("holdjoy0");
for(int i = kJ0Up; i <= kJ0Fire; ++i)
@@ -287,6 +299,8 @@ void GlobalPropsDialog::saveConfig()
if(s == "DEFAULT") s = "";
settings.setValue("tv", s);
+ settings.setValue("debug", myDebug->getSelectedTag().toBool());
+
s = "";
for(int i = kJ0Up; i <= kJ0Fire; ++i)
if(myJoy[i]->getState()) s += ourJoyState[i];
@@ -307,6 +321,7 @@ void GlobalPropsDialog::setDefaults()
myLeftDiff->setSelected("DEFAULT");
myRightDiff->setSelected("DEFAULT");
myTVType->setSelected("DEFAULT");
+ myDebug->setSelected("false");
for(int i = kJ0Up; i <= kJ1Fire; ++i)
myJoy[i]->setState(false);
diff --git a/src/gui/GlobalPropsDialog.hxx b/src/gui/GlobalPropsDialog.hxx
index c0f40a006..8636d39eb 100644
--- a/src/gui/GlobalPropsDialog.hxx
+++ b/src/gui/GlobalPropsDialog.hxx
@@ -54,6 +54,7 @@ class GlobalPropsDialog : public Dialog, public CommandSender
PopUpWidget* myLeftDiff;
PopUpWidget* myRightDiff;
PopUpWidget* myTVType;
+ PopUpWidget* myDebug;
CheckboxWidget* myJoy[10];
CheckboxWidget* myHoldSelect;