From f7032a1c33ddf5f44cc52fd9da1c8e02fe6b7c11 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 24 Nov 2012 14:17:56 +0000 Subject: [PATCH] Coleco - some minor refactoring --- .../Consoles/Coleco/ColecoVision.cs | 14 +++++++------- BizHawk.Emulation/Consoles/Coleco/Input.cs | 16 ++++++++++++---- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/BizHawk.Emulation/Consoles/Coleco/ColecoVision.cs b/BizHawk.Emulation/Consoles/Coleco/ColecoVision.cs index 32e4759e1f..57928d95ea 100644 --- a/BizHawk.Emulation/Consoles/Coleco/ColecoVision.cs +++ b/BizHawk.Emulation/Consoles/Coleco/ColecoVision.cs @@ -73,12 +73,12 @@ namespace BizHawk.Emulation.Consoles.Coleco public void FrameAdvance(bool render, bool renderSound) { Frame++; - IsLagFrame = true; + islag = true; PSG.BeginFrame(Cpu.TotalExecutedCycles); VDP.ExecuteFrame(); PSG.EndFrame(Cpu.TotalExecutedCycles); - if (IsLagFrame) + if (islag) LagCount++; } @@ -165,7 +165,7 @@ namespace BizHawk.Emulation.Consoles.Coleco writer.WriteLine("Frame {0}", Frame); writer.WriteLine("Lag {0}", _lagcount); - writer.WriteLine("IsLagFrame {0}", IsLagFrame); + writer.WriteLine("islag {0}", islag); writer.Write("RAM "); Ram.SaveAsHex(writer); writer.WriteLine("[/Coleco]"); @@ -183,8 +183,8 @@ namespace BizHawk.Emulation.Consoles.Coleco Frame = int.Parse(args[1]); else if (args[0] == "Lag") _lagcount = int.Parse(args[1]); - else if (args[0] == "IsLagFrame") - IsLagFrame = bool.Parse(args[1]); + else if (args[0] == "islag") + islag = bool.Parse(args[1]); else if (args[0] == "RAM") Ram.ReadFromHex(args[1]); else if (args[0] == "[Z80]") @@ -216,7 +216,7 @@ namespace BizHawk.Emulation.Consoles.Coleco writer.Write(Frame); writer.Write(_lagcount); - writer.Write(IsLagFrame); + writer.Write(islag); writer.Write(Ram); } @@ -228,7 +228,7 @@ namespace BizHawk.Emulation.Consoles.Coleco Frame = reader.ReadInt32(); _lagcount = reader.ReadInt32(); - IsLagFrame = reader.ReadBoolean(); + islag = reader.ReadBoolean(); Ram = reader.ReadBytes(Ram.Length); } diff --git a/BizHawk.Emulation/Consoles/Coleco/Input.cs b/BizHawk.Emulation/Consoles/Coleco/Input.cs index 1141850012..7bce20f069 100644 --- a/BizHawk.Emulation/Consoles/Coleco/Input.cs +++ b/BizHawk.Emulation/Consoles/Coleco/Input.cs @@ -27,7 +27,7 @@ byte ReadController1() { - IsLagFrame = false; + islag = false; if (InputPortSelection == InputPortMode.Left) { @@ -71,7 +71,7 @@ byte ReadController2() { - IsLagFrame = false; + islag = false; if (InputPortSelection == InputPortMode.Left) { @@ -114,7 +114,15 @@ public int Frame { get; set; } public int LagCount { get { return _lagcount; } set { _lagcount = value; } } - public bool IsLagFrame { get; private set; } - private int _lagcount = 0; + public bool IsLagFrame + { + get + { + return islag; + } + } + + private int _lagcount = 0; + private bool islag = true; } }