From fa199a09ddf63d889f044d7cb8cadf71a5bd0e24 Mon Sep 17 00:00:00 2001
From: Stephen Anthony
Date: Mon, 13 Apr 2020 17:30:36 -0230
Subject: [PATCH 01/30] Fix 'ovveride' warning from clang. Convert 'template
class' to the more modern 'template typename'.
---
src/common/LinkedObjectPool.hxx | 2 +-
src/common/Stack.hxx | 2 +-
src/common/Vec.hxx | 6 +++---
src/common/bspf.hxx | 6 +++---
src/emucore/Cart3E.hxx | 2 +-
src/emucore/DispatchResult.hxx | 2 +-
src/emucore/tia/DelayQueue.hxx | 4 ++--
7 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/common/LinkedObjectPool.hxx b/src/common/LinkedObjectPool.hxx
index ab4a2fcbd..7c35439e3 100644
--- a/src/common/LinkedObjectPool.hxx
+++ b/src/common/LinkedObjectPool.hxx
@@ -49,7 +49,7 @@
*/
namespace Common {
-template
+template
class LinkedObjectPool
{
public:
diff --git a/src/common/Stack.hxx b/src/common/Stack.hxx
index aac9c28b2..e3b2afd87 100644
--- a/src/common/Stack.hxx
+++ b/src/common/Stack.hxx
@@ -27,7 +27,7 @@
*/
namespace Common {
-template
+template
class FixedStack
{
private:
diff --git a/src/common/Vec.hxx b/src/common/Vec.hxx
index 10e0c492e..7d102a785 100644
--- a/src/common/Vec.hxx
+++ b/src/common/Vec.hxx
@@ -22,19 +22,19 @@
namespace Vec {
-template
+template
void append(vector& dst, const vector& src)
{
dst.insert(dst.cend(), src.cbegin(), src.cend());
}
-template
+template
void insertAt(vector& dst, uInt32 idx, const T& element)
{
dst.insert(dst.cbegin()+idx, element);
}
-template
+template
void removeAt(vector& dst, uInt32 idx)
{
dst.erase(dst.cbegin()+idx);
diff --git a/src/common/bspf.hxx b/src/common/bspf.hxx
index e7cc60024..18c60bd2a 100644
--- a/src/common/bspf.hxx
+++ b/src/common/bspf.hxx
@@ -119,16 +119,16 @@ namespace BSPF
#endif
// Make 2D-arrays using std::array less verbose
- template
+ template
using array2D = std::array, ROW>;
// Combines 'max' and 'min', and clamps value to the upper/lower value
// if it is outside the specified range
- template inline T clamp(T val, T lower, T upper)
+ template inline T clamp(T val, T lower, T upper)
{
return (val < lower) ? lower : (val > upper) ? upper : val;
}
- template inline void clamp(T& val, T lower, T upper, T setVal)
+ template inline void clamp(T& val, T lower, T upper, T setVal)
{
if(val < lower || val > upper) val = setVal;
}
diff --git a/src/emucore/Cart3E.hxx b/src/emucore/Cart3E.hxx
index 021497c82..e2382babb 100644
--- a/src/emucore/Cart3E.hxx
+++ b/src/emucore/Cart3E.hxx
@@ -117,7 +117,7 @@ class Cartridge3E : public Cartridge
@param bank The bank to get the size for
@return The bank's size
*/
- virtual uInt16 bankSize(uInt16 bank = 0) const;
+ virtual uInt16 bankSize(uInt16 bank = 0) const override;
/**
Patch the cartridge ROM.
diff --git a/src/emucore/DispatchResult.hxx b/src/emucore/DispatchResult.hxx
index 4ce172aeb..6d76cf5ce 100644
--- a/src/emucore/DispatchResult.hxx
+++ b/src/emucore/DispatchResult.hxx
@@ -55,7 +55,7 @@ class DispatchResult
if (myStatus != status) throw runtime_error("invalid status for operation");
}
- template void assertStatus(Status status, Ts... more) const
+ template void assertStatus(Status status, Ts... more) const
{
if (myStatus == status) return;
diff --git a/src/emucore/tia/DelayQueue.hxx b/src/emucore/tia/DelayQueue.hxx
index d3e7e544b..996bde72e 100644
--- a/src/emucore/tia/DelayQueue.hxx
+++ b/src/emucore/tia/DelayQueue.hxx
@@ -41,7 +41,7 @@ class DelayQueue : public Serializable
void reset();
- template void execute(T executor);
+ template void execute(T executor);
/**
Serializable methods (see that class for more information).
@@ -103,7 +103,7 @@ void DelayQueue::reset()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
template
-template
+template
void DelayQueue::execute(T executor)
{
DelayQueueMember& currentMember = myMembers[myIndex];
From e702653355843dd47fddf449f41bce5bd509b8a8 Mon Sep 17 00:00:00 2001
From: thrust26
Date: Sun, 19 Apr 2020 10:31:00 +0200
Subject: [PATCH 02/30] fix #617 (3E RAM banks)
---
src/debugger/gui/Cart3EWidget.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/debugger/gui/Cart3EWidget.cxx b/src/debugger/gui/Cart3EWidget.cxx
index 3880f2026..8055cd23b 100644
--- a/src/debugger/gui/Cart3EWidget.cxx
+++ b/src/debugger/gui/Cart3EWidget.cxx
@@ -161,7 +161,7 @@ string Cartridge3EWidget::bankState()
if(bank < 256)
buf << "ROM bank #" << std::dec << bank % myNumRomBanks << ", RAM inactive";
else
- buf << "ROM inactive, RAM bank #" << std::dec << bank % myNumRomBanks;
+ buf << "ROM inactive, RAM bank #" << std::dec << bank % myNumRamBanks;
return buf.str();
}
From 12f6588d5d385578e9f534c3153dc9cf01415669 Mon Sep 17 00:00:00 2001
From: thrust26
Date: Sun, 19 Apr 2020 10:45:22 +0200
Subject: [PATCH 03/30] renamed 'Exit' button in debugger into 'Run' (TODO:
update screenshots) (fixes #614)
---
docs/debugger.html | 20 ++++++++++----------
src/debugger/gui/DebuggerDialog.cxx | 4 ++--
src/debugger/gui/DebuggerDialog.hxx | 2 +-
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/docs/debugger.html b/docs/debugger.html
index 46e38d079..4f0c1cf6f 100644
--- a/docs/debugger.html
+++ b/docs/debugger.html
@@ -331,7 +331,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 Exit (debugger).
+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.
@@ -382,12 +382,12 @@ size can be configured e.g. in the
Backquote (`) |
- Exit |
+ Run |
For MacOS use 'Cmd' instead of 'Alt' key.
-To the left of the global buttons, you find the "Options..." button.
+To the left of the global buttons, you find the 'Options...' button.
@@ -608,7 +608,7 @@ created a symbol file, you can use labels for the expression.
Example: You have got a label called "kernel". To break there,
the command is "break kernel". After you've set the breakpoint,
-exit the debugger ("quit" or click the Exit button). The emulator
+exit the debugger (enter "run" or click the 'Run' button). The emulator
will run until it gets to the breakpoint, then it will enter the
debugger with the Program Counter pointing to the instruction
at the breakpoint.
@@ -1027,8 +1027,8 @@ graphics and positions, and the playfield.
of the displays are editable. You can even toggle individual bits in
the GRP0/1 and playfield registers (remember to double-click).
-The group of buttons labelled "Strobes" allows you to write to any
-of the strobe registers at any time.
+The buttons allow you to write to any of the strobe registers at
+any time.
The collision registers are displayed in decoded format, in a table.
You can see exactly which objects have hit what. These are read-only
@@ -1103,7 +1103,7 @@ or TV effects are enabled, you won't see the effects here; this shows the
raw TIA image only.
To e.g. watch the TIA draw the frame one scanline at a time, you can
-use the "Scan+1" button, the prompt "scan" command or the Control-L key.
+use the 'Scan+1' button, the prompt "scan" command or the Control-L key.
You can also right-click anywhere in this window to show a context menu,
as illustrated:
@@ -1213,7 +1213,7 @@ section for details.

All the registers and flags are displayed, and can be changed by
double-clicking on them (to the left). Flags are toggled on double-click.
-Selected registers here can also be changed by using the "Data Operations" buttons,
+Selected registers here can also be changed by using the 'Data Operations' buttons,
further described in (J). All items are shown in hex. Any label defined for the
current PC value is shown to the right. Decimal and binary equivalents
are shown for SP/A/X/Y to the right (first decimal, then binary).
@@ -1631,7 +1631,7 @@ but it helps to know at least a little about 6502 programming.
Enter the debugger by pressing the ` (backquote) key. Don't get
killed before you do this, though. You should still have all 5 lives.
- In the RAM display, click the "Search" button and enter "5" for input.
+ In the RAM display, click the 'Search' button and enter "5" for input.
This searches RAM for your value and highlights all addresses that match
the input. You should see two addresses highlighted: "00a5" and "00ba".
These are the only two addresses that currently have the value 5, so they're
@@ -1647,7 +1647,7 @@ but it helps to know at least a little about 6502 programming.
Get killed! Ram an enemy tank, or let him shoot you. Wait for
the explosion to finish. You will now have 4 lives.
- Enter the debugger again. Click the "Compare" button in RAM widget and enter
+ Enter the debugger again. Click the 'Compare...' button in RAM widget and enter
a value of 4. Now the RAM widget should only show one highlighted address:
"00ba". What we did was search within our previous results (the ones that
were 5 before) for the new value 4. Address $00ba used to have the value 5,
diff --git a/src/debugger/gui/DebuggerDialog.cxx b/src/debugger/gui/DebuggerDialog.cxx
index 47e05da04..ac3c8d6c9 100644
--- a/src/debugger/gui/DebuggerDialog.cxx
+++ b/src/debugger/gui/DebuggerDialog.cxx
@@ -231,7 +231,7 @@ void DebuggerDialog::handleCommand(CommandSender* sender, int cmd,
doUnwind();
break;
- case kDDExitCmd:
+ case kDDRunCmd:
doExitDebugger();
break;
@@ -541,7 +541,7 @@ void DebuggerDialog::addRomArea()
wid2.push_back(b);
buttonY += bheight + 4;
b = new ButtonWidget(this, *myLFont, buttonX, buttonY,
- bwidth, bheight, "Exit", kDDExitCmd);
+ bwidth, bheight, "Run", kDDRunCmd);
wid2.push_back(b);
addCancelWidget(b);
diff --git a/src/debugger/gui/DebuggerDialog.hxx b/src/debugger/gui/DebuggerDialog.hxx
index f9f11e459..b1b42211a 100644
--- a/src/debugger/gui/DebuggerDialog.hxx
+++ b/src/debugger/gui/DebuggerDialog.hxx
@@ -110,7 +110,7 @@ class DebuggerDialog : public Dialog
kDDSAdvCmd = 'DDsv',
kDDRewindCmd = 'DDrw',
kDDUnwindCmd = 'DDuw',
- kDDExitCmd = 'DDex',
+ kDDRunCmd = 'DDex',
kDDExitFatalCmd = 'DDer',
kDDOptionsCmd = 'DDop'
};
From 8f6cdf689dc31bec82a7248295fd8e8f702857c8 Mon Sep 17 00:00:00 2001
From: thrust26
Date: Sat, 18 Apr 2020 17:51:21 +0200
Subject: [PATCH 04/30] fix display of changed PopUpWidget in debugger allow
using IDs with PopUpWidget's ContextMenu
---
src/gui/ContextMenu.cxx | 10 +++++-----
src/gui/ContextMenu.hxx | 4 ++++
src/gui/PopUpWidget.cxx | 10 +++++++++-
src/gui/PopUpWidget.hxx | 2 ++
4 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/src/gui/ContextMenu.cxx b/src/gui/ContextMenu.cxx
index 11e09e475..cf142255f 100644
--- a/src/gui/ContextMenu.cxx
+++ b/src/gui/ContextMenu.cxx
@@ -181,7 +181,7 @@ bool ContextMenu::sendSelectionUp()
return false;
_selectedItem--;
- sendCommand(_cmd ? _cmd : ContextMenu::kItemSelectedCmd, _selectedItem, -1);
+ sendCommand(_cmd ? _cmd : ContextMenu::kItemSelectedCmd, _selectedItem, _id);
return true;
}
@@ -192,7 +192,7 @@ bool ContextMenu::sendSelectionDown()
return false;
_selectedItem++;
- sendCommand(_cmd ? _cmd : ContextMenu::kItemSelectedCmd, _selectedItem, -1);
+ sendCommand(_cmd ? _cmd : ContextMenu::kItemSelectedCmd, _selectedItem, _id);
return true;
}
@@ -203,7 +203,7 @@ bool ContextMenu::sendSelectionFirst()
return false;
_selectedItem = 0;
- sendCommand(_cmd ? _cmd : ContextMenu::kItemSelectedCmd, _selectedItem, -1);
+ sendCommand(_cmd ? _cmd : ContextMenu::kItemSelectedCmd, _selectedItem, _id);
return true;
}
@@ -214,7 +214,7 @@ bool ContextMenu::sendSelectionLast()
return false;
_selectedItem = int(_entries.size()) - 1;
- sendCommand(_cmd ? _cmd : ContextMenu::kItemSelectedCmd, _selectedItem, -1);
+ sendCommand(_cmd ? _cmd : ContextMenu::kItemSelectedCmd, _selectedItem, _id);
return true;
}
@@ -375,7 +375,7 @@ void ContextMenu::sendSelection()
// Send any command associated with the selection
_selectedItem = item;
- sendCommand(_cmd ? _cmd : ContextMenu::kItemSelectedCmd, _selectedItem, -1);
+ sendCommand(_cmd ? _cmd : ContextMenu::kItemSelectedCmd, _selectedItem, _id);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/src/gui/ContextMenu.hxx b/src/gui/ContextMenu.hxx
index 28d485f1a..40858f8b9 100644
--- a/src/gui/ContextMenu.hxx
+++ b/src/gui/ContextMenu.hxx
@@ -45,6 +45,9 @@ class ContextMenu : public Dialog, public CommandSender
const VariantList& items, int cmd = 0, int width = 0);
virtual ~ContextMenu() = default;
+ /** Set the parent widget's ID */
+ void setID(uInt32 id) { _id = id; }
+
/** Add the given items to the widget. */
void addItems(const VariantList& items);
@@ -121,6 +124,7 @@ class ContextMenu : public Dialog, public CommandSender
ColorId _scrollUpColor{kColor}, _scrollDnColor{kColor};
int _cmd{0};
+ int _id{-1};
uInt32 _xorig{0}, _yorig{0};
uInt32 _maxWidth{0};
diff --git a/src/gui/PopUpWidget.cxx b/src/gui/PopUpWidget.cxx
index 6b530f6d1..9cc233060 100644
--- a/src/gui/PopUpWidget.cxx
+++ b/src/gui/PopUpWidget.cxx
@@ -50,6 +50,14 @@ PopUpWidget::PopUpWidget(GuiObject* boss, const GUI::Font& font,
myMenu = make_unique(this, font, list, cmd, w);
}
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+void PopUpWidget::setID(uInt32 id)
+{
+ myMenu->setID(id);
+
+ Widget::setID(id);
+}
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void PopUpWidget::addItems(const VariantList& items)
{
@@ -219,5 +227,5 @@ void PopUpWidget::drawWidget(bool hilite)
TextAlign align = (_font.getStringWidth(name) > w-6) ?
TextAlign::Right : TextAlign::Left;
s.drawString(_font, name, x+2, _y+myTextY, w-6,
- !(isEnabled() && onTop) ? kColor : kTextColor, align);
+ !(isEnabled() && onTop) ? kColor : _changed ? kDbgChangedTextColor : kTextColor, align);
}
diff --git a/src/gui/PopUpWidget.hxx b/src/gui/PopUpWidget.hxx
index f79e575f8..955263f5f 100644
--- a/src/gui/PopUpWidget.hxx
+++ b/src/gui/PopUpWidget.hxx
@@ -41,6 +41,8 @@ class PopUpWidget : public Widget, public CommandSender
const string& label, int labelWidth = 0, int cmd = 0);
virtual ~PopUpWidget() = default;
+ void setID(uInt32 id);
+
int getTop() const override { return _y + 1; }
int getBottom() const override { return _y + 1 + getHeight(); }
From e782d60e71104b2ef26cfd6f31c26eaa8843133e Mon Sep 17 00:00:00 2001
From: Stephen Anthony
Date: Sun, 19 Apr 2020 15:04:59 -0230
Subject: [PATCH 05/30] Update Windows appveyor build to use latest SDL
(2.0.12).
---
appveyor.yml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/appveyor.yml b/appveyor.yml
index a087f4e42..211b69a24 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -7,15 +7,15 @@ environment:
matrix:
- Platform: x64
- Platform: Win32
-
+
Configuration: Release
- SDL2_version: 2.0.10
+ SDL2_version: 2.0.12
install:
- cmd: |
- curl -o "C:\SDL2-devel.zip" https://www.libsdl.org/release/SDL2-devel-2.0.10-VC.zip
+ curl -o "C:\SDL2-devel.zip" "https://www.libsdl.org/release/SDL2-devel-%SDL2_version%-VC.zip"
7z x "C:\SDL2-devel.zip" -o"C:\"
xcopy /S "C:\SDL2-%SDL2_version%\include" src\common
From 538728579ece3d6b95f294aaac11ff48974d4c80 Mon Sep 17 00:00:00 2001
From: Stephen Anthony
Date: Sun, 19 Apr 2020 15:10:23 -0230
Subject: [PATCH 06/30] Updated copyright date in Makefile.
---
Makefile | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index b0e41062b..939f0d7cf 100644
--- a/Makefile
+++ b/Makefile
@@ -8,14 +8,11 @@
## SS SS tt ee ll ll aa aa
## SSSS ttt eeeee llll llll aaaaa
##
-## Copyright (c) 1995-2016 by Bradford W. Mott, Stephen Anthony
+## Copyright (c) 1995-2020 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.
-##
-## Based on code from ScummVM - Scumm Interpreter
-## Copyright (C) 2002-2004 The ScummVM project
##============================================================================
#######################################################################
From 4e6734b1803a06d697b01c86a86e50b4779c15ec Mon Sep 17 00:00:00 2001
From: thrust26
Date: Sun, 19 Apr 2020 23:08:25 +0200
Subject: [PATCH 07/30] added 'Turbo" mode
---
Changes.txt | 4 ++-
docs/index.html | 51 ++++++++++++++++++++-------------
src/common/FrameBufferSDL2.cxx | 3 +-
src/common/PKeyboardHandler.cxx | 1 +
src/emucore/Console.cxx | 22 +++++++++++++-
src/emucore/Console.hxx | 5 ++++
src/emucore/Event.hxx | 1 +
src/emucore/EventHandler.cxx | 6 ++++
src/emucore/EventHandler.hxx | 2 +-
src/emucore/FrameBuffer.cxx | 5 +++-
src/emucore/Settings.cxx | 2 ++
11 files changed, 77 insertions(+), 25 deletions(-)
diff --git a/Changes.txt b/Changes.txt
index 60fd29f4e..a12cef9d1 100644
--- a/Changes.txt
+++ b/Changes.txt
@@ -22,7 +22,9 @@
a game. This allows the user to save high scores for these games. For each
game and variation, the top 10 scores can be saved. (TODO: Doc)
- * Add option which lets default ROM path follow launcher navigation (TODO: Doc)
+ * Added 'Turbo' mode, runs the game as fast as the computer allows.
+
+ * Added option which lets default ROM path follow launcher navigation (TODO: Doc)
* Added displaying last write address in the debugger.
diff --git a/docs/index.html b/docs/index.html
index 68be48e0d..e57dd3d51 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -1626,6 +1626,12 @@
Control + i |
+
+ Toggle 'Turbo' mode |
+ Control + t |
+ Control + t |
+
+
Toggle sound on/off |
Control + ] |
@@ -2004,6 +2010,11 @@
Control the emulation speed (as a percentage, 10 - 1000). |
+
+ -turbo <1|0> |
+ Enable 'Turbo' mode for maximum emulation speed. |
+
+
-uimessages <1|0> |
Enable or disable display of message in the UI. Note that messages
@@ -2063,29 +2074,29 @@
| Set the pitch o f Pitfall II music. |
-
- -tia.zoom <zoom> |
- Use the specified zoom level (integer) while in TIA/emulation mode.
- |
-
+
+ -tia.zoom <zoom> |
+ Use the specified zoom level (integer) while in TIA/emulation mode.
+ |
+
-
- -tia.vsizeadjust <-5 - 5> |
- Adjust the display height of the TIA image
- |
-
+
+ -tia.vsizeadjust <-5 - 5> |
+ Adjust the display height of the TIA image
+ |
+
-
- -tia.inter <1|0> |
- Use interpolation for the TIA image (results in blending/smoothing
- of the image). |
-
+
+ -tia.inter <1|0> |
+ Use interpolation for the TIA image (results in blending/smoothing
+ of the image). |
+
-
- -tia.fs_stretch <1|0> |
- Stretch TIA image completely while in fullscreen mode, vs. keeping the correct
- aspect ratio. |
-
+
+ -tia.fs_stretch <1|0> |
+ Stretch TIA image completely while in fullscreen mode, vs. keeping the correct
+ aspect ratio. |
+
-tia.fs_overscan <0 - 10> |
diff --git a/src/common/FrameBufferSDL2.cxx b/src/common/FrameBufferSDL2.cxx
index d7b9ecb17..bce5c2e7c 100644
--- a/src/common/FrameBufferSDL2.cxx
+++ b/src/common/FrameBufferSDL2.cxx
@@ -320,7 +320,8 @@ bool FrameBufferSDL2::setVideoMode(const string& title, const VideoMode& mode)
}
uInt32 renderFlags = SDL_RENDERER_ACCELERATED;
- if(myOSystem.settings().getBool("vsync")) // V'synced blits option
+ if(myOSystem.settings().getBool("vsync")
+ && !myOSystem.settings().getBool("turbo")) // V'synced blits option
renderFlags |= SDL_RENDERER_PRESENTVSYNC;
const string& video = myOSystem.settings().getString("video"); // Render hint
if(video != "")
diff --git a/src/common/PKeyboardHandler.cxx b/src/common/PKeyboardHandler.cxx
index 76d48dd1a..bc2c545ca 100644
--- a/src/common/PKeyboardHandler.cxx
+++ b/src/common/PKeyboardHandler.cxx
@@ -468,6 +468,7 @@ PhysicalKeyboardHandler::EventMappingArray PhysicalKeyboardHandler::DefaultCommo
{Event::ToggleColorLoss, KBDK_L, KBDM_CTRL},
{Event::TogglePalette, KBDK_P, KBDM_CTRL},
{Event::ToggleInter, KBDK_I, KBDM_CTRL},
+ {Event::ToggleTurbo, KBDK_T, KBDM_CTRL},
{Event::ToggleJitter, KBDK_J, MOD3},
{Event::ToggleFrameStats, KBDK_L, MOD3},
{Event::ToggleTimeMachine, KBDK_T, MOD3},
diff --git a/src/emucore/Console.cxx b/src/emucore/Console.cxx
index 518030966..fc5c1e9be 100644
--- a/src/emucore/Console.cxx
+++ b/src/emucore/Console.cxx
@@ -563,6 +563,24 @@ void Console::toggleInter()
myOSystem.frameBuffer().showMessage(ss.str());
}
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+void Console::toggleTurbo()
+{
+ bool enabled = myOSystem.settings().getBool("turbo");
+
+ myOSystem.settings().setValue("turbo", !enabled);
+
+ // update speed
+ initializeAudio();
+
+ // update VSync
+ myOSystem.createFrameBuffer();
+
+ ostringstream ss;
+ ss << "Turbo mode " << (!enabled ? "enabled" : "disabled");
+ myOSystem.frameBuffer().showMessage(ss.str());
+}
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::togglePhosphor()
{
@@ -657,7 +675,9 @@ void Console::initializeAudio()
.updatePlaybackPeriod(myAudioSettings.fragmentSize())
.updateAudioQueueExtraFragments(myAudioSettings.bufferSize())
.updateAudioQueueHeadroom(myAudioSettings.headroom())
- .updateSpeedFactor(myOSystem.settings().getFloat("speed"));
+ .updateSpeedFactor(myOSystem.settings().getBool("turbo")
+ ? 20.0F
+ : myOSystem.settings().getFloat("speed"));
createAudioQueue();
myTIA->setAudioQueue(myAudioQueue);
diff --git a/src/emucore/Console.hxx b/src/emucore/Console.hxx
index eb85025a6..33c3b117c 100644
--- a/src/emucore/Console.hxx
+++ b/src/emucore/Console.hxx
@@ -221,6 +221,11 @@ class Console : public Serializable, public ConsoleIO
*/
void toggleInter();
+ /**
+ Toggle turbo mode on/off
+ */
+ void toggleTurbo();
+
/**
Toggles phosphor effect.
diff --git a/src/emucore/Event.hxx b/src/emucore/Event.hxx
index b82bb7f50..c45fc1e0a 100644
--- a/src/emucore/Event.hxx
+++ b/src/emucore/Event.hxx
@@ -120,6 +120,7 @@ class Event
ToggleFrameStats, ToggleSAPortOrder, ExitGame,
// add new events from here to avoid that user remapped events get overwritten
+ ToggleTurbo,
LastType
};
diff --git a/src/emucore/EventHandler.cxx b/src/emucore/EventHandler.cxx
index 4433ed244..1a11c604b 100644
--- a/src/emucore/EventHandler.cxx
+++ b/src/emucore/EventHandler.cxx
@@ -539,6 +539,10 @@ void EventHandler::handleEvent(Event::Type event, Int32 value, bool repeated)
if (pressed && !repeated) myOSystem.console().toggleInter();
return;
+ case Event::ToggleTurbo:
+ if (pressed && !repeated) myOSystem.console().toggleTurbo();
+ return;
+
case Event::ToggleJitter:
if (pressed && !repeated) myOSystem.console().toggleJitter();
return;
@@ -1815,6 +1819,7 @@ EventHandler::EmulActionList EventHandler::ourEmulActionList = { {
{ Event::TogglePauseMode, "Toggle Pause mode", "" },
{ Event::StartPauseMode, "Start Pause mode", "" },
{ Event::Fry, "Fry cartridge", "" },
+ { Event::ToggleTurbo, "Toggle Turbo mode", "" },
{ Event::DebuggerMode, "Toggle Debugger mode", "" },
{ Event::ConsoleSelect, "Select", "" },
@@ -2023,6 +2028,7 @@ EventHandler::MenuActionList EventHandler::ourMenuActionList = { {
const Event::EventSet EventHandler::MiscEvents = {
Event::Quit, Event::ReloadConsole, Event::Fry, Event::StartPauseMode,
Event::TogglePauseMode, Event::OptionsMenuMode, Event::CmdMenuMode, Event::ExitMode,
+ Event::ToggleTurbo,
Event::TakeSnapshot, Event::ToggleContSnapshots, Event::ToggleContSnapshotsFrame,
// Event::MouseAxisXMove, Event::MouseAxisYMove,
// Event::MouseButtonLeftValue, Event::MouseButtonRightValue,
diff --git a/src/emucore/EventHandler.hxx b/src/emucore/EventHandler.hxx
index 7fa56d17d..8148fa085 100644
--- a/src/emucore/EventHandler.hxx
+++ b/src/emucore/EventHandler.hxx
@@ -468,7 +468,7 @@ class EventHandler
#else
PNG_SIZE = 0,
#endif
- EMUL_ACTIONLIST_SIZE = 144 + PNG_SIZE + COMBO_SIZE,
+ EMUL_ACTIONLIST_SIZE = 145 + PNG_SIZE + COMBO_SIZE,
MENU_ACTIONLIST_SIZE = 18
;
diff --git a/src/emucore/FrameBuffer.cxx b/src/emucore/FrameBuffer.cxx
index 68b6e8caa..3c64c5d8f 100644
--- a/src/emucore/FrameBuffer.cxx
+++ b/src/emucore/FrameBuffer.cxx
@@ -502,7 +502,10 @@ void FrameBuffer::drawFrameStats(float framesPerSecond)
ss
<< std::fixed << std::setprecision(1) << framesPerSecond
<< "fps @ "
- << std::fixed << std::setprecision(0) << 100 * myOSystem.settings().getFloat("speed")
+ << std::fixed << std::setprecision(0) << 100 *
+ (myOSystem.settings().getBool("turbo")
+ ? 20.0F
+ : myOSystem.settings().getFloat("speed"))
<< "% speed";
myStatsMsg.surface->drawString(f, ss.str(), xPos, yPos,
diff --git a/src/emucore/Settings.cxx b/src/emucore/Settings.cxx
index c3feece37..50e45cd06 100644
--- a/src/emucore/Settings.cxx
+++ b/src/emucore/Settings.cxx
@@ -157,6 +157,7 @@ Settings::Settings()
setPermanent("threads", "false");
setTemporary("romloadcount", "0");
setTemporary("maxres", "");
+ setTemporary("turbo", "0");
#ifdef DEBUGGER_SUPPORT
// Debugger/disassembly options
@@ -400,6 +401,7 @@ void Settings::usage() const
<< " z26|\n"
<< " user>\n"
<< " -speed Run emulation at the given speed\n"
+ << " -turbo <1|0> Enable 'Turbo' mode for maximum emulation speed\n"
<< " -uimessages <1|0> Show onscreen UI messages for different events\n"
<< endl
#ifdef SOUND_SUPPORT
From b61f83bad60062031314fa8e75e1f7a65c362f5b Mon Sep 17 00:00:00 2001
From: thrust26
Date: Mon, 20 Apr 2020 12:45:05 +0200
Subject: [PATCH 08/30] sort single file ZIP files correctly (fixes #612)
---
src/emucore/FSNode.cxx | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/emucore/FSNode.cxx b/src/emucore/FSNode.cxx
index 6965839ef..64af7212e 100644
--- a/src/emucore/FSNode.cxx
+++ b/src/emucore/FSNode.cxx
@@ -58,6 +58,20 @@ bool FilesystemNode::getChildren(FSList& fslist, ListMode mode,
if (!_realNode->getChildren(tmp, mode))
return false;
+ #if defined(ZIP_SUPPORT)
+ // before sorting, replace single file ZIP archive names with contained file names
+ // because they are displayed using their contained file names
+ for (auto& i : tmp)
+ {
+ if (BSPF::endsWithIgnoreCase(i->getPath(), ".zip"))
+ {
+ FilesystemNodeZIP node(i->getPath());
+
+ i->setName(node.getName());
+ }
+ }
+ #endif
+
std::sort(tmp.begin(), tmp.end(),
[](const AbstractFSNodePtr& node1, const AbstractFSNodePtr& node2)
{
From 7eb3bd33db2482e130923eab1ed5a03222d4f63c Mon Sep 17 00:00:00 2001
From: thrust26
Date: Tue, 21 Apr 2020 16:20:37 +0200
Subject: [PATCH 09/30] order KeyMap and JoyMap when saving
---
src/common/JoyMap.cxx | 28 +++++++++++++++++++++++++++-
src/common/KeyMap.cxx | 24 +++++++++++++++++++++---
2 files changed, 48 insertions(+), 4 deletions(-)
diff --git a/src/common/JoyMap.cxx b/src/common/JoyMap.cxx
index 2a20b4a8b..266dd5e74 100644
--- a/src/common/JoyMap.cxx
+++ b/src/common/JoyMap.cxx
@@ -185,9 +185,35 @@ JoyMap::JoyMappingArray JoyMap::getEventMapping(const Event::Type event, const E
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string JoyMap::saveMapping(const EventMode mode) const
{
+ using MapType = std::pair;
+ std::vector sortedMap(myMap.begin(), myMap.end());
+
+ std::sort(sortedMap.begin(), sortedMap.end(),
+ [](const MapType& a, const MapType& b)
+ {
+ // Event::Type first
+ if(a.second != b.second)
+ return a.second < b.second;
+
+ if(a.first.button != b.first.button)
+ return a.first.button < b.first.button;
+
+ if(a.first.axis != b.first.axis)
+ return a.first.axis < b.first.axis;
+
+ if(a.first.adir != b.first.adir)
+ return a.first.adir < b.first.adir;
+
+ if(a.first.hat != b.first.hat)
+ return a.first.hat < b.first.hat;
+
+ return a.first.hdir < b.first.hdir;
+ }
+ );
+
ostringstream buf;
- for (auto item : myMap)
+ for (auto item : sortedMap)
{
if (item.first.mode == mode)
{
diff --git a/src/common/KeyMap.cxx b/src/common/KeyMap.cxx
index eca0369ec..47b34dc9c 100644
--- a/src/common/KeyMap.cxx
+++ b/src/common/KeyMap.cxx
@@ -16,11 +16,12 @@
//============================================================================
#include "KeyMap.hxx"
+#include