summaryrefslogtreecommitdiff
path: root/include/script.h
diff options
context:
space:
mode:
authormartmists <mail@martmists.com>2020-04-21 19:16:35 +0200
committerGitHub <noreply@github.com>2020-04-21 19:16:35 +0200
commite75843a08471a1212bee05e8df9a6c804fbf248b (patch)
treed1b529a9e44cda643a0f927ba6bdb321ff36d177 /include/script.h
parentaeb4e938f5f48c8484419f5333a5b0e6caee7a21 (diff)
parent8cdd2f137d6041538dcba2b13580b0f43f1cc549 (diff)
Merge pull request #16 from ProjectRevoTPP/master
split filesystem.s, scrcmd.s, and decompile script.c
Diffstat (limited to 'include/script.h')
-rw-r--r--include/script.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/script.h b/include/script.h
new file mode 100644
index 00000000..2ecc8e28
--- /dev/null
+++ b/include/script.h
@@ -0,0 +1,27 @@
+#ifndef _SCRIPT_H_
+#define _SCRIPT_H_
+
+struct ScriptContext;
+
+typedef u8 (*ScrCmdFunc)(struct ScriptContext *);
+typedef u8 Script[];
+
+struct ScriptContext
+{
+ u8 stackDepth;
+ u8 mode;
+ u8 comparisonResult;
+ u8 (*nativePtr)(struct ScriptContext *);
+ const u8 *scriptPtr;
+ const u8 *stack[20];
+ ScrCmdFunc *cmdTable;
+ ScrCmdFunc *cmdTableEnd;
+ u32 data[4];
+ u32 unk74;
+};
+
+#define ScriptReadByte(ctx) (*(ctx->scriptPtr++))
+
+u16 ScriptReadHalfword(struct ScriptContext *ctx);
+
+#endif // _SCRIPT_H_