Merge branch 'master' into feature/full-on-sqlite

This commit is contained in:
Stephen Anthony 2020-12-20 19:03:15 -03:30
commit 39b42bca55
197 changed files with 2839 additions and 938 deletions

10
.gitignore vendored
View File

@ -11,11 +11,12 @@ out
out.pgo out.pgo
out.pgen out.pgen
stella stella
stella-pgo stella-pgo
stella-pgo-generate stella-pgo-generate
*.diff *.diff
project.xcworkspace/ project.xcworkspace/
xcuserdata/ xcuserdata/
.DS_Store
build/ build/
src/macosx/M6502.ins src/macosx/M6502.ins
*.dSYM *.dSYM
@ -33,4 +34,7 @@ src/**/*.vspx
src/**/**.pdb src/**/**.pdb
Stella.xcscheme Stella.xcscheme
src/tools/fonts/* src/tools/fonts/*
*.sym
a.out
*.json
*.sqlite3

View File

@ -16,9 +16,11 @@
* Added high scores saving. * Added high scores saving.
* Enhanced cut/copy/paste for text editing. (TODO: PromptWidget) * Enhanced cut/copy/paste for text editing (except PromptWidget).
* Added undo and redo to text editing. (TODO: PromptWidget) * 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 wildcard support to launcher dialog filter.
@ -30,10 +32,15 @@
* Added sound to Time Machine playback. * Added sound to Time Machine playback.
* Extended global hotkeys for input devices & ports settings.
* Increased sample size for CDFJ+. * Increased sample size for CDFJ+.
* Fixed autofire bug for trackball controllers. * Fixed autofire bug for trackball controllers.
* Fixed Stelladaptor/2600'daptor devices sometimes not being assigned
correct default mappings.
* Codebase now uses C++17 features. * Codebase now uses C++17 features.
-Have fun! -Have fun!

View File

@ -1561,6 +1561,250 @@
</tr> </tr>
</table> </table>
<p><b>Input Devices & Ports Keys (can be remapped)</b></p>
<table BORDER=2 cellpadding=4>
<tr>
<th>Function</th>
<th>Key (Standard)</th>
<th>Key (macOS)</th>
</tr>
<tr>
<td><i>Decrease</i> joystick deadzone</td>
<td>Shift-Control + F1</td>
<td>Shift-Control + F1</td>
</tr>
<tr>
<td><i>Increase</i> joystick deadzone</td>
<td>Control + F1</td>
<td>Control + F1</td>
</tr>
<tr>
<td><i>Decrease</i> analog paddle sensitivity</td>
<td>Shift-Control + F2</td>
<td>Shift-Control + F2</td>
</tr>
<tr>
<td><i>Increase</i> analog paddle sensitivity</td>
<td>Control + F2</td>
<td>Control + F2</td>
</tr>
<tr>
<td><i>Decrease</i> analog paddle dejitter averaging</td>
<td>Shift-Control + F3</td>
<td>Shift-Control + F3</td>
</tr>
<tr>
<td><i>Increase</i> analog paddle dejitter averaging</td>
<td>Control + F3</td>
<td>Control + F3</td>
</tr>
<tr>
<td><i>Decrease</i> analog paddle dejitter reaction</td>
<td>Shift-Control + F4</td>
<td>Shift-Control + F4</td>
</tr>
<tr>
<td><i>Increase</i> analog paddle dejitter reaction</td>
<td>Control + F4</td>
<td>Control + F4</td>
</tr>
<tr>
<td><i>Decrease</i> digital paddle sensitivity</td>
<td>Shift-Control + F5</td>
<td>Shift-Control + F5</td>
</tr>
<tr>
<td><i>Increase</i> digital paddle sensitivity</td>
<td>Control + F5</td>
<td>Control + F5</td>
</tr>
<tr>
<td><i>Decrease</i> autofire rate</td>
<td>Shift-Control + a</td>
<td>Shift-Control + a</td>
</tr>
<tr>
<td><i>Increase</i> autofire rate</td>
<td>Control + a</td>
<td>Control + a</td>
</tr>
<tr>
<td>Toggle allowing all four directions on joystick</br>
to be pressed simultaneously</td>
<td>Control + F6</td>
<td>Control + F6</td>
</tr>
<tr>
<td>Toggle use of modifier key combos</td>
<td>Control + F7</td>
<td>Control + F7</td>
</tr>
<tr>
<td>Swap Stelladaptor/2600-daptor port ordering</td>
<td>Control + 1</td>
<td>Control + 1</td>
</tr>
<tr>
<td>Select <i>previous</i> controllers emulated by the mouse
</br>(all, analog, none)</td>
<td>Shift-Control + F8</td>
<td>Shift-Control + F8</td>
</tr>
<tr>
<td>Select <i>next</i> controllers emulated by the mouse
</br>(all, analog, none)</td>
<td>Control + F8</td>
<td>Control + F8</td>
</tr>
<tr>
<td><i>Decrease</i> mouse paddle sensitivity</td>
<td>Shift-Control + F9</td>
<td>Shift-Control + F9</td>
</tr>
<tr>
<td><i>Increase</i> mouse paddle sensitivity</td>
<td>Control + F9</td>
<td>Control + F9</td>
</tr>
<tr>
<td><i>Decrease</i> mouse trackball sensitivity</td>
<td>Shift-Control + F10</td>
<td>Shift-Control + F10</td>
</tr>
<tr>
<td><i>Increase</i> mouse trackball sensitivity</td>
<td>Control + F10</td>
<td>Control + F10</td>
</tr>
<tr>
<td><i>Decrease</i> digital and mouse driving controller sensitivity</td>
<td>Shift-Control + F11</td>
<td>Shift-Control + F11</td>
</tr>
<tr>
<td><i>Increase</i> digital and mouse driving controller sensitivity</td>
<td>Control + F11</td>
<td>Control + F11</td>
</tr>
<tr>
<td>Select <i>previous</i> mouse cursor visiblity option
(-UI, -Emulation/</br>-UI, +Emulation/+UI, -Emulation/+UI, +Emulation)</td>
<td>Shift-Control + F12</td>
<td>Shift-Control + F12</td>
</tr>
<tr>
<td>Select <i>next</i> mouse cursor visiblity option
(-UI, -Emulation/</br>-UI, +Emulation/+UI, -Emulation/+UI, +Emulation)</td>
<td>Control + F12</td>
<td>Control + F12</td>
</tr>
<tr>
<td>Toggle grab mouse</td>
<td>Control + g</td>
<td>Control + g</td>
</tr>
<tr>
<td>Select <i>previous</i> left port controller type</td>
<td>Shift-Control + 2</td>
<td>Shift-Control + 2</td>
</tr>
<tr>
<td>Select <i>next</i> left port controller type</td>
<td>Control + 2</td>
<td>Control + 2</td>
</tr>
<tr>
<td>Select <i>previous</i> right port controller type</td>
<td>Shift-Control + 3</td>
<td>Shift-Control + 3</td>
</tr>
<tr>
<td>Select <i>next</i> right port controller type</td>
<td>Control + 3</td>
<td>Control + 3</td>
</tr>
<tr>
<td>Toggle swap left and right controller ports</td>
<td>Control + 4</td>
<td>Control + 4</td>
</tr>
<tr>
<td>Toggle swap paddles</td>
<td>Control + 5</td>
<td>Control + 5</td>
</tr>
<tr>
<td><i>Decrease</i> horizontal center of paddles </td>
<td>Shift-Control + 6</td>
<td>Shift-Control + 6</td>
</tr>
<tr>
<td><i>Increase</i> horizontal center of paddles </td>
<td>Control + 6</td>
<td>Control + 6</td>
</tr>
<tr>
<td><i>Decrease</i> vertical center of paddles </td>
<td>Shift-Control + 7</td>
<td>Shift-Control + 7</td>
</tr>
<tr>
<td><i>Increase</i> vertical center of paddles </td>
<td>Control + 7</td>
<td>Control + 7</td>
</tr>
<tr>
<td>Switch mouse to <i>previous</i> controller emulation mode</br>(see <b><a href="#Controller">Controller Properties</a></b>)</td>
<td>Shift-Control + 0</td>
<td>Shift-Control + 0</td>
</tr>
<tr>
<td>Switch mouse to <i>next</i> controller emulation modes</br>(see <b><a href="#Controller">Controller Properties</a></b>)</td>
<td>Control + 0</td>
<td>Control + 0</td>
</tr>
<tr>
<td><i>Decrease</i> mouse paddle axes range</td>
<td>Shift-Control + 8</td>
<td>Shift-Control + 8</td>
</tr>
<tr>
<td><i>Increase</i> mouse paddle axes range</td>
<td>Control + 8</td>
<td>Control + 8</td>
</tr>
<tr>
<td colspan="3"><center><font size="-1">
These settings can also be changed using <a href="#GlobalKeys"><b>Global Keys</a></font></center>
</td>
</tr>
</table>
<a name="DeveloperKeys"></a> <a name="DeveloperKeys"></a>
<p><b>Developer Keys (can be remapped)</b></p> <p><b>Developer Keys (can be remapped)</b></p>
@ -1687,7 +1931,7 @@
<p><b><a name="GlobalKeys">Global Keys</a> (can be remapped)</b></p> <p><b><a name="GlobalKeys">Global Keys</a> (can be remapped)</b></p>
<p>These keys allow selecting and changing settings without having to remember the <p>These keys allow selecting and changing settings without having to remember the
dedicated keys. They keys are grouped by Audio & Video and Debug settings.</p> dedicated keys. They keys are grouped by 'Audio & Video', 'Input Device & Ports' and 'Debug' settings.</p>
<table BORDER=2 cellpadding=4> <table BORDER=2 cellpadding=4>
<tr> <tr>
<th>Function</th> <th>Function</th>
@ -1729,7 +1973,7 @@
<ul> <ul>
<li>Only available if UI messages are enabled.</li> <li>Only available if UI messages are enabled.</li>
<li>Currently not available settings are automatically skipped.</li> <li>Currently not available settings are automatically skipped.</li>
<li>If a setting was selected via dedicated key, its value can also be changed with the <li>If a setting was previously selected via a dedicated key, its value can also be changed with the
global keys.</li> global keys.</li>
</ul> </ul>
</p> </p>
@ -1743,23 +1987,18 @@
<th>Key (macOS)</th> <th>Key (macOS)</th>
</tr> </tr>
<tr> <tr>
<td>Load <i>previous</i> game in ROM (multicart ROM, TIA mode)</td> <td>Load <i>previous</i> game in ROM (multicart ROM)</td>
<td>Shift-Control + r</td> <td>Shift-Control + r</td>
<td>Shift-Control + r</td> <td>Shift-Control + r</td>
</tr> </tr>
<tr> <tr>
<td>Reload current ROM (singlecart ROM, TIA mode)<br> <td>Reload current ROM (singlecart ROM)<br>
Load <i>next</i> game in ROM (multicart ROM, TIA mode)</td> Load <i>next</i> game in ROM (multicart ROM)</td>
<td>Control + r</td> <td>Control + r</td>
<td>Control + r</td> <td>Control + r</td>
</tr> </tr>
<tr> <tr>
<td>Reload ROM listing (ROM launcher mode)</td> <td>Emulate 'frying' effect</td>
<td>Control + r</td>
<td>Control + r</td>
</tr>
<tr>
<td>Emulate 'frying' effect (TIA mode)</td>
<td>Backspace</td> <td>Backspace</td>
<td>Backspace</td> <td>Backspace</td>
</tr> </tr>
@ -1778,33 +2017,7 @@
<td>Control + t</td> <td>Control + t</td>
<td>Control + t</td> <td>Control + t</td>
</tr> </tr>
<tr>
<td><i>Decrease</i> autofire rate</td>
<td>Shift-Control + a</td>
<td>Shift-Control + a</td>
</tr>
<tr>
<td><i>Increase</i> autofire rate</td>
<td>Control + a</td>
<td>Control + a</td>
</tr>
<tr>
<td>Switch mouse between controller emulation modes</br>(see <b><a href="#Controller">Controller Properties</a></b>)</td>
<td>Control + 0</td>
<td>Control + 0</td>
</tr>
<tr>
<td>Toggle grab mouse</td>
<td>Control + g</td>
<td>Control + g</td>
</tr>
<tr>
<td>Swap Stelladaptor/2600-daptor port ordering</td>
<td>Control + 1</td>
<td>Control + 1</td>
</tr>
<tr> <tr>
<td>Save continuous PNG snapshots</br>(per interval defined in <a href="#Snapshots"><b>Snapshot Settings</b></a>)</td> <td>Save continuous PNG snapshots</br>(per interval defined in <a href="#Snapshots"><b>Snapshot Settings</b></a>)</td>
<td>Control-Alt + s</td> <td>Control-Alt + s</td>
@ -2691,7 +2904,7 @@
<tr> <tr>
<td><pre>-psense &lt;number&gt;</pre></td> <td><pre>-psense &lt;number&gt;</pre></td>
<td>Sensitivity for emulation of paddles when using analog paddles. <td>Sensitivity for emulation of paddles when using analog paddles.
Valid range of values is from 1 to 30, with larger numbers causing Valid range of values is from 0 to 30, with larger numbers causing
faster movement.</td> faster movement.</td>
</tr> </tr>
@ -2706,8 +2919,9 @@
</tr> </tr>
<tr> <tr>
<td><pre>-dcsense &lt;number&gt;</pre></td> <td><pre>-dsense &lt;number&gt;</pre></td>
<td>Sensitivity for emulation of driving controllers when using a mouse. <td>Sensitivity for emulation of paddles when using a digital device
(i.e. joystick digital axis or button, keyboard key, etc.).
Valid range of values is from 1 to 20, with larger numbers causing Valid range of values is from 1 to 20, with larger numbers causing
faster movement.</td> faster movement.</td>
</tr> </tr>
@ -2767,11 +2981,10 @@
</tr> </tr>
<tr> <tr>
<td><pre>-dsense &lt;number&gt;</pre></td> <td><pre>-dcsense &lt;number&gt;</pre></td>
<td>Sensitivity for emulation of paddles when using a digital device <td>Sensitivity for emulation of driving controllers when using a mouse
(ie, joystick digital axis or button, keyboard key, etc.). or a digital device. Valid range of values is from 1 to 20, with larger
Valid range of values is from 1 to 20, with larger numbers causing numbers causing faster movement.</td>
faster movement.</td>
</tr> </tr>
<tr> <tr>
@ -3684,8 +3897,10 @@
<tr><th>Item</th><th>Brief description</th><th>For more information,<br>see <a href="#CommandLine">Command Line</a></th></tr> <tr><th>Item</th><th>Brief description</th><th>For more information,<br>see <a href="#CommandLine">Command Line</a></th></tr>
<tr><td>Joystick deadzone size</td><td>Deadzone area for axes on joysticks/gamepads</td><td>-joydeadzone</td></tr> <tr><td>Joystick deadzone size</td><td>Deadzone area for axes on joysticks/gamepads</td><td>-joydeadzone</td></tr>
<tr><td>(Analog paddle) Sensitivity</td><td>Sensitivity of an analog paddle</td><td>-psense</td></tr> <tr><td>(Analog paddle) Sensitivity</td><td>Sensitivity of an analog paddle</td><td>-psense</td></tr>
<tr><td>Analog paddle) Dejitter averaging</td><td>Strength of paddle input averaging, suppresses mouse jitter</td><td>-dejitter.base</td></tr> <tr><td>(Analog paddle) Dejitter averaging</td><td>Strength of paddle input averaging, suppresses paddle jitter.<br>
<tr><td>(Analog paddle) Dejitter reaction</td><td>Strength of paddle reaction to fast paddle movements, suppresses mouse jitter</td><td>-dejitter.diff</td></tr> Note: The 2600-daptor has built-in dejitter, so there should be no need to use Stella's dejitter.
</td><td>-dejitter.base</td></tr>
<tr><td>(Analog paddle) Dejitter reaction</td><td>Strength of paddle reaction to fast paddle movements, suppresses paddle jitter.</td><td>-dejitter.diff</td></tr>
<tr><td>Digital paddle sensitivity</td><td>Sensitivity used when emulating a paddle using a digital device</td><td>-dsense</td></tr> <tr><td>Digital paddle sensitivity</td><td>Sensitivity used when emulating a paddle using a digital device</td><td>-dsense</td></tr>
<tr><td>Autofire rate</td><td>Automatic trigger rate of the fire buttons in Hz</td><td>-autofirerate</td></tr> <tr><td>Autofire rate</td><td>Automatic trigger rate of the fire buttons in Hz</td><td>-autofirerate</td></tr>
<tr><td>Allow all 4 directions ...</td><td>Allow all 4 joystick directions to be pressed simultaneously</td><td>-joyallow4</td></tr> <tr><td>Allow all 4 directions ...</td><td>Allow all 4 joystick directions to be pressed simultaneously</td><td>-joyallow4</td></tr>
@ -3710,7 +3925,7 @@
<tr><td>Use mouse as ...</td><td>Allow the mouse to emulate various controllers</td><td>-usemouse</td></tr> <tr><td>Use mouse as ...</td><td>Allow the mouse to emulate various controllers</td><td>-usemouse</td></tr>
<tr><td>(Sensitivity) Paddle</td><td>Sensitivity used when emulating a paddle using a mouse</td><td>-msense</td></tr> <tr><td>(Sensitivity) Paddle</td><td>Sensitivity used when emulating a paddle using a mouse</td><td>-msense</td></tr>
<tr><td>(Sensitivity) Trackball</td><td>Sensitivity used when emulating a trackball device using a mouse</td><td>-tsense</td></tr> <tr><td>(Sensitivity) Trackball</td><td>Sensitivity used when emulating a trackball device using a mouse</td><td>-tsense</td></tr>
<tr><td>(Sensitivity) Driving controller</td><td>Sensitivity used when emulating a driving controller device using a mouse</td><td>-dcsense</td></tr> <tr><td>(Sensitivity) Driving controller</td><td>Sensitivity used when emulating a driving controller device using a mouse or a digital device</td><td>-dcsense</td></tr>
<tr><td>Mouse cursor visibility</td><td>Show/hide cursor depending on current state</td><td>-cursor</td></tr> <tr><td>Mouse cursor visibility</td><td>Show/hide cursor depending on current state</td><td>-cursor</td></tr>
<tr><td>Grab mouse ...</td><td>Keep mouse in window in emulation mode<br/>(only when used as controller)<br/> <tr><td>Grab mouse ...</td><td>Keep mouse in window in emulation mode<br/>(only when used as controller)<br/>
Note: The sensitivity may greatly vary when the mouse is not grabbed.</td><td>-grabmouse</td></tr> Note: The sensitivity may greatly vary when the mouse is not grabbed.</td><td>-grabmouse</td></tr>
@ -3787,7 +4002,7 @@
<h3><b><a name="ROMLauncherContextMenu">ROM Launcher Context Menu</a></b></h3> <h3><b><a name="ROMLauncherContextMenu">ROM Launcher Context Menu</a></b></h3>
<p>The ROM launcher also contains a context menu, selected by clicking the <p>The ROM launcher also contains a context menu, selected by clicking the
right mouse button anywhere in the current window. This context menu right mouse button in the ROM list. This context menu
contains the following items:</p> contains the following items:</p>
<p><ol> <p><ol>
@ -3819,8 +4034,11 @@
</td> </td>
</tr> </tr>
</table> </table>
<p>This dialog can also be opened by pressing 'Control + p'.</p>
</li> </li>
<br><li><b>High scores</b>: This option displays the <a href="#HighScores">High Scores</a> dialog for the selected ROM.</li> <li><b>High scores</b>: This option displays the <a href="#HighScores">
High Scores</a> dialog for the selected ROM. Only available if high score
properties have been setup for the ROM. Also available via 'Control + h' keys combo.</li>
</li> </li>
<br><li><b>Reload listing</b>: Selecting this performs a reload of the <br><li><b>Reload listing</b>: 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'
@ -4133,7 +4351,7 @@
<p><ul> <p><ul>
<li>Developer key-combo shortcuts, used to change TIA state dynamically <li>Developer key-combo shortcuts, used to change TIA state dynamically
(ie, while the emulation is still running). See <b>Keyboard Layout - (ie, while the emulation is still running). See <b>Keyboard Layout -
<a href="#DeveloperKeys">Developer Keys in TIA mode</a></b> for more information.</li> <a href="#DeveloperKeys">Developer Keys</a></b> for more information.</li>
<li>Commandline options influencing emulation state. See <b>Using the Command Line - <li>Commandline options influencing emulation state. See <b>Using the Command Line -
<a href="#DeveloperCommandLine">Developer Commands</a></b> for more information.</li> <a href="#DeveloperCommandLine">Developer Commands</a></b> for more information.</li>

View File

@ -28,7 +28,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CheatManager::CheatManager(OSystem& osystem) CheatManager::CheatManager(OSystem& osystem)
: myOSystem(osystem) : myOSystem{osystem}
{ {
} }

View File

@ -23,9 +23,9 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CheetahCheat::CheetahCheat(OSystem& os, const string& name, const string& code) CheetahCheat::CheetahCheat(OSystem& os, const string& name, const string& code)
: Cheat(os, name, code), : Cheat(os, name, code),
address(0xf000 + unhex(code.substr(0, 3))), address{uInt16(0xf000 + unhex(code.substr(0, 3)))},
value(uInt8(unhex(code.substr(3, 2)))), value{uInt8(unhex(code.substr(3, 2)))},
count(uInt8(unhex(code.substr(5, 1)) + 1)) count{uInt8(unhex(code.substr(5, 1)) + 1)}
{ {
// Back up original data; we need this if the cheat is ever disabled // Back up original data; we need this if the cheat is ever disabled
for(int i = 0; i < count; ++i) for(int i = 0; i < count; ++i)

View File

@ -25,8 +25,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
RamCheat::RamCheat(OSystem& os, const string& name, const string& code) RamCheat::RamCheat(OSystem& os, const string& name, const string& code)
: Cheat(os, name, code), : Cheat(os, name, code),
address(uInt16(unhex(myCode.substr(0, 2)))), address{uInt16(unhex(myCode.substr(0, 2)))},
value(uInt8(unhex(myCode.substr(2, 2)))) value{uInt8(unhex(myCode.substr(2, 2)))}
{ {
} }

View File

@ -22,10 +22,10 @@ using std::lock_guard;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AudioQueue::AudioQueue(uInt32 fragmentSize, uInt32 capacity, bool isStereo) AudioQueue::AudioQueue(uInt32 fragmentSize, uInt32 capacity, bool isStereo)
: myFragmentSize(fragmentSize), : myFragmentSize{fragmentSize},
myIsStereo(isStereo), myIsStereo{isStereo},
myFragmentQueue(capacity), myFragmentQueue{capacity},
myAllFragments(capacity + 2) myAllFragments{capacity + 2}
{ {
const uInt8 sampleSize = myIsStereo ? 2 : 1; const uInt8 sampleSize = myIsStereo ? 2 : 1;
@ -48,7 +48,7 @@ uInt32 AudioQueue::capacity() const
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 AudioQueue::size() uInt32 AudioQueue::size() const
{ {
lock_guard<mutex> guard(myMutex); lock_guard<mutex> guard(myMutex);

View File

@ -55,7 +55,7 @@ class AudioQueue
/** /**
Size getter. Size getter.
*/ */
uInt32 size(); uInt32 size() const;
/** /**
Stereo / mono getter. Stereo / mono getter.
@ -120,7 +120,7 @@ class AudioQueue
uInt32 myNextFragment{0}; uInt32 myNextFragment{0};
// We need a mutex for thread safety. // We need a mutex for thread safety.
std::mutex myMutex; mutable std::mutex myMutex;
// The first (empty) enqueue call returns this fragment. // The first (empty) enqueue call returns this fragment.
Int16* myFirstFragmentForEnqueue{nullptr}; Int16* myFirstFragmentForEnqueue{nullptr};

View File

@ -43,7 +43,7 @@ namespace {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AudioSettings::AudioSettings(Settings& settings) AudioSettings::AudioSettings(Settings& settings)
: mySettings(settings) : mySettings{settings}
{ {
setPreset(normalizedPreset(mySettings.getInt(SETTING_PRESET))); setPreset(normalizedPreset(mySettings.getInt(SETTING_PRESET)));
} }

View File

@ -129,13 +129,13 @@ class AudioSettings
Settings& mySettings; Settings& mySettings;
Preset myPreset; Preset myPreset{Preset::custom};
uInt32 myPresetSampleRate{0}; uInt32 myPresetSampleRate{0};
uInt32 myPresetFragmentSize{0}; uInt32 myPresetFragmentSize{0};
uInt32 myPresetBufferSize{0}; uInt32 myPresetBufferSize{0};
uInt32 myPresetHeadroom{0}; uInt32 myPresetHeadroom{0};
ResamplingQuality myPresetResamplingQuality; ResamplingQuality myPresetResamplingQuality{ResamplingQuality::nearestNeightbour};
bool myIsPersistent{true}; bool myIsPersistent{true};
}; };

View File

@ -23,7 +23,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EventHandlerSDL2::EventHandlerSDL2(OSystem& osystem) EventHandlerSDL2::EventHandlerSDL2(OSystem& osystem)
: EventHandler(osystem) : EventHandler{osystem}
{ {
ASSERT_MAIN_THREAD; ASSERT_MAIN_THREAD;

View File

@ -31,7 +31,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FBBackendSDL2::FBBackendSDL2(OSystem& osystem) FBBackendSDL2::FBBackendSDL2(OSystem& osystem)
: myOSystem(osystem) : myOSystem{osystem}
{ {
ASSERT_MAIN_THREAD; ASSERT_MAIN_THREAD;
@ -39,9 +39,8 @@ FBBackendSDL2::FBBackendSDL2(OSystem& osystem)
if(SDL_InitSubSystem(SDL_INIT_VIDEO | SDL_INIT_TIMER) < 0) if(SDL_InitSubSystem(SDL_INIT_VIDEO | SDL_INIT_TIMER) < 0)
{ {
ostringstream buf; ostringstream buf;
buf << "ERROR: Couldn't initialize SDL: " << SDL_GetError() << endl; buf << "ERROR: Couldn't initialize SDL: " << SDL_GetError();
Logger::error(buf.str()); throw runtime_error(buf.str());
throw runtime_error("FATAL ERROR");
} }
Logger::debug("FBBackendSDL2::FBBackendSDL2 SDL_Init()"); Logger::debug("FBBackendSDL2::FBBackendSDL2 SDL_Init()");

View File

@ -45,8 +45,8 @@ FBSurfaceSDL2::FBSurfaceSDL2(FBBackendSDL2& backend,
uInt32 width, uInt32 height, uInt32 width, uInt32 height,
ScalingInterpolation inter, ScalingInterpolation inter,
const uInt32* staticData) const uInt32* staticData)
: myBackend(backend), : myBackend{backend},
myInterpolationMode(inter) myInterpolationMode{inter}
{ {
createSurface(width, height, staticData); createSurface(width, height, staticData);
} }

View File

@ -94,8 +94,8 @@ FilesystemNodeZIP::FilesystemNodeZIP(const string& p)
FilesystemNodeZIP::FilesystemNodeZIP( FilesystemNodeZIP::FilesystemNodeZIP(
const string& zipfile, const string& virtualpath, const string& zipfile, const string& virtualpath,
const AbstractFSNodePtr& realnode, bool isdir) const AbstractFSNodePtr& realnode, bool isdir)
: _isDirectory(isdir), : _isDirectory{isdir},
_isFile(!isdir) _isFile{!isdir}
{ {
setFlags(zipfile, virtualpath, realnode); setFlags(zipfile, virtualpath, realnode);
} }

View File

@ -21,7 +21,7 @@ using namespace std::chrono;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FpsMeter::FpsMeter(uInt32 queueSize) FpsMeter::FpsMeter(uInt32 queueSize)
: myQueue(queueSize) : myQueue{queueSize}
{ {
reset(); reset();
} }

View File

@ -60,7 +60,7 @@ using Common::Base;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
HighScoresManager::HighScoresManager(OSystem& osystem) HighScoresManager::HighScoresManager(OSystem& osystem)
: myOSystem(osystem) : myOSystem{osystem}
{ {
} }

View File

@ -92,7 +92,7 @@ namespace HSM {
class HighScoresManager class HighScoresManager
{ {
public: public:
HighScoresManager(OSystem& osystem); explicit HighScoresManager(OSystem& osystem);
virtual ~HighScoresManager() = default; virtual ~HighScoresManager() = default;

View File

@ -196,9 +196,6 @@ json JoyMap::saveMapping(const EventMode mode) const
[](const MapType& a, const MapType& b) [](const MapType& a, const MapType& b)
{ {
// Event::Type first // Event::Type first
if(a.second != b.second)
return a.second < b.second;
if(a.first.button != b.first.button) if(a.first.button != b.first.button)
return a.first.button < b.first.button; return a.first.button < b.first.button;
@ -211,7 +208,10 @@ json JoyMap::saveMapping(const EventMode mode) const
if(a.first.hat != b.first.hat) if(a.first.hat != b.first.hat)
return a.first.hat < b.first.hat; return a.first.hat < b.first.hat;
if(a.first.hdir != b.first.hdir)
return a.first.hdir < b.first.hdir; return a.first.hdir < b.first.hdir;
return a.second < b.second;
} }
); );

View File

@ -44,19 +44,19 @@ class JoyMap
explicit JoyMapping(EventMode c_mode, int c_button, explicit JoyMapping(EventMode c_mode, int c_button,
JoyAxis c_axis, JoyDir c_adir, JoyAxis c_axis, JoyDir c_adir,
int c_hat, JoyHatDir c_hdir) int c_hat, JoyHatDir c_hdir)
: mode(c_mode), button(c_button), : mode{c_mode}, button{c_button},
axis(c_axis), adir(c_adir), axis{c_axis}, adir{c_adir},
hat(c_hat), hdir(c_hdir) { } hat{c_hat}, hdir{c_hdir} { }
explicit JoyMapping(EventMode c_mode, int c_button, explicit JoyMapping(EventMode c_mode, int c_button,
JoyAxis c_axis, JoyDir c_adir) JoyAxis c_axis, JoyDir c_adir)
: mode(c_mode), button(c_button), : mode{c_mode}, button{c_button},
axis(c_axis), adir(c_adir), axis{c_axis}, adir{c_adir},
hat(JOY_CTRL_NONE), hdir(JoyHatDir::CENTER) { } hat{JOY_CTRL_NONE}, hdir{JoyHatDir::CENTER} { }
explicit JoyMapping(EventMode c_mode, int c_button, explicit JoyMapping(EventMode c_mode, int c_button,
int c_hat, JoyHatDir c_hdir) int c_hat, JoyHatDir c_hdir)
: mode(c_mode), button(c_button), : mode{c_mode}, button{c_button},
axis(JoyAxis::NONE), adir(JoyDir::NONE), axis{JoyAxis::NONE}, adir{JoyDir::NONE},
hat(c_hat), hdir(c_hdir) { } hat{c_hat}, hdir{c_hdir} { }
JoyMapping(const JoyMapping&) = default; JoyMapping(const JoyMapping&) = default;
JoyMapping& operator=(const JoyMapping&) = default; JoyMapping& operator=(const JoyMapping&) = default;

View File

@ -228,13 +228,13 @@ json KeyMap::saveMapping(const EventMode mode) const
[](const MapType& a, const MapType& b) [](const MapType& a, const MapType& b)
{ {
// Event::Type first // Event::Type first
if(a.second != b.second)
return a.second < b.second;
if(a.first.key != b.first.key) if(a.first.key != b.first.key)
return a.first.key < b.first.key; return a.first.key < b.first.key;
if(a.first.mod != b.first.mod)
return a.first.mod < b.first.mod; return a.first.mod < b.first.mod;
return a.second < b.second;
} }
); );
@ -300,7 +300,8 @@ json KeyMap::convertLegacyMapping(string list)
mapping["event"] = Event::Type(event); mapping["event"] = Event::Type(event);
mapping["key"] = StellaKey(key); mapping["key"] = StellaKey(key);
if(StellaMod(mod) != StellaMod::KBDM_NONE) mapping["mod"] = StellaMod(mod); if(StellaMod(mod) != StellaMod::KBDM_NONE)
mapping["mod"] = serializeModkeyMask(StellaMod(mod));
convertedMapping.push_back(mapping); convertedMapping.push_back(mapping);
} }

View File

@ -39,9 +39,9 @@ class KeyMap
StellaMod mod{StellaMod(0)}; StellaMod mod{StellaMod(0)};
explicit Mapping(EventMode c_mode, StellaKey c_key, StellaMod c_mod) explicit Mapping(EventMode c_mode, StellaKey c_key, StellaMod c_mod)
: mode(c_mode), key(c_key), mod(c_mod) { } : mode{c_mode}, key{c_key}, mod{c_mod} { }
explicit Mapping(EventMode c_mode, int c_key, int c_mod) explicit Mapping(EventMode c_mode, int c_key, int c_mod)
: mode(c_mode), key(StellaKey(c_key)), mod(StellaMod(c_mod)) { } : mode{c_mode}, key{StellaKey(c_key)}, mod{StellaMod(c_mod)} { }
Mapping(const Mapping&) = default; Mapping(const Mapping&) = default;
Mapping& operator=(const Mapping&) = default; Mapping& operator=(const Mapping&) = default;
Mapping(Mapping&&) = default; Mapping(Mapping&&) = default;

View File

@ -24,9 +24,9 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MouseControl::MouseControl(Console& console, const string& mode) MouseControl::MouseControl(Console& console, const string& mode)
: myProps(console.properties()), : myProps{console.properties()},
myLeftController(console.leftController()), myLeftController{console.leftController()},
myRightController(console.rightController()) myRightController{console.rightController()}
{ {
istringstream m_axis(mode); istringstream m_axis(mode);
string m_mode; string m_mode;
@ -137,14 +137,18 @@ MouseControl::MouseControl(Console& console, const string& mode)
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const string& MouseControl::next() const string& MouseControl::change(int direction)
{ {
myCurrentModeNum = BSPF::clampw(myCurrentModeNum + direction, 0, int(myModeList.size() - 1));
const MouseMode& mode = myModeList[myCurrentModeNum]; const MouseMode& mode = myModeList[myCurrentModeNum];
myCurrentModeNum = (myCurrentModeNum + 1) % myModeList.size();
bool leftControl =
myLeftController.setMouseControl(mode.xtype, mode.xid, mode.ytype, mode.yid); myLeftController.setMouseControl(mode.xtype, mode.xid, mode.ytype, mode.yid);
bool rightControl =
myRightController.setMouseControl(mode.xtype, mode.xid, mode.ytype, mode.yid); myRightController.setMouseControl(mode.xtype, mode.xid, mode.ytype, mode.yid);
myHasMouseControl = leftControl || rightControl;
return mode.message; return mode.message;
} }

View File

@ -62,7 +62,12 @@ class MouseControl
@return A message explaining the current mouse mode @return A message explaining the current mouse mode
*/ */
const string& next(); const string& change(int direction = +1);
/**
Get whether any current controller supports mouse control
*/
bool hasMouseControl() const { return myHasMouseControl; }
private: private:
void addLeftControllerModes(bool noswap); void addLeftControllerModes(bool noswap);
@ -101,6 +106,7 @@ class MouseControl
int myCurrentModeNum{0}; int myCurrentModeNum{0};
vector<MouseMode> myModeList; vector<MouseMode> myModeList;
bool myHasMouseControl{false};
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported

View File

@ -19,6 +19,9 @@
#include "OSystem.hxx" #include "OSystem.hxx"
#include "Console.hxx" #include "Console.hxx"
#include "Joystick.hxx" #include "Joystick.hxx"
#include "Paddles.hxx"
#include "PointingDevice.hxx"
#include "Driving.hxx"
#include "Settings.hxx" #include "Settings.hxx"
#include "EventHandler.hxx" #include "EventHandler.hxx"
#include "PJoystickHandler.hxx" #include "PJoystickHandler.hxx"
@ -33,8 +36,8 @@ using json = nlohmann::json;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PhysicalJoystickHandler::PhysicalJoystickHandler( PhysicalJoystickHandler::PhysicalJoystickHandler(
OSystem& system, EventHandler& handler) OSystem& system, EventHandler& handler)
: myOSystem(system), : myOSystem{system},
myHandler(handler) myHandler{handler}
{ {
if(myOSystem.settings().getInt("event_ver") != Event::VERSION) { if(myOSystem.settings().getInt("event_ver") != Event::VERSION) {
Logger::info("event version mismatch; dropping previous joystick mappings"); Logger::info("event version mismatch; dropping previous joystick mappings");
@ -132,12 +135,13 @@ int PhysicalJoystickHandler::add(const PhysicalJoystickPtr& stick)
name << stick->name << " #" << count+1; name << stick->name << " #" << count+1;
stick->name = name.str(); stick->name = name.str();
} }
stick->type = PhysicalJoystick::JT_REGULAR; stick->type = PhysicalJoystick::Type::REGULAR;
} }
// The stick *must* be inserted here, since it may be used below // The stick *must* be inserted here, since it may be used below
mySticks[stick->ID] = stick; mySticks[stick->ID] = stick;
// Map the stelladaptors we've found according to the specified ports // Map the stelladaptors we've found according to the specified ports
// The 'type' is also set there
if(specialAdaptor) if(specialAdaptor)
mapStelladaptors(myOSystem.settings().getString("saport")); mapStelladaptors(myOSystem.settings().getString("saport"));
@ -236,12 +240,12 @@ void PhysicalJoystickHandler::mapStelladaptors(const string& saport)
if(saOrder[saCount] == 1) if(saOrder[saCount] == 1)
{ {
_joyptr->name += " (emulates left joystick port)"; _joyptr->name += " (emulates left joystick port)";
_joyptr->type = PhysicalJoystick::JT_STELLADAPTOR_LEFT; _joyptr->type = PhysicalJoystick::Type::LEFT_STELLADAPTOR;
} }
else if(saOrder[saCount] == 2) else if(saOrder[saCount] == 2)
{ {
_joyptr->name += " (emulates right joystick port)"; _joyptr->name += " (emulates right joystick port)";
_joyptr->type = PhysicalJoystick::JT_STELLADAPTOR_RIGHT; _joyptr->type = PhysicalJoystick::Type::RIGHT_STELLADAPTOR;
} }
saCount++; saCount++;
} }
@ -250,12 +254,12 @@ void PhysicalJoystickHandler::mapStelladaptors(const string& saport)
if(saOrder[saCount] == 1) if(saOrder[saCount] == 1)
{ {
_joyptr->name += " (emulates left joystick port)"; _joyptr->name += " (emulates left joystick port)";
_joyptr->type = PhysicalJoystick::JT_2600DAPTOR_LEFT; _joyptr->type = PhysicalJoystick::Type::LEFT_2600DAPTOR;
} }
else if(saOrder[saCount] == 2) else if(saOrder[saCount] == 2)
{ {
_joyptr->name += " (emulates right joystick port)"; _joyptr->name += " (emulates right joystick port)";
_joyptr->type = PhysicalJoystick::JT_2600DAPTOR_RIGHT; _joyptr->type = PhysicalJoystick::Type::RIGHT_2600DAPTOR;
} }
saCount++; saCount++;
} }
@ -263,6 +267,24 @@ void PhysicalJoystickHandler::mapStelladaptors(const string& saport)
myOSystem.settings().setValue("saport", saport); myOSystem.settings().setValue("saport", saport);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool PhysicalJoystickHandler::hasStelladaptors() const
{
for(auto& [_id, _joyptr] : mySticks)
{
// remove previously added emulated ports
size_t pos = _joyptr->name.find(" (emulates ");
if(pos != std::string::npos)
_joyptr->name.erase(pos);
if(BSPF::startsWithIgnoreCase(_joyptr->name, "Stelladaptor")
|| BSPF::startsWithIgnoreCase(_joyptr->name, "2600-daptor"))
return true;
}
return false;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Depending on parameters, this method does the following: // Depending on parameters, this method does the following:
// 1. update all events with default (event == Event::NoType, updateDefault == true) // 1. update all events with default (event == Event::NoType, updateDefault == true)
@ -313,7 +335,15 @@ void PhysicalJoystickHandler::setStickDefaultMapping(int stick, Event::Type even
switch (mode) switch (mode)
{ {
case EventMode::kEmulationMode: case EventMode::kEmulationMode:
if((stick % 2) == 0) // even sticks {
// A regular joystick defaults to left or right based on the
// stick number being even or odd; 'daptor joysticks request a
// specific port
const bool useLeftMappings =
j->type == PhysicalJoystick::Type::REGULAR ? ((stick % 2) == 0) :
(j->type == PhysicalJoystick::Type::LEFT_STELLADAPTOR ||
j->type == PhysicalJoystick::Type::LEFT_2600DAPTOR);
if(useLeftMappings)
{ {
// put all controller events into their own mode's mappings // put all controller events into their own mode's mappings
for (const auto& item : DefaultLeftJoystickMapping) for (const auto& item : DefaultLeftJoystickMapping)
@ -323,7 +353,7 @@ void PhysicalJoystickHandler::setStickDefaultMapping(int stick, Event::Type even
for (const auto& item : DefaultLeftKeypadMapping) for (const auto& item : DefaultLeftKeypadMapping)
setDefaultAction(stick, item, event, EventMode::kKeypadMode, updateDefaults); setDefaultAction(stick, item, event, EventMode::kKeypadMode, updateDefaults);
} }
else // odd sticks else
{ {
// put all controller events into their own mode's mappings // put all controller events into their own mode's mappings
for (const auto& item : DefaultRightJoystickMapping) for (const auto& item : DefaultRightJoystickMapping)
@ -338,6 +368,7 @@ void PhysicalJoystickHandler::setStickDefaultMapping(int stick, Event::Type even
// update running emulation mapping too // update running emulation mapping too
enableEmulationMappings(); enableEmulationMappings();
break; break;
}
case EventMode::kMenuMode: case EventMode::kMenuMode:
for (const auto& item : DefaultMenuMapping) for (const auto& item : DefaultMenuMapping)
@ -840,6 +871,147 @@ ostream& operator<<(ostream& os, const PhysicalJoystickHandler& jh)
return os; return os;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void PhysicalJoystickHandler::changeDeadzone(int direction)
{
int deadzone = BSPF::clamp(myOSystem.settings().getInt("joydeadzone") + direction,
Joystick::DEAD_ZONE_MIN, Joystick::DEAD_ZONE_MAX);
myOSystem.settings().setValue("joydeadzone", deadzone);
Joystick::setDeadZone(deadzone);
int value = Joystick::deadZoneValue(deadzone);
myOSystem.frameBuffer().showGaugeMessage("Joystick deadzone", std::to_string(value),
value, 3200, 32200);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void PhysicalJoystickHandler::changeAnalogPaddleSensitivity(int direction)
{
int sense = BSPF::clamp(myOSystem.settings().getInt("psense") + direction,
Paddles::MIN_ANALOG_SENSE, Paddles::MAX_ANALOG_SENSE);
myOSystem.settings().setValue("psense", sense);
Paddles::setAnalogSensitivity(sense);
ostringstream ss;
ss << std::round(Paddles::analogSensitivityValue(sense) * 100.F) << "%";
myOSystem.frameBuffer().showGaugeMessage("Analog paddle sensitivity", ss.str(), sense,
Paddles::MIN_ANALOG_SENSE, Paddles::MAX_ANALOG_SENSE);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void PhysicalJoystickHandler::changePaddleDejitterAveraging(int direction)
{
int dejitter = BSPF::clamp(myOSystem.settings().getInt("dejitter.base") + direction,
Paddles::MIN_DEJITTER, Paddles::MAX_DEJITTER);
myOSystem.settings().setValue("dejitter.base", dejitter);
Paddles::setDejitterBase(dejitter);
ostringstream ss;
if(dejitter)
ss << dejitter;
else
ss << "Off";
myOSystem.frameBuffer().showGaugeMessage("Analog paddle dejitter averaging",
ss.str(), dejitter,
Paddles::MIN_DEJITTER, Paddles::MAX_DEJITTER);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void PhysicalJoystickHandler::changePaddleDejitterReaction(int direction)
{
int dejitter = BSPF::clamp(myOSystem.settings().getInt("dejitter.diff") + direction,
Paddles::MIN_DEJITTER, Paddles::MAX_DEJITTER);
myOSystem.settings().setValue("dejitter.diff", dejitter);
Paddles::setDejitterDiff(dejitter);
ostringstream ss;
if(dejitter)
ss << dejitter;
else
ss << "Off";
myOSystem.frameBuffer().showGaugeMessage("Analog paddle dejitter reaction",
ss.str(), dejitter,
Paddles::MIN_DEJITTER, Paddles::MAX_DEJITTER);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void PhysicalJoystickHandler::changeDigitalPaddleSensitivity(int direction)
{
int sense = BSPF::clamp(myOSystem.settings().getInt("dsense") + direction,
Paddles::MIN_DIGITAL_SENSE, Paddles::MAX_DIGITAL_SENSE);
myOSystem.settings().setValue("dsense", sense);
Paddles::setDigitalSensitivity(sense);
ostringstream ss;
if(sense)
ss << sense * 10 << "%";
else
ss << "Off";
myOSystem.frameBuffer().showGaugeMessage("Digital sensitivity",
ss.str(), sense,
Paddles::MIN_DIGITAL_SENSE, Paddles::MAX_DIGITAL_SENSE);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void PhysicalJoystickHandler::changeMousePaddleSensitivity(int direction)
{
int sense = BSPF::clamp(myOSystem.settings().getInt("msense") + direction,
Paddles::MIN_MOUSE_SENSE, Paddles::MAX_MOUSE_SENSE);
myOSystem.settings().setValue("msense", sense);
Paddles::setMouseSensitivity(sense);
ostringstream ss;
ss << sense * 10 << "%";
myOSystem.frameBuffer().showGaugeMessage("Mouse paddle sensitivity",
ss.str(), sense,
Paddles::MIN_MOUSE_SENSE, Paddles::MAX_MOUSE_SENSE);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void PhysicalJoystickHandler::changeMouseTrackballSensitivity(int direction)
{
int sense = BSPF::clamp(myOSystem.settings().getInt("tsense") + direction,
PointingDevice::MIN_SENSE, PointingDevice::MAX_SENSE);
myOSystem.settings().setValue("tsense", sense);
PointingDevice::setSensitivity(sense);
ostringstream ss;
ss << sense * 10 << "%";
myOSystem.frameBuffer().showGaugeMessage("Mouse trackball sensitivity",
ss.str(), sense,
PointingDevice::MIN_SENSE, PointingDevice::MAX_SENSE);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void PhysicalJoystickHandler::changeDrivingSensitivity(int direction)
{
int sense = BSPF::clamp(myOSystem.settings().getInt("dcsense") + direction,
Driving::MIN_SENSE, Driving::MAX_SENSE);
myOSystem.settings().setValue("dcsense", sense);
Driving::setSensitivity(sense);
ostringstream ss;
ss << sense * 10 << "%";
myOSystem.frameBuffer().showGaugeMessage("Driving controller sensitivity",
ss.str(), sense,
Driving::MIN_SENSE, Driving::MAX_SENSE);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PhysicalJoystickHandler::EventMappingArray PhysicalJoystickHandler::DefaultLeftJoystickMapping = { PhysicalJoystickHandler::EventMappingArray PhysicalJoystickHandler::DefaultLeftJoystickMapping = {
// Left joystick (assume buttons zero..two) // Left joystick (assume buttons zero..two)
@ -953,7 +1125,8 @@ PhysicalJoystickHandler::EventMappingArray PhysicalJoystickHandler::DefaultRight
}; };
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PhysicalJoystickHandler::EventMappingArray PhysicalJoystickHandler::DefaultCommonMapping = { PhysicalJoystickHandler::EventMappingArray
PhysicalJoystickHandler::DefaultCommonMapping = {
// valid for all joysticks // valid for all joysticks
//#if defined(RETRON77) //#if defined(RETRON77)
{Event::CmdMenuMode, 3}, // Note: buttons 0..2 are used by controllers! {Event::CmdMenuMode, 3}, // Note: buttons 0..2 are used by controllers!
@ -966,7 +1139,8 @@ PhysicalJoystickHandler::EventMappingArray PhysicalJoystickHandler::DefaultCommo
}; };
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PhysicalJoystickHandler::EventMappingArray PhysicalJoystickHandler::DefaultMenuMapping = { PhysicalJoystickHandler::EventMappingArray
PhysicalJoystickHandler::DefaultMenuMapping = {
// valid for all joysticks // valid for all joysticks
{Event::UISelect, 0}, {Event::UISelect, 0},
{Event::UIOK, 1}, {Event::UIOK, 1},

View File

@ -50,7 +50,7 @@ class PhysicalJoystickHandler
struct StickInfo struct StickInfo
{ {
StickInfo(const nlohmann::json& map = nullptr, PhysicalJoystickPtr stick = nullptr) StickInfo(const nlohmann::json& map = nullptr, PhysicalJoystickPtr stick = nullptr)
: mapping(map), joy(std::move(stick)) {} : mapping{map}, joy{std::move(stick)} { }
nlohmann::json mapping; nlohmann::json mapping;
PhysicalJoystickPtr joy; PhysicalJoystickPtr joy;
@ -71,6 +71,7 @@ class PhysicalJoystickHandler
bool remove(int id); bool remove(int id);
bool remove(const string& name); bool remove(const string& name);
void mapStelladaptors(const string& saport); void mapStelladaptors(const string& saport);
bool hasStelladaptors() const;
void setDefaultMapping(Event::Type type, EventMode mode); void setDefaultMapping(Event::Type type, EventMode mode);
/** define mappings for current controllers */ /** define mappings for current controllers */
@ -109,6 +110,15 @@ class PhysicalJoystickHandler
/** Returns a list of pairs consisting of joystick name and associated ID. */ /** Returns a list of pairs consisting of joystick name and associated ID. */
VariantList database() const; VariantList database() const;
void changeDeadzone(int direction = +1);
void changeAnalogPaddleSensitivity(int direction = +1);
void changePaddleDejitterAveraging(int direction = +1);
void changePaddleDejitterReaction(int direction = +1);
void changeDigitalPaddleSensitivity(int direction = +1);
void changeMousePaddleSensitivity(int direction = +1);
void changeMouseTrackballSensitivity(int direction = +1);
void changeDrivingSensitivity(int direction = +1);
private: private:
using StickDatabase = std::map<string,StickInfo>; using StickDatabase = std::map<string,StickInfo>;
using StickList = std::map<int, PhysicalJoystickPtr>; using StickList = std::map<int, PhysicalJoystickPtr>;

View File

@ -40,8 +40,8 @@ static constexpr int MOD3 = KBDM_ALT;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PhysicalKeyboardHandler::PhysicalKeyboardHandler(OSystem& system, EventHandler& handler) PhysicalKeyboardHandler::PhysicalKeyboardHandler(OSystem& system, EventHandler& handler)
: myOSystem(system), : myOSystem{system},
myHandler(handler) myHandler{handler}
{ {
Int32 version = myOSystem.settings().getInt("event_ver"); Int32 version = myOSystem.settings().getInt("event_ver");
bool updateDefaults = false; bool updateDefaults = false;
@ -480,161 +480,215 @@ void PhysicalKeyboardHandler::handleEvent(StellaKey key, StellaMod mod,
} }
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void PhysicalKeyboardHandler::toggleModKeys(bool toggle)
{
bool modCombo = myOSystem.settings().getBool("modcombo");
if(toggle)
{
modCombo = !modCombo;
myKeyMap.enableMod() = modCombo;
myOSystem.settings().setValue("modcombo", modCombo);
}
ostringstream ss;
ss << "Modifier key combos ";
ss << (modCombo ? "enabled" : "disabled");
myOSystem.frameBuffer().showTextMessage(ss.str());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PhysicalKeyboardHandler::EventMappingArray PhysicalKeyboardHandler::EventMappingArray
PhysicalKeyboardHandler::DefaultCommonMapping = { PhysicalKeyboardHandler::DefaultCommonMapping = {
{Event::ConsoleSelect, KBDK_F1}, { Event::ConsoleSelect, KBDK_F1 },
{Event::ConsoleReset, KBDK_F2}, { Event::ConsoleReset, KBDK_F2 },
{Event::ConsoleColor, KBDK_F3}, { Event::ConsoleColor, KBDK_F3 },
{Event::Console7800Pause, KBDK_F3, MOD3}, { Event::Console7800Pause, KBDK_F3, MOD3 },
{Event::ConsoleLeftDiffA, KBDK_F5}, { Event::ConsoleLeftDiffA, KBDK_F5 },
{Event::ConsoleRightDiffA, KBDK_F7}, { Event::ConsoleRightDiffA, KBDK_F7 },
{Event::SaveState, KBDK_F9}, { Event::SaveState, KBDK_F9 },
{Event::SaveAllStates, KBDK_F9, MOD3}, { Event::SaveAllStates, KBDK_F9, MOD3 },
{Event::PreviousState, KBDK_F10, KBDM_SHIFT}, { Event::PreviousState, KBDK_F10, KBDM_SHIFT },
{Event::NextState, KBDK_F10}, { Event::NextState, KBDK_F10 },
{Event::ToggleAutoSlot, KBDK_F10, MOD3}, { Event::ToggleAutoSlot, KBDK_F10, MOD3 },
{Event::LoadState, KBDK_F11}, { Event::LoadState, KBDK_F11 },
{Event::LoadAllStates, KBDK_F11, MOD3}, { Event::LoadAllStates, KBDK_F11, MOD3 },
{Event::TakeSnapshot, KBDK_F12}, { Event::TakeSnapshot, KBDK_F12 },
#ifdef BSPF_MACOS #ifdef BSPF_MACOS
{Event::TogglePauseMode, KBDK_P, KBDM_SHIFT | MOD3}, { Event::TogglePauseMode, KBDK_P, KBDM_SHIFT | MOD3 },
#else #else
{Event::TogglePauseMode, KBDK_PAUSE}, { Event::TogglePauseMode, KBDK_PAUSE },
#endif #endif
{Event::OptionsMenuMode, KBDK_TAB}, { Event::OptionsMenuMode, KBDK_TAB },
{Event::CmdMenuMode, KBDK_BACKSLASH}, { Event::CmdMenuMode, KBDK_BACKSLASH },
{Event::TimeMachineMode, KBDK_T, KBDM_SHIFT}, { Event::TimeMachineMode, KBDK_T, KBDM_SHIFT },
{Event::DebuggerMode, KBDK_GRAVE}, { Event::DebuggerMode, KBDK_GRAVE },
{Event::ExitMode, KBDK_ESCAPE}, { Event::ExitMode, KBDK_ESCAPE },
#ifdef BSPF_MACOS #ifdef BSPF_MACOS
{Event::Quit, KBDK_Q, MOD3}, { Event::Quit, KBDK_Q, MOD3 },
#else #else
{Event::Quit, KBDK_Q, KBDM_CTRL}, { Event::Quit, KBDK_Q, KBDM_CTRL },
#endif #endif
{Event::ReloadConsole, KBDK_R, KBDM_CTRL}, { Event::ReloadConsole, KBDK_R, KBDM_CTRL },
{Event::PreviousMultiCartRom, KBDK_R, KBDM_SHIFT | KBDM_CTRL}, { Event::PreviousMultiCartRom, KBDK_R, KBDM_SHIFT | KBDM_CTRL },
{Event::VidmodeDecrease, KBDK_MINUS, MOD3}, { Event::VidmodeDecrease, KBDK_MINUS, MOD3 },
{Event::VidmodeIncrease, KBDK_EQUALS, MOD3}, { Event::VidmodeIncrease, KBDK_EQUALS, MOD3 },
{Event::VCenterDecrease, KBDK_PAGEUP, MOD3}, { Event::VCenterDecrease, KBDK_PAGEUP, MOD3 },
{Event::VCenterIncrease, KBDK_PAGEDOWN, MOD3}, { Event::VCenterIncrease, KBDK_PAGEDOWN, MOD3 },
{Event::VSizeAdjustDecrease, KBDK_PAGEDOWN, KBDM_SHIFT | MOD3}, { Event::VSizeAdjustDecrease, KBDK_PAGEDOWN, KBDM_SHIFT | MOD3 },
{Event::VSizeAdjustIncrease, KBDK_PAGEUP, KBDM_SHIFT | MOD3}, { Event::VSizeAdjustIncrease, KBDK_PAGEUP, KBDM_SHIFT | MOD3 },
{Event::ToggleCorrectAspectRatio, KBDK_C, KBDM_CTRL}, { Event::ToggleCorrectAspectRatio, KBDK_C, KBDM_CTRL },
{Event::VolumeDecrease, KBDK_LEFTBRACKET, MOD3}, { Event::VolumeDecrease, KBDK_LEFTBRACKET, MOD3 },
{Event::VolumeIncrease, KBDK_RIGHTBRACKET, MOD3}, { Event::VolumeIncrease, KBDK_RIGHTBRACKET, MOD3 },
{Event::SoundToggle, KBDK_RIGHTBRACKET, KBDM_CTRL}, { Event::SoundToggle, KBDK_RIGHTBRACKET, KBDM_CTRL },
{Event::ToggleFullScreen, KBDK_RETURN, MOD3}, { Event::ToggleFullScreen, KBDK_RETURN, MOD3 },
{Event::ToggleAdaptRefresh, KBDK_R, MOD3}, { Event::ToggleAdaptRefresh, KBDK_R, MOD3 },
{Event::OverscanDecrease, KBDK_PAGEDOWN, KBDM_SHIFT}, { Event::OverscanDecrease, KBDK_PAGEDOWN, KBDM_SHIFT },
{Event::OverscanIncrease, KBDK_PAGEUP, KBDM_SHIFT}, { Event::OverscanIncrease, KBDK_PAGEUP, KBDM_SHIFT },
//{Event::VidmodeStd, KBDK_1, MOD3}, //{Event::VidmodeStd, KBDK_1, MOD3},
//{Event::VidmodeRGB, KBDK_2, MOD3}, //{Event::VidmodeRGB, KBDK_2, MOD3},
//{Event::VidmodeSVideo, KBDK_3, MOD3}, //{Event::VidmodeSVideo, KBDK_3, MOD3},
//{Event::VidModeComposite, KBDK_4, MOD3}, //{Event::VidModeComposite, KBDK_4, MOD3},
//{Event::VidModeBad, KBDK_5, MOD3}, //{Event::VidModeBad, KBDK_5, MOD3},
//{Event::VidModeCustom, KBDK_6, MOD3}, //{Event::VidModeCustom, KBDK_6, MOD3},
{Event::PreviousVideoMode, KBDK_1, KBDM_SHIFT | MOD3}, { Event::PreviousVideoMode, KBDK_1, KBDM_SHIFT | MOD3 },
{Event::NextVideoMode, KBDK_1, MOD3}, { Event::NextVideoMode, KBDK_1, MOD3 },
{Event::PreviousAttribute, KBDK_2, KBDM_SHIFT | MOD3}, { Event::PreviousAttribute, KBDK_2, KBDM_SHIFT | MOD3 },
{Event::NextAttribute, KBDK_2, MOD3}, { Event::NextAttribute, KBDK_2, MOD3 },
{Event::DecreaseAttribute, KBDK_3, KBDM_SHIFT | MOD3}, { Event::DecreaseAttribute, KBDK_3, KBDM_SHIFT | MOD3 },
{Event::IncreaseAttribute, KBDK_3, MOD3}, { Event::IncreaseAttribute, KBDK_3, MOD3 },
{Event::PhosphorDecrease, KBDK_4, KBDM_SHIFT | MOD3}, { Event::PhosphorDecrease, KBDK_4, KBDM_SHIFT | MOD3 },
{Event::PhosphorIncrease, KBDK_4, MOD3}, { Event::PhosphorIncrease, KBDK_4, MOD3 },
{Event::TogglePhosphor, KBDK_P, MOD3}, { Event::TogglePhosphor, KBDK_P, MOD3 },
{Event::ScanlinesDecrease, KBDK_5, KBDM_SHIFT | MOD3}, { Event::ScanlinesDecrease, KBDK_5, KBDM_SHIFT | MOD3 },
{Event::ScanlinesIncrease, KBDK_5, MOD3}, { Event::ScanlinesIncrease, KBDK_5, MOD3 },
{Event::PreviousPaletteAttribute, KBDK_9, KBDM_SHIFT | MOD3}, { Event::PreviousPaletteAttribute, KBDK_9, KBDM_SHIFT | MOD3 },
{Event::NextPaletteAttribute, KBDK_9, MOD3}, { Event::NextPaletteAttribute, KBDK_9, MOD3 },
{Event::PaletteAttributeDecrease, KBDK_0, KBDM_SHIFT | MOD3}, { Event::PaletteAttributeDecrease, KBDK_0, KBDM_SHIFT | MOD3 },
{Event::PaletteAttributeIncrease, KBDK_0, MOD3}, { Event::PaletteAttributeIncrease, KBDK_0, MOD3 },
{Event::ToggleColorLoss, KBDK_L, KBDM_CTRL}, { Event::ToggleColorLoss, KBDK_L, KBDM_CTRL },
{Event::PaletteDecrease, KBDK_P, KBDM_SHIFT | KBDM_CTRL}, { Event::PaletteDecrease, KBDK_P, KBDM_SHIFT | KBDM_CTRL },
{Event::PaletteIncrease, KBDK_P, KBDM_CTRL}, { Event::PaletteIncrease, KBDK_P, KBDM_CTRL },
{ Event::FormatDecrease, KBDK_F, KBDM_SHIFT | KBDM_CTRL },
#ifndef BSPF_MACOS { Event::FormatIncrease, KBDK_F, KBDM_CTRL },
{Event::PreviousSetting, KBDK_END}, #ifndef BSPF_MACOS
{Event::NextSetting, KBDK_HOME}, { Event::PreviousSetting, KBDK_END },
{Event::PreviousSettingGroup, KBDK_END, KBDM_CTRL}, { Event::NextSetting, KBDK_HOME },
{Event::NextSettingGroup, KBDK_HOME, KBDM_CTRL}, { Event::PreviousSettingGroup, KBDK_END, KBDM_CTRL },
#else { Event::NextSettingGroup, KBDK_HOME, KBDM_CTRL },
#else
// HOME & END keys are swapped on Mac keyboards // HOME & END keys are swapped on Mac keyboards
{Event::PreviousSetting, KBDK_HOME}, { Event::PreviousSetting, KBDK_HOME },
{Event::NextSetting, KBDK_END}, { Event::NextSetting, KBDK_END },
{Event::PreviousSettingGroup, KBDK_HOME, KBDM_CTRL}, { Event::PreviousSettingGroup, KBDK_HOME, KBDM_CTRL },
{Event::NextSettingGroup, KBDK_END, KBDM_CTRL}, { Event::NextSettingGroup, KBDK_END, KBDM_CTRL },
#endif #endif
{Event::PreviousSetting, KBDK_KP_1}, { Event::PreviousSetting, KBDK_KP_1 },
{Event::NextSetting, KBDK_KP_7}, { Event::NextSetting, KBDK_KP_7 },
{Event::PreviousSettingGroup, KBDK_KP_1, KBDM_CTRL}, { Event::PreviousSettingGroup, KBDK_KP_1, KBDM_CTRL },
{Event::NextSettingGroup, KBDK_KP_7, KBDM_CTRL}, { Event::NextSettingGroup, KBDK_KP_7, KBDM_CTRL },
{Event::SettingDecrease, KBDK_PAGEDOWN}, { Event::SettingDecrease, KBDK_PAGEDOWN },
{Event::SettingDecrease, KBDK_KP_3, KBDM_CTRL}, { Event::SettingDecrease, KBDK_KP_3, KBDM_CTRL },
{Event::SettingIncrease, KBDK_PAGEUP}, { Event::SettingIncrease, KBDK_PAGEUP },
{Event::SettingIncrease, KBDK_KP_9, KBDM_CTRL}, { Event::SettingIncrease, KBDK_KP_9, KBDM_CTRL },
{Event::ToggleInter, KBDK_I, KBDM_CTRL}, { Event::ToggleInter, KBDK_I, KBDM_CTRL },
{Event::DecreaseSpeed, KBDK_S, KBDM_SHIFT | KBDM_CTRL}, { Event::DecreaseSpeed, KBDK_S, KBDM_SHIFT | KBDM_CTRL },
{Event::IncreaseSpeed, KBDK_S, KBDM_CTRL }, { Event::IncreaseSpeed, KBDK_S, KBDM_CTRL },
{Event::ToggleTurbo, KBDK_T, KBDM_CTRL}, { Event::ToggleTurbo, KBDK_T, KBDM_CTRL },
{Event::ToggleJitter, KBDK_J, MOD3}, { Event::ToggleJitter, KBDK_J, MOD3 },
{Event::ToggleFrameStats, KBDK_L, MOD3}, { Event::ToggleFrameStats, KBDK_L, MOD3 },
{Event::ToggleTimeMachine, KBDK_T, MOD3}, { Event::ToggleTimeMachine, KBDK_T, MOD3 },
#ifdef PNG_SUPPORT #ifdef PNG_SUPPORT
{Event::ToggleContSnapshots, KBDK_S, MOD3 | KBDM_CTRL}, { Event::ToggleContSnapshots, KBDK_S, MOD3 | KBDM_CTRL },
{Event::ToggleContSnapshotsFrame, KBDK_S, KBDM_SHIFT | MOD3 | KBDM_CTRL}, { Event::ToggleContSnapshotsFrame, KBDK_S, KBDM_SHIFT | MOD3 | KBDM_CTRL },
#endif #endif
{Event::DecreaseAutoFire, KBDK_A, KBDM_SHIFT | KBDM_CTRL}, { Event::DecreaseDeadzone, KBDK_F1, KBDM_CTRL | KBDM_SHIFT },
{Event::IncreaseAutoFire, KBDK_A, KBDM_CTRL }, { Event::IncreaseDeadzone, KBDK_F1, KBDM_CTRL },
{Event::HandleMouseControl, KBDK_0, KBDM_CTRL}, { Event::DecAnalogSense, KBDK_F2, KBDM_CTRL | KBDM_SHIFT },
{Event::ToggleGrabMouse, KBDK_G, KBDM_CTRL}, { Event::IncAnalogSense, KBDK_F2, KBDM_CTRL },
{Event::ToggleSAPortOrder, KBDK_1, KBDM_CTRL}, { Event::DecDejtterAveraging, KBDK_F3, KBDM_CTRL | KBDM_SHIFT },
{Event::FormatDecrease, KBDK_F, KBDM_SHIFT | KBDM_CTRL}, { Event::IncDejtterAveraging, KBDK_F3, KBDM_CTRL },
{Event::FormatIncrease, KBDK_F, KBDM_CTRL}, { Event::DecDejtterReaction, KBDK_F4, KBDM_CTRL | KBDM_SHIFT },
{ Event::IncDejtterReaction, KBDK_F4, KBDM_CTRL },
{ Event::DecDigitalSense, KBDK_F5, KBDM_CTRL | KBDM_SHIFT },
{ Event::IncDigitalSense, KBDK_F5, KBDM_CTRL },
{ Event::DecreaseAutoFire, KBDK_A, KBDM_CTRL | KBDM_SHIFT },
{ Event::IncreaseAutoFire, KBDK_A, KBDM_CTRL },
{ Event::ToggleFourDirections, KBDK_F6, KBDM_CTRL },
{ Event::ToggleKeyCombos, KBDK_F7, KBDM_CTRL },
{ Event::ToggleSAPortOrder, KBDK_1, KBDM_CTRL },
{Event::ToggleP0Collision, KBDK_Z, KBDM_SHIFT | MOD3}, { Event::PrevMouseAsController, KBDK_F8, KBDM_CTRL | KBDM_SHIFT },
{Event::ToggleP0Bit, KBDK_Z, MOD3}, { Event::NextMouseAsController, KBDK_F8, KBDM_CTRL },
{Event::ToggleP1Collision, KBDK_X, KBDM_SHIFT | MOD3}, { Event::DecMousePaddleSense, KBDK_F9, KBDM_CTRL | KBDM_SHIFT },
{Event::ToggleP1Bit, KBDK_X, MOD3}, { Event::IncMousePaddleSense, KBDK_F9, KBDM_CTRL },
{Event::ToggleM0Collision, KBDK_C, KBDM_SHIFT | MOD3}, { Event::DecMouseTrackballSense, KBDK_F10, KBDM_CTRL | KBDM_SHIFT },
{Event::ToggleM0Bit, KBDK_C, MOD3}, { Event::IncMouseTrackballSense, KBDK_F10, KBDM_CTRL },
{Event::ToggleM1Collision, KBDK_V, KBDM_SHIFT | MOD3}, { Event::DecreaseDrivingSense, KBDK_F11, KBDM_CTRL | KBDM_SHIFT },
{Event::ToggleM1Bit, KBDK_V, MOD3}, { Event::IncreaseDrivingSense, KBDK_F11, KBDM_CTRL },
{Event::ToggleBLCollision, KBDK_B, KBDM_SHIFT | MOD3}, { Event::PreviousCursorVisbility, KBDK_F12, KBDM_CTRL | KBDM_SHIFT },
{Event::ToggleBLBit, KBDK_B, MOD3}, { Event::NextCursorVisbility, KBDK_F12, KBDM_CTRL },
{Event::TogglePFCollision, KBDK_N, KBDM_SHIFT | MOD3}, { Event::ToggleGrabMouse, KBDK_G, KBDM_CTRL },
{Event::TogglePFBit, KBDK_N, MOD3},
{Event::ToggleCollisions, KBDK_COMMA, KBDM_SHIFT | MOD3},
{Event::ToggleBits, KBDK_COMMA, MOD3},
{Event::ToggleFixedColors, KBDK_PERIOD, MOD3},
{Event::RewindPause, KBDK_LEFT, KBDM_SHIFT}, { Event::PreviousLeftPort, KBDK_2, KBDM_CTRL | KBDM_SHIFT },
{Event::Rewind1Menu, KBDK_LEFT, MOD3}, { Event::NextLeftPort, KBDK_2, KBDM_CTRL },
{Event::Rewind10Menu, KBDK_LEFT, KBDM_SHIFT | MOD3}, { Event::PreviousRightPort, KBDK_3, KBDM_CTRL | KBDM_SHIFT },
{Event::RewindAllMenu, KBDK_DOWN, MOD3}, { Event::NextRightPort, KBDK_3, KBDM_CTRL },
{Event::UnwindPause, KBDK_LEFT, KBDM_SHIFT}, { Event::ToggleSwapPorts, KBDK_4, KBDM_CTRL },
{Event::Unwind1Menu, KBDK_RIGHT, MOD3}, { Event::ToggleSwapPaddles, KBDK_5, KBDM_CTRL },
{Event::Unwind10Menu, KBDK_RIGHT, KBDM_SHIFT | MOD3}, { Event::DecreasePaddleCenterX, KBDK_6, KBDM_CTRL | KBDM_SHIFT },
{Event::UnwindAllMenu, KBDK_UP, MOD3}, { Event::IncreasePaddleCenterX, KBDK_6, KBDM_CTRL },
{Event::HighScoresMenuMode, KBDK_INSERT}, { Event::DecreasePaddleCenterY, KBDK_7, KBDM_CTRL | KBDM_SHIFT },
{Event::TogglePlayBackMode, KBDK_SPACE, KBDM_SHIFT}, { Event::IncreasePaddleCenterY, KBDK_7, KBDM_CTRL },
{ Event::PreviousMouseControl, KBDK_0, KBDM_CTRL | KBDM_SHIFT },
{ Event::NextMouseControl, KBDK_0, KBDM_CTRL },
{ Event::DecreaseMouseAxesRange, KBDK_8, KBDM_CTRL | KBDM_SHIFT },
{ Event::IncreaseMouseAxesRange, KBDK_8, KBDM_CTRL },
#if defined(RETRON77) { Event::ToggleP0Collision, KBDK_Z, KBDM_SHIFT | MOD3 },
{Event::ConsoleColorToggle, KBDK_F4}, // back ("COLOR","B/W") { Event::ToggleP0Bit, KBDK_Z, MOD3 },
{Event::ConsoleLeftDiffToggle, KBDK_F6}, // front ("SKILL P1") { Event::ToggleP1Collision, KBDK_X, KBDM_SHIFT | MOD3 },
{Event::ConsoleRightDiffToggle, KBDK_F8}, // front ("SKILL P2") { Event::ToggleP1Bit, KBDK_X, MOD3 },
{Event::CmdMenuMode, KBDK_F13}, // back ("4:3","16:9") { Event::ToggleM0Collision, KBDK_C, KBDM_SHIFT | MOD3 },
{Event::ExitMode, KBDK_BACKSPACE}, // back ("FRY") { Event::ToggleM0Bit, KBDK_C, MOD3 },
#else // defining duplicate keys must be avoided! { Event::ToggleM1Collision, KBDK_V, KBDM_SHIFT | MOD3 },
{Event::ConsoleBlackWhite, KBDK_F4}, { Event::ToggleM1Bit, KBDK_V, MOD3 },
{Event::ConsoleLeftDiffB, KBDK_F6}, { Event::ToggleBLCollision, KBDK_B, KBDM_SHIFT | MOD3 },
{Event::ConsoleRightDiffB, KBDK_F8}, { Event::ToggleBLBit, KBDK_B, MOD3 },
{Event::Fry, KBDK_BACKSPACE}, { Event::TogglePFCollision, KBDK_N, KBDM_SHIFT | MOD3 },
{ Event::TogglePFBit, KBDK_N, MOD3 },
{ Event::ToggleCollisions, KBDK_COMMA, KBDM_SHIFT | MOD3 },
{ Event::ToggleBits, KBDK_COMMA, MOD3 },
{ Event::ToggleFixedColors, KBDK_PERIOD, MOD3 },
{ Event::RewindPause, KBDK_LEFT, KBDM_SHIFT },
{ Event::Rewind1Menu, KBDK_LEFT, MOD3 },
{ Event::Rewind10Menu, KBDK_LEFT, KBDM_SHIFT | MOD3 },
{ Event::RewindAllMenu, KBDK_DOWN, MOD3 },
{ Event::UnwindPause, KBDK_LEFT, KBDM_SHIFT },
{ Event::Unwind1Menu, KBDK_RIGHT, MOD3 },
{ Event::Unwind10Menu, KBDK_RIGHT, KBDM_SHIFT | MOD3 },
{ Event::UnwindAllMenu, KBDK_UP, MOD3 },
{ Event::HighScoresMenuMode, KBDK_INSERT },
{ Event::TogglePlayBackMode, KBDK_SPACE, KBDM_SHIFT },
#if defined(RETRON77)
{ Event::ConsoleColorToggle, KBDK_F4 }, // back ("COLOR","B/W")
{ Event::ConsoleLeftDiffToggle, KBDK_F6 }, // front ("SKILL P1")
{ Event::ConsoleRightDiffToggle, KBDK_F8 }, // front ("SKILL P2")
{ Event::CmdMenuMode, KBDK_F13 }, // back ("4:3","16:9")
{ Event::ExitMode, KBDK_BACKSPACE }, // back ("FRY")
#else // defining duplicate keys must be avoided!
{ Event::ConsoleBlackWhite, KBDK_F4 },
{ Event::ConsoleLeftDiffB, KBDK_F6 },
{ Event::ConsoleRightDiffB, KBDK_F8 },
{ Event::Fry, KBDK_BACKSPACE },
#endif #endif
}; };

View File

@ -79,6 +79,8 @@ class PhysicalKeyboardHandler
/** See comments on KeyMap.myModEnabled for more information. */ /** See comments on KeyMap.myModEnabled for more information. */
bool& useModKeys() { return myKeyMap.enableMod(); } bool& useModKeys() { return myKeyMap.enableMod(); }
void toggleModKeys(bool toggle = true);
private: private:
// Structure used for action menu items // Structure used for action menu items

View File

@ -33,7 +33,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PNGLibrary::PNGLibrary(OSystem& osystem) PNGLibrary::PNGLibrary(OSystem& osystem)
: myOSystem(osystem) : myOSystem{osystem}
{ {
} }

View File

@ -24,7 +24,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PaletteHandler::PaletteHandler(OSystem& system) PaletteHandler::PaletteHandler(OSystem& system)
: myOSystem(system) : myOSystem{system}
{ {
// Load user-defined palette for this ROM // Load user-defined palette for this ROM
loadUserPalette(); loadUserPalette();
@ -442,7 +442,7 @@ void PaletteHandler::generateCustomPalette(ConsoleTiming timing)
if(timing == ConsoleTiming::ntsc) if(timing == ConsoleTiming::ntsc)
{ {
vector2d IQ[NUM_CHROMA]; vector2d IQ[NUM_CHROMA];
// YIQ is YUV shifted by 33° // YIQ is YUV shifted by 33 degrees
constexpr float offset = 33 * BSPF::PI_f / 180; constexpr float offset = 33 * BSPF::PI_f / 180;
const float shift = myPhaseNTSC * BSPF::PI_f / 180; const float shift = myPhaseNTSC * BSPF::PI_f / 180;
@ -542,7 +542,7 @@ void PaletteHandler::generateCustomPalette(ConsoleTiming timing)
void PaletteHandler::adjustHueSaturation(int& R, int& G, int& B, float H, float S) void PaletteHandler::adjustHueSaturation(int& R, int& G, int& B, float H, float S)
{ {
// Adapted from http://beesbuzz.biz/code/16-hsv-color-transforms // Adapted from http://beesbuzz.biz/code/16-hsv-color-transforms
// (C) J. Fluffy Shagam // (C) J. Fluffy Shagam
// License: CC BY-SA 4.0 // License: CC BY-SA 4.0
const float su = S * cosf(-H * BSPF::PI_f); const float su = S * cosf(-H * BSPF::PI_f);
const float sw = S * sinf(-H * BSPF::PI_f); const float sw = S * sinf(-H * BSPF::PI_f);

View File

@ -65,7 +65,7 @@ class PaletteHandler
}; };
public: public:
PaletteHandler(OSystem& system); explicit PaletteHandler(OSystem& system);
/** /**
Cycle through available palettes. Cycle through available palettes.
@ -139,7 +139,7 @@ class PaletteHandler
float y{0.F}; float y{0.F};
explicit vector2d(float _x = 0.F, float _y = 0.F) explicit vector2d(float _x = 0.F, float _y = 0.F)
: x(_x), y(_y) { } : x{_x}, y{_y} { }
}; };
/** /**

View File

@ -59,17 +59,13 @@ class PhysicalJoystick
int axes, int buttons, int hats, int balls); int axes, int buttons, int hats, int balls);
private: private:
// TODO: these are not required anymore, delete or keep for future usage? enum class Type {
enum JoyType { REGULAR,
JT_NONE = 0, LEFT_STELLADAPTOR, RIGHT_STELLADAPTOR,
JT_REGULAR = 1, LEFT_2600DAPTOR, RIGHT_2600DAPTOR
JT_STELLADAPTOR_LEFT = 2,
JT_STELLADAPTOR_RIGHT = 3,
JT_2600DAPTOR_LEFT = 4,
JT_2600DAPTOR_RIGHT = 5
}; };
JoyType type{JT_NONE}; Type type{Type::REGULAR};
int ID{-1}; int ID{-1};
string name{"None"}; string name{"None"};
int numAxes{0}, numButtons{0}, numHats{0}; int numAxes{0}, numButtons{0}, numHats{0};

View File

@ -32,6 +32,7 @@ namespace Common {
*/ */
struct Point struct Point
{ {
// FIXME : make this uInt32
Int32 x{0}; //!< The horizontal part of the point Int32 x{0}; //!< The horizontal part of the point
Int32 y{0}; //!< The vertical part of the point Int32 y{0}; //!< The vertical part of the point

View File

@ -28,8 +28,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
RewindManager::RewindManager(OSystem& system, StateManager& statemgr) RewindManager::RewindManager(OSystem& system, StateManager& statemgr)
: myOSystem(system), : myOSystem{system},
myStateManager(statemgr) myStateManager{statemgr}
{ {
setup(); setup();
} }

View File

@ -40,8 +40,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SoundSDL2::SoundSDL2(OSystem& osystem, AudioSettings& audioSettings) SoundSDL2::SoundSDL2(OSystem& osystem, AudioSettings& audioSettings)
: Sound(osystem), : Sound{osystem},
myAudioSettings(audioSettings) myAudioSettings{audioSettings}
{ {
ASSERT_MAIN_THREAD; ASSERT_MAIN_THREAD;
@ -273,7 +273,7 @@ void SoundSDL2::adjustVolume(int direction)
if(percent > 0 && !enabled) if(percent > 0 && !enabled)
{ {
setEnabled(!enabled); setEnabled(true);
myOSystem.console().initializeAudio(); myOSystem.console().initializeAudio();
} }

View File

@ -37,8 +37,8 @@ namespace {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
StaggeredLogger::StaggeredLogger(const string& message, Logger::Level level) StaggeredLogger::StaggeredLogger(const string& message, Logger::Level level)
: myMessage(message), : myMessage{message},
myLevel(level) myLevel{level}
{ {
} }

View File

@ -31,7 +31,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
StateManager::StateManager(OSystem& osystem) StateManager::StateManager(OSystem& osystem)
: myOSystem(osystem) : myOSystem{osystem}
{ {
myRewindManager = make_unique<RewindManager>(myOSystem, *this); myRewindManager = make_unique<RewindManager>(myOSystem, *this);
reset(); reset();

View File

@ -20,7 +20,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TimerManager::TimerManager() TimerManager::TimerManager()
: nextId(no_timer + 1), : nextId{no_timer + 1},
queue() queue()
{ {
} }

View File

@ -44,8 +44,8 @@ class Variant
public: public:
Variant() { } // NOLINT Variant() { } // NOLINT
Variant(const string& s) : data(s) { } Variant(const string& s) : data{s} { }
Variant(const char* s) : data(s) { } Variant(const char* s) : data{s} { }
Variant(Int32 i) { buf().str(""); buf() << i; data = buf().str(); } Variant(Int32 i) { buf().str(""); buf() << i; data = buf().str(); }
Variant(uInt32 i) { buf().str(""); buf() << i; data = buf().str(); } Variant(uInt32 i) { buf().str(""); buf() << i; data = buf().str(); }

View File

@ -105,14 +105,12 @@ VideoModeHandler::Mode::Mode(uInt32 iw, uInt32 ih, Stretch smode,
VideoModeHandler::Mode::Mode(uInt32 iw, uInt32 ih, uInt32 sw, uInt32 sh, VideoModeHandler::Mode::Mode(uInt32 iw, uInt32 ih, uInt32 sw, uInt32 sh,
Stretch smode, Int32 fsindex, const string& desc, Stretch smode, Int32 fsindex, const string& desc,
float zoomLevel, float overscan) float zoomLevel, float overscan)
: stretch(smode), : screenS(sw, sh),
stretch(smode),
description(desc), description(desc),
zoom(zoomLevel), zoom(zoomLevel),
fsIndex(fsindex) fsIndex(fsindex)
{ {
// First set default size and positioning
screenS = Common::Size(sw, sh);
// Now resize based on windowed/fullscreen mode and stretch factor // Now resize based on windowed/fullscreen mode and stretch factor
if(fsIndex != -1) // fullscreen mode if(fsIndex != -1) // fullscreen mode
{ {

View File

@ -19,9 +19,9 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ConvolutionBuffer::ConvolutionBuffer(uInt32 size) ConvolutionBuffer::ConvolutionBuffer(uInt32 size)
: mySize(size) : myData{make_unique<float[]>(size)},
mySize{size}
{ {
myData = make_unique<float[]>(mySize);
std::fill_n(myData.get(), mySize, 0.F); std::fill_n(myData.get(), mySize, 0.F);
} }

View File

@ -20,7 +20,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
HighPass::HighPass(float cutOffFrequency, float frequency) HighPass::HighPass(float cutOffFrequency, float frequency)
: myAlpha(1.F / (1.F + 2.F*BSPF::PI_f*cutOffFrequency/frequency)) : myAlpha{1.F / (1.F + 2.F*BSPF::PI_f*cutOffFrequency/frequency)}
{ {
} }

View File

@ -69,12 +69,12 @@ LanczosResampler::LanczosResampler(
// formatFrom.sampleRate / formatTo.sampleRate = M / N // formatFrom.sampleRate / formatTo.sampleRate = M / N
// //
// -> we find N from fully reducing the fraction. // -> we find N from fully reducing the fraction.
myPrecomputedKernelCount(reducedDenominator(formatFrom.sampleRate, formatTo.sampleRate)), myPrecomputedKernelCount{reducedDenominator(formatFrom.sampleRate, formatTo.sampleRate)},
myKernelSize(2 * kernelParameter), myKernelSize{2 * kernelParameter},
myKernelParameter(kernelParameter), myKernelParameter{kernelParameter},
myHighPassL(HIGH_PASS_CUT_OFF, float(formatFrom.sampleRate)), myHighPassL{HIGH_PASS_CUT_OFF, float(formatFrom.sampleRate)},
myHighPassR(HIGH_PASS_CUT_OFF, float(formatFrom.sampleRate)), myHighPassR{HIGH_PASS_CUT_OFF, float(formatFrom.sampleRate)},
myHighPass(HIGH_PASS_CUT_OFF, float(formatFrom.sampleRate)) myHighPass{HIGH_PASS_CUT_OFF, float(formatFrom.sampleRate)}
{ {
myPrecomputedKernels = make_unique<float[]>(myPrecomputedKernelCount * myKernelSize); myPrecomputedKernels = make_unique<float[]>(myPrecomputedKernelCount * myKernelSize);

View File

@ -51,12 +51,11 @@ class Resampler {
public: public:
Resampler(Format formatFrom, Format formatTo, Resampler(Format formatFrom, Format formatTo,
const NextFragmentCallback& nextFragmentCallback) : const NextFragmentCallback& nextFragmentCallback)
myFormatFrom(formatFrom), : myFormatFrom{formatFrom},
myFormatTo(formatTo), myFormatTo{formatTo},
myNextFragmentCallback(nextFragmentCallback), myNextFragmentCallback{nextFragmentCallback},
myUnderrunLogger("audio buffer underrun", Logger::Level::INFO) myUnderrunLogger{"audio buffer underrun", Logger::Level::INFO} { }
{}
virtual void fillFragment(float* fragment, uInt32 length) = 0; virtual void fillFragment(float* fragment, uInt32 length) = 0;

View File

@ -39,13 +39,11 @@ class SimpleResampler : public Resampler
bool myIsUnderrun{true}; bool myIsUnderrun{true};
private: private:
SimpleResampler() = delete; SimpleResampler() = delete;
SimpleResampler(const SimpleResampler&) = delete; SimpleResampler(const SimpleResampler&) = delete;
SimpleResampler(SimpleResampler&&) = delete; SimpleResampler(SimpleResampler&&) = delete;
SimpleResampler& operator=(const SimpleResampler&) = delete; SimpleResampler& operator=(const SimpleResampler&) = delete;
SimpleResampler& operator=(const SimpleResampler&&) = delete; SimpleResampler& operator=(const SimpleResampler&&) = delete;
}; };
#endif // SIMPLE_RESAMPLER_HXX #endif // SIMPLE_RESAMPLER_HXX

View File

@ -1,3 +1,20 @@
//============================================================================
//
// 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-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.
//============================================================================
#ifndef JSON_DEFINITIONS_HXX #ifndef JSON_DEFINITIONS_HXX
#define JSON_DEFINITIONS_HXX #define JSON_DEFINITIONS_HXX
@ -69,6 +86,16 @@ NLOHMANN_JSON_SERIALIZE_ENUM(Event::Type, {
{Event::JoystickOneFire, "JoystickOneFire"}, {Event::JoystickOneFire, "JoystickOneFire"},
{Event::JoystickOneFire5, "JoystickOneFire5"}, {Event::JoystickOneFire5, "JoystickOneFire5"},
{Event::JoystickOneFire9, "JoystickOneFire9"}, {Event::JoystickOneFire9, "JoystickOneFire9"},
{Event::JoystickTwoUp, "JoystickTwoUp"},
{Event::JoystickTwoDown, "JoystickTwoDown"},
{Event::JoystickTwoLeft, "JoystickTwoLeft"},
{Event::JoystickTwoRight, "JoystickTwoRight"},
{Event::JoystickTwoFire, "JoystickTwoFire"},
{Event::JoystickThreeUp, "JoystickThreeUp"},
{Event::JoystickThreeDown, "JoystickThreeDown"},
{Event::JoystickThreeLeft, "JoystickThreeLeft"},
{Event::JoystickThreeRight, "JoystickThreeRight"},
{Event::JoystickThreeFire, "JoystickThreeFire"},
{Event::PaddleZeroDecrease, "PaddleZeroDecrease"}, {Event::PaddleZeroDecrease, "PaddleZeroDecrease"},
{Event::PaddleZeroIncrease, "PaddleZeroIncrease"}, {Event::PaddleZeroIncrease, "PaddleZeroIncrease"},
{Event::PaddleZeroAnalog, "PaddleZeroAnalog"}, {Event::PaddleZeroAnalog, "PaddleZeroAnalog"},
@ -160,6 +187,50 @@ NLOHMANN_JSON_SERIALIZE_ENUM(Event::Type, {
{Event::CompuMateEquals, "CompuMateEquals"}, {Event::CompuMateEquals, "CompuMateEquals"},
{Event::CompuMatePlus, "CompuMatePlus"}, {Event::CompuMatePlus, "CompuMatePlus"},
{Event::CompuMateSlash, "CompuMateSlash"}, {Event::CompuMateSlash, "CompuMateSlash"},
{Event::DecreaseDeadzone, "DecreaseDeadzone"},
{Event::IncreaseDeadzone, "IncreaseDeadzone"},
{Event::DecAnalogSense, "DecAnalogSense"},
{Event::IncAnalogSense, "IncAnalogSense"},
{Event::DecDejtterAveraging, "DecDejtterAveraging"},
{Event::IncDejtterAveraging, "IncDejtterAveraging"},
{Event::DecDejtterReaction, "DecDejtterReaction"},
{Event::IncDejtterReaction, "IncDejtterReaction"},
{Event::DecDigitalSense, "DecDigitalSense"},
{Event::IncDigitalSense, "IncDigitalSense"},
{Event::DecreaseAutoFire, "DecreaseAutoFire"},
{Event::IncreaseAutoFire, "IncreaseAutoFire"},
{Event::ToggleFourDirections, "ToggleFourDirections"},
{Event::ToggleKeyCombos, "ToggleKeyCombos"},
{Event::ToggleSAPortOrder, "ToggleSAPortOrder"},
{Event::PrevMouseAsController, "PrevMouseAsController"},
{Event::NextMouseAsController, "NextMouseAsController"},
{Event::DecMousePaddleSense, "DecMousePaddleSense"},
{Event::IncMousePaddleSense, "IncMousePaddleSense"},
{Event::DecMouseTrackballSense, "DecMouseTrackballSense"},
{Event::IncMouseTrackballSense, "IncMouseTrackballSense"},
{Event::DecreaseDrivingSense, "DecreaseDrivingSense"},
{Event::IncreaseDrivingSense, "IncreaseDrivingSense"},
{Event::PreviousCursorVisbility, "PreviousCursorVisbility"},
{Event::NextCursorVisbility, "NextCursorVisbility"},
{Event::ToggleGrabMouse, "ToggleGrabMouse"},
{Event::PreviousLeftPort, "PreviousLeftPort"},
{Event::NextLeftPort, "NextLeftPort"},
{Event::PreviousRightPort, "PreviousRightPort"},
{Event::NextRightPort, "NextRightPort"},
{Event::ToggleSwapPorts, "ToggleSwapPorts"},
{Event::ToggleSwapPaddles,"ToggleSwapPaddles"},
{Event::DecreasePaddleCenterX, "DecreasePaddleCenterX"},
{Event::IncreasePaddleCenterX, "IncreasePaddleCenterX"},
{Event::DecreasePaddleCenterY, "DecreasePaddleCenterY"},
{Event::IncreasePaddleCenterY, "IncreasePaddleCenterY"},
{Event::PreviousMouseControl, "PreviousMouseControl"},
{Event::NextMouseControl, "NextMouseControl"},
{Event::DecreaseMouseAxesRange, "DecreaseMouseAxesRange"},
{Event::IncreaseMouseAxesRange, "IncreaseMouseAxesRange"},
{Event::Combo1, "Combo1"}, {Event::Combo1, "Combo1"},
{Event::Combo2, "Combo2"}, {Event::Combo2, "Combo2"},
{Event::Combo3, "Combo3"}, {Event::Combo3, "Combo3"},
@ -192,8 +263,6 @@ NLOHMANN_JSON_SERIALIZE_ENUM(Event::Type, {
{Event::UIPrevDir, "UIPrevDir"}, {Event::UIPrevDir, "UIPrevDir"},
{Event::UITabPrev, "UITabPrev"}, {Event::UITabPrev, "UITabPrev"},
{Event::UITabNext, "UITabNext"}, {Event::UITabNext, "UITabNext"},
{Event::HandleMouseControl, "HandleMouseControl"},
{Event::ToggleGrabMouse, "ToggleGrabMouse"},
{Event::MouseAxisXMove, "MouseAxisXMove"}, {Event::MouseAxisXMove, "MouseAxisXMove"},
{Event::MouseAxisYMove, "MouseAxisYMove"}, {Event::MouseAxisYMove, "MouseAxisYMove"},
{Event::MouseAxisXValue, "MouseAxisXValue"}, {Event::MouseAxisXValue, "MouseAxisXValue"},
@ -287,7 +356,6 @@ NLOHMANN_JSON_SERIALIZE_ENUM(Event::Type, {
{Event::ToggleBits, "ToggleBits"}, {Event::ToggleBits, "ToggleBits"},
{Event::ToggleFixedColors, "ToggleFixedColors"}, {Event::ToggleFixedColors, "ToggleFixedColors"},
{Event::ToggleFrameStats, "ToggleFrameStats"}, {Event::ToggleFrameStats, "ToggleFrameStats"},
{Event::ToggleSAPortOrder, "ToggleSAPortOrder"},
{Event::ExitGame, "ExitGame"}, {Event::ExitGame, "ExitGame"},
{Event::SettingDecrease, "SettingDecrease"}, {Event::SettingDecrease, "SettingDecrease"},
{Event::SettingIncrease, "SettingIncrease"}, {Event::SettingIncrease, "SettingIncrease"},
@ -302,16 +370,6 @@ NLOHMANN_JSON_SERIALIZE_ENUM(Event::Type, {
{Event::IncreaseAutoFire, "IncreaseAutoFire"}, {Event::IncreaseAutoFire, "IncreaseAutoFire"},
{Event::DecreaseSpeed, "DecreaseSpeed"}, {Event::DecreaseSpeed, "DecreaseSpeed"},
{Event::IncreaseSpeed, "IncreaseSpeed"}, {Event::IncreaseSpeed, "IncreaseSpeed"},
{Event::JoystickTwoUp, "JoystickTwoUp"},
{Event::JoystickTwoDown, "JoystickTwoDown"},
{Event::JoystickTwoLeft, "JoystickTwoLeft"},
{Event::JoystickTwoRight, "JoystickTwoRight"},
{Event::JoystickTwoFire, "JoystickTwoFire"},
{Event::JoystickThreeUp, "JoystickThreeUp"},
{Event::JoystickThreeDown, "JoystickThreeDown"},
{Event::JoystickThreeLeft, "JoystickThreeLeft"},
{Event::JoystickThreeRight, "JoystickThreeRight"},
{Event::JoystickThreeFire, "JoystickThreeFire"},
{Event::ToggleCorrectAspectRatio, "ToggleCorrectAspectRatio"}, {Event::ToggleCorrectAspectRatio, "ToggleCorrectAspectRatio"},
{Event::MoveLeftChar, "MoveLeftChar"}, {Event::MoveLeftChar, "MoveLeftChar"},
{Event::MoveRightChar, "MoveRightChar"}, {Event::MoveRightChar, "MoveRightChar"},

View File

@ -29,7 +29,7 @@ namespace {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
KeyValueRepositoryConfigfile::KeyValueRepositoryConfigfile(const FilesystemNode& file) KeyValueRepositoryConfigfile::KeyValueRepositoryConfigfile(const FilesystemNode& file)
: myFile(file) : myFile{file}
{ {
} }

View File

@ -22,10 +22,9 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
KeyValueRepositorySqlite::KeyValueRepositorySqlite( KeyValueRepositorySqlite::KeyValueRepositorySqlite(
SqliteDatabase& db, SqliteDatabase& db, const string& tableName)
const string& tableName : myTableName{tableName},
) : myTableName(tableName), myDb{db}
myDb(db)
{ {
} }

View File

@ -20,11 +20,9 @@
#include "SqliteError.hxx" #include "SqliteError.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SettingsDb::SettingsDb( SettingsDb::SettingsDb(const string& databaseDirectory, const string& databaseName)
const string& databaseDirectory, : myDatabaseDirectory{databaseDirectory},
const string& databaseName myDatabaseName{databaseName}
) : myDatabaseDirectory(databaseDirectory),
myDatabaseName(databaseName)
{ {
} }

View File

@ -24,7 +24,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SqliteDatabase::SqliteDatabase(const string& databaseDirectory, SqliteDatabase::SqliteDatabase(const string& databaseDirectory,
const string& databaseName) const string& databaseName)
: myDatabaseFile(databaseDirectory + databaseName + ".sqlite3") : myDatabaseFile{databaseDirectory + databaseName + ".sqlite3"}
{ {
} }

View File

@ -19,7 +19,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SqliteStatement::SqliteStatement(sqlite3* handle, const string& sql) SqliteStatement::SqliteStatement(sqlite3* handle, const string& sql)
: myHandle(handle) : myHandle{handle}
{ {
if (sqlite3_prepare_v2(handle, sql.c_str(), -1, &myStmt, nullptr) != SQLITE_OK) if (sqlite3_prepare_v2(handle, sql.c_str(), -1, &myStmt, nullptr) != SQLITE_OK)
throw SqliteError(handle); throw SqliteError(handle);

View File

@ -20,7 +20,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SqliteTransaction::SqliteTransaction(SqliteDatabase& db) SqliteTransaction::SqliteTransaction(SqliteDatabase& db)
: myDb(db) : myDb{db}
{ {
myDb.exec("BEGIN TRANSACTION"); myDb.exec("BEGIN TRANSACTION");
} }

View File

@ -21,8 +21,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BilinearBlitter::BilinearBlitter(FBBackendSDL2& fb, bool interpolate) BilinearBlitter::BilinearBlitter(FBBackendSDL2& fb, bool interpolate)
: myFB(fb), : myFB{fb},
myInterpolate(interpolate) myInterpolate{interpolate}
{ {
} }

View File

@ -21,7 +21,8 @@
#include "BilinearBlitter.hxx" #include "BilinearBlitter.hxx"
#include "QisBlitter.hxx" #include "QisBlitter.hxx"
unique_ptr<Blitter> BlitterFactory::createBlitter(FBBackendSDL2& fb, ScalingAlgorithm scaling) unique_ptr<Blitter>
BlitterFactory::createBlitter(FBBackendSDL2& fb, ScalingAlgorithm scaling)
{ {
if (!fb.isInitialized()) { if (!fb.isInitialized()) {
throw runtime_error("BlitterFactory requires an initialized framebuffer!"); throw runtime_error("BlitterFactory requires an initialized framebuffer!");

View File

@ -21,7 +21,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
QisBlitter::QisBlitter(FBBackendSDL2& fb) QisBlitter::QisBlitter(FBBackendSDL2& fb)
: myFB(fb) : myFB{fb}
{ {
} }

View File

@ -192,7 +192,7 @@ void NTSCFilter::getAdjustables(Adjustable& adjustable, Preset preset) const
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void NTSCFilter::setCustomAdjustables(Adjustable& adjustable) void NTSCFilter::setCustomAdjustables(const Adjustable& adjustable)
{ {
#ifdef BLARGG_PALETTE #ifdef BLARGG_PALETTE
//myCustomSetup.hue = scaleFrom100(adjustable.hue); //myCustomSetup.hue = scaleFrom100(adjustable.hue);

View File

@ -90,7 +90,7 @@ class NTSCFilter
// Set custom adjustables to given values // Set custom adjustables to given values
// Values will be scaled to 0 - 100 range, independent of how // Values will be scaled to 0 - 100 range, independent of how
// they're actually stored internally // they're actually stored internally
void setCustomAdjustables(Adjustable& adjustable); void setCustomAdjustables(const Adjustable& adjustable);
// The following methods cycle through each custom adjustable // The following methods cycle through each custom adjustable
// They are used in conjunction with the increase/decrease // They are used in conjunction with the increase/decrease

View File

@ -48,7 +48,7 @@ using std::right;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartDebug::CartDebug(Debugger& dbg, Console& console, const OSystem& osystem) CartDebug::CartDebug(Debugger& dbg, Console& console, const OSystem& osystem)
: DebuggerSystem(dbg, console), : DebuggerSystem(dbg, console),
myOSystem(osystem) myOSystem{osystem}
{ {
// Add case sensitive compare for user labels // Add case sensitive compare for user labels
// TODO - should user labels be case insensitive too? // TODO - should user labels be case insensitive too?
@ -1516,7 +1516,7 @@ CartDebug::AddrType CartDebug::addressType(uInt16 addr) const
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartDebug::getBankDirectives(ostream& buf, BankInfo& info) const void CartDebug::getBankDirectives(ostream& buf, const BankInfo& info) const
{ {
// Start with the offset for this bank // Start with the offset for this bank
buf << "ORG " << Base::HEX4 << info.offset << endl; buf << "ORG " << Base::HEX4 << info.offset << endl;

View File

@ -324,7 +324,7 @@ class CartDebug : public DebuggerSystem
// Analyze of bank of ROM, generating a list of Distella directives // Analyze of bank of ROM, generating a list of Distella directives
// based on its disassembly // based on its disassembly
void getBankDirectives(ostream& buf, BankInfo& info) const; void getBankDirectives(ostream& buf, const BankInfo& info) const;
// Get access enum type from 'flags', taking precendence into account // Get access enum type from 'flags', taking precendence into account
Device::AccessType accessTypeAbsolute(Device::AccessFlags flags) const; Device::AccessType accessTypeAbsolute(Device::AccessFlags flags) const;

View File

@ -27,7 +27,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CpuDebug::CpuDebug(Debugger& dbg, Console& console) CpuDebug::CpuDebug(Debugger& dbg, Console& console)
: DebuggerSystem(dbg, console), : DebuggerSystem(dbg, console),
my6502(mySystem.m6502()) my6502{mySystem.m6502()}
{ {
} }

View File

@ -62,8 +62,8 @@ Debugger* Debugger::myStaticDebugger = nullptr;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Debugger::Debugger(OSystem& osystem, Console& console) Debugger::Debugger(OSystem& osystem, Console& console)
: DialogContainer(osystem), : DialogContainer(osystem),
myConsole(console), myConsole{console},
mySystem(console.system()) mySystem{console.system()}
{ {
// Init parser // Init parser
myParser = make_unique<DebuggerParser>(*this, osystem.settings()); myParser = make_unique<DebuggerParser>(*this, osystem.settings());
@ -716,10 +716,8 @@ bool Debugger::addFunction(const string& name, const string& definition,
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool Debugger::isBuiltinFunction(const string& name) bool Debugger::isBuiltinFunction(const string& name)
{ {
for(const auto& func: ourBuiltinFunctions) return std::any_of(ourBuiltinFunctions.cbegin(), ourBuiltinFunctions.cend(),
if(name == func.name) [&](const auto& func) { return name == func.name; });
return true;
return false;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -91,7 +91,7 @@ class ByteDerefOffsetExpression : public Expression
class ConstExpression : public Expression class ConstExpression : public Expression
{ {
public: public:
ConstExpression(const int value) : Expression(), myValue(value) { } ConstExpression(const int value) : Expression(), myValue{value} { }
Int32 evaluate() const override Int32 evaluate() const override
{ return myValue; } { return myValue; }
@ -103,7 +103,7 @@ class ConstExpression : public Expression
class CpuMethodExpression : public Expression class CpuMethodExpression : public Expression
{ {
public: public:
CpuMethodExpression(CpuMethod method) : Expression(), myMethod(std::mem_fn(method)) { } CpuMethodExpression(CpuMethod method) : Expression(), myMethod{std::mem_fn(method)} { }
Int32 evaluate() const override Int32 evaluate() const override
{ return myMethod(Debugger::debugger().cpuDebug()); } { return myMethod(Debugger::debugger().cpuDebug()); }
@ -134,7 +134,7 @@ class EqualsExpression : public Expression
class EquateExpression : public Expression class EquateExpression : public Expression
{ {
public: public:
EquateExpression(const string& label) : Expression(), myLabel(label) { } EquateExpression(const string& label) : Expression(), myLabel{label} { }
Int32 evaluate() const override Int32 evaluate() const override
{ return Debugger::debugger().cartDebug().getAddress(myLabel); } { return Debugger::debugger().cartDebug().getAddress(myLabel); }
@ -146,7 +146,7 @@ class EquateExpression : public Expression
class FunctionExpression : public Expression class FunctionExpression : public Expression
{ {
public: public:
FunctionExpression(const string& label) : Expression(), myLabel(label) { } FunctionExpression(const string& label) : Expression(), myLabel{label} { }
Int32 evaluate() const override Int32 evaluate() const override
{ return Debugger::debugger().getFunction(myLabel).evaluate(); } { return Debugger::debugger().getFunction(myLabel).evaluate(); }
@ -285,7 +285,7 @@ class PlusExpression : public Expression
class CartMethodExpression : public Expression class CartMethodExpression : public Expression
{ {
public: public:
CartMethodExpression(CartMethod method) : Expression(), myMethod(std::mem_fn(method)) { } CartMethodExpression(CartMethod method) : Expression(), myMethod{std::mem_fn(method)} { }
Int32 evaluate() const override Int32 evaluate() const override
{ return myMethod(Debugger::debugger().cartDebug()); } { return myMethod(Debugger::debugger().cartDebug()); }
@ -315,7 +315,7 @@ class ShiftRightExpression : public Expression
class RiotMethodExpression : public Expression class RiotMethodExpression : public Expression
{ {
public: public:
RiotMethodExpression(RiotMethod method) : Expression(), myMethod(std::mem_fn(method)) { } RiotMethodExpression(RiotMethod method) : Expression(), myMethod{std::mem_fn(method)} { }
Int32 evaluate() const override Int32 evaluate() const override
{ return myMethod(Debugger::debugger().riotDebug()); } { return myMethod(Debugger::debugger().riotDebug()); }
@ -327,7 +327,7 @@ class RiotMethodExpression : public Expression
class TiaMethodExpression : public Expression class TiaMethodExpression : public Expression
{ {
public: public:
TiaMethodExpression(TiaMethod method) : Expression(), myMethod(std::mem_fn(method)) { } TiaMethodExpression(TiaMethod method) : Expression(), myMethod{std::mem_fn(method)} { }
Int32 evaluate() const override Int32 evaluate() const override
{ return myMethod(Debugger::debugger().tiaDebug()); } { return myMethod(Debugger::debugger().tiaDebug()); }

View File

@ -57,8 +57,8 @@ using std::right;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DebuggerParser::DebuggerParser(Debugger& d, Settings& s) DebuggerParser::DebuggerParser(Debugger& d, Settings& s)
: debugger(d), : debugger{d},
settings(s) settings{s}
{ {
} }

View File

@ -27,12 +27,12 @@ DiStella::DiStella(const CartDebug& dbg, CartDebug::DisassemblyList& list,
CartDebug::AddrTypeArray& labels, CartDebug::AddrTypeArray& labels,
CartDebug::AddrTypeArray& directives, CartDebug::AddrTypeArray& directives,
CartDebug::ReservedEquates& reserved) CartDebug::ReservedEquates& reserved)
: myDbg(dbg), : myDbg{dbg},
myList(list), myList{list},
mySettings(s), mySettings{s},
myReserved(reserved), myReserved{reserved},
myLabels(labels), myLabels{labels},
myDirectives(directives) myDirectives{directives}
{ {
bool resolve_code = mySettings.resolveCode; bool resolve_code = mySettings.resolveCode;
CartDebug::AddressList& debuggerAddresses = info.addressList; CartDebug::AddressList& debuggerAddresses = info.addressList;

View File

@ -32,7 +32,7 @@ class Expression
{ {
public: public:
Expression(Expression* lhs = nullptr, Expression* rhs = nullptr) Expression(Expression* lhs = nullptr, Expression* rhs = nullptr)
: myLHS(lhs), myRHS(rhs) { } : myLHS{lhs}, myRHS{rhs} { }
virtual ~Expression() = default; virtual ~Expression() = default;
virtual Int32 evaluate() const { return 0; } virtual Int32 evaluate() const { return 0; }

View File

@ -26,7 +26,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TIADebug::TIADebug(Debugger& dbg, Console& console) TIADebug::TIADebug(Debugger& dbg, Console& console)
: DebuggerSystem(dbg, console), : DebuggerSystem(dbg, console),
myTIA(console.tia()) myTIA{console.tia()}
{ {
} }

View File

@ -25,7 +25,7 @@ Cartridge3EPlusWidget::Cartridge3EPlusWidget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont, GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, Cartridge3EPlus& cart) int x, int y, int w, int h, Cartridge3EPlus& cart)
: CartridgeEnhancedWidget(boss, lfont, nfont, x, y, w, h, cart), : CartridgeEnhancedWidget(boss, lfont, nfont, x, y, w, h, cart),
myCart3EP(cart) myCart3EP{cart}
{ {
initialize(); initialize();
} }

View File

@ -24,7 +24,7 @@ Cartridge4A50Widget::Cartridge4A50Widget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont, GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, Cartridge4A50& cart) int x, int y, int w, int h, Cartridge4A50& cart)
: CartDebugWidget(boss, lfont, nfont, x, y, w, h), : CartDebugWidget(boss, lfont, nfont, x, y, w, h),
myCart(cart) myCart{cart}
{ {
string info = string info =
"4A50 cartridge - 128K ROM and 32K RAM, split in various bank configurations\n" "4A50 cartridge - 128K ROM and 32K RAM, split in various bank configurations\n"

View File

@ -27,7 +27,7 @@ CartridgeARWidget::CartridgeARWidget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont, GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, CartridgeAR& cart) int x, int y, int w, int h, CartridgeAR& cart)
: CartDebugWidget(boss, lfont, nfont, x, y, w, h), : CartDebugWidget(boss, lfont, nfont, x, y, w, h),
myCart(cart) myCart{cart}
{ {
size_t size = myCart.mySize; size_t size = myCart.mySize;

View File

@ -25,7 +25,7 @@ CartridgeBUSWidget::CartridgeBUSWidget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont, GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, CartridgeBUS& cart) int x, int y, int w, int h, CartridgeBUS& cart)
: CartDebugWidget(boss, lfont, nfont, x, y, w, h), : CartDebugWidget(boss, lfont, nfont, x, y, w, h),
myCart(cart) myCart{cart}
{ {
uInt16 size = 8 * 4096; uInt16 size = 8 * 4096;
@ -75,7 +75,6 @@ CartridgeBUSWidget::CartridgeBUSWidget(
ypos += myLineHeight + 4; ypos += myLineHeight + 4;
new StaticTextWidget(boss, _font, xpos, ypos, lwidth, new StaticTextWidget(boss, _font, xpos, ypos, lwidth,
myFontHeight, "Datastream Pointers", TextAlign::Left); myFontHeight, "Datastream Pointers", TextAlign::Left);
xpos += lwidth;
myDatastreamPointers = new DataGridWidget(boss, _nfont, DS_X, ypos+myLineHeight-2, 4, 4, 6, 32, Common::Base::Fmt::_16_3_2); myDatastreamPointers = new DataGridWidget(boss, _nfont, DS_X, ypos+myLineHeight-2, 4, 4, 6, 32, Common::Base::Fmt::_16_3_2);
myDatastreamPointers->setTarget(this); myDatastreamPointers->setTarget(this);

View File

@ -24,7 +24,7 @@ CartridgeCDFWidget::CartridgeCDFWidget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont, GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, CartridgeCDF& cart) int x, int y, int w, int h, CartridgeCDF& cart)
: CartDebugWidget(boss, lfont, nfont, x, y, w, h), : CartDebugWidget(boss, lfont, nfont, x, y, w, h),
myCart(cart) myCart{cart}
{ {
const int VBORDER = 8; const int VBORDER = 8;
const int HBORDER = 2; const int HBORDER = 2;

View File

@ -31,7 +31,7 @@ CartridgeCMWidget::CartridgeCMWidget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont, GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, CartridgeCM& cart) int x, int y, int w, int h, CartridgeCM& cart)
: CartDebugWidget(boss, lfont, nfont, x, y, w, h), : CartDebugWidget(boss, lfont, nfont, x, y, w, h),
myCart(cart) myCart{cart}
{ {
uInt16 size = 4 * 4096; uInt16 size = 4 * 4096;

View File

@ -27,7 +27,7 @@ CartridgeCTYWidget::CartridgeCTYWidget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont, GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, CartridgeCTY& cart) int x, int y, int w, int h, CartridgeCTY& cart)
: CartDebugWidget(boss, lfont, nfont, x, y, w, h), : CartDebugWidget(boss, lfont, nfont, x, y, w, h),
myCart(cart) myCart{cart}
{ {
uInt16 size = 8 * 4096; uInt16 size = 8 * 4096;

View File

@ -25,7 +25,7 @@ CartridgeDPCPlusWidget::CartridgeDPCPlusWidget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont, GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, CartridgeDPCPlus& cart) int x, int y, int w, int h, CartridgeDPCPlus& cart)
: CartDebugWidget(boss, lfont, nfont, x, y, w, h), : CartDebugWidget(boss, lfont, nfont, x, y, w, h),
myCart(cart) myCart{cart}
{ {
size_t size = cart.mySize; size_t size = cart.mySize;

View File

@ -25,7 +25,7 @@ CartridgeDPCWidget::CartridgeDPCWidget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont, GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, CartridgeDPC& cart) int x, int y, int w, int h, CartridgeDPC& cart)
: CartDebugWidget(boss, lfont, nfont, x, y, w, h), : CartDebugWidget(boss, lfont, nfont, x, y, w, h),
myCart(cart) myCart{cart}
{ {
const int V_GAP = 4; const int V_GAP = 4;
size_t size = cart.mySize; size_t size = cart.mySize;
@ -68,11 +68,10 @@ CartridgeDPCWidget::CartridgeDPCWidget(
ypos += myLineHeight + V_GAP * 3; ypos += myLineHeight + V_GAP * 3;
// Data fetchers // Data fetchers
int lwidth = _font.getStringWidth("Data fetchers ");
new StaticTextWidget(boss, _font, xpos, ypos, "Data fetchers "); new StaticTextWidget(boss, _font, xpos, ypos, "Data fetchers ");
// Top registers // Top registers
lwidth = _font.getStringWidth("Counter registers "); int lwidth = _font.getStringWidth("Counter registers ");
xpos = 2 + _font.getMaxCharWidth() * 2; ypos += myLineHeight + 4; xpos = 2 + _font.getMaxCharWidth() * 2; ypos += myLineHeight + 4;
new StaticTextWidget(boss, _font, xpos, ypos, "Top registers "); new StaticTextWidget(boss, _font, xpos, ypos, "Top registers ");
xpos += lwidth; xpos += lwidth;

View File

@ -29,11 +29,11 @@ CartDebugWidget::CartDebugWidget(GuiObject* boss, const GUI::Font& lfont,
int x, int y, int w, int h) int x, int y, int w, int h)
: Widget(boss, lfont, x, y, w, h), : Widget(boss, lfont, x, y, w, h),
CommandSender(boss), CommandSender(boss),
_nfont(nfont), _nfont{nfont},
myFontWidth(lfont.getMaxCharWidth()), myFontWidth{lfont.getMaxCharWidth()},
myFontHeight(lfont.getFontHeight()), myFontHeight{lfont.getFontHeight()},
myLineHeight(lfont.getLineHeight()), myLineHeight{lfont.getLineHeight()},
myButtonHeight(myLineHeight + 4) myButtonHeight{myLineHeight + 4}
{ {
} }

View File

@ -28,7 +28,7 @@ CartridgeEnhancedWidget::CartridgeEnhancedWidget(GuiObject* boss, const GUI::Fon
int x, int y, int w, int h, int x, int y, int w, int h,
CartridgeEnhanced& cart) CartridgeEnhanced& cart)
: CartDebugWidget(boss, lfont, nfont, x, y, w, h), : CartDebugWidget(boss, lfont, nfont, x, y, w, h),
myCart(cart) myCart{cart}
{ {
} }

View File

@ -23,7 +23,7 @@ CartridgeFA2Widget::CartridgeFA2Widget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont, GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, CartridgeFA2& cart) int x, int y, int w, int h, CartridgeFA2& cart)
: CartridgeEnhancedWidget(boss, lfont, nfont, x, y, w, h, cart), : CartridgeEnhancedWidget(boss, lfont, nfont, x, y, w, h, cart),
myCartFA2(cart) myCartFA2{cart}
{ {
int xpos = 2, int xpos = 2,
ypos = initialize(); ypos = initialize();

View File

@ -24,7 +24,7 @@ CartridgeMDMWidget::CartridgeMDMWidget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont, GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, CartridgeMDM& cart) int x, int y, int w, int h, CartridgeMDM& cart)
: CartridgeEnhancedWidget(boss, lfont, nfont, x, y, w, h, cart), : CartridgeEnhancedWidget(boss, lfont, nfont, x, y, w, h, cart),
myCartMDM(cart) myCartMDM{cart}
{ {
initialize(); initialize();
} }

View File

@ -26,7 +26,7 @@ CartridgeMNetworkWidget::CartridgeMNetworkWidget(
int x, int y, int w, int h, int x, int y, int w, int h,
CartridgeMNetwork& cart) CartridgeMNetwork& cart)
: CartDebugWidget(boss, lfont, nfont, x, y, w, h), : CartDebugWidget(boss, lfont, nfont, x, y, w, h),
myCart(cart) myCart{cart}
{ {
} }

View File

@ -33,11 +33,11 @@ CartRamWidget::CartRamWidget(
int x, int y, int w, int h, CartDebugWidget& cartDebug) int x, int y, int w, int h, CartDebugWidget& cartDebug)
: Widget(boss, lfont, x, y, w, h), : Widget(boss, lfont, x, y, w, h),
CommandSender(boss), CommandSender(boss),
_nfont(nfont), _nfont{nfont},
myFontWidth(lfont.getMaxCharWidth()), myFontWidth{lfont.getMaxCharWidth()},
myFontHeight(lfont.getFontHeight()), myFontHeight{lfont.getFontHeight()},
myLineHeight(lfont.getLineHeight()), myLineHeight{lfont.getLineHeight()},
myButtonHeight(myLineHeight + 4) myButtonHeight{myLineHeight + 4}
{ {
int lwidth = lfont.getStringWidth("Description "), int lwidth = lfont.getStringWidth("Description "),
fwidth = w - lwidth - 20; fwidth = w - lwidth - 20;

View File

@ -24,7 +24,7 @@ CartridgeTVBoyWidget::CartridgeTVBoyWidget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont, GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, CartridgeTVBoy& cart) int x, int y, int w, int h, CartridgeTVBoy& cart)
: CartridgeEnhancedWidget(boss, lfont, nfont, x, y, w, h, cart), : CartridgeEnhancedWidget(boss, lfont, nfont, x, y, w, h, cart),
myCartTVBoy(cart) myCartTVBoy{cart}
{ {
initialize(); initialize();
} }

View File

@ -23,7 +23,7 @@ CartridgeUAWidget::CartridgeUAWidget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont, GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, CartridgeUA& cart, bool swapHotspots) int x, int y, int w, int h, CartridgeUA& cart, bool swapHotspots)
: CartridgeEnhancedWidget(boss, lfont, nfont, x, y, w, h, cart), : CartridgeEnhancedWidget(boss, lfont, nfont, x, y, w, h, cart),
mySwappedHotspots(swapHotspots) mySwappedHotspots{swapHotspots}
{ {
myHotspotDelta = 0x20; myHotspotDelta = 0x20;
initialize(); initialize();

View File

@ -23,7 +23,7 @@ CartridgeWDWidget::CartridgeWDWidget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont, GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, CartridgeWD& cart) int x, int y, int w, int h, CartridgeWD& cart)
: CartridgeEnhancedWidget(boss, lfont, nfont, x, y, w, h, cart), : CartridgeEnhancedWidget(boss, lfont, nfont, x, y, w, h, cart),
myCartWD(cart) myCartWD{cart}
{ {
initialize(); initialize();
} }

View File

@ -27,7 +27,7 @@ DataGridRamWidget::DataGridRamWidget(GuiObject* boss, const RamWidget& ram,
bool useScrollbar) bool useScrollbar)
: DataGridWidget(boss, font, x, y, cols, rows, colchars, : DataGridWidget(boss, font, x, y, cols, rows, colchars,
bits, base, useScrollbar), bits, base, useScrollbar),
_ram(ram) _ram{ram}
{ {
} }

View File

@ -38,12 +38,12 @@ DataGridWidget::DataGridWidget(GuiObject* boss, const GUI::Font& font,
: EditableWidget(boss, font, x, y, : EditableWidget(boss, font, x, y,
cols*(colchars * font.getMaxCharWidth() + 8) + 1, cols*(colchars * font.getMaxCharWidth() + 8) + 1,
font.getLineHeight()*rows + 1), font.getLineHeight()*rows + 1),
_rows(rows), _rows{rows},
_cols(cols), _cols{cols},
_rowHeight(font.getLineHeight()), _rowHeight{font.getLineHeight()},
_colWidth(colchars * font.getMaxCharWidth() + 8), _colWidth{colchars * font.getMaxCharWidth() + 8},
_bits(bits), _bits{bits},
_base(base) _base{base}
{ {
_flags = Widget::FLAG_ENABLED | Widget::FLAG_RETAIN_FOCUS | Widget::FLAG_WANTS_RAWDATA; _flags = Widget::FLAG_ENABLED | Widget::FLAG_RETAIN_FOCUS | Widget::FLAG_WANTS_RAWDATA;
_editMode = false; _editMode = false;

View File

@ -41,12 +41,12 @@ PromptWidget::PromptWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h) int x, int y, int w, int h)
: Widget(boss, font, x, y, w - ScrollBarWidget::scrollBarWidth(font), h), : Widget(boss, font, x, y, w - ScrollBarWidget::scrollBarWidth(font), h),
CommandSender(boss), CommandSender(boss),
_historySize(0), _historySize{0},
_historyIndex(0), _historyIndex{0},
_historyLine(0), _historyLine{0},
_makeDirty(false), _makeDirty{false},
_firstTime(true), _firstTime{true},
_exitedEarly(false) _exitedEarly{false}
{ {
_flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG | Widget::FLAG_RETAIN_FOCUS | _flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG | Widget::FLAG_RETAIN_FOCUS |
Widget::FLAG_WANTS_TAB | Widget::FLAG_WANTS_RAWDATA; Widget::FLAG_WANTS_TAB | Widget::FLAG_WANTS_RAWDATA;

View File

@ -33,14 +33,14 @@ RamWidget::RamWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n
uInt32 ramsize, uInt32 numrows, uInt32 pagesize) uInt32 ramsize, uInt32 numrows, uInt32 pagesize)
: Widget(boss, lfont, x, y, w, h), : Widget(boss, lfont, x, y, w, h),
CommandSender(boss), CommandSender(boss),
_nfont(nfont), _nfont{nfont},
myFontWidth(lfont.getMaxCharWidth()), myFontWidth{lfont.getMaxCharWidth()},
myFontHeight(lfont.getFontHeight()), myFontHeight{lfont.getFontHeight()},
myLineHeight(lfont.getLineHeight()), myLineHeight{lfont.getLineHeight()},
myButtonHeight(myLineHeight * 1.25), myButtonHeight{static_cast<int>(myLineHeight * 1.25)},
myRamSize(ramsize), myRamSize{ramsize},
myNumRows(numrows), myNumRows{numrows},
myPageSize(pagesize) myPageSize{pagesize}
{ {
const int bwidth = lfont.getStringWidth("Compare " + ELLIPSIS), const int bwidth = lfont.getStringWidth("Compare " + ELLIPSIS),
bheight = myLineHeight + 2; bheight = myLineHeight + 2;

View File

@ -25,7 +25,7 @@
RiotRamWidget::RiotRamWidget(GuiObject* boss, const GUI::Font& lfont, RiotRamWidget::RiotRamWidget(GuiObject* boss, const GUI::Font& lfont,
const GUI::Font& nfont, int x, int y, int w) const GUI::Font& nfont, int x, int y, int w)
: RamWidget(boss, lfont, nfont, x, y, w, 0, 128, 8, 128), : RamWidget(boss, lfont, nfont, x, y, w, 0, 128, 8, 128),
myDbg(instance().debugger().cartDebug()) myDbg{instance().debugger().cartDebug()}
{ {
} }

View File

@ -34,6 +34,8 @@ class RomListSettings : public Dialog, public CommandSender
RomListSettings(GuiObject* boss, const GUI::Font& font); RomListSettings(GuiObject* boss, const GUI::Font& font);
~RomListSettings() override = default; ~RomListSettings() override = default;
bool isShading() const override { return false; }
/** Show dialog onscreen at the specified coordinates /** Show dialog onscreen at the specified coordinates
('data' will be the currently selected line number in RomListWidget) */ ('data' will be the currently selected line number in RomListWidget) */
void show(uInt32 x, uInt32 y, const Common::Rect& bossRect, int data = -1); void show(uInt32 x, uInt32 y, const Common::Rect& bossRect, int data = -1);

View File

@ -42,7 +42,6 @@ TiaInfoWidget::TiaInfoWidget(GuiObject* boss, const GUI::Font& lfont,
+ COLUMN_GAP + lfont.getStringWidth("Scanline262262") + COLUMN_GAP + lfont.getStringWidth("Scanline262262")
+ EditTextWidget::calcWidth(lfont) * 3 <= max_w; + EditTextWidget::calcWidth(lfont) * 3 <= max_w;
const int lineHeight = lfont.getLineHeight(); const int lineHeight = lfont.getLineHeight();
int xpos = x, ypos = y + VBORDER;
int lwidth = lfont.getStringWidth(longstr ? "Frame Cycls" : "F. Cycls"); int lwidth = lfont.getStringWidth(longstr ? "Frame Cycls" : "F. Cycls");
int lwidth8 = lwidth - lfont.getMaxCharWidth() * 3; int lwidth8 = lwidth - lfont.getMaxCharWidth() * 3;
int lwidthR = lfont.getStringWidth(longstr ? "Frame Cnt." : "Frame "); int lwidthR = lfont.getStringWidth(longstr ? "Frame Cnt." : "Frame ");
@ -57,7 +56,7 @@ TiaInfoWidget::TiaInfoWidget(GuiObject* boss, const GUI::Font& lfont,
// Left column // Left column
// Left: Frame Cycle // Left: Frame Cycle
xpos = x; int xpos = x, ypos = y + VBORDER;
new StaticTextWidget(boss, lfont, xpos, ypos + 1, longstr ? "Frame Cycls" : "F. Cycls"); new StaticTextWidget(boss, lfont, xpos, ypos + 1, longstr ? "Frame Cycls" : "F. Cycls");
myFrameCycles = new EditTextWidget(boss, nfont, xpos + lwidth, ypos - 1, fwidth, lineHeight); myFrameCycles = new EditTextWidget(boss, nfont, xpos + lwidth, ypos - 1, fwidth, lineHeight);
myFrameCycles->setToolTip("CPU cycles executed this frame."); myFrameCycles->setToolTip("CPU cycles executed this frame.");

View File

@ -28,7 +28,7 @@ ToggleBitWidget::ToggleBitWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int cols, int rows, int colchars, int x, int y, int cols, int rows, int colchars,
const StringList& labels) const StringList& labels)
: ToggleWidget(boss, font, x, y, cols, rows), : ToggleWidget(boss, font, x, y, cols, rows),
_labelList(labels) _labelList{labels}
{ {
_rowHeight = font.getLineHeight(); _rowHeight = font.getLineHeight();
_colWidth = colchars * font.getMaxCharWidth() + 8; _colWidth = colchars * font.getMaxCharWidth() + 8;

View File

@ -28,9 +28,9 @@ ToggleWidget::ToggleWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int cols, int rows, int shiftBits) int x, int y, int cols, int rows, int shiftBits)
: Widget(boss, font, x, y, 16, 16), : Widget(boss, font, x, y, 16, 16),
CommandSender(boss), CommandSender(boss),
_rows(rows), _rows{rows},
_cols(cols), _cols{cols},
_shiftBits(shiftBits) _shiftBits{shiftBits}
{ {
_flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG | Widget::FLAG_RETAIN_FOCUS | _flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG | Widget::FLAG_RETAIN_FOCUS |
Widget::FLAG_WANTS_RAWDATA; Widget::FLAG_WANTS_RAWDATA;

View File

@ -24,9 +24,9 @@
AtariVox::AtariVox(Jack jack, const Event& event, const System& system, AtariVox::AtariVox(Jack jack, const Event& event, const System& system,
const string& portname, const FilesystemNode& eepromfile, const string& portname, const FilesystemNode& eepromfile,
const onMessageCallback& callback) const onMessageCallback& callback)
: SaveKey(jack, event, system, eepromfile, callback, Controller::Type::AtariVox) : SaveKey(jack, event, system, eepromfile, callback, Controller::Type::AtariVox),
mySerialPort{MediaFactory::createSerialPort()}
{ {
mySerialPort = MediaFactory::createSerialPort();
if(mySerialPort->openPort(portname)) if(mySerialPort->openPort(portname))
{ {
myCTSFlip = !mySerialPort->isCTS(); myCTSFlip = !mySerialPort->isCTS();

View File

@ -28,7 +28,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cartridge::Cartridge(const Settings& settings, const string& md5) Cartridge::Cartridge(const Settings& settings, const string& md5)
: mySettings(settings) : mySettings{settings}
{ {
auto to_uInt32 = [](const string& s, uInt32 pos) { auto to_uInt32 = [](const string& s, uInt32 pos) {
return uInt32(std::stoul(s.substr(pos, 8), nullptr, 16)); return uInt32(std::stoul(s.substr(pos, 8), nullptr, 16));

View File

@ -66,7 +66,6 @@ class Cartridge3F : public CartridgeEnhanced
*/ */
void install(System& system) override; void install(System& system) override;
/** /**
Get a descriptor for the device name (used in error checking). Get a descriptor for the device name (used in error checking).

View File

@ -24,8 +24,8 @@
Cartridge4A50::Cartridge4A50(const ByteBuffer& image, size_t size, Cartridge4A50::Cartridge4A50(const ByteBuffer& image, size_t size,
const string& md5, const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings, md5), : Cartridge(settings, md5),
myImage(make_unique<uInt8[]>(128_KB)), myImage{make_unique<uInt8[]>(128_KB)},
mySize(size) mySize{size}
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
// Supported file sizes are 32/64/128K, which are duplicated if necessary // Supported file sizes are 32/64/128K, which are duplicated if necessary

View File

@ -24,7 +24,7 @@
CartridgeAR::CartridgeAR(const ByteBuffer& image, size_t size, CartridgeAR::CartridgeAR(const ByteBuffer& image, size_t size,
const string& md5, const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings, md5), : Cartridge(settings, md5),
mySize(std::max<size_t>(size, 8448)) mySize{std::max<size_t>(size, 8448)}
{ {
// Create a load image buffer and copy the given image // Create a load image buffer and copy the given image
myLoadImages = make_unique<uInt8[]>(mySize); myLoadImages = make_unique<uInt8[]>(mySize);

View File

@ -44,7 +44,7 @@
CartridgeBUS::CartridgeBUS(const ByteBuffer& image, size_t size, CartridgeBUS::CartridgeBUS(const ByteBuffer& image, size_t size,
const string& md5, const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings, md5), : Cartridge(settings, md5),
myImage(make_unique<uInt8[]>(32_KB)) myImage{make_unique<uInt8[]>(32_KB)}
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
std::copy_n(image.get(), std::min(32_KB, size), myImage.get()); std::copy_n(image.get(), std::min(32_KB, size), myImage.get());

View File

@ -66,7 +66,7 @@ namespace {
CartridgeCDF::CartridgeCDF(const ByteBuffer& image, size_t size, CartridgeCDF::CartridgeCDF(const ByteBuffer& image, size_t size,
const string& md5, const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings, md5), : Cartridge(settings, md5),
myImage(make_unique<uInt8[]>(512_KB)) myImage{make_unique<uInt8[]>(512_KB)}
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
std::fill_n(myImage.get(), 512_KB, 0); std::fill_n(myImage.get(), 512_KB, 0);

View File

@ -24,7 +24,7 @@
CartridgeCM::CartridgeCM(const ByteBuffer& image, size_t size, CartridgeCM::CartridgeCM(const ByteBuffer& image, size_t size,
const string& md5, const Settings& settings) const string& md5, const Settings& settings)
: Cartridge(settings, md5), : Cartridge(settings, md5),
myImage(make_unique<uInt8[]>(16_KB)) myImage{make_unique<uInt8[]>(16_KB)}
{ {
// Copy the ROM image into my buffer // Copy the ROM image into my buffer
std::copy_n(image.get(), std::min(16_KB, size), myImage.get()); std::copy_n(image.get(), std::min(16_KB, size), myImage.get());

Some files were not shown because too many files have changed in this diff Show More