Implement HARDWARE sytem variable
This commit is contained in:
@@ -227,6 +227,7 @@ class Compiler
|
||||
addSystemVariable("FREEMEM", new FreeMem());
|
||||
addSystemVariable("TABSTEP", new TabStep());
|
||||
addSystemVariable("RESULT", new Result());
|
||||
addSystemVariable("HARDWARE", new Hardware());
|
||||
}
|
||||
void addSystemVariable(wstring name, SystemVariable var)
|
||||
{
|
||||
|
||||
@@ -213,6 +213,12 @@ class RingBuffer(T)
|
||||
return buffer[(start != -1 ? start + index : index) % buffer.length];
|
||||
}
|
||||
}
|
||||
enum Hardware
|
||||
{
|
||||
threeDS = 0,
|
||||
new3DS = 1,
|
||||
wiiU = 2,
|
||||
}
|
||||
class PetitComputer
|
||||
{
|
||||
this()
|
||||
@@ -1463,6 +1469,7 @@ class PetitComputer
|
||||
std.stdio.stderr.writefln("Unknown XON %s", func);
|
||||
}
|
||||
}
|
||||
Hardware hardware = Hardware.wiiU;
|
||||
//プチコン内部表現はRGB5_A1
|
||||
static uint toGLColor(GLenum format, ubyte r, ubyte g, ubyte b, ubyte a)
|
||||
{
|
||||
|
||||
@@ -116,3 +116,11 @@ class Result : SystemVariable
|
||||
return Value(vm.petitcomputer.project.result);
|
||||
}
|
||||
}
|
||||
class Hardware : SystemVariable
|
||||
{
|
||||
@property
|
||||
override Value value()
|
||||
{
|
||||
return Value(cast(int)vm.petitcomputer.hardware);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user