From ffb8666a8fd8e94a3dbe0d5248c5b758ca2dad97 Mon Sep 17 00:00:00 2001 From: zeromus Date: Fri, 7 Jun 2024 00:24:55 -0400 Subject: [PATCH] winport - plumb S9X_JOY_NEUTRAL through inifile: [Controls] DigitalizationThreshold=50 --- desmume/src/frontend/windows/inputdx.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/desmume/src/frontend/windows/inputdx.cpp b/desmume/src/frontend/windows/inputdx.cpp index feb00300c..b3db20f51 100644 --- a/desmume/src/frontend/windows/inputdx.cpp +++ b/desmume/src/frontend/windows/inputdx.cpp @@ -51,6 +51,13 @@ #include "main.h" #include "winutil.h" + //60 is a poor choice for a threshold; the theoretical maximum you can get even at an exact 45 degree angle is 70 + //Sloshy sticks or slightly-off angles make it impossible to reach 60, as it's far too close to 70. + //Too-small values feel bad, too + //50 is a more normal choice + //#define S9X_JOY_NEUTRAL 60 +int S9X_JOY_NEUTRAL = 50; + // Gamepad Dialog Strings // Support Unicode display //#define INPUTCONFIG_TITLE "Input Configuration" @@ -520,6 +527,9 @@ BOOL di_init() { HWND hParentWnd = MainWindow->getHWnd(); + S9X_JOY_NEUTRAL = GetPrivateProfileInt("Controls", "DigitalizationThreshold", S9X_JOY_NEUTRAL, IniName); + + pDI = NULL; memset(cDIBuf, 0, sizeof(cDIBuf)); @@ -669,14 +679,6 @@ int FunkyNormalize(int cur, int min, int max) return Result; } - -//60 is a poor choice for a threshold; the theoretical maximum you can get even at an exact 45 degree angle is 70 -//Sloshy sticks or slightly-off angles make it impossible to reach 60, as it's far too close to 70. -//Too-small values feel bad, too -//50 is a more normal choice -//#define S9X_JOY_NEUTRAL 60 -#define S9X_JOY_NEUTRAL 50 - void CheckAxis (short joy, short control, int val, int min, int max, bool &first, bool &second)