From 93bc50288f30d3d093ae3dba98aa2c44ce0b6fe7 Mon Sep 17 00:00:00 2001 From: feos Date: Wed, 9 Apr 2025 19:37:31 +0300 Subject: [PATCH] dsda: fix horizontal mouse range the core uses 2 bytes, but if we use that range then raw mouse input is automatically recalibrated somehow and sends values multiplied by 272. that way maximum actual value is 120 (after dividing the range cap by 272), which is even more limiting than shorttics. and min value is 272 itself, which is not very useful if we have to divide it, because we need it to be 1! the range of [-180, 180] is somehow the highest range that still gives minimal movement of 1, while providing maximum room for bigger movement. --- .../Computers/Doom/DSDA.IEmulator.cs | 5 ----- .../Computers/Doom/DSDAControllers.cs | 9 ++++++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IEmulator.cs b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IEmulator.cs index ad02c62fb1..0c6f2b710f 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IEmulator.cs @@ -95,11 +95,6 @@ namespace BizHawk.Emulation.Cores.Computers.Doom // mouse-driven turning var mouseTurning = axisReaders[i](controller, (int)AxisType.MouseTurning) * _syncSettings.MouseTurnSensitivity; - if (_syncSettings.TurningResolution == TurningResolution.Longtics) - { - // divider recalibrates minimal mouse movement to be 1 (requires global setting) - mouseTurning = (int)(mouseTurning / 272.0); - } if (strafe) { players[i].StrafingSpeed += mouseTurning / 5; diff --git a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDAControllers.cs b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDAControllers.cs index e4a554f18d..70410e3149 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDAControllers.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDAControllers.cs @@ -42,14 +42,17 @@ namespace BizHawk.Emulation.Cores.Computers.Doom Definition = new ControllerDefinition("Doom Input Format") { BoolButtons = _baseDefinition - .Select(b => $"P{PortNum} " + b) - .ToList() + .Select(b => $"P{PortNum} " + b) + .ToList() }.AddAxis($"P{PortNum} Run Speed", (-50).RangeTo(50), 0) .AddAxis($"P{PortNum} Strafing Speed", (-50).RangeTo(50), 0) .AddAxis($"P{PortNum} Turning Speed", (-128).RangeTo(127), 0) .AddAxis($"P{PortNum} Weapon Select", (0).RangeTo(7), 0) .AddAxis($"P{PortNum} Mouse Running", (-128).RangeTo(127), 0) - .AddAxis($"P{PortNum} Mouse Turning", (longtics ? -32768 : -128).RangeTo(longtics ? 32767 : 127), 0) + // max raw mouse delta seems to be 180 + // higher range results in higher minimal movement value (above 1) + // which then has to be divided to get a usable value + .AddAxis($"P{PortNum} Mouse Turning", (longtics ? -180 : -128).RangeTo(longtics ? 180 : 127), 0) .MakeImmutable(); }