From 8344f78445d222704b348d24181b5936856fc925 Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Tue, 7 Sep 2021 11:38:30 +0200 Subject: [PATCH 01/20] some work on PlusROMs support --- src/emucore/PlusROM.cxx | 2 +- src/gui/InputDialog.cxx | 95 +++++++++++++++++++++++++-------- src/gui/InputDialog.hxx | 8 ++- src/gui/PlusRomsSetupDialog.cxx | 17 +++--- 4 files changed, 87 insertions(+), 35 deletions(-) diff --git a/src/emucore/PlusROM.cxx b/src/emucore/PlusROM.cxx index a4dcc890a..4bbec15f4 100644 --- a/src/emucore/PlusROM.cxx +++ b/src/emucore/PlusROM.cxx @@ -326,7 +326,7 @@ void PlusROM::send() { #if defined(HTTP_LIB_SUPPORT) if (myPendingRequests.size() >= MAX_CONCURRENT_REQUESTS) { - // Try to make room by cosuming any requests that have completed. + // Try to make room by consuming any requests that have completed. receive(); } diff --git a/src/gui/InputDialog.cxx b/src/gui/InputDialog.cxx index 8d75d4e4f..25adb16ab 100644 --- a/src/gui/InputDialog.cxx +++ b/src/gui/InputDialog.cxx @@ -54,7 +54,7 @@ InputDialog::InputDialog(OSystem& osystem, DialogContainer& parent, // Set real dimensions setSize(48 * fontWidth + PopUpWidget::dropDownWidth(_font) + HBORDER * 2, - _th + VGAP * 3 + lineHeight + 13 * (lineHeight + VGAP) + VGAP * 8 + buttonHeight + VBORDER * 3, + _th + VGAP * 3 + lineHeight + 13 * (lineHeight + VGAP) + VGAP * 9 + buttonHeight + VBORDER * 3, max_w, max_h); // The tab widget @@ -115,26 +115,48 @@ void InputDialog::addDevicePortTab() lwidth = _font.getStringWidth("Digital paddle sensitivity "); // Add joystick deadzone setting - myDeadzone = new SliderWidget(myTab, _font, HBORDER, ypos - 1, 13 * fontWidth, lineHeight, - "Joystick deadzone size", lwidth, kDeadzoneChanged, 5 * fontWidth); - myDeadzone->setMinValue(Joystick::DEAD_ZONE_MIN); - myDeadzone->setMaxValue(Joystick::DEAD_ZONE_MAX); - myDeadzone->setTickmarkIntervals(4); - wid.push_back(myDeadzone); + myJoystickDeadzone = new SliderWidget(myTab, _font, HBORDER, ypos - 1, 13 * fontWidth, lineHeight, + "Joystick deadzone size", lwidth, kJDeadzoneChanged, 5 * fontWidth); + myJoystickDeadzone->setMinValue(Joystick::DEAD_ZONE_MIN); + myJoystickDeadzone->setMaxValue(Joystick::DEAD_ZONE_MAX); + myJoystickDeadzone->setTickmarkIntervals(4); + wid.push_back(myJoystickDeadzone); - xpos = HBORDER; ypos += lineHeight + VGAP * 3; + xpos = HBORDER; ypos += lineHeight + VGAP * (3 - 2); new StaticTextWidget(myTab, _font, xpos, ypos+1, "Analog paddle:"); xpos += fontWidth * 2; - // Add analog paddle sensitivity + // Add analog paddle deadzone ypos += lineHeight; + myPaddleDeadzone = new SliderWidget(myTab, _font, xpos, ypos - 1, 13 * fontWidth, lineHeight, + "Deadzone size", + lwidth - fontWidth * 2, 0, 5 * fontWidth); + myPaddleDeadzone->setMinValue(Paddles::MIN_ANALOG_DEADZONE); + myPaddleDeadzone->setMaxValue(Paddles::MAX_ANALOG_DEADZONE); + myPaddleDeadzone->setStepValue(500); + myPaddleDeadzone->setTickmarkIntervals(3); + wid.push_back(myPaddleDeadzone); + + // Add analog paddle sensitivity + ypos += lineHeight + VGAP; myPaddleSpeed = new SliderWidget(myTab, _font, xpos, ypos - 1, 13 * fontWidth, lineHeight, - "Sensitivity", - lwidth - fontWidth * 2, kPSpeedChanged, 4 * fontWidth, "%"); - myPaddleSpeed->setMinValue(0); myPaddleSpeed->setMaxValue(Paddles::MAX_ANALOG_SENSE); + "Sensitivity", + lwidth - fontWidth * 2, kPSpeedChanged, 4 * fontWidth, "%"); + myPaddleSpeed->setMinValue(0); + myPaddleSpeed->setMaxValue(Paddles::MAX_ANALOG_SENSE); myPaddleSpeed->setTickmarkIntervals(3); wid.push_back(myPaddleSpeed); + // Add analog paddle acceleration + ypos += lineHeight + VGAP; + myPaddleAccel = new SliderWidget(myTab, _font, xpos, ypos - 1, 13 * fontWidth, lineHeight, + "Acceleration", + lwidth - fontWidth * 2, kPAccelChanged, 4 * fontWidth); + myPaddleAccel->setMinValue(Paddles::MIN_ANALOG_ACCEL); + myPaddleAccel->setMaxValue(Paddles::MAX_ANALOG_ACCEL); + myPaddleAccel->setStepValue(5); + myPaddleAccel->setTickmarkIntervals(4); + wid.push_back(myPaddleAccel); // Add dejitter (analog paddles) ypos += lineHeight + VGAP; @@ -160,7 +182,7 @@ void InputDialog::addDevicePortTab() wid.push_back(myDejitterDiff); // Add paddle speed (digital emulation) - ypos += lineHeight + VGAP * 3; + ypos += lineHeight + VGAP * (3 - 2); myDPaddleSpeed = new SliderWidget(myTab, _font, HBORDER, ypos - 1, 13 * fontWidth, lineHeight, "Digital paddle sensitivity", lwidth, kDPSpeedChanged, 4 * fontWidth, "%"); @@ -168,7 +190,7 @@ void InputDialog::addDevicePortTab() myDPaddleSpeed->setTickmarkIntervals(4); wid.push_back(myDPaddleSpeed); - ypos += lineHeight + VGAP * 3; + ypos += lineHeight + VGAP * (3 - 2); myAutoFireRate = new SliderWidget(myTab, _font, HBORDER, ypos - 1, 13 * fontWidth, lineHeight, "Autofire rate", lwidth, kAutoFireChanged, 5 * fontWidth, "Hz"); @@ -177,7 +199,7 @@ void InputDialog::addDevicePortTab() wid.push_back(myAutoFireRate); // Add 'allow all 4 directions' for joystick - ypos += lineHeight + VGAP * 4; + ypos += lineHeight + VGAP * (4 - 2); myAllowAll4 = new CheckboxWidget(myTab, _font, HBORDER, ypos, "Allow all 4 directions on joystick"); wid.push_back(myAllowAll4); @@ -197,7 +219,7 @@ void InputDialog::addDevicePortTab() int fwidth; // Add EEPROM erase (part 1/2) - ypos += VGAP * 3; + ypos += VGAP * (3 - 1); fwidth = _font.getStringWidth("AtariVox/SaveKey"); new StaticTextWidget(myTab, _font, _w - HBORDER - 2 - fwidth, ypos, "AtariVox/SaveKey"); @@ -338,10 +360,14 @@ void InputDialog::loadConfig() handleCursorState(); // Joystick deadzone - myDeadzone->setValue(settings.getInt("joydeadzone")); + myJoystickDeadzone->setValue(settings.getInt("joydeadzone")); + // Paddle deadzone (analog) + myPaddleDeadzone->setValue(settings.getInt("pdeadzone")); // Paddle speed (analog) myPaddleSpeed->setValue(settings.getInt("psense")); + // Paddle acceleration (analog) + myPaddleAccel->setValue(settings.getInt("paccel")); // Paddle dejitter (analog) myDejitterBase->setValue(settings.getInt("dejitter.base")); myDejitterDiff->setValue(settings.getInt("dejitter.diff")); @@ -404,16 +430,24 @@ void InputDialog::saveConfig() // *** Device & Ports *** // Joystick deadzone - int deadzone = myDeadzone->getValue(); + int deadzone = myJoystickDeadzone->getValue(); settings.setValue("joydeadzone", deadzone); Joystick::setDeadZone(deadzone); + // Paddle deadzone (analog) + deadzone = myPaddleDeadzone->getValue(); + settings.setValue("pdeadzone", deadzone); + Paddles::setAnalogDeadzone(deadzone); // Paddle speed (analog) int sensitivity = myPaddleSpeed->getValue(); settings.setValue("psense", sensitivity); Paddles::setAnalogSensitivity(sensitivity); + // Paddle acceleration (analog) + int accel = myPaddleAccel->getValue(); + settings.setValue("paccel", accel); + Paddles::setAnalogAccel(accel); - // Paddle speed (digital and mouse) + // Paddle dejitter (analog) int dejitter = myDejitterBase->getValue(); settings.setValue("dejitter.base", dejitter); Paddles::setDejitterBase(dejitter); @@ -491,10 +525,16 @@ void InputDialog::setDefaults() case 1: // Devices & Ports // Joystick deadzone - myDeadzone->setValue(0); + myJoystickDeadzone->setValue(0); + + // Paddle deadzone + myPaddleDeadzone->setValue(0); // Paddle speed (analog) myPaddleSpeed->setValue(20); + + // Paddle acceleration + myPaddleAccel->setValue(0); #if defined(RETRON77) myDejitterBase->setValue(2); myDejitterDiff->setValue(6); @@ -653,8 +693,8 @@ void InputDialog::handleCommand(CommandSender* sender, int cmd, setDefaults(); break; - case kDeadzoneChanged: - myDeadzone->setValueLabel(Joystick::deadZoneValue(myDeadzone->getValue())); + case kJDeadzoneChanged: + myJoystickDeadzone->setValueLabel(Joystick::deadZoneValue(myJoystickDeadzone->getValue())); break; case kPSpeedChanged: @@ -662,6 +702,10 @@ void InputDialog::handleCommand(CommandSender* sender, int cmd, myPaddleSpeed->getValue()) * 100.F)); break; + case kPAccelChanged: + updatePaddleAccel(); + break; + case kDejitterAvChanged: updateDejitterAveraging(); break; @@ -737,6 +781,13 @@ void InputDialog::handleCommand(CommandSender* sender, int cmd, } } +void InputDialog::updatePaddleAccel() +{ + int strength = myPaddleAccel->getValue(); + + myPaddleAccel->setValueLabel(strength ? std::to_string(strength) + "%" : "Off"); +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void InputDialog::updateDejitterAveraging() { diff --git a/src/gui/InputDialog.hxx b/src/gui/InputDialog.hxx index e2faeca0f..6b75eb80a 100644 --- a/src/gui/InputDialog.hxx +++ b/src/gui/InputDialog.hxx @@ -64,6 +64,7 @@ class InputDialog : public Dialog void handleMouseControlState(); void handleCursorState(); + void updatePaddleAccel(); void updateDejitterAveraging(); void updateDejitterReaction(); void updateAutoFireRate(); @@ -71,8 +72,9 @@ class InputDialog : public Dialog private: enum { - kDeadzoneChanged = 'DZch', + kJDeadzoneChanged = 'DZch', kPSpeedChanged = 'Ppch', + kPAccelChanged = 'PAch', kDejitterAvChanged = 'JAch', kDejitterReChanged = 'JRch', kDPSpeedChanged = 'PDch', @@ -96,8 +98,10 @@ class InputDialog : public Dialog PopUpWidget* myAVoxPort{nullptr}; - SliderWidget* myDeadzone{nullptr}; + SliderWidget* myJoystickDeadzone{nullptr}; SliderWidget* myPaddleSpeed{nullptr}; + SliderWidget* myPaddleDeadzone{nullptr}; + SliderWidget* myPaddleAccel{nullptr}; SliderWidget* myDejitterBase{nullptr}; SliderWidget* myDejitterDiff{nullptr}; SliderWidget* myDPaddleSpeed{nullptr}; diff --git a/src/gui/PlusRomsSetupDialog.cxx b/src/gui/PlusRomsSetupDialog.cxx index 5da2e55df..0d112b124 100644 --- a/src/gui/PlusRomsSetupDialog.cxx +++ b/src/gui/PlusRomsSetupDialog.cxx @@ -20,9 +20,7 @@ #include "PlusRomsSetupDialog.hxx" -static const int MIN_NICK_LEN = 2; static const int MAX_NICK_LEN = 16; -static const char* MIN_NICK_LEN_STR = "Two"; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PlusRomsSetupDialog::PlusRomsSetupDialog(OSystem& osystem, DialogContainer& parent, @@ -33,7 +31,8 @@ PlusRomsSetupDialog::PlusRomsSetupDialog(OSystem& osystem, DialogContainer& pare return isalnum(c) || (c == '_'); }; - setTextFilter(filter, 0); + setTextFilter(filter); + setToolTip("Enter your PlusCart High Score Club nickname here."); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -46,6 +45,9 @@ void PlusRomsSetupDialog::loadConfig() void PlusRomsSetupDialog::saveConfig() { instance().settings().setValue("plusroms.nick", getResult(0)); + if(instance().settings().getString("plusroms.id") == EmptyString) + instance().settings().setValue("plusroms.id", "12345678901234567890123456789012"); // TODO: generate in PlusROM class + // Note: The user can cancel, so the existance of an ID must be checked (and generated if not existing) when transmitting scores } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -56,13 +58,8 @@ void PlusRomsSetupDialog::handleCommand(CommandSender* sender, int cmd, { case GuiObject::kOKCmd: case EditableWidget::kAcceptCmd: - if(getResult(0).length() >= MIN_NICK_LEN) - { - saveConfig(); - instance().eventHandler().leaveMenuMode(); - } - else - setMessage(MIN_NICK_LEN_STR + string(" characters minimum")); + saveConfig(); + instance().eventHandler().leaveMenuMode(); break; case kCloseCmd: From 43873a1d667fbaaa07f1b51b92fb8ef050a01f8e Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Tue, 7 Sep 2021 11:39:33 +0200 Subject: [PATCH 02/20] added new paddle options (TODO: deadzone and testing with real controllers, remove test code) --- docs/graphics/eventmapping_devsports.png | Bin 4644 -> 4928 bytes docs/index.html | 51 +++++++-- src/common/PJoystickHandler.cxx | 36 +++++- src/common/PJoystickHandler.hxx | 2 + src/common/PKeyboardHandler.cxx | 4 + src/common/jsonDefinitions.hxx | 4 + src/emucore/Event.hxx | 2 + src/emucore/EventHandler.cxx | 55 ++++++++- src/emucore/EventHandler.hxx | 4 +- src/emucore/OSystem.cxx | 2 +- src/emucore/Paddles.cxx | 137 +++++++++++++++++------ src/emucore/Paddles.hxx | 25 ++++- src/emucore/Settings.cxx | 61 ++++++---- 13 files changed, 307 insertions(+), 76 deletions(-) diff --git a/docs/graphics/eventmapping_devsports.png b/docs/graphics/eventmapping_devsports.png index 4d006e3266aff8937b816be52a8ecf37847ba2ca..c7cbf6720bf4578c546beda34b91abb0178be415 100644 GIT binary patch literal 4928 zcmZ8ldpOf=A16kVLk>Acd33~##T@5JAqh#&BOaoRu`oG|LJm2Ulw(Lm3X3%RWzMo; zVd3%DE?5!?-zP*gerHq`tjW^_~g((lNS8;YP;P*RceU68x=ArPG7ice5xN`ZL+0C0b zE6<8AF4DT*MKfrnFVnpCPC9vb23^htTe&Fh1wz3WT|#(xMBD#fyyT#AA08eFoaKdc z*X|6n3#~G~>q;b!ObP2r;|7wEZgq_oYKgT^C;j6FK_M1QYQV^*% zMX0bku5}#SC2qfAX&w`ywH;dF+)d)l}F>$=64Jh4DZrWqJ)p% zcIS!xo?V-NR4%nDO2gk6p}@I;rP_LgAK9%~e#T1o6f6I&5`&mN31_JBLmj*L83pbk zl!-9~M68W zvPzA9hZ!-W1zF=Z-ID!Pe+hA_{%Vv*F`>Ja9v9=>YWc&{cLt=g&s3b`M4fx{d82l| z9~7R>?-UH;eg@?4D)Ha87<#1HAjyI8%zW!1EG#_2$+rcD872xhb$U*kB-wg{I9$cD zsFO`S9S#tTPaNfd*hJaunnU1&$|qAtKyO?itq1ystJ#OOfl=1#x>%pK7Fdb|lGIw< zifGCluLluliR+ZD+@A4z4OWjpvq39Jq0IA)y6ejs{76;Q3ry#$U;%<*I+ru!er@Wb z`X?RDSWfr+!TRgY#MKwGy5G`Qd+sd&q?|N#;1Sn-K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a-E+`@Sjjt5-3lgiHebFeAzjq+ zeMhg#5Iw)!`OsMeQ&w2ST0r;@I%nw37cnmq+*Wi;{OE50^sD+bZKHx~V~d!@%U>s6Pr@t(nKaG@~!0b{<0XJSQ#X=g{6UtXpjY?Ifu&A(|yz0#=($zb9dqNV5DJc*YYtcA_UfIArkRg52bM1Z+ETREnKG_NejZ5KNF( zZ*!CS+_$%1F!M=hUQNx{gQ<_FA%;5)$;U26dt!$%J5)#If6oitVNbfw!*DZugvh$R z)4;)C;XL)d!=UqR?#3(puD}MG<5$t*>AK)A+xsHDVAfhe9HA7kyAB)}qV-%iC$$wt zulY=s!x-)p_0k(IJ;At{*1RHa$emJN2iP$9h23DGt(a+?}yxS!aU!qF08l!CjPh4irw)L)azqMKy65XZq{wjm^~d$W^*c$#&8E zF1P^=;1W9-n=^$f%b_408O7HB|G^(&%ov(`zu%qvHz&K33MIl=)U+AJ_YasuIDrtt zeodEPo(+SCQl!UZ>2*8})$fpkbwK%1Z-1GNm>x7yTI;*$5mj}Vopt;e z*03|Qs{zlqf#c4Of9BD% z>dG2_OlS|aP}}P%AKLAw5w^rUo@?lXwVH7TkeC4kcA70QG78a??zc9vyMJ^1Xus39 c+1Y&qQIAxp^2_LhFB_1JrGo|0-0R+d0ddeVControl + F1 + + Decrease analog paddle deadzone + Shift-Control-Alt + F1 + Shift-Control-Cmd + F1 + + + Increase analog paddle deadzone + Control-Alt + F1 + Control-Cmd + F1 + + Decrease analog paddle sensitivity Shift-Control + F2 @@ -1595,6 +1606,17 @@ Control + F2 + + Decrease analog paddle acceleration + Shift-Control-Alt + F2 + Shift-Control-Cmd + F2 + + + Increase analog paddle acceleration + Control-Alt + F2 + Control-Cmd + F2 + + Decrease analog paddle dejitter averaging Shift-Control + F3 @@ -1933,8 +1955,9 @@

Global Keys (can be remapped)

-

These keys allow selecting and changing settings without having to remember the - dedicated keys. They keys are grouped by 'Audio & Video', 'Input Device & Ports' and 'Debug' settings.

+

These keys allow selecting and changing settings without having to remember + the dedicated hotkeys. The global keys are grouped by 'Audio & Video', + 'Input Devices & Ports' and 'Debug' settings.

@@ -1976,8 +1999,8 @@
  • Only available if UI messages are enabled.
  • Currently not available settings are automatically skipped.
  • -
  • If a setting was previously selected via a dedicated key, its value can also be changed with the - global keys.
  • +
  • If a setting was previously selected via a dedicated hotkey, its + value can also be directly changed with the global keys.

@@ -2947,6 +2970,13 @@ range from 3200 to 32200. + + + + + + + + + + - + - + @@ -2990,7 +3025,7 @@ when you want to disable them.
E.g. a 2-player game is using either the 'F' or 'R' keys for movement, and pressing Control (for Fire) will perform an unwanted action - associated with 'Control + R' or 'Control + F' default keys. + associated with 'Control + F' or 'Control + R' default keys. @@ -3989,7 +4024,9 @@
Function
-pdeadzone <0 - 15000>
Set the deadzone area for analog paddles. All values within the + deadzone are treated as zero-axis values, while only those values + outside are registered as valid input.
-psense <number>
Sensitivity for emulation of paddles when using analog paddles. @@ -2954,14 +2984,19 @@ faster movement.
-paccel <0 - 100>
Acceleration of analog paddles when moving them fast.
-dejitter.base <0 - 10>
Strength of paddle input averaging.Strength of analog paddle input averaging.
-dejitter.diff <0 - 10>
Impact of fast paddle movement on input averaging.Impact of fast analog paddle movement on input averaging.
+ + diff --git a/src/common/PJoystickHandler.cxx b/src/common/PJoystickHandler.cxx index 7f9a50f95..de3bf4eac 100644 --- a/src/common/PJoystickHandler.cxx +++ b/src/common/PJoystickHandler.cxx @@ -664,7 +664,6 @@ bool PhysicalJoystickHandler::addJoyMapping(Event::Type event, EventMode mode, i { EventMode evMode = getEventMode(event, mode); - // This confusing code is because each axis has two associated values, // but analog events only affect one of the axis. if (Event::isAnalog(event)) @@ -956,7 +955,20 @@ void PhysicalJoystickHandler::changeDeadzone(int direction) int value = Joystick::deadZoneValue(deadzone); myOSystem.frameBuffer().showGaugeMessage("Joystick deadzone", std::to_string(value), - value, 3200, 32200); + deadzone, Joystick::DEAD_ZONE_MIN, Joystick::DEAD_ZONE_MAX); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void PhysicalJoystickHandler::changeAnalogPaddleDeadzone(int direction) +{ + int deadzone = BSPF::clamp(myOSystem.settings().getInt("pdeadzone") + direction * 500, + Paddles::MIN_ANALOG_DEADZONE, Paddles::MAX_ANALOG_DEADZONE); + myOSystem.settings().setValue("pdeadzone", deadzone); + + Paddles::setAnalogDeadzone(deadzone); + + myOSystem.frameBuffer().showGaugeMessage("Analog paddle deadzone", std::to_string(deadzone), deadzone, + Paddles::MIN_ANALOG_DEADZONE, Paddles::MAX_ANALOG_DEADZONE); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -970,10 +982,30 @@ void PhysicalJoystickHandler::changeAnalogPaddleSensitivity(int direction) 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::changeAnalogPaddleAcceleration(int direction) +{ + int accel = BSPF::clamp(myOSystem.settings().getInt("paccel") + direction * 5, + Paddles::MIN_ANALOG_ACCEL, Paddles::MAX_ANALOG_ACCEL); + myOSystem.settings().setValue("paccel", accel); + + Paddles::setAnalogAccel(accel); + + ostringstream ss; + if(accel) + ss << accel << "%"; + else + ss << "Off"; + + myOSystem.frameBuffer().showGaugeMessage("Analog paddle acceleration", ss.str(), accel, + Paddles::MIN_ANALOG_ACCEL, Paddles::MAX_ANALOG_ACCEL); +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void PhysicalJoystickHandler::changePaddleDejitterAveraging(int direction) { diff --git a/src/common/PJoystickHandler.hxx b/src/common/PJoystickHandler.hxx index b67bcea76..e5fb287e1 100644 --- a/src/common/PJoystickHandler.hxx +++ b/src/common/PJoystickHandler.hxx @@ -111,7 +111,9 @@ class PhysicalJoystickHandler VariantList database() const; void changeDeadzone(int direction = +1); + void changeAnalogPaddleDeadzone(int direction = +1); void changeAnalogPaddleSensitivity(int direction = +1); + void changeAnalogPaddleAcceleration(int direction = +1); void changePaddleDejitterAveraging(int direction = +1); void changePaddleDejitterReaction(int direction = +1); void changeDigitalPaddleSensitivity(int direction = +1); diff --git a/src/common/PKeyboardHandler.cxx b/src/common/PKeyboardHandler.cxx index a3b6d2e19..50fdafa75 100644 --- a/src/common/PKeyboardHandler.cxx +++ b/src/common/PKeyboardHandler.cxx @@ -689,8 +689,12 @@ PhysicalKeyboardHandler::DefaultCommonMapping = { { Event::DecreaseDeadzone, KBDK_F1, KBDM_CTRL | KBDM_SHIFT }, { Event::IncreaseDeadzone, KBDK_F1, KBDM_CTRL }, + { Event::DecAnalogDeadzone, KBDK_F1, KBDM_CTRL | MOD3 | KBDM_SHIFT}, + { Event::IncAnalogDeadzone, KBDK_F1, KBDM_CTRL | MOD3}, { Event::DecAnalogSense, KBDK_F2, KBDM_CTRL | KBDM_SHIFT }, { Event::IncAnalogSense, KBDK_F2, KBDM_CTRL }, + { Event::DecAnalogAccel, KBDK_F2, KBDM_CTRL | MOD3 | KBDM_SHIFT}, + { Event::IncAnalogAccel, KBDK_F2, KBDM_CTRL | MOD3}, { Event::DecDejtterAveraging, KBDK_F3, KBDM_CTRL | KBDM_SHIFT }, { Event::IncDejtterAveraging, KBDK_F3, KBDM_CTRL }, { Event::DecDejtterReaction, KBDK_F4, KBDM_CTRL | KBDM_SHIFT }, diff --git a/src/common/jsonDefinitions.hxx b/src/common/jsonDefinitions.hxx index 522bcd2ed..3d60ae30d 100644 --- a/src/common/jsonDefinitions.hxx +++ b/src/common/jsonDefinitions.hxx @@ -195,8 +195,12 @@ NLOHMANN_JSON_SERIALIZE_ENUM(Event::Type, { {Event::DecreaseDeadzone, "DecreaseDeadzone"}, {Event::IncreaseDeadzone, "IncreaseDeadzone"}, + {Event::DecAnalogDeadzone, "DecAnalogDeadzone"}, + {Event::IncAnalogDeadzone, "IncAnalogDeadzone"}, {Event::DecAnalogSense, "DecAnalogSense"}, {Event::IncAnalogSense, "IncAnalogSense"}, + {Event::DecAnalogAccel, "DecAnalogAccel"}, + {Event::IncAnalogAccel, "IncAnalogAccel"}, {Event::DecDejtterAveraging, "DecDejtterAveraging"}, {Event::IncDejtterAveraging, "IncDejtterAveraging"}, {Event::DecDejtterReaction, "DecDejtterReaction"}, diff --git a/src/emucore/Event.hxx b/src/emucore/Event.hxx index ee489d384..64381a0de 100644 --- a/src/emucore/Event.hxx +++ b/src/emucore/Event.hxx @@ -147,7 +147,9 @@ class Event HighScoresMenuMode, // Input settings DecreaseDeadzone, IncreaseDeadzone, + DecAnalogDeadzone, IncAnalogDeadzone, DecAnalogSense, IncAnalogSense, + DecAnalogAccel, IncAnalogAccel, DecDejtterAveraging, IncDejtterAveraging, DecDejtterReaction, IncDejtterReaction, DecDigitalSense, IncDigitalSense, diff --git a/src/emucore/EventHandler.cxx b/src/emucore/EventHandler.cxx index c72982be3..da2714945 100644 --- a/src/emucore/EventHandler.cxx +++ b/src/emucore/EventHandler.cxx @@ -99,6 +99,9 @@ void EventHandler::initialize() setActionMappings(EventMode::kMenuMode); Joystick::setDeadZone(myOSystem.settings().getInt("joydeadzone")); + Paddles::setAnalogDeadzone(myOSystem.settings().getInt("pdeadzone")); + Paddles::setAnalogAccel(myOSystem.settings().getInt("paccel")); + Paddles::setDejitterDiff(myOSystem.settings().getInt("dejitter.diff")); Paddles::setDejitterBase(myOSystem.settings().getInt("dejitter.base")); Paddles::setDejitterDiff(myOSystem.settings().getInt("dejitter.diff")); Paddles::setDigitalSensitivity(myOSystem.settings().getInt("dsense")); @@ -455,7 +458,9 @@ bool EventHandler::skipInputSetting() const && (myAdjustSetting == AdjustSetting::DEADZONE || myAdjustSetting == AdjustSetting::FOUR_DIRECTIONS)) || (!paddle - && (myAdjustSetting == AdjustSetting::ANALOG_SENSITIVITY + && (myAdjustSetting == AdjustSetting::ANALOG_DEADZONE + || myAdjustSetting == AdjustSetting::ANALOG_SENSITIVITY + || myAdjustSetting == AdjustSetting::ANALOG_ACCEL || myAdjustSetting == AdjustSetting::DEJITTER_AVERAGING || myAdjustSetting == AdjustSetting::DEJITTER_REACTION || myAdjustSetting == AdjustSetting::DIGITAL_SENSITIVITY @@ -591,7 +596,9 @@ AdjustFunction EventHandler::getAdjustSetting(AdjustSetting setting) // *** Input settings *** std::bind(&PhysicalJoystickHandler::changeDeadzone, &joyHandler(), _1), + std::bind(&PhysicalJoystickHandler::changeAnalogPaddleDeadzone, &joyHandler(), _1), std::bind(&PhysicalJoystickHandler::changeAnalogPaddleSensitivity, &joyHandler(), _1), + std::bind(&PhysicalJoystickHandler::changeAnalogPaddleAcceleration, &joyHandler(), _1), std::bind(&PhysicalJoystickHandler::changePaddleDejitterAveraging, &joyHandler(), _1), std::bind(&PhysicalJoystickHandler::changePaddleDejitterReaction, &joyHandler(), _1), std::bind(&PhysicalJoystickHandler::changeDigitalPaddleSensitivity, &joyHandler(), _1), @@ -1371,11 +1378,29 @@ void EventHandler::handleEvent(Event::Type event, Int32 value, bool repeated) } return; + case Event::DecAnalogDeadzone: + if(pressed) + { + myPJoyHandler->changeAnalogPaddleDeadzone(-1); + myAdjustSetting = AdjustSetting::ANALOG_DEADZONE; + myAdjustActive = true; + } + return; + + case Event::IncAnalogDeadzone: + if(pressed) + { + myPJoyHandler->changeAnalogPaddleDeadzone(+1); + myAdjustSetting = AdjustSetting::ANALOG_DEADZONE; + myAdjustActive = true; + } + return; + case Event::DecAnalogSense: if(pressed) { myPJoyHandler->changeAnalogPaddleSensitivity(-1); - myAdjustSetting = AdjustSetting::PADDLE_SENSITIVITY; + myAdjustSetting = AdjustSetting::ANALOG_SENSITIVITY; myAdjustActive = true; } return; @@ -1384,10 +1409,27 @@ void EventHandler::handleEvent(Event::Type event, Int32 value, bool repeated) if(pressed) { myPJoyHandler->changeAnalogPaddleSensitivity(+1); - myAdjustSetting = AdjustSetting::PADDLE_SENSITIVITY; + myAdjustSetting = AdjustSetting::ANALOG_SENSITIVITY; myAdjustActive = true; } + return; + case Event::DecAnalogAccel: + if(pressed) + { + myPJoyHandler->changeAnalogPaddleAcceleration(-1); + myAdjustSetting = AdjustSetting::ANALOG_ACCEL; + myAdjustActive = true; + } + return; + + case Event::IncAnalogAccel: + if(pressed) + { + myPJoyHandler->changeAnalogPaddleAcceleration(+1); + myAdjustSetting = AdjustSetting::ANALOG_ACCEL; + myAdjustActive = true; + } return; case Event::DecDejtterAveraging: @@ -3279,11 +3321,14 @@ EventHandler::EmulActionList EventHandler::ourEmulActionList = { { { Event::VolumeDecrease, "Decrease volume", "" }, { Event::VolumeIncrease, "Increase volume", "" }, - { Event::DecreaseDeadzone, "Decrease joystick deadzone", "" }, { Event::IncreaseDeadzone, "Increase joystick deadzone", "" }, + { Event::DecAnalogDeadzone, "Decrease analog paddle deadzone", "" }, + { Event::IncAnalogDeadzone, "Increase analog paddle deadzone", "" }, { Event::DecAnalogSense, "Decrease analog paddle sensitivity", "" }, { Event::IncAnalogSense, "Increase analog paddle sensitivity", "" }, + { Event::DecAnalogAccel, "Decrease analog paddle acceleration", "" }, + { Event::IncAnalogAccel, "Increase analog paddle acceleration", "" }, { Event::DecDejtterAveraging, "Decrease paddle dejitter averaging", "" }, { Event::IncDejtterAveraging, "Increase paddle dejitter averaging", "" }, { Event::DecDejtterReaction, "Decrease paddle dejitter reaction", "" }, @@ -3467,7 +3512,9 @@ const Event::EventSet EventHandler::KeyboardEvents = { const Event::EventSet EventHandler::DevicesEvents = { Event::DecreaseDeadzone, Event::IncreaseDeadzone, + Event::DecAnalogDeadzone, Event::IncAnalogDeadzone, Event::DecAnalogSense, Event::IncAnalogSense, + Event::DecAnalogAccel, Event::IncAnalogAccel, Event::DecDejtterAveraging, Event::IncDejtterAveraging, Event::DecDejtterReaction, Event::IncDejtterReaction, Event::DecDigitalSense, Event::IncDigitalSense, diff --git a/src/emucore/EventHandler.hxx b/src/emucore/EventHandler.hxx index e6dbdb66c..49acaf0b2 100644 --- a/src/emucore/EventHandler.hxx +++ b/src/emucore/EventHandler.hxx @@ -473,7 +473,9 @@ class EventHandler INTERPOLATION, // *** Input group *** DEADZONE, + ANALOG_DEADZONE, ANALOG_SENSITIVITY, + ANALOG_ACCEL, DEJITTER_AVERAGING, DEJITTER_REACTION, DIGITAL_SENSITIVITY, @@ -645,7 +647,7 @@ class EventHandler #else REFRESH_SIZE = 0, #endif - EMUL_ACTIONLIST_SIZE = 212 + PNG_SIZE + COMBO_SIZE + REFRESH_SIZE, + EMUL_ACTIONLIST_SIZE = 216 + PNG_SIZE + COMBO_SIZE + REFRESH_SIZE, MENU_ACTIONLIST_SIZE = 19 ; diff --git a/src/emucore/OSystem.cxx b/src/emucore/OSystem.cxx index dab463aaf..19e34795f 100644 --- a/src/emucore/OSystem.cxx +++ b/src/emucore/OSystem.cxx @@ -510,7 +510,7 @@ string OSystem::createConsole(const FilesystemNode& rom, const string& md5sum, } // Check for first PlusROM start if(myConsole->cartridge().isPlusROM() && - settings().getString("plusroms.nick") == EmptyString) + settings().getString("plusroms.id") == EmptyString) { myEventHandler->changeStateByEvent(Event::PlusRomsSetupMode); } diff --git a/src/emucore/Paddles.cxx b/src/emucore/Paddles.cxx index f6f675bc5..d0667cf8f 100644 --- a/src/emucore/Paddles.cxx +++ b/src/emucore/Paddles.cxx @@ -195,6 +195,45 @@ void Paddles::update() setPin(DigitalPin::Three, !getAutoFireStateP1(firePressedB)); } +AnalogReadout::Connection Paddles::getReadOut(int lastAxis, int& newAxis, int center) +{ + static constexpr std::array bFac = { + // higher values mean more dejitter strength + 0, // off + 0.50, 0.59, 0.67, 0.74, 0.80, + 0.85, 0.89, 0.92, 0.94, 0.95 + }; + static constexpr std::array dFac = { + // lower values mean more dejitter strength + 1, // off + 1.0 / 181, 1.0 / 256, 1.0 / 362, 1.0 / 512, 1.0 / 724, + 1.0 / 1024, 1.0 / 1448, 1.0 / 2048, 1.0 / 2896, 1.0 / 4096 + }; + const double baseFactor = bFac[DEJITTER_BASE]; + const double diffFactor = dFac[DEJITTER_DIFF]; + + // dejitter, suppress small changes only + double dejitter = pow(baseFactor, abs(newAxis - lastAxis) * diffFactor); + int newVal = newAxis * (1 - dejitter) + lastAxis * dejitter; + + // only use new dejittered value for larger differences + if(abs(newVal - newAxis) > 10) + newAxis = newVal; + + // TODO: deadzone + // here or in PJoystickhandler? + + // accelerate, reduces sensitivity accordingly + int diff = newAxis - lastAxis; + float factor = diff ? pow(abs(diff), ACCEL) / abs(diff) : 0; + + newAxis = lastAxis - diff * factor * pow(MOUSE_SENSITIVITY, 1.f/ACCEL); // TODO: predefine pow(...) + + // scale result + return AnalogReadout::connectToVcc(MAX_RESISTANCE * + (BSPF::clamp(32768 - Int32(Int32(newAxis) * SENSITIVITY + center), 0, 65536) / 65536.0)); +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool Paddles::updateAnalogAxes() { @@ -206,20 +245,20 @@ bool Paddles::updateAnalogAxes() // previous values by a pre-defined amount) // Otherwise, it would always override input from digital and mouse - static constexpr std::array bFac = { - // higher values mean more dejitter strength - 0, // off - 0.50, 0.59, 0.67, 0.74, 0.80, - 0.85, 0.89, 0.92, 0.94, 0.95 - }; - static constexpr std::array dFac = { - // lower values mean more dejitter strength - 1, // off - 1.0 / 181, 1.0 / 256, 1.0 / 362, 1.0 / 512, 1.0 / 724, - 1.0 / 1024, 1.0 / 1448, 1.0 / 2048, 1.0 / 2896, 1.0 / 4096 - }; - const double baseFactor = bFac[DEJITTER_BASE]; - const double diffFactor = dFac[DEJITTER_DIFF]; + //static constexpr std::array bFac = { + // // higher values mean more dejitter strength + // 0, // off + // 0.50, 0.59, 0.67, 0.74, 0.80, + // 0.85, 0.89, 0.92, 0.94, 0.95 + //}; + //static constexpr std::array dFac = { + // // lower values mean more dejitter strength + // 1, // off + // 1.0 / 181, 1.0 / 256, 1.0 / 362, 1.0 / 512, 1.0 / 724, + // 1.0 / 1024, 1.0 / 1448, 1.0 / 2048, 1.0 / 2896, 1.0 / 4096 + //}; + //const double baseFactor = bFac[DEJITTER_BASE]; + //const double diffFactor = dFac[DEJITTER_DIFF]; int sa_xaxis = myEvent.get(myAAxisValue); int sa_yaxis = myEvent.get(myBAxisValue); @@ -227,31 +266,34 @@ bool Paddles::updateAnalogAxes() if(abs(myLastAxisX - sa_xaxis) > 10) { - // dejitter, suppress small changes only - double dejitter = std::pow(baseFactor, abs(sa_xaxis - myLastAxisX) * diffFactor); - int new_val = sa_xaxis * (1 - dejitter) + myLastAxisX * dejitter; - // only use new dejittered value for larger differences - if(abs(new_val - sa_xaxis) > 10) - sa_xaxis = new_val; + //// dejitter, suppress small changes only + //double dejitter = pow(baseFactor, abs(sa_xaxis - myLastAxisX) * diffFactor); + //int new_val = sa_xaxis * (1 - dejitter) + myLastAxisX * dejitter; - setPin(AnalogPin::Nine, AnalogReadout::connectToVcc(MAX_RESISTANCE * - (BSPF::clamp(32768 - Int32(Int32(sa_xaxis) * SENSITIVITY + XCENTER), 0, 65536) / 65536.0))); + //// only use new dejittered value for larger differences + //if(abs(new_val - sa_xaxis) > 10) + // sa_xaxis = new_val; + + //setPin(AnalogPin::Nine, AnalogReadout::connectToVcc(MAX_RESISTANCE * + // (BSPF::clamp(32768 - Int32(Int32(sa_xaxis) * SENSITIVITY + XCENTER), 0, 65536) / 65536.0))); + setPin(AnalogPin::Nine, getReadOut(myLastAxisX, sa_xaxis, XCENTER)); sa_changed = true; } if(abs(myLastAxisY - sa_yaxis) > 10) { - // dejitter, suppress small changes only - double dejitter = std::pow(baseFactor, abs(sa_yaxis - myLastAxisY) * diffFactor); - int new_val = sa_yaxis * (1 - dejitter) + myLastAxisY * dejitter; + //// dejitter, suppress small changes only + //double dejitter = pow(baseFactor, abs(sa_yaxis - myLastAxisY) * diffFactor); + //int new_val = sa_yaxis * (1 - dejitter) + myLastAxisY * dejitter; - // only use new dejittered value for larger differences - if(abs(new_val - sa_yaxis) > 10) - sa_yaxis = new_val; + //// only use new dejittered value for larger differences + //if(abs(new_val - sa_yaxis) > 10) + // sa_yaxis = new_val; - setPin(AnalogPin::Five, AnalogReadout::connectToVcc(MAX_RESISTANCE * - (BSPF::clamp(32768 - Int32(Int32(sa_yaxis) * SENSITIVITY + YCENTER), 0, 65536) / 65536.0))); + //setPin(AnalogPin::Five, AnalogReadout::connectToVcc(MAX_RESISTANCE * + // (BSPF::clamp(32768 - Int32(Int32(sa_yaxis) * SENSITIVITY + YCENTER), 0, 65536) / 65536.0))); + setPin(AnalogPin::Nine, getReadOut(myLastAxisY, sa_yaxis, YCENTER)); sa_changed = true; } myLastAxisX = sa_xaxis; @@ -271,6 +313,7 @@ void Paddles::updateMouse(bool& firePressedA, bool& firePressedB) myCharge[myMPaddleID] = BSPF::clamp(myCharge[myMPaddleID] - (myEvent.get(myAxisMouseMotion) * MOUSE_SENSITIVITY), TRIGMIN, TRIGRANGE); + if(myMPaddleID == 0) firePressedA = firePressedA || myEvent.get(Event::MouseButtonLeftValue) @@ -286,9 +329,20 @@ void Paddles::updateMouse(bool& firePressedA, bool& firePressedB) // mapped to a separate paddle if(myMPaddleIDX > -1) { - myCharge[myMPaddleIDX] = BSPF::clamp(myCharge[myMPaddleIDX] - + // TODO: REMOVE! Test for 2600-daptor paddles only! + // deadzone + // TODO + // + // accelerate + int diff = myEvent.get(myAxisMouseMotion); + float factor = diff ? pow(abs(diff), ACCEL) / abs(diff) : 0; + int newVal = myCharge[myMPaddleIDX] - diff * factor * pow(MOUSE_SENSITIVITY, 1.f/ACCEL); + + myCharge[myMPaddleIDX] = BSPF::clamp(newVal, TRIGMIN, TRIGRANGE); + + /* myCharge[myMPaddleIDX] = BSPF::clamp(myCharge[myMPaddleIDX] - (myEvent.get(Event::MouseAxisXMove) * MOUSE_SENSITIVITY), - TRIGMIN, TRIGRANGE); + TRIGMIN, TRIGRANGE);*/ if(myMPaddleIDX == 0) firePressedA = firePressedA || myEvent.get(Event::MouseButtonLeftValue); @@ -424,6 +478,17 @@ float Paddles::analogSensitivityValue(int sensitivity) static_cast(BSPF::clamp(sensitivity, MIN_ANALOG_SENSE, MAX_ANALOG_SENSE))); } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Paddles::setAnalogDeadzone(int deadzone) +{ + DEADZONE = BSPF::clamp(deadzone, MIN_ANALOG_DEADZONE, MAX_ANALOG_DEADZONE); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Paddles::setAnalogAccel(int accel) +{ + ACCEL = 1.f + BSPF::clamp(accel, MIN_ANALOG_ACCEL, MAX_ANALOG_ACCEL) / 100.f; +} // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Paddles::setDejitterBase(int strength) { @@ -460,10 +525,12 @@ void Paddles::setDigitalPaddleRange(int range) int Paddles::XCENTER = 0; int Paddles::YCENTER = 0; float Paddles::SENSITIVITY = 1.0; - +int Paddles::DEADZONE = 0; +float Paddles::ACCEL = 0; +int Paddles::DEJITTER_BASE = 0; +int Paddles::DEJITTER_DIFF = 0; int Paddles::TRIGRANGE = Paddles::TRIGMAX; + int Paddles::DIGITAL_SENSITIVITY = -1; int Paddles::DIGITAL_DISTANCE = -1; int Paddles::MOUSE_SENSITIVITY = -1; -int Paddles::DEJITTER_BASE = 0; -int Paddles::DEJITTER_DIFF = 0; diff --git a/src/emucore/Paddles.hxx b/src/emucore/Paddles.hxx index 5c1fa7913..bb1c5e498 100644 --- a/src/emucore/Paddles.hxx +++ b/src/emucore/Paddles.hxx @@ -48,9 +48,13 @@ class Paddles : public Controller ~Paddles() override = default; public: + static constexpr int MIN_ANALOG_DEADZONE = 0; + static constexpr int MAX_ANALOG_DEADZONE = 15000; static constexpr float BASE_ANALOG_SENSE = 0.148643628F; static constexpr int MIN_ANALOG_SENSE = 0; static constexpr int MAX_ANALOG_SENSE = 30; + static constexpr int MIN_ANALOG_ACCEL = 0; + static constexpr int MAX_ANALOG_ACCEL = 100; static constexpr int MIN_ANALOG_CENTER = -10; static constexpr int MAX_ANALOG_CENTER = 30; static constexpr int MIN_DIGITAL_SENSE = 1; @@ -111,6 +115,20 @@ class Paddles : public Controller */ static void setAnalogYCenter(int ycenter); + /** + Sets the deadzone for analog paddles. + + @param deadzone Value from 0 to 15000 + */ + static void setAnalogDeadzone(int deadzone); + + /** + Sets the acceleration for analog paddles. + + @param accel Value from 100 to 300 + */ + static void setAnalogAccel(int accel); + /** Sets the sensitivity for analog paddles. @@ -121,6 +139,7 @@ class Paddles : public Controller static float analogSensitivityValue(int sensitivity); + /** @param strength Value from 0 to 10 */ @@ -192,10 +211,10 @@ class Paddles : public Controller static int XCENTER; static int YCENTER; - static float SENSITIVITY; + static float SENSITIVITY, ACCEL; static int DIGITAL_SENSITIVITY, DIGITAL_DISTANCE; - static int DEJITTER_BASE, DEJITTER_DIFF; + static int DEADZONE, DEJITTER_BASE, DEJITTER_DIFF; static int MOUSE_SENSITIVITY; /** @@ -203,6 +222,8 @@ class Paddles : public Controller */ void swapEvents(Event::Type& event1, Event::Type& event2); + AnalogReadout::Connection getReadOut(int lastAxis, int& newAxis, int center); + /** Update the axes pin state according to the events currently set. */ diff --git a/src/emucore/Settings.cxx b/src/emucore/Settings.cxx index a55ab4564..d23deb3f8 100644 --- a/src/emucore/Settings.cxx +++ b/src/emucore/Settings.cxx @@ -22,6 +22,7 @@ #include "Logger.hxx" #include "AudioSettings.hxx" #include "PaletteHandler.hxx" +#include "Joystick.hxx" #include "Paddles.hxx" #ifdef DEBUGGER_SUPPORT @@ -114,6 +115,8 @@ Settings::Settings() setPermanent("usemouse", "analog"); setPermanent("grabmouse", "true"); setPermanent("cursor", "2"); + setPermanent("pdeadzone", "0"); + setPermanent("paccel", "100"); setPermanent("dejitter.base", "0"); setPermanent("dejitter.diff", "0"); setPermanent("dsense", "10"); @@ -354,26 +357,34 @@ void Settings::validate() AudioSettings::normalize(*this); #endif - i = getInt("joydeadzone"); - if(i < 0) setValue("joydeadzone", "0"); - else if(i > 29) setValue("joydeadzone", "29"); + setValue("joydeadzone", BSPF::clamp(getInt("joydeadzone"), + Joystick::DEAD_ZONE_MIN, Joystick::DEAD_ZONE_MAX)); + + setValue("pdeadzone", BSPF::clamp(getInt("pdeadzone"), + Paddles::MIN_ANALOG_DEADZONE, Paddles::MAX_ANALOG_DEADZONE)); + + setValue("psense", BSPF::clamp(getInt("psense"), + Paddles::MIN_ANALOG_SENSE, Paddles::MAX_ANALOG_SENSE)); + + setValue("paccel", BSPF::clamp(getInt("paccel"), + Paddles::MIN_ANALOG_ACCEL, Paddles::MAX_ANALOG_ACCEL)); + + setValue("dejitter.base", BSPF::clamp(getInt("dejitter.base"), + Paddles::MIN_DEJITTER, Paddles::MAX_DEJITTER)); + + setValue("dejitter.diff", BSPF::clamp(getInt("dejitter.diff"), + Paddles::MIN_DEJITTER, Paddles::MAX_DEJITTER)); + + setValue("dsense", BSPF::clamp(getInt("dsense"), + Paddles::MIN_DIGITAL_SENSE, Paddles::MAX_DIGITAL_SENSE)); + + setValue("msense", BSPF::clamp(getInt("msense"), + Paddles::MIN_MOUSE_SENSE, Paddles::MAX_MOUSE_SENSE)); i = getInt("cursor"); if(i < 0 || i > 3) setValue("cursor", "2"); - i = getInt("psense"); - if(i < Paddles::MIN_ANALOG_SENSE || i > Paddles::MAX_ANALOG_SENSE) - setValue("psense", "20"); - - i = getInt("dsense"); - if(i < Paddles::MIN_DIGITAL_SENSE || i > Paddles::MAX_DIGITAL_SENSE) - setValue("dsense", "10"); - - i = getInt("msense"); - if(i < 1 || i > 20) - setValue("msense", "10"); - i = getInt("tsense"); if(i < 1 || i > 20) setValue("tsense", "10"); @@ -510,15 +521,17 @@ void Settings::usage() const << " analog|\n" << " never> Use mouse as a controller as specified by ROM\n" << " properties in given mode(see manual)\n" - << " -grabmouse <1|0> Locks the mouse cursor in the TIA window\n" - << " -cursor <0,1,2,3> Set cursor state in UI/emulation modes\n" - << " -dejitter.base <0-10> Strength of analog paddle value averaging\n" - << " -dejitter.diff <0-10> Strength of analog paddle reaction to fast movements\n" - << " -psense <0-30> Sensitivity of analog paddle movement\n" - << " -dsense <1-20> Sensitivity of digital emulated paddle movement\n" - << " -msense <1-20> Sensitivity of mouse emulated paddle movement\n" - << " -tsense <1-20> Sensitivity of mouse emulated trackball movement\n" - << " -dcsense <1-20> Sensitivity of digital emulated driving controller\n" + << " -grabmouse <1|0> Locks the mouse cursor in the TIA window\n" + << " -cursor <0,1,2,3> Set cursor state in UI/emulation modes\n" + << " -pdeadzone Sets 'deadzone' area for analog paddles (0-15000)\n" + << " -paccel <0-100> Sets paddle acceleration strength\n" + << " -dejitter.base <0-10> Strength of analog paddle value averaging\n" + << " -dejitter.diff <0-10> Strength of analog paddle reaction to fast movements\n" + << " -psense <0-30> Sensitivity of analog paddle movement\n" + << " -dsense <1-20> Sensitivity of digital emulated paddle movement\n" + << " -msense <1-20> Sensitivity of mouse emulated paddle movement\n" + << " -tsense <1-20> Sensitivity of mouse emulated trackball movement\n" + << " -dcsense <1-20> Sensitivity of digital emulated driving controller\n" << " movement\n" << " -autofirerate <0-30> Set fire button's autofire rate (0 means off)\n" << " -saport How to assign virtual ports to multiple\n" From 126a9fd1ac93c2619d7ec63fbd91f198e2f6a9cd Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Wed, 8 Sep 2021 08:27:06 +0200 Subject: [PATCH 03/20] added Kid Vid detection --- docs/index.html | 4 ++-- src/emucore/ControllerDetector.cxx | 18 +++++++++++++++++- src/emucore/ControllerDetector.hxx | 3 +++ src/emucore/DefProps.hxx | 4 ++-- src/emucore/Paddles.cxx | 2 +- src/emucore/stella.pro | 6 ++---- 6 files changed, 27 insertions(+), 10 deletions(-) diff --git a/docs/index.html b/docs/index.html index 08eb17911..6ffb4d08d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4935,9 +4935,9 @@ Ms Pac-Man (Stella extended codes): - + - +
ItemBrief descriptionFor more information,
see Command Line
Joystick deadzone sizeDeadzone area for axes on joysticks/gamepads-joydeadzone
(Analog paddle) Deadzone sizeDeadzone area for analog paddles-pdeadzone
(Analog paddle) SensitivitySensitivity of an analog paddle-psense
(Analog paddle) AccelerationAcceleration of analog paddles when moving them fast-paccel
(Analog paddle) Dejitter averagingStrength of paddle input averaging, suppresses paddle jitter.
Note: The 2600-daptor has built-in dejitter, so there should be no need to use Stella's dejitter.
-dejitter.base
SaveKeyA 32K EEPROM for saving high scores, etc. (the EEPROM portion of an AtariVox).
Genesis Sega Genesis controller, which can be used similar to a BoosterGrip, giving an extra button.
CompuMate ¹Spectravideo CompuMate (if either left or right is set, CompuMate is used for both).
LightgunAtari XG-1 compatible Light Gun
LightgunAtari XG-1 compatible Light Gun.
Mindlink ¹Mindlink controller.
KidVid ¹KidVid controller, limited support (8, 9 and 0 start the games).
KidVidKid Vid Voice Module, limited support (Right Keyboard controller buttons 1, 2 and 3 start the games, default mapping is 8, 9 and 0).
QuadTariQuadTari controller, limited support (see below).
diff --git a/src/emucore/ControllerDetector.cxx b/src/emucore/ControllerDetector.cxx index 8dd837776..75c0ffe02 100644 --- a/src/emucore/ControllerDetector.cxx +++ b/src/emucore/ControllerDetector.cxx @@ -86,8 +86,10 @@ Controller::Type ControllerDetector::autodetectPort( { if(usesPaddle(image, size, port, settings)) type = Controller::Type::Paddles; + else if(isProbablyKidVid(image, size, port)) + type = Controller::Type::KidVid; } - // TODO: BOOSTERGRIP, DRIVING, MINDLINK, ATARIVOX, KIDVID + // TODO: BOOSTERGRIP, DRIVING, COMPUMATE, MINDLINK, ATARIVOX // not detectable: PADDLES_IAXIS, PADDLES_IAXDR return type; } @@ -728,3 +730,17 @@ bool ControllerDetector::isProbablyQuadTari(const ByteBuffer& image, size_t size } return false; } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +bool ControllerDetector::isProbablyKidVid(const ByteBuffer& image, size_t size, + Controller::Jack port) +{ + if(port == Controller::Jack::Right) + { + const int SIG_SIZE = 5; + uInt8 signature[SIG_SIZE] = {0xA9, 0x03, 0x8D, 0x81, 0x02}; + + return searchForBytes(image, size, signature, SIG_SIZE); + } + return false; +} diff --git a/src/emucore/ControllerDetector.hxx b/src/emucore/ControllerDetector.hxx index 901511956..96d221c2a 100644 --- a/src/emucore/ControllerDetector.hxx +++ b/src/emucore/ControllerDetector.hxx @@ -125,6 +125,9 @@ class ControllerDetector static bool isProbablyQuadTari(const ByteBuffer& image, size_t size, Controller::Jack port); + // Returns true if a Kid Vid code pattern is found. + static bool isProbablyKidVid(const ByteBuffer& image, size_t size, + Controller::Jack port); private: // Following constructors and assignment operators not supported ControllerDetector() = delete; diff --git a/src/emucore/DefProps.hxx b/src/emucore/DefProps.hxx index aa4e1e953..e1f873620 100644 --- a/src/emucore/DefProps.hxx +++ b/src/emucore/DefProps.hxx @@ -2246,7 +2246,7 @@ static const BSPF::array2D DefProps = {{ { "a1ca372388b6465a693e4626cc98b865", "Quelle", "176.543 7", "Der Vielfrass (1983) (Quelle) (PAL)", "AKA Fast Food", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, { "a1ead9c181d67859aa93c44e40f1709c", "American Videogame - Dunhill Electronics, Darrell Wagner, Todd Clark Holm, John Simonds", "", "Tax Avoiders (1986) (American Videogame)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, { "a1f9159121142d42e63e6fb807d337aa", "Quelle - Otto Versand", "700.223 1 - 781627", "Der moderne Ritter (1983) (Quelle) (PAL)", "AKA Fast Eddie", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, - { "a204cd4fb1944c86e800120706512a64", "Coleco, Rob Harris", "2511", "Smurfs Save the Day (1983) (Coleco)", "Uses the Kid Vid Controller", "", "", "", "", "", "", "", "", "", "", "", "KIDVID", "", "", "", "", "", "", "", "", "", "", "", "" }, + { "a204cd4fb1944c86e800120706512a64", "Coleco, Rob Harris", "2511", "Smurfs Save the Day (1983) (Coleco)", "Uses the Kid Vid Voice Module", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, { "a20b7abbcdf90fbc29ac0fafa195bd12", "Quelle - Otto Versand", "719.383 2 - 649635, 781393, 781784, 986404", "Motocross (1983) (Quelle) (PAL)", "AKA Motorcross", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, { "a20d931a8fddcd6f6116ed21ff5c4832", "Apollo - Games by Apollo, Ed Salvo, Byron Parks", "AP-2003", "Racquetball (1982) (Apollo)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "YES", "", "", "" }, { "a2170318a8ef4b50a1b1d38567c220d6", "Amiga - Video Soft", "3125", "Surf's Up (1983) (Amiga) (Prototype) [a1]", "Uses the Joyboard controller", "Prototype", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "http://www.atariprotos.com/2600/software/surfsup/surfsup.htm" }, @@ -3285,7 +3285,7 @@ static const BSPF::array2D DefProps = {{ { "ee456542b93fa8d7e6a8c689b5a0413c", "", "", "Chronocolor Donkey Kong Clean (PD)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, { "ee4c186123d31a279ed7a84d3578df23", "Atari, Carol Shaw, Nick 'Sandy Maiwald' Turner", "CX2608", "Super Breakout (1982 - 1981) (Atari) (PAL)", "Uses the Paddle Controllers (left only)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "01 45", "", "", "", "", "{\"score_addresses\":[\"0xdc\",\"0xdd\"],\"variations_address\":\"0xc0\",\"variations_count\":9}", "" }, { "ee659ae50e9df886ac4f8d7ad10d046a", "Exus Corporation", "", "Video Reflex (1983) (Exus)", "AKA Foot Craz", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, - { "ee6665683ebdb539e89ba620981cb0f6", "Coleco", "2658", "Berenstain Bears (1983) (Coleco)", "Uses the KidVid Controller", "Unbelievably Rare", "", "", "", "A", "", "", "", "", "", "", "KIDVID", "", "", "", "", "", "", "", "", "", "", "", "" }, + { "ee6665683ebdb539e89ba620981cb0f6", "Coleco", "2658", "Berenstain Bears (1983) (Coleco)", "Uses the Kid Vid Voice Module", "Unbelievably Rare", "", "", "", "A", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, { "ee67dc0b01746372d2b983d88f48e24f", "", "", "Scroller Demo (02-01-2003) (CT)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, { "ee681f566aad6c07c61bbbfc66d74a27", "Activision", "", "Unknown Activision Game (10-29-1982) (Activision) (Prototype)", "", "Prototype", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "http://www.atariprotos.com/2600/software/unknown1/unknown1.htm" }, { "ee6cbedf6c0aac90faa0a8dbc093ffbe", "CCE", "", "My Golf (CCE) (PAL)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, diff --git a/src/emucore/Paddles.cxx b/src/emucore/Paddles.cxx index d0667cf8f..a02f53961 100644 --- a/src/emucore/Paddles.cxx +++ b/src/emucore/Paddles.cxx @@ -526,7 +526,7 @@ int Paddles::XCENTER = 0; int Paddles::YCENTER = 0; float Paddles::SENSITIVITY = 1.0; int Paddles::DEADZONE = 0; -float Paddles::ACCEL = 0; +float Paddles::ACCEL = 1.0; int Paddles::DEJITTER_BASE = 0; int Paddles::DEJITTER_DIFF = 0; int Paddles::TRIGRANGE = Paddles::TRIGMAX; diff --git a/src/emucore/stella.pro b/src/emucore/stella.pro index c7c95354c..1fdc1152f 100644 --- a/src/emucore/stella.pro +++ b/src/emucore/stella.pro @@ -14183,8 +14183,7 @@ "Cart.Manufacturer" "Coleco, Rob Harris" "Cart.ModelNo" "2511" "Cart.Name" "Smurfs Save the Day (1983) (Coleco)" -"Cart.Note" "Uses the Kid Vid Controller" -"Controller.Right" "KIDVID" +"Cart.Note" "Uses the Kid Vid Voice Module" "" "Cart.MD5" "a20b7abbcdf90fbc29ac0fafa195bd12" @@ -20774,10 +20773,9 @@ "Cart.Manufacturer" "Coleco" "Cart.ModelNo" "2658" "Cart.Name" "Berenstain Bears (1983) (Coleco)" -"Cart.Note" "Uses the KidVid Controller" +"Cart.Note" "Uses the Kid Vid Voice Module" "Cart.Rarity" "Unbelievably Rare" "Console.LeftDiff" "A" -"Controller.Right" "KIDVID" "" "Cart.MD5" "ee67dc0b01746372d2b983d88f48e24f" From 466023fac3f89b13989e0bb1e7b2b028070f4427 Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Wed, 8 Sep 2021 18:23:03 +0200 Subject: [PATCH 04/20] added right port paddles for Decathlon (NTSC) --- src/emucore/DefProps.hxx | 4 ++-- src/emucore/stella.pro | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/emucore/DefProps.hxx b/src/emucore/DefProps.hxx index e1f873620..4e5cf42d1 100644 --- a/src/emucore/DefProps.hxx +++ b/src/emucore/DefProps.hxx @@ -1168,7 +1168,7 @@ static const BSPF::array2D DefProps = {{ { "524693b337f7ecc9e8b9126e04a232af", "", "", "Euchre (19-08-2001) (Eric Eid) (PD)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, { "5256f68d1491986aae5cfdff539bfeb5", "Atari - GCC, Mark Ackerman, Noellie Alito", "CX2692", "Moon Patrol (07-26-1983) (Atari) (Prototype)", "", "Prototype", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "http://www.atariprotos.com/2600/software/moonpatrol/moonpatrol.htm" }, { "525ea747d746f3e80e3027720e1fa7ac", "Activision, Garry Kitchen - Ariola", "EAZ-032 - 771 032-712", "Pressure Cooker (1983) (Activision) (PAL)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, - { "525f2dfc8b21b0186cff2568e0509bfc", "Activision, David Crane", "AG-930-04, AZ-030", "Decathlon (1983) (Activision) [fixed]", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "{\"notes\":\"Decathlon & 100m dash share variation 1\",\"score_addresses\":[\"0x95\",\"0x96\"],\"variations_address\":\"0x80\",\"variations_bcd\":false,\"variations_count\":10,\"variations_zero_based\":true}", "" }, + { "525f2dfc8b21b0186cff2568e0509bfc", "Activision, David Crane", "AG-930-04, AZ-030", "Decathlon (1983) (Activision) [fixed]", "", "", "", "", "", "", "", "", "", "", "", "", "PADDLES", "", "", "", "", "", "", "", "", "", "", "{\"notes\":\"Decathlon & 100m dash share variation 1\",\"score_addresses\":[\"0x95\",\"0x96\"],\"variations_address\":\"0x80\",\"variations_bcd\":false,\"variations_count\":10,\"variations_zero_based\":true}", "" }, { "52615ae358a68de6e76467e95eb404c7", "", "", "DJdsl-wopd (PD)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "YES", "", "", "" }, { "528400fad9a77fd5ad7fc5fdc2b7d69d", "Starpath Corporation, Stephen H. Landrum, Jon Leupp", "11 AR-4201", "Sword of Saros (1983) (Starpath)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, { "52a0003efb3b1c49fcde4dbc2c685d8f", "Atari, Alan Miller - Sears", "CX2641 - 99807, 49-75105", "Surround (1977) (Atari) (4K) [a]", "", "", "", "", "2K", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, @@ -2391,7 +2391,7 @@ static const BSPF::array2D DefProps = {{ { "ac3dd22dd945724be705ddd2785487c2", "Atari - GCC, Mark Ackerman, Noellie Alito", "CX2692", "Moon Patrol (06-15-1983) (Atari) (Prototype)", "", "Prototype", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "http://www.atariprotos.com/2600/software/moonpatrol/moonpatrol.htm" }, { "ac53b83e1b57a601eeae9d3ce1b4a458", "Retroactive", "", "Qb (2.15) (Retroactive) (NTSC)", "", "New Release", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "YES", "", "{\"score_addresses\":[\"0xe6\",\"0xe5\",\"0xe4\"],\"score_digits\":6,\"variations_count\":1}", "https://atariage.com/store/index.php?l=product_detail&p=926" }, { "ac5f78bae0638cf3f2a0c8d07eb4df69", "", "", "Minesweeper (V.99) (Soren Gust) (PD)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, - { "ac7c2260378975614192ca2bc3d20e0b", "Activision, David Crane", "AG-930-04, AZ-030", "Decathlon (1983) (Activision)", "", "Rare", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "{\"notes\":\"Decathlon & 100m dash share variation 1\",\"score_addresses\":[\"0x95\",\"0x96\"],\"variations_address\":\"0x80\",\"variations_bcd\":false,\"variations_count\":10,\"variations_zero_based\":true}", "" }, + { "ac7c2260378975614192ca2bc3d20e0b", "Activision, David Crane", "AG-930-04, AZ-030", "Decathlon (1983) (Activision)", "", "Rare", "", "", "", "", "", "", "", "", "", "", "PADDLES", "", "", "", "", "", "", "", "", "", "", "{\"notes\":\"Decathlon & 100m dash share variation 1\",\"score_addresses\":[\"0x95\",\"0x96\"],\"variations_address\":\"0x80\",\"variations_bcd\":false,\"variations_count\":10,\"variations_zero_based\":true}", "" }, { "ac9adbd6de786a242e19d4bec527982b", "Activision, Alan Miller - Ariola", "EAG-012-04I, EAX-012, EAX-012-04B - 711 012-720", "Ice Hockey (1981) (Activision) (PAL)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, { "aca09ffea77174b148b96b205109db4d", "Activision, Alan Miller", "AG-007, CAG-007", "Tennis (1981) (Activision) (4K)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, { "acaa27d214039d89d7031609aafa55c3", "", "", "Sprite Demo 6 (PD)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, diff --git a/src/emucore/stella.pro b/src/emucore/stella.pro index 1fdc1152f..7122f738e 100644 --- a/src/emucore/stella.pro +++ b/src/emucore/stella.pro @@ -7301,6 +7301,7 @@ "Cart.ModelNo" "AG-930-04, AZ-030" "Cart.Name" "Decathlon (1983) (Activision) [fixed]" "Cart.Highscore" "{\"notes\":\"Decathlon & 100m dash share variation 1\",\"score_addresses\":[\"0x95\",\"0x96\"],\"variations_address\":\"0x80\",\"variations_bcd\":false,\"variations_count\":10,\"variations_zero_based\":true}" +"Controller.Right" "PADDLES" "" "Cart.MD5" "52615ae358a68de6e76467e95eb404c7" @@ -15085,6 +15086,7 @@ "Cart.Name" "Decathlon (1983) (Activision)" "Cart.Rarity" "Rare" "Cart.Highscore" "{\"notes\":\"Decathlon & 100m dash share variation 1\",\"score_addresses\":[\"0x95\",\"0x96\"],\"variations_address\":\"0x80\",\"variations_bcd\":false,\"variations_count\":10,\"variations_zero_based\":true}" +"Controller.Right" "PADDLES" "" "Cart.MD5" "ac9adbd6de786a242e19d4bec527982b" From db2081a2c68a3ffa66b3636b8040bd4dbeb51027 Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Thu, 9 Sep 2021 10:21:26 +0200 Subject: [PATCH 05/20] fixed MindLink controller (resolves #821) --- Changes.txt | 2 ++ src/common/PJoystickHandler.cxx | 2 ++ src/emucore/EventHandler.cxx | 2 ++ src/emucore/MindLink.cxx | 32 +++++++++++++++++--------------- src/emucore/MindLink.hxx | 23 +++++++++++++++++++++-- src/gui/InputDialog.cxx | 2 ++ 6 files changed, 46 insertions(+), 17 deletions(-) diff --git a/Changes.txt b/Changes.txt index 75d014b70..327c2a9e5 100644 --- a/Changes.txt +++ b/Changes.txt @@ -21,6 +21,8 @@ * Added web links for many games + * Fixe MindLink controller + * Debugger: enhanced prompt's auto complete and history * Debugger: added optional logging of breaks and traps diff --git a/src/common/PJoystickHandler.cxx b/src/common/PJoystickHandler.cxx index de3bf4eac..422eb1717 100644 --- a/src/common/PJoystickHandler.cxx +++ b/src/common/PJoystickHandler.cxx @@ -20,6 +20,7 @@ #include "Console.hxx" #include "Joystick.hxx" #include "Paddles.hxx" +#include "MindLink.hxx" #include "PointingDevice.hxx" #include "Driving.hxx" #include "Settings.hxx" @@ -1074,6 +1075,7 @@ void PhysicalJoystickHandler::changeMousePaddleSensitivity(int direction) myOSystem.settings().setValue("msense", sense); Paddles::setMouseSensitivity(sense); + MindLink::setMouseSensitivity(sense); ostringstream ss; ss << sense * 10 << "%"; diff --git a/src/emucore/EventHandler.cxx b/src/emucore/EventHandler.cxx index da2714945..e66f7b5e1 100644 --- a/src/emucore/EventHandler.cxx +++ b/src/emucore/EventHandler.cxx @@ -28,6 +28,7 @@ #include "OSystem.hxx" #include "Joystick.hxx" #include "Paddles.hxx" +#include "MindLink.hxx" #include "Lightgun.hxx" #include "PointingDevice.hxx" #include "Driving.hxx" @@ -106,6 +107,7 @@ void EventHandler::initialize() Paddles::setDejitterDiff(myOSystem.settings().getInt("dejitter.diff")); Paddles::setDigitalSensitivity(myOSystem.settings().getInt("dsense")); Paddles::setMouseSensitivity(myOSystem.settings().getInt("msense")); + MindLink::setMouseSensitivity(myOSystem.settings().getInt("msense")); PointingDevice::setSensitivity(myOSystem.settings().getInt("tsense")); Driving::setSensitivity(myOSystem.settings().getInt("dcsense")); Controller::setAutoFireRate(myOSystem.settings().getInt("autofirerate")); diff --git a/src/emucore/MindLink.cxx b/src/emucore/MindLink.cxx index 94b39c1b3..007d6a2bd 100644 --- a/src/emucore/MindLink.cxx +++ b/src/emucore/MindLink.cxx @@ -22,10 +22,6 @@ MindLink::MindLink(Jack jack, const Event& event, const System& system) : Controller(jack, event, system, Controller::Type::MindLink) { - setPin(DigitalPin::One, true); - setPin(DigitalPin::Two, true); - setPin(DigitalPin::Three, true); - setPin(DigitalPin::Four, true); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -39,19 +35,16 @@ void MindLink::update() if(!myMouseEnabled) return; - myMindlinkPos = (myMindlinkPos & 0x3fffffff) + - (myEvent.get(Event::MouseAxisXMove) << 3); - if(myMindlinkPos < 0x2800) - myMindlinkPos = 0x2800; - if(myMindlinkPos >= 0x3800) - myMindlinkPos = 0x3800; - - myMindlinkShift = 1; - nextMindlinkBit(); + myMindlinkPos = BSPF::clamp((myMindlinkPos & ~CALIBRATE_FLAG) + + myEvent.get(Event::MouseAxisXMove) * MOUSE_SENSITIVITY, + MIN_POS, MAX_POS); if(myEvent.get(Event::MouseButtonLeftValue) || myEvent.get(Event::MouseButtonRightValue)) - myMindlinkPos |= 0x4000; // this bit starts a game + myMindlinkPos = CALIBRATE_FLAG; // flag starts game & calibates + + myMindlinkShift = 1; // start transfer with least significant bit + nextMindlinkBit(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -63,7 +56,7 @@ void MindLink::nextMindlinkBit() setPin(DigitalPin::Four, false); if(myMindlinkPos & myMindlinkShift) setPin(DigitalPin::Four, true); - myMindlinkShift <<= 1; + myMindlinkShift <<= 1; // next bit } } @@ -79,3 +72,12 @@ bool MindLink::setMouseControl( (xid != -1 || yid != -1); return true; } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void MindLink::setMouseSensitivity(int sensitivity) +{ + MOUSE_SENSITIVITY = BSPF::clamp(sensitivity, MIN_MOUSE_SENSE, MAX_MOUSE_SENSE); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +int MindLink::MOUSE_SENSITIVITY = -1; diff --git a/src/emucore/MindLink.hxx b/src/emucore/MindLink.hxx index e4bd2b23f..eaef64f57 100644 --- a/src/emucore/MindLink.hxx +++ b/src/emucore/MindLink.hxx @@ -35,7 +35,7 @@ the Stella core actually stores this information in boolean arrays addressable by DigitalPin number. - @author Stephen Anthony & z26 team + @author Stephen Anthony, Thomas Jentzsch & z26 team */ class MindLink : public Controller { @@ -101,13 +101,32 @@ class MindLink : public Controller bool setMouseControl( Controller::Type xtype, int xid, Controller::Type ytype, int yid) override; + /** + Sets the sensitivity for analog emulation of MindLink movement + using a mouse. + + @param sensitivity Value from 1 to MAX_MOUSE_SENSE, with larger + values causing more movement + */ + static void setMouseSensitivity(int sensitivity); + private: void nextMindlinkBit(); + // Range of valid values + static constexpr int MIN_POS = 0x2700; + static constexpr int MAX_POS = 0x3e00; + static constexpr int CALIBRATE_FLAG = 0x8000; // this causes a left side calibration + + static constexpr int MIN_MOUSE_SENSE = 1; + static constexpr int MAX_MOUSE_SENSE = 20; + + static int MOUSE_SENSITIVITY; + private: // Position value in Mindlink controller // Gets transferred bitwise (16 bits) - int myMindlinkPos{0x2800}; + int myMindlinkPos{MIN_POS}; // Which bit to transfer next int myMindlinkShift{1}; diff --git a/src/gui/InputDialog.cxx b/src/gui/InputDialog.cxx index 25adb16ab..2c5eca3e7 100644 --- a/src/gui/InputDialog.cxx +++ b/src/gui/InputDialog.cxx @@ -21,6 +21,7 @@ #include "EventHandler.hxx" #include "Joystick.hxx" #include "Paddles.hxx" +#include "MindLink.hxx" #include "PointingDevice.hxx" #include "Driving.hxx" #include "SaveKey.hxx" @@ -487,6 +488,7 @@ void InputDialog::saveConfig() sensitivity = myMPaddleSpeed->getValue(); settings.setValue("msense", sensitivity); Paddles::setMouseSensitivity(sensitivity); + MindLink::setMouseSensitivity(sensitivity); // Trackball speed sensitivity = myTrackBallSpeed->getValue(); From 58d8b684d53777a5dc4a0221fc786d7e64c39972 Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Thu, 9 Sep 2021 11:20:38 +0200 Subject: [PATCH 06/20] fixed properties for Mind Maze (no MindLink controller used) --- src/common/stella.pro | 374 --------------------------------------- src/emucore/DefProps.hxx | 8 +- src/emucore/stella.pro | 9 +- 3 files changed, 7 insertions(+), 384 deletions(-) delete mode 100644 src/common/stella.pro diff --git a/src/common/stella.pro b/src/common/stella.pro deleted file mode 100644 index e5205894c..000000000 --- a/src/common/stella.pro +++ /dev/null @@ -1,374 +0,0 @@ -"Cart.MD5" "05215b73ec33b502449ee726ac6b201f" -"Cart.Name" "draconian_20171013_RC6" -"Display.Phosphor" "YES" -"Cart.Variations" "4" -"Cart.Formats" "8,0,B,0,B,1,SECT.,D,1,VARIATIONS_ARE_DIFFICULTY_LEVEL" -"Cart.Addresses" "177B,177A,1779,1778,811,1780" -"" - -"Cart.MD5" "081e2c114c9c20b61acf25fc95c71bf4" -"Cart.Manufacturer" "Parker Brothers, Ed English, David Lamkins" -"Cart.ModelNo" "PB5300" -"Cart.Name" "Frogger (1982) (Parker Bros)" -"Display.Phosphor" "YES" -"Cart.Variations" "6" -"Cart.Addresses" "CC,CE,DD,E6" -"" - -"Cart.MD5" "136f75c4dd02c29283752b7e5799f978" -"Cart.Manufacturer" "Atari, Dan Hitchens - Sears" -"Cart.ModelNo" "CX2650 - 49-75168" -"Cart.Name" "Berzerk (1982) (Atari)" -"Cart.Rarity" "Common" -"Cart.Variations" "12" -"Cart.Formats" "6" -"Cart.Addresses" "DD,DE,DF,80" -"" - -"Cart.MD5" "137373599e9b7bf2cf162a102eb5927f" -"Cart.Manufacturer" "AtariAge, Joe Grand" -"Cart.Name" "Ultra SCSIcide (SCSIcide 2.0)" -"Controller.Left" "PADDLES" -"Cart.Formats" "6,0,H" -"Cart.Addresses" "DC,DD,DE" -"" - -"Cart.MD5" "211774f4c5739042618be8ff67351177" -"Cart.Manufacturer" "Atari - GCC, Mark Ackerman, Tom Calderwood, Glenn Parker" -"Cart.ModelNo" "CX2684" -"Cart.Name" "Galaxian (1983) (Atari)" -"Display.Phosphor" "YES" -"Cart.Variations" "9" -"Cart.Formats" "6,0,B,0,B,0,WAVE" -"Cart.Addresses" "AC,AD,AE,B3,AF" -"" - -"Cart.MD5" "240bfbac5163af4df5ae713985386f92" -"Cart.Manufacturer" "Activision, Steve Cartwright" -"Cart.ModelNo" "AX-022" -"Cart.Name" "Seaquest (1983) (Activision)" -"Cart.Formats" "6,0,B,0,B,0,_,B,0,HIGH_SCORE_IS_FROM_CURRENT_PLAYER" -"Cart.Addresses" "B8,B9,BA" -"" - -"Cart.MD5" "278f14887d601b5e5b620f1870bc09f6" -"Cart.Manufacturer" "Thomas Jentzsch" -"Cart.Name" "SWOOPS! (v0.96) (TJ)" -"Cart.Note" "Uses the Joystick (L) and Paddle (R) Controllers" -"Cart.Rarity" "Homebrew" -"Cart.Variations" "4" -"Cart.Formats" "6,0,B,0,B,1" -"Cart.Addresses" "FD,FE,FF,FC" -"" - -"Cart.MD5" "2903896d88a341511586d69fcfc20f7d" -"Cart.Manufacturer" "Activision, David Crane" -"Cart.ModelNo" "AX-014, AX-014-04" -"Cart.Name" "Grand Prix (1982) (Activision)" -"Cart.Variations" "4" -"Cart.Formats" "5,0,B,1,B,1,_,B,0,TIME/SCORE_SHOWS_EXTRA_DIGIT" -"Cart.Addresses" "EB,EC,ED,80" -"" - -"Cart.MD5" "2a0ba55e56e7a596146fa729acf0e109" -"Cart.Manufacturer" "Activision, Bob Whitehead" -"Cart.ModelNo" "AG-019" -"Cart.Name" "Sky Jinks (1982) (Activision)" -"Cart.Variations" "4" -"Cart.Formats" "6,0,B,1,B,1" -"Cart.Addresses" "9E,A6,A2,99" -"" - -"Cart.MD5" "2bb9f4686f7e08c5fcc69ec1a1c66fe7" -"Cart.Manufacturer" "Atari - GCC, John Allred, Mike Feinstein" -"Cart.ModelNo" "CX2688" -"Cart.Name" "Jungle Hunt (1983) (Atari)" -"Cart.Variations" "2" -"Cart.Formats" "6,0,B,0,B,1" -"Cart.Addresses" "85,84,83,8B" -"" - -"Cart.MD5" "318a9d6dda791268df92d72679914ac3" -"Cart.Manufacturer" "Activision, Steve Cartwright" -"Cart.ModelNo" "AX-017, AX-017-04" -"Cart.Name" "MegaMania (1982) (Activision)" -"Cart.Variations" "4" -"Cart.Formats" "6,0,B,0,B,1" -"Cart.Addresses" "DB,DC,DD,80" -"" - -"Cart.MD5" "36b20c427975760cb9cf4a47e41369e4" -"Cart.Manufacturer" "Coleco - Woodside Design Associates - Imaginative Systems Software, Garry Kitchen" -"Cart.ModelNo" "2451" -"Cart.Name" "Donkey Kong (1982) (Coleco)" -"Cart.Formats" "6,2" -"Cart.Addresses" "87,88" -"" - -"Cart.MD5" "3a2e2d0c6892aa14544083dfb7762782" -"Cart.Manufacturer" "Atari, Rob Fulop - Sears" -"Cart.ModelNo" "CX2638 - 49-75166" -"Cart.Name" "Missile Command (1981) (Atari)" -"Display.Phosphor" "YES" -"Cart.Variations" "34" -"Cart.Formats" "6" -"Cart.Addresses" "F3,F1,EF,E9" -"" - -"Cart.MD5" "3e90cf23106f2e08b2781e41299de556" -"Cart.Manufacturer" "Activision, David Crane" -"Cart.ModelNo" "AX-018, AX-018-04" -"Cart.Name" "Pitfall! (1982) (Activision)" -"Cart.Note" "Pitfall Harry's Jungle Adventure (Jungle Runner)" -"Cart.Formats" "6" -"Cart.Addresses" "D5,D6,D7" -"" - -"Cart.MD5" "4ca73eb959299471788f0b685c3ba0b5" -"Cart.Manufacturer" "Activision, Steve Cartwright" -"Cart.ModelNo" "AX-031" -"Cart.Name" "Frostbite (1983) (Activision)" -"Cart.Variations" "4" -"Cart.Formats" "6,0,B,0,B,1,LEVEL,B,1" -"Cart.Addresses" "C8,C9,CA,80,CB" -"" - -"Cart.MD5" "515046e3061b7b18aa3a551c3ae12673" -"Cart.Manufacturer" "Atari - GCC, Mark Ackerman, Noellie Alito" -"Cart.ModelNo" "CX2692" -"Cart.Name" "Moon Patrol (1983) (Atari)" -"Cart.Variations" "6" -"Cart.Formats" "6,0,B,0,B,1" -"Cart.Addresses" "EA,EB,EC,F9" -"" - -"Cart.MD5" "541cac55ebcf7891d9d51c415922303f" -"Cart.Name" "SF2_20131217_RC8_NTSC" -"Display.Phosphor" "YES" -"Cart.Formats" "8,0,B,0,B,0,LEVEL,D,1" -"Cart.Addresses" "1CF7,1CF6,1CF5,1CF4,0,18AC" -"" - -"Cart.MD5" "6dda84fb8e442ecf34241ac0d1d91d69" -"Cart.Manufacturer" "Atari - GCC, Douglas B. Macrae" -"Cart.ModelNo" "CX2677" -"Cart.Name" "Dig Dug (1983) (Atari)" -"Cart.Variations" "2" -"Cart.Formats" "4,0,B,0,B,1,_,B,0,VARIATION_1_IS_EASY;_2_IS_NORMAL" -"Cart.Addresses" "F0FE,F0FD,80" -"" - -"Cart.MD5" "72ffbef6504b75e69ee1045af9075f66" -"Cart.Manufacturer" "Atari, Richard Maurer - Sears" -"Cart.ModelNo" "CX2632 - 49-75153" -"Cart.Name" "Space Invaders (1980) (Atari)" -"Cart.Variations" "112" -"Cart.Formats" "4,0,B,0,D,1,_,B,0,ONLY_PLAYER_1_SUPPORTED" -"Cart.Addresses" "E6,E8,DC" -"" - -"Cart.MD5" "77057d9d14b99e465ea9e29783af0ae3" -"Cart.Manufacturer" "Activision, David Crane" -"Cart.ModelNo" "AG-001" -"Cart.Name" "Dragster (1980) (Activision)" -"Cart.Note" "AKA Drag Strip" -"Cart.Formats" "4,0,B,1,B,1" -"Cart.Addresses" "B3,B5,80,0" -"" - -"Cart.MD5" "7e52a95074a66640fcfde124fffd491a" -"Cart.Manufacturer" "Atari - GCC, Mike Feinstein, John Mracek" -"Cart.ModelNo" "CX2673" -"Cart.Name" "Phoenix (1983) (Atari)" -"Cart.Formats" "6" -"Cart.Addresses" "C9,C8,C7" -"" - -"Cart.MD5" "87e79cd41ce136fd4f72cc6e2c161bee" -"Cart.Manufacturer" "Atari - GCC, Mark Ackerman, Glenn Parker" -"Cart.ModelNo" "CX2675" -"Cart.Name" "Ms. Pac-Man (1983) (Atari)" -"Display.Phosphor" "YES" -"Cart.Variations" "4" -"Cart.Formats" "6,0,B,0,B,1,_,D,1,VARS_VALID_AT_GAME_OVER;_CHERRIES_=_VAR_#4" -"Cart.Addresses" "FA,F9,F8,F7,0" -"" - -"Cart.MD5" "91c2098e88a6b13f977af8c003e0bca5" -"Cart.Manufacturer" "Atari - GCC" -"Cart.ModelNo" "CX2676" -"Cart.Name" "Centipede (1983) (Atari)" -"Cart.Formats" "6,0,B,0,B,0,_,B,0,VARIATIONS_CANNOT_BE_DEFINED" -"Cart.Addresses" "F4,F5,F6" -"" - -"Cart.MD5" "91f0a708eeb93c133e9672ad2c8e0429" -"Cart.Name" "Oystron (V2.9) (Piero Cavina) (PD)" -"Cart.Rarity" "New Release" -"Cart.Variations" "3" -"Cart.Formats" "5,1,B,0,B,1" -"Cart.Addresses" "D4,D3,E5" -"" - -"Cart.MD5" "94b92a882f6dbaa6993a46e2dcc58402" -"Cart.Manufacturer" "Activision, Larry Miller" -"Cart.ModelNo" "AX-026, AX-026-04" -"Cart.Name" "Enduro (1983) (Activision)" -"Cart.Formats" "6,0,B,0,B,0,DAY" -"Cart.Addresses" "AA,A9,A8,0,AD" -"" - -"Cart.MD5" "9ad36e699ef6f45d9eb6c4cf90475c9f" -"Cart.Manufacturer" "Imagic, Dennis Koble" -"Cart.ModelNo" "720103-1A, 720103-1B, IA3203, IX-010-04" -"Cart.Name" "Atlantis (1982) (Imagic)" -"Cart.Note" "AKA Lost City of Atlantis" -"Cart.Rarity" "Uncommon" -"Cart.Variations" "4" -"Cart.Formats" "6,2,B,0,B,1" -"Cart.Addresses" "A3,A2,8D" -"" - -"Cart.MD5" "ab5bf1ef5e463ad1cbb11b6a33797228" -"Cart.Manufacturer" "Imagic, Rob Fulop" -"Cart.ModelNo" "720104-1A, 720104-1B, IA3204" -"Cart.Name" "Cosmic Ark (1982) (Imagic)" -"Cart.Variations" "6" -"Cart.Formats" "6" -"Cart.Addresses" "AE,B0,B2,BC" -"" - -"Cart.MD5" "ac7c2260378975614192ca2bc3d20e0b" -"Cart.Manufacturer" "Activision, David Crane" -"Cart.ModelNo" "AG-930-04, AZ-030" -"Cart.Name" "Decathlon (1983) (Activision)" -"Cart.Rarity" "Rare" -"Cart.Variations" "10" -"Cart.Formats" "4,0,B,0,D,1,_,B,0,DECATHLON_&_100M_DASH_SHARE_VARIATION_1" -"Cart.Addresses" "95,96,80,0" -"" - -"Cart.MD5" "be929419902e21bd7830a7a7d746195d" -"Cart.Manufacturer" "Activision, Garry Kitchen" -"Cart.ModelNo" "AX-025, AX-025-04" -"Cart.Name" "Keystone Kapers (1983) (Activision)" -"Cart.Formats" "6" -"Cart.Addresses" "9A,9B,9C" -"" - -"Cart.MD5" "c1cb228470a87beb5f36e90ac745da26" -"Cart.Manufacturer" "Activision, Bob Whitehead" -"Cart.ModelNo" "AX-015, AX-015-04" -"Cart.Name" "Chopper Command (1982) (Activision)" -"Cart.Variations" "4" -"Cart.Formats" "6,0,B,0,B,1" -"Cart.Addresses" "EC,EE,F0,E0" -"" - -"Cart.MD5" "c5930d0e8cdae3e037349bfa08e871be" -"Cart.Manufacturer" "Atari, Howard Scott Warshaw - Sears" -"Cart.ModelNo" "CX2655 - 49-75167" -"Cart.Name" "Yars' Revenge (1982) (Atari)" -"Display.Phosphor" "YES" -"Cart.Variations" "8" -"Cart.Formats" "6,0,B,0,B,1,_,B,0,VARIATIONS_ARE_LARGER_BY_1" -"Cart.Addresses" "E0,E1,E2,80" -"" - -"Cart.MD5" "c6556e082aac04260596b4045bc122de" -"Cart.Manufacturer" "Atari - GCC, Dave Payne" -"Cart.ModelNo" "CX2669" -"Cart.Name" "Vanguard (1983) (Atari)" -"Cart.Formats" "6,0,B,0,B,0,_,B,0,SCORE_IS_FOR_CURRENT_PLAYER" -"Cart.Addresses" "99,98,97" -"" - -"Cart.MD5" "ccbd36746ed4525821a8083b0d6d2c2c" -"Cart.Manufacturer" "Atari, Brad Stewart - Sears" -"Cart.ModelNo" "CX2649, 49-75163" -"Cart.Name" "Asteroids (1981) (Atari) [no copyright]" -"Cart.Rarity" "Common" -"Display.Phosphor" "YES" -"Cart.Variations" "66" -"Cart.Formats" "5,1,H,1,D,0,_,B,0,VARIATIONS_>_32_DIFFER_BY_1" -"Cart.Addresses" "BD,BE,80" -"" - -"Cart.MD5" "d69559f9c9dc6ef528d841bf9d91b275" -"Cart.Manufacturer" "Activision, Alan Miller" -"Cart.ModelNo" "AX-016" -"Cart.Name" "StarMaster (1982) (Activision)" -"Cart.Note" "Use Color/BW switch to change between galactic chart and front views" -"Cart.Variations" "4" -"Cart.Formats" "4,0,B,0,B,1,_,B,0,SCORE_ONLY_CALCULATED_WHEN_GAME_IS_OVER" -"Cart.Addresses" "C1,C2,80" -"" - -"Cart.MD5" "dd7884b4f93cab423ac471aa1935e3df" -"Cart.Manufacturer" "Atari, Brad Stewart - Sears" -"Cart.ModelNo" "CX2649, 49-75163" -"Cart.Name" "Asteroids (1981) (Atari)" -"Cart.Variations" "66" -"Cart.Formats" "5,1,H,1,D,0,_,B,0,VARIATIONS_>_32_DIFFER_BY_1" -"Cart.Addresses" "BD,BE,80" -"" - -"Cart.MD5" "dde55d9868911407fe8b3fefef396f00" -"Cart.Name" "Seawolf (2004) (Xype, Manuel Rotschkar)" -"Cart.Variations" "4" -"Cart.Formats" "6,0,B,0,B,0,_,B,0,USER_DEFINED_VARIATION_BASED_ON_SWITCHES" -"Cart.Addresses" "90,91,92,0,0" -"" - -"Cart.MD5" "f0e0addc07971561ab80d9abe1b8d333" -"Cart.Manufacturer" "Imagic, Rob Fulop" -"Cart.ModelNo" "720000-200, 720101-1B, 720101-1C, IA3200, IA3200C, IX-006-04" -"Cart.Name" "Demon Attack (1982) (Imagic)" -"Cart.Note" "AKA Death from Above" -"Cart.Variations" "10" -"Cart.Formats" "6,0,B,0,B,0,WAVE,B,1" -"Cart.Addresses" "81,83,85,EA,80" -"" - -"Cart.MD5" "f1489e27a4539a0c6c8529262f9f7e18" -"Cart.Manufacturer" "Champ Games" -"Cart.ModelNo" "CG-01-P" -"Cart.Name" "Lady Bug (PAL60)" -"Cart.Rarity" "Homebrew" -"Console.RightDiff" "A" -"Display.Format" "PAL60" -"Display.Phosphor" "YES" -"Cart.Variations" "3" -"Cart.Formats" "6,0,B,0,B,1,PART,D,1" -"Cart.Addresses" "8E,8D,8C,8A,89" -"" - -"Cart.MD5" "f34f08e5eb96e500e851a80be3277a56" -"Cart.Manufacturer" "Atari, Brad Stewart - Sears" -"Cart.ModelNo" "CX2622 - 6-99813, 49-75107" -"Cart.Name" "Breakout (1978) (Atari)" -"Cart.Note" "Uses the Paddle Controllers" -"Controller.MouseAxis" "01 60" -"Cart.Formats" "3,0,B,0,B,0,_,B,0,VARIATIONS_CANNOT_BE_DEFINED" -"Cart.Addresses" "CE,CD" -"" - -"Cart.MD5" "f8240e62d8c0a64a61e19388414e3104" -"Cart.Manufacturer" "Activision, Steve Cartwright" -"Cart.ModelNo" "AX-013" -"Cart.Name" "Barnstorming (1982) (Activision)" -"Cart.Rarity" "Uncommon" -"Cart.Variations" "4" -"Cart.Formats" "6,0,B,1,B,1" -"Cart.Addresses" "B5,B6,B7,80" -"" - -"Cart.MD5" "fca4a5be1251927027f2c24774a02160" -"Cart.Manufacturer" "Activision, John Van Ryzin" -"Cart.ModelNo" "AZ-036-04" -"Cart.Name" "H.E.R.O. (1984) (Activision)" -"Cart.Variations" "5" -"Cart.Formats" "6,0,B,0,B,1,LEVEL,D,1" -"Cart.Addresses" "B7,B8,B9,80,F5" -"" - diff --git a/src/emucore/DefProps.hxx b/src/emucore/DefProps.hxx index 4e5cf42d1..b330d693a 100644 --- a/src/emucore/DefProps.hxx +++ b/src/emucore/DefProps.hxx @@ -223,7 +223,7 @@ static const BSPF::array2D DefProps = {{ { "0dfbdadf8f1bc718e7e1bb3ccd5fef3d", "", "", "Mr. Pac-Man (New start tune) (El Destructo)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, { "0e0808227ef41f6825c06f25082c2e56", "", "", "Candi (Hack) [a]", "Hack of Space Invaders", "Hack", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "{\"notes\":\"Only player 1 supported\",\"score_addresses\":[\"0xe6\",\"0xe8\"],\"variations_address\":\"0xdc\",\"variations_bcd\":false,\"variations_bcd_A\":false,\"variations_count\":112,\"variations_zero_based\":true}", "" }, { "0e08cd2c5bcf11c6a7e5a009a7715b6a", "", "", "Boing! (PD) [a1]", "", "New Release", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, - { "0e224ea74310da4e7e2103400eb1b4bf", "Atari, Peter C. Niday, Gary Shannon, Howard Scott Warshaw", "", "Mind Maze (10-10-1984) (Atari) (Prototype)", "Uses the MindLink controller", "Prototype", "", "", "", "", "", "", "", "", "", "", "MINDLINK", "", "", "", "", "", "", "", "", "", "", "", "http://www.atariprotos.com/2600/software/mindmaze/mindmaze.htm" }, + { "0e224ea74310da4e7e2103400eb1b4bf", "Atari, Peter C. Niday, Gary Shannon, Howard Scott Warshaw", "", "Mind Maze (10-10-1984) (Atari) (Prototype)", "", "Prototype", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "http://www.atariprotos.com/2600/software/mindmaze/mindmaze.htm" }, { "0e23d0ed4c33b2011ab4cc93a7619683", "Thomas Jentzsch", "", "Centipede - Amiga Mouse Hack v1.4 (PAL60) (Half-Speed) (TJ)", "Uses Amiga Mouse Controller", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "{\"notes\":\"Variations cannot be defined\",\"score_addresses\":[\"0xf4\",\"0xf5\",\"0xf6\"],\"score_digits\":6,\"variations_count\":1}", "https://atariage.com/store/index.php?l=product_detail&p=1180" }, { "0e4b2b6e014a93ef8be896823da0d4ec", "", "", "Skiing (208 in 1) (Unknown) (PAL)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, { "0e713d4e272ea7322c5b27d645f56dd0", "Home Vision - Gem International Corp. - VDI", "VCS83105", "Panda Chase (1983) (Home Vision) (PAL)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, @@ -268,7 +268,7 @@ static const BSPF::array2D DefProps = {{ { "10c47acca2ecd212b900ad3cf6942dbb", "Atari - Axlon, Tod Frye - Heuristica, Agustin Ortiz", "CX26169", "Shooting Arcade (03-07-1989) (Atari) (Prototype) [a4]", "Uses the Light Gun Controller (left only)", "Prototype", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "http://www.atariprotos.com/2600/software/shootingarcade/shootingarcade.htm" }, { "10c8cfd8c37522f11d47540ff024e5f9", "Canal 3 - Intellivision", "C 3016", "Demon Attack (Canal 3)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "{\"score_addresses\":[\"0x81\",\"0x83\",\"0x85\"],\"score_digits\":6,\"special_address\":\"0x80\",\"special_label\":\"Wave\",\"special_zero_based\":true,\"variations_address\":\"0xea\",\"variations_count\":10}", "" }, { "10eae73a07b3da044b72473d8d366267", "Funvision - Fund. Int'l Co.", "", "Karate (1982) (Funvision) (PAL)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, - { "10f0ecaf962aef1fc28abed870b01b65", "Atari, Paul Donaldson", "", "Bionic Breakthrough (06-22-1984) (Atari) (Prototype)", "Uses the Mindlink Controller", "Prototype", "", "", "", "", "", "", "", "MINDLINK", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "http://www.atariprotos.com/2600/software/bionic/bionic.htm" }, + { "10f0ecaf962aef1fc28abed870b01b65", "Atari, Paul Donaldson", "", "Bionic Breakthrough (06-22-1984) (Atari) (Prototype)", "Uses MindLink Controller", "Prototype", "", "", "", "", "", "", "", "MINDLINK", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "http://www.atariprotos.com/2600/software/bionic/bionic.htm" }, { "10f62443f1ae087dc588a77f9e8f43e9", "Atari, Carla Meninsky", "CX2637, CX2637P", "Dodge 'Em (1980) (Atari) (PAL) [fixed]", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, { "110ac8ecaf1b69f41bc94c59dfcb8b2d", "", "", "Demon Attack (Unknown)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "{\"score_addresses\":[\"0x81\",\"0x83\",\"0x85\"],\"score_digits\":6,\"special_address\":\"0x80\",\"special_label\":\"Wave\",\"special_zero_based\":true,\"variations_address\":\"0xea\",\"variations_count\":10}", "" }, { "111029770226b319524134193886a10e", "Hozer Video Games", "", "Gunfight 2600 - One Limit Reached! (2001) (MP)", "", "New Release", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, @@ -880,7 +880,7 @@ static const BSPF::array2D DefProps = {{ { "3d48b8b586a09bdbf49f1a016bf4d29a", "Video Game Cartridge - Ariola", "TP-606", "Hole Hunter (Video Game Cartridge)", "AKA Topy", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, { "3d6fc7a19be76d808aa233415cb583fc", "CCE", "C-833", "Target Practice (1983) (CCE)", "AKA Carnival", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, { "3d7749fb9c2f91a276dfe494495234c5", "Jone Yuan Telephonic Enterprise Co", "", "Checkers (Jone Yuan)", "2600 Screen Search Console", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, - { "3d7aad37c55692814211c8b590a0334c", "Atari, Dan Oliver", "", "Telepathy (1983) (Atari) (Prototype)", "Uses both left joystick and right Mindlink controllers (press Fire on respective controller to begin)", "Prototype", "", "", "", "", "", "", "", "", "", "", "MINDLINK", "", "", "", "", "", "78", "", "", "", "", "", "http://www.atariprotos.com/2600/software/telepathy/telepathy.htm" }, + { "3d7aad37c55692814211c8b590a0334c", "Atari, Dan Oliver", "", "Telepathy (1983) (Atari) (Prototype)", "Uses both left joystick and right MindLink controllers (press Fire on respective controller to begin)", "Prototype", "", "", "", "", "", "", "", "", "", "", "MINDLINK", "", "", "", "", "", "", "", "", "", "", "", "http://www.atariprotos.com/2600/software/telepathy/telepathy.htm" }, { "3d8a2d6493123a53ade45e3e2c5cafa0", "Atari, Jim Huether - Sears", "CX2629 - 6-99843, 49-75118", "Sky Diver (1979) (Atari) (4K)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, { "3d934bb980e2e63e1ead3e7756928ccd", "Activision, Steve Cartwright - Ariola", "EAX-017, EAX-017-04I - 711 017-720", "MegaMania (1982) (Activision) (PAL)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "{\"score_addresses\":[\"0xdb\",\"0xdc\",\"0xdd\"],\"score_digits\":6,\"variations_address\":\"0x80\",\"variations_count\":4,\"variations_zero_based\":true}", "" }, { "3d9c2fccf8b11630762ff00811c19277", "", "", "Challenge of.... Nexar, The (Unknown) (PAL)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, @@ -3315,7 +3315,7 @@ static const BSPF::array2D DefProps = {{ { "f04ee80011d95798006378643650aaa7", "Atari, Bill Aspromonte, John Russell, Michael Sierchio, Robert Zdybel", "CX26114", "Pigs in Space (1983) (Atari) (Prototype)", "", "Prototype", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "http://www.atariprotos.com/2600/software/pigsinspace/pigsinspace.htm" }, { "f0510abbfbe24ead552e92e3841f63f3", "Thomas Jentzsch", "", "Reactor - Atari Mouse Hack v1.3 (NTSC) (Full-Speed) (TJ)", "Uses Atari Mouse Controller", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "https://atariage.com/store/index.php?l=product_detail&p=1186" }, { "f0536303f49006806bac3aec15738336", "Arcadia Corporation, Dennis Caswell", "AR-4200", "Escape from the Mindmaster (4 of 4) (1982) (Arcadia)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, - { "f0541d2f7cda5ec7bab6d62b6128b823", "Atari, Paul Donaldson", "", "Bionic Breakthrough (1984) (Atari) (Prototype)", "Uses Mindlink Controller (left only)", "Prototype", "", "", "", "", "", "", "", "MINDLINK", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "http://www.atariprotos.com/2600/software/bionic/bionic.htm" }, + { "f0541d2f7cda5ec7bab6d62b6128b823", "Atari, Paul Donaldson", "", "Bionic Breakthrough (1984) (Atari) (Prototype)", "Uses MindLink Controller", "Prototype", "", "", "", "", "", "", "", "MINDLINK", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "http://www.atariprotos.com/2600/software/bionic/bionic.htm" }, { "f060826626aac9e0d8cda0282f4b7fc3", "Atari, David Crane - Sears", "CX2605 - 6-99822, 49-75109", "Outlaw (1978) (Atari) (4K)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, { "f0631c6675033428238408885d7e4fde", "Paul Slocum", "", "Test Cart (2002) (Paul Slocum)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "YES", "", "", "https://atariage.com/store/index.php?l=product_detail&p=102" }, { "f066bea7ab0a37b83c83c924a87c5b67", "", "", "Air Raiders (1982) (Unknown)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, diff --git a/src/emucore/stella.pro b/src/emucore/stella.pro index 7122f738e..bda5f5801 100644 --- a/src/emucore/stella.pro +++ b/src/emucore/stella.pro @@ -1249,10 +1249,8 @@ "Cart.MD5" "0e224ea74310da4e7e2103400eb1b4bf" "Cart.Manufacturer" "Atari, Peter C. Niday, Gary Shannon, Howard Scott Warshaw" "Cart.Name" "Mind Maze (10-10-1984) (Atari) (Prototype)" -"Cart.Note" "Uses the MindLink controller" "Cart.Rarity" "Prototype" "Cart.Url" "http://www.atariprotos.com/2600/software/mindmaze/mindmaze.htm" -"Controller.Right" "MINDLINK" "" "Cart.MD5" "0e23d0ed4c33b2011ab4cc93a7619683" @@ -1544,7 +1542,7 @@ "Cart.MD5" "10f0ecaf962aef1fc28abed870b01b65" "Cart.Manufacturer" "Atari, Paul Donaldson" "Cart.Name" "Bionic Breakthrough (06-22-1984) (Atari) (Prototype)" -"Cart.Note" "Uses the Mindlink Controller" +"Cart.Note" "Uses MindLink Controller" "Cart.Rarity" "Prototype" "Cart.Url" "http://www.atariprotos.com/2600/software/bionic/bionic.htm" "Controller.Left" "MINDLINK" @@ -5482,11 +5480,10 @@ "Cart.MD5" "3d7aad37c55692814211c8b590a0334c" "Cart.Manufacturer" "Atari, Dan Oliver" "Cart.Name" "Telepathy (1983) (Atari) (Prototype)" -"Cart.Note" "Uses both left joystick and right Mindlink controllers (press Fire on respective controller to begin)" +"Cart.Note" "Uses both left joystick and right MindLink controllers (press Fire on respective controller to begin)" "Cart.Rarity" "Prototype" "Cart.Url" "http://www.atariprotos.com/2600/software/telepathy/telepathy.htm" "Controller.Right" "MINDLINK" -"Controller.MouseAxis" "78" "" "Cart.MD5" "3d8a2d6493123a53ade45e3e2c5cafa0" @@ -20958,7 +20955,7 @@ "Cart.MD5" "f0541d2f7cda5ec7bab6d62b6128b823" "Cart.Manufacturer" "Atari, Paul Donaldson" "Cart.Name" "Bionic Breakthrough (1984) (Atari) (Prototype)" -"Cart.Note" "Uses Mindlink Controller (left only)" +"Cart.Note" "Uses MindLink Controller" "Cart.Rarity" "Prototype" "Cart.Url" "http://www.atariprotos.com/2600/software/bionic/bionic.htm" "Controller.Left" "MINDLINK" From 9bd225d2801d9991bc7e2b3247a5de720531f742 Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Thu, 9 Sep 2021 11:47:26 +0200 Subject: [PATCH 07/20] fixed some controller spellings --- docs/index.html | 20 ++++++++++---------- src/emucore/AmigaMouse.hxx | 2 +- src/emucore/AtariMouse.hxx | 2 +- src/emucore/Booster.hxx | 2 +- src/emucore/Control.cxx | 8 ++++---- src/emucore/Lightgun.hxx | 2 +- src/emucore/TrakBall.hxx | 2 +- src/gui/GameInfoDialog.cxx | 12 ++++++------ src/gui/QuadTariDialog.cxx | 12 ++++++------ src/gui/StellaSettingsDialog.cxx | 8 ++++---- 10 files changed, 35 insertions(+), 35 deletions(-) diff --git a/docs/index.html b/docs/index.html index 6ffb4d08d..0cb14a30d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -272,9 +272,9 @@ Atari 2600 FPGA project, including cycle-exact audio, analog interference from mixing of audio channels, as well as stereo sound support; dynamic sound resampling is also included -
  • Emulates the Atari 2600 Joystick, Paddle, Driving, CBS BoosterGrip, Sega Genesis, QuadTari controllers using your computer's keyboard, +
  • Emulates the Atari 2600 Joystick, Paddle, Driving, CBS Booster Grip, Sega Genesis, QuadTari controllers using your computer's keyboard, joysticks or mouse
  • -
  • Emulates CX22/CX80 style Trackballs, Amiga/Atari Mouse, Mindlink controller and the Light Gun using your +
  • Emulates CX22/CX80 style Trak-Balls, Amiga/Atari mouse, MindLink controller and the Light Gun using your computer's mouse
  • Emulates the Atari 2600 Keyboard controllers using your computer's keyboard
  • Emulates Spectravideo CompuMate system using your computer's keyboard, @@ -781,7 +781,7 @@ -

    Joystick/BoosterGrip Controller (can be remapped)

    +

    Joystick/Booster Grip Controller (can be remapped)

    @@ -880,7 +880,7 @@
    -

    Sega Genesis Controller (cannot be remapped, always associated with joystick and booster-grip controllers)

    +

    Sega Genesis Controller (cannot be remapped, always associated with joystick and Booster Grip controllers)

    @@ -2418,7 +2418,7 @@ - + @@ -2426,7 +2426,7 @@ - + @@ -2450,7 +2450,7 @@ - + @@ -2474,7 +2474,7 @@ - + @@ -4933,10 +4933,10 @@ Ms Pac-Man (Stella extended codes): - + - +
    Booster Booster Grip ✓ (+ extra) ✓ (+ extra)
    Genesis Sega Genesis ✓ (+ extra)
    Trackball/Mouse Trak-Ball/Mouse
    Mindlink MindLink
    TrakballStandard Atari 2600 CX22/CX80 'Trak-Ball' controller.
    AtariVox ¹A SpeakJet based unlimited-vocabulary speech/sound synthesizer with 32K EEPROM.
    SaveKeyA 32K EEPROM for saving high scores, etc. (the EEPROM portion of an AtariVox).
    Genesis Sega Genesis controller, which can be used similar to a BoosterGrip, giving an extra button.
    Genesis Sega Genesis controller, which can be used similar to a Booster Grip, giving an extra button.
    CompuMate ¹Spectravideo CompuMate (if either left or right is set, CompuMate is used for both).
    LightgunAtari XG-1 compatible Light Gun.
    Mindlink ¹Mindlink controller.
    MindLink ¹MindLink controller.
    KidVidKid Vid Voice Module, limited support (Right Keyboard controller buttons 1, 2 and 3 start the games, default mapping is 8, 9 and 0).
    QuadTariQuadTari controller, limited support (see below).
    diff --git a/src/emucore/AmigaMouse.hxx b/src/emucore/AmigaMouse.hxx index 71cd0ca32..b24c95cce 100644 --- a/src/emucore/AmigaMouse.hxx +++ b/src/emucore/AmigaMouse.hxx @@ -38,7 +38,7 @@ class AmigaMouse : public PointingDevice /** Returns the name of this controller. */ - string name() const override { return "AmigaMouse"; } + string name() const override { return "Amiga mouse"; } protected: uInt8 ioPortA(uInt8 countH, uInt8 countV, uInt8, uInt8) override diff --git a/src/emucore/AtariMouse.hxx b/src/emucore/AtariMouse.hxx index 563b606f9..0ff5fc787 100644 --- a/src/emucore/AtariMouse.hxx +++ b/src/emucore/AtariMouse.hxx @@ -38,7 +38,7 @@ class AtariMouse : public PointingDevice /** Returns the name of this controller. */ - string name() const override { return "AtariMouse"; } + string name() const override { return "Atari mouse"; } protected: uInt8 ioPortA(uInt8 countH, uInt8 countV, uInt8, uInt8) override diff --git a/src/emucore/Booster.hxx b/src/emucore/Booster.hxx index eed210d38..9c98787e8 100644 --- a/src/emucore/Booster.hxx +++ b/src/emucore/Booster.hxx @@ -44,7 +44,7 @@ class BoosterGrip : public Joystick /** Returns the name of this controller. */ - string name() const override { return "BoosterGrip"; } + string name() const override { return "Booster Grip"; } private: /** diff --git a/src/emucore/Control.cxx b/src/emucore/Control.cxx index 8f7448fc7..22d12cc08 100644 --- a/src/emucore/Control.cxx +++ b/src/emucore/Control.cxx @@ -107,10 +107,10 @@ string Controller::getName(const Type type) static const std::array NAMES = { "Unknown", - "AmigaMouse", "AtariMouse", "AtariVox", "BoosterGrip", "CompuMate", - "Driving", "Sega Genesis", "Joystick", "Keyboard", "KidVid", "MindLink", - "Paddles", "Paddles_IAxis", "Paddles_IAxDr", "SaveKey", "TrakBall", - "Lightgun", "QuadTari" + "Amiga mouse", "Atari mouse", "AtariVox", "Booster Grip", "CompuMate", + "Driving", "Sega Genesis", "Joystick", "Keyboard", "Kid Vid", "MindLink", + "Paddles", "Paddles_IAxis", "Paddles_IAxDr", "SaveKey", "Trak-Ball", + "Light Gun", "QuadTari" }; return NAMES[int(type)]; diff --git a/src/emucore/Lightgun.hxx b/src/emucore/Lightgun.hxx index 1b3b223d1..503de5de3 100644 --- a/src/emucore/Lightgun.hxx +++ b/src/emucore/Lightgun.hxx @@ -66,7 +66,7 @@ class Lightgun : public Controller /** Returns the name of this controller. */ - string name() const override { return "Lightgun"; } + string name() const override { return "Light Gun"; } private: const FrameBuffer& myFrameBuffer; diff --git a/src/emucore/TrakBall.hxx b/src/emucore/TrakBall.hxx index 3ecfdf403..2b0ce777f 100644 --- a/src/emucore/TrakBall.hxx +++ b/src/emucore/TrakBall.hxx @@ -38,7 +38,7 @@ class TrakBall : public PointingDevice /** Returns the name of this controller. */ - string name() const override { return "TrakBall"; } + string name() const override { return "Trak-Ball"; } protected: uInt8 ioPortA(uInt8 countH, uInt8 countV, uInt8 left, uInt8 down) override diff --git a/src/gui/GameInfoDialog.cxx b/src/gui/GameInfoDialog.cxx index e51e499e2..e825cfe97 100644 --- a/src/gui/GameInfoDialog.cxx +++ b/src/gui/GameInfoDialog.cxx @@ -277,17 +277,17 @@ void GameInfoDialog::addControllersTab() VarList::push_back(items, "Paddles", "PADDLES"); VarList::push_back(items, "Paddles_IAxis", "PADDLES_IAXIS"); VarList::push_back(items, "Paddles_IAxDr", "PADDLES_IAXDR"); - VarList::push_back(items, "BoosterGrip", "BOOSTERGRIP"); + VarList::push_back(items, "Booster Grip", "BOOSTERGRIP"); VarList::push_back(items, "Driving", "DRIVING"); VarList::push_back(items, "Keyboard", "KEYBOARD"); - VarList::push_back(items, "AmigaMouse", "AMIGAMOUSE"); - VarList::push_back(items, "AtariMouse", "ATARIMOUSE"); - VarList::push_back(items, "Trakball", "TRAKBALL"); + VarList::push_back(items, "Amiga mouse", "AMIGAMOUSE"); + VarList::push_back(items, "Atari mouse", "ATARIMOUSE"); + VarList::push_back(items, "Trak-Ball", "TRAKBALL"); VarList::push_back(items, "AtariVox", "ATARIVOX"); VarList::push_back(items, "SaveKey", "SAVEKEY"); VarList::push_back(items, "Sega Genesis", "GENESIS"); - VarList::push_back(items, "KidVid", "KIDVID"); - VarList::push_back(items, "Lightgun", "LIGHTGUN"); + VarList::push_back(items, "Kid Vid", "KIDVID"); + VarList::push_back(items, "Light Gun", "LIGHTGUN"); VarList::push_back(items, "MindLink", "MINDLINK"); VarList::push_back(items, "QuadTari", "QUADTARI"); diff --git a/src/gui/QuadTariDialog.cxx b/src/gui/QuadTariDialog.cxx index 194445bdf..2307169db 100644 --- a/src/gui/QuadTariDialog.cxx +++ b/src/gui/QuadTariDialog.cxx @@ -47,17 +47,17 @@ QuadTariDialog::QuadTariDialog(GuiObject* boss, const GUI::Font& font, int max_w VarList::push_back(ctrls, "Paddles", "PADDLES"); //VarList::push_back(ctrls, "Paddles_IAxis", "PADDLES_IAXIS"); //VarList::push_back(ctrls, "Paddles_IAxDr", "PADDLES_IAXDR"); - //VarList::push_back(ctrls, "BoosterGrip", "BOOSTERGRIP"); + //VarList::push_back(ctrls, "Booster Grip", "BOOSTERGRIP"); VarList::push_back(ctrls, "Driving", "DRIVING"); //VarList::push_back(ctrls, "Keyboard", "KEYBOARD"); - //VarList::push_back(ctrls, "AmigaMouse", "AMIGAMOUSE"); - //VarList::push_back(ctrls, "AtariMouse", "ATARIMOUSE"); - //VarList::push_back(ctrls, "Trakball", "TRAKBALL"); + //VarList::push_back(ctrls, "Amiga mouse", "AMIGAMOUSE"); + //VarList::push_back(ctrls, "Atari mouse", "ATARIMOUSE"); + //VarList::push_back(ctrls, "Trak-Ball", "TRAKBALL"); VarList::push_back(ctrls, "AtariVox", "ATARIVOX"); VarList::push_back(ctrls, "SaveKey", "SAVEKEY"); //VarList::push_back(ctrls, "Sega Genesis", "GENESIS"); - //VarList::push_back(ctrls, "KidVid", "KIDVID"); - //VarList::push_back(ctrls, "Lightgun", "LIGHTGUN"); + //VarList::push_back(ctrls, "Kid Vid", "KIDVID"); + //VarList::push_back(ctrls, "Light Gun", "LIGHTGUN"); //VarList::push_back(ctrls, "MindLink", "MINDLINK"); //VarList::push_back(ctrls, "QuadTari", "QUADTARI"); diff --git a/src/gui/StellaSettingsDialog.cxx b/src/gui/StellaSettingsDialog.cxx index d49a3c255..46efdc497 100644 --- a/src/gui/StellaSettingsDialog.cxx +++ b/src/gui/StellaSettingsDialog.cxx @@ -187,12 +187,12 @@ void StellaSettingsDialog::addGameOptions(WidgetArray& wid, int& xpos, int& ypos VarList::push_back(ctrls, "Auto-detect", "AUTO"); VarList::push_back(ctrls, "Joystick", "JOYSTICK"); VarList::push_back(ctrls, "Paddles", "PADDLES"); - VarList::push_back(ctrls, "BoosterGrip", "BOOSTERGRIP"); + VarList::push_back(ctrls, "Booster Grip", "BOOSTERGRIP"); VarList::push_back(ctrls, "Driving", "DRIVING"); VarList::push_back(ctrls, "Keyboard", "KEYBOARD"); - VarList::push_back(ctrls, "AmigaMouse", "AMIGAMOUSE"); - VarList::push_back(ctrls, "AtariMouse", "ATARIMOUSE"); - VarList::push_back(ctrls, "Trakball", "TRAKBALL"); + VarList::push_back(ctrls, "Amiga mouse", "AMIGAMOUSE"); + VarList::push_back(ctrls, "Atari mouse", "ATARIMOUSE"); + VarList::push_back(ctrls, "Trak-Ball", "TRAKBALL"); VarList::push_back(ctrls, "Sega Genesis", "GENESIS"); VarList::push_back(ctrls, "QuadTari", "QUADTARI"); From 2b522ca8146b2337213748d96c6385d62da00b18 Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Thu, 9 Sep 2021 13:57:12 +0200 Subject: [PATCH 08/20] one more controller spelling fix --- src/emucore/Genesis.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/emucore/Genesis.hxx b/src/emucore/Genesis.hxx index 88fbda1d8..1db0499cc 100644 --- a/src/emucore/Genesis.hxx +++ b/src/emucore/Genesis.hxx @@ -45,7 +45,7 @@ class Genesis : public Joystick /** Returns the name of this controller. */ - string name() const override { return "Genesis"; } + string name() const override { return "Sega Genesis"; } private: /** From 0ee5b6681ba26d8c5b308a29e3cdd136059facb1 Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Thu, 9 Sep 2021 16:40:06 +0200 Subject: [PATCH 09/20] refactored dead zone and mouse sensitivity setting management --- src/common/PJoystickHandler.cxx | 46 +++++++++--------- src/common/PJoystickHandler.hxx | 2 +- src/emucore/Control.cxx | 30 +++++++++++- src/emucore/Control.hxx | 47 +++++++++++++++++++ src/emucore/EventHandler.cxx | 13 +++--- src/emucore/Joystick.cxx | 17 ------- src/emucore/Joystick.hxx | 18 ------- src/emucore/MindLink.cxx | 12 ++--- src/emucore/MindLink.hxx | 14 ------ src/emucore/Paddles.cxx | 14 ------ src/emucore/Paddles.hxx | 23 +-------- src/emucore/Settings.cxx | 15 +++--- src/gui/InputDialog.cxx | 83 ++++++++++++++++++--------------- src/gui/InputDialog.hxx | 9 ++-- 14 files changed, 170 insertions(+), 173 deletions(-) diff --git a/src/common/PJoystickHandler.cxx b/src/common/PJoystickHandler.cxx index 422eb1717..0909ad646 100644 --- a/src/common/PJoystickHandler.cxx +++ b/src/common/PJoystickHandler.cxx @@ -798,9 +798,9 @@ void PhysicalJoystickHandler::handleRegularAxisEvent(const PhysicalJoystickPtr j Event::Type eventAxisNeg = j->joyMap.get(EventMode::kEmulationMode, button, JoyAxis(axis), JoyDir::NEG); Event::Type eventAxisPos = j->joyMap.get(EventMode::kEmulationMode, button, JoyAxis(axis), JoyDir::POS); - if(value > Joystick::deadzone()) + if(value > Controller::digitalDeadzone()) myHandler.handleEvent(eventAxisPos); - else if(value < -Joystick::deadzone()) + else if(value < -Controller::digitalDeadzone()) myHandler.handleEvent(eventAxisNeg); else { @@ -823,14 +823,14 @@ void PhysicalJoystickHandler::handleRegularAxisEvent(const PhysicalJoystickPtr j #ifdef GUI_SUPPORT else if(myHandler.hasOverlay()) { - // A value change lower than Joystick::deadzone indicates analog input which is ignored - if((abs(j->axisLastValue[axis] - value) > Joystick::deadzone())) + // A value change lower than Controller::digitalDeadzone indicates analog input which is ignored + if((abs(j->axisLastValue[axis] - value) > Controller::digitalDeadzone())) { // First, clamp the values to simulate digital input // (the only thing that the underlying code understands) - if(value > Joystick::deadzone()) + if(value > Controller::digitalDeadzone()) value = 32000; - else if(value < -Joystick::deadzone()) + else if(value < -Controller::digitalDeadzone()) value = -32000; else value = 0; @@ -945,31 +945,34 @@ ostream& operator<<(ostream& os, const PhysicalJoystickHandler& jh) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void PhysicalJoystickHandler::changeDeadzone(int direction) +void PhysicalJoystickHandler::changeDigitalDeadzone(int direction) { int deadzone = BSPF::clamp(myOSystem.settings().getInt("joydeadzone") + direction, - Joystick::DEAD_ZONE_MIN, Joystick::DEAD_ZONE_MAX); + Controller::MIN_DIGITAL_DEADZONE, Controller::MAX_DIGITAL_DEADZONE); myOSystem.settings().setValue("joydeadzone", deadzone); - Joystick::setDeadZone(deadzone); + Controller::setDigitalDeadZone(deadzone); - int value = Joystick::deadZoneValue(deadzone); + ostringstream ss; + ss << std::round(Controller::digitalDeadzoneValue(deadzone) * 100.F / 32768) << "%"; - myOSystem.frameBuffer().showGaugeMessage("Joystick deadzone", std::to_string(value), - deadzone, Joystick::DEAD_ZONE_MIN, Joystick::DEAD_ZONE_MAX); + myOSystem.frameBuffer().showGaugeMessage("Digital controller dead zone", ss. str(), deadzone, + Controller::MIN_DIGITAL_DEADZONE, Controller::MAX_DIGITAL_DEADZONE); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void PhysicalJoystickHandler::changeAnalogPaddleDeadzone(int direction) { - int deadzone = BSPF::clamp(myOSystem.settings().getInt("pdeadzone") + direction * 500, - Paddles::MIN_ANALOG_DEADZONE, Paddles::MAX_ANALOG_DEADZONE); - myOSystem.settings().setValue("pdeadzone", deadzone); + int deadzone = BSPF::clamp(myOSystem.settings().getInt("adeadzone") + direction * 500, + Controller::MIN_ANALOG_DEADZONE, Controller::MAX_ANALOG_DEADZONE); + myOSystem.settings().setValue("adeadzone", deadzone); - Paddles::setAnalogDeadzone(deadzone); + Controller::setAnalogDeadzone(deadzone); + ostringstream ss; + ss << std::round(deadzone * 100.F / 32768) << "%"; - myOSystem.frameBuffer().showGaugeMessage("Analog paddle deadzone", std::to_string(deadzone), deadzone, - Paddles::MIN_ANALOG_DEADZONE, Paddles::MAX_ANALOG_DEADZONE); + myOSystem.frameBuffer().showGaugeMessage("Analog controller dead zone", ss.str(), deadzone, + Controller::MIN_ANALOG_DEADZONE, Controller::MAX_ANALOG_DEADZONE); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1071,18 +1074,17 @@ void PhysicalJoystickHandler::changeDigitalPaddleSensitivity(int direction) void PhysicalJoystickHandler::changeMousePaddleSensitivity(int direction) { int sense = BSPF::clamp(myOSystem.settings().getInt("msense") + direction, - Paddles::MIN_MOUSE_SENSE, Paddles::MAX_MOUSE_SENSE); + Controller::MIN_MOUSE_SENSE, Controller::MAX_MOUSE_SENSE); myOSystem.settings().setValue("msense", sense); - Paddles::setMouseSensitivity(sense); - MindLink::setMouseSensitivity(sense); + Controller::setMouseSensitivity(sense); ostringstream ss; ss << sense * 10 << "%"; myOSystem.frameBuffer().showGaugeMessage("Mouse paddle sensitivity", ss.str(), sense, - Paddles::MIN_MOUSE_SENSE, Paddles::MAX_MOUSE_SENSE); + Controller::MIN_MOUSE_SENSE, Controller::MAX_MOUSE_SENSE); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/common/PJoystickHandler.hxx b/src/common/PJoystickHandler.hxx index e5fb287e1..3b99a88de 100644 --- a/src/common/PJoystickHandler.hxx +++ b/src/common/PJoystickHandler.hxx @@ -110,7 +110,7 @@ class PhysicalJoystickHandler /** Returns a list of pairs consisting of joystick name and associated ID. */ VariantList database() const; - void changeDeadzone(int direction = +1); + void changeDigitalDeadzone(int direction = +1); void changeAnalogPaddleDeadzone(int direction = +1); void changeAnalogPaddleSensitivity(int direction = +1); void changeAnalogPaddleAcceleration(int direction = +1); diff --git a/src/emucore/Control.cxx b/src/emucore/Control.cxx index 22d12cc08..39f310ccb 100644 --- a/src/emucore/Control.cxx +++ b/src/emucore/Control.cxx @@ -148,6 +148,32 @@ Controller::Type Controller::getType(const string& propName) return Type::Unknown; } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Controller::setDigitalDeadZone(int deadzone) +{ + DIGITAL_DEAD_ZONE = digitalDeadzoneValue(deadzone); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +int Controller::digitalDeadzoneValue(int deadzone) +{ + deadzone = BSPF::clamp(deadzone, MIN_DIGITAL_DEADZONE, MAX_DIGITAL_DEADZONE); + + return 3200 + deadzone * 1000; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Controller::setAnalogDeadzone(int deadzone) +{ + ANALOG_DEAD_ZONE = BSPF::clamp(deadzone, MIN_ANALOG_DEADZONE, MAX_ANALOG_DEADZONE); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Controller::setMouseSensitivity(int sensitivity) +{ + MOUSE_SENSITIVITY = BSPF::clamp(sensitivity, MIN_MOUSE_SENSE, MAX_MOUSE_SENSE); +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Controller::setAutoFireRate(int rate, bool isNTSC) { @@ -156,5 +182,7 @@ void Controller::setAutoFireRate(int rate, bool isNTSC) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +int Controller::DIGITAL_DEAD_ZONE = 3200; +int Controller::ANALOG_DEAD_ZONE = 0; +int Controller::MOUSE_SENSITIVITY = -1; int Controller::AUTO_FIRE_RATE = 0; - diff --git a/src/emucore/Control.hxx b/src/emucore/Control.hxx index c329ecf2c..32e60824a 100644 --- a/src/emucore/Control.hxx +++ b/src/emucore/Control.hxx @@ -71,6 +71,13 @@ class Controller : public Serializable friend class ControllerLowLevel; public: + static constexpr int MIN_DIGITAL_DEADZONE = 0; + static constexpr int MAX_DIGITAL_DEADZONE = 29; + static constexpr int MIN_ANALOG_DEADZONE = 0; + static constexpr int MAX_ANALOG_DEADZONE = 16500; + static constexpr int MIN_MOUSE_SENSE = 1; + static constexpr int MAX_MOUSE_SENSE = 20; + /** Enumeration of the controller jacks */ @@ -273,6 +280,38 @@ class Controller : public Serializable */ static Type getType(const string& propName); + /** + Sets the deadzone amount for real analog joysticks. + Technically, this isn't really used by the Joystick class at all, + but it seemed like the best place to put it. + */ + static void setDigitalDeadZone(int deadzone); + + /** + Sets the deadzone for analog paddles. + + @param deadzone Value from 0 to 16500 + */ + static void setAnalogDeadzone(int deadzone); + + /** + Retrieves the effective digital deadzone value + */ + static int digitalDeadzoneValue(int deadzone); + + inline static int digitalDeadzone() { return DIGITAL_DEAD_ZONE; } + + inline static int analogDeadzone() { return ANALOG_DEAD_ZONE; } + + /** + Sets the sensitivity for analog emulation movement + using a mouse. + + @param sensitivity Value from 1 to MAX_MOUSE_SENSE, with larger + values causing more movement + */ + static void setMouseSensitivity(int sensitivity); + /** Sets the auto fire rate. 0 disables auto fire. @@ -366,6 +405,14 @@ class Controller : public Serializable /// The callback that is dispatched whenver an analog pin has changed onAnalogPinUpdateCallback myOnAnalogPinUpdateCallback{nullptr}; + /// Defines the dead zone of analog joysticks for digital Atari controllers + static int DIGITAL_DEAD_ZONE; + + /// Defines the dead zone of analog joysticks for analog Atari controllers + static int ANALOG_DEAD_ZONE; + + static int MOUSE_SENSITIVITY; + /// Defines the speed of the auto fire static int AUTO_FIRE_RATE; diff --git a/src/emucore/EventHandler.cxx b/src/emucore/EventHandler.cxx index e66f7b5e1..31c08f892 100644 --- a/src/emucore/EventHandler.cxx +++ b/src/emucore/EventHandler.cxx @@ -99,15 +99,14 @@ void EventHandler::initialize() setActionMappings(EventMode::kEmulationMode); setActionMappings(EventMode::kMenuMode); - Joystick::setDeadZone(myOSystem.settings().getInt("joydeadzone")); - Paddles::setAnalogDeadzone(myOSystem.settings().getInt("pdeadzone")); + Controller::setDigitalDeadZone(myOSystem.settings().getInt("joydeadzone")); + Controller::setAnalogDeadzone(myOSystem.settings().getInt("adeadzone")); Paddles::setAnalogAccel(myOSystem.settings().getInt("paccel")); Paddles::setDejitterDiff(myOSystem.settings().getInt("dejitter.diff")); Paddles::setDejitterBase(myOSystem.settings().getInt("dejitter.base")); Paddles::setDejitterDiff(myOSystem.settings().getInt("dejitter.diff")); Paddles::setDigitalSensitivity(myOSystem.settings().getInt("dsense")); - Paddles::setMouseSensitivity(myOSystem.settings().getInt("msense")); - MindLink::setMouseSensitivity(myOSystem.settings().getInt("msense")); + Controller::setMouseSensitivity(myOSystem.settings().getInt("msense")); PointingDevice::setSensitivity(myOSystem.settings().getInt("tsense")); Driving::setSensitivity(myOSystem.settings().getInt("dcsense")); Controller::setAutoFireRate(myOSystem.settings().getInt("autofirerate")); @@ -597,7 +596,7 @@ AdjustFunction EventHandler::getAdjustSetting(AdjustSetting setting) std::bind(&Console::toggleInter, &myOSystem.console(), _1), // *** Input settings *** - std::bind(&PhysicalJoystickHandler::changeDeadzone, &joyHandler(), _1), + std::bind(&PhysicalJoystickHandler::changeDigitalDeadzone, &joyHandler(), _1), std::bind(&PhysicalJoystickHandler::changeAnalogPaddleDeadzone, &joyHandler(), _1), std::bind(&PhysicalJoystickHandler::changeAnalogPaddleSensitivity, &joyHandler(), _1), std::bind(&PhysicalJoystickHandler::changeAnalogPaddleAcceleration, &joyHandler(), _1), @@ -1365,7 +1364,7 @@ void EventHandler::handleEvent(Event::Type event, Int32 value, bool repeated) case Event::DecreaseDeadzone: if(pressed) { - myPJoyHandler->changeDeadzone(-1); + myPJoyHandler->changeDigitalDeadzone(-1); myAdjustSetting = AdjustSetting::DEADZONE; myAdjustActive = true; } @@ -1374,7 +1373,7 @@ void EventHandler::handleEvent(Event::Type event, Int32 value, bool repeated) case Event::IncreaseDeadzone: if(pressed) { - myPJoyHandler->changeDeadzone(+1); + myPJoyHandler->changeDigitalDeadzone(+1); myAdjustSetting = AdjustSetting::DEADZONE; myAdjustActive = true; } diff --git a/src/emucore/Joystick.cxx b/src/emucore/Joystick.cxx index 6acacf6e4..067623699 100644 --- a/src/emucore/Joystick.cxx +++ b/src/emucore/Joystick.cxx @@ -157,20 +157,3 @@ bool Joystick::setMouseControl( return true; } - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void Joystick::setDeadZone(int deadzone) -{ - _DEAD_ZONE = deadZoneValue(deadzone); -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int Joystick::deadZoneValue(int deadzone) -{ - deadzone = BSPF::clamp(deadzone, DEAD_ZONE_MIN, DEAD_ZONE_MAX); - - return 3200 + deadzone * 1000; -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int Joystick::_DEAD_ZONE = 3200; diff --git a/src/emucore/Joystick.hxx b/src/emucore/Joystick.hxx index fa43960d3..97c89bcef 100644 --- a/src/emucore/Joystick.hxx +++ b/src/emucore/Joystick.hxx @@ -29,9 +29,6 @@ class Joystick : public Controller { public: - static constexpr int DEAD_ZONE_MIN = 0; - static constexpr int DEAD_ZONE_MAX = 29; - /** Create a new joystick controller plugged into the specified jack @@ -88,19 +85,6 @@ class Joystick : public Controller bool setMouseControl( Controller::Type xtype, int xid, Controller::Type ytype, int yid) override; - /** - Sets the deadzone amount for real analog joysticks. - Technically, this isn't really used by the Joystick class at all, - but it seemed like the best place to put it. - */ - static void setDeadZone(int deadzone); - - /** - Retrieves the effective deadzone value - */ - static int deadZoneValue(int deadzone); - inline static int deadzone() { return _DEAD_ZONE; } - protected: /** Update the button pin states. @@ -123,8 +107,6 @@ class Joystick : public Controller // Controller to emulate in normal mouse axis mode int myControlID{-1}; - static int _DEAD_ZONE; - private: /** Update the axes pin states according to the keyboard diff --git a/src/emucore/MindLink.cxx b/src/emucore/MindLink.cxx index 007d6a2bd..43e3e77cb 100644 --- a/src/emucore/MindLink.cxx +++ b/src/emucore/MindLink.cxx @@ -22,6 +22,10 @@ MindLink::MindLink(Jack jack, const Event& event, const System& system) : Controller(jack, event, system, Controller::Type::MindLink) { + setPin(DigitalPin::One, true); + setPin(DigitalPin::Two, true); + setPin(DigitalPin::Three, true); + setPin(DigitalPin::Four, true); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -73,11 +77,3 @@ bool MindLink::setMouseControl( return true; } -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void MindLink::setMouseSensitivity(int sensitivity) -{ - MOUSE_SENSITIVITY = BSPF::clamp(sensitivity, MIN_MOUSE_SENSE, MAX_MOUSE_SENSE); -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int MindLink::MOUSE_SENSITIVITY = -1; diff --git a/src/emucore/MindLink.hxx b/src/emucore/MindLink.hxx index eaef64f57..d2105fa7e 100644 --- a/src/emucore/MindLink.hxx +++ b/src/emucore/MindLink.hxx @@ -101,15 +101,6 @@ class MindLink : public Controller bool setMouseControl( Controller::Type xtype, int xid, Controller::Type ytype, int yid) override; - /** - Sets the sensitivity for analog emulation of MindLink movement - using a mouse. - - @param sensitivity Value from 1 to MAX_MOUSE_SENSE, with larger - values causing more movement - */ - static void setMouseSensitivity(int sensitivity); - private: void nextMindlinkBit(); @@ -118,11 +109,6 @@ class MindLink : public Controller static constexpr int MAX_POS = 0x3e00; static constexpr int CALIBRATE_FLAG = 0x8000; // this causes a left side calibration - static constexpr int MIN_MOUSE_SENSE = 1; - static constexpr int MAX_MOUSE_SENSE = 20; - - static int MOUSE_SENSITIVITY; - private: // Position value in Mindlink controller // Gets transferred bitwise (16 bits) diff --git a/src/emucore/Paddles.cxx b/src/emucore/Paddles.cxx index a02f53961..f469d08e5 100644 --- a/src/emucore/Paddles.cxx +++ b/src/emucore/Paddles.cxx @@ -478,12 +478,6 @@ float Paddles::analogSensitivityValue(int sensitivity) static_cast(BSPF::clamp(sensitivity, MIN_ANALOG_SENSE, MAX_ANALOG_SENSE))); } -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void Paddles::setAnalogDeadzone(int deadzone) -{ - DEADZONE = BSPF::clamp(deadzone, MIN_ANALOG_DEADZONE, MAX_ANALOG_DEADZONE); -} - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Paddles::setAnalogAccel(int accel) { @@ -508,12 +502,6 @@ void Paddles::setDigitalSensitivity(int sensitivity) DIGITAL_DISTANCE = 20 + (DIGITAL_SENSITIVITY << 3); } -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void Paddles::setMouseSensitivity(int sensitivity) -{ - MOUSE_SENSITIVITY = BSPF::clamp(sensitivity, MIN_MOUSE_SENSE, MAX_MOUSE_SENSE); -} - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Paddles::setDigitalPaddleRange(int range) { @@ -525,7 +513,6 @@ void Paddles::setDigitalPaddleRange(int range) int Paddles::XCENTER = 0; int Paddles::YCENTER = 0; float Paddles::SENSITIVITY = 1.0; -int Paddles::DEADZONE = 0; float Paddles::ACCEL = 1.0; int Paddles::DEJITTER_BASE = 0; int Paddles::DEJITTER_DIFF = 0; @@ -533,4 +520,3 @@ int Paddles::TRIGRANGE = Paddles::TRIGMAX; int Paddles::DIGITAL_SENSITIVITY = -1; int Paddles::DIGITAL_DISTANCE = -1; -int Paddles::MOUSE_SENSITIVITY = -1; diff --git a/src/emucore/Paddles.hxx b/src/emucore/Paddles.hxx index bb1c5e498..2c501771a 100644 --- a/src/emucore/Paddles.hxx +++ b/src/emucore/Paddles.hxx @@ -48,8 +48,6 @@ class Paddles : public Controller ~Paddles() override = default; public: - static constexpr int MIN_ANALOG_DEADZONE = 0; - static constexpr int MAX_ANALOG_DEADZONE = 15000; static constexpr float BASE_ANALOG_SENSE = 0.148643628F; static constexpr int MIN_ANALOG_SENSE = 0; static constexpr int MAX_ANALOG_SENSE = 30; @@ -59,8 +57,6 @@ class Paddles : public Controller static constexpr int MAX_ANALOG_CENTER = 30; static constexpr int MIN_DIGITAL_SENSE = 1; static constexpr int MAX_DIGITAL_SENSE = 20; - static constexpr int MIN_MOUSE_SENSE = 1; - static constexpr int MAX_MOUSE_SENSE = 20; static constexpr int MIN_DEJITTER = 0; static constexpr int MAX_DEJITTER = 10; static constexpr int MIN_MOUSE_RANGE = 1; @@ -115,13 +111,6 @@ class Paddles : public Controller */ static void setAnalogYCenter(int ycenter); - /** - Sets the deadzone for analog paddles. - - @param deadzone Value from 0 to 15000 - */ - static void setAnalogDeadzone(int deadzone); - /** Sets the acceleration for analog paddles. @@ -161,15 +150,6 @@ class Paddles : public Controller */ static void setDigitalSensitivity(int sensitivity); - /** - Sets the sensitivity for analog emulation of paddle movement - using a mouse. - - @param sensitivity Value from 1 to MAX_MOUSE_SENSE, with larger - values causing more movement - */ - static void setMouseSensitivity(int sensitivity); - /** Sets the maximum upper range for digital/mouse emulation of paddle movement (ie, a value of 50 means to only use 50% of the possible @@ -214,8 +194,7 @@ class Paddles : public Controller static float SENSITIVITY, ACCEL; static int DIGITAL_SENSITIVITY, DIGITAL_DISTANCE; - static int DEADZONE, DEJITTER_BASE, DEJITTER_DIFF; - static int MOUSE_SENSITIVITY; + static int DEJITTER_BASE, DEJITTER_DIFF; /** Swap two events. diff --git a/src/emucore/Settings.cxx b/src/emucore/Settings.cxx index d23deb3f8..85da5c588 100644 --- a/src/emucore/Settings.cxx +++ b/src/emucore/Settings.cxx @@ -115,7 +115,7 @@ Settings::Settings() setPermanent("usemouse", "analog"); setPermanent("grabmouse", "true"); setPermanent("cursor", "2"); - setPermanent("pdeadzone", "0"); + setPermanent("adeadzone", "0"); setPermanent("paccel", "100"); setPermanent("dejitter.base", "0"); setPermanent("dejitter.diff", "0"); @@ -358,10 +358,10 @@ void Settings::validate() #endif setValue("joydeadzone", BSPF::clamp(getInt("joydeadzone"), - Joystick::DEAD_ZONE_MIN, Joystick::DEAD_ZONE_MAX)); + Controller::MIN_DIGITAL_DEADZONE, Joystick::MAX_DIGITAL_DEADZONE)); - setValue("pdeadzone", BSPF::clamp(getInt("pdeadzone"), - Paddles::MIN_ANALOG_DEADZONE, Paddles::MAX_ANALOG_DEADZONE)); + setValue("adeadzone", BSPF::clamp(getInt("adeadzone"), + Controller::MIN_ANALOG_DEADZONE, Controller::MAX_ANALOG_DEADZONE)); setValue("psense", BSPF::clamp(getInt("psense"), Paddles::MIN_ANALOG_SENSE, Paddles::MAX_ANALOG_SENSE)); @@ -379,7 +379,7 @@ void Settings::validate() Paddles::MIN_DIGITAL_SENSE, Paddles::MAX_DIGITAL_SENSE)); setValue("msense", BSPF::clamp(getInt("msense"), - Paddles::MIN_MOUSE_SENSE, Paddles::MAX_MOUSE_SENSE)); + Controller::MIN_MOUSE_SENSE, Controller::MAX_MOUSE_SENSE)); i = getInt("cursor"); if(i < 0 || i > 3) @@ -514,7 +514,7 @@ void Settings::usage() const << " -loglevel <0|1|2> Set level of logging during application run\n" << endl << " -logtoconsole <1|0> Log output to console/commandline\n" - << " -joydeadzone Sets 'deadzone' area for analog joysticks (0-29)\n" + << " -joydeadzone <0-29> Sets digital 'dead zone' area for analog joysticks\n" << " -joyallow4 <1|0> Allow all 4 directions on a joystick to be\n" << " pressed simultaneously\n" << " -usemouse Locks the mouse cursor in the TIA window\n" << " -cursor <0,1,2,3> Set cursor state in UI/emulation modes\n" - << " -pdeadzone Sets 'deadzone' area for analog paddles (0-15000)\n" + << " -adeadzone Sets analog 'dead zone' area for analog joysticks\n" + << " (0-16500)\n" << " -paccel <0-100> Sets paddle acceleration strength\n" << " -dejitter.base <0-10> Strength of analog paddle value averaging\n" << " -dejitter.diff <0-10> Strength of analog paddle reaction to fast movements\n" diff --git a/src/gui/InputDialog.cxx b/src/gui/InputDialog.cxx index 2c5eca3e7..6ab997a36 100644 --- a/src/gui/InputDialog.cxx +++ b/src/gui/InputDialog.cxx @@ -112,34 +112,37 @@ void InputDialog::addDevicePortTab() // Devices/ports tabID = myTab->addTab(" Devices & Ports ", TabWidget::AUTO_WIDTH); - ypos = VBORDER; + xpos = HBORDER; ypos = VBORDER; lwidth = _font.getStringWidth("Digital paddle sensitivity "); - // Add joystick deadzone setting - myJoystickDeadzone = new SliderWidget(myTab, _font, HBORDER, ypos - 1, 13 * fontWidth, lineHeight, - "Joystick deadzone size", lwidth, kJDeadzoneChanged, 5 * fontWidth); - myJoystickDeadzone->setMinValue(Joystick::DEAD_ZONE_MIN); - myJoystickDeadzone->setMaxValue(Joystick::DEAD_ZONE_MAX); - myJoystickDeadzone->setTickmarkIntervals(4); - wid.push_back(myJoystickDeadzone); + // Add digital dead zone setting + myDigitalDeadzone = new SliderWidget(myTab, _font, xpos, ypos - 1, 13 * fontWidth, lineHeight, + "Digital dead zone", + lwidth, kDDeadzoneChanged, 3 * fontWidth, "%"); + myDigitalDeadzone->setMinValue(Controller::MIN_DIGITAL_DEADZONE); + myDigitalDeadzone->setMaxValue(Controller::MAX_DIGITAL_DEADZONE); + myDigitalDeadzone->setTickmarkIntervals(4); + myDigitalDeadzone->setToolTip("Adjust dead zone size for analog joysticks when emulating digital controllers."); + wid.push_back(myDigitalDeadzone); - xpos = HBORDER; ypos += lineHeight + VGAP * (3 - 2); + // Add analog dead zone + ypos += lineHeight + VGAP; + myAnalogDeadzone = new SliderWidget(myTab, _font, xpos, ypos - 1, 13 * fontWidth, lineHeight, + "Analog dead zone", + lwidth, kADeadzoneChanged, 3 * fontWidth, "%"); + myAnalogDeadzone->setMinValue(Controller::MIN_ANALOG_DEADZONE); + myAnalogDeadzone->setMaxValue(Controller::MAX_ANALOG_DEADZONE); + myAnalogDeadzone->setStepValue(500); + myAnalogDeadzone->setTickmarkIntervals(3); + myAnalogDeadzone->setToolTip("Adjust dead zone size for analog joysticks when emulating analog controllers."); + wid.push_back(myAnalogDeadzone); + + ypos += lineHeight + VGAP * (3 - 2); new StaticTextWidget(myTab, _font, xpos, ypos+1, "Analog paddle:"); xpos += fontWidth * 2; - // Add analog paddle deadzone - ypos += lineHeight; - myPaddleDeadzone = new SliderWidget(myTab, _font, xpos, ypos - 1, 13 * fontWidth, lineHeight, - "Deadzone size", - lwidth - fontWidth * 2, 0, 5 * fontWidth); - myPaddleDeadzone->setMinValue(Paddles::MIN_ANALOG_DEADZONE); - myPaddleDeadzone->setMaxValue(Paddles::MAX_ANALOG_DEADZONE); - myPaddleDeadzone->setStepValue(500); - myPaddleDeadzone->setTickmarkIntervals(3); - wid.push_back(myPaddleDeadzone); - // Add analog paddle sensitivity - ypos += lineHeight + VGAP; + ypos += lineHeight; myPaddleSpeed = new SliderWidget(myTab, _font, xpos, ypos - 1, 13 * fontWidth, lineHeight, "Sensitivity", lwidth - fontWidth * 2, kPSpeedChanged, 4 * fontWidth, "%"); @@ -360,11 +363,11 @@ void InputDialog::loadConfig() myCursorState->setSelected(settings.getString("cursor"), "2"); handleCursorState(); - // Joystick deadzone - myJoystickDeadzone->setValue(settings.getInt("joydeadzone")); + // Digital dead zone + myDigitalDeadzone->setValue(settings.getInt("joydeadzone")); + // Analog dead zone + myAnalogDeadzone->setValue(settings.getInt("adeadzone")); - // Paddle deadzone (analog) - myPaddleDeadzone->setValue(settings.getInt("pdeadzone")); // Paddle speed (analog) myPaddleSpeed->setValue(settings.getInt("psense")); // Paddle acceleration (analog) @@ -430,15 +433,15 @@ void InputDialog::saveConfig() Settings& settings = instance().settings(); // *** Device & Ports *** - // Joystick deadzone - int deadzone = myJoystickDeadzone->getValue(); + // Digital dead zone + int deadzone = myDigitalDeadzone->getValue(); settings.setValue("joydeadzone", deadzone); - Joystick::setDeadZone(deadzone); + Controller::setDigitalDeadZone(deadzone); + // Analog dead zone + deadzone = myAnalogDeadzone->getValue(); + settings.setValue("adeadzone", deadzone); + Controller::setAnalogDeadzone(deadzone); - // Paddle deadzone (analog) - deadzone = myPaddleDeadzone->getValue(); - settings.setValue("pdeadzone", deadzone); - Paddles::setAnalogDeadzone(deadzone); // Paddle speed (analog) int sensitivity = myPaddleSpeed->getValue(); settings.setValue("psense", sensitivity); @@ -526,11 +529,11 @@ void InputDialog::setDefaults() break; case 1: // Devices & Ports - // Joystick deadzone - myJoystickDeadzone->setValue(0); + // Digital dead zone + myDigitalDeadzone->setValue(0); - // Paddle deadzone - myPaddleDeadzone->setValue(0); + // Analog dead zone + myAnalogDeadzone->setValue(0); // Paddle speed (analog) myPaddleSpeed->setValue(20); @@ -695,8 +698,12 @@ void InputDialog::handleCommand(CommandSender* sender, int cmd, setDefaults(); break; - case kJDeadzoneChanged: - myJoystickDeadzone->setValueLabel(Joystick::deadZoneValue(myJoystickDeadzone->getValue())); + case kDDeadzoneChanged: + myDigitalDeadzone->setValueLabel(std::round(Controller::digitalDeadzoneValue(myDigitalDeadzone->getValue()) * 100.f / 32768)); + break; + + case kADeadzoneChanged: + myAnalogDeadzone->setValueLabel(std::round(myAnalogDeadzone->getValue() * 100.f / 32768)); break; case kPSpeedChanged: diff --git a/src/gui/InputDialog.hxx b/src/gui/InputDialog.hxx index 6b75eb80a..793b59a57 100644 --- a/src/gui/InputDialog.hxx +++ b/src/gui/InputDialog.hxx @@ -72,12 +72,13 @@ class InputDialog : public Dialog private: enum { - kJDeadzoneChanged = 'DZch', + kDDeadzoneChanged = 'DDch', + kADeadzoneChanged = 'ADch', kPSpeedChanged = 'Ppch', kPAccelChanged = 'PAch', kDejitterAvChanged = 'JAch', kDejitterReChanged = 'JRch', - kDPSpeedChanged = 'PDch', + kDPSpeedChanged = 'DSch', kAutoFireChanged = 'AFch', kTBSpeedChanged = 'TBch', kDCSpeedChanged = 'DCch', @@ -98,9 +99,9 @@ class InputDialog : public Dialog PopUpWidget* myAVoxPort{nullptr}; - SliderWidget* myJoystickDeadzone{nullptr}; + SliderWidget* myDigitalDeadzone{nullptr}; + SliderWidget* myAnalogDeadzone{nullptr}; SliderWidget* myPaddleSpeed{nullptr}; - SliderWidget* myPaddleDeadzone{nullptr}; SliderWidget* myPaddleAccel{nullptr}; SliderWidget* myDejitterBase{nullptr}; SliderWidget* myDejitterDiff{nullptr}; From 0495c975a482aa1435b37bca166781d011dda51e Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Thu, 9 Sep 2021 17:11:19 +0200 Subject: [PATCH 10/20] fixed properties for Telepathy (after breaking them) --- src/emucore/DefProps.hxx | 2 +- src/emucore/stella.pro | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/emucore/DefProps.hxx b/src/emucore/DefProps.hxx index b330d693a..faeb25e2c 100644 --- a/src/emucore/DefProps.hxx +++ b/src/emucore/DefProps.hxx @@ -880,7 +880,7 @@ static const BSPF::array2D DefProps = {{ { "3d48b8b586a09bdbf49f1a016bf4d29a", "Video Game Cartridge - Ariola", "TP-606", "Hole Hunter (Video Game Cartridge)", "AKA Topy", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, { "3d6fc7a19be76d808aa233415cb583fc", "CCE", "C-833", "Target Practice (1983) (CCE)", "AKA Carnival", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, { "3d7749fb9c2f91a276dfe494495234c5", "Jone Yuan Telephonic Enterprise Co", "", "Checkers (Jone Yuan)", "2600 Screen Search Console", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, - { "3d7aad37c55692814211c8b590a0334c", "Atari, Dan Oliver", "", "Telepathy (1983) (Atari) (Prototype)", "Uses both left joystick and right MindLink controllers (press Fire on respective controller to begin)", "Prototype", "", "", "", "", "", "", "", "", "", "", "MINDLINK", "", "", "", "", "", "", "", "", "", "", "", "http://www.atariprotos.com/2600/software/telepathy/telepathy.htm" }, + { "3d7aad37c55692814211c8b590a0334c", "Atari, Dan Oliver", "", "Telepathy (1983) (Atari) (Prototype)", "Uses both left joystick and right MindLink controllers (press Fire on respective controller to begin)", "Prototype", "", "", "", "", "", "", "", "", "", "", "MINDLINK", "", "", "", "", "", "78", "", "", "", "", "", "http://www.atariprotos.com/2600/software/telepathy/telepathy.htm" }, { "3d8a2d6493123a53ade45e3e2c5cafa0", "Atari, Jim Huether - Sears", "CX2629 - 6-99843, 49-75118", "Sky Diver (1979) (Atari) (4K)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, { "3d934bb980e2e63e1ead3e7756928ccd", "Activision, Steve Cartwright - Ariola", "EAX-017, EAX-017-04I - 711 017-720", "MegaMania (1982) (Activision) (PAL)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "{\"score_addresses\":[\"0xdb\",\"0xdc\",\"0xdd\"],\"score_digits\":6,\"variations_address\":\"0x80\",\"variations_count\":4,\"variations_zero_based\":true}", "" }, { "3d9c2fccf8b11630762ff00811c19277", "", "", "Challenge of.... Nexar, The (Unknown) (PAL)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, diff --git a/src/emucore/stella.pro b/src/emucore/stella.pro index bda5f5801..37ca217b7 100644 --- a/src/emucore/stella.pro +++ b/src/emucore/stella.pro @@ -5484,6 +5484,7 @@ "Cart.Rarity" "Prototype" "Cart.Url" "http://www.atariprotos.com/2600/software/telepathy/telepathy.htm" "Controller.Right" "MINDLINK" +"Controller.MouseAxis" "78" "" "Cart.MD5" "3d8a2d6493123a53ade45e3e2c5cafa0" From d97a38a51fff14d2276fa1edcc99aca65193d3ed Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Thu, 9 Sep 2021 17:15:50 +0200 Subject: [PATCH 11/20] forget to save before committing :) --- src/emucore/MindLink.cxx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/emucore/MindLink.cxx b/src/emucore/MindLink.cxx index 43e3e77cb..40f96c6cb 100644 --- a/src/emucore/MindLink.cxx +++ b/src/emucore/MindLink.cxx @@ -22,10 +22,6 @@ MindLink::MindLink(Jack jack, const Event& event, const System& system) : Controller(jack, event, system, Controller::Type::MindLink) { - setPin(DigitalPin::One, true); - setPin(DigitalPin::Two, true); - setPin(DigitalPin::Three, true); - setPin(DigitalPin::Four, true); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 393a588aa9a49c91ad017dd20624e59fc724770c Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Thu, 9 Sep 2021 18:11:38 +0200 Subject: [PATCH 12/20] added preliminary dead zone code for analog events changed some wording --- src/common/PJoystickHandler.cxx | 57 +++++++++++++++++++++------------ src/common/PJoystickHandler.hxx | 4 +-- src/emucore/Control.cxx | 14 ++++---- src/emucore/Control.hxx | 22 ++++++------- src/emucore/EventHandler.cxx | 22 ++++++------- src/gui/InputDialog.cxx | 15 +++++---- 6 files changed, 75 insertions(+), 59 deletions(-) diff --git a/src/common/PJoystickHandler.cxx b/src/common/PJoystickHandler.cxx index 0909ad646..d5d2ff3c6 100644 --- a/src/common/PJoystickHandler.cxx +++ b/src/common/PJoystickHandler.cxx @@ -789,7 +789,22 @@ void PhysicalJoystickHandler::handleRegularAxisEvent(const PhysicalJoystickPtr j if((abs(j->axisLastValue[axis] - value) < 30000) && (eventAxisAnalog = j->joyMap.get(EventMode::kEmulationMode, button, JoyAxis(axis), JoyDir::ANALOG)) != Event::Type::NoType) { - myHandler.handleEvent(eventAxisAnalog, value); + // TODO: TEST!!! + if(abs(value) > Controller::analogDeadZone()) + myHandler.handleEvent(eventAxisAnalog, value); + else + { + // Treat any dead zone value as zero + value = 0; + + // Now filter out consecutive, similar values + // (only pass on the event if the state has changed) + if(j->axisLastValue[axis] != value) + { + // Turn off events + myHandler.handleEvent(eventAxisAnalog, 0); + } + } } else { @@ -798,13 +813,13 @@ void PhysicalJoystickHandler::handleRegularAxisEvent(const PhysicalJoystickPtr j Event::Type eventAxisNeg = j->joyMap.get(EventMode::kEmulationMode, button, JoyAxis(axis), JoyDir::NEG); Event::Type eventAxisPos = j->joyMap.get(EventMode::kEmulationMode, button, JoyAxis(axis), JoyDir::POS); - if(value > Controller::digitalDeadzone()) + if(value > Controller::digitalDeadZone()) myHandler.handleEvent(eventAxisPos); - else if(value < -Controller::digitalDeadzone()) + else if(value < -Controller::digitalDeadZone()) myHandler.handleEvent(eventAxisNeg); else { - // Treat any deadzone value as zero + // Treat any dead zone value as zero value = 0; // Now filter out consecutive, similar values @@ -813,8 +828,8 @@ void PhysicalJoystickHandler::handleRegularAxisEvent(const PhysicalJoystickPtr j { // Turn off both events, since we don't know exactly which one // was previously activated. - myHandler.handleEvent(eventAxisNeg, false); - myHandler.handleEvent(eventAxisPos, false); + myHandler.handleEvent(eventAxisNeg, 0); + myHandler.handleEvent(eventAxisPos, 0); } } } @@ -824,13 +839,13 @@ void PhysicalJoystickHandler::handleRegularAxisEvent(const PhysicalJoystickPtr j else if(myHandler.hasOverlay()) { // A value change lower than Controller::digitalDeadzone indicates analog input which is ignored - if((abs(j->axisLastValue[axis] - value) > Controller::digitalDeadzone())) + if((abs(j->axisLastValue[axis] - value) > Controller::digitalDeadZone())) { // First, clamp the values to simulate digital input // (the only thing that the underlying code understands) - if(value > Controller::digitalDeadzone()) + if(value > Controller::digitalDeadZone()) value = 32000; - else if(value < -Controller::digitalDeadzone()) + else if(value < -Controller::digitalDeadZone()) value = -32000; else value = 0; @@ -945,33 +960,33 @@ ostream& operator<<(ostream& os, const PhysicalJoystickHandler& jh) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void PhysicalJoystickHandler::changeDigitalDeadzone(int direction) +void PhysicalJoystickHandler::changeDigitalDeadZone(int direction) { - int deadzone = BSPF::clamp(myOSystem.settings().getInt("joydeadzone") + direction, + int deadZone = BSPF::clamp(myOSystem.settings().getInt("joydeadzone") + direction, Controller::MIN_DIGITAL_DEADZONE, Controller::MAX_DIGITAL_DEADZONE); - myOSystem.settings().setValue("joydeadzone", deadzone); + myOSystem.settings().setValue("joydeadzone", deadZone); - Controller::setDigitalDeadZone(deadzone); + Controller::setDigitalDeadZone(deadZone); ostringstream ss; - ss << std::round(Controller::digitalDeadzoneValue(deadzone) * 100.F / 32768) << "%"; + ss << std::round(Controller::digitalDeadZoneValue(deadZone) * 100.F / 32768) << "%"; - myOSystem.frameBuffer().showGaugeMessage("Digital controller dead zone", ss. str(), deadzone, + myOSystem.frameBuffer().showGaugeMessage("Digital controller dead zone", ss. str(), deadZone, Controller::MIN_DIGITAL_DEADZONE, Controller::MAX_DIGITAL_DEADZONE); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void PhysicalJoystickHandler::changeAnalogPaddleDeadzone(int direction) +void PhysicalJoystickHandler::changeAnalogPaddleDeadZone(int direction) { - int deadzone = BSPF::clamp(myOSystem.settings().getInt("adeadzone") + direction * 500, + int deadZone = BSPF::clamp(myOSystem.settings().getInt("adeadzone") + direction * 500, Controller::MIN_ANALOG_DEADZONE, Controller::MAX_ANALOG_DEADZONE); - myOSystem.settings().setValue("adeadzone", deadzone); + myOSystem.settings().setValue("adeadzone", deadZone); - Controller::setAnalogDeadzone(deadzone); + Controller::setAnalogDeadZone(deadZone); ostringstream ss; - ss << std::round(deadzone * 100.F / 32768) << "%"; + ss << std::round(deadZone * 100.F / 32768) << "%"; - myOSystem.frameBuffer().showGaugeMessage("Analog controller dead zone", ss.str(), deadzone, + myOSystem.frameBuffer().showGaugeMessage("Analog controller dead zone", ss.str(), deadZone, Controller::MIN_ANALOG_DEADZONE, Controller::MAX_ANALOG_DEADZONE); } diff --git a/src/common/PJoystickHandler.hxx b/src/common/PJoystickHandler.hxx index 3b99a88de..522dfbd26 100644 --- a/src/common/PJoystickHandler.hxx +++ b/src/common/PJoystickHandler.hxx @@ -110,8 +110,8 @@ class PhysicalJoystickHandler /** Returns a list of pairs consisting of joystick name and associated ID. */ VariantList database() const; - void changeDigitalDeadzone(int direction = +1); - void changeAnalogPaddleDeadzone(int direction = +1); + void changeDigitalDeadZone(int direction = +1); + void changeAnalogPaddleDeadZone(int direction = +1); void changeAnalogPaddleSensitivity(int direction = +1); void changeAnalogPaddleAcceleration(int direction = +1); void changePaddleDejitterAveraging(int direction = +1); diff --git a/src/emucore/Control.cxx b/src/emucore/Control.cxx index 39f310ccb..b83616de7 100644 --- a/src/emucore/Control.cxx +++ b/src/emucore/Control.cxx @@ -149,23 +149,23 @@ Controller::Type Controller::getType(const string& propName) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void Controller::setDigitalDeadZone(int deadzone) +void Controller::setDigitalDeadZone(int deadZone) { - DIGITAL_DEAD_ZONE = digitalDeadzoneValue(deadzone); + DIGITAL_DEAD_ZONE = digitalDeadZoneValue(deadZone); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int Controller::digitalDeadzoneValue(int deadzone) +int Controller::digitalDeadZoneValue(int deadZone) { - deadzone = BSPF::clamp(deadzone, MIN_DIGITAL_DEADZONE, MAX_DIGITAL_DEADZONE); + deadZone = BSPF::clamp(deadZone, MIN_DIGITAL_DEADZONE, MAX_DIGITAL_DEADZONE); - return 3200 + deadzone * 1000; + return 3200 + deadZone * 1000; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void Controller::setAnalogDeadzone(int deadzone) +void Controller::setAnalogDeadZone(int deadZone) { - ANALOG_DEAD_ZONE = BSPF::clamp(deadzone, MIN_ANALOG_DEADZONE, MAX_ANALOG_DEADZONE); + ANALOG_DEAD_ZONE = BSPF::clamp(deadZone, MIN_ANALOG_DEADZONE, MAX_ANALOG_DEADZONE); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/Control.hxx b/src/emucore/Control.hxx index 32e60824a..8e90706d0 100644 --- a/src/emucore/Control.hxx +++ b/src/emucore/Control.hxx @@ -281,27 +281,27 @@ class Controller : public Serializable static Type getType(const string& propName); /** - Sets the deadzone amount for real analog joysticks. - Technically, this isn't really used by the Joystick class at all, - but it seemed like the best place to put it. + Sets the dead zone amount for real analog joysticks. + + @param deadZone Value from 0 to 29 */ - static void setDigitalDeadZone(int deadzone); + static void setDigitalDeadZone(int deadZone); /** - Sets the deadzone for analog paddles. + Sets the dead zone for analog paddles. - @param deadzone Value from 0 to 16500 + @param deadZone Value from 0 to 16500 */ - static void setAnalogDeadzone(int deadzone); + static void setAnalogDeadZone(int deadZone); /** - Retrieves the effective digital deadzone value + Retrieves the effective digital dead zone value */ - static int digitalDeadzoneValue(int deadzone); + static int digitalDeadZoneValue(int deadZone); - inline static int digitalDeadzone() { return DIGITAL_DEAD_ZONE; } + inline static int digitalDeadZone() { return DIGITAL_DEAD_ZONE; } - inline static int analogDeadzone() { return ANALOG_DEAD_ZONE; } + inline static int analogDeadZone() { return ANALOG_DEAD_ZONE; } /** Sets the sensitivity for analog emulation movement diff --git a/src/emucore/EventHandler.cxx b/src/emucore/EventHandler.cxx index 31c08f892..24e1e3dc7 100644 --- a/src/emucore/EventHandler.cxx +++ b/src/emucore/EventHandler.cxx @@ -100,7 +100,7 @@ void EventHandler::initialize() setActionMappings(EventMode::kMenuMode); Controller::setDigitalDeadZone(myOSystem.settings().getInt("joydeadzone")); - Controller::setAnalogDeadzone(myOSystem.settings().getInt("adeadzone")); + Controller::setAnalogDeadZone(myOSystem.settings().getInt("adeadzone")); Paddles::setAnalogAccel(myOSystem.settings().getInt("paccel")); Paddles::setDejitterDiff(myOSystem.settings().getInt("dejitter.diff")); Paddles::setDejitterBase(myOSystem.settings().getInt("dejitter.base")); @@ -596,8 +596,8 @@ AdjustFunction EventHandler::getAdjustSetting(AdjustSetting setting) std::bind(&Console::toggleInter, &myOSystem.console(), _1), // *** Input settings *** - std::bind(&PhysicalJoystickHandler::changeDigitalDeadzone, &joyHandler(), _1), - std::bind(&PhysicalJoystickHandler::changeAnalogPaddleDeadzone, &joyHandler(), _1), + std::bind(&PhysicalJoystickHandler::changeDigitalDeadZone, &joyHandler(), _1), + std::bind(&PhysicalJoystickHandler::changeAnalogPaddleDeadZone, &joyHandler(), _1), std::bind(&PhysicalJoystickHandler::changeAnalogPaddleSensitivity, &joyHandler(), _1), std::bind(&PhysicalJoystickHandler::changeAnalogPaddleAcceleration, &joyHandler(), _1), std::bind(&PhysicalJoystickHandler::changePaddleDejitterAveraging, &joyHandler(), _1), @@ -1364,7 +1364,7 @@ void EventHandler::handleEvent(Event::Type event, Int32 value, bool repeated) case Event::DecreaseDeadzone: if(pressed) { - myPJoyHandler->changeDigitalDeadzone(-1); + myPJoyHandler->changeDigitalDeadZone(-1); myAdjustSetting = AdjustSetting::DEADZONE; myAdjustActive = true; } @@ -1373,7 +1373,7 @@ void EventHandler::handleEvent(Event::Type event, Int32 value, bool repeated) case Event::IncreaseDeadzone: if(pressed) { - myPJoyHandler->changeDigitalDeadzone(+1); + myPJoyHandler->changeDigitalDeadZone(+1); myAdjustSetting = AdjustSetting::DEADZONE; myAdjustActive = true; } @@ -1382,7 +1382,7 @@ void EventHandler::handleEvent(Event::Type event, Int32 value, bool repeated) case Event::DecAnalogDeadzone: if(pressed) { - myPJoyHandler->changeAnalogPaddleDeadzone(-1); + myPJoyHandler->changeAnalogPaddleDeadZone(-1); myAdjustSetting = AdjustSetting::ANALOG_DEADZONE; myAdjustActive = true; } @@ -1391,7 +1391,7 @@ void EventHandler::handleEvent(Event::Type event, Int32 value, bool repeated) case Event::IncAnalogDeadzone: if(pressed) { - myPJoyHandler->changeAnalogPaddleDeadzone(+1); + myPJoyHandler->changeAnalogPaddleDeadZone(+1); myAdjustSetting = AdjustSetting::ANALOG_DEADZONE; myAdjustActive = true; } @@ -3322,10 +3322,10 @@ EventHandler::EmulActionList EventHandler::ourEmulActionList = { { { Event::VolumeDecrease, "Decrease volume", "" }, { Event::VolumeIncrease, "Increase volume", "" }, - { Event::DecreaseDeadzone, "Decrease joystick deadzone", "" }, - { Event::IncreaseDeadzone, "Increase joystick deadzone", "" }, - { Event::DecAnalogDeadzone, "Decrease analog paddle deadzone", "" }, - { Event::IncAnalogDeadzone, "Increase analog paddle deadzone", "" }, + { Event::DecreaseDeadzone, "Decrease digital dead zone", "" }, + { Event::IncreaseDeadzone, "Increase digital dead zone", "" }, + { Event::DecAnalogDeadzone, "Decrease analog dead zone", "" }, + { Event::IncAnalogDeadzone, "Increase analog dead zone", "" }, { Event::DecAnalogSense, "Decrease analog paddle sensitivity", "" }, { Event::IncAnalogSense, "Increase analog paddle sensitivity", "" }, { Event::DecAnalogAccel, "Decrease analog paddle acceleration", "" }, diff --git a/src/gui/InputDialog.cxx b/src/gui/InputDialog.cxx index 6ab997a36..76d2bbac2 100644 --- a/src/gui/InputDialog.cxx +++ b/src/gui/InputDialog.cxx @@ -160,6 +160,7 @@ void InputDialog::addDevicePortTab() myPaddleAccel->setMaxValue(Paddles::MAX_ANALOG_ACCEL); myPaddleAccel->setStepValue(5); myPaddleAccel->setTickmarkIntervals(4); + myPaddleAccel->setToolTip("Adjust fast paddle movement acceleration."); wid.push_back(myPaddleAccel); // Add dejitter (analog paddles) @@ -434,13 +435,13 @@ void InputDialog::saveConfig() // *** Device & Ports *** // Digital dead zone - int deadzone = myDigitalDeadzone->getValue(); - settings.setValue("joydeadzone", deadzone); - Controller::setDigitalDeadZone(deadzone); + int deadZone = myDigitalDeadzone->getValue(); + settings.setValue("joydeadzone", deadZone); + Controller::setDigitalDeadZone(deadZone); // Analog dead zone - deadzone = myAnalogDeadzone->getValue(); - settings.setValue("adeadzone", deadzone); - Controller::setAnalogDeadzone(deadzone); + deadZone = myAnalogDeadzone->getValue(); + settings.setValue("adeadzone", deadZone); + Controller::setAnalogDeadZone(deadZone); // Paddle speed (analog) int sensitivity = myPaddleSpeed->getValue(); @@ -699,7 +700,7 @@ void InputDialog::handleCommand(CommandSender* sender, int cmd, break; case kDDeadzoneChanged: - myDigitalDeadzone->setValueLabel(std::round(Controller::digitalDeadzoneValue(myDigitalDeadzone->getValue()) * 100.f / 32768)); + myDigitalDeadzone->setValueLabel(std::round(Controller::digitalDeadZoneValue(myDigitalDeadzone->getValue()) * 100.f / 32768)); break; case kADeadzoneChanged: From ee385a8cf04ea264771edc270aa73408afb26f18 Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Thu, 9 Sep 2021 19:53:40 +0200 Subject: [PATCH 13/20] updated docs --- docs/graphics/eventmapping_devsports.png | Bin 4928 -> 4952 bytes docs/index.html | 50 +++++++++++++---------- src/gui/InputDialog.cxx | 4 +- 3 files changed, 31 insertions(+), 23 deletions(-) diff --git a/docs/graphics/eventmapping_devsports.png b/docs/graphics/eventmapping_devsports.png index c7cbf6720bf4578c546beda34b91abb0178be415..018f503327038254799cc2334ac28e9e23a42647 100644 GIT binary patch delta 4846 zcmZXXi9ghP+s9ih*~>O|MM7nrgJexfg%k-HB1IX-jBOI;*RhsmNVXwH38!eJ!TgNG z*e1uwzRzgv`%m_2$bIhTJm-1t=ks_({Wn*YfG^0;usjAFmoWi&FAP3o>6X|%r=(iC}0&GA-!RwS0@ zrc9GS&`k75JOu#<-e3n($HG*Z0sFKAvje_<^#FbODZMNc#J5@-Xos`$psZmxzcHBD zOsN6+0jLg6yJuv_7Pj+JMr7lN$5D!}y=h#h%zc`wZ(m|><<^dxnQuSEywujre)9Wh z=W_JUfYy-h*N#)`Ui!cyC0j&xXJNnQkT$o2N4JdSBB~yW8&Q6qCkF05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$(wLFQ_K5HbwB&HIO^a0m%Hsg+F4H$`>0|CJ0QnZA(IIIq1!u^6| zjGSFXcDKLsZu9cKhrHMWw0c8G24X>ZX%j=phXTJ(twp1@Nr$?wLH8SU9U$K8csz+9 zz&py+Gn+PtFQ@(a`;_`C97foXWTYb#cg$wC__zDX^W#)>vKqT53SO(_kh)sdlJw)BdnmZGtl(k?@ z`eaTV4m%M=>Y-)BflD*SgX$nL25i+6>pT<|bNfyB3rgfSkJY|y=_hX2y z1U90}J-gfGx7d;{{Hxh9vUxt-b_(W+z~Bmc=i+jz`|U4pFB6Ai0$N;_PQ51yM4Dku zd}3Hdr~lrO8kD(Hv(rtIwEv3Px2a}f0@oIa*E$xb8WJr=cWT@I967-RQHo(pJlU4Q z2;&wRM2m$8Di?d^WoenP;7SWY>S|5aus<^>Ng!_2gb8_2)QB6kcNmdpbcuJBMW=*D z{q>Om@F*Rj%XuQI%%VBjtkA6sv*Kq_4o1Q&TcOKpCWy1?w`x!?$45IrCpCP=6!Hx( zSu!b?5n**=rWUaV_!wtr=I|)cWsb;Z`AVYtRyC*X6Jt(69Gfs(GwWf+2$EXME=mJO zg_h+Rkc~Nf_z4HwDkR}U(g&A)9F&dhoZ@ahutP&Kk>>>yvp)!T@S}JQUhEG<`J0^T z@M9-|tl#VMU+`!HeVKXyKMN3v9eoOjWLnOv8>Cmn{X52Isdh8eoE?4#vFe2ss<8jA P-_Q26!zsL#Z~XrOHfGN6 diff --git a/docs/index.html b/docs/index.html index 0cb14a30d..f92ed9ad9 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1574,23 +1574,23 @@ - Decrease joystick deadzone + Decrease analog joystick dead zone for digital controllers Shift-Control + F1 Shift-Control + F1 - Increase joystick deadzone + Increase analog joystick dead zone for digital controllers Control + F1 Control + F1 - Decrease analog paddle deadzone + Decrease analog joystick dead zone for analog controllers Shift-Control-Alt + F1 Shift-Control-Cmd + F1 - Increase analog paddle deadzone + Increase analog joystick dead zone for analog controllers Control-Alt + F1 Control-Cmd + F1 @@ -2961,20 +2961,21 @@ -
    -joydeadzone <number>
    - Set the joystick axis deadzone area for analog joysticks/gamepads. - All values within the deadzone are treated as zero-axis values, +
    -joydeadzone <0 - 29>
    + Set the joystick axis dead zone area for analog joysticks/gamepads + emulating digital controllers. + All values within the dead zone are treated as zero-axis values, while only those values outside are registered as valid input. - Accepts a number from 0 - 29, and uses the formula - 3200 + number * 1000. So the possible deadzone values - range from 3200 to 32200. + Dead zone is calculated as 3200 + value * 1000. So the possible dead + zone values range from 3200 to 32200 (= 10% - 98%). -
    -pdeadzone <0 - 15000>
    - Set the deadzone area for analog paddles. All values within the - deadzone are treated as zero-axis values, while only those values - outside are registered as valid input. +
    -adeadzone <0 - 16500>
    + Set the joystick axis dead zone area for analog joysticks/gamepads + emulating analog controllers. All values within the + dead zone are treated as zero-axis values, while only those values + outside are registered as valid input. Range: 0% - 50% @@ -2986,17 +2987,20 @@
    -paccel <0 - 100>
    - Acceleration of analog paddles when moving them fast. + Acceleration of analog paddles while moving them fast.
    -dejitter.base <0 - 10>
    - Strength of analog paddle input averaging. + Strength of analog paddle input averaging. Higher values will make + the movement smoother, but also less responsive.
    -dejitter.diff <0 - 10>
    - Impact of fast analog paddle movement on input averaging. + Impact of fast analog paddle movement on input averaging. Higher + values will reduce the movement smoothing while the paddle is moved + fast, making fast paddle movements more responsive. @@ -4023,14 +4027,18 @@ - - + + - - + diff --git a/src/gui/InputDialog.cxx b/src/gui/InputDialog.cxx index 76d2bbac2..b45048b1a 100644 --- a/src/gui/InputDialog.cxx +++ b/src/gui/InputDialog.cxx @@ -117,7 +117,7 @@ void InputDialog::addDevicePortTab() // Add digital dead zone setting myDigitalDeadzone = new SliderWidget(myTab, _font, xpos, ypos - 1, 13 * fontWidth, lineHeight, - "Digital dead zone", + "Digital dead zone size ", lwidth, kDDeadzoneChanged, 3 * fontWidth, "%"); myDigitalDeadzone->setMinValue(Controller::MIN_DIGITAL_DEADZONE); myDigitalDeadzone->setMaxValue(Controller::MAX_DIGITAL_DEADZONE); @@ -128,7 +128,7 @@ void InputDialog::addDevicePortTab() // Add analog dead zone ypos += lineHeight + VGAP; myAnalogDeadzone = new SliderWidget(myTab, _font, xpos, ypos - 1, 13 * fontWidth, lineHeight, - "Analog dead zone", + "Analog dead zone size", lwidth, kADeadzoneChanged, 3 * fontWidth, "%"); myAnalogDeadzone->setMinValue(Controller::MIN_ANALOG_DEADZONE); myAnalogDeadzone->setMaxValue(Controller::MAX_ANALOG_DEADZONE); From ce754188931318f31f51e4efdbf2073fa4f49a74 Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Fri, 10 Sep 2021 09:36:31 +0200 Subject: [PATCH 14/20] added TIA randomization (see #126), TODO: doc --- src/emucore/Settings.cxx | 7 +++++-- src/emucore/tia/TIA.cxx | 10 ++++++++++ src/emucore/tia/TIA.hxx | 5 +++++ src/gui/DeveloperDialog.cxx | 13 +++++++++++-- src/gui/DeveloperDialog.hxx | 4 ++-- 5 files changed, 33 insertions(+), 6 deletions(-) diff --git a/src/emucore/Settings.cxx b/src/emucore/Settings.cxx index 85da5c588..d441cf96b 100644 --- a/src/emucore/Settings.cxx +++ b/src/emucore/Settings.cxx @@ -208,6 +208,7 @@ Settings::Settings() setPermanent("plr.bankrandom", "false"); setPermanent("plr.ramrandom", "true"); setPermanent("plr.cpurandom", "AXYP"); + setPermanent("plr.tiarandom", "true"); setPermanent("plr.colorloss", "false"); setPermanent("plr.tv.jitter", "true"); setPermanent("plr.tv.jitter_recovery", "10"); @@ -227,6 +228,7 @@ Settings::Settings() setPermanent("dev.bankrandom", "true"); setPermanent("dev.ramrandom", "true"); setPermanent("dev.cpurandom", "SAXYP"); + setPermanent("dev.tiarandom", "true"); setPermanent("dev.colorloss", "true"); setPermanent("dev.tv.jitter", "true"); setPermanent("dev.tv.jitter_recovery", "2"); @@ -677,8 +679,8 @@ void Settings::usage() const << " handling and RAM initialization\n" << " -plr.bankrandom <1|0> Randomize the startup bank on reset\n" << " -plr.ramrandom <1|0> Randomize the contents of RAM on reset\n" - << " -plr.cpurandom <1|0> Randomize the contents of CPU registers on\n" - << " reset\n" + << " -plr.tiarandom <1|0> Randomize the TIA registers on reset\n" + << " -plr.ramrandom <1|0> Randomize the contents of RAM on reset\n" << " -plr.debugcolors <1|0> Enable debug colors\n" << " -plr.colorloss <1|0> Enable PAL color-loss effect\n" << " -plr.tv.jitter <1|0> Enable TV jitter effect\n" @@ -695,6 +697,7 @@ void Settings::usage() const << " -dev.ramrandom <1|0> Randomize the contents of RAM on reset\n" << " -dev.cpurandom <1|0> Randomize the contents of CPU registers on\n" << " reset\n" + << " -dev.tiarandom <1|0> Randomize the TIA registers on reset\n" << " -dev.debugcolors <1|0> Enable debug colors\n" << " -dev.colorloss <1|0> Enable PAL color-loss effect\n" << " -dev.tv.jitter <1|0> Enable TV jitter effect\n" diff --git a/src/emucore/tia/TIA.cxx b/src/emucore/tia/TIA.cxx index a086bfef8..75d4ac0b4 100644 --- a/src/emucore/tia/TIA.cxx +++ b/src/emucore/tia/TIA.cxx @@ -198,6 +198,15 @@ void TIA::reset() // Simply call initialize(); mostly to get around calling a virtual method // from the constructor initialize(); + + if(myRandomize) + for(uInt32 i = 0; i < 0x10000; ++i) + { + uInt16 address = mySystem->randGenerator().next() & 0x3F; + uInt8 value = mySystem->randGenerator().next(); + poke(address, value); + cycle(2); // process delay queue + } } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -956,6 +965,7 @@ void TIA::applyDeveloperSettings() setBlSwapDelay(false); } + myRandomize = mySettings.getBool(devSettings ? "dev.tiarandom" : "plr.tiarandom"); myTIAPinsDriven = devSettings ? mySettings.getBool("dev.tiadriven") : false; myEnableJitter = mySettings.getBool(devSettings ? "dev.tv.jitter" : "plr.tv.jitter"); diff --git a/src/emucore/tia/TIA.hxx b/src/emucore/tia/TIA.hxx index 67c7d9da5..2913a0cde 100644 --- a/src/emucore/tia/TIA.hxx +++ b/src/emucore/tia/TIA.hxx @@ -819,6 +819,11 @@ class TIA : public Device // Frames since the last time a frame was rendered to the render buffer uInt32 myFramesSinceLastRender{0}; + /** + * Setting this to true randomizes TIA on reset. + */ + bool myRandomize{false}; + /** * Setting this to true injects random values into undefined reads. */ diff --git a/src/gui/DeveloperDialog.cxx b/src/gui/DeveloperDialog.cxx index ec18bab0b..c47854690 100644 --- a/src/gui/DeveloperDialog.cxx +++ b/src/gui/DeveloperDialog.cxx @@ -145,11 +145,15 @@ void DeveloperDialog::addEmulationTab(const GUI::Font& font) myRandomBankWidget->setToolTip("Randomize the startup bank for\n" "most classic bankswitching types."); wid.push_back(myRandomBankWidget); + + myRandomizeTIAWidget = new CheckboxWidget(myTab, font, myRandomBankWidget->getRight() + fontWidth * 2, ypos + 1, + "Randomize TIA"); + wid.push_back(myRandomizeTIAWidget); ypos += lineHeight + VGAP; // Randomize RAM myRandomizeRAMWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 2, ypos + 1, - "Randomize zero-page and extended RAM", kRandRAMID); + "Randomize zero-page and extended RAM"); wid.push_back(myRandomizeRAMWidget); ypos += lineHeight + VGAP; @@ -162,7 +166,7 @@ void DeveloperDialog::addEmulationTab(const GUI::Font& font) for(int i = 0; i < 5; ++i) { myRandomizeCPUWidget[i] = new CheckboxWidget(myTab, font, xpos, ypos + 1, - cpuregsLabels[i], kRandCPUID); + cpuregsLabels[i]); wid.push_back(myRandomizeCPUWidget[i]); xpos += CheckboxWidget::boxSize(font) + font.getStringWidth("XX") + fontWidth * 2.5; } @@ -669,6 +673,7 @@ void DeveloperDialog::loadSettings(SettingsSet set) myConsole[set] = instance().settings().getString(prefix + "console") == "7800" ? 1 : 0; // Randomization myRandomBank[set] = instance().settings().getBool(prefix + "bankrandom"); + myRandomizeTIA[set] = instance().settings().getBool(prefix + "tiarandom"); myRandomizeRAM[set] = instance().settings().getBool(prefix + "ramrandom"); myRandomizeCPU[set] = instance().settings().getString(prefix + "cpurandom"); // Undriven TIA pins @@ -725,6 +730,7 @@ void DeveloperDialog::saveSettings(SettingsSet set) // Randomization instance().settings().setValue(prefix + "bankrandom", myRandomBank[set]); + instance().settings().setValue(prefix + "tiarandom", myRandomizeTIA[set]); instance().settings().setValue(prefix + "ramrandom", myRandomizeRAM[set]); instance().settings().setValue(prefix + "cpurandom", myRandomizeCPU[set]); @@ -786,6 +792,7 @@ void DeveloperDialog::getWidgetStates(SettingsSet set) myConsole[set] = myConsoleWidget->getSelected() == 1; // Randomization myRandomBank[set] = myRandomBankWidget->getState(); + myRandomizeTIA[set] = myRandomizeTIAWidget->getState(); myRandomizeRAM[set] = myRandomizeRAMWidget->getState(); string cpurandom; const std::array cpuregs = {"S", "A", "X", "Y", "P"}; @@ -841,6 +848,7 @@ void DeveloperDialog::setWidgetStates(SettingsSet set) myConsoleWidget->setSelectedIndex(myConsole[set]); // Randomization myRandomBankWidget->setState(myRandomBank[set]); + myRandomizeTIAWidget->setState(myRandomizeTIA[set]); myRandomizeRAMWidget->setState(myRandomizeRAM[set]); const string& cpurandom = myRandomizeCPU[set]; @@ -1025,6 +1033,7 @@ void DeveloperDialog::setDefaults() myConsole[set] = 0; // Randomization myRandomBank[set] = devSettings ? true : false; + myRandomizeTIA[set] = true; myRandomizeRAM[set] = true; myRandomizeCPU[set] = devSettings ? "SAXYP" : "AXYP"; // Undriven TIA pins diff --git a/src/gui/DeveloperDialog.hxx b/src/gui/DeveloperDialog.hxx index 5cb506af1..01170a4e1 100644 --- a/src/gui/DeveloperDialog.hxx +++ b/src/gui/DeveloperDialog.hxx @@ -57,8 +57,6 @@ class DeveloperDialog : public Dialog kPlrSettings = 'DVpl', kDevSettings = 'DVdv', kConsole = 'DVco', - kRandRAMID = 'DVrm', - kRandCPUID = 'DVcp', kTIAType = 'DVtt', kTVJitter = 'DVjt', kTVJitterChanged = 'DVjr', @@ -94,6 +92,7 @@ class DeveloperDialog : public Dialog PopUpWidget* myConsoleWidget{nullptr}; StaticTextWidget* myLoadingROMLabel{nullptr}; CheckboxWidget* myRandomBankWidget{nullptr}; + CheckboxWidget* myRandomizeTIAWidget{nullptr}; CheckboxWidget* myRandomizeRAMWidget{nullptr}; StaticTextWidget* myRandomizeCPULabel{nullptr}; CheckboxWidget* myUndrivenPinsWidget{nullptr}; @@ -154,6 +153,7 @@ class DeveloperDialog : public Dialog std::array myDetectedInfo; std::array myConsole; std::array myRandomBank; + std::array myRandomizeTIA; std::array myRandomizeRAM; std::array myRandomizeCPU; std::array myColorLoss; From 4b0e7b3d19b0f2127fa093ba2da078e65b45a0e6 Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Fri, 10 Sep 2021 11:34:13 +0200 Subject: [PATCH 15/20] added doc for TIA randomization (see #126) --- Changes.txt | 4 +- docs/graphics/options_developer_emulation.png | Bin 5131 -> 5282 bytes docs/index.html | 69 +++++++++++++++--- src/gui/DeveloperDialog.cxx | 2 +- 4 files changed, 63 insertions(+), 12 deletions(-) diff --git a/Changes.txt b/Changes.txt index 327c2a9e5..1677857cc 100644 --- a/Changes.txt +++ b/Changes.txt @@ -21,7 +21,9 @@ * Added web links for many games - * Fixe MindLink controller + * Fixed MindLink controller + + * Added TIA randomization on startup option * Debugger: enhanced prompt's auto complete and history diff --git a/docs/graphics/options_developer_emulation.png b/docs/graphics/options_developer_emulation.png index 82e5aa2a8b9147d2cf7010b0a368a33683e1586d..03b8fc9d81c3fff1a1db267244fc9f410f1ecc70 100644 GIT binary patch delta 5217 zcmYjVc{tSF`%a2v3)ziHDn$$-HOyEFiBLqAF_y@#GWO+DNn@ASR!z21iI}lu8;mWq zO=c`3%UGiiW391`?brK$f8XW&dCqfP=X%a_?)$m#C-F4?%+tF-`@Vew?HpYJZ*TA0 zcl3zKWqs?=p@kgNnpbr~Pu>kngE%Gdm4asD&yQIV{!97YW&C#)&s%avIOg_M=3Ggz zd@Oq`P0zrjdEuN^njSR##CF2bJSjRXAQ`M3UrHH$1cw(F*5=EwRYzhF?UsQfB_D`s zmzrI!^B`0rc_M-NINN~>Rx6y&?lUbe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e+X4A1PkT&~J_jZ-1@Tr1Bv9DUNb9;Wc!tlzF9F60Y1P+R-(!HTR93_>69 zt`d_Xn3&tbYR1SSj<;{`Oy@eb3l^5gvB(omuey%zJublqEV?>kx^eVC6{ z^rF(qCewo{NFlF6(weLzB*d3FoF2SmK=1bAu7E<%=u`~ zBA^`CQzF~XpDwi5;)K5(SNKiWgX19QFn*IW6>4ve3lFc8o6a$nZH=mV$8AUpHKtc` z7N8QpR@RreS!dw9uQ5DnRr7U!#Q?2Ep`=T>V$#d=0>JabP`$KoZ_F2zayGq8s-Ldr zTc>ApSJgwpKPl|#BARHCrC+jW7x=v*P|SEFlQHC>i+}z6`>$YYEcXYta!>i7*Q1P( zF^Z@SLF8#rqOuvxvscdr9CYX=YQu_Y5uy{bz9j)eWxq)q?@Lff{FA~RlCj=tbni>2 zwAW7u;J$gnNTMK&Giy4{ANVqP%MM1>GcH3dS18SM&RcauppdN~tJsk$9aEFOC}F9z z{Gf)4Sz-1!Gge+xxbiFIc`vmy1tiMRX1e%bdWWUqQ<>DZof-|xw4YmS$Q_U-x~`@^ zi*D!2`OO&qN-TT^5Qj9tAuiRjfx~!AT~5=!TE}Kz10J+Cnj?UEZ=1Gj@ySu|VN!&> zQYKni_o#BBW42qE-wE}l9bBoXS>-EobQjW^* zopkWClg2;<0Xte$He7t)cFQLFSmOII_thMcr}7%~ zBnQUUMPPR(cfN@eUOIW6-&uY>oPE6i67}b-3&tp+srWooJ(UA#w^b)8u2oQM+oLQy zDLi4~a9e%!n9?}W*!Q^7^}3x!j8LL&)fs(9 zGJLH1U*V%BEkyTUB8Wn68<^~WoG8NGe5suzfarM*17k`hE`H|7^t8a5HR?|z{tr+I BW?BFM diff --git a/docs/index.html b/docs/index.html index f92ed9ad9..437f1a532 100644 --- a/docs/index.html +++ b/docs/index.html @@ -3566,6 +3566,9 @@ + + + @@ -4323,15 +4326,57 @@ diff --git a/src/gui/DeveloperDialog.cxx b/src/gui/DeveloperDialog.cxx index c47854690..1b02b1282 100644 --- a/src/gui/DeveloperDialog.cxx +++ b/src/gui/DeveloperDialog.cxx @@ -146,7 +146,7 @@ void DeveloperDialog::addEmulationTab(const GUI::Font& font) "most classic bankswitching types."); wid.push_back(myRandomBankWidget); - myRandomizeTIAWidget = new CheckboxWidget(myTab, font, myRandomBankWidget->getRight() + fontWidth * 2, ypos + 1, + myRandomizeTIAWidget = new CheckboxWidget(myTab, font, myRandomBankWidget->getRight() + fontWidth * 2.5, ypos + 1, "Randomize TIA"); wid.push_back(myRandomizeTIAWidget); ypos += lineHeight + VGAP; From c4e0884da5f96fa86ef4efec10a4fc6a1ac42a93 Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Fri, 10 Sep 2021 22:16:19 +0200 Subject: [PATCH 16/20] renamed Menu class into OptionsMenu --- docs/index.html | 2 +- src/debugger/gui/DebuggerDialog.cxx | 2 +- src/emucore/EventHandler.cxx | 12 ++++++------ src/emucore/FrameBuffer.cxx | 10 +++++----- src/emucore/OSystem.cxx | 4 ++-- src/emucore/OSystem.hxx | 12 ++++++------ src/gui/Dialog.cxx | 2 +- src/gui/HighScoresDialog.cxx | 6 +++--- src/gui/HighScoresDialog.hxx | 6 +++--- src/gui/HighScoresMenu.cxx | 2 +- src/gui/LauncherDialog.cxx | 6 +++--- src/gui/MinUICommandDialog.cxx | 6 +++--- src/gui/OptionsDialog.cxx | 12 ++++++------ src/gui/OptionsDialog.hxx | 6 +++--- src/gui/{Menu.cxx => OptionsMenu.cxx} | 8 ++++---- src/gui/{Menu.hxx => OptionsMenu.hxx} | 20 ++++++++++---------- src/gui/StellaSettingsDialog.cxx | 6 +++--- src/gui/StellaSettingsDialog.hxx | 6 +++--- src/gui/VideoAudioDialog.cxx | 1 - src/gui/module.mk | 2 +- src/windows/Stella.vcxproj | 4 ++-- src/windows/Stella.vcxproj.filters | 4 ++-- 22 files changed, 69 insertions(+), 70 deletions(-) rename src/gui/{Menu.cxx => OptionsMenu.cxx} (93%) rename src/gui/{Menu.hxx => OptionsMenu.hxx} (76%) diff --git a/docs/index.html b/docs/index.html index 437f1a532..bb4bb95be 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4358,7 +4358,7 @@ - + diff --git a/src/debugger/gui/DebuggerDialog.cxx b/src/debugger/gui/DebuggerDialog.cxx index 444ce3260..f3a853f40 100644 --- a/src/debugger/gui/DebuggerDialog.cxx +++ b/src/debugger/gui/DebuggerDialog.cxx @@ -285,7 +285,7 @@ void DebuggerDialog::handleCommand(CommandSender* sender, int cmd, getDynamicBounds(w, h); myOptions = make_unique(instance(), parent(), this, w, h, - Menu::AppMode::debugger); + OptionsMenu::AppMode::debugger); } myOptions->open(); diff --git a/src/emucore/EventHandler.cxx b/src/emucore/EventHandler.cxx index 24e1e3dc7..b1ac76bc2 100644 --- a/src/emucore/EventHandler.cxx +++ b/src/emucore/EventHandler.cxx @@ -58,7 +58,7 @@ #include "DebuggerParser.hxx" #endif #ifdef GUI_SUPPORT - #include "Menu.hxx" + #include "OptionsMenu.hxx" #include "CommandMenu.hxx" #include "HighScoresMenu.hxx" #include "MessageMenu.hxx" @@ -3034,7 +3034,7 @@ void EventHandler::setState(EventHandlerState state) #ifdef GUI_SUPPORT case EventHandlerState::OPTIONSMENU: - myOverlay = &myOSystem.menu(); + myOverlay = &myOSystem.optionsMenu(); enableTextEvents(true); break; @@ -3083,11 +3083,11 @@ void EventHandler::setState(EventHandlerState state) } // Inform various subsystems about the new state - myOSystem.stateChanged(myState); - myOSystem.frameBuffer().stateChanged(myState); - myOSystem.frameBuffer().setCursorState(); + myOSystem.stateChanged(myState); // does nothing + myOSystem.frameBuffer().stateChanged(myState); // ignores state + myOSystem.frameBuffer().setCursorState(); // en/disables cursor for UI and emulation states if(myOSystem.hasConsole()) - myOSystem.console().stateChanged(myState); + myOSystem.console().stateChanged(myState); // does nothing // Sometimes an extraneous mouse motion event is generated // after a state change, which should be supressed diff --git a/src/emucore/FrameBuffer.cxx b/src/emucore/FrameBuffer.cxx index 70e29f6cf..917ed5c66 100644 --- a/src/emucore/FrameBuffer.cxx +++ b/src/emucore/FrameBuffer.cxx @@ -51,7 +51,7 @@ #include "ConsoleFont.hxx" #include "ConsoleBFont.hxx" #include "Launcher.hxx" - #include "Menu.hxx" + #include "OptionsMenu.hxx" #include "CommandMenu.hxx" #include "HighScoresMenu.hxx" #include "MessageMenu.hxx" @@ -379,19 +379,19 @@ void FrameBuffer::update(UpdateMode mode) #ifdef GUI_SUPPORT case EventHandlerState::OPTIONSMENU: { - myOSystem.menu().tick(); - redraw |= myOSystem.menu().needsRedraw(); + myOSystem.optionsMenu().tick(); + redraw |= myOSystem.optionsMenu().needsRedraw(); if(redraw) { clear(); myTIASurface->render(true); - myOSystem.menu().draw(forceRedraw); + myOSystem.optionsMenu().draw(forceRedraw); } else if(rerender) { clear(); myTIASurface->render(true); - myOSystem.menu().render(); + myOSystem.optionsMenu().render(); } break; // EventHandlerState::OPTIONSMENU } diff --git a/src/emucore/OSystem.cxx b/src/emucore/OSystem.cxx index 19e34795f..29394acd1 100644 --- a/src/emucore/OSystem.cxx +++ b/src/emucore/OSystem.cxx @@ -31,7 +31,7 @@ #include "Debugger.hxx" #endif #ifdef GUI_SUPPORT - #include "Menu.hxx" + #include "OptionsMenu.hxx" #include "CommandMenu.hxx" #include "HighScoresMenu.hxx" #include "MessageMenu.hxx" @@ -177,7 +177,7 @@ bool OSystem::initialize(const Settings::Options& options) #ifdef GUI_SUPPORT // Create various subsystems (menu and launcher GUI objects, etc) - myMenu = make_unique(*this); + myOptionsMenu = make_unique(*this); myCommandMenu = make_unique(*this); myHighScoresManager = make_unique(*this); myHighScoresMenu = make_unique(*this); diff --git a/src/emucore/OSystem.hxx b/src/emucore/OSystem.hxx index 014fd0696..ec7a15e53 100644 --- a/src/emucore/OSystem.hxx +++ b/src/emucore/OSystem.hxx @@ -40,7 +40,7 @@ class AudioSettings; class CommandMenu; class HighScoresMenu; class Launcher; - class Menu; + class OptionsMenu; class MessageMenu; class PlusRomsMenu; class TimeMachine; @@ -200,11 +200,11 @@ class OSystem #ifdef GUI_SUPPORT /** - Get the settings menu of the system. + Get the option menu of the system. - @return The settings menu object + @return The option menu object */ - Menu& menu() const { return *myMenu; } + OptionsMenu& optionsMenu() const { return *myOptionsMenu; } /** Get the command menu of the system. @@ -516,8 +516,8 @@ class OSystem #endif #ifdef GUI_SUPPORT - // Pointer to the Menu object - unique_ptr myMenu; + // Pointer to the OptionMenu object + unique_ptr myOptionsMenu; // Pointer to the CommandMenu object unique_ptr myCommandMenu; diff --git a/src/gui/Dialog.cxx b/src/gui/Dialog.cxx index 8239a4887..c615ed8fb 100644 --- a/src/gui/Dialog.cxx +++ b/src/gui/Dialog.cxx @@ -23,7 +23,7 @@ #include "FrameBuffer.hxx" #include "FBSurface.hxx" #include "Font.hxx" -#include "Menu.hxx" +#include "OptionsMenu.hxx" #include "Dialog.hxx" #include "Widget.hxx" #include "TabWidget.hxx" diff --git a/src/gui/HighScoresDialog.cxx b/src/gui/HighScoresDialog.cxx index 8349f804e..cdfeaf58e 100644 --- a/src/gui/HighScoresDialog.cxx +++ b/src/gui/HighScoresDialog.cxx @@ -98,7 +98,7 @@ static constexpr std::array NEXT_GFX_LARGE = { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - HighScoresDialog::HighScoresDialog(OSystem& osystem, DialogContainer& parent, int max_w, int max_h, - Menu::AppMode mode) + OptionsMenu::AppMode mode) : Dialog(osystem, parent, osystem.frameBuffer().font(), "High Scores"), _max_w{max_w}, _max_h{max_h}, @@ -219,7 +219,7 @@ HighScoresDialog::~HighScoresDialog() void HighScoresDialog::loadConfig() { // Enable blending (only once is necessary) - if (myMode == Menu::AppMode::emulator && !surface().attributes().blending) + if (myMode == OptionsMenu::AppMode::emulator && !surface().attributes().blending) { surface().attributes().blending = true; surface().attributes().blendalpha = 90; @@ -314,7 +314,7 @@ void HighScoresDialog::handleCommand(CommandSender* sender, int cmd, int data, i saveConfig(); [[fallthrough]]; case kCloseCmd: - if(myMode != Menu::AppMode::emulator) + if(myMode != OptionsMenu::AppMode::emulator) close(); else instance().eventHandler().leaveMenuMode(); diff --git a/src/gui/HighScoresDialog.hxx b/src/gui/HighScoresDialog.hxx index c1b60b04f..530088632 100644 --- a/src/gui/HighScoresDialog.hxx +++ b/src/gui/HighScoresDialog.hxx @@ -28,7 +28,7 @@ namespace GUI { } class Serializer; -#include "Menu.hxx" +#include "OptionsMenu.hxx" #include "Dialog.hxx" #include "HighScoresManager.hxx" #include "json_lib.hxx" @@ -47,7 +47,7 @@ class HighScoresDialog : public Dialog static constexpr uInt32 NUM_RANKS = 10; HighScoresDialog(OSystem& osystem, DialogContainer& parent, - int max_w, int max_h, Menu::AppMode mode); + int max_w, int max_h, OptionsMenu::AppMode mode); ~HighScoresDialog() override; protected: @@ -110,7 +110,7 @@ class HighScoresDialog : public Dialog StaticTextWidget* myMD5Widget{nullptr}; StaticTextWidget* myCheckSumWidget{nullptr}; - Menu::AppMode myMode{Menu::AppMode::emulator}; + OptionsMenu::AppMode myMode{OptionsMenu::AppMode::emulator}; private: // Following constructors and assignment operators not supported diff --git a/src/gui/HighScoresMenu.cxx b/src/gui/HighScoresMenu.cxx index fade474e4..9ca4d0b29 100644 --- a/src/gui/HighScoresMenu.cxx +++ b/src/gui/HighScoresMenu.cxx @@ -38,7 +38,7 @@ Dialog* HighScoresMenu::baseDialog() if (myHighScoresDialog == nullptr) myHighScoresDialog = new HighScoresDialog(myOSystem, *this, FBMinimum::Width, FBMinimum::Height, - Menu::AppMode::emulator); + OptionsMenu::AppMode::emulator); return myHighScoresDialog; } diff --git a/src/gui/LauncherDialog.cxx b/src/gui/LauncherDialog.cxx index 051f70eb8..c97d47791 100644 --- a/src/gui/LauncherDialog.cxx +++ b/src/gui/LauncherDialog.cxx @@ -926,10 +926,10 @@ void LauncherDialog::openSettings() // Create an options dialog, similar to the in-game one if (instance().settings().getBool("basic_settings")) myDialog = make_unique(instance(), parent(), - _w, _h, Menu::AppMode::launcher); + _w, _h, OptionsMenu::AppMode::launcher); else myDialog = make_unique(instance(), parent(), this, _w, _h, - Menu::AppMode::launcher); + OptionsMenu::AppMode::launcher); myDialog->open(); } @@ -938,7 +938,7 @@ void LauncherDialog::openHighScores() { // Create an high scores dialog, similar to the in-game one myDialog = make_unique(instance(), parent(), _w, _h, - Menu::AppMode::launcher); + OptionsMenu::AppMode::launcher); myDialog->open(); } diff --git a/src/gui/MinUICommandDialog.cxx b/src/gui/MinUICommandDialog.cxx index c98cb5675..e58094b53 100644 --- a/src/gui/MinUICommandDialog.cxx +++ b/src/gui/MinUICommandDialog.cxx @@ -321,14 +321,14 @@ void MinUICommandDialog::openSettings() if (instance().settings().getBool("basic_settings")) { myDialog = make_unique(instance(), parent(), - 1280, 720, Menu::AppMode::launcher); + 1280, 720, OptionsMenu::AppMode::launcher); myDialog->open(); } else { myDialog = make_unique(instance(), parent(), this, FBMinimum::Width, FBMinimum::Height, - Menu::AppMode::launcher); + OptionsMenu::AppMode::launcher); myDialog->open(); } } @@ -337,6 +337,6 @@ void MinUICommandDialog::openSettings() void MinUICommandDialog::openHighscores() { myDialog = make_unique(instance(), parent(), - 1280, 720, Menu::AppMode::emulator); + 1280, 720, OptionsMenu::AppMode::emulator); myDialog->open(); } diff --git a/src/gui/OptionsDialog.cxx b/src/gui/OptionsDialog.cxx index 8b3972b3b..646be5220 100644 --- a/src/gui/OptionsDialog.cxx +++ b/src/gui/OptionsDialog.cxx @@ -37,7 +37,7 @@ #include "OptionsDialog.hxx" #include "Launcher.hxx" #include "Settings.hxx" -#include "Menu.hxx" +#include "OptionsMenu.hxx" #ifdef CHEATCODE_SUPPORT #include "CheatCodeDialog.hxx" @@ -47,13 +47,13 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent, - GuiObject* boss, int max_w, int max_h, Menu::AppMode mode) + GuiObject* boss, int max_w, int max_h, OptionsMenu::AppMode mode) : Dialog(osystem, parent, osystem.frameBuffer().font(), "Options"), myBoss{boss}, myMode{mode} { // do not show basic settings options in debugger - bool minSettings = osystem.settings().getBool("minimal_ui") && mode != Menu::AppMode::debugger; + bool minSettings = osystem.settings().getBool("minimal_ui") && mode != OptionsMenu::AppMode::debugger; const int buttonHeight = Dialog::buttonHeight(), VBORDER = Dialog::vBorder(), HBORDER = Dialog::hBorder(), @@ -138,7 +138,7 @@ OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent, addToFocusList(wid); // Certain buttons are disabled depending on mode - if(myMode == Menu::AppMode::launcher) + if(myMode == OptionsMenu::AppMode::launcher) { myCheatCodeButton->clearFlags(Widget::FLAG_ENABLED); } @@ -186,7 +186,7 @@ void OptionsDialog::handleCommand(CommandSender* sender, int cmd, case kBasSetCmd: // enable basic settings instance().settings().setValue("basic_settings", true); - if (myMode != Menu::AppMode::emulator) + if (myMode != OptionsMenu::AppMode::emulator) close(); else instance().eventHandler().leaveMenuMode(); @@ -297,7 +297,7 @@ void OptionsDialog::handleCommand(CommandSender* sender, int cmd, break; case kExitCmd: - if(myMode != Menu::AppMode::emulator) + if(myMode != OptionsMenu::AppMode::emulator) close(); else instance().eventHandler().leaveMenuMode(); diff --git a/src/gui/OptionsDialog.hxx b/src/gui/OptionsDialog.hxx index 4bc747667..ce16245c6 100644 --- a/src/gui/OptionsDialog.hxx +++ b/src/gui/OptionsDialog.hxx @@ -23,14 +23,14 @@ class DialogContainer; class GuiObject; class OSystem; -#include "Menu.hxx" +#include "OptionsMenu.hxx" #include "Dialog.hxx" class OptionsDialog : public Dialog { public: OptionsDialog(OSystem& osystem, DialogContainer& parent, GuiObject* boss, - int max_w, int max_h, Menu::AppMode mode); + int max_w, int max_h, OptionsMenu::AppMode mode); ~OptionsDialog() override; private: @@ -46,7 +46,7 @@ class OptionsDialog : public Dialog GuiObject* myBoss{nullptr}; // Indicates if this dialog is used for global (vs. in-game) settings - Menu::AppMode myMode{Menu::AppMode::emulator}; + OptionsMenu::AppMode myMode{OptionsMenu::AppMode::emulator}; enum { kBasSetCmd = 'BAST', diff --git a/src/gui/Menu.cxx b/src/gui/OptionsMenu.cxx similarity index 93% rename from src/gui/Menu.cxx rename to src/gui/OptionsMenu.cxx index dee439419..f12c6bed9 100644 --- a/src/gui/Menu.cxx +++ b/src/gui/OptionsMenu.cxx @@ -22,23 +22,23 @@ #include "OSystem.hxx" #include "FrameBuffer.hxx" #include "bspf.hxx" -#include "Menu.hxx" +#include "OptionsMenu.hxx" // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Menu::Menu(OSystem& osystem) +OptionsMenu::OptionsMenu(OSystem& osystem) : DialogContainer(osystem) { } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Menu::~Menu() +OptionsMenu::~OptionsMenu() { delete stellaSettingDialog; stellaSettingDialog = nullptr; delete optionsDialog; optionsDialog = nullptr; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Dialog* Menu::baseDialog() +Dialog* OptionsMenu::baseDialog() { if (myOSystem.settings().getBool("basic_settings")) { diff --git a/src/gui/Menu.hxx b/src/gui/OptionsMenu.hxx similarity index 76% rename from src/gui/Menu.hxx rename to src/gui/OptionsMenu.hxx index f1d76492a..3329d18ca 100644 --- a/src/gui/Menu.hxx +++ b/src/gui/OptionsMenu.hxx @@ -15,8 +15,8 @@ // this file, and for a DISCLAIMER OF ALL WARRANTIES. //============================================================================ -#ifndef MENU_HXX -#define MENU_HXX +#ifndef OPTIONS_MENU_HXX +#define OPTIONS_MENU_HXX class OSystem; class StellaSettingsDialog; @@ -29,7 +29,7 @@ class OptionsDialog; @author Stephen Anthony */ -class Menu : public DialogContainer +class OptionsMenu : public DialogContainer { public: // Current Stella mode @@ -38,8 +38,8 @@ class Menu : public DialogContainer /** Create a new menu stack */ - explicit Menu(OSystem& osystem); - ~Menu() override; + explicit OptionsMenu(OSystem& osystem); + ~OptionsMenu() override; private: Dialog* baseDialog() override; @@ -48,11 +48,11 @@ class Menu : public DialogContainer private: // Following constructors and assignment operators not supported - Menu() = delete; - Menu(const Menu&) = delete; - Menu(Menu&&) = delete; - Menu& operator=(const Menu&) = delete; - Menu& operator=(Menu&&) = delete; + OptionsMenu() = delete; + OptionsMenu(const OptionsMenu&) = delete; + OptionsMenu(OptionsMenu&&) = delete; + OptionsMenu& operator=(const OptionsMenu&) = delete; + OptionsMenu& operator=(OptionsMenu&&) = delete; }; #endif diff --git a/src/gui/StellaSettingsDialog.cxx b/src/gui/StellaSettingsDialog.cxx index 46efdc497..604b836d0 100644 --- a/src/gui/StellaSettingsDialog.cxx +++ b/src/gui/StellaSettingsDialog.cxx @@ -30,7 +30,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - StellaSettingsDialog::StellaSettingsDialog(OSystem& osystem, DialogContainer& parent, - int max_w, int max_h, Menu::AppMode mode) + int max_w, int max_h, OptionsMenu::AppMode mode) : Dialog(osystem, parent, osystem.frameBuffer().font(), "Basic settings"), myMode{mode} { @@ -351,7 +351,7 @@ void StellaSettingsDialog::handleCommand(CommandSender* sender, int cmd, saveConfig(); [[fallthrough]]; case GuiObject::kCloseCmd: - if (myMode != Menu::AppMode::emulator) + if (myMode != OptionsMenu::AppMode::emulator) close(); else instance().eventHandler().leaveMenuMode(); @@ -363,7 +363,7 @@ void StellaSettingsDialog::handleCommand(CommandSender* sender, int cmd, case kConfirmSwitchCmd: instance().settings().setValue("basic_settings", false); - if (myMode != Menu::AppMode::emulator) + if (myMode != OptionsMenu::AppMode::emulator) close(); else instance().eventHandler().leaveMenuMode(); diff --git a/src/gui/StellaSettingsDialog.hxx b/src/gui/StellaSettingsDialog.hxx index 1a93deb7f..a0349eb12 100644 --- a/src/gui/StellaSettingsDialog.hxx +++ b/src/gui/StellaSettingsDialog.hxx @@ -21,7 +21,7 @@ class PopUpWidget; #include "Props.hxx" -#include "Menu.hxx" +#include "OptionsMenu.hxx" #include "Dialog.hxx" #if defined(RETRON77) @@ -39,7 +39,7 @@ class StellaSettingsDialog : public Dialog { public: StellaSettingsDialog(OSystem& osystem, DialogContainer& parent, - int max_w, int max_h, Menu::AppMode mode); + int max_w, int max_h, OptionsMenu::AppMode mode); ~StellaSettingsDialog() override; private: @@ -103,7 +103,7 @@ class StellaSettingsDialog : public Dialog #endif // Indicates if this dialog is used for global (vs. in-game) settings - Menu::AppMode myMode{Menu::AppMode::emulator}; + OptionsMenu::AppMode myMode{OptionsMenu::AppMode::emulator}; enum { kAdvancedSettings = 'SSad', diff --git a/src/gui/VideoAudioDialog.cxx b/src/gui/VideoAudioDialog.cxx index b9cb91c56..f1ebade27 100644 --- a/src/gui/VideoAudioDialog.cxx +++ b/src/gui/VideoAudioDialog.cxx @@ -23,7 +23,6 @@ #include "Cart.hxx" #include "CartDPC.hxx" #include "Dialog.hxx" -#include "Menu.hxx" #include "OSystem.hxx" #include "EditTextWidget.hxx" #include "PopUpWidget.hxx" diff --git a/src/gui/module.mk b/src/gui/module.mk index a4500b412..8234e89ee 100644 --- a/src/gui/module.mk +++ b/src/gui/module.mk @@ -30,12 +30,12 @@ MODULE_OBJS := \ src/gui/Launcher.o \ src/gui/ListWidget.o \ src/gui/LoggerDialog.o \ - src/gui/Menu.o \ src/gui/MessageBox.o \ src/gui/MessageDialog.o \ src/gui/MessageMenu.o \ src/gui/MinUICommandDialog.o\ src/gui/OptionsDialog.o \ + src/gui/OptionMenu.o \ src/gui/PlusRomsMenu.o\ src/gui/PlusRomsSetupDialog.o\ src/gui/PopUpWidget.o \ diff --git a/src/windows/Stella.vcxproj b/src/windows/Stella.vcxproj index 78adadda1..918b927cf 100755 --- a/src/windows/Stella.vcxproj +++ b/src/windows/Stella.vcxproj @@ -981,7 +981,7 @@ - + @@ -2096,7 +2096,7 @@ - + diff --git a/src/windows/Stella.vcxproj.filters b/src/windows/Stella.vcxproj.filters index 764734d65..773e9a088 100644 --- a/src/windows/Stella.vcxproj.filters +++ b/src/windows/Stella.vcxproj.filters @@ -423,7 +423,7 @@ Source Files\gui - + Source Files\gui @@ -1505,7 +1505,7 @@ Header Files\gui - + Header Files\gui From 808195f2d25ed410978b506100d1e18df6e6c0b2 Mon Sep 17 00:00:00 2001 From: lodefmode Date: Sun, 12 Sep 2021 15:19:07 -0400 Subject: [PATCH 17/20] Random pixels betwen OSD and bars (#824) * Support background color changes - pf/background used to change background color once per line resulting in higher visual quality. * - blank out left/right sides based on kernel modifications by Thomas Jentzch work in progress, stray pixel remaining * MovieCart: Fixed delayed right side kernel * MovieCart: Fixed random pixels between OSD + bars --- src/emucore/CartMVC.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/emucore/CartMVC.cxx b/src/emucore/CartMVC.cxx index c049aaefa..14de73ffb 100755 --- a/src/emucore/CartMVC.cxx +++ b/src/emucore/CartMVC.cxx @@ -481,6 +481,8 @@ static constexpr uInt8 brightLabelEven[] = { 0, 49, 48, 12, 96, 6, 140, 231, 96, 0, 0, 225, 48, 12, 96, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0 }; static constexpr uInt8 brightLabelOdd[] = { @@ -495,6 +497,8 @@ static constexpr uInt8 brightLabelOdd[] = { 6, 156, 195, 96, 0, 0, 113, 48, 12, 96, 7, 142, 127, 96, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -511,6 +515,8 @@ static constexpr uInt8 volumeLabelEven[] = { 0, 12, 192, 15, 192, 30, 112, 119, 176, 0, 0, 7, 252, 12, 254, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0 }; static constexpr uInt8 volumeLabelOdd[] = { @@ -525,6 +531,8 @@ static constexpr uInt8 volumeLabelOdd[] = { 30, 112, 99, 176, 0, 0, 14, 192, 13, 192, 14, 224, 62, 48, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; From 48ab233b87df61ba0911970c6eca112cc38c536e Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Wed, 15 Sep 2021 18:02:10 +0200 Subject: [PATCH 18/20] finalized new paddle settings --- Changes.txt | 2 + docs/graphics/eventmapping_devsports.png | Bin 4952 -> 4961 bytes docs/index.html | 32 +++---- src/common/PJoystickHandler.cxx | 40 +++------ src/common/PJoystickHandler.hxx | 2 +- src/common/PKeyboardHandler.cxx | 4 +- src/common/jsonDefinitions.hxx | 4 +- src/emucore/Control.cxx | 11 ++- src/emucore/Control.hxx | 9 +- src/emucore/Event.hxx | 2 +- src/emucore/EventHandler.cxx | 24 +++--- src/emucore/EventHandler.hxx | 2 +- src/emucore/MindLink.cxx | 2 +- src/emucore/Paddles.cxx | 102 ++++++++--------------- src/emucore/Paddles.hxx | 15 ++-- src/emucore/Settings.cxx | 11 ++- src/gui/InputDialog.cxx | 57 +++++-------- src/gui/InputDialog.hxx | 4 +- 18 files changed, 143 insertions(+), 180 deletions(-) diff --git a/Changes.txt b/Changes.txt index 1677857cc..28b38ca27 100644 --- a/Changes.txt +++ b/Changes.txt @@ -21,6 +21,8 @@ * Added web links for many games + * Added dead zone and linearity settings for analog controllers + * Fixed MindLink controller * Added TIA randomization on startup option diff --git a/docs/graphics/eventmapping_devsports.png b/docs/graphics/eventmapping_devsports.png index 018f503327038254799cc2334ac28e9e23a42647..2cc3e73f3126cb139ed087576aed8d11a0e37611 100644 GIT binary patch delta 4873 zcmZ8kc{tST-_DYKC;O6QiHw-W8Y-!T(t>0t%BXBJwvp{?ImoV(H58Rom@MI|v5m1E zW~h{D#?UO;88miAZ|8S@=epkaeg1#`xbN$8Z{M`&S~)Smu-%zc*CHs3CH9YBno1=% zR2qCdGqWIE-7 zkI+bo`Pw6w9DBAkx80F`k7>pS?2$yju_oyHXJhS0__j^yUaE@JOA;JI+(NpCj1sR< zNBS8PLu4G_L>+8wtLfkr5alQGV_(3EDSO$mIL&ZCWkb5NzPKwuX=gZAQU7%-9IvQG zxXef#V7^WuBXko(+>3ZwFq*2Xs)@66Ce71dB%5BUUSMc%gjB-5wxfC8f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Mp!Ivrs%o^N6gb}(STxNN{mG>_WWd!L%a}2VssNupI*O|CSOek3WTbxW4A^Q59 zxhUhmfW%ANT`}1WoadZj5|k~Hfb;cr9X(DF3rT@10L$|gl<|8fBI`G6uS2Ar_lKFx zHYFUqZI3@y{I9LyF<_Vh#l2S(_;|L|Syj8!D_bk|xHdJGcRUwvOr5FywBUDL-gBx7 z>Sf5@f+uGW%GT^mYv_y+-42Qpgos{XTVsk1_Bh8%l0@_i@O7HB^(LBl%=Xwxq7c+D zo=W@Vhh$VRdUwN%BZJAy@<|yg3wai2>_Gj{me!z}>^n|<512Ox;9aS9ITB-xh5%P{ z?z$ATf#A%6&_N=}e0!-!g^%Y9itM6Yh9tPe$D*sUleLseYjiYUHxE^YkUwL!25%(B zaKICHEbbCU(@YAhmsq;?Za&RUjsZ3c3O3g8xIB$&A9vMi<@BD+9#d6P2K2g^gD_h! qstnd@BwsxKA5YM-FV4>1JJ>n*K{hx - + - + @@ -2965,29 +2965,31 @@ - + + emulating analog controllers. All values within the dead zone are + treated as zero-axis values, while only those values outside are + registered as valid input.
    + Dead zone is calculated as value * 565. So the possible dead zone + values range from 0 to 16384 (= 0% - 50%) - - + + - - + + @@ -4036,8 +4038,8 @@ - - + + diff --git a/src/common/PJoystickHandler.cxx b/src/common/PJoystickHandler.cxx index d5d2ff3c6..250919b5e 100644 --- a/src/common/PJoystickHandler.cxx +++ b/src/common/PJoystickHandler.cxx @@ -789,22 +789,7 @@ void PhysicalJoystickHandler::handleRegularAxisEvent(const PhysicalJoystickPtr j if((abs(j->axisLastValue[axis] - value) < 30000) && (eventAxisAnalog = j->joyMap.get(EventMode::kEmulationMode, button, JoyAxis(axis), JoyDir::ANALOG)) != Event::Type::NoType) { - // TODO: TEST!!! - if(abs(value) > Controller::analogDeadZone()) - myHandler.handleEvent(eventAxisAnalog, value); - else - { - // Treat any dead zone value as zero - value = 0; - - // Now filter out consecutive, similar values - // (only pass on the event if the state has changed) - if(j->axisLastValue[axis] != value) - { - // Turn off events - myHandler.handleEvent(eventAxisAnalog, 0); - } - } + myHandler.handleEvent(eventAxisAnalog, value); } else { @@ -978,13 +963,14 @@ void PhysicalJoystickHandler::changeDigitalDeadZone(int direction) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void PhysicalJoystickHandler::changeAnalogPaddleDeadZone(int direction) { - int deadZone = BSPF::clamp(myOSystem.settings().getInt("adeadzone") + direction * 500, + int deadZone = BSPF::clamp(myOSystem.settings().getInt("adeadzone") + direction, Controller::MIN_ANALOG_DEADZONE, Controller::MAX_ANALOG_DEADZONE); myOSystem.settings().setValue("adeadzone", deadZone); Controller::setAnalogDeadZone(deadZone); + ostringstream ss; - ss << std::round(deadZone * 100.F / 32768) << "%"; + ss << std::round(Controller::analogDeadZoneValue(deadZone) * 100.F / 32768) << "%"; myOSystem.frameBuffer().showGaugeMessage("Analog controller dead zone", ss.str(), deadZone, Controller::MIN_ANALOG_DEADZONE, Controller::MAX_ANALOG_DEADZONE); @@ -1007,22 +993,22 @@ void PhysicalJoystickHandler::changeAnalogPaddleSensitivity(int direction) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void PhysicalJoystickHandler::changeAnalogPaddleAcceleration(int direction) +void PhysicalJoystickHandler::changeAnalogPaddleLinearity(int direction) { - int accel = BSPF::clamp(myOSystem.settings().getInt("paccel") + direction * 5, - Paddles::MIN_ANALOG_ACCEL, Paddles::MAX_ANALOG_ACCEL); - myOSystem.settings().setValue("paccel", accel); + int linear = BSPF::clamp(myOSystem.settings().getInt("plinear") + direction * 5, + Paddles::MIN_ANALOG_LINEARITY, Paddles::MAX_ANALOG_LINEARITY); + myOSystem.settings().setValue("plinear", linear); - Paddles::setAnalogAccel(accel); + Paddles::setAnalogLinearity(linear); ostringstream ss; - if(accel) - ss << accel << "%"; + if(linear) + ss << linear << "%"; else ss << "Off"; - myOSystem.frameBuffer().showGaugeMessage("Analog paddle acceleration", ss.str(), accel, - Paddles::MIN_ANALOG_ACCEL, Paddles::MAX_ANALOG_ACCEL); + myOSystem.frameBuffer().showGaugeMessage("Analog paddle linearity", ss.str(), linear, + Paddles::MIN_ANALOG_LINEARITY, Paddles::MAX_ANALOG_LINEARITY); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/common/PJoystickHandler.hxx b/src/common/PJoystickHandler.hxx index 522dfbd26..b28ca228b 100644 --- a/src/common/PJoystickHandler.hxx +++ b/src/common/PJoystickHandler.hxx @@ -113,7 +113,7 @@ class PhysicalJoystickHandler void changeDigitalDeadZone(int direction = +1); void changeAnalogPaddleDeadZone(int direction = +1); void changeAnalogPaddleSensitivity(int direction = +1); - void changeAnalogPaddleAcceleration(int direction = +1); + void changeAnalogPaddleLinearity(int direction = +1); void changePaddleDejitterAveraging(int direction = +1); void changePaddleDejitterReaction(int direction = +1); void changeDigitalPaddleSensitivity(int direction = +1); diff --git a/src/common/PKeyboardHandler.cxx b/src/common/PKeyboardHandler.cxx index 50fdafa75..7e4b9b93c 100644 --- a/src/common/PKeyboardHandler.cxx +++ b/src/common/PKeyboardHandler.cxx @@ -693,8 +693,8 @@ PhysicalKeyboardHandler::DefaultCommonMapping = { { Event::IncAnalogDeadzone, KBDK_F1, KBDM_CTRL | MOD3}, { Event::DecAnalogSense, KBDK_F2, KBDM_CTRL | KBDM_SHIFT }, { Event::IncAnalogSense, KBDK_F2, KBDM_CTRL }, - { Event::DecAnalogAccel, KBDK_F2, KBDM_CTRL | MOD3 | KBDM_SHIFT}, - { Event::IncAnalogAccel, KBDK_F2, KBDM_CTRL | MOD3}, + { Event::DecAnalogLinear, KBDK_F2, KBDM_CTRL | MOD3 | KBDM_SHIFT}, + { Event::IncAnalogLinear, KBDK_F2, KBDM_CTRL | MOD3}, { Event::DecDejtterAveraging, KBDK_F3, KBDM_CTRL | KBDM_SHIFT }, { Event::IncDejtterAveraging, KBDK_F3, KBDM_CTRL }, { Event::DecDejtterReaction, KBDK_F4, KBDM_CTRL | KBDM_SHIFT }, diff --git a/src/common/jsonDefinitions.hxx b/src/common/jsonDefinitions.hxx index 3d60ae30d..35053864f 100644 --- a/src/common/jsonDefinitions.hxx +++ b/src/common/jsonDefinitions.hxx @@ -199,8 +199,8 @@ NLOHMANN_JSON_SERIALIZE_ENUM(Event::Type, { {Event::IncAnalogDeadzone, "IncAnalogDeadzone"}, {Event::DecAnalogSense, "DecAnalogSense"}, {Event::IncAnalogSense, "IncAnalogSense"}, - {Event::DecAnalogAccel, "DecAnalogAccel"}, - {Event::IncAnalogAccel, "IncAnalogAccel"}, + {Event::DecAnalogLinear, "DecAnalogLinear"}, + {Event::IncAnalogLinear, "IncAnalogLinear"}, {Event::DecDejtterAveraging, "DecDejtterAveraging"}, {Event::IncDejtterAveraging, "IncDejtterAveraging"}, {Event::DecDejtterReaction, "DecDejtterReaction"}, diff --git a/src/emucore/Control.cxx b/src/emucore/Control.cxx index b83616de7..b356e96e4 100644 --- a/src/emucore/Control.cxx +++ b/src/emucore/Control.cxx @@ -165,9 +165,18 @@ int Controller::digitalDeadZoneValue(int deadZone) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Controller::setAnalogDeadZone(int deadZone) { - ANALOG_DEAD_ZONE = BSPF::clamp(deadZone, MIN_ANALOG_DEADZONE, MAX_ANALOG_DEADZONE); + ANALOG_DEAD_ZONE = analogDeadZoneValue(deadZone); } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +int Controller::analogDeadZoneValue(int deadZone) +{ + deadZone = BSPF::clamp(deadZone, MIN_ANALOG_DEADZONE, MAX_ANALOG_DEADZONE); + + return deadZone * std::round(32768 / 2. / MAX_DIGITAL_DEADZONE); +} + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Controller::setMouseSensitivity(int sensitivity) { diff --git a/src/emucore/Control.hxx b/src/emucore/Control.hxx index 8e90706d0..12a4ae699 100644 --- a/src/emucore/Control.hxx +++ b/src/emucore/Control.hxx @@ -74,7 +74,7 @@ class Controller : public Serializable static constexpr int MIN_DIGITAL_DEADZONE = 0; static constexpr int MAX_DIGITAL_DEADZONE = 29; static constexpr int MIN_ANALOG_DEADZONE = 0; - static constexpr int MAX_ANALOG_DEADZONE = 16500; + static constexpr int MAX_ANALOG_DEADZONE = 29; static constexpr int MIN_MOUSE_SENSE = 1; static constexpr int MAX_MOUSE_SENSE = 20; @@ -290,7 +290,7 @@ class Controller : public Serializable /** Sets the dead zone for analog paddles. - @param deadZone Value from 0 to 16500 + @param deadZone Value from 0 to 29 */ static void setAnalogDeadZone(int deadZone); @@ -299,6 +299,11 @@ class Controller : public Serializable */ static int digitalDeadZoneValue(int deadZone); + /** + Retrieves the effective analog dead zone value + */ + static int Controller::analogDeadZoneValue(int deadZone); + inline static int digitalDeadZone() { return DIGITAL_DEAD_ZONE; } inline static int analogDeadZone() { return ANALOG_DEAD_ZONE; } diff --git a/src/emucore/Event.hxx b/src/emucore/Event.hxx index 64381a0de..481a13252 100644 --- a/src/emucore/Event.hxx +++ b/src/emucore/Event.hxx @@ -149,7 +149,7 @@ class Event DecreaseDeadzone, IncreaseDeadzone, DecAnalogDeadzone, IncAnalogDeadzone, DecAnalogSense, IncAnalogSense, - DecAnalogAccel, IncAnalogAccel, + DecAnalogLinear, IncAnalogLinear, DecDejtterAveraging, IncDejtterAveraging, DecDejtterReaction, IncDejtterReaction, DecDigitalSense, IncDigitalSense, diff --git a/src/emucore/EventHandler.cxx b/src/emucore/EventHandler.cxx index b1ac76bc2..593bedaa0 100644 --- a/src/emucore/EventHandler.cxx +++ b/src/emucore/EventHandler.cxx @@ -101,7 +101,7 @@ void EventHandler::initialize() Controller::setDigitalDeadZone(myOSystem.settings().getInt("joydeadzone")); Controller::setAnalogDeadZone(myOSystem.settings().getInt("adeadzone")); - Paddles::setAnalogAccel(myOSystem.settings().getInt("paccel")); + Paddles::setAnalogLinearity(myOSystem.settings().getInt("plinear")); Paddles::setDejitterDiff(myOSystem.settings().getInt("dejitter.diff")); Paddles::setDejitterBase(myOSystem.settings().getInt("dejitter.base")); Paddles::setDejitterDiff(myOSystem.settings().getInt("dejitter.diff")); @@ -461,7 +461,7 @@ bool EventHandler::skipInputSetting() const || (!paddle && (myAdjustSetting == AdjustSetting::ANALOG_DEADZONE || myAdjustSetting == AdjustSetting::ANALOG_SENSITIVITY - || myAdjustSetting == AdjustSetting::ANALOG_ACCEL + || myAdjustSetting == AdjustSetting::ANALOG_LINEARITY || myAdjustSetting == AdjustSetting::DEJITTER_AVERAGING || myAdjustSetting == AdjustSetting::DEJITTER_REACTION || myAdjustSetting == AdjustSetting::DIGITAL_SENSITIVITY @@ -599,7 +599,7 @@ AdjustFunction EventHandler::getAdjustSetting(AdjustSetting setting) std::bind(&PhysicalJoystickHandler::changeDigitalDeadZone, &joyHandler(), _1), std::bind(&PhysicalJoystickHandler::changeAnalogPaddleDeadZone, &joyHandler(), _1), std::bind(&PhysicalJoystickHandler::changeAnalogPaddleSensitivity, &joyHandler(), _1), - std::bind(&PhysicalJoystickHandler::changeAnalogPaddleAcceleration, &joyHandler(), _1), + std::bind(&PhysicalJoystickHandler::changeAnalogPaddleLinearity, &joyHandler(), _1), std::bind(&PhysicalJoystickHandler::changePaddleDejitterAveraging, &joyHandler(), _1), std::bind(&PhysicalJoystickHandler::changePaddleDejitterReaction, &joyHandler(), _1), std::bind(&PhysicalJoystickHandler::changeDigitalPaddleSensitivity, &joyHandler(), _1), @@ -1415,20 +1415,20 @@ void EventHandler::handleEvent(Event::Type event, Int32 value, bool repeated) } return; - case Event::DecAnalogAccel: + case Event::DecAnalogLinear: if(pressed) { - myPJoyHandler->changeAnalogPaddleAcceleration(-1); - myAdjustSetting = AdjustSetting::ANALOG_ACCEL; + myPJoyHandler->changeAnalogPaddleLinearity(-1); + myAdjustSetting = AdjustSetting::ANALOG_LINEARITY; myAdjustActive = true; } return; - case Event::IncAnalogAccel: + case Event::IncAnalogLinear: if(pressed) { - myPJoyHandler->changeAnalogPaddleAcceleration(+1); - myAdjustSetting = AdjustSetting::ANALOG_ACCEL; + myPJoyHandler->changeAnalogPaddleLinearity(+1); + myAdjustSetting = AdjustSetting::ANALOG_LINEARITY; myAdjustActive = true; } return; @@ -3328,8 +3328,8 @@ EventHandler::EmulActionList EventHandler::ourEmulActionList = { { { Event::IncAnalogDeadzone, "Increase analog dead zone", "" }, { Event::DecAnalogSense, "Decrease analog paddle sensitivity", "" }, { Event::IncAnalogSense, "Increase analog paddle sensitivity", "" }, - { Event::DecAnalogAccel, "Decrease analog paddle acceleration", "" }, - { Event::IncAnalogAccel, "Increase analog paddle acceleration", "" }, + { Event::DecAnalogLinear, "Decrease analog paddle linearity", "" }, + { Event::IncAnalogLinear, "Increase analog paddle linearity", "" }, { Event::DecDejtterAveraging, "Decrease paddle dejitter averaging", "" }, { Event::IncDejtterAveraging, "Increase paddle dejitter averaging", "" }, { Event::DecDejtterReaction, "Decrease paddle dejitter reaction", "" }, @@ -3515,7 +3515,7 @@ const Event::EventSet EventHandler::DevicesEvents = { Event::DecreaseDeadzone, Event::IncreaseDeadzone, Event::DecAnalogDeadzone, Event::IncAnalogDeadzone, Event::DecAnalogSense, Event::IncAnalogSense, - Event::DecAnalogAccel, Event::IncAnalogAccel, + Event::DecAnalogLinear, Event::IncAnalogLinear, Event::DecDejtterAveraging, Event::IncDejtterAveraging, Event::DecDejtterReaction, Event::IncDejtterReaction, Event::DecDigitalSense, Event::IncDigitalSense, diff --git a/src/emucore/EventHandler.hxx b/src/emucore/EventHandler.hxx index 49acaf0b2..431f3f644 100644 --- a/src/emucore/EventHandler.hxx +++ b/src/emucore/EventHandler.hxx @@ -475,7 +475,7 @@ class EventHandler DEADZONE, ANALOG_DEADZONE, ANALOG_SENSITIVITY, - ANALOG_ACCEL, + ANALOG_LINEARITY, DEJITTER_AVERAGING, DEJITTER_REACTION, DIGITAL_SENSITIVITY, diff --git a/src/emucore/MindLink.cxx b/src/emucore/MindLink.cxx index 40f96c6cb..6dc14f59d 100644 --- a/src/emucore/MindLink.cxx +++ b/src/emucore/MindLink.cxx @@ -57,7 +57,7 @@ void MindLink::nextMindlinkBit() if(myMindlinkPos & myMindlinkShift) setPin(DigitalPin::Four, true); myMindlinkShift <<= 1; // next bit - } + } } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/Paddles.cxx b/src/emucore/Paddles.cxx index f469d08e5..0523895d8 100644 --- a/src/emucore/Paddles.cxx +++ b/src/emucore/Paddles.cxx @@ -25,8 +25,8 @@ Paddles::Paddles(Jack jack, const Event& event, const System& system, bool swappaddle, bool swapaxis, bool swapdir, bool altmap) : Controller(jack, event, system, Controller::Type::Paddles) { - // We must start with minimum resistance; see commit - // 38b452e1a047a0dca38c5bcce7c271d40f76736e for more information + // We must start with a physical valid resistance (e.g. 0); + // see commit 38b452e1a047a0dca38c5bcce7c271d40f76736e for more information setPin(AnalogPin::Five, AnalogReadout::connectToVcc()); setPin(AnalogPin::Nine, AnalogReadout::connectToVcc()); @@ -197,11 +197,21 @@ void Paddles::update() AnalogReadout::Connection Paddles::getReadOut(int lastAxis, int& newAxis, int center) { + const double range = ANALOG_RANGE - analogDeadZone() * 2; + + // dead zone, ignore changes inside the dead zone + if(newAxis > analogDeadZone()) + newAxis -= analogDeadZone(); + else if(newAxis < -analogDeadZone()) + newAxis += analogDeadZone(); + else + newAxis = 0; // treat any dead zone value as zero + static constexpr std::array bFac = { - // higher values mean more dejitter strength - 0, // off - 0.50, 0.59, 0.67, 0.74, 0.80, - 0.85, 0.89, 0.92, 0.94, 0.95 + // higher values mean more dejitter strength + 0, // off + 0.50, 0.59, 0.67, 0.74, 0.80, + 0.85, 0.89, 0.92, 0.94, 0.95 }; static constexpr std::array dFac = { // lower values mean more dejitter strength @@ -220,24 +230,30 @@ AnalogReadout::Connection Paddles::getReadOut(int lastAxis, int& newAxis, int ce if(abs(newVal - newAxis) > 10) newAxis = newVal; - // TODO: deadzone - // here or in PJoystickhandler? + // apply linearity + double linearVal = newAxis / (range / 2); // scale to -1.0..+1.0 - // accelerate, reduces sensitivity accordingly - int diff = newAxis - lastAxis; - float factor = diff ? pow(abs(diff), ACCEL) / abs(diff) : 0; + if(newAxis >= 0) + linearVal = pow(abs(linearVal), LINEARITY); + else + linearVal = -pow(abs(linearVal), LINEARITY); - newAxis = lastAxis - diff * factor * pow(MOUSE_SENSITIVITY, 1.f/ACCEL); // TODO: predefine pow(...) + newAxis = linearVal * (range / 2); // scale back to ANALOG_RANGE + + // scale axis to range including dead zone + const Int32 scaledAxis = newAxis * ANALOG_RANGE / range; // scale result return AnalogReadout::connectToVcc(MAX_RESISTANCE * - (BSPF::clamp(32768 - Int32(Int32(newAxis) * SENSITIVITY + center), 0, 65536) / 65536.0)); + BSPF::clamp((ANALOG_MAX_VALUE - (scaledAxis * SENSITIVITY + center)) / double(ANALOG_RANGE), + 0.0, 1.0)); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool Paddles::updateAnalogAxes() { - // Analog axis events from Stelladaptor-like devices + // Analog axis events from Stelladaptor-like devices, + // (which includes analog USB controllers) // These devices generate data in the range -32768 to 32767, // so we have to scale appropriately // Since these events are generated and stored indefinitely, @@ -245,20 +261,6 @@ bool Paddles::updateAnalogAxes() // previous values by a pre-defined amount) // Otherwise, it would always override input from digital and mouse - //static constexpr std::array bFac = { - // // higher values mean more dejitter strength - // 0, // off - // 0.50, 0.59, 0.67, 0.74, 0.80, - // 0.85, 0.89, 0.92, 0.94, 0.95 - //}; - //static constexpr std::array dFac = { - // // lower values mean more dejitter strength - // 1, // off - // 1.0 / 181, 1.0 / 256, 1.0 / 362, 1.0 / 512, 1.0 / 724, - // 1.0 / 1024, 1.0 / 1448, 1.0 / 2048, 1.0 / 2896, 1.0 / 4096 - //}; - //const double baseFactor = bFac[DEJITTER_BASE]; - //const double diffFactor = dFac[DEJITTER_DIFF]; int sa_xaxis = myEvent.get(myAAxisValue); int sa_yaxis = myEvent.get(myBAxisValue); @@ -266,34 +268,13 @@ bool Paddles::updateAnalogAxes() if(abs(myLastAxisX - sa_xaxis) > 10) { - - //// dejitter, suppress small changes only - //double dejitter = pow(baseFactor, abs(sa_xaxis - myLastAxisX) * diffFactor); - //int new_val = sa_xaxis * (1 - dejitter) + myLastAxisX * dejitter; - - //// only use new dejittered value for larger differences - //if(abs(new_val - sa_xaxis) > 10) - // sa_xaxis = new_val; - - //setPin(AnalogPin::Nine, AnalogReadout::connectToVcc(MAX_RESISTANCE * - // (BSPF::clamp(32768 - Int32(Int32(sa_xaxis) * SENSITIVITY + XCENTER), 0, 65536) / 65536.0))); setPin(AnalogPin::Nine, getReadOut(myLastAxisX, sa_xaxis, XCENTER)); sa_changed = true; } if(abs(myLastAxisY - sa_yaxis) > 10) { - //// dejitter, suppress small changes only - //double dejitter = pow(baseFactor, abs(sa_yaxis - myLastAxisY) * diffFactor); - //int new_val = sa_yaxis * (1 - dejitter) + myLastAxisY * dejitter; - - //// only use new dejittered value for larger differences - //if(abs(new_val - sa_yaxis) > 10) - // sa_yaxis = new_val; - - //setPin(AnalogPin::Five, AnalogReadout::connectToVcc(MAX_RESISTANCE * - // (BSPF::clamp(32768 - Int32(Int32(sa_yaxis) * SENSITIVITY + YCENTER), 0, 65536) / 65536.0))); - setPin(AnalogPin::Nine, getReadOut(myLastAxisY, sa_yaxis, YCENTER)); + setPin(AnalogPin::Five, getReadOut(myLastAxisY, sa_yaxis, YCENTER)); sa_changed = true; } myLastAxisX = sa_xaxis; @@ -329,20 +310,9 @@ void Paddles::updateMouse(bool& firePressedA, bool& firePressedB) // mapped to a separate paddle if(myMPaddleIDX > -1) { - // TODO: REMOVE! Test for 2600-daptor paddles only! - // deadzone - // TODO - // - // accelerate - int diff = myEvent.get(myAxisMouseMotion); - float factor = diff ? pow(abs(diff), ACCEL) / abs(diff) : 0; - int newVal = myCharge[myMPaddleIDX] - diff * factor * pow(MOUSE_SENSITIVITY, 1.f/ACCEL); - - myCharge[myMPaddleIDX] = BSPF::clamp(newVal, TRIGMIN, TRIGRANGE); - - /* myCharge[myMPaddleIDX] = BSPF::clamp(myCharge[myMPaddleIDX] - + myCharge[myMPaddleIDX] = BSPF::clamp(myCharge[myMPaddleIDX] - (myEvent.get(Event::MouseAxisXMove) * MOUSE_SENSITIVITY), - TRIGMIN, TRIGRANGE);*/ + TRIGMIN, TRIGRANGE); if(myMPaddleIDX == 0) firePressedA = firePressedA || myEvent.get(Event::MouseButtonLeftValue); @@ -479,9 +449,9 @@ float Paddles::analogSensitivityValue(int sensitivity) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void Paddles::setAnalogAccel(int accel) +void Paddles::setAnalogLinearity(int linearity) { - ACCEL = 1.f + BSPF::clamp(accel, MIN_ANALOG_ACCEL, MAX_ANALOG_ACCEL) / 100.f; + LINEARITY = 100.f / BSPF::clamp(linearity, MIN_ANALOG_LINEARITY, MAX_ANALOG_LINEARITY); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Paddles::setDejitterBase(int strength) @@ -513,7 +483,7 @@ void Paddles::setDigitalPaddleRange(int range) int Paddles::XCENTER = 0; int Paddles::YCENTER = 0; float Paddles::SENSITIVITY = 1.0; -float Paddles::ACCEL = 1.0; +float Paddles::LINEARITY = 1.0; int Paddles::DEJITTER_BASE = 0; int Paddles::DEJITTER_DIFF = 0; int Paddles::TRIGRANGE = Paddles::TRIGMAX; diff --git a/src/emucore/Paddles.hxx b/src/emucore/Paddles.hxx index 2c501771a..ce37b35b3 100644 --- a/src/emucore/Paddles.hxx +++ b/src/emucore/Paddles.hxx @@ -48,11 +48,14 @@ class Paddles : public Controller ~Paddles() override = default; public: + static constexpr int ANALOG_MIN_VALUE = -32768; + static constexpr int ANALOG_MAX_VALUE = 32767; + static constexpr int ANALOG_RANGE = ANALOG_MAX_VALUE - ANALOG_MIN_VALUE + 1; static constexpr float BASE_ANALOG_SENSE = 0.148643628F; static constexpr int MIN_ANALOG_SENSE = 0; static constexpr int MAX_ANALOG_SENSE = 30; - static constexpr int MIN_ANALOG_ACCEL = 0; - static constexpr int MAX_ANALOG_ACCEL = 100; + static constexpr int MIN_ANALOG_LINEARITY = 25; + static constexpr int MAX_ANALOG_LINEARITY = 100; static constexpr int MIN_ANALOG_CENTER = -10; static constexpr int MAX_ANALOG_CENTER = 30; static constexpr int MIN_DIGITAL_SENSE = 1; @@ -112,11 +115,11 @@ class Paddles : public Controller static void setAnalogYCenter(int ycenter); /** - Sets the acceleration for analog paddles. + Sets the linearity of analog paddles. - @param accel Value from 100 to 300 + @param linearity Value from 25 to 100 */ - static void setAnalogAccel(int accel); + static void setAnalogLinearity(int linearity); /** Sets the sensitivity for analog paddles. @@ -191,7 +194,7 @@ class Paddles : public Controller static int XCENTER; static int YCENTER; - static float SENSITIVITY, ACCEL; + static float SENSITIVITY, LINEARITY; static int DIGITAL_SENSITIVITY, DIGITAL_DISTANCE; static int DEJITTER_BASE, DEJITTER_DIFF; diff --git a/src/emucore/Settings.cxx b/src/emucore/Settings.cxx index d441cf96b..0a9314316 100644 --- a/src/emucore/Settings.cxx +++ b/src/emucore/Settings.cxx @@ -116,7 +116,7 @@ Settings::Settings() setPermanent("grabmouse", "true"); setPermanent("cursor", "2"); setPermanent("adeadzone", "0"); - setPermanent("paccel", "100"); + setPermanent("plinear", "100"); setPermanent("dejitter.base", "0"); setPermanent("dejitter.diff", "0"); setPermanent("dsense", "10"); @@ -368,8 +368,8 @@ void Settings::validate() setValue("psense", BSPF::clamp(getInt("psense"), Paddles::MIN_ANALOG_SENSE, Paddles::MAX_ANALOG_SENSE)); - setValue("paccel", BSPF::clamp(getInt("paccel"), - Paddles::MIN_ANALOG_ACCEL, Paddles::MAX_ANALOG_ACCEL)); + setValue("plinear", BSPF::clamp(getInt("plinear"), + Paddles::MIN_ANALOG_LINEARITY, Paddles::MAX_ANALOG_LINEARITY)); setValue("dejitter.base", BSPF::clamp(getInt("dejitter.base"), Paddles::MIN_DEJITTER, Paddles::MAX_DEJITTER)); @@ -525,9 +525,8 @@ void Settings::usage() const << " properties in given mode(see manual)\n" << " -grabmouse <1|0> Locks the mouse cursor in the TIA window\n" << " -cursor <0,1,2,3> Set cursor state in UI/emulation modes\n" - << " -adeadzone Sets analog 'dead zone' area for analog joysticks\n" - << " (0-16500)\n" - << " -paccel <0-100> Sets paddle acceleration strength\n" + << " -adeadzone <0-29> Sets analog 'dead zone' area for analog joysticks\n" + << " -plinear <25-100> Sets paddle linearity\n" << " -dejitter.base <0-10> Strength of analog paddle value averaging\n" << " -dejitter.diff <0-10> Strength of analog paddle reaction to fast movements\n" << " -psense <0-30> Sensitivity of analog paddle movement\n" diff --git a/src/gui/InputDialog.cxx b/src/gui/InputDialog.cxx index b45048b1a..40ae3f8f9 100644 --- a/src/gui/InputDialog.cxx +++ b/src/gui/InputDialog.cxx @@ -121,7 +121,7 @@ void InputDialog::addDevicePortTab() lwidth, kDDeadzoneChanged, 3 * fontWidth, "%"); myDigitalDeadzone->setMinValue(Controller::MIN_DIGITAL_DEADZONE); myDigitalDeadzone->setMaxValue(Controller::MAX_DIGITAL_DEADZONE); - myDigitalDeadzone->setTickmarkIntervals(4); + myDigitalDeadzone->setTickmarkIntervals(5); myDigitalDeadzone->setToolTip("Adjust dead zone size for analog joysticks when emulating digital controllers."); wid.push_back(myDigitalDeadzone); @@ -132,8 +132,7 @@ void InputDialog::addDevicePortTab() lwidth, kADeadzoneChanged, 3 * fontWidth, "%"); myAnalogDeadzone->setMinValue(Controller::MIN_ANALOG_DEADZONE); myAnalogDeadzone->setMaxValue(Controller::MAX_ANALOG_DEADZONE); - myAnalogDeadzone->setStepValue(500); - myAnalogDeadzone->setTickmarkIntervals(3); + myAnalogDeadzone->setTickmarkIntervals(5); myAnalogDeadzone->setToolTip("Adjust dead zone size for analog joysticks when emulating analog controllers."); wid.push_back(myAnalogDeadzone); @@ -151,17 +150,16 @@ void InputDialog::addDevicePortTab() myPaddleSpeed->setTickmarkIntervals(3); wid.push_back(myPaddleSpeed); - // Add analog paddle acceleration + // Add analog paddle linearity ypos += lineHeight + VGAP; - myPaddleAccel = new SliderWidget(myTab, _font, xpos, ypos - 1, 13 * fontWidth, lineHeight, - "Acceleration", - lwidth - fontWidth * 2, kPAccelChanged, 4 * fontWidth); - myPaddleAccel->setMinValue(Paddles::MIN_ANALOG_ACCEL); - myPaddleAccel->setMaxValue(Paddles::MAX_ANALOG_ACCEL); - myPaddleAccel->setStepValue(5); - myPaddleAccel->setTickmarkIntervals(4); - myPaddleAccel->setToolTip("Adjust fast paddle movement acceleration."); - wid.push_back(myPaddleAccel); + myPaddleLinearity = new SliderWidget(myTab, _font, xpos, ypos - 1, 13 * fontWidth, lineHeight, + "Linearity", lwidth - fontWidth * 2, 0, 4 * fontWidth, "%"); + myPaddleLinearity->setMinValue(Paddles::MIN_ANALOG_LINEARITY); + myPaddleLinearity->setMaxValue(Paddles::MAX_ANALOG_LINEARITY); + myPaddleLinearity->setStepValue(5); + myPaddleLinearity->setTickmarkIntervals(3); + myPaddleLinearity->setToolTip("Adjust paddle movement linearity."); + wid.push_back(myPaddleLinearity); // Add dejitter (analog paddles) ypos += lineHeight + VGAP; @@ -371,8 +369,8 @@ void InputDialog::loadConfig() // Paddle speed (analog) myPaddleSpeed->setValue(settings.getInt("psense")); - // Paddle acceleration (analog) - myPaddleAccel->setValue(settings.getInt("paccel")); + // Paddle linearity (analog) + myPaddleLinearity->setValue(settings.getInt("plinear")); // Paddle dejitter (analog) myDejitterBase->setValue(settings.getInt("dejitter.base")); myDejitterDiff->setValue(settings.getInt("dejitter.diff")); @@ -447,10 +445,10 @@ void InputDialog::saveConfig() int sensitivity = myPaddleSpeed->getValue(); settings.setValue("psense", sensitivity); Paddles::setAnalogSensitivity(sensitivity); - // Paddle acceleration (analog) - int accel = myPaddleAccel->getValue(); - settings.setValue("paccel", accel); - Paddles::setAnalogAccel(accel); + // Paddle linearity (analog) + int linearity = myPaddleLinearity->getValue(); + settings.setValue("plinear", linearity); + Paddles::setAnalogLinearity(linearity); // Paddle dejitter (analog) int dejitter = myDejitterBase->getValue(); @@ -539,8 +537,8 @@ void InputDialog::setDefaults() // Paddle speed (analog) myPaddleSpeed->setValue(20); - // Paddle acceleration - myPaddleAccel->setValue(0); + // Paddle linearity + myPaddleLinearity->setValue(100); #if defined(RETRON77) myDejitterBase->setValue(2); myDejitterDiff->setValue(6); @@ -700,11 +698,13 @@ void InputDialog::handleCommand(CommandSender* sender, int cmd, break; case kDDeadzoneChanged: - myDigitalDeadzone->setValueLabel(std::round(Controller::digitalDeadZoneValue(myDigitalDeadzone->getValue()) * 100.f / 32768)); + myDigitalDeadzone->setValueLabel(std::round(Controller::digitalDeadZoneValue(myDigitalDeadzone->getValue()) * 100.f / + (Paddles::ANALOG_RANGE / 2))); break; case kADeadzoneChanged: - myAnalogDeadzone->setValueLabel(std::round(myAnalogDeadzone->getValue() * 100.f / 32768)); + myAnalogDeadzone->setValueLabel(std::round(Controller::analogDeadZoneValue(myAnalogDeadzone->getValue()) * 100.f / + (Paddles::ANALOG_RANGE / 2))); break; case kPSpeedChanged: @@ -712,10 +712,6 @@ void InputDialog::handleCommand(CommandSender* sender, int cmd, myPaddleSpeed->getValue()) * 100.F)); break; - case kPAccelChanged: - updatePaddleAccel(); - break; - case kDejitterAvChanged: updateDejitterAveraging(); break; @@ -791,13 +787,6 @@ void InputDialog::handleCommand(CommandSender* sender, int cmd, } } -void InputDialog::updatePaddleAccel() -{ - int strength = myPaddleAccel->getValue(); - - myPaddleAccel->setValueLabel(strength ? std::to_string(strength) + "%" : "Off"); -} - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void InputDialog::updateDejitterAveraging() { diff --git a/src/gui/InputDialog.hxx b/src/gui/InputDialog.hxx index 793b59a57..e5a2d1ced 100644 --- a/src/gui/InputDialog.hxx +++ b/src/gui/InputDialog.hxx @@ -64,7 +64,6 @@ class InputDialog : public Dialog void handleMouseControlState(); void handleCursorState(); - void updatePaddleAccel(); void updateDejitterAveraging(); void updateDejitterReaction(); void updateAutoFireRate(); @@ -75,7 +74,6 @@ class InputDialog : public Dialog kDDeadzoneChanged = 'DDch', kADeadzoneChanged = 'ADch', kPSpeedChanged = 'Ppch', - kPAccelChanged = 'PAch', kDejitterAvChanged = 'JAch', kDejitterReChanged = 'JRch', kDPSpeedChanged = 'DSch', @@ -102,7 +100,7 @@ class InputDialog : public Dialog SliderWidget* myDigitalDeadzone{nullptr}; SliderWidget* myAnalogDeadzone{nullptr}; SliderWidget* myPaddleSpeed{nullptr}; - SliderWidget* myPaddleAccel{nullptr}; + SliderWidget* myPaddleLinearity{nullptr}; SliderWidget* myDejitterBase{nullptr}; SliderWidget* myDejitterDiff{nullptr}; SliderWidget* myDPaddleSpeed{nullptr}; From 8bf7eb46e234fa90ab8167cb88e4538f579cdff6 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Wed, 15 Sep 2021 15:14:31 -0230 Subject: [PATCH 19/20] Fix compilation in Linux (missing entry in module.mk). Fix compilation warnings in a few places. Use float instead of floats and doubles in Paddles class (otherwise we get warnings). Thomas, can you check that this doesn't affect functionality? --- src/emucore/CartMVC.cxx | 38 +++++++++++++++++++------------------- src/emucore/Control.cxx | 1 + src/emucore/Control.hxx | 6 +++--- src/emucore/Paddles.cxx | 22 +++++++++++----------- src/gui/module.mk | 2 +- 5 files changed, 35 insertions(+), 34 deletions(-) diff --git a/src/emucore/CartMVC.cxx b/src/emucore/CartMVC.cxx index 88de9280c..e24f6f245 100755 --- a/src/emucore/CartMVC.cxx +++ b/src/emucore/CartMVC.cxx @@ -301,7 +301,7 @@ class MovieInputs : public Serializable // Automatically generated // Several not used -#define addr_kernel_48 0x800 +// #define addr_kernel_48 0x800 #define addr_transport_direction 0x880 #define addr_transport_buttons 0x894 #define addr_right_line 0x948 @@ -317,7 +317,7 @@ class MovieInputs : public Serializable #define addr_set_gcol7 0x96a #define addr_set_gdata7 0x96e #define addr_set_gcol8 0x972 -#define addr_left_line 0x980 +// #define addr_left_line 0x980 #define addr_set_gdata1 0x982 #define addr_set_gcol1 0x988 #define addr_set_aud_left 0x98c @@ -331,27 +331,27 @@ class MovieInputs : public Serializable #define addr_set_gdata2 0x9a8 #define addr_set_gcol3 0x9ac #define addr_pick_continue 0x9be -#define addr_main_start 0xa00 -#define addr_aud_bank_setup 0xa0c -#define addr_tg0 0xa24 -#define addr_title_again 0xa3b -#define addr_wait_cnt 0xa77 +// #define addr_main_start 0xa00 +// #define addr_aud_bank_setup 0xa0c +// #define addr_tg0 0xa24 +// #define addr_title_again 0xa3b +// #define addr_wait_cnt 0xa77 #define addr_end_lines 0xa80 #define addr_set_aud_endlines 0xa80 #define addr_set_overscan_size 0xa9a #define addr_set_vblank_size 0xab0 #define addr_pick_extra_lines 0xab9 #define addr_pick_transport 0xac6 -#define addr_wait_lines 0xac9 -#define addr_transport_done1 0xada -#define addr_draw_title 0xb00 +// #define addr_wait_lines 0xac9 +// #define addr_transport_done1 0xada +// #define addr_draw_title 0xb00 #define addr_title_loop 0xb50 -#define addr_black_bar 0xb52 -#define addr_animate_bar1 0xb58 -#define addr_animate_bar_again1 0xb5a -#define addr_animate_dex1 0xb65 +// #define addr_black_bar 0xb52 +// #define addr_animate_bar1 0xb58 +// #define addr_animate_bar_again1 0xb5a +// #define addr_animate_dex1 0xb65 #define addr_audio_bank 0xb80 -#define addr_reset_loop 0xbfa +// #define addr_reset_loop 0xbfa // scale adjustments, automatically generated static constexpr uInt8 scale0[16] = { @@ -480,7 +480,7 @@ static constexpr uInt8 brightLabelEven[] = { 0, 49, 48, 12, 96, 6, 140, 231, 96, 0, 0, 225, 48, 12, 96, - 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -497,7 +497,7 @@ static constexpr uInt8 brightLabelOdd[] = { 0, 113, 48, 12, 96, 7, 142, 127, 96, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -514,7 +514,7 @@ static constexpr uInt8 volumeLabelEven[] = { 0, 12, 192, 15, 192, 30, 112, 119, 176, 0, 0, 7, 252, 12, 254, - 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -531,7 +531,7 @@ static constexpr uInt8 volumeLabelOdd[] = { 0, 14, 192, 13, 192, 14, 224, 62, 48, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; diff --git a/src/emucore/Control.cxx b/src/emucore/Control.cxx index b356e96e4..0b8d99dcc 100644 --- a/src/emucore/Control.cxx +++ b/src/emucore/Control.cxx @@ -16,6 +16,7 @@ //============================================================================ #include +#include #include "System.hxx" #include "Control.hxx" diff --git a/src/emucore/Control.hxx b/src/emucore/Control.hxx index 12a4ae699..88ccde736 100644 --- a/src/emucore/Control.hxx +++ b/src/emucore/Control.hxx @@ -302,7 +302,7 @@ class Controller : public Serializable /** Retrieves the effective analog dead zone value */ - static int Controller::analogDeadZoneValue(int deadZone); + static int analogDeadZoneValue(int deadZone); inline static int digitalDeadZone() { return DIGITAL_DEAD_ZONE; } @@ -410,10 +410,10 @@ class Controller : public Serializable /// The callback that is dispatched whenver an analog pin has changed onAnalogPinUpdateCallback myOnAnalogPinUpdateCallback{nullptr}; - /// Defines the dead zone of analog joysticks for digital Atari controllers + /// Defines the dead zone of analog joysticks for digital Atari controllers static int DIGITAL_DEAD_ZONE; - /// Defines the dead zone of analog joysticks for analog Atari controllers + /// Defines the dead zone of analog joysticks for analog Atari controllers static int ANALOG_DEAD_ZONE; static int MOUSE_SENSITIVITY; diff --git a/src/emucore/Paddles.cxx b/src/emucore/Paddles.cxx index 0523895d8..42e8eea52 100644 --- a/src/emucore/Paddles.cxx +++ b/src/emucore/Paddles.cxx @@ -197,7 +197,7 @@ void Paddles::update() AnalogReadout::Connection Paddles::getReadOut(int lastAxis, int& newAxis, int center) { - const double range = ANALOG_RANGE - analogDeadZone() * 2; + const float range = ANALOG_RANGE - analogDeadZone() * 2; // dead zone, ignore changes inside the dead zone if(newAxis > analogDeadZone()) @@ -207,23 +207,23 @@ AnalogReadout::Connection Paddles::getReadOut(int lastAxis, int& newAxis, int ce else newAxis = 0; // treat any dead zone value as zero - static constexpr std::array bFac = { + static constexpr std::array bFac = { // higher values mean more dejitter strength 0, // off 0.50, 0.59, 0.67, 0.74, 0.80, 0.85, 0.89, 0.92, 0.94, 0.95 }; - static constexpr std::array dFac = { + static constexpr std::array dFac = { // lower values mean more dejitter strength 1, // off 1.0 / 181, 1.0 / 256, 1.0 / 362, 1.0 / 512, 1.0 / 724, 1.0 / 1024, 1.0 / 1448, 1.0 / 2048, 1.0 / 2896, 1.0 / 4096 }; - const double baseFactor = bFac[DEJITTER_BASE]; - const double diffFactor = dFac[DEJITTER_DIFF]; + const float baseFactor = bFac[DEJITTER_BASE]; + const float diffFactor = dFac[DEJITTER_DIFF]; // dejitter, suppress small changes only - double dejitter = pow(baseFactor, abs(newAxis - lastAxis) * diffFactor); + float dejitter = powf(baseFactor, std::abs(newAxis - lastAxis) * diffFactor); int newVal = newAxis * (1 - dejitter) + lastAxis * dejitter; // only use new dejittered value for larger differences @@ -231,12 +231,12 @@ AnalogReadout::Connection Paddles::getReadOut(int lastAxis, int& newAxis, int ce newAxis = newVal; // apply linearity - double linearVal = newAxis / (range / 2); // scale to -1.0..+1.0 + float linearVal = newAxis / (range / 2); // scale to -1.0..+1.0 if(newAxis >= 0) - linearVal = pow(abs(linearVal), LINEARITY); + linearVal = powf(std::abs(linearVal), LINEARITY); else - linearVal = -pow(abs(linearVal), LINEARITY); + linearVal = -powf(std::abs(linearVal), LINEARITY); newAxis = linearVal * (range / 2); // scale back to ANALOG_RANGE @@ -245,8 +245,8 @@ AnalogReadout::Connection Paddles::getReadOut(int lastAxis, int& newAxis, int ce // scale result return AnalogReadout::connectToVcc(MAX_RESISTANCE * - BSPF::clamp((ANALOG_MAX_VALUE - (scaledAxis * SENSITIVITY + center)) / double(ANALOG_RANGE), - 0.0, 1.0)); + BSPF::clamp((ANALOG_MAX_VALUE - (scaledAxis * SENSITIVITY + center)) / + float(ANALOG_RANGE), 0.F, 1.F)); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/module.mk b/src/gui/module.mk index 8234e89ee..3759b367c 100644 --- a/src/gui/module.mk +++ b/src/gui/module.mk @@ -35,7 +35,7 @@ MODULE_OBJS := \ src/gui/MessageMenu.o \ src/gui/MinUICommandDialog.o\ src/gui/OptionsDialog.o \ - src/gui/OptionMenu.o \ + src/gui/OptionsMenu.o \ src/gui/PlusRomsMenu.o\ src/gui/PlusRomsSetupDialog.o\ src/gui/PopUpWidget.o \ From 3b6dba3b844f5836ae62feaaa9f81b09db251a96 Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Wed, 15 Sep 2021 20:23:57 +0200 Subject: [PATCH 20/20] fixed VS compiler warnings (yes, sometimes VS is more strict than anything else :) --- src/emucore/Paddles.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/emucore/Paddles.cxx b/src/emucore/Paddles.cxx index 42e8eea52..30a243969 100644 --- a/src/emucore/Paddles.cxx +++ b/src/emucore/Paddles.cxx @@ -209,15 +209,15 @@ AnalogReadout::Connection Paddles::getReadOut(int lastAxis, int& newAxis, int ce static constexpr std::array bFac = { // higher values mean more dejitter strength - 0, // off - 0.50, 0.59, 0.67, 0.74, 0.80, - 0.85, 0.89, 0.92, 0.94, 0.95 + 0.f, // off + 0.50f, 0.59f, 0.67f, 0.74f, 0.80f, + 0.85f, 0.89f, 0.92f, 0.94f, 0.95f }; static constexpr std::array dFac = { // lower values mean more dejitter strength - 1, // off - 1.0 / 181, 1.0 / 256, 1.0 / 362, 1.0 / 512, 1.0 / 724, - 1.0 / 1024, 1.0 / 1448, 1.0 / 2048, 1.0 / 2896, 1.0 / 4096 + 1.f, // off + 1.0f / 181, 1.0f / 256, 1.0f / 362, 1.0f / 512, 1.0f / 724, + 1.0f / 1024, 1.0f / 1448, 1.0f / 2048, 1.0f / 2896, 1.0f / 4096 }; const float baseFactor = bFac[DEJITTER_BASE]; const float diffFactor = dFac[DEJITTER_DIFF];
    ItemBrief descriptionFor more information,
    see Command Line
    Joystick deadzone sizeDeadzone area for axes on joysticks/gamepads-joydeadzone
    (Analog paddle) Deadzone sizeDeadzone area for analog paddles-pdeadzone
    Digital dead zone sizeDead zone area for axes on joysticks/gamepads emulating + digital controllers + -joydeadzone
    Analog dead zone sizeDead zone area for axes on joysticks/gamepads emulating + analog controllers + -adeadzone
    (Analog paddle) SensitivitySensitivity of an analog paddle-psense
    (Analog paddle) AccelerationAcceleration of analog paddles when moving them fast-paccel
    (Analog paddle) Dejitter averagingStrength of paddle input averaging, suppresses paddle jitter.
    +
    (Analog paddle) Dejitter averagingStrength of paddle input averaging, suppresses paddle jitter
    Note: The 2600-daptor has built-in dejitter, so there should be no need to use Stella's dejitter.
    -dejitter.base
    (Analog paddle) Dejitter reactionStrength of paddle reaction to fast paddle movements, suppresses paddle jitter.-dejitter.diff
    (Analog paddle) Dejitter reactionStrength of paddle reaction to fast paddle movements, suppresses paddle jitter-dejitter.diff
    Digital paddle sensitivitySensitivity used when emulating a paddle using a digital device-dsense
    Autofire rateAutomatic trigger rate of the fire buttons in Hz-autofirerate
    Allow all 4 directions ...Allow all 4 joystick directions to be pressed simultaneously-joyallow4
    -<plr.|dev.>bankrandom <1|0>
    On reset, randomize the startup bank (only for selected bankswitch types).
    -<plr.|dev.>tiarandom <1|0>
    On reset, randomize the TIA registers.
    -<plr.|dev.>ramrandom <1|0>
    On reset, either randomize all RAM content, or initialize with zero (console = 2600)/startup values (console = 7800) instead.     - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4347,7 +4392,11 @@ - + + + + +
    ItemBrief descriptionFor more information,
    see Command Line
    Player/Developer settingsSelects the active settings set-dev.settings
    Console info overlayOverlay console info on the TIA image during emulation.-plr.stats
    -dev.stats
    Detected settings infoDisplay detected settings when a ROM is loaded.-plr.detectedinfo
    -dev.detectedinfo
    ConsoleSelect the console type, this affects Color/B&W/Pause key emulation and zero-page RAM initialization-plr.console
    -dev.console
    Random startup bankRandomize the startup bank (only for selected bankswitch types)-plr.bankrandom
    -dev.bankrandom
    Randomize zero-page ...When loading a ROM, randomize all RAM content instead of initializing with all zeroes (for 'Console' = 'Atari 2600' only)-plr.ramrandom
    -dev.ramrandom
    Randomize CPUWhen loading a ROM, randomize the content of the specified CPU registers-plr.cpurandom
    -dev.cpurandom
    Drive unused TIA pins ...Unused TIA pins are read random instead of the last databus values-dev.tiadriven
    ItemBrief descriptionFor more information,
    see Command Line
    Player/Developer settingsSelects the active settings set-dev.settings
    Console info overlayOverlay console info on the TIA image during emulation.-plr.stats
    -dev.stats
    Detected settings infoDisplay detected settings when a ROM is loaded.-plr.detectedinfo
    -dev.detectedinfo
    ConsoleSelect the console type, this affects Color/B&W/Pause key + emulation and zero-page RAM initialization-plr.console
    -dev.console
    Random startup bankRandomize the startup bank (only for selected bankswitch types)-plr.bankrandom
    -dev.bankrandom
    Randomize TIARandomizes TIA registers on the startup-plr.tiarandom
    -dev.tiarandom
    Randomize zero-page ...When loading a ROM, randomize all RAM content instead of + initializing with all zeroes (for 'Console' = 'Atari 2600' only)-plr.ramrandom
    -dev.ramrandom
    Randomize CPUWhen loading a ROM, randomize the content of the specified CPU registers-plr.cpurandom
    -dev.cpurandom
    Drive unused TIA pins ...Unused TIA pins are read random instead of the last databus values-dev.tiadriven
    Break on reads from ... A read from a write port interrupts emulation and the debugger is entered.Thumb ARM emulation throws an exception and enters the debugger on fatal errors -dev.thumb.trapfatal
    Display AtariVox...Display a message when the AtariVox/SaveKey EEPROM is read or written-plr.eepromaccess
    -dev.eepromaccess
    Display AtariVox...Display a message when the AtariVox/SaveKey EEPROM is read or written-plr.eepromaccess
    -dev.eepromaccess
    Randomize TIARandomizes TIA registers on the startupRandomize TIA registers when loading a ROM -plr.tiarandom
    -dev.tiarandom
    Decrease analog paddle accelerationDecrease analog paddle linearity Shift-Control-Alt + F2 Shift-Control-Cmd + F2
    Increase analog paddle accelerationIncrease analog paddle linearity Control-Alt + F2 Control-Cmd + F2
    Set the joystick axis dead zone area for analog joysticks/gamepads emulating digital controllers. All values within the dead zone are treated as zero-axis values, - while only those values outside are registered as valid input. + while only those values outside are registered as valid input.
    Dead zone is calculated as 3200 + value * 1000. So the possible dead zone values range from 3200 to 32200 (= 10% - 98%).
    -adeadzone <0 - 16500>
    -adeadzone <0 - 29>
    Set the joystick axis dead zone area for analog joysticks/gamepads - emulating analog controllers. All values within the - dead zone are treated as zero-axis values, while only those values - outside are registered as valid input. Range: 0% - 50%
    -psense <number>
    Sensitivity for emulation of paddles when using analog paddles. - Valid range of values is from 0 to 30, with larger numbers causing - faster movement.
    -psense <0 - 30>
    Sensitivity for emulation of paddles when using analog controllers. + Larger numbers are causing faster movement.
    -paccel <0 - 100>
    Acceleration of analog paddles while moving them fast.
    -plinear <25 - 100>
    Linearity of analog paddles. Lower numbers allow finer control + around the paddle center.
    Analog dead zone sizeDead zone area for axes on joysticks/gamepads emulating analog controllers -adeadzone
    (Analog paddle) SensitivitySensitivity of an analog paddle-psense
    (Analog paddle) AccelerationAcceleration of analog paddles when moving them fast-paccel
    (Analog paddle) SensitivitySensitivity of analog paddles-psense
    (Analog paddle) LinearityLinearity of analog paddles-plinear
    (Analog paddle) Dejitter averagingStrength of paddle input averaging, suppresses paddle jitter
    Note: The 2600-daptor has built-in dejitter, so there should be no need to use Stella's dejitter.
    -dejitter.base