diff --git a/Assets/dll/melonDS.wbx.zst b/Assets/dll/melonDS.wbx.zst index 3576676b02d..aa442b44963 100644 Binary files a/Assets/dll/melonDS.wbx.zst and b/Assets/dll/melonDS.wbx.zst differ diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/LibMelonDS.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/LibMelonDS.cs index 0f8d76e0c5c..0961d43d337 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/LibMelonDS.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/LibMelonDS.cs @@ -37,6 +37,7 @@ public enum Buttons : uint public byte MicVolume; public byte GBALightSensor; public byte ConsiderAltLag; + public byte UseTouchInterpolation; } [StructLayout(LayoutKind.Sequential)] diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.ISettable.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.ISettable.cs index 563ec856c21..e4ec3d2f5c6 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.ISettable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.ISettable.cs @@ -225,6 +225,11 @@ public DateTime InitialTime [DefaultValue(true)] public bool UseRealTime { get; set; } + [DisplayName("Touch Interpolation")] + [Description("If true, touch inputs will be interpolated, creating smoother touch movements. Required to progress in some games. May be undesirable when TASing.")] + [DefaultValue(true)] + public bool UseTouchInterpolation { get; set; } + [DisplayName("DSi Mode")] [Description("If true, DSi mode will be used. Forced true if a DSiWare rom is detected.")] [DefaultValue(false)] diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs index a5106563a58..a7b177d0aff 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs @@ -503,6 +503,7 @@ protected override LibWaterboxCore.FrameInfo FrameAdvancePrep(IController contro MicVolume = (byte)(controller.IsPressed("Microphone") ? controller.AxisValue("Mic Volume") : 0), GBALightSensor = (byte)controller.AxisValue("GBA Light Sensor"), ConsiderAltLag = (byte)(_settings.ConsiderAltLag ? 1 : 0), + UseTouchInterpolation = (byte)(_activeSyncSettings.UseTouchInterpolation ? 1 : 0), }; } diff --git a/waterbox/melon/BizInterface.cpp b/waterbox/melon/BizInterface.cpp index 5bfc4895ca1..77b00b2b6f3 100644 --- a/waterbox/melon/BizInterface.cpp +++ b/waterbox/melon/BizInterface.cpp @@ -44,6 +44,7 @@ struct MyFrameInfo : public FrameInfo u8 MicVolume; u8 GBALightSensor; bool ConsiderAltLag; + bool UseTouchInterpolation; }; static s16 biz_mic_input[735]; @@ -71,8 +72,15 @@ ECL_EXPORT void FrameAdvance(MyFrameInfo* f) if (f->Keys & 0x1000) { - // move touch coords incrementally to our new touch point - f->NDS->MoveTouch(f->TouchX, f->TouchY); + if (f->UseTouchInterpolation) + { + // move touch coords incrementally to our new touch point + f->NDS->MoveTouch(f->TouchX, f->TouchY); + } + else + { + f->NDS->TouchScreen(f->TouchX, f->TouchY); + } } else { @@ -113,8 +121,11 @@ ECL_EXPORT void FrameAdvance(MyFrameInfo* f) if (f->Keys & 0x1000) { - // finalize touch after emulation finishes - f->NDS->TouchScreen(f->TouchX, f->TouchY); + if (f->UseTouchInterpolation) + { + // finalize touch after emulation finishes + f->NDS->TouchScreen(f->TouchX, f->TouchY); + } } auto& renderer3d = f->NDS->GetRenderer3D();