From b2059ca1ad5c95fb60b5502d84656aee0b1ce01e Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Tue, 21 Apr 2020 11:46:50 -0400 Subject: decompile script.c --- include/script.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 include/script.h (limited to 'include/script.h') diff --git a/include/script.h b/include/script.h new file mode 100644 index 00000000..13035fc9 --- /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)(void); + 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_ -- cgit v1.2.3 From fb6be2fb9463b1542e4cc839627b2d2d1bb0afbe Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Tue, 21 Apr 2020 12:03:53 -0400 Subject: fix various issues and NONMATCHING. Thanks Demki! --- include/script.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/script.h') diff --git a/include/script.h b/include/script.h index 13035fc9..2ecc8e28 100644 --- a/include/script.h +++ b/include/script.h @@ -11,7 +11,7 @@ struct ScriptContext u8 stackDepth; u8 mode; u8 comparisonResult; - u8 (*nativePtr)(void); + u8 (*nativePtr)(struct ScriptContext *); const u8 *scriptPtr; const u8 *stack[20]; ScrCmdFunc *cmdTable; -- cgit v1.2.3