Make SNES layer hotkeys work for new BSNES

This commit is contained in:
YoshiRulz 2025-01-11 01:55:29 +10:00
parent 28264c6dee
commit 967ae76dfd
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 15 additions and 1 deletions

View File

@ -859,7 +859,7 @@ namespace BizHawk.Client.EmuHawk
{
if (layer is < 1 or > 4) return; // should this throw?
bool result = false;
if (Emulator is LibsnesCore bsnes)
if (Emulator is BsnesCore bsnes)
{
var s = bsnes.GetSettings();
result = layer switch
@ -873,6 +873,20 @@ namespace BizHawk.Client.EmuHawk
bsnes.PutSettings(s);
AddOnScreenMessage($"Obj {layer} Layer {(result ? "On" : "Off")}");
}
else if (Emulator is LibsnesCore bsnes1)
{
var s = bsnes1.GetSettings();
result = layer switch
{
1 => s.ShowOBJ_0 = !s.ShowOBJ_0,
2 => s.ShowOBJ_1 = !s.ShowOBJ_1,
3 => s.ShowOBJ_2 = !s.ShowOBJ_2,
4 => s.ShowOBJ_3 = !s.ShowOBJ_3,
_ => result,
};
bsnes1.PutSettings(s);
AddOnScreenMessage($"Obj {layer} Layer {(result ? "On" : "Off")}");
}
else if (Emulator is Snes9x snes9X)
{
var s = snes9X.GetSettings();