DS - add hotkey to toggle video screen options

This commit is contained in:
adelikat 2020-03-29 11:44:41 -05:00
parent b039b1f823
commit 9bc5d74c67
2 changed files with 24 additions and 1 deletions

View File

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

View File

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