diff --git a/data/scripts/script_0800E8D6.inc b/data/scripts/script_0800E8D6.inc index 47f4bfa7..3e273e5c 100644 --- a/data/scripts/script_0800E8D6.inc +++ b/data/scripts/script_0800E8D6.inc @@ -11,5 +11,5 @@ script_0800E8D6: SetLocalFlag 0x0091 TextboxNoOverlapFollow 0x4508 _0807EA94 - Call FUN_0806c598 + Call sub_0806C598 SCRIPT_END 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 diff --git a/src/code_0805436C.c b/src/code_0805436C.c index 76a9b18c..142eb474 100644 --- a/src/code_0805436C.c +++ b/src/code_0805436C.c @@ -168,11 +168,11 @@ void sub_08054524(void) { } #endif -void sub_08054564(void) { +void sub_08054564() { gRoomVars.filler[2] = 1; } -void sub_08054570(void) { +void sub_08054570() { gRoomVars.filler[2] = 0; } diff --git a/src/code_0805EC04.c b/src/code_0805EC04.c index 1981f507..6c847707 100644 --- a/src/code_0805EC04.c +++ b/src/code_0805EC04.c @@ -104,4 +104,4 @@ void sub_0805ED14(u32 param_1) { gPlayerState.field_0x9c = param_1; gPlayerState.field_0x98 = 0; gPlayerState.field_0x9a = 0; -} \ No newline at end of file +} diff --git a/src/enemy/smallPesto.c b/src/enemy/smallPesto.c index f1b039f4..a3aebc73 100644 --- a/src/enemy/smallPesto.c +++ b/src/enemy/smallPesto.c @@ -101,7 +101,6 @@ void sub_08031770(Entity* this) { this->attachedEntity = NULL; } } - return; } void sub_080317B4(Entity* this) { diff --git a/src/entity.c b/src/entity.c index cb81ae21..2e99ed68 100644 --- a/src/entity.c +++ b/src/entity.c @@ -122,7 +122,6 @@ void ClearAllDeletedEntities(void) { ClearDeletedEntity(ent); } } while (ent++, ent < (&gPlayerEntity + 80)); - return; } extern u8 gEntCount; diff --git a/src/intro.c b/src/intro.c index 9bc22124..891544d3 100644 --- a/src/intro.c +++ b/src/intro.c @@ -212,7 +212,6 @@ static void UpdatePressStartIcon(void) { gOamCmd.x = 120; gOamCmd.y = 152; sub_080ADA14(511, 1); - return; } static void UpdateSwordBgAffineData(void) { diff --git a/src/npc/anju.c b/src/npc/anju.c index b0b0ee91..f5cc69a0 100644 --- a/src/npc/anju.c +++ b/src/npc/anju.c @@ -38,7 +38,6 @@ void Anju(Entity* this) { if (UpdateFuseInteraction(this)) { this->action = 1; } - default: } } diff --git a/src/npc/beedle.c b/src/npc/beedle.c index 9e7a5755..0e9a95ff 100644 --- a/src/npc/beedle.c +++ b/src/npc/beedle.c @@ -148,17 +148,17 @@ void sub_0806346C(Entity* this) { } } -void sub_080634E4(Entity* this, u32* param_1) { - param_1[1] = this->type2; +void sub_080634E4(Entity* this, ScriptExecutionContext* context) { + context->unk_04 = this->type2; } void sub_080634EC(Entity* this) { gRoomVars.itemForSaleIndex = gUnk_0810C88C[this->type2]; } -void sub_08063504(Entity* this, u32* param_2) { +void sub_08063504(Entity* this, ScriptExecutionContext* context) { u32 uVar1; uVar1 = sub_080544DC(gUnk_0810C88C[this->type2]); - param_2[5] = BOOLCAST(uVar1); + context->condition = BOOLCAST(uVar1); } diff --git a/src/npc/bladeBrothers.c b/src/npc/bladeBrothers.c index 913f30cc..10bf8d4a 100644 --- a/src/npc/bladeBrothers.c +++ b/src/npc/bladeBrothers.c @@ -195,53 +195,50 @@ void sub_08068C6C(Entity* this) { sub_080A7C18(gUnk_0811162B[this->actionDelay] & 0xffffff7f, 0, 0); } -void sub_08068C8C(Entity* param_1, Entity* param_2) { +void sub_08068C8C(Entity* this, ScriptExecutionContext* context) { u8* arr = gUnk_0811162B + 0xd; - - *(u32*)¶m_2->animationState = *(u32*)(arr + param_1->actionDelay * 4); + context->condition = *(u32*)(arr + this->actionDelay * 4); } -void sub_08068CA0(Entity* param_1, Entity* param_2) { +void sub_08068CA0(Entity* this, ScriptExecutionContext* context) { u8 bVar1; u32 uVar2; - bVar1 = param_1->type; + bVar1 = this->type; if (bVar1 == 1) { - *(u32*)¶m_2->animationState = bVar1; + context->condition = bVar1; uVar2 = GetInventoryValue(0x48); // spin attack if (uVar2 == 0) { - *(u32*)¶m_2->animationState = 0; + context->condition = 0; } uVar2 = GetInventoryValue(0x4b); // rock breaker if (uVar2 == 0) { - *(u32*)¶m_2->animationState = 0; + context->condition = 0; } uVar2 = GetInventoryValue(0x4a); // dash attack if (uVar2 == 0) { - *(u32*)¶m_2->animationState = 0; + context->condition = 0; } uVar2 = GetInventoryValue(0x4e); // down thrust if (uVar2 != 0) { return; } } else { - uVar2 = GetInventoryValue(gUnk_0811162B[param_1->actionDelay] & -0x81); + uVar2 = GetInventoryValue(gUnk_0811162B[this->actionDelay] & -0x81); if (uVar2 != 0) { uVar2 = 1; } } - *(u32*)¶m_2->animationState = uVar2; + context->condition = uVar2; } -void sub_08068CFC(Entity* param_1, Entity* param_2, u32 param_3, u32 param_4) - -{ +void sub_08068CFC(Entity* this, ScriptExecutionContext* context) { u8 bVar1; u8 itemID; u32 uVar2; - *(u32*)¶m_2->animationState = 0; - bVar1 = param_1->actionDelay; + context->condition = 0; + bVar1 = this->actionDelay; if (bVar1 > 10) return; @@ -302,7 +299,7 @@ LABEL1: return; } switchD_08068d12_caseD_0: - *(u32*)¶m_2->animationState = 1; + context->condition = 1; } // Introduction dialoague @@ -350,16 +347,16 @@ void sub_08068E90(Entity* this) { *(u16*)&s->field_0xac = (1 << (gUnk_08111740[this->actionDelay] - 1)) | *(u16*)&s->field_0xac; } -void sub_08068EB4(void) { +void sub_08068EB4() { gPlayerState.field_0xab = 0; } -void sub_08068EC4(Entity* param_1, Entity* param_2) { - if (gUnk_08111740[param_1->actionDelay] == gPlayerState.field_0xab) { - *(u16*)¶m_2->flags = gUnk_0811172A[param_1->actionDelay]; - *(u32*)¶m_2->animationState = 1; +void sub_08068EC4(Entity* this, ScriptExecutionContext* context) { + if (gUnk_08111740[this->actionDelay] == gPlayerState.field_0xab) { + context->wait = gUnk_0811172A[this->actionDelay]; + context->condition = 1; } else { - *(u32*)¶m_2->animationState = 0; + context->condition = 0; } } @@ -386,7 +383,6 @@ void sub_08068F3C(Entity* this) { } void BladeBrothers_Fusion(Entity* this) { - if (this->action == 0) { this->action += 1; this->spriteSettings.b.draw = 0; diff --git a/src/npc/carpenter.c b/src/npc/carpenter.c index 37585ed0..1c6392e4 100644 --- a/src/npc/carpenter.c +++ b/src/npc/carpenter.c @@ -2,6 +2,7 @@ #include "entity.h" #include "sprite.h" #include "player.h" +#include "script.h" extern void DeleteThisEntity(); extern u32 LoadExtraSpriteData(Entity*, SpriteLoadData*); @@ -10,7 +11,6 @@ extern void sub_0805E3A0(Entity*, u32); extern void sub_0807DD64(Entity*); extern u32 GetFacingDirection(Entity*, Entity*); extern void sub_0806F118(Entity*); -extern void sub_0807DDAC(Entity*, u32); extern void sub_0807DDE4(Entity*); extern u32 UpdateFuseInteraction(Entity*); extern void SetSpriteSubEntryOffsetData2(Entity*, u32, u32); @@ -69,6 +69,6 @@ void Carpenter_Head(Entity* this) { } } -void sub_080672B0(Entity* this, u32 param_2) { - InitializeAnimation(this, *(u32*)(param_2 + 4) + (this->animationState >> 1) + this->type * 8); +void sub_080672B0(Entity* this, ScriptExecutionContext* context) { + InitializeAnimation(this, context->unk_04 + (this->animationState >> 1) + this->type * 8); } diff --git a/src/npc/dampe.c b/src/npc/dampe.c index f424c1d8..c9ec14b1 100644 --- a/src/npc/dampe.c +++ b/src/npc/dampe.c @@ -6,25 +6,19 @@ #include "sprite.h" #include "textbox.h" #include "npc.h" +#include "script.h" extern void sub_0805E3A0(Entity*, u32); extern void sub_0807DD50(Entity*); extern u32 sub_0806F5A4(u32); extern void sub_0806F118(Entity*); -extern void sub_0807DD94(Entity*, u32); extern u32 sub_0801E99C(void); extern void sub_08078784(Entity*, u32); extern u16 gUnk_08113344[]; extern u16 gUnk_0811334A[]; -typedef struct { - u8 filler[18]; - u32 unk; -} struct_0806BE84; - void Dampe(Entity* this) { - switch (this->action) { case 0: this->action = 1; @@ -47,7 +41,6 @@ void Dampe(Entity* this) { if (UpdateFuseInteraction(this)) { this->action = 1; } - default: } } @@ -66,15 +59,15 @@ void Dampe_Fusion(Entity* this) { } } -void sub_0806BE84(Entity* this, struct_0806BE84* r1) { +void sub_0806BE84(Entity* this, ScriptExecutionContext* context) { u32 msgIndex; - r1->unk = 0; + context->condition = 0; msgIndex = 1; if (!CheckLocalFlag(0x69)) { msgIndex = 0; SetLocalFlag(0x69); - r1->unk = 1; + context->condition = 1; } // Graveyard key if (GetInventoryValue(0x3C) >= 2) { @@ -83,16 +76,16 @@ void sub_0806BE84(Entity* this, struct_0806BE84* r1) { TextboxNoOverlap(gUnk_08113344[msgIndex], this); } -void sub_0806BEC8(Entity* this, struct_0806BE84* r1) { +void sub_0806BEC8(Entity* this, ScriptExecutionContext* context) { u32 hasGraveyardKey; u32 msgIndex; msgIndex = 0; - r1->unk = 0; + context->condition = 0; hasGraveyardKey = GetInventoryValue(0x3C); if (hasGraveyardKey == 1) { msgIndex = 1; - r1->unk = 1; + context->condition = 1; } else if (hasGraveyardKey >= 2) { msgIndex = 2; } @@ -107,10 +100,10 @@ void sub_0806BEFC() { SetTileType(0x181, 0x5CF, 1); } -void sub_0806BF44(Entity* this, struct_0806BE84* r1) { - r1->unk = 0; +void sub_0806BF44(Entity* this, ScriptExecutionContext* context) { + context->condition = 0; if (((this->x.HALF.HI - gRoomControls.roomScrollX) + 0x10U < 0x110) && ((this->y.HALF.HI - gRoomControls.roomScrollY) + 0x18U < 0xD0)) { - r1->unk = 1; + context->condition = 1; } } diff --git a/src/npc/emma.c b/src/npc/emma.c index c43b961c..7d4ac28d 100644 --- a/src/npc/emma.c +++ b/src/npc/emma.c @@ -10,36 +10,24 @@ extern void sub_0807DD50(Entity*); extern void sub_0807DD94(Entity*, u32); extern void DoExitTransition(u32*); -void Emma(Entity* param_1) - -{ - if (param_1->action == 0) { - param_1->action += 1; - sub_0805E3A0(param_1, 2); - sub_0807DD50(param_1); +void Emma(Entity* this) { + if (this->action == 0) { + this->action += 1; + sub_0805E3A0(this, 2); + sub_0807DD50(this); } else { - sub_0807DD94(param_1, 0); + sub_0807DD94(this, 0); } - return; } -void sub_0806C578(void) - -{ +void sub_0806C578() { DoExitTransition(&gUnk_0813AD10); - return; } -void sub_0806C588(void) - -{ +void sub_0806C588() { DoExitTransition(&gUnk_0813AD24); - return; } -void FUN_0806c598(void) - -{ +void sub_0806C598() { DoExitTransition(&gUnk_0813AD38); - return; } diff --git a/src/npc/ezloCap.c b/src/npc/ezloCap.c index ae684276..d4c59e30 100644 --- a/src/npc/ezloCap.c +++ b/src/npc/ezloCap.c @@ -39,35 +39,21 @@ void EzloCap(Entity* this) { UpdateAnimationSingleFrame(this); } -typedef struct { - u8 unk_00[4]; - u32 field_04; - u32 field_08; - u8 unk_0c[8]; - u32 field_14; - u8 unk_18; - u8 field_19; - u8 unk_1a[3]; - u16 field_1e; - u8 unk_20[2]; - u16 field_22; -} paramStruct; - -void sub_0806D8A0(Entity* this, paramStruct* param_2) { +void sub_0806D8A0(Entity* this, ScriptExecutionContext* context) { s32 xOffset; s32 yOffset; - param_2->field_19 = 8; - param_2->field_08 |= 2; - param_2->field_14 = 0; + context->unk_19 = 8; + context->unk_08 |= 2; + context->condition = 0; xOffset = 16; if (this->spriteSettings.b.flipX) { xOffset = -xOffset; } xOffset += gPlayerEntity.x.HALF.HI; yOffset = gPlayerEntity.y.HALF.HI + 2; - param_2->field_1e = xOffset; - param_2->field_22 = yOffset; + context->unk_1C.HALF.HI = xOffset; + context->unk_20.HALF.HI = yOffset; xOffset -= this->x.HALF.HI; this->direction = sub_080045DA(xOffset, yOffset - this->y.HALF.HI); @@ -119,15 +105,15 @@ void NPC4E(Entity* this) { } } -void sub_0806DA04(Entity* this, u32* param_2) { +void sub_0806DA04(Entity* this, ScriptExecutionContext* context) { // TODO gUnk_0811415C should be a gUnk_0810C89C_struct[], but then a lot of bytes everywhere are wrong? gUnk_0810C89C_struct* a = (gUnk_0810C89C_struct*)&( - (gUnk_0810C89C_struct*)gUnk_0811415C)[param_2[1]]; // cast necessary to no longer make it a const* ? + (gUnk_0810C89C_struct*)gUnk_0811415C)[context->unk_04]; // cast necessary to no longer make it a const* ? sub_08078850(this, 1, a->unk_04, a); } -void sub_0806DA1C(Entity* this, u32* param_2) { - sub_0808091C((ScreenTransitionData*)(gUnk_081141A4)[param_2[1]], (u32)(gUnk_081141E4[param_2[1]])); +void sub_0806DA1C(Entity* this, ScriptExecutionContext* context) { + sub_0808091C((ScreenTransitionData*)(gUnk_081141A4)[context->unk_04], (u32)(gUnk_081141E4[context->unk_04])); } // Returns the kinstone id? @@ -168,10 +154,8 @@ u8 sub_0806DA3C(Entity* this) { } // Check whether a kinstone fusion is possible and store the result somewhere in param_2? -void sub_0806DAAC(Entity* this, u32* param_2) { - u32 uVar1; - uVar1 = CheckKinstoneFused(sub_0806DA3C(this)); - param_2[5] = uVar1; +void sub_0806DAAC(Entity* this, ScriptExecutionContext* context) { + context->condition = CheckKinstoneFused(sub_0806DA3C(this)); gActiveScriptInfo.flags |= 1; } @@ -202,18 +186,16 @@ void sub_0806DAE8(Entity* this) { SoundReq(0xcd); } -// Unknown param_2 struct -void sub_0806DB44(Entity* this, u32* param_2) { - param_2[5] = 0; +void sub_0806DB44(Entity* this, ScriptExecutionContext* context) { + context->condition = 0; if (CheckLocalFlag(0xee) != 0 && CheckLocalFlag(0xef) != 0 && CheckLocalFlag(0xf0) != 0 && CheckLocalFlag(0xf1) != 0 && CheckLocalFlag(0xf2) != 0) { - param_2[5] = 1; + context->condition = 1; } } -// The unused param just had to be added, so that a mov r1, #0 in NPC4E_Fusion is matching correctly -void sub_0806DB84(Entity* this, u8 unused) { +void sub_0806DB84(Entity* this, ScriptExecutionContext* context) { Entity* ent; this->hitbox = (Hitbox*)&gUnk_08114154; ent = CreateObject(0x3e, 4, 0); diff --git a/src/npc/forestMinish.c b/src/npc/forestMinish.c index ce829a81..5f1686c4 100644 --- a/src/npc/forestMinish.c +++ b/src/npc/forestMinish.c @@ -224,11 +224,11 @@ void sub_080602BC(Entity* this) { TextboxNoOverlap(gUnk_0810A362[index], this); } -void sub_0806030C(Entity* this, u32* arg1) { - ModBombs(*(arg1 + 1)); +void sub_0806030C(Entity* this, ScriptExecutionContext* context) { + ModBombs(context->unk_04); } -void sub_08060318(void) { +void sub_08060318() { Entity* ent; int i; @@ -241,11 +241,11 @@ void sub_08060318(void) { } } -void sub_08060340(void) { +void sub_08060340() { gSave.unk490 = gSave.unk50; } -u32 sub_08060354(void) { +u32 sub_08060354() { u32 iVar1; s32 iVar2; diff --git a/src/npc/goron.c b/src/npc/goron.c index b0b60222..46a6e940 100644 --- a/src/npc/goron.c +++ b/src/npc/goron.c @@ -97,8 +97,8 @@ u32 sub_08069480(Entity* this) { return (sub_0801E99C(this) << 24) >> 24; } -void sub_0806948C(Entity* this, u32* param_1) { - param_1[5] = CheckKinstoneFused((sub_08069480(this) << 24) >> 24); +void sub_0806948C(Entity* this, ScriptExecutionContext* context) { + context->condition = CheckKinstoneFused((sub_08069480(this) << 24) >> 24); gActiveScriptInfo.flags |= 1; } diff --git a/src/npc/guard.c b/src/npc/guard.c index 782253ee..3a43c14c 100644 --- a/src/npc/guard.c +++ b/src/npc/guard.c @@ -4,6 +4,7 @@ #include "flags.h" #include "textbox.h" #include "room.h" +#include "script.h" typedef struct { u32 unk; @@ -15,11 +16,6 @@ typedef struct { u8 unk; } ScreenTransition; -typedef struct { - u32 unk; - u32 unk2; -} struct_08064050; - extern void sub_08063D24(Entity*); extern void sub_0806ED78(Entity*); extern u32 GetFacingDirection(Entity*, Entity*); @@ -27,7 +23,6 @@ extern u32 sub_0806F5A4(u32); extern void sub_0806EE20(Entity*); extern void sub_08064428(Entity*); extern u32 sub_0805ACC0(Entity*); -extern void sub_0807DDAC(Entity*, u32); extern void sub_0807DDE4(Entity*); extern void sub_0807000C(Entity*); extern void sub_0806EE04(Entity*, void*, u32); @@ -219,22 +214,20 @@ void sub_08064030(Entity* arg0, Entity* arg1) { *(u32*)&arg1->animationState = (-gRoomVars.greatFairyState | gRoomVars.greatFairyState) >> 0x1f; } -void sub_08064044(void) { +void sub_08064044() { gScreenTransition.unk = 1; } -void sub_08064050(Entity* arg0, struct_08064050* arg1) { - u32 unk; - - arg1->unk2 = 0; - switch (arg0->type2) { +void sub_08064050(Entity* this, ScriptExecutionContext* context) { + context->unk_04 = 0; + switch (this->type2) { case 0x11: - arg1->unk2 = 1; + context->unk_04 = 1; break; case 0x12: - arg1->unk2 = 2; + context->unk_04 = 2; break; case 0x13: - arg1->unk2 = 3; + context->unk_04 = 3; } } diff --git a/src/npc/librari.c b/src/npc/librari.c index 72b4dfbe..30c5ea99 100644 --- a/src/npc/librari.c +++ b/src/npc/librari.c @@ -37,15 +37,15 @@ void Librari(Entity* this) { } } -void sub_0806B260(Entity* this, u32 arg1) { +void sub_0806B260(Entity* this, ScriptExecutionContext* context) { u32 index; - *(u32*)(arg1 + 0x14) = 0; + context->condition = 0; // flippers if (!GetInventoryValue(0x46)) { if (CheckGlobalFlag(0x29)) { index = 2; - *(u32*)(arg1 + 0x14) = 1; + context->condition = 1; } else if (!CheckLocalFlag(0x7a)) { index = 0; SetLocalFlag(0x7a); diff --git a/src/npc/simon.c b/src/npc/simon.c index 35397e80..2741f30a 100644 --- a/src/npc/simon.c +++ b/src/npc/simon.c @@ -27,7 +27,7 @@ void Simon(Entity* this) { } } -void sub_0806C224(void) { +void sub_0806C224() { DoExitTransition(&gUnk_0813AD60); gScreenTransition.transitionType = 6; } @@ -38,14 +38,14 @@ void Simon_CreateChest(Entity* this) { SoundReq(0x73); } -void sub_0806C280(void) { +void sub_0806C280() { SetGlobalFlag(MAROYA_WAKEUP); DoExitTransition(&gUnk_0813AD74); gScreenTransition.transitionType = 6; } -void sub_0806C2A0(u32* param_1, struct_0806C2A0* param_2) { - switch (param_2->unk) { +void sub_0806C2A0(Entity* this, ScriptExecutionContext* context) { + switch (context->unk_04) { case 0: DoFade(0xd, 4); break; diff --git a/src/npc/smith.c b/src/npc/smith.c index 3502d8bf..2ae9e7f7 100644 --- a/src/npc/smith.c +++ b/src/npc/smith.c @@ -16,7 +16,7 @@ extern void sub_0807DD50(Entity*); extern void sub_0807DDE4(Entity*); extern u32 UpdateFuseInteraction(Entity*); extern u32 GetAnimationState(Entity*); -extern void sub_08078850(u32, u32, u32, u32*); +extern void sub_08078850(Entity*, u32, u32, u32*); extern void sub_08078784(Entity*, u32); extern void (*const gUnk_08110360[])(Entity*); @@ -160,16 +160,16 @@ void sub_0806622C(Entity* this) { void nullsub_501(Entity* this) { } -void sub_08066258(void) { +void sub_08066258() { SoundReq(gUnk_081103D0[Random() & 7]); } -void sub_08066274(u32 arg0) { - sub_08078850(arg0, 1, 0, &gUnk_081103E0); +void sub_08066274(Entity* this) { + sub_08078850(this, 1, 0, &gUnk_081103E0); } -void sub_08066288(Entity* arg0) { - sub_08078784(arg0, arg0->field_0x68.HALF.LO); +void sub_08066288(Entity* this) { + sub_08078784(this, this->field_0x68.HALF.LO); } void Smith_Fusion(Entity* this) { diff --git a/src/npc/stamp.c b/src/npc/stamp.c index a30d31ad..870060ef 100644 --- a/src/npc/stamp.c +++ b/src/npc/stamp.c @@ -74,9 +74,7 @@ void sub_08062CA4(Entity* ent) { } void sub_08062CBC(Entity* ent) { - u32 uVar1; - - uVar1 = CheckKinstoneFused(44); + u32 uVar1 = CheckKinstoneFused(44); ShowNPCDialogue(ent, &gUnk_0810C2E4[(-uVar1 | uVar1) >> 31]); } diff --git a/src/npc/syrup.c b/src/npc/syrup.c index 307c75bd..7ca47dc1 100644 --- a/src/npc/syrup.c +++ b/src/npc/syrup.c @@ -56,8 +56,8 @@ void sub_0806A26C(Entity* this) { if (uVar2 = Random(), uVar2) { unk = -unk; // wtf?! } - pEVar1->spriteOffsetX = gUnk_081121DC[uVar2 & 7]; - pEVar1->spriteOffsetY = gUnk_081121DC[(uVar2 / 256) & 7] - 8; + pEVar1->spriteOffsetX = gUnk_081121D4[uVar2 & 7]; + pEVar1->spriteOffsetY = gUnk_081121D4[(uVar2 / 256) & 7] - 8; } } #else diff --git a/src/npc/talon.c b/src/npc/talon.c index 45278133..c3a680a2 100644 --- a/src/npc/talon.c +++ b/src/npc/talon.c @@ -134,12 +134,12 @@ void sub_0806574C(Entity* this) { this->field_0x6a.HALF.LO = this->animIndex; } -void sub_08065780(Entity* this, u16* param_2) { +void sub_08065780(Entity* this, ScriptExecutionContext* context) { u32 rand; rand = Random(); this->animationState = rand & 6; - param_2[8] = gUnk_0810FED8[rand >> 8 & 7]; + context->wait = gUnk_0810FED8[rand >> 8 & 7]; } void Talon_Head(Entity* this) { diff --git a/src/npc/townMinish.c b/src/npc/townMinish.c index 3f97b540..1aeca5b2 100644 --- a/src/npc/townMinish.c +++ b/src/npc/townMinish.c @@ -14,7 +14,7 @@ extern u32 sub_080002C0(); extern void sub_0806ACC4(Entity*); extern void sub_0806AEA8(); extern void sub_0806AEE4(Entity*); -extern void sub_0806AFE8(Entity*, s32*); +extern void sub_0806AFE8(Entity*, ScriptExecutionContext*); extern s32 sub_0806EDD8(Entity*, u32, u32); extern u32 sub_0806F5B0(u32); extern void sub_08078784(Entity*, u32); @@ -26,7 +26,7 @@ extern u32 gUnk_081126D4[4]; extern u8 gUnk_081126E4[4]; extern void (*gUnk_081126E8[])(); extern Dialog gUnk_081126F0[0x10]; -extern void (*gUnk_08112BF0[])(Entity*, s32*); +extern void (*gUnk_08112BF0[])(Entity*, ScriptExecutionContext*); extern u16 gUnk_08112C40[5]; extern u16 gUnk_08112C4A[3]; extern u16 gUnk_08112C50[6]; @@ -118,7 +118,7 @@ void sub_0806ACC4(Entity* this) { this->action = 2; this->interactType = 0; InitializeAnimation(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)) + 8); - sub_0806AFE8(this, *(s32**)&this->cutsceneBeh); + sub_0806AFE8(this, *(ScriptExecutionContext**)&this->cutsceneBeh); } if (this->type == 1) { u8 idx = gPlayerEntity.animationState >> 1; @@ -223,19 +223,19 @@ void sub_0806AEE4(Entity* this) { } } -void sub_0806AF60(Entity* this, int* idx) { - InitializeAnimation(this, idx[1] + (this->animationState / 2)); +void sub_0806AF60(Entity* this, ScriptExecutionContext* context) { + InitializeAnimation(this, context->unk_04 + (this->animationState / 2)); } -void sub_0806AF70(Entity* this, u32 arg1) { +void sub_0806AF70(Entity* this, ScriptExecutionContext* context) { this->field_0x20 = 0x24000; } -void sub_0806AF78(Entity* this, u32 arg1) { +void sub_0806AF78(Entity* this, ScriptExecutionContext* context) { sub_08003FC4(this, 0x1800); if (0 <= this->height.WORD && this->field_0x20 < 1) { this->height.WORD = 0; - sub_0806AF70(this, arg1); + sub_0806AF70(this, context); } } @@ -253,12 +253,12 @@ void sub_0806AFBC(Entity* this) { ShowNPCDialogue(this, gUnk_081126F0 + this->type2 * 8 + idx); } -void sub_0806AFE8(Entity* this, s32* unk) { - unk[5] = 0; - gUnk_08112BF0[this->type2](this, unk); +void sub_0806AFE8(Entity* this, ScriptExecutionContext* context) { + context->condition = 0; + gUnk_08112BF0[this->type2](this, context); } -void sub_0806B004(Entity* this, int* unk) { +void sub_0806B004(Entity* this, ScriptExecutionContext* context) { int idx = 0; if (CheckGlobalFlag(0x29)) { @@ -267,7 +267,7 @@ void sub_0806B004(Entity* this, int* unk) { idx = 3; if (CheckLocalFlag(0x78) == 0) { idx = 2; - unk[5] = 1; + context->condition = 1; SetLocalFlag(0x78); } } else { diff --git a/src/npc/townsperson.c b/src/npc/townsperson.c index 26e063a2..9b097489 100644 --- a/src/npc/townsperson.c +++ b/src/npc/townsperson.c @@ -16,11 +16,6 @@ typedef struct { u8 unk3; } struct_0810B680; -typedef struct { - u32 unk; - u32 unk2; -} struct_08061FB8; - extern void (*const gUnk_0810B774[])(Entity*); extern void (*const gUnk_0810B77C[])(Entity*); extern void sub_08061CB4(Entity*, u32); @@ -183,6 +178,7 @@ void sub_08061E70(Entity* this) { } } +// FIXME this is actually (Entity* this, ScriptExecutionContext* context) void sub_08061E90(Entity* this, Entity* arg1) { u32 animIndex; s32 iVar4; @@ -258,10 +254,10 @@ void sub_08061FB0(Entity* this) { this->hitbox = NULL; } -void sub_08061FB8(Entity* this, struct_08061FB8* arg1) { +void sub_08061FB8(Entity* this, ScriptExecutionContext* context) { u8* temp = gUnk_0810B748; - sub_08078850(this, 1, temp[arg1->unk2], &gUnk_0810B740[arg1->unk2]); + sub_08078850(this, 1, temp[context->unk_04], &gUnk_0810B740[context->unk_04]); } void sub_08061FD8(Entity* this) { diff --git a/src/npc/windTribespeople.c b/src/npc/windTribespeople.c index 09a9b2cb..bbecda9b 100644 --- a/src/npc/windTribespeople.c +++ b/src/npc/windTribespeople.c @@ -21,7 +21,7 @@ extern void SetSpriteSubEntryOffsetData1(Entity*, u32, u32); extern void sub_0807000C(Entity*); extern void (*const gUnk_08113A7C[])(Entity*); -extern void (*const gUnk_08113A8C[])(Entity*, Entity*); +extern void (*const gUnk_08113A8C[])(Entity*, ScriptExecutionContext*); extern SpriteLoadData gUnk_08113A1C[]; extern u32 script_08014A80; @@ -111,10 +111,9 @@ void WindTribespeople_Head(Entity* this) { } } -// body and head entities? -void sub_0806C90C(Entity* param_1, Entity* param_2) { - *(u32*)¶m_2->animationState = 0; - gUnk_08113A8C[param_1->type2](param_1, param_2); +void sub_0806C90C(Entity* this, ScriptExecutionContext* context) { + context->condition = 0; + gUnk_08113A8C[this->type2](this, context); } void sub_0806C928(Entity* this) { diff --git a/src/npc/zelda.c b/src/npc/zelda.c index fad1be75..1eb8420f 100644 --- a/src/npc/zelda.c +++ b/src/npc/zelda.c @@ -24,59 +24,59 @@ extern RoomControls gRoomControls; extern void (*gUnk_08110BD8[])(Entity* ent); extern u16 gUnk_08110BE0[]; -void Zelda(Entity* ent) { - gUnk_08110BD8[ent->action](ent); +void Zelda(Entity* this) { + gUnk_08110BD8[this->action](this); } -void sub_08066CCC(Entity* ent) { - ent->action = 1; - ent->spriteSettings.b.draw = 1; - PrependEntityToList(ent, 7); - sub_0805E3A0(ent, 2); - sub_0807DD50(ent); +void sub_08066CCC(Entity* this) { + this->action = 1; + this->spriteSettings.b.draw = 1; + PrependEntityToList(this, 7); + sub_0805E3A0(this, 2); + sub_0807DD50(this); } -void sub_08066CF8(Entity* ent) { - sub_0807DD94(ent, NULL); +void sub_08066CF8(Entity* this) { + sub_0807DD94(this, NULL); } -void sub_08066D04(Entity* ent) { - ent->parent = FindEntityBySubtype(7, 0x2E); +void sub_08066D04(Entity* this) { + this->parent = FindEntityBySubtype(7, 0x2E); } -void sub_08066D14(Entity* ent, u32* param_2) { +void sub_08066D14(Entity* this, ScriptExecutionContext* context) { Entity* parent; - parent = ent->parent; + parent = this->parent; if (parent != NULL) { - ent->animationState = parent->animationState; - ent->spriteSettings.b.draw = 1; - CopyPosition(parent, ent); - sub_08068680(ent, ent->parent); - param_2[5] = 1; + this->animationState = parent->animationState; + this->spriteSettings.b.draw = 1; + CopyPosition(parent, this); + sub_08068680(this, this->parent); + context->condition = 1; } else { - param_2[5] = 0; + context->condition = 0; } } -void sub_08066D4C(Entity* ent, u32* param_2) { +void sub_08066D4C(Entity* this, ScriptExecutionContext* context) { Entity* parent; - parent = ent->parent; - if (ent->parent != NULL) { - CopyPosition(ent, parent); - ent->parent->spriteSettings.b.draw = 1; - ent->parent->animationState = ent->animationState; - ent->spriteSettings.b.draw = 0; - ent->field_0x17 &= 0xFE; - sub_08068694(ent, ent->parent); - param_2[5] = 1; + parent = this->parent; + if (this->parent != NULL) { + CopyPosition(this, parent); + this->parent->spriteSettings.b.draw = 1; + this->parent->animationState = this->animationState; + this->spriteSettings.b.draw = 0; + this->field_0x17 &= 0xFE; + sub_08068694(this, this->parent); + context->condition = 1; } else { - param_2[5] = 0; + context->condition = 0; } } -void sub_08066D94(Entity* ent) { +void sub_08066D94(Entity* this) { u32 roomID; Entity* npc; @@ -85,94 +85,94 @@ void sub_08066D94(Entity* ent) { if (npc != NULL) { npc->animationState = gPlayerEntity.animationState; npc->flags |= 0x20; - npc->animationState = GetAnimationState(ent); + npc->animationState = GetAnimationState(this); roomID = gRoomControls.roomID; npc->field_0x74.HWORD = roomID; - CopyPosition(ent, npc); + CopyPosition(this, npc); } DeleteThisEntity(); } -void sub_08066DE4(Entity* ent) { +void sub_08066DE4(Entity* this) { Entity* pEVar1; pEVar1 = FindEntityBySubtype(7, 0x2E); if (pEVar1 != NULL) { - CopyPosition(ent, pEVar1); - sub_080686C4(ent, pEVar1); + CopyPosition(this, pEVar1); + sub_080686C4(this, pEVar1); } } -void sub_08066E08(Entity* ent) { - InitAnimationForceUpdate(ent, 0x50); - ent->field_0x80.HWORD = ent->animIndex; +void sub_08066E08(Entity* this) { + InitAnimationForceUpdate(this, 0x50); + this->field_0x80.HWORD = this->animIndex; } -void sub_08066E20(Entity* ent) { - InitAnimationForceUpdate(ent, 0x44); - ent->field_0x80.HWORD = ent->animIndex; +void sub_08066E20(Entity* this) { + InitAnimationForceUpdate(this, 0x44); + this->field_0x80.HWORD = this->animIndex; } -void sub_08066E38(Entity* ent) { - InitAnimationForceUpdate(ent, 0x48); - ent->field_0x80.HWORD = ent->animIndex; +void sub_08066E38(Entity* this) { + InitAnimationForceUpdate(this, 0x48); + this->field_0x80.HWORD = this->animIndex; } -void sub_08066E50(Entity* ent) { - InitAnimationForceUpdate(ent, 0x4C); - ent->field_0x80.HWORD = ent->animIndex; +void sub_08066E50(Entity* this) { + InitAnimationForceUpdate(this, 0x4C); + this->field_0x80.HWORD = this->animIndex; } -void sub_08066E68(Entity* ent) { - InitAnimationForceUpdate(ent, 0x54); - ent->field_0x80.HWORD = ent->animIndex; +void sub_08066E68(Entity* this) { + InitAnimationForceUpdate(this, 0x54); + this->field_0x80.HWORD = this->animIndex; } -void sub_08066E80(Entity* ent, u8* param_2) { - switch (param_2[0x18]) { +void sub_08066E80(Entity* this, ScriptExecutionContext* context) { + switch (context->unk_18) { case 0: - param_2[0x18]++; - InitAnimationForceUpdate(ent, 0x16); + context->unk_18++; + InitAnimationForceUpdate(this, 0x16); break; case 1: - UpdateAnimationSingleFrame(ent); - if (ent->frames.all & 1) { - param_2[0x18]++; - ent->field_0x20 = 0x20000; - ent->frames.all &= 0xFE; + UpdateAnimationSingleFrame(this); + if (this->frames.all & 1) { + context->unk_18++; + this->field_0x20 = 0x20000; + this->frames.all &= 0xFE; SoundReq(0x7C); } break; case 2: - sub_0806F62C(ent, 0x100, 0x80); - sub_08003FC4(ent, 0x2000); - if (!(ent->frames.all & 1)) { - UpdateAnimationSingleFrame(ent); + sub_0806F62C(this, 0x100, 0x80); + sub_08003FC4(this, 0x2000); + if (!(this->frames.all & 1)) { + UpdateAnimationSingleFrame(this); } - if (ent->field_0x20 < 0) { - param_2[0x18]++; + if (this->field_0x20 < 0) { + context->unk_18++; } break; case 3: - sub_0806F62C(ent, 0x100, 0x80); - UpdateAnimationSingleFrame(ent); - if (sub_08003FC4(ent, 0x2000) == 0) { - param_2[0x18]++; - InitAnimationForceUpdate(ent, 0x1E); + sub_0806F62C(this, 0x100, 0x80); + UpdateAnimationSingleFrame(this); + if (sub_08003FC4(this, 0x2000) == 0) { + context->unk_18++; + InitAnimationForceUpdate(this, 0x1E); } break; case 4: - UpdateAnimationSingleFrame(ent); - if (ent->frames.b.f3) { + UpdateAnimationSingleFrame(this); + if (this->frames.b.f3) { gActiveScriptInfo.flags |= 1; return; } } - ent->field_0x80.HWORD = ent->animIndex; + this->field_0x80.HWORD = this->animIndex; gActiveScriptInfo.commandSize = 0; } -void sub_08066F94(void) { +void sub_08066F94() { u16 uVar1; u16* puVar2; @@ -184,7 +184,7 @@ void sub_08066F94(void) { } } -void sub_08066FB8(void) { +void sub_08066FB8() { u16 uVar1; u16* puVar2; diff --git a/src/object/greatFairy.c b/src/object/greatFairy.c index b4c07923..c52456ab 100644 --- a/src/object/greatFairy.c +++ b/src/object/greatFairy.c @@ -6,6 +6,7 @@ #include "greatFairy.h" #include "functions.h" #include "save.h" +#include "script.h" enum { BEHAVIORS, @@ -517,7 +518,7 @@ void sub_080873D0(Entity* this) { } } -void sub_080873FC(void) { +void sub_080873FC() { Entity* ent; SoundReq(0xf7); @@ -528,7 +529,7 @@ void sub_080873FC(void) { } } -void sub_08087424(Entity* arg0, struct_08087424* arg1) { +void sub_08087424(Entity* this, ScriptExecutionContext* context) { Entity* ent; sub_080791D0(); @@ -539,9 +540,9 @@ void sub_08087424(Entity* arg0, struct_08087424* arg1) { sub_0805E3A0(ent, 2); } - switch (arg1->unk4) { + switch (context->unk_04) { case 0: - gSave.stats.arrowCount = arg1->unk4; + gSave.stats.arrowCount = 0; break; case 1: gSave.stats.bombCount = 0; @@ -549,14 +550,14 @@ void sub_08087424(Entity* arg0, struct_08087424* arg1) { } } -void sub_0808747C(u32 arg0, u32 arg1) { - u32 iVar1; +void sub_0808747C(Entity* this, ScriptExecutionContext* context) { + u32 iVar1 = 0; iVar1 = (u32)FindEntityInListByForm(0x6, 0xf, 0x6, 0xb, 0x0); if (iVar1 != 0) { iVar1 = 1; } - *(u32*)(arg1 + 0x14) = iVar1; + context->condition = iVar1; } // clang-format off diff --git a/src/object/houseDoorExterior.c b/src/object/houseDoorExterior.c index d500686c..3dbca161 100644 --- a/src/object/houseDoorExterior.c +++ b/src/object/houseDoorExterior.c @@ -174,11 +174,10 @@ static u8 sub_08086954(Entity* this) { return this->actionDelay; } -// TODO: Second arg is some unknown struct. -void sub_080869A4(Entity* entityA, u32* entityB) { - entityB[5] = 0; - if (!sub_08086954(entityA)) { - entityA->actionDelay = 8; - entityB[5] = 1; +void sub_080869A4(Entity* this, ScriptExecutionContext* context) { + context->condition = 0; + if (!sub_08086954(this)) { + this->actionDelay = 8; + context->condition = 1; } } diff --git a/src/room.c b/src/room.c index dd7e34f5..3b268657 100644 --- a/src/room.c +++ b/src/room.c @@ -10,6 +10,7 @@ #include "main.h" #include "structures.h" #include "save.h" +#include "script.h" void sub_0804B3C4(void* arg0) { sub_0804B29C(arg0); @@ -981,7 +982,7 @@ void sub_0804BF38(u32 arg0, struct_0804BF38* arg1) } #else NAKED -void sub_0804BF38(u32 arg0, void* arg1) { +void sub_0804BF38(Entity* this, ScriptExecutionContext* context) { asm(".include \"asm/non_matching/sub_0804BF38.inc\""); } #endif @@ -3568,7 +3569,7 @@ void sub_0804D780(void) { extern u16 gUnk_080EAE00; -void sub_0804D7EC(void) { +void sub_0804D7EC() { u16 temp; u16* tilePos; @@ -3580,7 +3581,7 @@ void sub_0804D7EC(void) { } } -void sub_0804D810(void) { +void sub_0804D810() { u16 uVar1; u16* puVar2; @@ -4795,7 +4796,7 @@ void sub_0804E7DC(void) { extern u32 script_08009E58; -void sub_0804E864(void) { +void sub_0804E864() { gPlayerEntity.x.HALF.HI = gRoomControls.roomOriginX + 0x90; gPlayerEntity.y.HALF.HI = gRoomControls.roomOriginY + 0x38; sub_080751E8(1, 6, &script_08009E58); @@ -5680,35 +5681,35 @@ void sub_0804F680(Entity* parent, s32 x, s32 y) { } } -void sub_0804F6A8(Entity* arg0) { - sub_0804F680(arg0, 0x1d8, 0x108); - sub_0804F680(arg0, 0x218, 0x188); +void sub_0804F6A8(Entity* this) { + sub_0804F680(this, 0x1d8, 0x108); + sub_0804F680(this, 0x218, 0x188); } -void sub_0804F6C8(Entity* arg0) { - sub_0804F680(arg0, 0x1e8, 0x108); - sub_0804F680(arg0, 0x208, 0x188); +void sub_0804F6C8(Entity* this) { + sub_0804F680(this, 0x1e8, 0x108); + sub_0804F680(this, 0x208, 0x188); } -void sub_0804F6E8(Entity* arg0) { - sub_0804F680(arg0, 0x1f8, 0x108); - sub_0804F680(arg0, 0x258, 0x138); - sub_0804F680(arg0, 0x1f8, 0x188); - sub_0804F680(arg0, 0x198, 0x158); +void sub_0804F6E8(Entity* this) { + sub_0804F680(this, 0x1f8, 0x108); + sub_0804F680(this, 0x258, 0x138); + sub_0804F680(this, 0x1f8, 0x188); + sub_0804F680(this, 0x198, 0x158); } -void sub_0804F724(Entity* arg0) { - sub_0804F680(arg0, 0x208, 0x108); - sub_0804F680(arg0, 0x258, 0x148); - sub_0804F680(arg0, 0x1e8, 0x188); - sub_0804F680(arg0, 0x198, 0x148); +void sub_0804F724(Entity* this) { + sub_0804F680(this, 0x208, 0x108); + sub_0804F680(this, 0x258, 0x148); + sub_0804F680(this, 0x1e8, 0x188); + sub_0804F680(this, 0x198, 0x148); } -void sub_0804F760(Entity* arg0) { - sub_0804F680(arg0, 0x218, 0x108); - sub_0804F680(arg0, 0x258, 0x158); - sub_0804F680(arg0, 0x1d8, 0x188); - sub_0804F680(arg0, 0x198, 0x138); +void sub_0804F760(Entity* this) { + sub_0804F680(this, 0x218, 0x108); + sub_0804F680(this, 0x258, 0x158); + sub_0804F680(this, 0x1d8, 0x188); + sub_0804F680(this, 0x198, 0x138); } void sub_0804F79C(Entity* parent) { @@ -5728,62 +5729,62 @@ void sub_0804F79C(Entity* parent) { } } -void sub_0804F808(void) { +void sub_0804F808() { SetTileType(0x1d3, 0x41d, 1); SetTileType(0x1d3, 0x621, 1); } -void sub_0804F830(void) { +void sub_0804F830() { SetTileType(0x1d4, 0x41e, 1); SetTileType(0x1d4, 0x620, 1); } -void sub_0804F854(void) { +void sub_0804F854() { SetTileType(0x1d5, 0x41f, 1); SetTileType(0x1d4, 0x4e5, 1); SetTileType(0x1d5, 0x61f, 1); SetTileType(0x1d4, 0x559, 1); } -void sub_0804F89C(void) { +void sub_0804F89C() { SetTileType(0x1d6, 0x420, 1); SetTileType(0x1d5, 0x525, 1); SetTileType(0x1d6, 0x61e, 1); SetTileType(0x1d5, 0x519, 1); } -void sub_0804F8E0(void) { +void sub_0804F8E0() { SetTileType(0x1d3, 0x421, 1); SetTileType(0x1d6, 0x565, 1); SetTileType(0x1d3, 0x61d, 1); SetTileType(0x1d6, 0x4d9, 1); } -void sub_0804F928(void) { +void sub_0804F928() { sub_0807BA8C(0x41d, 1); sub_0807BA8C(0x621, 1); } -void sub_0804F944(void) { +void sub_0804F944() { sub_0807BA8C(0x41e, 1); sub_0807BA8C(0x620, 1); } -void sub_0804F960(void) { +void sub_0804F960() { sub_0807BA8C(0x41f, 1); sub_0807BA8C(0x4e5, 1); sub_0807BA8C(0x61f, 1); sub_0807BA8C(0x559, 1); } -void sub_0804F994(void) { +void sub_0804F994() { sub_0807BA8C(0x420, 1); sub_0807BA8C(0x525, 1); sub_0807BA8C(0x61e, 1); sub_0807BA8C(0x519, 1); } -void sub_0804F9C8(void) { +void sub_0804F9C8() { sub_0807BA8C(0x421, 1); sub_0807BA8C(0x565, 1); sub_0807BA8C(0x61d, 1); diff --git a/src/script.c b/src/script.c index 67f1a151..741673f1 100644 --- a/src/script.c +++ b/src/script.c @@ -579,18 +579,18 @@ void sub_0807DEDC(Entity* entity, ScriptExecutionContext* context, u32 arg2, u32 entity->animationState = (entity->animationState & 0x80) | gUnk_0811E514[(u32)(temp << 0x18) >> 0x1c]; } -void sub_0807DF28(void) { +void sub_0807DF28() { sub_0807DF38(); sub_08079184(); sub_08077B20(); } -void sub_0807DF38(void) { +void sub_0807DF38() { gUnk_0200AF00.filler0[1] = 0xff; gUnk_02034490[0] = 0xff; } -void sub_0807DF50(void) { +void sub_0807DF50() { gUnk_02034490[0] = 0; gUnk_0200AF00.filler0[1] = 0; sub_0801C4A0(0); diff --git a/src/sub_0804AFF4.c b/src/sub_0804AFF4.c index a7108fd6..0d14ee1e 100644 --- a/src/sub_0804AFF4.c +++ b/src/sub_0804AFF4.c @@ -18,7 +18,6 @@ void sub_0804AFF4(void) { _call_via_r0(func); } sub_0804B16C(); - return; } /* diff --git a/src/sub_08050008.c b/src/sub_08050008.c index 4fe0e197..6d8e5103 100644 --- a/src/sub_08050008.c +++ b/src/sub_08050008.c @@ -11,6 +11,4 @@ void sub_08050008(u32 param_1, u32 param_2, u32 param_3) { unk = &gFadeControl; *(unk + 1) = -1; - - return; } diff --git a/src/sub_08050024.c b/src/sub_08050024.c index b6915ab9..f3868b4b 100644 --- a/src/sub_08050024.c +++ b/src/sub_08050024.c @@ -18,7 +18,6 @@ extern void DoFade(u32, u32); void sub_08050024() { sub_0801E104(); DoFade(5, 0x80 << 1); - return; } void sub_08050038(u32 arg0) { diff --git a/src/sub_0807B7D8.c b/src/sub_0807B7D8.c index 7ef8b080..79892047 100644 --- a/src/sub_0807B7D8.c +++ b/src/sub_0807B7D8.c @@ -4,9 +4,7 @@ extern void sub_08000152(u32); extern void sub_0807B778(u32, u32); extern void SetTileType(u32, u32, u32); -void sub_0807B7D8(u32 param_1, u32 param_2, u32 param_3) - -{ +void sub_0807B7D8(u32 param_1, u32 param_2, u32 param_3) { if (param_1 == 53) { sub_08000152(53); sub_0807B778(param_2, param_3); @@ -17,5 +15,4 @@ void sub_0807B7D8(u32 param_1, u32 param_2, u32 param_3) } else { SetTileType(param_1, param_2, param_3); } - return; } diff --git a/src/sub_0807B820.c b/src/sub_0807B820.c index b8ae309d..0e8bde35 100644 --- a/src/sub_0807B820.c +++ b/src/sub_0807B820.c @@ -2,9 +2,7 @@ extern void SetTileType(u32, u32, u32); -void sub_0807B820(u32 param_1) - -{ +void sub_0807B820(u32 param_1) { SetTileType(620, param_1 + -65, 1); SetTileType(627, param_1 + -65, 2); SetTileType(621, param_1 + -64, 1); @@ -14,5 +12,4 @@ void sub_0807B820(u32 param_1) SetTileType(623, param_1 + -1, 1); SetTileType(624, param_1, 1); SetTileType(626, param_1 + 1, 1); - return; } diff --git a/src/sub_0807B8A8.c b/src/sub_0807B8A8.c index 5c008ad2..c29c35d7 100644 --- a/src/sub_0807B8A8.c +++ b/src/sub_0807B8A8.c @@ -2,9 +2,7 @@ extern void SetTileType(u32, u32, u32); -void sub_0807B8A8(u32 param_1) - -{ +void sub_0807B8A8(u32 param_1) { SetTileType(636, param_1 + -65, 1); SetTileType(643, param_1 + -65, 2); SetTileType(637, param_1 + -64, 1); @@ -14,5 +12,4 @@ void sub_0807B8A8(u32 param_1) SetTileType(639, param_1 + -1, 1); SetTileType(640, param_1, 1); SetTileType(642, param_1 + 1, 1); - return; } diff --git a/src/sub_0807B930.c b/src/sub_0807B930.c index aae0472c..fe373eff 100644 --- a/src/sub_0807B930.c +++ b/src/sub_0807B930.c @@ -2,9 +2,7 @@ extern void SetTileType(u32, u32, u32); -void sub_0807B930(int param_1) - -{ +void sub_0807B930(int param_1) { SetTileType(652, param_1 + -65, 1); SetTileType(659, param_1 + -65, 2); SetTileType(653, param_1 + -64, 1); @@ -14,5 +12,4 @@ void sub_0807B930(int param_1) SetTileType(655, param_1 + -1, 1); SetTileType(656, param_1, 1); SetTileType(658, param_1 + 1, 1); - return; } diff --git a/tools/script_disassembler/definitions.py b/tools/script_disassembler/definitions.py index 22e8584c..fac5ce83 100644 --- a/tools/script_disassembler/definitions.py +++ b/tools/script_disassembler/definitions.py @@ -151,7 +151,7 @@ POINTER_MAP = { 'sub_0806C23C': 'Simon_CreateChest', 'sub_0801637C': 'script_0801637C+1', 'sub_08016383': 'script_08016384', - 'sub_0806C598': 'FUN_0806c598', + 'sub_0806C598': 'sub_0806C598', 'sub_080A2138': 'Windcrest_Unlock', 'sub_080A29BC': 'CreateDust' }