NES: Minor code cleanup
This commit is contained in:
parent
647f0914ed
commit
48e3cdfcdc
|
@ -300,8 +300,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
bool hardResetSignal;
|
bool hardResetSignal;
|
||||||
public void FrameAdvance(bool render, bool rendersound)
|
public void FrameAdvance(bool render, bool rendersound)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
if (Tracer.Enabled)
|
if (Tracer.Enabled)
|
||||||
cpu.TraceCallback = (s) => Tracer.Put(s);
|
cpu.TraceCallback = (s) => Tracer.Put(s);
|
||||||
else
|
else
|
||||||
|
@ -394,6 +392,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
public bool IRQ_delay;
|
public bool IRQ_delay;
|
||||||
public bool special_case_delay; // very ugly but the only option
|
public bool special_case_delay; // very ugly but the only option
|
||||||
public bool do_the_reread;
|
public bool do_the_reread;
|
||||||
|
public byte DB; //old data bus values from previous reads
|
||||||
|
|
||||||
|
|
||||||
#if VS2012
|
#if VS2012
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
|
@ -407,8 +407,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
if (cpu_step == 5) cpu_step = 0;
|
if (cpu_step == 5) cpu_step = 0;
|
||||||
cpu_stepcounter = 0;
|
cpu_stepcounter = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////
|
///////////////////////////
|
||||||
// OAM DMA start
|
// OAM DMA start
|
||||||
///////////////////////////
|
///////////////////////////
|
||||||
|
@ -502,7 +500,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
special_case_delay = false;
|
special_case_delay = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
cpu.ExecuteOne();
|
cpu.ExecuteOne();
|
||||||
apu.RunOne(false);
|
apu.RunOne(false);
|
||||||
|
|
||||||
|
@ -521,8 +518,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
IRQ_delay = true;
|
IRQ_delay = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ppu.ppu_open_bus_decay(0);
|
ppu.ppu_open_bus_decay(0);
|
||||||
|
|
||||||
Board.ClockCPU();
|
Board.ClockCPU();
|
||||||
|
@ -846,9 +841,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
//old data bus values from previous reads
|
|
||||||
public byte DB;
|
|
||||||
|
|
||||||
public void ExecFetch(ushort addr)
|
public void ExecFetch(ushort addr)
|
||||||
{
|
{
|
||||||
MemoryCallbacks.CallExecutes(addr);
|
MemoryCallbacks.CallExecutes(addr);
|
||||||
|
|
|
@ -1,9 +1,4 @@
|
||||||
//TODO - better sprite hit handling (be sure to test world runner)
|
//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.
|
||||||
//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.
|
|
||||||
|
|
||||||
//static const byte powerUpPalette[] =
|
//static const byte powerUpPalette[] =
|
||||||
//{
|
//{
|
||||||
|
@ -326,7 +321,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
vtoggle = false;
|
vtoggle = false;
|
||||||
VRAMBuffer = 0;
|
VRAMBuffer = 0;
|
||||||
}
|
}
|
||||||
//---------------------
|
|
||||||
|
|
||||||
//PPU CONTROL (write)
|
//PPU CONTROL (write)
|
||||||
void write_2000(byte value)
|
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 we just unleashed the vblank interrupt then activate it now
|
||||||
//if (ppudead != 1)
|
//if (ppudead != 1)
|
||||||
NMI_PendingInstructions = 2;
|
NMI_PendingInstructions = 2;
|
||||||
|
|
||||||
//NMI_PendingInstructions = 2;
|
|
||||||
}
|
}
|
||||||
//reg_2000.Value = value;
|
|
||||||
//if (ppudead != 1)
|
//if (ppudead != 1)
|
||||||
reg_2000.Value = value;
|
reg_2000.Value = value;
|
||||||
|
|
||||||
|
@ -617,7 +608,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
//--------
|
|
||||||
|
|
||||||
public byte ReadReg(int addr)
|
public byte ReadReg(int addr)
|
||||||
{
|
{
|
||||||
|
@ -704,7 +694,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void ppu_open_bus_decay(byte action)
|
public void ppu_open_bus_decay(byte action)
|
||||||
{
|
{
|
||||||
// if there is no action, decrement the timer
|
// if there is no action, decrement the timer
|
||||||
|
|
Loading…
Reference in New Issue