diff --git a/docs/index.html b/docs/index.html index ad55d4eb5..012a02464 100644 --- a/docs/index.html +++ b/docs/index.html @@ -3732,7 +3732,7 @@
-

Emulation dialog:

+

Emulation dialog:

@@ -3769,7 +3769,7 @@

-

Input Settings dialog:

+

Input Settings dialog:

@@ -3807,7 +3807,6 @@ -

@@ -3840,7 +3839,7 @@
-

Developer Settings dialog:

+

Developer Settings dialog:

@@ -3851,7 +3850,7 @@

-

Game Properties dialog:

+

Game Properties dialog:

@@ -3862,7 +3861,7 @@

-

Audit ROMs dialog:

+

Audit ROMs dialog:

@@ -4053,7 +4052,7 @@ contains the following items:

    -
  1. Power-on options: Selecting this option shows a dialog whereby +

  2. Power-on options: Selecting this option shows a dialog whereby ROM properties can be temporarily overridden, and joystick/console buttons can be temporarily held down. Selecting options from this dialog will cause all ROMs launched after that to use those properties you specify. Clicking Defaults will disable @@ -4127,8 +4126,8 @@

    Stelladaptor/2600-daptor Support

    -
    +
    H

    Stella supports real Atari 2600 joysticks, paddles, driving controllers and trackballs (CX22/CX80 'Trak-Ball', Atari and Amiga mouse) using the Stelladaptor and diff --git a/src/cheat/CheatCodeDialog.cxx b/src/cheat/CheatCodeDialog.cxx index 85eb0b885..45d170a93 100644 --- a/src/cheat/CheatCodeDialog.cxx +++ b/src/cheat/CheatCodeDialog.cxx @@ -107,6 +107,8 @@ CheatCodeDialog::CheatCodeDialog(OSystem& osystem, DialogContainer& parent, wid.clear(); addOKCancelBGroup(wid, font); addBGroupToFocusList(wid); + + setHelpAnchor("Cheats"); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/debugger/CartDebug.cxx b/src/debugger/CartDebug.cxx index f689041e3..39855fb8f 100644 --- a/src/debugger/CartDebug.cxx +++ b/src/debugger/CartDebug.cxx @@ -253,7 +253,7 @@ bool CartDebug::disassembleAddr(uInt16 address, bool force) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool CartDebug::disassemblePC(bool force) { - return (disassembleAddr(myDebugger.cpuDebug().pc(), force)); + return disassembleAddr(myDebugger.cpuDebug().pc(), force); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/CommandDialog.cxx b/src/gui/CommandDialog.cxx index 7905c932a..35407b62c 100644 --- a/src/gui/CommandDialog.cxx +++ b/src/gui/CommandDialog.cxx @@ -106,6 +106,8 @@ CommandDialog::CommandDialog(OSystem& osystem, DialogContainer& parent) // We don't have a close/cancel button, but we still want the cancel // event to be processed processCancelWithoutWidget(true); + + setHelpAnchor("CommandMenu"); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -223,7 +225,7 @@ void CommandDialog::handleCommand(CommandSender* sender, int cmd, break; default: - return; + Dialog::handleCommand(sender, cmd, data, 0); } // Console commands should be performed right away, after leaving the menu diff --git a/src/gui/DeveloperDialog.cxx b/src/gui/DeveloperDialog.cxx index fd5c33154..5c80c5eca 100644 --- a/src/gui/DeveloperDialog.cxx +++ b/src/gui/DeveloperDialog.cxx @@ -80,6 +80,8 @@ DeveloperDialog::DeveloperDialog(OSystem& osystem, DialogContainer& parent, // Activate the first tab myTab->setActiveTab(0); + + setHelpAnchor("Debugger"); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/Dialog.cxx b/src/gui/Dialog.cxx index 47ff33d08..ea59b42ad 100644 --- a/src/gui/Dialog.cxx +++ b/src/gui/Dialog.cxx @@ -144,6 +144,34 @@ void Dialog::setTitle(const string& title) _h += _th; } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Dialog::setHelpAnchor(const string& helpAnchor, bool debugger) +{ +#ifndef RETRON77 + _helpAnchor = helpAnchor; + _debuggerHelp = debugger; + + if(_helpWidget == nullptr) + _helpWidget = new ButtonWidget(this, _font, _w - _font.getMaxCharWidth() * 3.5, 0, + _font.getMaxCharWidth() * 3.5, buttonHeight(), "?", + kHelpCmd); + + if(hasTitle() && hasHelp()) + _helpWidget->clearFlags(Widget::FLAG_INVISIBLE); + else + _helpWidget->setFlags(Widget::FLAG_INVISIBLE); +#endif +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +const string Dialog::getHelpURL() +{ + if(_debuggerHelp) + return "https://stella-emu.github.io/docs/debugger.html#" + _helpAnchor; + else + return "https://stella-emu.github.io/docs/index.html#" + _helpAnchor; +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Dialog::setPosition() { @@ -851,6 +879,15 @@ void Dialog::handleCommand(CommandSender* sender, int cmd, int data, int id) close(); break; + case kHelpCmd: + if(hasHelp()) + { + if(SDL_OpenURL(getHelpURL().c_str())) + { + cerr << "error opening URL " << getHelpURL() << endl; + } + break; + } default: break; } diff --git a/src/gui/Dialog.hxx b/src/gui/Dialog.hxx index a9f352591..ac0e96dd2 100644 --- a/src/gui/Dialog.hxx +++ b/src/gui/Dialog.hxx @@ -97,6 +97,9 @@ class Dialog : public GuiObject void setTitle(const string& title); bool hasTitle() { return !_title.empty(); } + void setHelpAnchor(const string& helpAnchor, bool debugger = false); + const string getHelpURL(); + virtual bool isShading() const { return true; } /** @@ -198,7 +201,13 @@ class Dialog : public GuiObject virtual bool repeatEnabled() { return true; } + bool hasHelp() { return !getHelpURL().empty(); } + private: + enum { + kHelpCmd = 'DlHp' + }; + void buildCurrentFocusList(int tabID = -1); bool handleNavEvent(Event::Type e, bool repeated = false); void getTabIdForWidget(Widget* w); @@ -221,6 +230,9 @@ class Dialog : public GuiObject int _th{0}; int _layer{0}; unique_ptr _toolTip; + string _helpAnchor; + bool _debuggerHelp{false}; + ButtonWidget* _helpWidget{nullptr}; private: struct Focus { diff --git a/src/gui/EmulationDialog.cxx b/src/gui/EmulationDialog.cxx index 81c415a0a..7ea7375a4 100644 --- a/src/gui/EmulationDialog.cxx +++ b/src/gui/EmulationDialog.cxx @@ -157,6 +157,8 @@ EmulationDialog::EmulationDialog(OSystem& osystem, DialogContainer& parent, addDefaultsOKCancelBGroup(wid, font); addToFocusList(wid); + + setHelpAnchor("Emulation"); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/GameInfoDialog.cxx b/src/gui/GameInfoDialog.cxx index e7858ce19..0f7684aaa 100644 --- a/src/gui/GameInfoDialog.cxx +++ b/src/gui/GameInfoDialog.cxx @@ -95,6 +95,8 @@ GameInfoDialog::GameInfoDialog( _extraWidget->setToolTip("Export the current ROM's properties\n" "into the default directory."); addBGroupToFocusList(wid); + + setHelpAnchor("Properties"); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/GlobalPropsDialog.cxx b/src/gui/GlobalPropsDialog.cxx index 4db9988d5..fdd8061ae 100644 --- a/src/gui/GlobalPropsDialog.cxx +++ b/src/gui/GlobalPropsDialog.cxx @@ -130,6 +130,8 @@ GlobalPropsDialog::GlobalPropsDialog(GuiObject* boss, const GUI::Font& font) addDefaultsOKCancelBGroup(wid, font, "Load ROM", "Cancel"); addToFocusList(wid); + + setHelpAnchor("PowerOn"); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/HelpDialog.cxx b/src/gui/HelpDialog.cxx index 3349790c8..dbbae7046 100644 --- a/src/gui/HelpDialog.cxx +++ b/src/gui/HelpDialog.cxx @@ -83,6 +83,8 @@ HelpDialog::HelpDialog(OSystem& osystem, DialogContainer& parent, } addToFocusList(wid); + + setHelpAnchor(" "); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/HighScoresDialog.cxx b/src/gui/HighScoresDialog.cxx index 69892b400..8349f804e 100644 --- a/src/gui/HighScoresDialog.cxx +++ b/src/gui/HighScoresDialog.cxx @@ -206,6 +206,8 @@ HighScoresDialog::HighScoresDialog(OSystem& osystem, DialogContainer& parent, addToFocusList(wid); _focusedWidget = _okWidget; // start with focus on 'Save' button + + setHelpAnchor("Highscores"); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/InputDialog.cxx b/src/gui/InputDialog.cxx index 92989587b..b41d4a03d 100644 --- a/src/gui/InputDialog.cxx +++ b/src/gui/InputDialog.cxx @@ -96,6 +96,8 @@ InputDialog::InputDialog(OSystem& osystem, DialogContainer& parent, WidgetArray wid; addDefaultsOKCancelBGroup(wid, _font); addBGroupToFocusList(wid); + + setHelpAnchor("Input"); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -233,6 +235,8 @@ void InputDialog::addDevicePortTab() // Add items for virtual device ports addToFocusList(wid, myTab, tabID); + + setHelpAnchor("Input"); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/LoggerDialog.cxx b/src/gui/LoggerDialog.cxx index 52dd13147..b426f1d5c 100644 --- a/src/gui/LoggerDialog.cxx +++ b/src/gui/LoggerDialog.cxx @@ -85,6 +85,8 @@ LoggerDialog::LoggerDialog(OSystem& osystem, DialogContainer& parent, addOKCancelBGroup(wid, font); addToFocusList(wid); + + setHelpAnchor("Logs"); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/OptionsDialog.cxx b/src/gui/OptionsDialog.cxx index f5bbcfa62..8b3972b3b 100644 --- a/src/gui/OptionsDialog.cxx +++ b/src/gui/OptionsDialog.cxx @@ -146,6 +146,8 @@ OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent, { myRomAuditButton->clearFlags(Widget::FLAG_ENABLED); } + + setHelpAnchor("Options"); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/SnapshotDialog.cxx b/src/gui/SnapshotDialog.cxx index ac05d94d6..4d81b61da 100644 --- a/src/gui/SnapshotDialog.cxx +++ b/src/gui/SnapshotDialog.cxx @@ -93,6 +93,8 @@ SnapshotDialog::SnapshotDialog(OSystem& osystem, DialogContainer& parent, addDefaultsOKCancelBGroup(wid, font); addToFocusList(wid); + + setHelpAnchor("Snapshots"); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/UIDialog.cxx b/src/gui/UIDialog.cxx index 0525606b8..d8b6d5082 100644 --- a/src/gui/UIDialog.cxx +++ b/src/gui/UIDialog.cxx @@ -311,6 +311,8 @@ UIDialog::UIDialog(OSystem& osystem, DialogContainer& parent, addDefaultsOKCancelBGroup(wid, font); addBGroupToFocusList(wid); + setHelpAnchor("UserInterface"); + #ifndef WINDOWED_SUPPORT myCenter->clearFlags(Widget::FLAG_ENABLED); #endif diff --git a/src/gui/VideoAudioDialog.cxx b/src/gui/VideoAudioDialog.cxx index 4338c361f..5fdf1ac72 100644 --- a/src/gui/VideoAudioDialog.cxx +++ b/src/gui/VideoAudioDialog.cxx @@ -90,6 +90,8 @@ VideoAudioDialog::VideoAudioDialog(OSystem& osystem, DialogContainer& parent, // Activate the first tab myTab->setActiveTab(0); + setHelpAnchor("VideoAudio"); + // Disable certain functions when we know they aren't present #ifndef WINDOWED_SUPPORT myFullscreen->clearFlags(Widget::FLAG_ENABLED);