executeScriptCommandSet: Split stuff into headers.

This commit is contained in:
Ibot02 2021-01-15 22:46:43 +01:00
parent 63038b4c6b
commit a14614a1a3
12 changed files with 360 additions and 370 deletions

View File

@ -290,4 +290,22 @@ extern u32 sub_08079F8C(void);
extern void sub_080A1ED0(u32, u32, u32);
extern void DeleteManager(Manager*);
extern bool32 CheckPlayerInRegion(u32 centerX, u32 centerY, u32 radiusX, u32 radiusY);
extern u32 sub_0806F5B0(u32);
extern void sub_0801DFB4(Entity*, u32, u32, u32);
extern void sub_0801E00C();
extern void sub_08050038(u32);
extern void sub_080500F4(u32);
extern void sub_08050110(u32, u32, u32, u32);
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 void sub_08078790(Entity*, u32);
extern void sub_080788E0(Entity*);
extern void sub_08078AA8(u32, u32);
extern void sub_08078B48(void);
extern void sub_0807919C();
extern void sub_0807CAA0(u32, u32);
extern void sub_08080964(u16, u32);
#endif

View File

@ -41,7 +41,7 @@ extern const s16 GreatFairy_RippleOffsets[10];
extern u32 gUnk_02034350;
extern RoomVars gRoomVars;
extern Screen gScreen;
extern u32 gUnk_02033280;
extern struct_02033280 gUnk_02033280;
extern u8 gUnk_0812079C[8];
extern s16 gSineTable[];
extern s8 gUnk_081207AC[];

33
include/script.h Normal file
View File

@ -0,0 +1,33 @@
#ifndef SCRIPT_H
#define SCRIPT_H
#include "global.h"
typedef struct {
u16 * unk_00;
u32 unk_04;
u32 unk_08;
u8 unk_0C[0x4];//unused
u16 unk_10;
u16 unk_12;
u32 unk_14;
u8 unk_18;
u8 unk_19;
u8 unk_1A;
u8 unk_1B;//unused
union SplitWord unk_1C;
union SplitWord unk_20;
} ScriptExecutionContext;
extern void ExecuteScriptCommandSet(Entity*, ScriptExecutionContext*);
extern u32 GetNextScriptCommandHalfword(u16*);
extern u32 GetNextScriptCommandWord(u16*);
extern u32 GetNextScriptCommandWordAfterCommandMetadata(u16*);
extern u32 GetNextScriptCommandHalfwordAfterCommandMetadata(u16*);
extern void StartPlayerScript(u32);
extern void sub_0807DEDC(Entity*, ScriptExecutionContext*, u32, u32);
#endif

View File

@ -13,6 +13,14 @@ typedef struct {
u8 gameLanguage;
} struct_02000000;
typedef struct {
u8 unk_00;
u8 unk_01;
u8 unk_02[0xE];
} struct_02000040;
extern struct_02000040 gUnk_02000040;
typedef struct {
u16 field_0x0;
u16 field_0x2;
@ -154,6 +162,16 @@ typedef struct {
extern struct_02024490 gUnk_02024490;
typedef struct {
u32 unk_00;
u16 unk_04;
u8 unk_06;
u8 unk_07;
u8 unk_08;
} struct_02033280;
extern struct_02033280 gUnk_02033280;
typedef struct {
u16 unk_00;
u8 unk_02[0xE];
@ -191,4 +209,7 @@ extern BG3Buffer gBG3Buffer;
static_assert(sizeof(BG3Buffer) == 0x1000);
*/
extern u8 gUnk_02022740[];
extern u8 gUnk_02034490;
#endif

View File

@ -674,7 +674,7 @@ SECTIONS {
src/flags.o(.text);
src/code_0807CC3C.o(.text);
asm/code_0807CC3C.o(.text);
src/code_0807DF74.o(.text);
src/executeScriptCommandSet.o(.text);
asm/code_0807F0D8.o(.text);
src/code_0808091C.o(.text);
asm/code_0808091C.o(.text);
@ -1013,7 +1013,7 @@ SECTIONS {
data/data_0811BD44.o(.rodata);
data/room_headers.o(.rodata);
data/data_0811E454.o(.rodata);
src/code_0807DF74.o(.rodata);
src/executeScriptCommandSet.o(.rodata);
data/data_0811E750.o(.rodata);
src/object/greatFairy.o(.rodata);
data/animations/greatFairy.o(.rodata);

View File

@ -14,7 +14,6 @@ void sub_0802C1C0(Entity*);
u32 sub_0802C020(Entity*);
void sub_0802C058(Entity*, u32);
bool32 sub_0802C06C(Entity*);
void sub_08080964(u32, u32);
void sub_0802C1CC(Entity*);
bool32 sub_0802C0E8(Entity*);

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,6 @@
#include "functions.h"
#include "textbox.h"
extern u8 gUnk_02033280[];
extern void (*gUnk_08111A80[])(Entity*);
extern void (*gUnk_08111A8C[])(Entity*);
extern Dialog gUnk_08111A94[];
@ -99,7 +98,7 @@ u32 sub_08069480(Entity* this) {
void sub_0806948C(Entity* this, u32* param_1) {
param_1[5] = CheckKinstoneFused((sub_08069480(this) << 24) >> 24);
gUnk_02033280[7] |= 1;
gUnk_02033280.unk_07 |= 1;
}
void sub_080694B0(Entity* this) {

View File

@ -7,11 +7,6 @@
#include "room.h"
#include "structures.h"
typedef struct {
u8 filler[7];
u8 unk;
} struct_02033280;
extern void sub_08060528(Entity*);
extern void* GetCurrentRoomProperty(u32);
extern void sub_0806EE04(Entity*, void*, u32);
@ -43,7 +38,6 @@ extern s8* gUnk_0810A918[];
extern void (*const gUnk_0810AA24[])(Entity*);
extern Dialog gUnk_0810AA30[];
extern struct_02033280 gUnk_02033280;
void Postman(Entity* this) {
if ((this->flags & 2) != 0) {
@ -213,7 +207,7 @@ void sub_08060700(Entity* entity, u32 arg1) {
u32 x = coords->x + gRoomControls.roomOriginX;
u32 y = coords->y + gRoomControls.roomOriginY;
sub_0807DEDC(entity, arg1, x, y);
gUnk_02033280.unk |= 1;
gUnk_02033280.unk_07 |= 1;
}
void sub_0806075C(Entity* this) {

View File

@ -42,7 +42,6 @@ extern SpriteLoadData* gUnk_0810B6EC[];
extern u8 gUnk_0810B78C[];
extern struct_0810B680 gUnk_0810B680[];
extern u16 gUnk_0810B74A[];
extern u8 gUnk_02033280[];
extern u8 gUnk_0810B748[];
extern u32 gUnk_0810B740[];
extern u16 gUnk_0810B790[];
@ -242,7 +241,7 @@ void sub_08061E90(Entity* this, Entity* arg1) {
arg1->spriteIndex = 1;
}
if (--arg1->spriteIndex != 0) {
gUnk_02033280[6] = 0;
gUnk_02033280.unk_06 = 0;
}
}

View File

@ -22,7 +22,6 @@ extern Entity gPlayerEntity;
extern RoomControls gRoomControls;
extern void (*gUnk_08110BD8[])(Entity* ent);
extern u8 gUnk_02033280[];
extern u16 gUnk_08110BE0[];
void Zelda(Entity* ent) {
@ -165,12 +164,12 @@ void sub_08066E80(Entity* ent, u8* param_2) {
case 4:
UpdateAnimationSingleFrame(ent);
if (ent->frames.b.f3) {
gUnk_02033280[7] |= 1;
gUnk_02033280.unk_07 |= 1;
return;
}
}
ent->field_0x80.HWORD = ent->animIndex;
gUnk_02033280[6] = 0;
gUnk_02033280.unk_06 = 0;
}
void sub_08066F94(void) {

View File

@ -2,8 +2,8 @@
#include "entity.h"
#include "room.h"
#include "screen.h"
#include "greatFairy.h"
#include "structures.h"
#include "greatFairy.h"
#include "functions.h"
enum {
@ -169,7 +169,7 @@ void GreatFairy_WingsUpdate(Entity* this) {
this->action = 2;
sub_0805EC60(this);
gRoomVars.greatFairyState |= 32;
gUnk_02033280 |= 4;
gUnk_02033280.unk_00 |= 4;
} else {
sub_0805EC9C(this, this->nonPlanarMovement, 256, 0);
}