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.
This commit is contained in:
feos 2025-04-09 19:37:31 +03:00
parent 0f0d84489f
commit 93bc50288f
2 changed files with 6 additions and 8 deletions

View File

@ -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;

View File

@ -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();
}