From c94d5aa9b8dc079fe708ffaeb2d66aad6ef8b7a0 Mon Sep 17 00:00:00 2001 From: goyuken Date: Mon, 24 Sep 2012 14:48:00 +0000 Subject: [PATCH] i implemented dwedit's DMC fix as best as i could understand it. 'Fire Hawk (USA) (Unl).nes' no longer has graphical glitches on the intro screen. audio still sounds wrong, and crash still occurs once you get in game --- BizHawk.Emulation/Consoles/Nintendo/NES/APU.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/BizHawk.Emulation/Consoles/Nintendo/NES/APU.cs b/BizHawk.Emulation/Consoles/Nintendo/NES/APU.cs index fdc867abbd..de44f52dcf 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/NES/APU.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/NES/APU.cs @@ -659,6 +659,11 @@ namespace BizHawk.Emulation.Consoles.Nintendo sample_address = user_address; sample_length = user_length; out_deltacounter = 64; + if (out_silence) // if the DMC buffer was empty... + { + timer = 0; // reset frequency counter so next Run() will cause output + out_bits_remaining = 0; // reset buffercount so next Run() will cause fetch + } } } //irq is acknowledged or sure to be clear, in either case @@ -730,7 +735,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo ser.Sync("sequence_reset_pending", ref sequence_reset_pending); ser.Sync("sequencer_irq_clear_pending", ref sequencer_irq_clear_pending); ser.Sync("sequencer_irq_assert", ref sequencer_irq_assert); - + pulse[0].SyncState(ser); pulse[1].SyncState(ser); triangle.SyncState(ser);