From 94f6616e7454bdfa0cef8766f40ec36795c48357 Mon Sep 17 00:00:00 2001 From: CasualPokePlayer <50538166+CasualPokePlayer@users.noreply.github.com> Date: Mon, 25 Dec 2023 00:46:13 -0800 Subject: [PATCH] fix #1862, also rename front facing setting ("non-vi" makes no sense here) --- src/BizHawk.Client.EmuHawk/MainForm.Designer.cs | 2 +- src/BizHawk.Client.EmuHawk/MainForm.Events.cs | 10 +++++----- .../Consoles/Nintendo/N64/N64.IInputPollable.cs | 10 +++++----- .../Consoles/Nintendo/N64/N64.cs | 2 +- .../Consoles/Nintendo/N64/N64VideoProvider.cs | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/BizHawk.Client.EmuHawk/MainForm.Designer.cs b/src/BizHawk.Client.EmuHawk/MainForm.Designer.cs index 4cb850fd7d..30dbdf2042 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.Designer.cs @@ -1765,7 +1765,7 @@ namespace BizHawk.Client.EmuHawk // // MupenStyleLagMenuItem // - this.MupenStyleLagMenuItem.Text = "&Non-VI Lag Frames"; + this.MupenStyleLagMenuItem.Text = "&Mupen Style Lag Frames"; this.MupenStyleLagMenuItem.Click += new System.EventHandler(this.MupenStyleLagMenuItem_Click); // // N64ExpansionSlotMenuItem diff --git a/src/BizHawk.Client.EmuHawk/MainForm.Events.cs b/src/BizHawk.Client.EmuHawk/MainForm.Events.cs index 109a5357c7..867383a376 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.Events.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.Events.cs @@ -1818,7 +1818,7 @@ namespace BizHawk.Client.EmuHawk Config.N64UseCircularAnalogConstraint ^= true; } - private void Mupen64PlusSetNonVILagFrames(bool newValue, ISettingsAdapter settable) + private static void Mupen64PlusSetMupenStyleLag(bool newValue, ISettingsAdapter settable) { var s = (N64Settings) settable.GetSettings(); s.UseMupenStyleLag = newValue; @@ -1826,7 +1826,7 @@ namespace BizHawk.Client.EmuHawk } private void MupenStyleLagMenuItem_Click(object sender, EventArgs e) - => Mupen64PlusSetNonVILagFrames(!((ToolStripMenuItem) sender).Checked, GetSettingsAdapterForLoadedCore()); + => Mupen64PlusSetMupenStyleLag(!((ToolStripMenuItem) sender).Checked, GetSettingsAdapterForLoadedCore()); private void Mupen64PlusSetUseExpansionSlot(bool newValue, ISettingsAdapter settable) { @@ -2842,9 +2842,9 @@ namespace BizHawk.Client.EmuHawk var mupen64PlusGraphicsSettingsItem = CreateSettingsItem("Video Plugins...", N64PluginSettingsMenuItem_Click); var mupen64PlusGamepadSettingsItem = CreateSettingsItem("Controller Settings...", (_, _) => OpenMupen64PlusGamepadSettingsDialog(GetSettingsAdapterFor())); var mupen64PlusAnalogConstraintItem = CreateSettingsItem("Circular Analog Range", N64CircularAnalogRangeMenuItem_Click); - var mupen64PlusNonVILagFramesItem = CreateSettingsItem("Non-VI Lag Frames", (sender, _) => Mupen64PlusSetNonVILagFrames(!((ToolStripMenuItem) sender).Checked, GetSettingsAdapterFor())); + var mupen64PlusMupenStyleLagFramesItem = CreateSettingsItem("Mupen Style Lag Frames", (sender, _) => Mupen64PlusSetMupenStyleLag(!((ToolStripMenuItem) sender).Checked, GetSettingsAdapterFor())); var mupen64PlusUseExpansionSlotItem = CreateSettingsItem("Use Expansion Slot", (sender, _) => Mupen64PlusSetUseExpansionSlot(!((ToolStripMenuItem) sender).Checked, GetSettingsAdapterFor())); - var mupen64PlusSubmenu = CreateCoreSubmenu(VSystemCategory.Consoles, CoreNames.Mupen64Plus, mupen64PlusGraphicsSettingsItem, mupen64PlusGamepadSettingsItem, mupen64PlusAnalogConstraintItem, mupen64PlusNonVILagFramesItem, mupen64PlusUseExpansionSlotItem); + var mupen64PlusSubmenu = CreateCoreSubmenu(VSystemCategory.Consoles, CoreNames.Mupen64Plus, mupen64PlusGraphicsSettingsItem, mupen64PlusGamepadSettingsItem, mupen64PlusAnalogConstraintItem, mupen64PlusMupenStyleLagFramesItem, mupen64PlusUseExpansionSlotItem); mupen64PlusSubmenu.DropDownOpened += (_, _) => { var settable = GetSettingsAdapterFor(); @@ -2855,7 +2855,7 @@ namespace BizHawk.Client.EmuHawk mupen64PlusGraphicsSettingsItem.Enabled = !loadedCoreIsMupen64Plus || !isMovieActive; mupen64PlusGamepadSettingsItem.Enabled = !loadedCoreIsMupen64Plus || !isMovieActive; mupen64PlusAnalogConstraintItem.Checked = Config.N64UseCircularAnalogConstraint; - mupen64PlusNonVILagFramesItem.Checked = s.UseMupenStyleLag; + mupen64PlusMupenStyleLagFramesItem.Checked = s.UseMupenStyleLag; if (loadedCoreIsMupen64Plus) { mupen64PlusUseExpansionSlotItem.Checked = mupen64Plus.UsingExpansionSlot; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.IInputPollable.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.IInputPollable.cs index 61fb4c3080..e9361e5934 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.IInputPollable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.IInputPollable.cs @@ -13,7 +13,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 { if (_settings.UseMupenStyleLag) { - return !IsVIFrame; + return !FrameFinished; } return !_inputProvider.LastFrameInputPolled; @@ -23,7 +23,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 { if (_settings.UseMupenStyleLag) { - IsVIFrame = !value; + FrameFinished = !value; } else { @@ -32,10 +32,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 } } - public bool IsVIFrame + public bool FrameFinished { - get => _videoProvider.IsVIFrame; - internal set => _videoProvider.IsVIFrame = value; + get => _videoProvider.FrameFinished; + internal set => _videoProvider.FrameFinished = value; } // TODO: optimize managed to unmanaged using the ActiveChanged event diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs index 1f2974cafd..0f3093fded 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs @@ -221,7 +221,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 { _inputProvider.Controller = controller; - IsVIFrame = false; + FrameFinished = false; api.setTraceCallback(Tracer?.IsEnabled() is true ? _tracecb : null); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64VideoProvider.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64VideoProvider.cs index bd9dc75aa4..1dfb4aea56 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64VideoProvider.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64VideoProvider.cs @@ -10,7 +10,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 private mupen64plusVideoApi api; private readonly mupen64plusApi coreAPI; - public bool IsVIFrame; + public bool FrameFinished; /// /// Creates N64 Video system with mupen64plus backend @@ -29,7 +29,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 coreAPI = core; coreAPI.BeforeRender += DoVideoFrame; - coreAPI.BeforeRender += () => { IsVIFrame = true; }; + coreAPI.FrameFinished += () => { FrameFinished = true; }; } public int[] GetVideoBuffer() => frameBuffer;