Prohibit U+D/L+R at the core level in SGB

fixes #1308
This commit is contained in:
nattthebear 2020-05-14 19:51:19 -04:00
parent 5892059fc3
commit 68dc12dab7
1 changed files with 10 additions and 4 deletions

View File

@ -150,16 +150,22 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.Gameboy
b |= LibSameboy.Buttons.SELECT;
if (c.IsPressed($"P{i} Start"))
b |= LibSameboy.Buttons.START;
if (_sgb)
{
// The SGB SNES side code enforces U+D/L+R prohibitions
if (((uint)b & 0x30) == 0x30)
b &= unchecked((LibSameboy.Buttons)~0x30);
if (((uint)b & 0xc0) == 0xc0)
b &= unchecked((LibSameboy.Buttons)~0xc0);
}
if (i != 1)
{
b = (LibSameboy.Buttons)((uint)b << 8);
}
}
return b;
}
public new bool SaveRamModified => _core.HasSaveRam();
public new byte[] CloneSaveRam()