diff --git a/BizHawk.Emulation/Consoles/Calculator/TI83.cs b/BizHawk.Emulation/Consoles/Calculator/TI83.cs index 2b6dc946f0..64ac4f3d97 100644 --- a/BizHawk.Emulation/Consoles/Calculator/TI83.cs +++ b/BizHawk.Emulation/Consoles/Calculator/TI83.cs @@ -663,6 +663,7 @@ namespace BizHawk.Emulation.Consoles.Calculator } public int Frame {get; set;} + public int LagCount { get { return 0; } } public bool DeterministicEmulation { get { return true; } set { } } diff --git a/BizHawk.Emulation/Consoles/Gameboy/Gameboy.cs b/BizHawk.Emulation/Consoles/Gameboy/Gameboy.cs index d6597c676f..03e0461f37 100644 --- a/BizHawk.Emulation/Consoles/Gameboy/Gameboy.cs +++ b/BizHawk.Emulation/Consoles/Gameboy/Gameboy.cs @@ -652,6 +652,8 @@ namespace BizHawk.Emulation.Consoles.Gameboy get { throw new NotImplementedException(); } } + public int LagCount { get { return 0; } } //TODO: implement + public byte[] SaveRam { get { throw new NotImplementedException(); } diff --git a/BizHawk.Emulation/Consoles/Nintendo/NES/NES.cs b/BizHawk.Emulation/Consoles/Nintendo/NES/NES.cs index 17fa94e07e..94ff1f4ec5 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/NES/NES.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/NES/NES.cs @@ -215,6 +215,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo int _frame; public int Frame { get { return _frame; } set { _frame = value; } } + public int LagCount { get { return 0; } } //TODO: implement this public bool DeterministicEmulation { get { return true; } set { } } diff --git a/BizHawk.Emulation/Consoles/PC Engine/PCEngine.cs b/BizHawk.Emulation/Consoles/PC Engine/PCEngine.cs index 8303c15099..f4d2328548 100644 --- a/BizHawk.Emulation/Consoles/PC Engine/PCEngine.cs +++ b/BizHawk.Emulation/Consoles/PC Engine/PCEngine.cs @@ -96,6 +96,7 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx } public int Frame { get; set; } + public int LagCount { get { return 0; } } //TODO: Implement this public void FrameAdvance(bool render) { diff --git a/BizHawk.Emulation/Consoles/Sega/Genesis/Genesis.cs b/BizHawk.Emulation/Consoles/Sega/Genesis/Genesis.cs index 8e0be3863e..d819eb9484 100644 --- a/BizHawk.Emulation/Consoles/Sega/Genesis/Genesis.cs +++ b/BizHawk.Emulation/Consoles/Sega/Genesis/Genesis.cs @@ -140,6 +140,7 @@ namespace BizHawk.Emulation.Consoles.Sega } public int Frame { get; set; } + public int LagCount { get { return 0; } } //TODO: Implement public bool DeterministicEmulation { get; set; } public string SystemId { get { return "GEN"; } } diff --git a/BizHawk.Emulation/Consoles/Sega/SMS/SMS.cs b/BizHawk.Emulation/Consoles/Sega/SMS/SMS.cs index 53d472fdc4..7b23d0fc13 100644 --- a/BizHawk.Emulation/Consoles/Sega/SMS/SMS.cs +++ b/BizHawk.Emulation/Consoles/Sega/SMS/SMS.cs @@ -45,6 +45,7 @@ namespace BizHawk.Emulation.Consoles.Sega public bool HasYM2413 = false; public int Frame { get; set; } + public int LagCount { get { return 0; } } //TODO: implement this private byte Port01 = 0xFF; private byte Port02 = 0xFF; private byte Port3E = 0xAF; diff --git a/BizHawk.Emulation/Interfaces/Base Implementations/NullEmulator.cs b/BizHawk.Emulation/Interfaces/Base Implementations/NullEmulator.cs index 24a38100ee..37ba39f52e 100644 --- a/BizHawk.Emulation/Interfaces/Base Implementations/NullEmulator.cs +++ b/BizHawk.Emulation/Interfaces/Base Implementations/NullEmulator.cs @@ -33,6 +33,7 @@ namespace BizHawk public void SetControllersAsMnemonic(string mnemonic) { return; } public int Frame { get; set; } + public int LagCount { get { return 0; } } public byte[] SaveRam { get { return new byte[0]; } } public bool DeterministicEmulation { get; set; } public bool SaveRamModified { get; set; } diff --git a/BizHawk.Emulation/Interfaces/IEmulator.cs b/BizHawk.Emulation/Interfaces/IEmulator.cs index e89629b1ce..d272b9ce9b 100644 --- a/BizHawk.Emulation/Interfaces/IEmulator.cs +++ b/BizHawk.Emulation/Interfaces/IEmulator.cs @@ -19,6 +19,7 @@ namespace BizHawk void FrameAdvance(bool render); int Frame { get; } + int LagCount { get; } string SystemId { get; } bool DeterministicEmulation { get; set; } diff --git a/BizHawk.MultiClient/RenderPanel.cs b/BizHawk.MultiClient/RenderPanel.cs index db1f0cb01a..00c653ce1a 100644 --- a/BizHawk.MultiClient/RenderPanel.cs +++ b/BizHawk.MultiClient/RenderPanel.cs @@ -277,6 +277,15 @@ namespace BizHawk.MultiClient MessageFont.DrawString(null, FPS.ToString() + " fps", Global.Config.DispFPSx, Global.Config.DispFPSy, Color.FromArgb(Global.Config.MessagesColor)); } + + if (Global.Config.DisplayLagCounter) + { + //TODO: lag counter should do something on a lag frame, turn red (or another color if messages color = red?), and perhaps a larger font + MessageFont.DrawString(null, MakeLagCounter(), Global.Config.DispLagx + 1, + Global.Config.DispLagy + 1, new Color4(Color.Black)); + MessageFont.DrawString(null, MakeLagCounter(), Global.Config.DispLagx, + Global.Config.DispLagy, Color.FromArgb(Global.Config.MessagesColor)); + } } private string MakeFrameCounter() @@ -292,6 +301,11 @@ namespace BizHawk.MultiClient } } + private string MakeLagCounter() + { + return Global.Emulator.LagCount.ToString(); + } + private List messages = new List(5); public void AddMessage(string message)