Implement MILLISEC system variable
This commit is contained in:
@@ -228,6 +228,7 @@ class Compiler
|
||||
addSystemVariable("TABSTEP", new TabStep());
|
||||
addSystemVariable("RESULT", new Result());
|
||||
addSystemVariable("HARDWARE", new Hardware());
|
||||
addSystemVariable("MILLISEC", new MilliSecond());
|
||||
}
|
||||
void addSystemVariable(wstring name, SystemVariable var)
|
||||
{
|
||||
|
||||
@@ -124,3 +124,12 @@ class Hardware : SystemVariable
|
||||
return Value(cast(int)vm.petitcomputer.hardware);
|
||||
}
|
||||
}
|
||||
class MilliSecond : SystemVariable
|
||||
{
|
||||
@property
|
||||
override Value value()
|
||||
{
|
||||
import derelict.sdl2.sdl;
|
||||
return Value(cast(int)SDL_GetTicks());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user