diff --git a/Changes.txt b/Changes.txt index 7d6eab080..9d056c5dd 100644 --- a/Changes.txt +++ b/Changes.txt @@ -17,19 +17,19 @@ * Note: because of major TIA sound changes, the state file format has changed, and old state files will not work with this release. - * New cycle exact audio core based on work by Chris Brenner (crispy); greatly - improved audio emulation accuracy (i.e. E.T., Ms. Pacman). + * New cycle exact audio core based on work by Chris Brenner (crispy); + greatly 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. + * Full rewrite of the audio subsystem; resample TIA output to target + sample rate directly in Stella. - * Added option to force stereo sound for all ROMs, or to use the setting - on a per-ROM basis. + * Added option to force stereo sound for all ROMs, or to use the + setting on a per-ROM basis. * 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). + * Main loop rewritten; emulating speed and timing is now much more + faithful (i.e. speed in Pick'n'Pile). * Audio settings replaced with new 'audio.xxx' settings. @@ -43,10 +43,21 @@ * UI modernization (new widget look, dialog titles added, dialogs refactored). - * Fixed excessive CPU usage while in UI modes (ROM launcher, debugger, etc). + * Fixed excessive CPU usage while in UI modes (ROM launcher, debugger, + etc). + + * The bankswitch scheme can now be forced by naming the ROM with a + specific extension (ie: .f8s for F8SC, .fe for FE, etc). The + supported extensions are the same as the ones from HarmonyCart and + UnoCart. + + * The 'launcherexts' option has been replaced by a true/false option + named 'launcherroms', which specifies to show only ROMs or all files + in the ROM launcher. * Changes in 'Game Properties' dialog - - 'Default' button now affects only current tab like in all other dialogs. + - 'Default' button now affects only current tab like in all other + dialogs. - 'Display' and 'Console' tab changes are now immediate. - Fixed bug when selecting 'Auto-detect' format for 50Hz ROMs @@ -78,8 +89,8 @@ * The UNIX builds now use the system-installed PNG and ZLIB libraries by default. - * For better compatibility, the Windows 32-bit version does not require SSE2 - anymore. + * For better compatibility, the Windows 32-bit version does not require + SSE2 anymore. * Updated included PNG library to latest stable version. diff --git a/docs/graphics/launcher_filter.png b/docs/graphics/launcher_filter.png deleted file mode 100644 index 6549c986e..000000000 Binary files a/docs/graphics/launcher_filter.png and /dev/null differ diff --git a/docs/index.html b/docs/index.html index 65eca88cd..40d704216 100644 --- a/docs/index.html +++ b/docs/index.html @@ -42,7 +42,7 @@
  • ROM Launcher
  • ROM Audit Mode
  • Stelladaptor/2600-daptor Support
  • @@ -255,8 +255,10 @@
  • Supports high quality TIA emulation using the TIA core from 6502.ts by Christian Speckner
  • -
  • Supports high quality sound emulation using code derived from Ron Fries' - TIA Sound Emulation library, including stereo sound support
  • +
  • Supports high quality sound emulation using code derived from Chris Brenner's + Atari 2600 FPGA project, including cycle-accurate audio, analog interference + from mixing of audio channels, as well as stereo sound support; dynamic + sound resampling is also included
  • Emulates the Atari 2600 Joystick Controllers using your computer's keyboard, joysticks or mouse
  • Emulates the Atari 2600 Keyboard Controllers using your computer's keyboard
  • @@ -287,6 +289,7 @@
  • Supports DPC+/CDF bankswitching schemes from the Harmony Cart, including partial emulation of the ARM processor
  • Supports cartridge autodetection for almost all bankswitching schemes
  • +
  • Supports using ROM filename extensions to force specific bankswitching schemes
  • Supports Supercharger single-load and multi-load games
  • Supports ROMs stored in ZIP and GZIP format, as well as the usual raw A26/BIN/ROM formats
  • Supports property file for setting the properties associated with games
  • @@ -2227,11 +2230,9 @@ -
    -launcherexts <allfiles|allroms|LIST>
    - Specifies which files to show in the ROM launcher - ('allfiles' is self-explanatory, 'allroms' is all files - with valid rom extensions (currently: a26, bin, rom, - gz, zip), 'LIST' is a ':' separated list of valid rom extensions. +
    -launcherroms <1|0>
    + Specifies whether to show ROMs only (the default) or all + files in the ROM launcher. @@ -2901,7 +2902,7 @@ case sensitive, so you don't need to worry about capital or lower-case letters.

    -

    ROM Lauchner Context Menu

    +

    ROM Launcher Context Menu

    The ROM launcher also contains a context menu, selected by clicking the right mouse button anywhere in the current window. This context menu @@ -2938,23 +2939,14 @@ -

  • Filter listing: Selecting this option shows a dialog whereby - one can filter the types of files shown in the listing. The dialog is as - follows:

    -

    -

    Currently, the choices are as follows:

    -

    -
  • -
  • Reload listing: Selecting this performs a reload of the +
  • Show only ROM files: Selecting this reloads the current listing, + showing only files that have a valid ROM extension.
  • + +
  • Show all files: Selecting this reloads the current listing, + showing all files (with no restriction on file name).
  • + +
  • Reload listing: Selecting this performs a reload of the current listing. It is an alternative to pressing the Control-r key combo.
  • diff --git a/src/emucore/Settings.cxx b/src/emucore/Settings.cxx index 4259f546b..20f0dc72d 100644 --- a/src/emucore/Settings.cxx +++ b/src/emucore/Settings.cxx @@ -115,7 +115,7 @@ Settings::Settings(OSystem& osystem) setInternal("exitlauncher", "false"); setInternal("launcherres", GUI::Size(900, 600)); setInternal("launcherfont", "medium"); - setInternal("launcherexts", "allroms"); + setInternal("launcherroms", "true"); setInternal("romviewer", "1"); setInternal("lastrom", ""); @@ -536,10 +536,7 @@ void Settings::usage() const << " -launcherres The resolution to use in ROM launcher mode\n" << " -launcherfont \n" - << " -launcherexts Show only ROMs in the launcher (vs. all files)\n" << " -romviewer <0|1|2> Show ROM info viewer at given zoom level in ROM\n" << " launcher (0 for off)\n" << " -listdelay Time to wait between keypresses in list widgets\n" diff --git a/src/gui/LauncherDialog.cxx b/src/gui/LauncherDialog.cxx index 15baad793..da81bc231 100644 --- a/src/gui/LauncherDialog.cxx +++ b/src/gui/LauncherDialog.cxx @@ -27,7 +27,6 @@ #include "MD5.hxx" #include "OptionsDialog.hxx" #include "GlobalPropsDialog.hxx" -#include "LauncherFilterDialog.hxx" #include "MessageBox.hxx" #include "OSystem.hxx" #include "FrameBuffer.hxx" @@ -179,7 +178,8 @@ LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent, // Create context menu for ROM list options VariantList l; VarList::push_back(l, "Power-on options" + ELLIPSIS, "override"); - VarList::push_back(l, "Filter listing" + ELLIPSIS, "filter"); + VarList::push_back(l, "Show only ROM files" + ELLIPSIS, "roms"); + VarList::push_back(l, "Show all files" + ELLIPSIS, "allfiles"); VarList::push_back(l, "Reload listing", "reload"); myMenu = make_unique(this, osystem.frameBuffer().font(), l); @@ -187,11 +187,8 @@ LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent, // ROM properties myGlobalProps = make_unique(this, osystem.frameBuffer().font()); - // Create dialog whereby the files shown in the ROM listing can be customized - myFilters = make_unique(this, osystem.frameBuffer().font()); - - // Figure out which filters are needed for the ROM listing - setListFilters(); + // Do we show only ROMs or all files? + showOnlyROMs(instance().settings().getBool("launcherroms")); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -292,16 +289,9 @@ void LauncherDialog::loadDirListing() bool isDir = f.isDirectory(); const string& name = isDir ? (" [" + f.getName() + "]") : f.getName(); - // Honour the filtering settings - // Showing only certain ROM extensions is determined by the extension - // that we want - if there are no extensions, it implies show all files - // In this way, showing all files is on the 'fast code path' - if(!isDir && myRomExts.size() > 0) - { - // Skip over those names we've filtered out - if(!LauncherFilterDialog::isValidRomName(name, myRomExts)) - continue; - } + // Do we want to show only ROMs or all files? + if(!isDir && myShowOnlyROMs && !Bankswitch::isValidRomName(f)) + continue; // Skip over files that don't match the pattern in the 'pattern' textbox if(domatch && !isDir && !matchPattern(name, myPattern->getText())) @@ -347,9 +337,10 @@ void LauncherDialog::handleContextMenu() { myGlobalProps->open(); } - else if(cmd == "filter") + else if(cmd == "roms" || cmd == "allfiles") { - myFilters->open(); + showOnlyROMs(cmd == "roms"); + updateListing(); } else if(cmd == "reload") { @@ -358,11 +349,10 @@ void LauncherDialog::handleContextMenu() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void LauncherDialog::setListFilters() +void LauncherDialog::showOnlyROMs(bool state) { - const string& exts = instance().settings().getString("launcherexts"); - myRomExts.clear(); - LauncherFilterDialog::parseExts(myRomExts, exts); + myShowOnlyROMs = state; + instance().settings().setValue("launcherroms", state); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -511,8 +501,8 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd, updateListing(); break; - case kReloadFiltersCmd: - setListFilters(); + case kOnlyROMsCmd: + showOnlyROMs(data); // NOTE: present for when we add a widget for this updateListing(); break; diff --git a/src/gui/LauncherDialog.hxx b/src/gui/LauncherDialog.hxx index 0b60e0c2f..1d5b67763 100644 --- a/src/gui/LauncherDialog.hxx +++ b/src/gui/LauncherDialog.hxx @@ -26,7 +26,6 @@ class GameList; class BrowserDialog; class OptionsDialog; class GlobalPropsDialog; -class LauncherFilterDialog; class OSystem; class Properties; class EditTextWidget; @@ -47,10 +46,10 @@ class LauncherDialog : public Dialog public: // These must be accessible from dialogs created by this class enum { - kLoadROMCmd = 'STRT', // load currently selected ROM - kRomDirChosenCmd = 'romc', // rom dir chosen - kReloadRomDirCmd = 'rdrl', // reload the current listing - kReloadFiltersCmd = 'rlfl' // reload filtering options and current listing + kLoadROMCmd = 'STRT', // load currently selected ROM + kRomDirChosenCmd = 'romc', // rom dir chosen + kReloadRomDirCmd = 'rdrl', // reload the current listing + kOnlyROMsCmd = 'rdor' // what to show has changed (ROMs vs. all files) }; public: @@ -88,7 +87,7 @@ class LauncherDialog : public Dialog void loadDirListing(); void loadRomInfo(); void handleContextMenu(); - void setListFilters(); + void showOnlyROMs(bool state); bool matchPattern(const string& s, const string& pattern) const; private: @@ -96,7 +95,6 @@ class LauncherDialog : public Dialog unique_ptr myGameList; unique_ptr myMenu; unique_ptr myGlobalProps; - unique_ptr myFilters; unique_ptr myRomDir; ButtonWidget* myStartButton; @@ -116,7 +114,7 @@ class LauncherDialog : public Dialog FilesystemNode myCurrentNode; Common::FixedStack myNodeNames; - StringList myRomExts; + bool myShowOnlyROMs; enum { kPrevDirCmd = 'PRVD', diff --git a/src/gui/LauncherFilterDialog.cxx b/src/gui/LauncherFilterDialog.cxx deleted file mode 100644 index 856e98c48..000000000 --- a/src/gui/LauncherFilterDialog.cxx +++ /dev/null @@ -1,224 +0,0 @@ -//============================================================================ -// -// SSSS tt lll lll -// SS SS tt ll ll -// SS tttttt eeee ll ll aaaa -// SSSS tt ee ee ll ll aa -// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" -// SS SS tt ee ll ll aa aa -// SSSS ttt eeeee llll llll aaaaa -// -// Copyright (c) 1995-2018 by Bradford W. Mott, Stephen Anthony -// and the Stella Team -// -// See the file "License.txt" for information on usage and redistribution of -// this file, and for a DISCLAIMER OF ALL WARRANTIES. -//============================================================================ - -#include "bspf.hxx" -#include "Dialog.hxx" -#include "OSystem.hxx" -#include "FSNode.hxx" -#include "PopUpWidget.hxx" -#include "Settings.hxx" -#include "Widget.hxx" -#include "Font.hxx" -#include "LauncherDialog.hxx" -#include "LauncherFilterDialog.hxx" - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -LauncherFilterDialog::LauncherFilterDialog(GuiObject* boss, const GUI::Font& font) - : Dialog(boss->instance(), boss->parent(), font, "Filter file list"), - CommandSender(boss) -{ - const int lineHeight = font.getLineHeight(), - buttonWidth = font.getStringWidth("Defaults") + 20, - buttonHeight = font.getLineHeight() + 4; - int xpos, ypos; - int lwidth = font.getStringWidth("Show "), - pwidth = font.getStringWidth("ROMs ending with"); - WidgetArray wid; - VariantList items; - - // Set real dimensions - _w = 3 * buttonWidth + 20 + 4 * 8; - - xpos = 10; ypos = 10 + _th; - - // Types of files to show - VarList::push_back(items, "All files", "allfiles"); - VarList::push_back(items, "All ROMs", "allroms"); - VarList::push_back(items, "ROMs ending with", "__EXTS"); - myFileType = - new PopUpWidget(this, font, xpos, ypos, pwidth, lineHeight, items, - "Show ", lwidth, kFileTypeChanged); - wid.push_back(myFileType); - ypos += lineHeight + 10; - - // Different types of ROM extensions - xpos += font.getStringWidth("Show "); - myRomType[0] = new CheckboxWidget(this, font, xpos, ypos, ourRomTypes[0][0]); - int rightcol = xpos + myRomType[0]->getWidth() + 8 * 3; - myRomType[3] = new CheckboxWidget(this, font, rightcol, ypos, ourRomTypes[0][3]); - ypos += lineHeight + 4; - myRomType[1] = new CheckboxWidget(this, font, xpos, ypos, ourRomTypes[0][1]); - myRomType[4] = new CheckboxWidget(this, font, rightcol, ypos, ourRomTypes[0][4]); - ypos += lineHeight + 4; - myRomType[2] = new CheckboxWidget(this, font, xpos, ypos, ourRomTypes[0][2]); - ypos += lineHeight + 10; - - _h = ypos + buttonHeight + 20; - - // Add Defaults, OK and Cancel buttons - addDefaultsOKCancelBGroup(wid, font); - - addToFocusList(wid); -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void LauncherFilterDialog::parseExts(StringList& list, const string& type) -{ - // Assume the list is empty before this method is called - if(type == "allroms") - { - for(uInt32 i = 0; i < 5; ++i) - list.push_back(ourRomTypes[1][i]); - } - else if(type != "allfiles") - { - // Since istringstream swallows whitespace, we have to make the - // delimiters be spaces - string exts = type, ext; - replace(exts.begin(), exts.end(), ':', ' '); - istringstream buf(exts); - - while(buf >> ext) - { - for(uInt32 i = 0; i < 5; ++i) - { - if(ourRomTypes[1][i] == ext) - { - list.push_back(ext); - break; - } - } - } - } -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool LauncherFilterDialog::isValidRomName(const string& name, - const StringList& exts) -{ - string::size_type idx = name.find_last_of('.'); - if(idx != string::npos) - { - const char* const ext = name.c_str() + idx + 1; - - for(const auto& s: exts) - if(BSPF::equalsIgnoreCase(ext, s)) - return true; - } - - return false; -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void LauncherFilterDialog::loadConfig() -{ - handleFileTypeChange(instance().settings().getString("launcherexts")); -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void LauncherFilterDialog::saveConfig() -{ - const string& type = myFileType->getSelectedTag().toString(); - if(type == "allfiles" || type == "allroms") - instance().settings().setValue("launcherexts", type); - else - { - ostringstream buf; - for(uInt32 i = 0; i < 5; ++i) - if(myRomType[i]->getState()) - buf << ourRomTypes[1][i] << ":"; - - // No ROMs selected means use all files - if(buf.str() == "") - instance().settings().setValue("launcherexts", "allfiles"); - else - instance().settings().setValue("launcherexts", buf.str()); - } - - // Let parent know about the changes - sendCommand(LauncherDialog::kReloadFiltersCmd, 0, 0); -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void LauncherFilterDialog::setDefaults() -{ - handleFileTypeChange("allroms"); -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void LauncherFilterDialog::handleFileTypeChange(const string& type) -{ - bool enable = (type != "allfiles" && type != "allroms"); - for(uInt32 i = 0; i < 5; ++i) - myRomType[i]->setEnabled(enable); - - if(enable) - { - myFileType->setSelected("__EXTS", ""); - - // Since istringstream swallows whitespace, we have to make the - // delimiters be spaces - string exts = type, ext; - replace(exts.begin(), exts.end(), ':', ' '); - istringstream buf(exts); - - while(buf >> ext) - { - for(uInt32 i = 0; i < 5; ++i) - { - if(ourRomTypes[1][i] == ext) - { - myRomType[i]->setState(true); - break; - } - } - } - } - else - myFileType->setSelected(type, ""); -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void LauncherFilterDialog::handleCommand(CommandSender* sender, int cmd, - int data, int id) -{ - switch(cmd) - { - case GuiObject::kOKCmd: - saveConfig(); - close(); - break; - - case GuiObject::kDefaultsCmd: - setDefaults(); - break; - - case kFileTypeChanged: - handleFileTypeChange(myFileType->getSelectedTag().toString()); - break; - - default: - Dialog::handleCommand(sender, cmd, data, 0); - break; - } -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -const char* const LauncherFilterDialog::ourRomTypes[2][5] = { - { ".a26", ".bin", ".rom", ".zip", ".gz" }, - { "a26", "bin", "rom", "zip", "gz" } -}; diff --git a/src/gui/LauncherFilterDialog.hxx b/src/gui/LauncherFilterDialog.hxx deleted file mode 100644 index e00969040..000000000 --- a/src/gui/LauncherFilterDialog.hxx +++ /dev/null @@ -1,78 +0,0 @@ -//============================================================================ -// -// SSSS tt lll lll -// SS SS tt ll ll -// SS tttttt eeee ll ll aaaa -// SSSS tt ee ee ll ll aa -// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" -// SS SS tt ee ll ll aa aa -// SSSS ttt eeeee llll llll aaaaa -// -// Copyright (c) 1995-2018 by Bradford W. Mott, Stephen Anthony -// and the Stella Team -// -// See the file "License.txt" for information on usage and redistribution of -// this file, and for a DISCLAIMER OF ALL WARRANTIES. -//============================================================================ - -#ifndef LAUNCHER_FILTER_DIALOG_HXX -#define LAUNCHER_FILTER_DIALOG_HXX - -class CommandSender; -class DialogContainer; -class FilesystemNode; -class CheckboxWidget; -class PopUpWidget; -class OSystem; - -#include "bspf.hxx" -#include "Dialog.hxx" -#include "Settings.hxx" - -class LauncherFilterDialog : public Dialog, public CommandSender -{ - public: - LauncherFilterDialog(GuiObject* boss, const GUI::Font& font); - virtual ~LauncherFilterDialog() = default; - - /** Add valid extensions from 'exts' to the given StringList */ - static void parseExts(StringList& list, const string& exts); - - /** - Is this a valid ROM filename (does it have a valid extension from - those specified in the list of extensions). - - @param name Filename of potential ROM file - @param exts The list of extensions to consult - */ - static bool isValidRomName(const string& name, const StringList& exts); - - private: - void loadConfig() override; - void saveConfig() override; - void setDefaults() override; - - void handleFileTypeChange(const string& type); - void handleCommand(CommandSender* sender, int cmd, int data, int id) override; - - private: - PopUpWidget* myFileType; - CheckboxWidget* myRomType[5]; - - enum { - kFileTypeChanged = 'LFDc' - }; - - // Holds static strings representing ROM types - static const char* const ourRomTypes[2][5]; - - private: - // Following constructors and assignment operators not supported - LauncherFilterDialog() = delete; - LauncherFilterDialog(const LauncherFilterDialog&) = delete; - LauncherFilterDialog(LauncherFilterDialog&&) = delete; - LauncherFilterDialog& operator=(const LauncherFilterDialog&) = delete; - LauncherFilterDialog& operator=(LauncherFilterDialog&&) = delete; -}; - -#endif diff --git a/src/gui/module.mk b/src/gui/module.mk index b598334c7..44e5d33f6 100644 --- a/src/gui/module.mk +++ b/src/gui/module.mk @@ -27,7 +27,6 @@ MODULE_OBJS := \ src/gui/InputTextDialog.o \ src/gui/JoystickDialog.o \ src/gui/LauncherDialog.o \ - src/gui/LauncherFilterDialog.o \ src/gui/Launcher.o \ src/gui/ListWidget.o \ src/gui/LoggerDialog.o \