Implement SPFUNC

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

No files matched your search

+16
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");