1
0

Implement SPFUNC

This commit is contained in:
otya128
2016-12-31 11:35:32 +09:00
parent ffa140e0dc
commit 0899286b1f
4 changed files with 98 additions and 6 deletions

View File

@@ -1883,6 +1883,22 @@ class BuiltinFunction
}
return p.sprite.spused(id);
}
static void SPFUNC(PetitComputer p, int id, wstring func)
{
if (!p.sprite.isValidSpriteId(id))
{
throw new OutOfRange("SPFUNC", 1);
}
/*
if (!p.sprite.isSpriteDefined(id))
{
throw new IllegalFunctionCall("SPFUNC", 1);
}*/
auto callback = p.vm.createCallback(func);
if (callback.type == CallbackType.none)
throw new IllegalFunctionCall("SPFUNC"/*, 2*/);
p.sprite.spfunc(id, callback);
}
static void BGMSTOP(PetitComputer p)
{
writeln("NOTIMPL:BGMSTOP");