Ti83 - nit picky reorg

This commit is contained in:
adelikat 2014-11-30 23:50:07 +00:00
parent 9adc45f4d1
commit bd458fc0dc
4 changed files with 35 additions and 16 deletions

View File

@ -85,6 +85,9 @@
<Compile Include="..\VersionInfo.cs"> <Compile Include="..\VersionInfo.cs">
<Link>VersionInfo.cs</Link> <Link>VersionInfo.cs</Link>
</Compile> </Compile>
<Compile Include="Calculator\TI83.IInputPollable.cs">
<DependentUpon>TI83.cs</DependentUpon>
</Compile>
<Compile Include="Calculator\TI83.IMemoryDomains.cs"> <Compile Include="Calculator\TI83.IMemoryDomains.cs">
<DependentUpon>TI83.cs</DependentUpon> <DependentUpon>TI83.cs</DependentUpon>
</Compile> </Compile>

View File

@ -0,0 +1,22 @@
using BizHawk.Emulation.Common;
namespace BizHawk.Emulation.Cores.Calculators
{
public partial class TI83 : IInputPollable
{
private int _lagCount = 0;
private bool _lagged = true;
private bool _isLag = false;
public int LagCount
{
get { return _lagCount; }
set { _lagCount = value; }
}
public bool IsLagFrame
{
get { return _isLag; }
}
}
}

View File

@ -73,8 +73,8 @@ namespace BizHawk.Emulation.Cores.Calculators
ser.Sync("m_LinkOutput", ref m_LinkOutput); ser.Sync("m_LinkOutput", ref m_LinkOutput);
ser.Sync("VRAM", ref vram, false); ser.Sync("VRAM", ref vram, false);
ser.Sync("Frame", ref frame); ser.Sync("Frame", ref frame);
ser.Sync("LagCount", ref lagCount); ser.Sync("LagCount", ref _lagCount);
ser.Sync("IsLag", ref isLag); ser.Sync("IsLag", ref _isLag);
ser.EndSection(); ser.EndSection();
} }
} }

View File

@ -47,10 +47,6 @@ namespace BizHawk.Emulation.Cores.Calculators
internal bool LinkActive; internal bool LinkActive;
private bool m_CursorMoved; private bool m_CursorMoved;
private int lagCount = 0;
private bool lagged = true;
private bool isLag = false;
private int frame; private int frame;
[CoreConstructor("TI83")] [CoreConstructor("TI83")]
@ -127,7 +123,7 @@ namespace BizHawk.Emulation.Cores.Calculators
} }
break; break;
case 1: //PORT_KEYBOARD: case 1: //PORT_KEYBOARD:
lagged = false; _lagged = false;
keyboardMask = value; keyboardMask = value;
//Console.WriteLine("write PORT_KEYBOARD {0:X2}",value); //Console.WriteLine("write PORT_KEYBOARD {0:X2}",value);
break; break;
@ -468,7 +464,7 @@ namespace BizHawk.Emulation.Cores.Calculators
public void FrameAdvance(bool render, bool rendersound) public void FrameAdvance(bool render, bool rendersound)
{ {
lagged = true; _lagged = true;
//I eyeballed this speed //I eyeballed this speed
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
{ {
@ -479,14 +475,14 @@ namespace BizHawk.Emulation.Cores.Calculators
} }
Frame++; Frame++;
if (lagged) if (_lagged)
{ {
lagCount++; _lagCount++;
isLag = true; _isLag = true;
} }
else else
{ {
isLag = false; _isLag = false;
} }
} }
@ -513,14 +509,12 @@ namespace BizHawk.Emulation.Cores.Calculators
} }
public int Frame { get { return frame; } set { frame = value; } } public int Frame { get { return frame; } set { frame = value; } }
public int LagCount { get { return lagCount; } set { lagCount = value; } }
public bool IsLagFrame { get { return isLag; } }
public void ResetCounters() public void ResetCounters()
{ {
Frame = 0; Frame = 0;
lagCount = 0; _lagCount = 0;
isLag = false; _isLag = false;
} }
public bool DeterministicEmulation { get { return true; } } public bool DeterministicEmulation { get { return true; } }