NES DCM glitch cleanup

-Implemenet for player 2
-make sure only happens on NTSC
This commit is contained in:
alyosha-tas 2017-01-10 10:39:15 -05:00 committed by GitHub
parent ab1a22bf31
commit 9aee377d66
1 changed files with 21 additions and 14 deletions

View File

@ -576,8 +576,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
{
// special hardware glitch case
ret_spec = read_joyport(addr);
if (do_the_reread)
if (do_the_reread && ppu.region==PPU.Region.NTSC)
{
Console.WriteLine("collision 1");
ret_spec = read_joyport(addr);
do_the_reread = false;
}
@ -585,22 +586,28 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
}
case 0x4017:
if (_isVS)
{
if (_isVS)
byte ret = 0;
ret = read_joyport(0x4017);
ret &= 1;
ret = (byte)(ret | (VS_dips[2] << 2) | (VS_dips[3] << 3) | (VS_dips[4] << 4) | (VS_dips[5] << 5) | (VS_dips[6] << 6) | (VS_dips[7] << 7));
return ret;
}
else
{
// special hardware glitch case
ret_spec = read_joyport(addr);
if (do_the_reread && ppu.region == PPU.Region.NTSC)
{
byte ret = 0;
ret = read_joyport(0x4017);
ret &= 1;
ret = (byte)(ret | (VS_dips[2] << 2) | (VS_dips[3] << 3) | (VS_dips[4] << 4) | (VS_dips[5] << 5) | (VS_dips[6] << 6) | (VS_dips[7] << 7));
return ret;
}
else
{
return read_joyport(addr);
Console.WriteLine("collision 2");
ret_spec = read_joyport(addr);
do_the_reread = false;
}
return ret_spec;
}
default:
//Console.WriteLine("read register: {0:x4}", addr);