1
0

Implement PRGSLOT

This commit is contained in:
otya128
2016-12-28 22:51:22 +09:00
parent 834480e9ac
commit 692c7907e9
3 changed files with 10 additions and 1 deletions

View File

@@ -226,6 +226,7 @@ class Compiler
addSystemVariable("RESULT", new Result()); addSystemVariable("RESULT", new Result());
addSystemVariable("HARDWARE", new Hardware()); addSystemVariable("HARDWARE", new Hardware());
addSystemVariable("MILLISEC", new MilliSecond()); addSystemVariable("MILLISEC", new MilliSecond());
addSystemVariable("PRGSLOT", new ProgramSlot());
} }
void addSystemVariable(wstring name, SystemVariable var) void addSystemVariable(wstring name, SystemVariable var)
{ {

View File

@@ -518,7 +518,7 @@ class Program
{ {
Slot[] slot; Slot[] slot;
bool PRGEDITused; bool PRGEDITused;
int currentSlot; int currentSlot = -1/*PRGSLOT default value*/;
int slotSize = 4; int slotSize = 4;
this() this()
{ {

View File

@@ -131,3 +131,11 @@ class MilliSecond : SystemVariable
return Value(cast(int)SDL_GetTicks()); return Value(cast(int)SDL_GetTicks());
} }
} }
class ProgramSlot : SystemVariable
{
@property
override Value value()
{
return Value(vm.petitcomputer.program.currentSlot);
}
}