From 5bc8d2d1b094faa782186b285a03c227a9233be9 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Sun, 5 Aug 2018 19:14:07 -0230 Subject: [PATCH] When starting Stella for the first time, the first ROM chosen determines 'romdir' (fixes #324) Bumped version for upcoming release. Updated changelog, various grammatical fixes. --- Changes.txt | 25 ++++++++++++---------- src/common/Version.hxx | 4 ++-- src/gui/LauncherDialog.cxx | 43 +++++++------------------------------- src/gui/LauncherDialog.hxx | 8 ++----- 4 files changed, 26 insertions(+), 54 deletions(-) diff --git a/Changes.txt b/Changes.txt index 845bd1416..0a0fe01cc 100644 --- a/Changes.txt +++ b/Changes.txt @@ -12,29 +12,29 @@ Release History =========================================================================== -5.1.3 to 5.2: (MMM d, 2018) +5.1.3 to 6.0: (MMM d, 2018) * New cycle exact audio core based on work by Chris Brenner (crispy); greatly - improved audio emulation accuracy (i.e. E.T., Ms. Pacman) + improved audio emulation accuracy (i.e. E.T., Ms. Pacman). * Full rewrite of the audio subsystem; resample TIA output to target sample - rate directly in Stella + rate directly in Stella. - * Threading: decouple emulation from frame rendering + * Threading: decouple emulation from frame rendering. * Main loop rewritten; emulating speed and timing is now much more faithful - (i.e. speed in Pick'n'Pile) + (i.e. speed in Pick'n'Pile). - * Audio settings replaced with new audio.xxx settings + * Audio settings replaced with new 'audio.xxx' settings. - * FPS setting replaced with speed setting for adjusting emulation speed + * FPS setting replaced with speed setting for adjusting emulation speed. * Extra functionality for Time Machine dialog (start/stop recording; minor fixes; TODO button and initial key repeats...) - * Fixes for collision corner cases (during HBlank) + * Fixes for collision corner cases (during HBlank). - * UI modernization (new widget look, dialog titles added, dialogs refactored) + * UI modernization (new widget look, dialog titles added, dialogs refactored). * Changes in 'Game Properties' dialog - 'Default' button now affects only current tab like in all other dialogs. @@ -46,8 +46,11 @@ * The Linux builds now use the system-installed PNG and ZLIB libraries by default. + * When starting Stella for the first time, the first ROM selected will + determine which path to use by default for subsequent runs. + * Fixed emulator crash when starting SaveKey ROMs from commandline with - SaveKey messages enabled + SaveKey messages enabled. * Fixed missing TV format update in frame stats dialog when switching display type. @@ -57,7 +60,7 @@ * Updated included PNG library to latest stable version. * For better compatibility, the Windows 32-bit version does not requires SSE2 - anymore + anymore. -Have fun! diff --git a/src/common/Version.hxx b/src/common/Version.hxx index ef52325c7..bc1d304a5 100644 --- a/src/common/Version.hxx +++ b/src/common/Version.hxx @@ -18,7 +18,7 @@ #ifndef VERSION_HXX #define VERSION_HXX -#define STELLA_VERSION "5.2_soundtest-1" -#define STELLA_BUILD "4138" +#define STELLA_VERSION "6.0_pre1" +#define STELLA_BUILD "4409" #endif diff --git a/src/gui/LauncherDialog.cxx b/src/gui/LauncherDialog.cxx index 6db174832..fc964af32 100644 --- a/src/gui/LauncherDialog.cxx +++ b/src/gui/LauncherDialog.cxx @@ -216,31 +216,12 @@ const string& LauncherDialog::selectedRomMD5() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void LauncherDialog::loadConfig() { + // Should we use a temporary directory specified on the commandline, or the + // default one specified by the settings? const string& tmpromdir = instance().settings().getString("tmpromdir"); const string& romdir = tmpromdir != "" ? tmpromdir : instance().settings().getString("romdir"); - // When romdir hasn't been set, it probably indicates that this is the first - // time running Stella; in this case, we should prompt the user - if(romdir == "") - { - if(!myFirstRunMsg) - { - StringList msg; - msg.push_back("This seems to be your first time running Stella."); - msg.push_back("Before you can start a game, you need to"); - msg.push_back("specify where your ROMs are located."); - msg.push_back(""); - msg.push_back("Click 'Default' to select a default ROM directory,"); - msg.push_back("or 'Browse' to browse the filesystem manually."); - myFirstRunMsg = make_unique - (this, instance().frameBuffer().font(), - msg, _w, _h, kFirstRunMsgChosenCmd, - "Default", "Browse", "ROM directory"); - } - myFirstRunMsg->show(); - } - // Assume that if the list is empty, this is the first time that loadConfig() // has been called (and we should reload the list) if(myList->getList().empty()) @@ -488,7 +469,13 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd, const string& result = instance().createConsole(romnode, myGameList->md5(item)); if(result == EmptyString) + { instance().settings().setValue("lastrom", myList->getSelectedString()); + + // If romdir has never been set, set it now based on the selected rom + if(instance().settings().getString("romdir") == EmptyString) + instance().settings().setValue("romdir", romnode.getParent().getShortPath()); + } else instance().frameBuffer().showMessage(result, MessagePosition::MiddleCenter, true); } @@ -515,20 +502,6 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd, instance().eventHandler().quit(); break; - case kFirstRunMsgChosenCmd: - // Show a file browser, starting from the users' home directory - if(!myRomDir) - myRomDir = make_unique(this, instance().frameBuffer().font(), - _w, _h, "Select ROM directory"); - myRomDir->show("~", BrowserDialog::Directories, kStartupRomDirChosenCmd); - break; - - case kStartupRomDirChosenCmd: - { - FilesystemNode dir(myRomDir->getResult()); - instance().settings().setValue("romdir", dir.getShortPath()); - [[fallthrough]]; - } case kRomDirChosenCmd: myCurrentNode = FilesystemNode(instance().settings().getString("romdir")); if(!(myCurrentNode.exists() && myCurrentNode.isDirectory())) diff --git a/src/gui/LauncherDialog.hxx b/src/gui/LauncherDialog.hxx index 61400f461..0b60e0c2f 100644 --- a/src/gui/LauncherDialog.hxx +++ b/src/gui/LauncherDialog.hxx @@ -48,7 +48,7 @@ class LauncherDialog : public Dialog // These must be accessible from dialogs created by this class enum { kLoadROMCmd = 'STRT', // load currently selected ROM - kRomDirChosenCmd = 'romc', // rom chosen + kRomDirChosenCmd = 'romc', // rom dir chosen kReloadRomDirCmd = 'rdrl', // reload the current listing kReloadFiltersCmd = 'rlfl' // reload filtering options and current listing }; @@ -98,7 +98,6 @@ class LauncherDialog : public Dialog unique_ptr myGlobalProps; unique_ptr myFilters; unique_ptr myRomDir; - unique_ptr myFirstRunMsg; ButtonWidget* myStartButton; ButtonWidget* myPrevDirButton; @@ -122,10 +121,7 @@ class LauncherDialog : public Dialog enum { kPrevDirCmd = 'PRVD', kOptionsCmd = 'OPTI', - kQuitCmd = 'QUIT', - - kFirstRunMsgChosenCmd = 'frmc', - kStartupRomDirChosenCmd = 'rmsc' + kQuitCmd = 'QUIT' }; private: