From 9bc5d74c674b4886f3d0fcadedc2c7114c1e17f0 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 29 Mar 2020 11:44:41 -0500 Subject: [PATCH] DS - add hotkey to toggle video screen options --- BizHawk.Client.Common/config/Binding.cs | 2 ++ BizHawk.Client.EmuHawk/MainForm.Hotkey.cs | 23 ++++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/BizHawk.Client.Common/config/Binding.cs b/BizHawk.Client.Common/config/Binding.cs index c999bb9e3a..3def99d103 100644 --- a/BizHawk.Client.Common/config/Binding.cs +++ b/BizHawk.Client.Common/config/Binding.cs @@ -256,6 +256,8 @@ namespace BizHawk.Client.Common Bind("Analog", "X Down Large", toolTip: "For Virtual Pad"), Bind("Tools", "Toggle All Cheats"), + + Bind("DS", "Toggle View") }; // set ordinals based on order in list diff --git a/BizHawk.Client.EmuHawk/MainForm.Hotkey.cs b/BizHawk.Client.EmuHawk/MainForm.Hotkey.cs index 045c049fcc..b452f4480b 100644 --- a/BizHawk.Client.EmuHawk/MainForm.Hotkey.cs +++ b/BizHawk.Client.EmuHawk/MainForm.Hotkey.cs @@ -1,7 +1,9 @@ -using System.Linq; +using System; +using System.Linq; using BizHawk.Common; using BizHawk.Emulation.Common; +using BizHawk.Emulation.Cores.Consoles.Nintendo.NDS; using BizHawk.Emulation.Cores.Nintendo.Gameboy; namespace BizHawk.Client.EmuHawk @@ -752,6 +754,25 @@ namespace BizHawk.Client.EmuHawk case "X Down Large": Tools.VirtualPad.BumpAnalogValue(-Config.AnalogLargeChange, null); break; + + // DS + case "Toggle View": + if (Emulator is MelonDS ds) + { + var settings = ds.GetSettings(); + var num = (int)settings.ScreenOptions; + num++; + var next = (MelonDS.VideoScreenOptions)Enum.Parse(typeof(MelonDS.VideoScreenOptions), num.ToString()); + if (!typeof(MelonDS.VideoScreenOptions).IsEnumDefined(next)) + { + next = default; + } + + settings.ScreenOptions = next; + ds.PutSettings(settings); + } + + break; } return true;