1
0

GAME1が動くようになった

This commit is contained in:
otya128
2015-08-20 20:11:33 +09:00
parent 886be04289
commit 8e0a4e0ae4
8 changed files with 275 additions and 30 deletions

View File

@@ -129,6 +129,7 @@ enum CodeType
GosubS,
ReturnSubroutine,
OnS,
RestoreCodeS,
}
abstract class Code
{
@@ -898,7 +899,14 @@ class CallBuiltinFunction : Code
result = vm.stack[vm.stacki/* - argcount */+ 1..vm.stacki + 1/* - argcount */+ outcount];//雑;
}
func.func(vm.petitcomputer, arg, result);
vm.stacki -= func.argments.length;// - outcount;
if(func.variadic)
{
vm.stacki -= argcount;
}
else
{
vm.stacki -= func.argments.length;// - outcount;
}
////vm.stacki += outcount;
//vm.stacki = old;
for(int i = 0; i < result.length; i++)
@@ -1151,6 +1159,33 @@ class ReadCode : Code
}
}
}
class RestoreCodeS : Code
{
wstring label;
this(wstring label)
{
this.label = label;
this.type = CodeType.RestoreCodeS;
}
override void execute(VM vm)
{
stderr.writeln("can't execute (compiler bug?)");
}
}
class RestoreCode : Code
{
int label;
DataTable datatable;
this(int label, DataTable datatable)
{
this.label = label;
this.datatable = datatable;
}
override void execute(VM vm)
{
datatable.dataIndex = label;
}
}
class PushSystemVariable : Code
{
SystemVariable var;