public static HITResult Wait(HITThread thread)
{
var src = thread.ReadByte();
if (thread.WaitRemain == -1) thread.WaitRemain = thread.ReadVar(src);
thread.WaitRemain -= 16; //assuming tick rate is 60 times a second
if (thread.WaitRemain > 0)
{
thread.PC -= 2;
return HITResult.HALT;
}
else
{
thread.WaitRemain = -1;
return HITResult.CONTINUE;
}
}