public bool FrameAdvance(IController controller, bool render, bool rendersound) { _controller = controller; _lagged = true; _frame++; PSG.BeginFrame(Cpu.TotalExecutedCycles); if (!IsGameGear) { PSG.StereoPanning = Settings.ForceStereoSeparation ? ForceStereoByte : (byte)0xFF; } if (Tracer.Enabled) { Cpu.TraceCallback = s => Tracer.Put(s); } else { Cpu.TraceCallback = null; } if (IsGameGear_C == false) { Cpu.NonMaskableInterrupt = controller.IsPressed("Pause"); } else if (!IsGameGear && IsGameGear_C) { Cpu.NonMaskableInterrupt = controller.IsPressed("P1 Start"); } if (IsGame3D && Settings.Fix3D) { Vdp.ExecFrame((Frame & 1) == 0); } else { Vdp.ExecFrame(render); } PSG.EndFrame(Cpu.TotalExecutedCycles); if (_lagged) { _lagCount++; _isLag = true; } else { _isLag = false; } return(true); }
public void FrameAdvance(IController controller, bool render, bool rendersound) { _controller = controller; _lagged = true; _frame++; PSG.BeginFrame(Cpu.TotalExecutedCycles); Cpu.Debug = Tracer.Enabled; if (!IsGameGear) { PSG.StereoPanning = Settings.ForceStereoSeparation ? ForceStereoByte : (byte)0xFF; } if (Cpu.Debug && Cpu.Logger == null) // TODO, lets not do this on each frame. But lets refactor CoreComm/CoreComm first { Cpu.Logger = s => Tracer.Put(s); } if (IsGameGear == false) { Cpu.NonMaskableInterrupt = controller.IsPressed("Pause"); } if (IsGame3D && Settings.Fix3D) { Vdp.ExecFrame((Frame & 1) == 0); } else { Vdp.ExecFrame(render); } PSG.EndFrame(Cpu.TotalExecutedCycles); if (_lagged) { _lagCount++; _isLag = true; } else { _isLag = false; } }