From 915ab71e3bef7dff9aebf1f08e328fcc90792fdd Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Sun, 20 Dec 2020 20:05:41 -0330 Subject: [PATCH 01/13] Move duplicated 'trim' function to BSPF. Remove unused methods from Settings. --- src/common/bspf.hxx | 8 ++++++++ .../repository/KeyValueRepositoryConfigfile.cxx | 13 ++----------- src/emucore/Settings.hxx | 14 -------------- 3 files changed, 10 insertions(+), 25 deletions(-) diff --git a/src/common/bspf.hxx b/src/common/bspf.hxx index 7003a73a4..636906c9b 100644 --- a/src/common/bspf.hxx +++ b/src/common/bspf.hxx @@ -303,6 +303,14 @@ namespace BSPF } } + // Trim leading and trailing whitespace from a string + inline string trim(const string& str) + { + string::size_type first = str.find_first_not_of(' '); + return (first == string::npos) ? EmptyString : + str.substr(first, str.find_last_not_of(' ')-first+1); + } + // C++11 way to get local time // Equivalent to the C-style localtime() function, but is thread-safe inline std::tm localTime() diff --git a/src/common/repository/KeyValueRepositoryConfigfile.cxx b/src/common/repository/KeyValueRepositoryConfigfile.cxx index b0e6ae725..1e325a08c 100644 --- a/src/common/repository/KeyValueRepositoryConfigfile.cxx +++ b/src/common/repository/KeyValueRepositoryConfigfile.cxx @@ -18,15 +18,6 @@ #include "KeyValueRepositoryConfigfile.hxx" #include "Logger.hxx" -namespace { - string trim(const string& str) - { - string::size_type first = str.find_first_not_of(' '); - return (first == string::npos) ? EmptyString : - str.substr(first, str.find_last_not_of(' ')-first+1); - } -} - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - KeyValueRepositoryConfigfile::KeyValueRepositoryConfigfile(const FilesystemNode& file) : myFile{file} @@ -67,8 +58,8 @@ std::map KeyValueRepositoryConfigfile::load() continue; // Split the line into key/value pairs and trim any whitespace - key = trim(line.substr(0, equalPos)); - value = trim(line.substr(equalPos + 1, line.length() - key.length() - 1)); + key = BSPF::trim(line.substr(0, equalPos)); + value = BSPF::trim(line.substr(equalPos + 1, line.length() - key.length() - 1)); // Skip absent key if(key.length() == 0) diff --git a/src/emucore/Settings.hxx b/src/emucore/Settings.hxx index 7c129a392..decc70a24 100644 --- a/src/emucore/Settings.hxx +++ b/src/emucore/Settings.hxx @@ -116,20 +116,6 @@ class Settings void setPermanent(const string& key, const Variant& value); void setTemporary(const string& key, const Variant& value); - // Trim leading and following whitespace from a string - static string trim(const string& str) - { - string::size_type first = str.find_first_not_of(' '); - return (first == string::npos) ? EmptyString : - str.substr(first, str.find_last_not_of(' ')-first+1); - } - - // FIXME - Rework so that these aren't needed; hence no commenting added - const Options& getPermanentSettings() const - { return myPermanentSettings; } - const Options& getTemporarySettings() const - { return myTemporarySettings; } - private: /** This method must be called *after* settings have been fully loaded From b557460fb9a9c973755a0bb38d03c929cdc3bcaa Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Sun, 20 Dec 2020 21:08:00 -0330 Subject: [PATCH 02/13] Final batch of brace conversion. Added const in a few places. --- src/gui/CheckListWidget.cxx | 2 +- src/gui/CheckListWidget.hxx | 4 +-- src/gui/ColorWidget.cxx | 4 +-- src/gui/Command.hxx | 2 +- src/gui/ContextMenu.cxx | 6 ++-- src/gui/ContextMenu.hxx | 2 +- src/gui/DeveloperDialog.hxx | 2 +- src/gui/Dialog.cxx | 4 +-- src/gui/Dialog.hxx | 4 +-- src/gui/DialogContainer.cxx | 2 +- src/gui/EventMappingWidget.cxx | 2 +- src/gui/FileListWidget.cxx | 2 +- src/gui/FileListWidget.hxx | 2 +- src/gui/Font.cxx | 2 +- src/gui/GuiObject.hxx | 8 ++--- src/gui/HighScoresDialog.hxx | 1 - src/gui/InputDialog.cxx | 4 +-- src/gui/Launcher.cxx | 2 +- src/gui/ListWidget.cxx | 2 +- src/gui/MessageBox.cxx | 4 +-- src/gui/MessageDialog.cxx | 1 + src/gui/MessageDialog.hxx | 50 +++++++++++++++--------------- src/gui/OptionsDialog.cxx | 4 +-- src/gui/OptionsDialog.hxx | 2 +- src/gui/PopUpWidget.cxx | 4 +-- src/gui/ProgressDialog.cxx | 2 +- src/gui/QuadTariDialog.cxx | 2 +- src/gui/RadioButtonWidget.cxx | 4 +-- src/gui/RadioButtonWidget.hxx | 2 +- src/gui/RomAuditDialog.cxx | 6 ++-- src/gui/RomInfoWidget.cxx | 2 +- src/gui/SnapshotDialog.cxx | 2 +- src/gui/StellaSettingsDialog.cxx | 2 +- src/gui/StringListWidget.cxx | 2 +- src/gui/TabWidget.hxx | 2 +- src/gui/TimeLineWidget.cxx | 6 ++-- src/gui/TimeLineWidget.hxx | 4 +-- src/gui/TimeMachine.cxx | 2 +- src/gui/TimeMachineDialog.cxx | 2 +- src/gui/TimeMachineDialog.hxx | 4 +-- src/gui/ToolTip.cxx | 4 +-- src/gui/UIDialog.cxx | 4 +-- src/gui/UndoHandler.cxx | 2 +- src/gui/VideoAudioDialog.hxx | 2 +- src/gui/Widget.cxx | 22 ++++++------- src/libretro/FBSurfaceLIBRETRO.hxx | 2 +- src/libretro/StellaLIBRETRO.hxx | 2 +- src/unix/FSNodePOSIX.cxx | 4 +-- src/windows/FSNodeWINDOWS.cxx | 2 +- 49 files changed, 105 insertions(+), 105 deletions(-) diff --git a/src/gui/CheckListWidget.cxx b/src/gui/CheckListWidget.cxx index 13afb335a..a42744657 100644 --- a/src/gui/CheckListWidget.cxx +++ b/src/gui/CheckListWidget.cxx @@ -143,7 +143,7 @@ Common::Rect CheckListWidget::getEditRect() const } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool CheckListWidget::getState(int line) +bool CheckListWidget::getState(int line) const { if(line >= 0 && line < int(_stateList.size())) return _stateList[line]; diff --git a/src/gui/CheckListWidget.hxx b/src/gui/CheckListWidget.hxx index 2ebec0d5d..30ccba814 100644 --- a/src/gui/CheckListWidget.hxx +++ b/src/gui/CheckListWidget.hxx @@ -39,8 +39,8 @@ class CheckListWidget : public ListWidget void setList(const StringList& list, const BoolArray& state); void setLine(int line, const string& str, const bool& state); - bool getState(int line); - bool getSelectedState() { return getState(_selectedItem); } + bool getState(int line) const; + bool getSelectedState() const { return getState(_selectedItem); } private: bool handleEvent(Event::Type e) override; diff --git a/src/gui/ColorWidget.cxx b/src/gui/ColorWidget.cxx index 94ef4bbf4..8320c9a88 100644 --- a/src/gui/ColorWidget.cxx +++ b/src/gui/ColorWidget.cxx @@ -28,8 +28,8 @@ ColorWidget::ColorWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h, int cmd, bool framed) : Widget(boss, font, x, y, w, h), CommandSender(boss), - _framed(framed), - _cmd(cmd) + _framed{framed}, + _cmd{cmd} { _flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG | Widget::FLAG_RETAIN_FOCUS; } diff --git a/src/gui/Command.hxx b/src/gui/Command.hxx index 64fab2151..0178670f8 100644 --- a/src/gui/Command.hxx +++ b/src/gui/Command.hxx @@ -48,7 +48,7 @@ class CommandSender // and add methods addTarget/removeTarget. public: explicit CommandSender(CommandReceiver* target) - : _target(target) { } + : _target{target} { } virtual ~CommandSender() = default; diff --git a/src/gui/ContextMenu.cxx b/src/gui/ContextMenu.cxx index 2ecf50302..bcf87ca0e 100644 --- a/src/gui/ContextMenu.cxx +++ b/src/gui/ContextMenu.cxx @@ -31,9 +31,9 @@ ContextMenu::ContextMenu(GuiObject* boss, const GUI::Font& font, const VariantList& items, int cmd, int width) : Dialog(boss->instance(), boss->parent(), font), CommandSender(boss), - _rowHeight(font.getLineHeight()), - _cmd(cmd), - _maxWidth(width) + _rowHeight{font.getLineHeight()}, + _cmd{cmd}, + _maxWidth{width} { setArrows(); addItems(items); diff --git a/src/gui/ContextMenu.hxx b/src/gui/ContextMenu.hxx index 6807635ba..ab6a0f6ff 100644 --- a/src/gui/ContextMenu.hxx +++ b/src/gui/ContextMenu.hxx @@ -130,7 +130,7 @@ class ContextMenu : public Dialog, public CommandSender int _id{-1}; uInt32 _xorig{0}, _yorig{0}; - uInt32 _maxWidth{0}; + int _maxWidth{0}; int _textOfs{0}; int _arrowSize{0}; diff --git a/src/gui/DeveloperDialog.hxx b/src/gui/DeveloperDialog.hxx index fc16e302e..65d057e38 100644 --- a/src/gui/DeveloperDialog.hxx +++ b/src/gui/DeveloperDialog.hxx @@ -148,7 +148,7 @@ class DeveloperDialog : public Dialog CheckboxWidget* myGhostReadsTrapWidget{nullptr}; #endif - bool mySettings; + bool mySettings{false}; // Emulator sets std::array myFrameStats; std::array myDetectedInfo; diff --git a/src/gui/Dialog.cxx b/src/gui/Dialog.cxx index 8b052b032..72bdc398a 100644 --- a/src/gui/Dialog.cxx +++ b/src/gui/Dialog.cxx @@ -49,8 +49,8 @@ Dialog::Dialog(OSystem& instance, DialogContainer& parent, const GUI::Font& font, const string& title, int x, int y, int w, int h) : GuiObject(instance, parent, *this, x, y, w, h), - _font(font), - _title(title) + _font{font}, + _title{title} { _flags = Widget::FLAG_ENABLED | Widget::FLAG_BORDER | Widget::FLAG_CLEARBG; setTitle(title); diff --git a/src/gui/Dialog.hxx b/src/gui/Dialog.hxx index 0cc145d55..022334e47 100644 --- a/src/gui/Dialog.hxx +++ b/src/gui/Dialog.hxx @@ -213,7 +213,7 @@ class Dialog : public GuiObject Widget* widget{nullptr}; WidgetArray list; - explicit Focus(Widget* w = nullptr) : widget(w) { } + explicit Focus(Widget* w = nullptr) : widget{w} { } }; using FocusList = vector; @@ -222,7 +222,7 @@ class Dialog : public GuiObject FocusList focus; uInt32 currentTab{0}; - explicit TabFocus(TabWidget* w = nullptr) : widget(w) { } + explicit TabFocus(TabWidget* w = nullptr) : widget{w} { } void appendFocusList(WidgetArray& list); void saveCurrentFocus(Widget* w); diff --git a/src/gui/DialogContainer.cxx b/src/gui/DialogContainer.cxx index 16f32536a..c421cb430 100644 --- a/src/gui/DialogContainer.cxx +++ b/src/gui/DialogContainer.cxx @@ -28,7 +28,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DialogContainer::DialogContainer(OSystem& osystem) - : myOSystem(osystem) + : myOSystem{osystem} { _DOUBLE_CLICK_DELAY = osystem.settings().getInt("mdouble"); _REPEAT_INITIAL_DELAY = osystem.settings().getInt("ctrldelay"); diff --git a/src/gui/EventMappingWidget.cxx b/src/gui/EventMappingWidget.cxx index 0336e4c51..4755c7789 100644 --- a/src/gui/EventMappingWidget.cxx +++ b/src/gui/EventMappingWidget.cxx @@ -40,7 +40,7 @@ EventMappingWidget::EventMappingWidget(GuiObject* boss, const GUI::Font& font, EventMode mode) : Widget(boss, font, x, y, w, h), CommandSender(boss), - myEventMode(mode) + myEventMode{mode} { const int fontHeight = font.getFontHeight(), lineHeight = font.getLineHeight(), diff --git a/src/gui/FileListWidget.cxx b/src/gui/FileListWidget.cxx index 169b9cddb..519c097fa 100644 --- a/src/gui/FileListWidget.cxx +++ b/src/gui/FileListWidget.cxx @@ -28,7 +28,7 @@ FileListWidget::FileListWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h) : StringListWidget(boss, font, x, y, w, h), - _filter([](const FilesystemNode& node) { return true; }) + _filter{[](const FilesystemNode& node) { return true; }} { // This widget is special, in that it catches signals and redirects them setTarget(this); diff --git a/src/gui/FileListWidget.hxx b/src/gui/FileListWidget.hxx index 32f6517f7..f60dd97d4 100644 --- a/src/gui/FileListWidget.hxx +++ b/src/gui/FileListWidget.hxx @@ -89,7 +89,7 @@ class FileListWidget : public StringListWidget const FilesystemNode& currentDir() const { return _node; } static void setQuickSelectDelay(uInt64 time) { _QUICK_SELECT_DELAY = time; } - uInt64 getQuickSelectDelay() { return _QUICK_SELECT_DELAY; } + uInt64 getQuickSelectDelay() const { return _QUICK_SELECT_DELAY; } ProgressDialog& progress(); void incProgress(); diff --git a/src/gui/Font.cxx b/src/gui/Font.cxx index e327fa8af..53797d031 100644 --- a/src/gui/Font.cxx +++ b/src/gui/Font.cxx @@ -26,7 +26,7 @@ namespace GUI { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Font::Font(const FontDesc& desc) - : myFontDesc(desc) + : myFontDesc{desc} { } diff --git a/src/gui/GuiObject.hxx b/src/gui/GuiObject.hxx index dd95d62cc..6d69cd04b 100644 --- a/src/gui/GuiObject.hxx +++ b/src/gui/GuiObject.hxx @@ -70,10 +70,10 @@ class GuiObject : public CommandReceiver public: GuiObject(OSystem& osystem, DialogContainer& parent, Dialog& dialog, int x, int y, int w, int h) - : myOSystem(osystem), - myParent(parent), - myDialog(dialog), - _x(x), _y(y), _w(w), _h(h) { } + : myOSystem{osystem}, + myParent{parent}, + myDialog{dialog}, + _x{x}, _y{y}, _w{w}, _h{h} { } ~GuiObject() override = default; diff --git a/src/gui/HighScoresDialog.hxx b/src/gui/HighScoresDialog.hxx index c15105f6f..39ccca335 100644 --- a/src/gui/HighScoresDialog.hxx +++ b/src/gui/HighScoresDialog.hxx @@ -35,7 +35,6 @@ class Serializer; using json = nlohmann::json; - /** The dialog for displaying high scores in Stella. diff --git a/src/gui/InputDialog.cxx b/src/gui/InputDialog.cxx index e9bb315c3..2345e3570 100644 --- a/src/gui/InputDialog.cxx +++ b/src/gui/InputDialog.cxx @@ -41,8 +41,8 @@ InputDialog::InputDialog(OSystem& osystem, DialogContainer& parent, const GUI::Font& font, int max_w, int max_h) : Dialog(osystem, parent, font, "Input settings"), - myMaxWidth(max_w), - myMaxHeight(max_h) + myMaxWidth{max_w}, + myMaxHeight{max_h} { const int lineHeight = _font.getLineHeight(), fontWidth = _font.getMaxCharWidth(), diff --git a/src/gui/Launcher.cxx b/src/gui/Launcher.cxx index 91868282c..81605a703 100644 --- a/src/gui/Launcher.cxx +++ b/src/gui/Launcher.cxx @@ -28,7 +28,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Launcher::Launcher(OSystem& osystem) : DialogContainer(osystem), - mySize(myOSystem.settings().getSize("launcherres")) + mySize{myOSystem.settings().getSize("launcherres")} { const Common::Size& d = myOSystem.frameBuffer().desktopSize(); double overscan = 1 - myOSystem.settings().getInt("tia.fs_overscan") / 100.0; diff --git a/src/gui/ListWidget.cxx b/src/gui/ListWidget.cxx index 1cf6c7e0d..a8c0c37da 100644 --- a/src/gui/ListWidget.cxx +++ b/src/gui/ListWidget.cxx @@ -28,7 +28,7 @@ ListWidget::ListWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h, bool useScrollbar) : EditableWidget(boss, font, x, y, 16, 16), - _useScrollbar(useScrollbar) + _useScrollbar{useScrollbar} { _flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG | Widget::FLAG_RETAIN_FOCUS; _bgcolor = kWidColor; diff --git a/src/gui/MessageBox.cxx b/src/gui/MessageBox.cxx index d5b5cf11b..ca3913543 100644 --- a/src/gui/MessageBox.cxx +++ b/src/gui/MessageBox.cxx @@ -33,8 +33,8 @@ MessageBox::MessageBox(GuiObject* boss, const GUI::Font& font, bool focusOKButton) : Dialog(boss->instance(), boss->parent(), font, title, 0, 0, max_w, max_h), CommandSender(boss), - myOkCmd(okCmd), - myCancelCmd(cancelCmd) + myOkCmd{okCmd}, + myCancelCmd{cancelCmd} { addText(font, text); diff --git a/src/gui/MessageDialog.cxx b/src/gui/MessageDialog.cxx index ca52c99e6..2c2b19c7d 100644 --- a/src/gui/MessageDialog.cxx +++ b/src/gui/MessageDialog.cxx @@ -82,6 +82,7 @@ void MessageDialog::setMessage(const string& title, const string& text, bool yes setMessage(title, StringParser(text).stringList(), yesNo); } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - string MessageDialog::myTitle = ""; StringList MessageDialog::myText; bool MessageDialog::myYesNo = false; diff --git a/src/gui/MessageDialog.hxx b/src/gui/MessageDialog.hxx index d3c8a8228..6399abafb 100644 --- a/src/gui/MessageDialog.hxx +++ b/src/gui/MessageDialog.hxx @@ -26,36 +26,36 @@ class OSystem; class MessageDialog : public Dialog { -public: - MessageDialog(OSystem& osystem, DialogContainer& parent, - const GUI::Font& font, int max_w, int max_h); - ~MessageDialog() override; + public: + MessageDialog(OSystem& osystem, DialogContainer& parent, + const GUI::Font& font, int max_w, int max_h); + ~MessageDialog() override; - // Define the message displayed - void setMessage(const string& title, const string& text, bool yesNo = false); - void setMessage(const string& title, const StringList& text, bool yesNo = false); - bool confirmed() { return myConfirmed; } + // Define the message displayed + void setMessage(const string& title, const string& text, bool yesNo = false); + void setMessage(const string& title, const StringList& text, bool yesNo = false); + bool confirmed() { return myConfirmed; } -protected: - void loadConfig() override; - void handleCommand(CommandSender* sender, int cmd, int data, int id) override; + protected: + void loadConfig() override; + void handleCommand(CommandSender* sender, int cmd, int data, int id) override; -private: - static string myTitle; - static StringList myText; - static bool myYesNo; - static bool myConfirmed; + private: + static string myTitle; + static StringList myText; + static bool myYesNo; + static bool myConfirmed; - // Show a message - GUI::MessageBox* myMsg{nullptr}; + // Show a message + GUI::MessageBox* myMsg{nullptr}; -private: - // Following constructors and assignment operators not supported - MessageDialog() = delete; - MessageDialog(const MessageDialog&) = delete; - MessageDialog(MessageDialog&&) = delete; - MessageDialog& operator=(const MessageDialog&) = delete; - MessageDialog& operator=(MessageDialog&&) = delete; + private: + // Following constructors and assignment operators not supported + MessageDialog() = delete; + MessageDialog(const MessageDialog&) = delete; + MessageDialog(MessageDialog&&) = delete; + MessageDialog& operator=(const MessageDialog&) = delete; + MessageDialog& operator=(MessageDialog&&) = delete; }; #endif diff --git a/src/gui/OptionsDialog.cxx b/src/gui/OptionsDialog.cxx index 865103822..b2dc3b083 100644 --- a/src/gui/OptionsDialog.cxx +++ b/src/gui/OptionsDialog.cxx @@ -49,8 +49,8 @@ OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent, GuiObject* boss, int max_w, int max_h, Menu::AppMode mode) : Dialog(osystem, parent, osystem.frameBuffer().font(), "Options"), - myBoss(boss), - myMode(mode) + myBoss{boss}, + myMode{mode} { // do not show basic settings options in debugger bool minSettings = osystem.settings().getBool("minimal_ui") && mode != Menu::AppMode::debugger; diff --git a/src/gui/OptionsDialog.hxx b/src/gui/OptionsDialog.hxx index bd13c3f37..ea0f38935 100644 --- a/src/gui/OptionsDialog.hxx +++ b/src/gui/OptionsDialog.hxx @@ -71,7 +71,7 @@ class OptionsDialog : public Dialog ButtonWidget* myGameInfoButton{nullptr}; ButtonWidget* myCheatCodeButton{nullptr}; - GuiObject* myBoss; + GuiObject* myBoss{nullptr}; // Indicates if this dialog is used for global (vs. in-game) settings Menu::AppMode myMode{Menu::AppMode::emulator}; diff --git a/src/gui/PopUpWidget.cxx b/src/gui/PopUpWidget.cxx index ab9560ed8..762ce3bf8 100644 --- a/src/gui/PopUpWidget.cxx +++ b/src/gui/PopUpWidget.cxx @@ -29,8 +29,8 @@ PopUpWidget::PopUpWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h, const VariantList& list, const string& label, int labelWidth, int cmd) : EditableWidget(boss, font, x, y - 1, w, h + 2), - _label(label), - _labelWidth(labelWidth) + _label{label}, + _labelWidth{labelWidth} { _flags = Widget::FLAG_ENABLED | Widget::FLAG_RETAIN_FOCUS | Widget::FLAG_TRACK_MOUSE; diff --git a/src/gui/ProgressDialog.cxx b/src/gui/ProgressDialog.cxx index 80aafc8c4..235e24f6c 100644 --- a/src/gui/ProgressDialog.cxx +++ b/src/gui/ProgressDialog.cxx @@ -30,7 +30,7 @@ ProgressDialog::ProgressDialog(GuiObject* boss, const GUI::Font& font, const string& message) : Dialog(boss->instance(), boss->parent()), - myFont(font) + myFont{font} { const int fontWidth = font.getMaxCharWidth(), fontHeight = font.getFontHeight(), diff --git a/src/gui/QuadTariDialog.cxx b/src/gui/QuadTariDialog.cxx index b4d1891ef..4b0ef8ead 100644 --- a/src/gui/QuadTariDialog.cxx +++ b/src/gui/QuadTariDialog.cxx @@ -29,7 +29,7 @@ QuadTariDialog::QuadTariDialog(GuiObject* boss, const GUI::Font& font, int max_w, int max_h, Properties& properties) : Dialog(boss->instance(), boss->parent(), font, "QuadTari controllers", 0, 0, max_w, max_h), - myGameProperties(properties) + myGameProperties{properties} { const int lineHeight = font.getLineHeight(), fontHeight = font.getFontHeight(), diff --git a/src/gui/RadioButtonWidget.cxx b/src/gui/RadioButtonWidget.cxx index 658859b97..7c3b8b16d 100644 --- a/src/gui/RadioButtonWidget.cxx +++ b/src/gui/RadioButtonWidget.cxx @@ -221,8 +221,8 @@ RadioButtonWidget::RadioButtonWidget(GuiObject* boss, const GUI::Font& font, int x, int y, const string& label, RadioButtonGroup* group, int cmd) : CheckboxWidget(boss, font, x, y, label, cmd), - myGroup(group), - _buttonSize(buttonSize(font)) // 14 | 22 + myGroup{group}, + _buttonSize{buttonSize(font)} // 14 | 22 { _flags = Widget::FLAG_ENABLED; _bgcolor = _bgcolorhi = kWidColor; diff --git a/src/gui/RadioButtonWidget.hxx b/src/gui/RadioButtonWidget.hxx index 8003a8627..52a81bb99 100644 --- a/src/gui/RadioButtonWidget.hxx +++ b/src/gui/RadioButtonWidget.hxx @@ -40,7 +40,7 @@ class RadioButtonWidget : public CheckboxWidget protected: void setFill(FillType type); void drawWidget(bool hilite) override; - static int buttonSize(const GUI::Font& font) + static uInt32 buttonSize(const GUI::Font& font) { return font.getFontHeight() < 24 ? 14 : 22; // box is square } diff --git a/src/gui/RomAuditDialog.cxx b/src/gui/RomAuditDialog.cxx index a95e4fce5..65b4d0c33 100644 --- a/src/gui/RomAuditDialog.cxx +++ b/src/gui/RomAuditDialog.cxx @@ -37,9 +37,9 @@ RomAuditDialog::RomAuditDialog(OSystem& osystem, DialogContainer& parent, const GUI::Font& font, int max_w, int max_h) : Dialog(osystem, parent, font, "Audit ROMs"), - myFont(font), - myMaxWidth(max_w), - myMaxHeight(max_h) + myFont{font}, + myMaxWidth{max_w}, + myMaxHeight{max_h} { const int lineHeight = font.getLineHeight(), fontWidth = font.getMaxCharWidth(), diff --git a/src/gui/RomInfoWidget.cxx b/src/gui/RomInfoWidget.cxx index 4cf7f4d33..11eddc6e5 100644 --- a/src/gui/RomInfoWidget.cxx +++ b/src/gui/RomInfoWidget.cxx @@ -37,7 +37,7 @@ RomInfoWidget::RomInfoWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h, const Common::Size& imgSize) : Widget(boss, font, x, y, w, h), - myAvail(imgSize) + myAvail{imgSize} { _flags = Widget::FLAG_ENABLED; _bgcolor = kDlgColor; diff --git a/src/gui/SnapshotDialog.cxx b/src/gui/SnapshotDialog.cxx index 792d7af7f..80af8ec1d 100644 --- a/src/gui/SnapshotDialog.cxx +++ b/src/gui/SnapshotDialog.cxx @@ -29,7 +29,7 @@ SnapshotDialog::SnapshotDialog(OSystem& osystem, DialogContainer& parent, const GUI::Font& font, int max_w, int max_h) : Dialog(osystem, parent, font, "Snapshot settings"), - myFont(font) + myFont{font} { const int lineHeight = font.getLineHeight(), fontHeight = _font.getFontHeight(), diff --git a/src/gui/StellaSettingsDialog.cxx b/src/gui/StellaSettingsDialog.cxx index 06ff03b3e..5236735f0 100644 --- a/src/gui/StellaSettingsDialog.cxx +++ b/src/gui/StellaSettingsDialog.cxx @@ -32,7 +32,7 @@ StellaSettingsDialog::StellaSettingsDialog(OSystem& osystem, DialogContainer& parent, int max_w, int max_h, Menu::AppMode mode) : Dialog(osystem, parent, osystem.frameBuffer().font(), "Basic settings"), - myMode(mode) + myMode{mode} { const int buttonHeight = _font.getLineHeight() + _font.getLineHeight() / 5, lineHeight = _font.getLineHeight(), diff --git a/src/gui/StringListWidget.cxx b/src/gui/StringListWidget.cxx index b94d1b5c4..5371947c5 100644 --- a/src/gui/StringListWidget.cxx +++ b/src/gui/StringListWidget.cxx @@ -27,7 +27,7 @@ StringListWidget::StringListWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h, bool hilite, bool useScrollbar) : ListWidget(boss, font, x, y, w, h, useScrollbar), - _hilite(hilite) + _hilite{hilite} { _bgcolorlo = kDlgColor; diff --git a/src/gui/TabWidget.hxx b/src/gui/TabWidget.hxx index d2ca4305c..fa33c06c1 100644 --- a/src/gui/TabWidget.hxx +++ b/src/gui/TabWidget.hxx @@ -83,7 +83,7 @@ class TabWidget : public Widget, public CommandSender explicit Tab(const string& t, int tw = NO_WIDTH, Widget* first = nullptr, Widget* parent = nullptr, bool e = true) - : title(t), firstWidget(first), parentWidget(parent), enabled(e), tabWidth(tw) { } + : title{t}, firstWidget{first}, parentWidget{parent}, enabled{e}, tabWidth{tw} { } }; using TabList = vector; diff --git a/src/gui/TimeLineWidget.cxx b/src/gui/TimeLineWidget.cxx index 5f6e0e687..3018bb40c 100644 --- a/src/gui/TimeLineWidget.cxx +++ b/src/gui/TimeLineWidget.cxx @@ -33,7 +33,7 @@ TimeLineWidget::TimeLineWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h, const string& label, uInt32 labelWidth, int cmd) : ButtonWidget(boss, font, x, y, w, h, label, cmd), - _labelWidth(labelWidth) + _labelWidth{labelWidth} { _flags = Widget::FLAG_ENABLED | Widget::FLAG_TRACK_MOUSE | Widget::FLAG_CLEARBG | Widget::FLAG_NOBG; @@ -205,13 +205,13 @@ void TimeLineWidget::drawWidget(bool hilite) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt32 TimeLineWidget::valueToPos(uInt32 value) +uInt32 TimeLineWidget::valueToPos(uInt32 value) const { return _stepValue[BSPF::clamp(value, _valueMin, _valueMax)]; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt32 TimeLineWidget::posToValue(uInt32 pos) +uInt32 TimeLineWidget::posToValue(uInt32 pos) const { // Find the interval in which 'pos' falls, and then the endpoint which // it is closest to diff --git a/src/gui/TimeLineWidget.hxx b/src/gui/TimeLineWidget.hxx index 5518fac20..e0cdd8980 100644 --- a/src/gui/TimeLineWidget.hxx +++ b/src/gui/TimeLineWidget.hxx @@ -49,8 +49,8 @@ class TimeLineWidget : public ButtonWidget void drawWidget(bool hilite) override; - uInt32 valueToPos(uInt32 value); - uInt32 posToValue(uInt32 pos); + uInt32 valueToPos(uInt32 value) const; + uInt32 posToValue(uInt32 pos) const; protected: uInt32 _value{0}; diff --git a/src/gui/TimeMachine.cxx b/src/gui/TimeMachine.cxx index 1dad57152..033aed076 100644 --- a/src/gui/TimeMachine.cxx +++ b/src/gui/TimeMachine.cxx @@ -23,7 +23,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TimeMachine::TimeMachine(OSystem& osystem) : DialogContainer(osystem), - myWidth(FBMinimum::Width) + myWidth{FBMinimum::Width} { myBaseDialog = new TimeMachineDialog(myOSystem, *this, myWidth); } diff --git a/src/gui/TimeMachineDialog.cxx b/src/gui/TimeMachineDialog.cxx index 594ed5036..c0ca3d299 100644 --- a/src/gui/TimeMachineDialog.cxx +++ b/src/gui/TimeMachineDialog.cxx @@ -495,7 +495,7 @@ void TimeMachineDialog::initBar() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -string TimeMachineDialog::getTimeString(uInt64 cycles) +string TimeMachineDialog::getTimeString(uInt64 cycles) const { const Int32 scanlines = std::max(instance().console().tia().scanlinesLastFrame(), 240); const bool isNTSC = scanlines <= 287; diff --git a/src/gui/TimeMachineDialog.hxx b/src/gui/TimeMachineDialog.hxx index 1d15d6b15..b9fe118fd 100644 --- a/src/gui/TimeMachineDialog.hxx +++ b/src/gui/TimeMachineDialog.hxx @@ -33,7 +33,7 @@ class TimeMachineDialog : public Dialog /** set/get number of winds when entering the dialog */ void setEnterWinds(Int32 numWinds) { _enterWinds = numWinds; } - Int32 getEnterWinds() { return _enterWinds; } + Int32 getEnterWinds() const { return _enterWinds; } private: void loadConfig() override; @@ -48,7 +48,7 @@ class TimeMachineDialog : public Dialog void setPosition() override; /** convert cycles into time */ - string getTimeString(uInt64 cycles); + string getTimeString(uInt64 cycles) const; /** re/unwind and update display */ void handleWinds(Int32 numWinds = 0); /** toggle Time Machine mode */ diff --git a/src/gui/ToolTip.cxx b/src/gui/ToolTip.cxx index c2f7b7656..88e5915bd 100644 --- a/src/gui/ToolTip.cxx +++ b/src/gui/ToolTip.cxx @@ -27,7 +27,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ToolTip::ToolTip(Dialog& dialog, const GUI::Font& font) - : myDialog(dialog) + : myDialog{dialog} { myScale = myDialog.instance().frameBuffer().hidpiScaleFactor(); @@ -179,5 +179,5 @@ void ToolTip::show(const string& tip) void ToolTip::render() { if(myTipShown) - mySurface->render(); + mySurface->render(); } diff --git a/src/gui/UIDialog.cxx b/src/gui/UIDialog.cxx index 11a9e0308..beb6f576d 100644 --- a/src/gui/UIDialog.cxx +++ b/src/gui/UIDialog.cxx @@ -42,8 +42,8 @@ UIDialog::UIDialog(OSystem& osystem, DialogContainer& parent, const GUI::Font& font, GuiObject* boss, int max_w, int max_h) : Dialog(osystem, parent, font, "User interface settings"), CommandSender(boss), - myFont(font), - myIsGlobal(boss != nullptr) + myFont{font}, + myIsGlobal{boss != nullptr} { const GUI::Font& ifont = instance().frameBuffer().infoFont(); const int lineHeight = font.getLineHeight(), diff --git a/src/gui/UndoHandler.cxx b/src/gui/UndoHandler.cxx index f8eeb0c48..4246d2f7f 100644 --- a/src/gui/UndoHandler.cxx +++ b/src/gui/UndoHandler.cxx @@ -19,7 +19,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - UndoHandler::UndoHandler(size_t size) - : mySize(size) + : mySize{size} { reset(); } diff --git a/src/gui/VideoAudioDialog.hxx b/src/gui/VideoAudioDialog.hxx index f0d376140..25a78baa5 100644 --- a/src/gui/VideoAudioDialog.hxx +++ b/src/gui/VideoAudioDialog.hxx @@ -66,7 +66,7 @@ class VideoAudioDialog : public Dialog void updateSettingsWithPreset(AudioSettings&); private: - TabWidget* myTab; + TabWidget* myTab{nullptr}; // General options PopUpWidget* myRenderer{nullptr}; diff --git a/src/gui/Widget.cxx b/src/gui/Widget.cxx index 7f605a6ea..4e11b59ff 100644 --- a/src/gui/Widget.cxx +++ b/src/gui/Widget.cxx @@ -32,8 +32,8 @@ Widget::Widget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h) : GuiObject(boss->instance(), boss->parent(), boss->dialog(), x, y, w, h), - _boss(boss), - _font(font) + _boss{boss}, + _font{font} { // Insert into the widget list of the boss _next = _boss->_firstWidget; @@ -395,8 +395,8 @@ StaticTextWidget::StaticTextWidget(GuiObject* boss, const GUI::Font& font, const string& text, TextAlign align, ColorId shadowColor) : Widget(boss, font, x, y, w, h), - _label(text), - _align(align) + _label{text}, + _align{align} { _flags = Widget::FLAG_ENABLED | FLAG_CLEARBG; @@ -464,8 +464,8 @@ ButtonWidget::ButtonWidget(GuiObject* boss, const GUI::Font& font, const string& label, int cmd, bool repeat) : StaticTextWidget(boss, font, x, y, w, h, label, TextAlign::Center), CommandSender(boss), - _cmd(cmd), - _repeat(repeat) + _cmd{cmd}, + _repeat{repeat} { _flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG; _bgcolor = kBtnColor; @@ -739,11 +739,11 @@ SliderWidget::SliderWidget(GuiObject* boss, const GUI::Font& font, int valueLabelWidth, const string& valueUnit, int valueLabelGap, bool forceLabelSign) : ButtonWidget(boss, font, x, y, w, h, label, cmd), - _labelWidth(labelWidth), - _valueUnit(valueUnit), - _valueLabelGap(valueLabelGap), - _valueLabelWidth(valueLabelWidth), - _forceLabelSign(forceLabelSign) + _labelWidth{labelWidth}, + _valueUnit{valueUnit}, + _valueLabelGap{valueLabelGap}, + _valueLabelWidth{valueLabelWidth}, + _forceLabelSign{forceLabelSign} { _flags = Widget::FLAG_ENABLED | Widget::FLAG_TRACK_MOUSE | Widget::FLAG_CLEARBG; _bgcolor = kDlgColor; diff --git a/src/libretro/FBSurfaceLIBRETRO.hxx b/src/libretro/FBSurfaceLIBRETRO.hxx index 7578ca658..b00fea94d 100644 --- a/src/libretro/FBSurfaceLIBRETRO.hxx +++ b/src/libretro/FBSurfaceLIBRETRO.hxx @@ -64,7 +64,7 @@ class FBSurfaceLIBRETRO : public FBSurface void applyAttributes() override { } private: - uInt32 myWidth, myHeight; + uInt32 myWidth{0}, myHeight{0}; unique_ptr myPixelData; Common::Rect mySrcGUIR, myDstGUIR; diff --git a/src/libretro/StellaLIBRETRO.hxx b/src/libretro/StellaLIBRETRO.hxx index d4ae39c87..3b76a93e3 100644 --- a/src/libretro/StellaLIBRETRO.hxx +++ b/src/libretro/StellaLIBRETRO.hxx @@ -43,7 +43,7 @@ class StellaLIBRETRO StellaLIBRETRO(); public: - OSystemLIBRETRO& osystem() { return *myOSystem; } + OSystemLIBRETRO& osystem() const { return *myOSystem; } bool create(bool logging); void destroy(); diff --git a/src/unix/FSNodePOSIX.cxx b/src/unix/FSNodePOSIX.cxx index c49d7d1ce..1ef2b684b 100644 --- a/src/unix/FSNodePOSIX.cxx +++ b/src/unix/FSNodePOSIX.cxx @@ -25,8 +25,8 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FilesystemNodePOSIX::FilesystemNodePOSIX() - : _path(ROOT_DIR), - _displayName(_path) + : _path{ROOT_DIR}, + _displayName{_path} { } diff --git a/src/windows/FSNodeWINDOWS.cxx b/src/windows/FSNodeWINDOWS.cxx index 82182fe83..179476b27 100644 --- a/src/windows/FSNodeWINDOWS.cxx +++ b/src/windows/FSNodeWINDOWS.cxx @@ -175,7 +175,7 @@ FilesystemNodeWINDOWS::FilesystemNodeWINDOWS() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FilesystemNodeWINDOWS::FilesystemNodeWINDOWS(const string& p) - : _path(p.length() > 0 ? p : "~") // Default to home directory + : _path{p.length() > 0 ? p : "~"} // Default to home directory { // Expand '~' to the users 'home' directory if(_path[0] == '~') From 7a07650556d3d3c190bcec5c56cd86c2d6ee196c Mon Sep 17 00:00:00 2001 From: thrust26 Date: Mon, 21 Dec 2020 09:14:42 +0100 Subject: [PATCH 03/13] limited redraw debug output to DEBUG_BUILD --- src/emucore/FrameBuffer.cxx | 2 ++ src/gui/Dialog.cxx | 12 +++++++++--- src/gui/DialogContainer.cxx | 8 ++++++-- src/gui/PopUpWidget.cxx | 1 - src/gui/TimeLineWidget.cxx | 2 -- src/gui/Widget.cxx | 4 ++++ 6 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/emucore/FrameBuffer.cxx b/src/emucore/FrameBuffer.cxx index 670e33f8c..4f6006e49 100644 --- a/src/emucore/FrameBuffer.cxx +++ b/src/emucore/FrameBuffer.cxx @@ -739,8 +739,10 @@ inline bool FrameBuffer::drawMessage() if(myMsg.dirty) { + #ifdef DEBUG_BUILD cerr << "m"; //cerr << "--- draw message ---" << endl; + #endif // Draw the bounded box and text const Common::Rect& dst = myMsg.surface->dstRect(); diff --git a/src/gui/Dialog.cxx b/src/gui/Dialog.cxx index 72bdc398a..95107b7b3 100644 --- a/src/gui/Dialog.cxx +++ b/src/gui/Dialog.cxx @@ -244,7 +244,9 @@ void Dialog::redraw(bool force) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Dialog::render() { +#ifdef DEBUG_BUILD //cerr << " render " << typeid(*this).name() << endl; +#endif // Update dialog surface; also render any extra surfaces // Extra surfaces must be rendered afterwards, so they are drawn on top @@ -263,8 +265,6 @@ void Dialog::render() if(!onTop) { - //cerr << " shade " << typeid(*this).name() << endl; - _shadeSurface->setDstRect(_surface->dstRect()); _shadeSurface->render(); } @@ -433,8 +433,10 @@ void Dialog::drawDialog() if(isDirty()) { - cerr << endl << "d"; + #ifdef DEBUG_BUILD //cerr << "*** draw dialog " << typeid(*this).name() << " ***" << endl; + cerr << endl << "d"; + #endif if(clearsBackground()) { @@ -453,7 +455,9 @@ void Dialog::drawDialog() } else { s.invalidate(); + #ifdef DEBUG_BUILD //cerr << "invalidate " << typeid(*this).name() << endl; + #endif } if(hasBorder()) // currently only used by Dialog itself s.frameRect(_x, _y, _w, _h, kColor); @@ -463,8 +467,10 @@ void Dialog::drawDialog() clearDirty(); } +#ifdef DEBUG_BUILD else cerr << endl; +#endif // Draw all children drawChain(); diff --git a/src/gui/DialogContainer.cxx b/src/gui/DialogContainer.cxx index c421cb430..b4307aa45 100644 --- a/src/gui/DialogContainer.cxx +++ b/src/gui/DialogContainer.cxx @@ -94,8 +94,9 @@ void DialogContainer::draw(bool full) { if(myDialogStack.empty()) return; - +#ifdef DEBUG_BUILD //cerr << "draw " << full << " " << typeid(*this).name() << endl; +#endif // Draw and render all dirty dialogs myDialogStack.applyAll([&](Dialog*& d) { @@ -118,8 +119,9 @@ void DialogContainer::render() { if(myDialogStack.empty()) return; - +#ifdef DEBUG_BUILD //cerr << "full re-render " << typeid(*this).name() << endl; +#endif // Make sure we start in a clean state (with zero'ed buffers) if(!myOSystem.eventHandler().inTIAMode()) @@ -171,7 +173,9 @@ void DialogContainer::removeDialog() { if(!myDialogStack.empty()) { + #ifdef DEBUG_BUILD //cerr << "remove dialog " << typeid(*myDialogStack.top()).name() << endl; + #endif myDialogStack.pop(); // Inform the frame buffer that it has to render all surfaces diff --git a/src/gui/PopUpWidget.cxx b/src/gui/PopUpWidget.cxx index 762ce3bf8..0bdd2e552 100644 --- a/src/gui/PopUpWidget.cxx +++ b/src/gui/PopUpWidget.cxx @@ -247,7 +247,6 @@ void PopUpWidget::setArrow() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void PopUpWidget::drawWidget(bool hilite) { -//cerr << "PopUpWidget::drawWidget\n"; FBSurface& s = dialog().surface(); int x = _x + _labelWidth; diff --git a/src/gui/TimeLineWidget.cxx b/src/gui/TimeLineWidget.cxx index 3018bb40c..23d50d542 100644 --- a/src/gui/TimeLineWidget.cxx +++ b/src/gui/TimeLineWidget.cxx @@ -143,8 +143,6 @@ void TimeLineWidget::drawWidget(bool hilite) { FBSurface& s = _boss->dialog().surface(); - //cerr << "TimeLineWidget::drawWidget " << typeid(s).name() << endl; - // Draw the label, if any if(_labelWidth > 0) s.drawString(_font, _label, _x, _y + 2, _labelWidth, diff --git a/src/gui/Widget.cxx b/src/gui/Widget.cxx index 4e11b59ff..2d4a4c135 100644 --- a/src/gui/Widget.cxx +++ b/src/gui/Widget.cxx @@ -99,8 +99,10 @@ void Widget::draw() if(isDirty()) { + #ifdef DEBUG_BUILD //cerr << " *** draw widget " << typeid(*this).name() << " ***" << endl; cerr << "w"; + #endif FBSurface& s = _boss->dialog().surface(); int oldX = _x, oldY = _y; @@ -383,7 +385,9 @@ void Widget::setDirtyInChain(Widget* start) { while(start) { + #ifdef DEBUG_BUILD //cerr << "setDirtyInChain " << typeid(*start).name() << endl; + #endif start->setDirty(); start = start->_next; } From e0eafb75a4258ee72acf7109df67a3d505fd0887 Mon Sep 17 00:00:00 2001 From: thrust26 Date: Mon, 21 Dec 2020 10:24:12 +0100 Subject: [PATCH 04/13] update docs (Launcher keys, upper case hotkeys) --- docs/index.html | 242 ++++++++++++++++++++++++++---------------------- 1 file changed, 133 insertions(+), 109 deletions(-) diff --git a/docs/index.html b/docs/index.html index 23ed6905a..f679feab6 100644 --- a/docs/index.html +++ b/docs/index.html @@ -644,8 +644,8 @@ Exit emulator - Control + q - Cmd + q + Control + Q + Cmd + Q @@ -771,7 +771,7 @@ Pause/resume emulation Pause - Shift-Cmd + p + Shift-Cmd + P @@ -1377,8 +1377,8 @@ Toggle adapting display refresh rate to game frame rate
Note: Not available for macOS. - Alt + r - Cmd + r + Alt + R + Cmd + R Decrease overscan in fullscreen mode @@ -1402,8 +1402,8 @@ Toggle aspect ratio correct scaling - Control + c - Control + c + Control + C + Control + C Decrease vertical display size @@ -1417,18 +1417,18 @@ Switch to previous display format (NTSC/PAL/SECAM etc.) - Shift-Control + f - Shift-Control + f + Shift-Control + F + Shift-Control + F Switch to next display format (NTSC/PAL/SECAM etc.) - Control + f - Control + f + Control + F + Control + F Toggle display interpolation - Control + i - Control + i + Control + I + Control + I
@@ -1447,14 +1447,14 @@ Select previous palette (Standard/z26/User/Custom) - Shift-Control + p - Shift-Control + p + Shift-Control + P + Shift-Control + P Select next palette (Standard/z26/User/Custom) - Control + p - Control + p + Control + P + Control + P @@ -1527,8 +1527,8 @@ Toggle 'phosphor' mode - Alt + p - Cmd + p + Alt + P + Cmd + P Decrease 'phosphor' blend @@ -1627,13 +1627,13 @@ Decrease autofire rate - Shift-Control + a - Shift-Control + a + Shift-Control + A + Shift-Control + A Increase autofire rate - Control + a - Control + a + Control + A + Control + A @@ -1716,8 +1716,8 @@ Toggle grab mouse - Control + g - Control + g + Control + G + Control + G @@ -1823,38 +1823,38 @@ Toggle TIA Player0 object - Alt + z - Cmd + z + Alt + Z + Cmd + Z Toggle TIA Player1 object - Alt + x - Cmd + x + Alt + X + Cmd + X Toggle TIA Missile0 object - Alt + c - Cmd + c + Alt + C + Cmd + C Toggle TIA Missile1 object - Alt + v - Cmd + v + Alt + V + Cmd + V Toggle TIA Ball object - Alt + b - Cmd + b + Alt + B + Cmd + B Toggle TIA Playfield object - Alt + n - Cmd + n + Alt + N + Cmd + N @@ -1865,38 +1865,38 @@ Toggle TIA Player0 collisions - Shift-Alt + z - Shift-Cmd + z + Shift-Alt + Z + Shift-Cmd + Z Toggle TIA Player1 collisions - Shift-Alt + x - Shift-Cmd + x + Shift-Alt + X + Shift-Cmd + X Toggle TIA Missile0 collisions - Shift-Alt + c - Shift-Cmd + c + Shift-Alt + C + Shift-Cmd + C Toggle TIA Missile1 collisions - Shift-Alt + v - Shift-Cmd + v + Shift-Alt + V + Shift-Cmd + V Toggle TIA Ball collisions - Shift-Alt + b - Shift-Cmd + b + Shift-Alt + B + Shift-Cmd + B Toggle TIA Playfield collisions - Shift-Alt + n - Shift-Cmd + n + Shift-Alt + N + Shift-Cmd + N @@ -1919,8 +1919,8 @@ Toggle TV 'Jitter' effect - Alt + j - Cmd + j + Alt + J + Cmd + J
@@ -1988,14 +1988,14 @@ Load previous game in ROM (multicart ROM) - Shift-Control + r - Shift-Control + r + Shift-Control + R + Shift-Control + R Reload current ROM (singlecart ROM)
Load next game in ROM (multicart ROM) - Control + r - Control + r + Control + R + Control + R Emulate 'frying' effect @@ -2004,29 +2004,29 @@ Decrease emulation speed (disables 'Turbo' mode) - Shift-Control + s - Shift-Control + s + Shift-Control + S + Shift-Control + S Increase emulation speed (disables 'Turbo' mode) - Control + s - Control + s + Control + S + Control + S Toggle 'Turbo' mode (maximum emulation speed) - Control + t - Control + t + Control + T + Control + T Save continuous PNG snapshots
(per interval defined in Snapshot Settings) - Control-Alt + s - Control-Cmd + s + Control-Alt + S + Control-Cmd + S Save continuous PNG snapshots (every frame) - Shift-Control-Alt + s - Shift-Control-Cmd + s + Shift-Control-Alt + S + Shift-Control-Cmd + S Open the High Scores dialog. @@ -2035,13 +2035,13 @@ Toggle 'Time Machine' mode - Alt + t - Cmd + t + Alt + T + Cmd + T Enter/Exit the Time Machine dialog - Shift + t to enter, Shift + t/Escape to exit and continue with emulation - Shift + t to enter, Shift + t/Escape to exit and continue with emulation + Shift + T to enter, Shift + T/Escape to exit and continue with emulation + Shift + T to enter, Shift + T/Escape to exit and continue with emulation Playback the Time Machine from current state (without sound, from the TM dialog only) @@ -2168,11 +2168,6 @@ Control + Tab Control + Tab - - Go to parent directory - Backspace - Backspace - Toggle windowed/fullscreen mode Alt + Return @@ -2180,8 +2175,37 @@ Exit emulator - Control + q - Cmd + q + Control + Q + Cmd + Q + + + +

Additional Launcher Keys (cannot be remapped)

+ + + + + + + + + + + + + + + + + + + + + + + + +
FunctionKey (Standard)Key (macOS)
Go to parent directory (also in other file dialogs)BackspaceBackspace
Open Power-On options dialogControl + PControl + P
Open High Scores dialog (if available for selected ROM)Control + HControl + H
Reload ROM listingControl + RControl + R
@@ -2216,12 +2240,12 @@ Move cursor to beginning of line Home - Home, Control + a, Command + Left arrow + Home, Control + A, Command + Left arrow Move cursor to end of line End - End, Control + e, Command + Right arrow + End, Control + E, Command + Right arrow Delete character to left of cursor @@ -2230,28 +2254,28 @@ Delete character to right of cursor - Delete, Control + d - Delete, Control + d + Delete, Control + D + Delete, Control + D Delete word to left of cursor - Control + Backspace, Control + w - Option + Backspace, Control + w + Control + Backspace, Control + W + Option + Backspace, Control + W Delete word to right of cursor - Control + Delete, Alt + d + Control + Delete, Alt + D Option + Delete Delete all text to beginning of line - Control + Home, Control + u - Command + Backspace, Control + u + Control + Home, Control + U + Command + Backspace, Control + U Delete all text to end of line - Control + End, Control + k - Control + k + Control + End, Control + K + Control + K Select character to left of cursor @@ -2276,42 +2300,42 @@ Select all text to beginning of line Shift + Home - Shift + Home, Shift-Control + a, Shift-Command + Left arrow + Shift + Home, Shift-Control + A, Shift-Command + Left arrow Select all text to end of line Shift + End - Shift + End, Shift-Control + e, Shift-Command + Right arrow + Shift + End, Shift-Control + E, Shift-Command + Right arrow Select all text - Control + a - Command + a + Control + A + Command + A Cut selected text - Control + x, Shift + Delete - Command + x + Control + X, Shift + Delete + Command + X Copy selected text - Control + c, Control + Insert - Command + c + Control + C, Control + Insert + Command + C Paste at cursor and replace selection - Control + v, Shift + Insert - Command + v + Control + V, Shift + Insert + Command + V Undo last operation - Control + z - Command + z + Control + Z + Command + Z Redo last operation - Control + y, Shift-Control + z - Command + y, Shift-Command + z + Control + Y, Shift-Control + Z + Command + Y, Shift-Command + Z
@@ -2939,12 +2963,12 @@
-modcombo <1|0>
- Use modifier(Shift/Alt/Control) + x key combos. This is normally enabled, - since the 'Quit' command is tied to 'Control + q'. However, there are times + Use modifier (Shift/Alt/Control/Cmd) + x key combos. This is normally enabled, + since the 'Quit' command is tied to 'Control + Q'. However, there are times when you want to disable them.
- E.g. a 2-player game is using either the 'f' or 'r' keys for movement, + E.g. a 2-player game is using either the 'F' or 'R' keys for movement, and pressing Control (for Fire) will perform an unwanted action - associated with 'Control + r' or 'Control + f' default keys. + associated with 'Control + R' or 'Control + F' default keys. @@ -3881,7 +3905,7 @@ Clicking 'Combo' will show a dialog similar to the following:

In this dialog, you can assign various events to the selected combo event. - Note that this simply assigns multiple events to the combo; you still need + Note that this only assigns multiple events to the combo; you still need to map the combo event itself to some action, as described in the 'remap an event' section above.

@@ -4034,14 +4058,14 @@ -

This dialog can also be opened by pressing 'Control + p'.

+

This dialog can also be opened by pressing 'Control + P'.

  • High scores: This option displays the High Scores dialog for the selected ROM. Only available if high score - properties have been setup for the ROM. Also available via 'Control + h' keys combo.
  • + properties have been setup for the ROM. Also available via 'Control + H' keys combo.
  • Reload listing: Selecting this performs a reload of the - current listing. It is an alternative to pressing the 'Control + r' + current listing. It is an alternative to pressing the 'Control + R' key combo.

  • From 93e0ad860a40f7d2acdf8358cade9ab514785a1f Mon Sep 17 00:00:00 2001 From: thrust26 Date: Mon, 21 Dec 2020 10:24:38 +0100 Subject: [PATCH 05/13] fixed missing GameInfoDialog save button --- src/gui/GameInfoDialog.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/GameInfoDialog.cxx b/src/gui/GameInfoDialog.cxx index 992c9a09b..113569c0c 100644 --- a/src/gui/GameInfoDialog.cxx +++ b/src/gui/GameInfoDialog.cxx @@ -92,7 +92,7 @@ GameInfoDialog::GameInfoDialog( myTab->setActiveTab(0); // Add Defaults, OK and Cancel buttons - addDefaultsOKCancelBGroup(wid, font); + addDefaultsExtraOKCancelBGroup(wid, font, "Save", kSavePressed); addBGroupToFocusList(wid); } From 03efb385758e4277dc3e40ca30a2447004894f27 Mon Sep 17 00:00:00 2001 From: thrust26 Date: Mon, 21 Dec 2020 10:30:30 +0100 Subject: [PATCH 06/13] updated doc for missing GameInfoDialog save button --- docs/graphics/options_gameinfo_highscores.png | Bin 3477 -> 3556 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/docs/graphics/options_gameinfo_highscores.png b/docs/graphics/options_gameinfo_highscores.png index f88bc399d23b4f7f764f762faf0da3e8cddc9f7e..6d18323e5ef682e78b22411ad804fc9b311ededf 100644 GIT binary patch delta 3462 zcmZ8jc{J4R+b1ch$=(Q=M=DE2WhF?@$H^YVM&Kc4r!&$-XJ?(4p;bFOor&*yW0o+^G<%m@ZMgoO5Y z2+OJe87CwJv$Hn8;BcSH%)S1EQ6`;yw@cACM%3$yInwB`*U(=1l*m(x>dxOyZ!7n@ ztV%^n?lFb89DNK%ws`NABNhJthCFWoM_QZb2MhBsB zA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+f`O?20ySmj{KIGIx`#c=!BWsPSFnU=*N$lQHm?|)ergfO$b<49{=*?K(PlK zDvI~07!at4p{Bler#tf?@wTW-%#=syrIEf0ZH3)9=XE4m!?^VEXh z#NED7(7+gPxgvW7EzE3%DNrWu_EnJ(>2_n;o$3eCA%!nI?})1}ChD0g=TM`3vw}bJt+_+)5lJ=X=dq zvYEQt%Ku$+HF?s{m4l-H$G>?^loY_v&bc{hH{^Bx$)jg4pv8z?eVhRwdD>+(4G%oa z;p4E3NRKA^&5aFU$on!PjT|v546}_=1CQkxUR=X?6k9JchI!O;N5Qoh#U;($53ore z>Hs!G1OHu>gNdr>Ry>pht7=FT z92bY1NxTfX+U^#lpF91;^TT|An9U~6QH&*pO%RmDHzhHloA^!y zas)PjJDq5v?Jf0*Bht&ZlCB;Jp%D*p6`V+<+0LK6i{iq$?Lz+etgV#VsXHyM<#6Mt zbx9L}=-*F#n!|@AApFzBCHd#^FWKVqlwU&sKRNYj9maHuKo9|9 Date: Mon, 21 Dec 2020 12:05:46 +0100 Subject: [PATCH 07/13] minor hotkey updates to debugger doc --- docs/debugger.html | 54 +++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/docs/debugger.html b/docs/debugger.html index bc0329c0f..689e5d958 100644 --- a/docs/debugger.html +++ b/docs/debugger.html @@ -223,7 +223,7 @@ present in the debugger):

    For space reasons, the Prompt, TIA, I/O and Audio displays are split into 4 tabs, only one of which is visible at a time. You can use the mouse or keyboard to select which tab you want to view. Control/Cmd + Tab cycles between -tabs from left-to-right, Shift + Control/Cmd + Tab cycles right-to-left. +tabs from left-to-right, Shift-Control/Cmd + Tab cycles right-to-left. Pressing Tab (or Shift + Tab) cycles between widgets in the current tab (except for in the Prompt Tab, where 'tab' is used for something else).

    @@ -339,7 +339,7 @@ previous rewind operation. The rewind buffer is 100 levels deep by default, the size can be configured e.g. in the Developer Settings - Time Machine dialog.

    -

    The other operations are Step, Trace, Scan+1, Frame+1 and Run.

    +

    The other operations are Step, Trace, Scan +1, Frame +1 and Run.

    You can also use the buttons from anywhere in the GUI via hotkeys.

    @@ -349,48 +349,48 @@ size can be configured e.g. in the Function - Control-s + Control + S Step - Control-t + Control + T Trace - Control-L - Scan+1 + Control + L + Scan +1 - Control-f - Frame+1 + Control + F + Frame +1 - Alt-Left arrow + Alt + Left arrow Rewind 1 - Shift-Alt-Left arrow + Shift-Alt + Left arrow Rewind 10 - Alt-Down arrow + Alt + Down arrow Rewind all - Alt-Right arrow + Alt + Right arrow Unwind 1 - Shift-Alt-Right arrow + Shift-Alt + Right arrow Unwind 10 - Alt-Up arrow + Alt + Up arrow Unwind all Backquote (`) - Run + Run, exits debugger

    @@ -433,18 +433,18 @@ Bash-style commands are also supported:

    EndMove cursor to end of line DeleteRemove character to right of cursor BackspaceRemove character to left of cursor - Control-aSame function as 'Home' - Control-eSame function as 'End' - Control-dSame function as 'Delete' - Control-kRemove all characters from cursor to end of line - Control-uRemove all characters from cursor to beginning of line - Control-wRemove entire word to left of cursor - Shift-PgUpScroll up through previous commands one screen/page - Shift-PgDownScroll down through previous commands one screen/page - Shift-UpScroll up through previous commands one line - Shift-DownScroll down through previous commands one line - Shift-HomeScroll to beginning of commands - Shift-EndScroll to end of commands + Control + ASame function as 'Home' + Control + ESame function as 'End' + Control + DSame function as 'Delete' + Control + KRemove all characters from cursor to end of line + Control + URemove all characters from cursor to beginning of line + Control + WRemove entire word to left of cursor + Shift + PgUpScroll up through previous commands one screen/page + Shift + PgDownScroll down through previous commands one screen/page + Shift + UpScroll up through previous commands one line + Shift + DownScroll down through previous commands one line + Shift + HomeScroll to beginning of commands + Shift + EndScroll to end of commands

    You can also scroll with the mouse. Copy and paste is not yet supported.

    From d4eb9535ef2de564ec7fbb97daeab3db1d16f511 Mon Sep 17 00:00:00 2001 From: thrust26 Date: Mon, 21 Dec 2020 13:31:42 +0100 Subject: [PATCH 08/13] fixed broken joystick mapping loading --- src/common/PJoystickHandler.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/PJoystickHandler.hxx b/src/common/PJoystickHandler.hxx index 017479ceb..444ef1a6a 100644 --- a/src/common/PJoystickHandler.hxx +++ b/src/common/PJoystickHandler.hxx @@ -50,7 +50,7 @@ class PhysicalJoystickHandler struct StickInfo { StickInfo(const nlohmann::json& map = nullptr, PhysicalJoystickPtr stick = nullptr) - : mapping{map}, joy{std::move(stick)} { } + : mapping(map), joy{std::move(stick)} { } nlohmann::json mapping; PhysicalJoystickPtr joy; From 8655e5233005515d7f6e98dd2a8de97718bd8587 Mon Sep 17 00:00:00 2001 From: thrust26 Date: Mon, 21 Dec 2020 17:37:10 +0100 Subject: [PATCH 09/13] removed default, just to be sure --- src/common/PJoystickHandler.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/PJoystickHandler.hxx b/src/common/PJoystickHandler.hxx index 444ef1a6a..0d683e9aa 100644 --- a/src/common/PJoystickHandler.hxx +++ b/src/common/PJoystickHandler.hxx @@ -49,8 +49,8 @@ class PhysicalJoystickHandler private: struct StickInfo { - StickInfo(const nlohmann::json& map = nullptr, PhysicalJoystickPtr stick = nullptr) - : mapping(map), joy{std::move(stick)} { } + StickInfo(const nlohmann::json map, PhysicalJoystickPtr stick = nullptr) + : mapping(map), joy{std::move(stick)} {} nlohmann::json mapping; PhysicalJoystickPtr joy; From 1d90b3caec6a148624c84f2d2cc1aa8e8072c128 Mon Sep 17 00:00:00 2001 From: thrust26 Date: Mon, 21 Dec 2020 18:06:33 +0100 Subject: [PATCH 10/13] ...and removed the const too --- src/common/PJoystickHandler.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/PJoystickHandler.hxx b/src/common/PJoystickHandler.hxx index 0d683e9aa..6a23f923b 100644 --- a/src/common/PJoystickHandler.hxx +++ b/src/common/PJoystickHandler.hxx @@ -49,7 +49,7 @@ class PhysicalJoystickHandler private: struct StickInfo { - StickInfo(const nlohmann::json map, PhysicalJoystickPtr stick = nullptr) + StickInfo(nlohmann::json map, PhysicalJoystickPtr stick = nullptr) : mapping(map), joy{std::move(stick)} {} nlohmann::json mapping; From 0f07304473093e98ecbb41b85053ebed8765c6f6 Mon Sep 17 00:00:00 2001 From: thrust26 Date: Mon, 21 Dec 2020 18:50:54 +0100 Subject: [PATCH 11/13] fixed(?) libretro/Makefile --- src/libretro/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libretro/Makefile b/src/libretro/Makefile index 6f8eb6599..e7cbe3b26 100644 --- a/src/libretro/Makefile +++ b/src/libretro/Makefile @@ -101,7 +101,7 @@ else ifeq ($(platform), libnx) include $(DEVKITPRO)/libnx/switch_rules TARGET := $(TARGET_NAME)_libretro_$(platform).a DEFINES := -DSWITCH=1 -D__SWITCH__ -DARM - CXXFLAGS := $(DEFINES) -fPIE -I$(LIBNX)/include/ -ffunction-sections -fdata-sections -ftls-model=local-exec -specs=$(LIBNX)/switch.specs + CXXFLAGS += $(DEFINES) -fPIE -I$(LIBNX)/include/ -ffunction-sections -fdata-sections -ftls-model=local-exec -specs=$(LIBNX)/switch.specs CXXFLAGS += -march=armv8-a -mtune=cortex-a57 -mtp=soft -mcpu=cortex-a57+crc+fp+simd -ffast-math $(ASFLAGS) STATIC_LINKING = 1 From cd811579e424c0f77235cfe449487093a4291190 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Mon, 21 Dec 2020 22:33:55 -0330 Subject: [PATCH 12/13] Added C++ compatible string search functions to BSPF. This allows us to remove strcmp, stricmp, strcasecmp, etc, which are non-standard and C-style functions. --- src/common/bspf.hxx | 83 +++++++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 48 deletions(-) diff --git a/src/common/bspf.hxx b/src/common/bspf.hxx index 636906c9b..d43080b7e 100644 --- a/src/common/bspf.hxx +++ b/src/common/bspf.hxx @@ -47,6 +47,7 @@ using uInt64 = uint64_t; #include #include #include +#include #include #include #include @@ -60,6 +61,7 @@ using std::cout; using std::cerr; using std::endl; using std::string; +using std::string_view; using std::istream; using std::ostream; using std::fstream; @@ -200,51 +202,47 @@ namespace BSPF catch(...) { return defaultValue; } } - // Compare two strings, ignoring case - inline int compareIgnoreCase(const string& s1, const string& s2) + // Compare two strings (case insensitive) + // Return negative, zero, positive result for <,==,> respectively + static constexpr int compareIgnoreCase(string_view s1, string_view s2) { - #if (defined BSPF_WINDOWS || defined __WIN32__) && !defined __GNUG__ - return _stricmp(s1.c_str(), s2.c_str()); - #else - return strcasecmp(s1.c_str(), s2.c_str()); - #endif - } - inline int compareIgnoreCase(const char* s1, const char* s2) - { - #if (defined BSPF_WINDOWS || defined __WIN32__) && !defined __GNUG__ - return _stricmp(s1, s2); - #else - return strcasecmp(s1, s2); - #endif - } + // Only compare up to the length of the shorter string + const auto maxsize = std::min(s1.size(), s2.size()); + for(size_t i = 0; i < maxsize; ++i) + if(toupper(s1[i]) != toupper(s2[i])) + return toupper(s1[i]) - toupper(s2[i]); - // Test whether the first string starts with the second one (case insensitive) - inline bool startsWithIgnoreCase(const string& s1, const string& s2) - { - #if (defined BSPF_WINDOWS || defined __WIN32__) && !defined __GNUG__ - return _strnicmp(s1.c_str(), s2.c_str(), s2.length()) == 0; - #else - return strncasecmp(s1.c_str(), s2.c_str(), s2.length()) == 0; - #endif - } - inline bool startsWithIgnoreCase(const char* s1, const char* s2) - { - #if (defined BSPF_WINDOWS || defined __WIN32__) && !defined __GNUG__ - return _strnicmp(s1, s2, strlen(s2)) == 0; - #else - return strncasecmp(s1, s2, strlen(s2)) == 0; - #endif + // Otherwise the length of the string takes priority + return static_cast(s1.size() - s2.size()); } // Test whether two strings are equal (case insensitive) - inline bool equalsIgnoreCase(const string& s1, const string& s2) + inline constexpr bool equalsIgnoreCase(string_view s1, string_view s2) { - return compareIgnoreCase(s1, s2) == 0; + return s1.size() == s2.size() ? (compareIgnoreCase(s1, s2) == 0) : false; + } + + // Test whether the first string starts with the second one (case insensitive) + inline constexpr bool startsWithIgnoreCase(string_view s1, string_view s2) + { + if(s1.size() >= s2.size()) + return compareIgnoreCase(s1.substr(0, s2.size()), s2) == 0; + + return false; + } + + // Test whether the first string ends with the second one (case insensitive) + inline constexpr bool endsWithIgnoreCase(string_view s1, string_view s2) + { + if(s1.size() >= s2.size()) + return compareIgnoreCase(s1.substr(s1.size() - s2.size()), s2) == 0; + + return false; } // Find location (if any) of the second string within the first, // starting from 'startpos' in the first string - inline size_t findIgnoreCase(const string& s1, const string& s2, size_t startpos = 0) + static size_t findIgnoreCase(const string& s1, const string& s2, size_t startpos = 0) { auto pos = std::search(s1.cbegin()+startpos, s1.cend(), s2.cbegin(), s2.cend(), [](char ch1, char ch2) { @@ -253,17 +251,6 @@ namespace BSPF return pos == s1.cend() ? string::npos : pos - (s1.cbegin()+startpos); } - // Test whether the first string ends with the second one (case insensitive) - inline bool endsWithIgnoreCase(const string& s1, const string& s2) - { - if(s1.length() >= s2.length()) - { - const char* end = s1.c_str() + s1.length() - s2.length(); - return compareIgnoreCase(end, s2.c_str()) == 0; - } - return false; - } - // Test whether the first string contains the second one (case insensitive) inline bool containsIgnoreCase(const string& s1, const string& s2) { @@ -275,12 +262,12 @@ namespace BSPF // - the following characters must appear in the order of the first string inline bool matches(const string& s1, const string& s2) { - if(BSPF::startsWithIgnoreCase(s1, s2.substr(0, 1))) + if(startsWithIgnoreCase(s1, s2.substr(0, 1))) { size_t pos = 1; for(uInt32 j = 1; j < s2.size(); ++j) { - size_t found = BSPF::findIgnoreCase(s1, s2.substr(j, 1), pos); + size_t found = findIgnoreCase(s1, s2.substr(j, 1), pos); if(found == string::npos) return false; pos += found + 1; From 7bf2f2b3c3c40b6e136e7af023dd6ab64f3d1730 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Mon, 21 Dec 2020 22:44:36 -0330 Subject: [PATCH 13/13] Updated changelog. --- Changes.txt | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Changes.txt b/Changes.txt index 013c1a57c..2f733a6e3 100644 --- a/Changes.txt +++ b/Changes.txt @@ -16,15 +16,15 @@ * Added high scores saving. - * Enhanced cut/copy/paste for text editing (except PromptWidget). + * Improved text editing functionality (except PromptWidget): + - Enhanced selection and cut/copy/paste from keyboard. + - Added undo and redo support. + - Added mouse support (selection, cut/copy/paste). + - All actions have keyboard shortcuts. - * Added undo and redo to text editing (except PromptWidget). - - * Added mouse support for text editing (except PromptWidget). - - * Added wildcard support to launcher dialog filter. - - * Added option to search subdirectories in launcher. + * Various improvements to the ROM launcher: + - Added wildcard support to the dialog filter + - Added option to search subdirectories * Added static tooltips to some UI items. @@ -41,7 +41,8 @@ * Fixed Stelladaptor/2600'daptor devices sometimes not being assigned correct default mappings. - * Codebase now uses C++17 features. + * Codebase now uses C++17 features, which means a minimum of gcc7 + or clang5 for Linux/Mac, and Visual Studio 2019 for Windows. -Have fun!