From 0f39ddd85e2c9ce10a6332cc45f767b3d220d1de Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Tue, 7 Sep 2021 11:39:33 +0200 Subject: [PATCH] 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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;*Jwae!f zO{+#rQwBa1`nB7apmG(w&T-%Q+ja)IBURIXA9AhTNy_4!k~Z8%S4<9ooY5&8zDMgKl zcj2u2WbMaP%H+EQDXW%?89KW7z+(f2C~=(X2{!m=(xk?37^e^V8ctgY5$H-Tsbq-( zp~N(b@AY8btj-(wg3?w*Tj|xodLKD|vOcG_;KiR0^M!O>KGG2a+hSRUf(ksfyii!? z?K}x!+(fPa-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"
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