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
This commit is contained in:
feos 2025-02-23 13:01:12 +03:00
parent d804496cc2
commit 49297ca9b7
2 changed files with 13 additions and 25 deletions

View File

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

View File

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