From 49297ca9b7334910048af4090f4a36c92befe030 Mon Sep 17 00:00:00 2001 From: feos Date: Sun, 23 Feb 2025 13:01:12 +0300 Subject: [PATCH] dsda: use actual relative mouse movement currently requires manually binding RMouse X/Y in config.ini (and zero deadzone I guess) empirically match dsda default settings with sensitivity syncsettings (defctrl.json wasn't touched yet) TODO: look at mouse calc inside the core --- .../Computers/Doom/DSDA.IEmulator.cs | 24 +++++-------------- .../Computers/Doom/DSDA.ISettable.cs | 14 +++++------ 2 files changed, 13 insertions(+), 25 deletions(-) diff --git a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IEmulator.cs b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IEmulator.cs index be26a8a1d2..23bebc570c 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IEmulator.cs @@ -58,28 +58,16 @@ namespace BizHawk.Emulation.Cores.Computers.Doom players[i]._AltWeapon = (actionsBitfield & 0b00100) >> 2; // Handling mouse-driven running - int mouseRunningSpeed = potReaders[i](controller, 4); - if (_lastMouseRunningValues[i] > MOUSE_NO_INPUT) - { - int mouseRunningDelta = _lastMouseRunningValues[i] - mouseRunningSpeed; - players[i]._RunSpeed += mouseRunningDelta * _syncSettings.MouseRunSensitivity; - if (players[i]._RunSpeed > 50) players[i]._RunSpeed = 50; - if (players[i]._RunSpeed < -50) players[i]._RunSpeed = -50; - } - _lastMouseRunningValues[i] = mouseRunningSpeed; + players[i]._RunSpeed -= (int)((float)potReaders[i](controller, 4) * (float)_syncSettings.MouseRunSensitivity / 6.0); + if (players[i]._RunSpeed > 50) players[i]._RunSpeed = 50; + if (players[i]._RunSpeed < -50) players[i]._RunSpeed = -50; // Handling mouse-driven turning - int mouseTurningSpeed = potReaders[i](controller, 5); - if (_lastMouseTurningValues[i] > MOUSE_NO_INPUT) + players[i]._TurningSpeed -= (int)((float)potReaders[i](controller, 5) * (float)_syncSettings.MouseTurnSensitivity / 300.0); + if (_syncSettings.TurningResolution == TurningResolution.Shorttics) { - int mouseTurningDelta = _lastMouseTurningValues[i] - mouseTurningSpeed; - players[i]._TurningSpeed += mouseTurningDelta * _syncSettings.MouseTurnSensitivity; - if (_syncSettings.TurningResolution == TurningResolution.Shorttics) - { - players[i]._TurningSpeed >>= 8; - } + players[i]._TurningSpeed >>= 8; } - _lastMouseTurningValues[i] = mouseTurningSpeed; // Raven Games if (_syncSettings.InputFormat is DoomControllerTypes.Heretic or DoomControllerTypes.Hexen) diff --git a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.ISettable.cs b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.ISettable.cs index d7316bb3d2..84bd1c2847 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.ISettable.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.ISettable.cs @@ -279,16 +279,16 @@ namespace BizHawk.Emulation.Cores.Computers.Doom [DefaultValue(false)] public bool PreventGameEnd { get; set; } - [DisplayName("Mouse Running Sensitivity")] - [Description("How fast the Doom player will run when using the mouse")] + [DisplayName("Mouse Horizontal Sensitivity")] + [Description("How fast the Doom player will turn when using the mouse.")] [DefaultValue(10)] - public int MouseRunSensitivity { get; set; } - - [DisplayName("Mouse Turning Sensitivity")] - [Description("How fast the Doom player will turn when using the mouse")] - [DefaultValue(1)] public int MouseTurnSensitivity { get; set; } + [DisplayName("Mouse Vertical Sensitivity")] + [Description("How fast the Doom player will run when using the mouse.")] + [DefaultValue(1)] + public int MouseRunSensitivity { get; set; } + public CInterface.InitSettings GetNativeSettings(GameInfo game) { return new CInterface.InitSettings