From 836415455ab109e6278c95f0bffe72f2e1979ee9 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 14 Apr 2012 13:51:26 +0000 Subject: [PATCH] NES - start an APU softreset function, and clear sequencer_irq, and 0x4015. Still a lot of work to be done for this, but passes nes apu reset tests: 4015_cleared, irq_flag_cleared --- BizHawk.Emulation/Consoles/Nintendo/NES/APU.cs | 8 +++++++- BizHawk.Emulation/Consoles/Nintendo/NES/Core.cs | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/BizHawk.Emulation/Consoles/Nintendo/NES/APU.cs b/BizHawk.Emulation/Consoles/Nintendo/NES/APU.cs index e517535364..c30e082cfe 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/NES/APU.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/NES/APU.cs @@ -87,7 +87,6 @@ namespace BizHawk.Emulation.Consoles.Nintendo public bool IsLenCntNonZero() { return len_cnt > 0; } - public void WriteReg(int addr, byte val) { //Console.WriteLine("write pulse {0:X} {1:X}", addr, val); @@ -822,6 +821,13 @@ namespace BizHawk.Emulation.Consoles.Nintendo noise.clock_env(); } + public void NESSoftReset() + { + //need to study what happens to apu and stuff.. + sequencer_irq = false; + _WriteReg(0x4015, 0); + } + public void WriteReg(int addr, byte val) { pending_reg = addr; diff --git a/BizHawk.Emulation/Consoles/Nintendo/NES/Core.cs b/BizHawk.Emulation/Consoles/Nintendo/NES/Core.cs index 436f654044..aac3bb8b2a 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/NES/Core.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/NES/Core.cs @@ -73,6 +73,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo if (resetSignal) { cpu.NESSoftReset(); + apu.NESSoftReset(); //need to study what happens to ppu and apu and stuff.. }