Implement lag counter for TI83

This commit is contained in:
andres.delikat 2011-05-01 13:42:33 +00:00
parent bf93a936df
commit fa4889bc9f
1 changed files with 7 additions and 2 deletions

View File

@ -272,6 +272,7 @@ namespace BizHawk.Emulation.Consoles.Calculator
m_LinkState = m_LinkOutput ^ 3; m_LinkState = m_LinkOutput ^ 3;
break; break;
case 1: //PORT_KEYBOARD: case 1: //PORT_KEYBOARD:
lagged = false;
keyboardMask = value; keyboardMask = value;
//Console.WriteLine("write PORT_KEYBOARD {0:X2}",value); //Console.WriteLine("write PORT_KEYBOARD {0:X2}",value);
break; break;
@ -628,7 +629,7 @@ namespace BizHawk.Emulation.Consoles.Calculator
public void FrameAdvance(bool render) public void FrameAdvance(bool render)
{ {
lagged = true;
//I eyeballed this speed //I eyeballed this speed
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
{ {
@ -638,6 +639,8 @@ namespace BizHawk.Emulation.Consoles.Calculator
cpu.Interrupt = true; cpu.Interrupt = true;
} }
Controller.UpdateControls(Frame++); Controller.UpdateControls(Frame++);
if (lagged)
_lagcount++;
} }
public void HardReset() public void HardReset()
@ -662,8 +665,10 @@ namespace BizHawk.Emulation.Consoles.Calculator
disp_x = disp_y = 0; disp_x = disp_y = 0;
} }
private int _lagcount = 0;
private bool lagged = true;
public int Frame {get; set;} public int Frame {get; set;}
public int LagCount { get { return -1; } set { return; } } public int LagCount { get { return _lagcount; } set { _lagcount = value; } }
public bool DeterministicEmulation { get { return true; } set { } } public bool DeterministicEmulation { get { return true; } set { } }