Implement PRGSLOT

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

No files matched your search

+1
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)
{ {
+1 -1
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()
{ {
+8
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);
}
}