From 48e3cdfcdc55a13e00fb08b4d4f1ee54c3ed7576 Mon Sep 17 00:00:00 2001 From: alyosha-tas Date: Wed, 25 Jan 2017 20:35:50 -0500 Subject: [PATCH] NES: Minor code cleanup --- .../Consoles/Nintendo/NES/NES.Core.cs | 12 ++---------- .../Consoles/Nintendo/NES/PPU.regs.cs | 13 +------------ 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs index b039d40ce4..485557fea2 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs @@ -300,8 +300,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bool hardResetSignal; public void FrameAdvance(bool render, bool rendersound) { - - if (Tracer.Enabled) cpu.TraceCallback = (s) => Tracer.Put(s); else @@ -394,6 +392,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES public bool IRQ_delay; public bool special_case_delay; // very ugly but the only option public bool do_the_reread; + public byte DB; //old data bus values from previous reads + #if VS2012 [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -407,8 +407,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (cpu_step == 5) cpu_step = 0; cpu_stepcounter = 0; - - /////////////////////////// // OAM DMA start /////////////////////////// @@ -502,7 +500,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES special_case_delay = false; } - cpu.ExecuteOne(); apu.RunOne(false); @@ -521,8 +518,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES IRQ_delay = true; } - - ppu.ppu_open_bus_decay(0); Board.ClockCPU(); @@ -846,9 +841,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return ret; } - //old data bus values from previous reads - public byte DB; - public void ExecFetch(ushort addr) { MemoryCallbacks.CallExecutes(addr); diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.regs.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.regs.cs index e689787a21..155690b2c7 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.regs.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.regs.cs @@ -1,9 +1,4 @@ -//TODO - better sprite hit handling (be sure to test world runner) -//http://nesdev.parodius.com/bbs/viewtopic.php?t=626 - -//TODO - Reg2002_objoverflow is not working in the dummy reads test.. why are we setting it when nintendulator doesnt> - -//blargg: Reading from $2007 when the VRAM address is $3fxx will fill the internal read buffer with the contents at VRAM address $3fxx, in addition to reading the palette RAM. +//blargg: Reading from $2007 when the VRAM address is $3fxx will fill the internal read buffer with the contents at VRAM address $3fxx, in addition to reading the palette RAM. //static const byte powerUpPalette[] = //{ @@ -326,7 +321,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES vtoggle = false; VRAMBuffer = 0; } - //--------------------- //PPU CONTROL (write) void write_2000(byte value) @@ -336,10 +330,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //if we just unleashed the vblank interrupt then activate it now //if (ppudead != 1) NMI_PendingInstructions = 2; - - //NMI_PendingInstructions = 2; } - //reg_2000.Value = value; //if (ppudead != 1) reg_2000.Value = value; @@ -617,7 +608,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return ret; } - //-------- public byte ReadReg(int addr) { @@ -704,7 +694,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public void ppu_open_bus_decay(byte action) { // if there is no action, decrement the timer