From cde108b92871183dac01058f0c6aeee468a648ae Mon Sep 17 00:00:00 2001 From: feos Date: Wed, 26 Feb 2025 23:37:23 +0300 Subject: [PATCH] dsda: mouse movement should be accurate now (barring obscure tweaks) demos still sync btw horizontal mouse was calibrated for my machine, dunno about others. for me 1-pixel relative movement results in 272-pixel deltas, so I divide it inside the core for now when the global sensitivity option is there, I'll drop sensitivity syncsettings and rely on client ones that I'll configure to match default dsda sensitivity. --- .../Computers/Doom/DSDA.IEmulator.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IEmulator.cs b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IEmulator.cs index e9a5103aa0..f1621fd6ef 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IEmulator.cs @@ -78,15 +78,17 @@ namespace BizHawk.Emulation.Cores.Computers.Doom if (controller.IsPressed($"P{i + 1} Turn Left")) players[i]._TurningSpeed = turnSpeed; // mouse-driven running - players[i]._RunSpeed -= (int)(potReaders[i](controller, 4) * _syncSettings.MouseRunSensitivity / 6.0); + // divider matches the core + players[i]._RunSpeed -= (int)(potReaders[i](controller, 4) * _syncSettings.MouseRunSensitivity / 8.0); players[i]._RunSpeed = players[i]._RunSpeed.Clamp(-_runSpeeds[1], _runSpeeds[1]); // mouse-driven turning - players[i]._TurningSpeed -= potReaders[i](controller, 5) * _syncSettings.MouseTurnSensitivity; - // todo: check how the core calculates these - if (_syncSettings.TurningResolution == TurningResolution.Longtics) + // divider recalibrates minimal mouse movement to be 1 (requires global setting) + players[i]._TurningSpeed -= (int)(potReaders[i](controller, 5) * _syncSettings.MouseTurnSensitivity / 272.0); + if (_syncSettings.TurningResolution == TurningResolution.Shorttics) { - players[i]._TurningSpeed = (int) (players[i]._TurningSpeed / 256.0); + // calc matches the core + players[i]._TurningSpeed = ((players[i]._TurningSpeed << 8) + 128) >> 8; } // bool buttons