From 05b2edad405eb47a5f36ee09f705f0da04df0793 Mon Sep 17 00:00:00 2001 From: octorock <79596758+octorock@users.noreply.github.com> Date: Thu, 4 Mar 2021 03:49:25 +0100 Subject: Add notes to script.c --- include/script.h | 14 ++++++++++++-- include/structures.h | 8 ++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/script.h b/include/script.h index 9abc5291..416485b5 100644 --- a/include/script.h +++ b/include/script.h @@ -3,14 +3,24 @@ #include "global.h" +typedef struct +{ + u16 command; + u16 metadata; +} ScriptCommand; + + typedef struct { - u16* unk_00; + union { + u16* raw; + ScriptCommand* commands; // list of commands to execute + } unk_00; u32 unk_04; u32 unk_08; u8 unk_0C[0x4]; // unused u16 unk_10; u16 unk_12; - u32 unk_14; + u32 compareResult; // result of a compare script command u8 unk_18; u8 unk_19; u8 unk_1A; diff --git a/include/structures.h b/include/structures.h index 59811d6f..f6108ad6 100644 --- a/include/structures.h +++ b/include/structures.h @@ -119,11 +119,15 @@ typedef struct { extern struct_02024490 gUnk_02024490; + +// Some kind of ScriptInterpreter state? typedef struct { u32 unk_00; - u16 unk_04; + u16 operationId; u8 unk_06; - u8 unk_07; + // bit 0 is reset before each script execution + // execution is continued if bit 0 or bit 1 are true, so bit 1 can be set to execute until someone unsets bit 1 + u8 continueScriptExecutionFlags; u8 unk_08; } struct_02033280; -- cgit v1.2.3 From 3336b91812c09255e307a9f66dd1ae30aabe027f Mon Sep 17 00:00:00 2001 From: octorock <79596758+octorock@users.noreply.github.com> Date: Thu, 4 Mar 2021 15:47:07 +0100 Subject: Add first draft for a script disassembler --- include/scriptMacros.h | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 include/scriptMacros.h (limited to 'include') diff --git a/include/scriptMacros.h b/include/scriptMacros.h new file mode 100644 index 00000000..0663059d --- /dev/null +++ b/include/scriptMacros.h @@ -0,0 +1,54 @@ +#ifndef SCRIPT_MACROS_H +#define SCRIPT_MACROS_H + +// Generated by disassemble_script.py +#define START_SCRIPT(name) const unsigned short name[] = { +#define END_SCRIPT() }; +#define WORD_TO_SHORTS(word) (unsigned short)(word & 0xffff),(unsigned short)(word >> 16) + +#define nullsub_507() 0x0400, +#define sub_0807E004() 0x0401, +#define sub_0807E014() 0x0402, +#define sub_0807E024(s) 0x0803, s, +#define sub_0807E050(s) 0x0804, s, +#define sub_0807E064(s) 0x0805, s, +#define sub_0807E078(s) 0x0806, s, +#define sub_0807E0A0(w) 0x0c07, WORD_TO_SHORTS(w), +#define sub_0807E0B8(w) 0x0c08, WORD_TO_SHORTS(w), +#define sub_0807E0CC(w) 0x0c09, WORD_TO_SHORTS(w), +#define sub_0807E0E0(w) 0x0c0a, WORD_TO_SHORTS(w), +#define sub_0807E10C(w) 0x0c0b, WORD_TO_SHORTS(w), +#define sub_0807E124(a,b) 0x140c, WORD_TO_SHORTS(a), WORD_TO_SHORTS(b), +#define sub_0807E148(w) 0x0c0d, WORD_TO_SHORTS(w), +#define sub_0807E158(w) 0x0c0e, WORD_TO_SHORTS(w), +#define sub_0807E188(s) 0x080f, s, +#define sub_0807E1D8(s) 0x0810, s, +#define sub_0807E4AC(s) 0x0811, s, +#define sub_0807E260(s) 0x0815, s, +#define sub_0807E2A8(s) 0x0817, s, +#define sub_0807E2E4() 0x0418, +#define sub_0807E5F8(w) 0x0c28, WORD_TO_SHORTS(w), +#define sub_0807E680(s) 0x0831, s, +#define sub_0807E6AC(w) 0x0c33, WORD_TO_SHORTS(w), +#define sub_0807E864() 0x0443, +#define sub_0807E878() 0x0444, +#define sub_0807E8C4(w) 0x0c47, WORD_TO_SHORTS(w), +#define sub_0807E8E4() 0x0449, +#define sub_0807E8E4a() 0x044a, +#define sub_0807E8E4b() 0x044b, +#define sub_0807E8E4c() 0x044c, +#define sub_0807E930(s) 0x0850, s, +#define sub_0807E9D4() 0x0453, +#define sub_0807E9DC() 0x0454, +#define sub_0807EA94() 0x0459, +#define sub_0807EAD0(a,b) 0x0c5c, a,b, +#define sub_0807EB28(s) 0x085f, s, +#define sub_0807EB8C() 0x0464, +#define sub_0807EBC0(s) 0x0867, s, +#define sub_0807EC1C(s) 0x086d, s, +#define sub_0807EE30() 0x0475, +#define sub_0807EF80(s) 0x0879, s, +#define sub_0807EFAC(s) 0x087c, s, +#define sub_0807EFE4() 0x047e, + +#endif -- cgit v1.2.3 From 174694a99b646040b93dec1a6d432f453ae9b7e5 Mon Sep 17 00:00:00 2001 From: octorock <79596758+octorock@users.noreply.github.com> Date: Thu, 4 Mar 2021 17:29:56 +0100 Subject: Generate using inline assembly --- include/scriptMacros.h | 97 ++++++++++++++++++++++++-------------------------- 1 file changed, 47 insertions(+), 50 deletions(-) (limited to 'include') diff --git a/include/scriptMacros.h b/include/scriptMacros.h index 0663059d..fabc19f9 100644 --- a/include/scriptMacros.h +++ b/include/scriptMacros.h @@ -1,54 +1,51 @@ #ifndef SCRIPT_MACROS_H #define SCRIPT_MACROS_H - // Generated by disassemble_script.py -#define START_SCRIPT(name) const unsigned short name[] = { -#define END_SCRIPT() }; -#define WORD_TO_SHORTS(word) (unsigned short)(word & 0xffff),(unsigned short)(word >> 16) - -#define nullsub_507() 0x0400, -#define sub_0807E004() 0x0401, -#define sub_0807E014() 0x0402, -#define sub_0807E024(s) 0x0803, s, -#define sub_0807E050(s) 0x0804, s, -#define sub_0807E064(s) 0x0805, s, -#define sub_0807E078(s) 0x0806, s, -#define sub_0807E0A0(w) 0x0c07, WORD_TO_SHORTS(w), -#define sub_0807E0B8(w) 0x0c08, WORD_TO_SHORTS(w), -#define sub_0807E0CC(w) 0x0c09, WORD_TO_SHORTS(w), -#define sub_0807E0E0(w) 0x0c0a, WORD_TO_SHORTS(w), -#define sub_0807E10C(w) 0x0c0b, WORD_TO_SHORTS(w), -#define sub_0807E124(a,b) 0x140c, WORD_TO_SHORTS(a), WORD_TO_SHORTS(b), -#define sub_0807E148(w) 0x0c0d, WORD_TO_SHORTS(w), -#define sub_0807E158(w) 0x0c0e, WORD_TO_SHORTS(w), -#define sub_0807E188(s) 0x080f, s, -#define sub_0807E1D8(s) 0x0810, s, -#define sub_0807E4AC(s) 0x0811, s, -#define sub_0807E260(s) 0x0815, s, -#define sub_0807E2A8(s) 0x0817, s, -#define sub_0807E2E4() 0x0418, -#define sub_0807E5F8(w) 0x0c28, WORD_TO_SHORTS(w), -#define sub_0807E680(s) 0x0831, s, -#define sub_0807E6AC(w) 0x0c33, WORD_TO_SHORTS(w), -#define sub_0807E864() 0x0443, -#define sub_0807E878() 0x0444, -#define sub_0807E8C4(w) 0x0c47, WORD_TO_SHORTS(w), -#define sub_0807E8E4() 0x0449, -#define sub_0807E8E4a() 0x044a, -#define sub_0807E8E4b() 0x044b, -#define sub_0807E8E4c() 0x044c, -#define sub_0807E930(s) 0x0850, s, -#define sub_0807E9D4() 0x0453, -#define sub_0807E9DC() 0x0454, -#define sub_0807EA94() 0x0459, -#define sub_0807EAD0(a,b) 0x0c5c, a,b, -#define sub_0807EB28(s) 0x085f, s, -#define sub_0807EB8C() 0x0464, -#define sub_0807EBC0(s) 0x0867, s, -#define sub_0807EC1C(s) 0x086d, s, -#define sub_0807EE30() 0x0475, -#define sub_0807EF80(s) 0x0879, s, -#define sub_0807EFAC(s) 0x087c, s, -#define sub_0807EFE4() 0x047e, +#define START_SCRIPT(name) asm(".globl "#name); asm(".section .rodata"); asm(#name":"); +#define END_SCRIPT() asm(".short 0xffff"); -#endif +#define nullsub_507() asm(".short 0x0400"); +#define sub_0807E004() asm(".short 0x0401"); +#define sub_0807E014() asm(".short 0x0402"); +#define sub_0807E024(s) asm(".short 0x0803");asm(".short " #s); +#define sub_0807E050(s) asm(".short 0x0804");asm(".short " #s); +#define sub_0807E064(s) asm(".short 0x0805");asm(".short " #s); +#define sub_0807E078(s) asm(".short 0x0806");asm(".short " #s); +#define sub_0807E0A0(w) asm(".short 0x0c07");asm(".word " #w); +#define sub_0807E0B8(w) asm(".short 0x0c08");asm(".word " #w); +#define sub_0807E0CC(w) asm(".short 0x0c09");asm(".word " #w); +#define sub_0807E0E0(w) asm(".short 0x0c0a");asm(".word " #w); +#define sub_0807E10C(w) asm(".short 0x0c0b");asm(".word " #w); +#define sub_0807E124(a,b) asm(".short 0x140c");asm(".word " #a);asm(".word " #b); +#define sub_0807E148(w) asm(".short 0x0c0d");asm(".word " #w); +#define sub_0807E158(w) asm(".short 0x0c0e");asm(".word " #w); +#define sub_0807E188(s) asm(".short 0x080f");asm(".short " #s); +#define sub_0807E1D8(s) asm(".short 0x0810");asm(".short " #s); +#define sub_0807E4AC(s) asm(".short 0x0811");asm(".short " #s); +#define sub_0807E260(s) asm(".short 0x0815");asm(".short " #s); +#define sub_0807E2A8(s) asm(".short 0x0817");asm(".short " #s); +#define sub_0807E2E4() asm(".short 0x0418"); +#define sub_0807E5F8(w) asm(".short 0x0c28");asm(".word " #w); +#define sub_0807E680(s) asm(".short 0x0831");asm(".short " #s); +#define sub_0807E6AC(w) asm(".short 0x0c33");asm(".word " #w); +#define sub_0807E864() asm(".short 0x0443"); +#define sub_0807E878() asm(".short 0x0444"); +#define sub_0807E8C4(w) asm(".short 0x0c47");asm(".word " #w); +#define sub_0807E8E4_0() asm(".short 0x0449"); +#define sub_0807E8E4_1() asm(".short 0x044a"); +#define sub_0807E8E4_2() asm(".short 0x044b"); +#define sub_0807E8E4_3() asm(".short 0x044c"); +#define sub_0807E930(s) asm(".short 0x0850");asm(".short " #s); +#define sub_0807E9D4() asm(".short 0x0453"); +#define sub_0807E9DC() asm(".short 0x0454"); +#define sub_0807EA94() asm(".short 0x0459"); +#define sub_0807EAD0(a,b) asm(".short 0x0c5c");asm(".short " #a);asm(".short " #b); +#define sub_0807EB28(s) asm(".short 0x085f");asm(".short " #s); +#define sub_0807EB8C() asm(".short 0x0464"); +#define sub_0807EBC0(s) asm(".short 0x0867");asm(".short " #s); +#define sub_0807EC1C(s) asm(".short 0x086d");asm(".short " #s); +#define sub_0807EE30() asm(".short 0x0475"); +#define sub_0807EF80(s) asm(".short 0x0879");asm(".short " #s); +#define sub_0807EFAC(s) asm(".short 0x087c");asm(".short " #s); +#define sub_0807EFE4() asm(".short 0x047e"); +#endif \ No newline at end of file -- cgit v1.2.3 From 1a8fad358a3d224bb035b8698162540a1372575b Mon Sep 17 00:00:00 2001 From: octorock <79596758+octorock@users.noreply.github.com> Date: Thu, 4 Mar 2021 23:37:57 +0100 Subject: Reset changes to script.c --- include/script.h | 14 ++------------ include/structures.h | 8 ++------ 2 files changed, 4 insertions(+), 18 deletions(-) (limited to 'include') diff --git a/include/script.h b/include/script.h index 416485b5..9abc5291 100644 --- a/include/script.h +++ b/include/script.h @@ -3,24 +3,14 @@ #include "global.h" -typedef struct -{ - u16 command; - u16 metadata; -} ScriptCommand; - - typedef struct { - union { - u16* raw; - ScriptCommand* commands; // list of commands to execute - } unk_00; + u16* unk_00; u32 unk_04; u32 unk_08; u8 unk_0C[0x4]; // unused u16 unk_10; u16 unk_12; - u32 compareResult; // result of a compare script command + u32 unk_14; u8 unk_18; u8 unk_19; u8 unk_1A; diff --git a/include/structures.h b/include/structures.h index f6108ad6..59811d6f 100644 --- a/include/structures.h +++ b/include/structures.h @@ -119,15 +119,11 @@ typedef struct { extern struct_02024490 gUnk_02024490; - -// Some kind of ScriptInterpreter state? typedef struct { u32 unk_00; - u16 operationId; + u16 unk_04; u8 unk_06; - // bit 0 is reset before each script execution - // execution is continued if bit 0 or bit 1 are true, so bit 1 can be set to execute until someone unsets bit 1 - u8 continueScriptExecutionFlags; + u8 unk_07; u8 unk_08; } struct_02033280; -- cgit v1.2.3 From a35c22e940efc7af89562e725575a4e79394ab2e Mon Sep 17 00:00:00 2001 From: Henny022p Date: Thu, 4 Mar 2021 19:49:46 +0100 Subject: started naming script stuff --- include/greatFairy.h | 2 +- include/script.h | 6 +++--- include/structures.h | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/greatFairy.h b/include/greatFairy.h index 31a37c99..ae78ffda 100644 --- a/include/greatFairy.h +++ b/include/greatFairy.h @@ -41,7 +41,7 @@ extern const s16 GreatFairy_RippleOffsets[10]; extern u32 gUnk_02034350; extern RoomVars gRoomVars; extern Screen gScreen; -extern struct_02033280 gUnk_02033280; +extern struct_02033280 gActiveScriptInfo; extern u8 gUnk_0812079C[8]; extern s16 gSineTable[]; extern s8 gUnk_081207AC[]; diff --git a/include/script.h b/include/script.h index 9abc5291..201d0f71 100644 --- a/include/script.h +++ b/include/script.h @@ -3,12 +3,12 @@ #include "global.h" -typedef struct { - u16* unk_00; +typedef struct ScriptExecutionContext { + u16* scriptInstructionPointer; u32 unk_04; u32 unk_08; u8 unk_0C[0x4]; // unused - u16 unk_10; + u16 wait; u16 unk_12; u32 unk_14; u8 unk_18; diff --git a/include/structures.h b/include/structures.h index 59811d6f..42e9d3ab 100644 --- a/include/structures.h +++ b/include/structures.h @@ -121,13 +121,13 @@ extern struct_02024490 gUnk_02024490; typedef struct { u32 unk_00; - u16 unk_04; - u8 unk_06; - u8 unk_07; + u16 commandIndex; + u8 commandSize; + u8 flags; u8 unk_08; } struct_02033280; -extern struct_02033280 gUnk_02033280; +extern struct_02033280 gActiveScriptInfo; typedef struct { u16 unk_00; -- cgit v1.2.3 From 849ff8dcfd1e9b24b91bf830719a24f31f113115 Mon Sep 17 00:00:00 2001 From: Henny022p Date: Thu, 4 Mar 2021 20:59:20 +0100 Subject: named a lot of script commands --- include/script.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/script.h b/include/script.h index 201d0f71..aebc64dd 100644 --- a/include/script.h +++ b/include/script.h @@ -10,7 +10,7 @@ typedef struct ScriptExecutionContext { u8 unk_0C[0x4]; // unused u16 wait; u16 unk_12; - u32 unk_14; + u32 condition; u8 unk_18; u8 unk_19; u8 unk_1A; -- cgit v1.2.3 From 37d03d13824fc8a6f1da88e77176e4d5d7e95c5e Mon Sep 17 00:00:00 2001 From: octorock <79596758+octorock@users.noreply.github.com> Date: Fri, 5 Mar 2021 00:31:07 +0100 Subject: Apply renaming --- include/scriptMacros.h | 51 -------------------------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 include/scriptMacros.h (limited to 'include') diff --git a/include/scriptMacros.h b/include/scriptMacros.h deleted file mode 100644 index fabc19f9..00000000 --- a/include/scriptMacros.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef SCRIPT_MACROS_H -#define SCRIPT_MACROS_H -// Generated by disassemble_script.py -#define START_SCRIPT(name) asm(".globl "#name); asm(".section .rodata"); asm(#name":"); -#define END_SCRIPT() asm(".short 0xffff"); - -#define nullsub_507() asm(".short 0x0400"); -#define sub_0807E004() asm(".short 0x0401"); -#define sub_0807E014() asm(".short 0x0402"); -#define sub_0807E024(s) asm(".short 0x0803");asm(".short " #s); -#define sub_0807E050(s) asm(".short 0x0804");asm(".short " #s); -#define sub_0807E064(s) asm(".short 0x0805");asm(".short " #s); -#define sub_0807E078(s) asm(".short 0x0806");asm(".short " #s); -#define sub_0807E0A0(w) asm(".short 0x0c07");asm(".word " #w); -#define sub_0807E0B8(w) asm(".short 0x0c08");asm(".word " #w); -#define sub_0807E0CC(w) asm(".short 0x0c09");asm(".word " #w); -#define sub_0807E0E0(w) asm(".short 0x0c0a");asm(".word " #w); -#define sub_0807E10C(w) asm(".short 0x0c0b");asm(".word " #w); -#define sub_0807E124(a,b) asm(".short 0x140c");asm(".word " #a);asm(".word " #b); -#define sub_0807E148(w) asm(".short 0x0c0d");asm(".word " #w); -#define sub_0807E158(w) asm(".short 0x0c0e");asm(".word " #w); -#define sub_0807E188(s) asm(".short 0x080f");asm(".short " #s); -#define sub_0807E1D8(s) asm(".short 0x0810");asm(".short " #s); -#define sub_0807E4AC(s) asm(".short 0x0811");asm(".short " #s); -#define sub_0807E260(s) asm(".short 0x0815");asm(".short " #s); -#define sub_0807E2A8(s) asm(".short 0x0817");asm(".short " #s); -#define sub_0807E2E4() asm(".short 0x0418"); -#define sub_0807E5F8(w) asm(".short 0x0c28");asm(".word " #w); -#define sub_0807E680(s) asm(".short 0x0831");asm(".short " #s); -#define sub_0807E6AC(w) asm(".short 0x0c33");asm(".word " #w); -#define sub_0807E864() asm(".short 0x0443"); -#define sub_0807E878() asm(".short 0x0444"); -#define sub_0807E8C4(w) asm(".short 0x0c47");asm(".word " #w); -#define sub_0807E8E4_0() asm(".short 0x0449"); -#define sub_0807E8E4_1() asm(".short 0x044a"); -#define sub_0807E8E4_2() asm(".short 0x044b"); -#define sub_0807E8E4_3() asm(".short 0x044c"); -#define sub_0807E930(s) asm(".short 0x0850");asm(".short " #s); -#define sub_0807E9D4() asm(".short 0x0453"); -#define sub_0807E9DC() asm(".short 0x0454"); -#define sub_0807EA94() asm(".short 0x0459"); -#define sub_0807EAD0(a,b) asm(".short 0x0c5c");asm(".short " #a);asm(".short " #b); -#define sub_0807EB28(s) asm(".short 0x085f");asm(".short " #s); -#define sub_0807EB8C() asm(".short 0x0464"); -#define sub_0807EBC0(s) asm(".short 0x0867");asm(".short " #s); -#define sub_0807EC1C(s) asm(".short 0x086d");asm(".short " #s); -#define sub_0807EE30() asm(".short 0x0475"); -#define sub_0807EF80(s) asm(".short 0x0879");asm(".short " #s); -#define sub_0807EFAC(s) asm(".short 0x087c");asm(".short " #s); -#define sub_0807EFE4() asm(".short 0x047e"); -#endif \ No newline at end of file -- cgit v1.2.3 From 8f7ad0a35c740c32c5763baa2bac998e260b2da9 Mon Sep 17 00:00:00 2001 From: octorock <79596758+octorock@users.noreply.github.com> Date: Sat, 6 Mar 2021 23:13:26 +0100 Subject: Fix parameters for all functions called from scripts --- include/greatFairy.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'include') diff --git a/include/greatFairy.h b/include/greatFairy.h index ae78ffda..d5e4906b 100644 --- a/include/greatFairy.h +++ b/include/greatFairy.h @@ -46,9 +46,4 @@ extern u8 gUnk_0812079C[8]; extern s16 gSineTable[]; extern s8 gUnk_081207AC[]; -typedef struct { - s32 unk0; - s32 unk4; -} struct_08087424; - #endif -- cgit v1.2.3 From 9bef8b068c7b59c2e1f71f5852bb671e41c48734 Mon Sep 17 00:00:00 2001 From: Henny022p Date: Mon, 8 Mar 2021 00:52:06 +0100 Subject: naming stuff --- include/script.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/script.h b/include/script.h index aebc64dd..b1aeca73 100644 --- a/include/script.h +++ b/include/script.h @@ -5,7 +5,7 @@ typedef struct ScriptExecutionContext { u16* scriptInstructionPointer; - u32 unk_04; + u32 intVariable; u32 unk_08; u8 unk_0C[0x4]; // unused u16 wait; -- cgit v1.2.3 From 5e2af32bb11f35dee966343959d955147c660204 Mon Sep 17 00:00:00 2001 From: Henny022p Date: Tue, 9 Mar 2021 01:28:13 +0100 Subject: named some stuff --- include/functions.h | 6 +----- include/manager.h | 2 +- include/script.h | 23 ++++++++++++++--------- 3 files changed, 16 insertions(+), 15 deletions(-) (limited to 'include') diff --git a/include/functions.h b/include/functions.h index ecf438fb..097c9a73 100644 --- a/include/functions.h +++ b/include/functions.h @@ -83,12 +83,9 @@ extern u32 sub_080045D4(s16, s16, u32, u32); extern void sub_0806F69C(Entity*); extern void sub_0805E3A0(void*, u32); extern void sub_0806D0B0(Entity*); -extern void sub_0807DD64(Entity*); -extern void sub_0807DDE4(Entity*); extern void sub_0806D02C(Entity*); extern u32 sub_0806F5A4(u32); extern void sub_08078784(Entity*, u32); -extern void sub_0807DD50(Entity*); extern s32 sub_0806ED9C(Entity*, u32, u32); extern void sub_0807000C(Entity*); extern void sub_0805E47C(Entity*); @@ -100,7 +97,6 @@ extern s32 sub_0806F078(Entity*, s32); extern void sub_0801D2B4(Entity*, u32); extern void sub_0806FD3C(Entity*); extern u32 sub_0801E99C(Entity*); -extern void sub_0807DD50(Entity*); extern void sub_0806F118(Entity*); extern void sub_0805ED14(u32*); extern void sub_080A7C18(u32, u32, u32); @@ -278,7 +274,7 @@ extern u32 sub_08052734(); // has Dungeon Map? extern u32 sub_08052764(); // has Dungeon Compass? extern u32 sub_0805279C(); // has Dungeon Big Key? extern u32 sub_080527CC(); // num Dungeon small keys? -extern u32 sub_08053FE0(); +extern u32 GetItemPrice(); extern void sub_08078790(Entity*, u32); extern void sub_080788E0(Entity*); extern void sub_08078AA8(u32, u32); diff --git a/include/manager.h b/include/manager.h index f292baf2..d86f203c 100644 --- a/include/manager.h +++ b/include/manager.h @@ -26,7 +26,7 @@ typedef struct Manager { /*0x11*/ u8 unk_11[3]; /*0x14*/ struct Manager* parent; /*0x18*/ u8 unk_18[0x8]; - // union SplitHWord unk_20; + // union SplitHWord y; // u16 unk_22; // u16 unk_24; // u16 unk_26; diff --git a/include/script.h b/include/script.h index b1aeca73..cfc2c180 100644 --- a/include/script.h +++ b/include/script.h @@ -6,7 +6,7 @@ typedef struct ScriptExecutionContext { u16* scriptInstructionPointer; u32 intVariable; - u32 unk_08; + u32 postScriptActions; u8 unk_0C[0x4]; // unused u16 wait; u16 unk_12; @@ -15,22 +15,27 @@ typedef struct ScriptExecutionContext { u8 unk_19; u8 unk_1A; u8 unk_1B; // unused - union SplitWord unk_1C; - union SplitWord unk_20; + union SplitWord x; + union SplitWord y; } ScriptExecutionContext; -extern void ExecuteScriptCommandSet(Entity*, ScriptExecutionContext*); +void ExecuteScript(Entity* entity, ScriptExecutionContext* context); extern u32 GetNextScriptCommandHalfword(u16*); extern u32 GetNextScriptCommandWord(u16*); extern u32 GetNextScriptCommandWordAfterCommandMetadata(u16*); extern u32 GetNextScriptCommandHalfwordAfterCommandMetadata(u16*); -extern void StartPlayerScript(u16*); +void UnloadCutsceneData(Entity* entity); +void StartPlayerScript(u16*); -extern void sub_0807DEDC(Entity*, ScriptExecutionContext*, u32, u32); +void sub_0807DD50(Entity* entity); +void sub_0807DD64(Entity* entity); +void sub_0807DD80(Entity* entity, u16* script); +void sub_0807DEDC(Entity*, ScriptExecutionContext*, u32, u32); -extern ScriptExecutionContext* StartCutscene(Entity*, u16*); -extern void sub_0807DDAC(Entity*, void (*function)(Entity*, ScriptExecutionContext*)); -extern void sub_0807DD94(Entity*, void (*function)(Entity*, ScriptExecutionContext*)); +ScriptExecutionContext* StartCutscene(Entity* entity, u16* script); +void ExecuteScriptForEntity(Entity* entity, void (*postScriptCallback)(Entity*, ScriptExecutionContext*)); +void HandleEntity0x82Actions(Entity* entity); +void sub_0807DD94(Entity*, void (*function)(Entity*, ScriptExecutionContext*)); #endif -- cgit v1.2.3 From e251d79ffd4ee1c4b10def3ecb41f2d572c63664 Mon Sep 17 00:00:00 2001 From: theo3 Date: Sat, 13 Mar 2021 01:14:46 -0800 Subject: =?UTF-8?q?quick=20fix=20=F0=9F=99=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/entity.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/entity.h b/include/entity.h index a1dd6d93..f3a76a68 100644 --- a/include/entity.h +++ b/include/entity.h @@ -92,7 +92,7 @@ typedef struct Entity { /*0x1e*/ u8 frameIndex; /*0x1f*/ u8 lastFrameIndex; /*0x20*/ s32 field_0x20; - /*0x24*/ s16 nonPlanarMovement; + /*0x24*/ s16 speed; /*0x26*/ u8 spriteAnimation[3]; /*0x29*/ struct { /* */ u8 b0 : 3; // 1-4 -- cgit v1.2.3