From 9ad6eb8971f533fc73e3f8cd6641b06794379871 Mon Sep 17 00:00:00 2001 From: feos Date: Sun, 23 Feb 2025 14:01:56 +0300 Subject: [PATCH] dsda: turnheld wip dsda halves turn speed for turn button if it's held for 5 or less frames. currently I use that reduced value for all button turning. --- .../Computers/Doom/DSDA.IStatable.cs | 24 +++++++------------ .../Computers/Doom/DSDA.cs | 15 +----------- 2 files changed, 9 insertions(+), 30 deletions(-) diff --git a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IStatable.cs b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IStatable.cs index 6685ab46a7..382c3b2220 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IStatable.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IStatable.cs @@ -13,14 +13,10 @@ namespace BizHawk.Emulation.Cores.Computers.Doom _elf.LoadStateBinary(reader); // Getting last mouse positions - _lastMouseRunningValues[0] = reader.ReadInt32(); - _lastMouseTurningValues[0] = reader.ReadInt32(); - _lastMouseRunningValues[1] = reader.ReadInt32(); - _lastMouseTurningValues[1] = reader.ReadInt32(); - _lastMouseRunningValues[2] = reader.ReadInt32(); - _lastMouseTurningValues[2] = reader.ReadInt32(); - _lastMouseRunningValues[3] = reader.ReadInt32(); - _lastMouseTurningValues[3] = reader.ReadInt32(); + _turnHeld[0] = reader.ReadInt32(); + _turnHeld[1] = reader.ReadInt32(); + _turnHeld[2] = reader.ReadInt32(); + _turnHeld[3] = reader.ReadInt32(); Frame = reader.ReadInt32(); // any managed pointers that we sent to the core need to be resent now! @@ -33,14 +29,10 @@ namespace BizHawk.Emulation.Cores.Computers.Doom _elf.SaveStateBinary(writer); // Writing last mouse positions - writer.Write(_lastMouseRunningValues[0]); - writer.Write(_lastMouseTurningValues[0]); - writer.Write(_lastMouseRunningValues[1]); - writer.Write(_lastMouseTurningValues[1]); - writer.Write(_lastMouseRunningValues[2]); - writer.Write(_lastMouseTurningValues[2]); - writer.Write(_lastMouseRunningValues[3]); - writer.Write(_lastMouseTurningValues[3]); + writer.Write(_turnHeld[0]); + writer.Write(_turnHeld[1]); + writer.Write(_turnHeld[2]); + writer.Write(_turnHeld[3]); writer.Write(Frame); } diff --git a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.cs b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.cs index 142181c4cd..27499b7c2a 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.cs @@ -156,20 +156,7 @@ namespace BizHawk.Emulation.Cores.Computers.Doom } } - // Remembering mouse position - private const int MOUSE_NO_INPUT = -65535; - private int[] _lastMouseRunningValues = [ - MOUSE_NO_INPUT, - MOUSE_NO_INPUT, - MOUSE_NO_INPUT, - MOUSE_NO_INPUT - ]; - private int[] _lastMouseTurningValues = [ - MOUSE_NO_INPUT, - MOUSE_NO_INPUT, - MOUSE_NO_INPUT, - MOUSE_NO_INPUT - ]; + private int[] _turnHeld = [ 0, 0, 0, 0 ]; private List _args; // IRegionable