From 9aee377d660da49ddf373ca02ac7c5b5cb180e18 Mon Sep 17 00:00:00 2001 From: alyosha-tas Date: Tue, 10 Jan 2017 10:39:15 -0500 Subject: [PATCH] NES DCM glitch cleanup -Implemenet for player 2 -make sure only happens on NTSC --- .../Consoles/Nintendo/NES/NES.Core.cs | 35 +++++++++++-------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs index 07baffad05..45a7816128 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs @@ -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);