NESHawk - a small speedup (a few fps) - don't call Board.ClockPPU unless it is implemented

This commit is contained in:
adelikat 2017-06-28 10:24:19 -05:00
parent 3d443b3e2f
commit ebdb244714
2 changed files with 7 additions and 1 deletions

View File

@ -404,6 +404,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
}
Board.Dispose();
Board = newboard;
ppu.HasClockPPU = Board.GetType().GetMethod(nameof(INESBoard.ClockPPU)).DeclaringType != typeof(NESBoardBase);
}

View File

@ -8,6 +8,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
{
public int cpu_step, cpu_stepcounter;
public bool HasClockPPU = false;
// this only handles region differences within the PPU
int preNMIlines;
int postNMIlines;
@ -333,7 +335,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
Reg2002_vblank_clear_pending = false;
}
nes.Board.ClockPPU();
if (HasClockPPU)
{
nes.Board.ClockPPU();
}
}
}
}