Fix parameters for all functions called from scripts

This commit is contained in:
octorock 2021-03-06 23:13:26 +01:00
parent 74e48d98b0
commit 8f7ad0a35c
39 changed files with 253 additions and 332 deletions

View File

@ -11,5 +11,5 @@ script_0800E8D6:
SetLocalFlag 0x0091 SetLocalFlag 0x0091
TextboxNoOverlapFollow 0x4508 TextboxNoOverlapFollow 0x4508
_0807EA94 _0807EA94
Call FUN_0806c598 Call sub_0806C598
SCRIPT_END SCRIPT_END

View File

@ -46,9 +46,4 @@ extern u8 gUnk_0812079C[8];
extern s16 gSineTable[]; extern s16 gSineTable[];
extern s8 gUnk_081207AC[]; extern s8 gUnk_081207AC[];
typedef struct {
s32 unk0;
s32 unk4;
} struct_08087424;
#endif #endif

View File

@ -168,11 +168,11 @@ void sub_08054524(void) {
} }
#endif #endif
void sub_08054564(void) { void sub_08054564() {
gRoomVars.filler[2] = 1; gRoomVars.filler[2] = 1;
} }
void sub_08054570(void) { void sub_08054570() {
gRoomVars.filler[2] = 0; gRoomVars.filler[2] = 0;
} }

View File

@ -104,4 +104,4 @@ void sub_0805ED14(u32 param_1) {
gPlayerState.field_0x9c = param_1; gPlayerState.field_0x9c = param_1;
gPlayerState.field_0x98 = 0; gPlayerState.field_0x98 = 0;
gPlayerState.field_0x9a = 0; gPlayerState.field_0x9a = 0;
} }

View File

@ -101,7 +101,6 @@ void sub_08031770(Entity* this) {
this->attachedEntity = NULL; this->attachedEntity = NULL;
} }
} }
return;
} }
void sub_080317B4(Entity* this) { void sub_080317B4(Entity* this) {

View File

@ -122,7 +122,6 @@ void ClearAllDeletedEntities(void) {
ClearDeletedEntity(ent); ClearDeletedEntity(ent);
} }
} while (ent++, ent < (&gPlayerEntity + 80)); } while (ent++, ent < (&gPlayerEntity + 80));
return;
} }
extern u8 gEntCount; extern u8 gEntCount;

View File

@ -212,7 +212,6 @@ static void UpdatePressStartIcon(void) {
gOamCmd.x = 120; gOamCmd.x = 120;
gOamCmd.y = 152; gOamCmd.y = 152;
sub_080ADA14(511, 1); sub_080ADA14(511, 1);
return;
} }
static void UpdateSwordBgAffineData(void) { static void UpdateSwordBgAffineData(void) {

View File

@ -38,7 +38,6 @@ void Anju(Entity* this) {
if (UpdateFuseInteraction(this)) { if (UpdateFuseInteraction(this)) {
this->action = 1; this->action = 1;
} }
default:
} }
} }

View File

@ -148,17 +148,17 @@ void sub_0806346C(Entity* this) {
} }
} }
void sub_080634E4(Entity* this, u32* param_1) { void sub_080634E4(Entity* this, ScriptExecutionContext* context) {
param_1[1] = this->type2; context->unk_04 = this->type2;
} }
void sub_080634EC(Entity* this) { void sub_080634EC(Entity* this) {
gRoomVars.itemForSaleIndex = gUnk_0810C88C[this->type2]; gRoomVars.itemForSaleIndex = gUnk_0810C88C[this->type2];
} }
void sub_08063504(Entity* this, u32* param_2) { void sub_08063504(Entity* this, ScriptExecutionContext* context) {
u32 uVar1; u32 uVar1;
uVar1 = sub_080544DC(gUnk_0810C88C[this->type2]); uVar1 = sub_080544DC(gUnk_0810C88C[this->type2]);
param_2[5] = BOOLCAST(uVar1); context->condition = BOOLCAST(uVar1);
} }

View File

@ -195,53 +195,50 @@ void sub_08068C6C(Entity* this) {
sub_080A7C18(gUnk_0811162B[this->actionDelay] & 0xffffff7f, 0, 0); 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; u8* arr = gUnk_0811162B + 0xd;
context->condition = *(u32*)(arr + this->actionDelay * 4);
*(u32*)&param_2->animationState = *(u32*)(arr + param_1->actionDelay * 4);
} }
void sub_08068CA0(Entity* param_1, Entity* param_2) { void sub_08068CA0(Entity* this, ScriptExecutionContext* context) {
u8 bVar1; u8 bVar1;
u32 uVar2; u32 uVar2;
bVar1 = param_1->type; bVar1 = this->type;
if (bVar1 == 1) { if (bVar1 == 1) {
*(u32*)&param_2->animationState = bVar1; context->condition = bVar1;
uVar2 = GetInventoryValue(0x48); // spin attack uVar2 = GetInventoryValue(0x48); // spin attack
if (uVar2 == 0) { if (uVar2 == 0) {
*(u32*)&param_2->animationState = 0; context->condition = 0;
} }
uVar2 = GetInventoryValue(0x4b); // rock breaker uVar2 = GetInventoryValue(0x4b); // rock breaker
if (uVar2 == 0) { if (uVar2 == 0) {
*(u32*)&param_2->animationState = 0; context->condition = 0;
} }
uVar2 = GetInventoryValue(0x4a); // dash attack uVar2 = GetInventoryValue(0x4a); // dash attack
if (uVar2 == 0) { if (uVar2 == 0) {
*(u32*)&param_2->animationState = 0; context->condition = 0;
} }
uVar2 = GetInventoryValue(0x4e); // down thrust uVar2 = GetInventoryValue(0x4e); // down thrust
if (uVar2 != 0) { if (uVar2 != 0) {
return; return;
} }
} else { } else {
uVar2 = GetInventoryValue(gUnk_0811162B[param_1->actionDelay] & -0x81); uVar2 = GetInventoryValue(gUnk_0811162B[this->actionDelay] & -0x81);
if (uVar2 != 0) { if (uVar2 != 0) {
uVar2 = 1; uVar2 = 1;
} }
} }
*(u32*)&param_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 bVar1;
u8 itemID; u8 itemID;
u32 uVar2; u32 uVar2;
*(u32*)&param_2->animationState = 0; context->condition = 0;
bVar1 = param_1->actionDelay; bVar1 = this->actionDelay;
if (bVar1 > 10) if (bVar1 > 10)
return; return;
@ -302,7 +299,7 @@ LABEL1:
return; return;
} }
switchD_08068d12_caseD_0: switchD_08068d12_caseD_0:
*(u32*)&param_2->animationState = 1; context->condition = 1;
} }
// Introduction dialoague // 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; *(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; gPlayerState.field_0xab = 0;
} }
void sub_08068EC4(Entity* param_1, Entity* param_2) { void sub_08068EC4(Entity* this, ScriptExecutionContext* context) {
if (gUnk_08111740[param_1->actionDelay] == gPlayerState.field_0xab) { if (gUnk_08111740[this->actionDelay] == gPlayerState.field_0xab) {
*(u16*)&param_2->flags = gUnk_0811172A[param_1->actionDelay]; context->wait = gUnk_0811172A[this->actionDelay];
*(u32*)&param_2->animationState = 1; context->condition = 1;
} else { } else {
*(u32*)&param_2->animationState = 0; context->condition = 0;
} }
} }
@ -386,7 +383,6 @@ void sub_08068F3C(Entity* this) {
} }
void BladeBrothers_Fusion(Entity* this) { void BladeBrothers_Fusion(Entity* this) {
if (this->action == 0) { if (this->action == 0) {
this->action += 1; this->action += 1;
this->spriteSettings.b.draw = 0; this->spriteSettings.b.draw = 0;

View File

@ -2,6 +2,7 @@
#include "entity.h" #include "entity.h"
#include "sprite.h" #include "sprite.h"
#include "player.h" #include "player.h"
#include "script.h"
extern void DeleteThisEntity(); extern void DeleteThisEntity();
extern u32 LoadExtraSpriteData(Entity*, SpriteLoadData*); extern u32 LoadExtraSpriteData(Entity*, SpriteLoadData*);
@ -10,7 +11,6 @@ extern void sub_0805E3A0(Entity*, u32);
extern void sub_0807DD64(Entity*); extern void sub_0807DD64(Entity*);
extern u32 GetFacingDirection(Entity*, Entity*); extern u32 GetFacingDirection(Entity*, Entity*);
extern void sub_0806F118(Entity*); extern void sub_0806F118(Entity*);
extern void sub_0807DDAC(Entity*, u32);
extern void sub_0807DDE4(Entity*); extern void sub_0807DDE4(Entity*);
extern u32 UpdateFuseInteraction(Entity*); extern u32 UpdateFuseInteraction(Entity*);
extern void SetSpriteSubEntryOffsetData2(Entity*, u32, u32); extern void SetSpriteSubEntryOffsetData2(Entity*, u32, u32);
@ -69,6 +69,6 @@ void Carpenter_Head(Entity* this) {
} }
} }
void sub_080672B0(Entity* this, u32 param_2) { void sub_080672B0(Entity* this, ScriptExecutionContext* context) {
InitializeAnimation(this, *(u32*)(param_2 + 4) + (this->animationState >> 1) + this->type * 8); InitializeAnimation(this, context->unk_04 + (this->animationState >> 1) + this->type * 8);
} }

View File

@ -6,25 +6,19 @@
#include "sprite.h" #include "sprite.h"
#include "textbox.h" #include "textbox.h"
#include "npc.h" #include "npc.h"
#include "script.h"
extern void sub_0805E3A0(Entity*, u32); extern void sub_0805E3A0(Entity*, u32);
extern void sub_0807DD50(Entity*); extern void sub_0807DD50(Entity*);
extern u32 sub_0806F5A4(u32); extern u32 sub_0806F5A4(u32);
extern void sub_0806F118(Entity*); extern void sub_0806F118(Entity*);
extern void sub_0807DD94(Entity*, u32);
extern u32 sub_0801E99C(void); extern u32 sub_0801E99C(void);
extern void sub_08078784(Entity*, u32); extern void sub_08078784(Entity*, u32);
extern u16 gUnk_08113344[]; extern u16 gUnk_08113344[];
extern u16 gUnk_0811334A[]; extern u16 gUnk_0811334A[];
typedef struct {
u8 filler[18];
u32 unk;
} struct_0806BE84;
void Dampe(Entity* this) { void Dampe(Entity* this) {
switch (this->action) { switch (this->action) {
case 0: case 0:
this->action = 1; this->action = 1;
@ -47,7 +41,6 @@ void Dampe(Entity* this) {
if (UpdateFuseInteraction(this)) { if (UpdateFuseInteraction(this)) {
this->action = 1; 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; u32 msgIndex;
r1->unk = 0; context->condition = 0;
msgIndex = 1; msgIndex = 1;
if (!CheckLocalFlag(0x69)) { if (!CheckLocalFlag(0x69)) {
msgIndex = 0; msgIndex = 0;
SetLocalFlag(0x69); SetLocalFlag(0x69);
r1->unk = 1; context->condition = 1;
} }
// Graveyard key // Graveyard key
if (GetInventoryValue(0x3C) >= 2) { if (GetInventoryValue(0x3C) >= 2) {
@ -83,16 +76,16 @@ void sub_0806BE84(Entity* this, struct_0806BE84* r1) {
TextboxNoOverlap(gUnk_08113344[msgIndex], this); TextboxNoOverlap(gUnk_08113344[msgIndex], this);
} }
void sub_0806BEC8(Entity* this, struct_0806BE84* r1) { void sub_0806BEC8(Entity* this, ScriptExecutionContext* context) {
u32 hasGraveyardKey; u32 hasGraveyardKey;
u32 msgIndex; u32 msgIndex;
msgIndex = 0; msgIndex = 0;
r1->unk = 0; context->condition = 0;
hasGraveyardKey = GetInventoryValue(0x3C); hasGraveyardKey = GetInventoryValue(0x3C);
if (hasGraveyardKey == 1) { if (hasGraveyardKey == 1) {
msgIndex = 1; msgIndex = 1;
r1->unk = 1; context->condition = 1;
} else if (hasGraveyardKey >= 2) { } else if (hasGraveyardKey >= 2) {
msgIndex = 2; msgIndex = 2;
} }
@ -107,10 +100,10 @@ void sub_0806BEFC() {
SetTileType(0x181, 0x5CF, 1); SetTileType(0x181, 0x5CF, 1);
} }
void sub_0806BF44(Entity* this, struct_0806BE84* r1) { void sub_0806BF44(Entity* this, ScriptExecutionContext* context) {
r1->unk = 0; context->condition = 0;
if (((this->x.HALF.HI - gRoomControls.roomScrollX) + 0x10U < 0x110) && if (((this->x.HALF.HI - gRoomControls.roomScrollX) + 0x10U < 0x110) &&
((this->y.HALF.HI - gRoomControls.roomScrollY) + 0x18U < 0xD0)) { ((this->y.HALF.HI - gRoomControls.roomScrollY) + 0x18U < 0xD0)) {
r1->unk = 1; context->condition = 1;
} }
} }

View File

@ -10,36 +10,24 @@ extern void sub_0807DD50(Entity*);
extern void sub_0807DD94(Entity*, u32); extern void sub_0807DD94(Entity*, u32);
extern void DoExitTransition(u32*); extern void DoExitTransition(u32*);
void Emma(Entity* param_1) void Emma(Entity* this) {
if (this->action == 0) {
{ this->action += 1;
if (param_1->action == 0) { sub_0805E3A0(this, 2);
param_1->action += 1; sub_0807DD50(this);
sub_0805E3A0(param_1, 2);
sub_0807DD50(param_1);
} else { } else {
sub_0807DD94(param_1, 0); sub_0807DD94(this, 0);
} }
return;
} }
void sub_0806C578(void) void sub_0806C578() {
{
DoExitTransition(&gUnk_0813AD10); DoExitTransition(&gUnk_0813AD10);
return;
} }
void sub_0806C588(void) void sub_0806C588() {
{
DoExitTransition(&gUnk_0813AD24); DoExitTransition(&gUnk_0813AD24);
return;
} }
void FUN_0806c598(void) void sub_0806C598() {
{
DoExitTransition(&gUnk_0813AD38); DoExitTransition(&gUnk_0813AD38);
return;
} }

View File

@ -39,35 +39,21 @@ void EzloCap(Entity* this) {
UpdateAnimationSingleFrame(this); UpdateAnimationSingleFrame(this);
} }
typedef struct { void sub_0806D8A0(Entity* this, ScriptExecutionContext* context) {
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) {
s32 xOffset; s32 xOffset;
s32 yOffset; s32 yOffset;
param_2->field_19 = 8; context->unk_19 = 8;
param_2->field_08 |= 2; context->unk_08 |= 2;
param_2->field_14 = 0; context->condition = 0;
xOffset = 16; xOffset = 16;
if (this->spriteSettings.b.flipX) { if (this->spriteSettings.b.flipX) {
xOffset = -xOffset; xOffset = -xOffset;
} }
xOffset += gPlayerEntity.x.HALF.HI; xOffset += gPlayerEntity.x.HALF.HI;
yOffset = gPlayerEntity.y.HALF.HI + 2; yOffset = gPlayerEntity.y.HALF.HI + 2;
param_2->field_1e = xOffset; context->unk_1C.HALF.HI = xOffset;
param_2->field_22 = yOffset; context->unk_20.HALF.HI = yOffset;
xOffset -= this->x.HALF.HI; xOffset -= this->x.HALF.HI;
this->direction = sub_080045DA(xOffset, yOffset - this->y.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? // 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* 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); sub_08078850(this, 1, a->unk_04, a);
} }
void sub_0806DA1C(Entity* this, u32* param_2) { void sub_0806DA1C(Entity* this, ScriptExecutionContext* context) {
sub_0808091C((ScreenTransitionData*)(gUnk_081141A4)[param_2[1]], (u32)(gUnk_081141E4[param_2[1]])); sub_0808091C((ScreenTransitionData*)(gUnk_081141A4)[context->unk_04], (u32)(gUnk_081141E4[context->unk_04]));
} }
// Returns the kinstone id? // 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? // Check whether a kinstone fusion is possible and store the result somewhere in param_2?
void sub_0806DAAC(Entity* this, u32* param_2) { void sub_0806DAAC(Entity* this, ScriptExecutionContext* context) {
u32 uVar1; context->condition = CheckKinstoneFused(sub_0806DA3C(this));
uVar1 = CheckKinstoneFused(sub_0806DA3C(this));
param_2[5] = uVar1;
gActiveScriptInfo.flags |= 1; gActiveScriptInfo.flags |= 1;
} }
@ -202,18 +186,16 @@ void sub_0806DAE8(Entity* this) {
SoundReq(0xcd); SoundReq(0xcd);
} }
// Unknown param_2 struct void sub_0806DB44(Entity* this, ScriptExecutionContext* context) {
void sub_0806DB44(Entity* this, u32* param_2) { context->condition = 0;
param_2[5] = 0;
if (CheckLocalFlag(0xee) != 0 && CheckLocalFlag(0xef) != 0 && CheckLocalFlag(0xf0) != 0 && if (CheckLocalFlag(0xee) != 0 && CheckLocalFlag(0xef) != 0 && CheckLocalFlag(0xf0) != 0 &&
CheckLocalFlag(0xf1) != 0 && CheckLocalFlag(0xf2) != 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, ScriptExecutionContext* context) {
void sub_0806DB84(Entity* this, u8 unused) {
Entity* ent; Entity* ent;
this->hitbox = (Hitbox*)&gUnk_08114154; this->hitbox = (Hitbox*)&gUnk_08114154;
ent = CreateObject(0x3e, 4, 0); ent = CreateObject(0x3e, 4, 0);

View File

@ -224,11 +224,11 @@ void sub_080602BC(Entity* this) {
TextboxNoOverlap(gUnk_0810A362[index], this); TextboxNoOverlap(gUnk_0810A362[index], this);
} }
void sub_0806030C(Entity* this, u32* arg1) { void sub_0806030C(Entity* this, ScriptExecutionContext* context) {
ModBombs(*(arg1 + 1)); ModBombs(context->unk_04);
} }
void sub_08060318(void) { void sub_08060318() {
Entity* ent; Entity* ent;
int i; int i;
@ -241,11 +241,11 @@ void sub_08060318(void) {
} }
} }
void sub_08060340(void) { void sub_08060340() {
gSave.unk490 = gSave.unk50; gSave.unk490 = gSave.unk50;
} }
u32 sub_08060354(void) { u32 sub_08060354() {
u32 iVar1; u32 iVar1;
s32 iVar2; s32 iVar2;

View File

@ -97,8 +97,8 @@ u32 sub_08069480(Entity* this) {
return (sub_0801E99C(this) << 24) >> 24; return (sub_0801E99C(this) << 24) >> 24;
} }
void sub_0806948C(Entity* this, u32* param_1) { void sub_0806948C(Entity* this, ScriptExecutionContext* context) {
param_1[5] = CheckKinstoneFused((sub_08069480(this) << 24) >> 24); context->condition = CheckKinstoneFused((sub_08069480(this) << 24) >> 24);
gActiveScriptInfo.flags |= 1; gActiveScriptInfo.flags |= 1;
} }

View File

@ -4,6 +4,7 @@
#include "flags.h" #include "flags.h"
#include "textbox.h" #include "textbox.h"
#include "room.h" #include "room.h"
#include "script.h"
typedef struct { typedef struct {
u32 unk; u32 unk;
@ -15,11 +16,6 @@ typedef struct {
u8 unk; u8 unk;
} ScreenTransition; } ScreenTransition;
typedef struct {
u32 unk;
u32 unk2;
} struct_08064050;
extern void sub_08063D24(Entity*); extern void sub_08063D24(Entity*);
extern void sub_0806ED78(Entity*); extern void sub_0806ED78(Entity*);
extern u32 GetFacingDirection(Entity*, Entity*); extern u32 GetFacingDirection(Entity*, Entity*);
@ -27,7 +23,6 @@ extern u32 sub_0806F5A4(u32);
extern void sub_0806EE20(Entity*); extern void sub_0806EE20(Entity*);
extern void sub_08064428(Entity*); extern void sub_08064428(Entity*);
extern u32 sub_0805ACC0(Entity*); extern u32 sub_0805ACC0(Entity*);
extern void sub_0807DDAC(Entity*, u32);
extern void sub_0807DDE4(Entity*); extern void sub_0807DDE4(Entity*);
extern void sub_0807000C(Entity*); extern void sub_0807000C(Entity*);
extern void sub_0806EE04(Entity*, void*, u32); 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; *(u32*)&arg1->animationState = (-gRoomVars.greatFairyState | gRoomVars.greatFairyState) >> 0x1f;
} }
void sub_08064044(void) { void sub_08064044() {
gScreenTransition.unk = 1; gScreenTransition.unk = 1;
} }
void sub_08064050(Entity* arg0, struct_08064050* arg1) { void sub_08064050(Entity* this, ScriptExecutionContext* context) {
u32 unk; context->unk_04 = 0;
switch (this->type2) {
arg1->unk2 = 0;
switch (arg0->type2) {
case 0x11: case 0x11:
arg1->unk2 = 1; context->unk_04 = 1;
break; break;
case 0x12: case 0x12:
arg1->unk2 = 2; context->unk_04 = 2;
break; break;
case 0x13: case 0x13:
arg1->unk2 = 3; context->unk_04 = 3;
} }
} }

View File

@ -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 index;
*(u32*)(arg1 + 0x14) = 0; context->condition = 0;
// flippers // flippers
if (!GetInventoryValue(0x46)) { if (!GetInventoryValue(0x46)) {
if (CheckGlobalFlag(0x29)) { if (CheckGlobalFlag(0x29)) {
index = 2; index = 2;
*(u32*)(arg1 + 0x14) = 1; context->condition = 1;
} else if (!CheckLocalFlag(0x7a)) { } else if (!CheckLocalFlag(0x7a)) {
index = 0; index = 0;
SetLocalFlag(0x7a); SetLocalFlag(0x7a);

View File

@ -27,7 +27,7 @@ void Simon(Entity* this) {
} }
} }
void sub_0806C224(void) { void sub_0806C224() {
DoExitTransition(&gUnk_0813AD60); DoExitTransition(&gUnk_0813AD60);
gScreenTransition.transitionType = 6; gScreenTransition.transitionType = 6;
} }
@ -38,14 +38,14 @@ void Simon_CreateChest(Entity* this) {
SoundReq(0x73); SoundReq(0x73);
} }
void sub_0806C280(void) { void sub_0806C280() {
SetGlobalFlag(MAROYA_WAKEUP); SetGlobalFlag(MAROYA_WAKEUP);
DoExitTransition(&gUnk_0813AD74); DoExitTransition(&gUnk_0813AD74);
gScreenTransition.transitionType = 6; gScreenTransition.transitionType = 6;
} }
void sub_0806C2A0(u32* param_1, struct_0806C2A0* param_2) { void sub_0806C2A0(Entity* this, ScriptExecutionContext* context) {
switch (param_2->unk) { switch (context->unk_04) {
case 0: case 0:
DoFade(0xd, 4); DoFade(0xd, 4);
break; break;

View File

@ -16,7 +16,7 @@ extern void sub_0807DD50(Entity*);
extern void sub_0807DDE4(Entity*); extern void sub_0807DDE4(Entity*);
extern u32 UpdateFuseInteraction(Entity*); extern u32 UpdateFuseInteraction(Entity*);
extern u32 GetAnimationState(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 sub_08078784(Entity*, u32);
extern void (*const gUnk_08110360[])(Entity*); extern void (*const gUnk_08110360[])(Entity*);
@ -160,16 +160,16 @@ void sub_0806622C(Entity* this) {
void nullsub_501(Entity* this) { void nullsub_501(Entity* this) {
} }
void sub_08066258(void) { void sub_08066258() {
SoundReq(gUnk_081103D0[Random() & 7]); SoundReq(gUnk_081103D0[Random() & 7]);
} }
void sub_08066274(u32 arg0) { void sub_08066274(Entity* this) {
sub_08078850(arg0, 1, 0, &gUnk_081103E0); sub_08078850(this, 1, 0, &gUnk_081103E0);
} }
void sub_08066288(Entity* arg0) { void sub_08066288(Entity* this) {
sub_08078784(arg0, arg0->field_0x68.HALF.LO); sub_08078784(this, this->field_0x68.HALF.LO);
} }
void Smith_Fusion(Entity* this) { void Smith_Fusion(Entity* this) {

View File

@ -74,9 +74,7 @@ void sub_08062CA4(Entity* ent) {
} }
void sub_08062CBC(Entity* ent) { void sub_08062CBC(Entity* ent) {
u32 uVar1; u32 uVar1 = CheckKinstoneFused(44);
uVar1 = CheckKinstoneFused(44);
ShowNPCDialogue(ent, &gUnk_0810C2E4[(-uVar1 | uVar1) >> 31]); ShowNPCDialogue(ent, &gUnk_0810C2E4[(-uVar1 | uVar1) >> 31]);
} }

View File

@ -56,8 +56,8 @@ void sub_0806A26C(Entity* this) {
if (uVar2 = Random(), uVar2) { if (uVar2 = Random(), uVar2) {
unk = -unk; // wtf?! unk = -unk; // wtf?!
} }
pEVar1->spriteOffsetX = gUnk_081121DC[uVar2 & 7]; pEVar1->spriteOffsetX = gUnk_081121D4[uVar2 & 7];
pEVar1->spriteOffsetY = gUnk_081121DC[(uVar2 / 256) & 7] - 8; pEVar1->spriteOffsetY = gUnk_081121D4[(uVar2 / 256) & 7] - 8;
} }
} }
#else #else

View File

@ -134,12 +134,12 @@ void sub_0806574C(Entity* this) {
this->field_0x6a.HALF.LO = this->animIndex; this->field_0x6a.HALF.LO = this->animIndex;
} }
void sub_08065780(Entity* this, u16* param_2) { void sub_08065780(Entity* this, ScriptExecutionContext* context) {
u32 rand; u32 rand;
rand = Random(); rand = Random();
this->animationState = rand & 6; this->animationState = rand & 6;
param_2[8] = gUnk_0810FED8[rand >> 8 & 7]; context->wait = gUnk_0810FED8[rand >> 8 & 7];
} }
void Talon_Head(Entity* this) { void Talon_Head(Entity* this) {

View File

@ -14,7 +14,7 @@ extern u32 sub_080002C0();
extern void sub_0806ACC4(Entity*); extern void sub_0806ACC4(Entity*);
extern void sub_0806AEA8(); extern void sub_0806AEA8();
extern void sub_0806AEE4(Entity*); 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 s32 sub_0806EDD8(Entity*, u32, u32);
extern u32 sub_0806F5B0(u32); extern u32 sub_0806F5B0(u32);
extern void sub_08078784(Entity*, u32); extern void sub_08078784(Entity*, u32);
@ -26,7 +26,7 @@ extern u32 gUnk_081126D4[4];
extern u8 gUnk_081126E4[4]; extern u8 gUnk_081126E4[4];
extern void (*gUnk_081126E8[])(); extern void (*gUnk_081126E8[])();
extern Dialog gUnk_081126F0[0x10]; 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_08112C40[5];
extern u16 gUnk_08112C4A[3]; extern u16 gUnk_08112C4A[3];
extern u16 gUnk_08112C50[6]; extern u16 gUnk_08112C50[6];
@ -118,7 +118,7 @@ void sub_0806ACC4(Entity* this) {
this->action = 2; this->action = 2;
this->interactType = 0; this->interactType = 0;
InitializeAnimation(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)) + 8); InitializeAnimation(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)) + 8);
sub_0806AFE8(this, *(s32**)&this->cutsceneBeh); sub_0806AFE8(this, *(ScriptExecutionContext**)&this->cutsceneBeh);
} }
if (this->type == 1) { if (this->type == 1) {
u8 idx = gPlayerEntity.animationState >> 1; u8 idx = gPlayerEntity.animationState >> 1;
@ -223,19 +223,19 @@ void sub_0806AEE4(Entity* this) {
} }
} }
void sub_0806AF60(Entity* this, int* idx) { void sub_0806AF60(Entity* this, ScriptExecutionContext* context) {
InitializeAnimation(this, idx[1] + (this->animationState / 2)); 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; this->field_0x20 = 0x24000;
} }
void sub_0806AF78(Entity* this, u32 arg1) { void sub_0806AF78(Entity* this, ScriptExecutionContext* context) {
sub_08003FC4(this, 0x1800); sub_08003FC4(this, 0x1800);
if (0 <= this->height.WORD && this->field_0x20 < 1) { if (0 <= this->height.WORD && this->field_0x20 < 1) {
this->height.WORD = 0; 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); ShowNPCDialogue(this, gUnk_081126F0 + this->type2 * 8 + idx);
} }
void sub_0806AFE8(Entity* this, s32* unk) { void sub_0806AFE8(Entity* this, ScriptExecutionContext* context) {
unk[5] = 0; context->condition = 0;
gUnk_08112BF0[this->type2](this, unk); gUnk_08112BF0[this->type2](this, context);
} }
void sub_0806B004(Entity* this, int* unk) { void sub_0806B004(Entity* this, ScriptExecutionContext* context) {
int idx = 0; int idx = 0;
if (CheckGlobalFlag(0x29)) { if (CheckGlobalFlag(0x29)) {
@ -267,7 +267,7 @@ void sub_0806B004(Entity* this, int* unk) {
idx = 3; idx = 3;
if (CheckLocalFlag(0x78) == 0) { if (CheckLocalFlag(0x78) == 0) {
idx = 2; idx = 2;
unk[5] = 1; context->condition = 1;
SetLocalFlag(0x78); SetLocalFlag(0x78);
} }
} else { } else {

View File

@ -16,11 +16,6 @@ typedef struct {
u8 unk3; u8 unk3;
} struct_0810B680; } struct_0810B680;
typedef struct {
u32 unk;
u32 unk2;
} struct_08061FB8;
extern void (*const gUnk_0810B774[])(Entity*); extern void (*const gUnk_0810B774[])(Entity*);
extern void (*const gUnk_0810B77C[])(Entity*); extern void (*const gUnk_0810B77C[])(Entity*);
extern void sub_08061CB4(Entity*, u32); 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) { void sub_08061E90(Entity* this, Entity* arg1) {
u32 animIndex; u32 animIndex;
s32 iVar4; s32 iVar4;
@ -258,10 +254,10 @@ void sub_08061FB0(Entity* this) {
this->hitbox = NULL; this->hitbox = NULL;
} }
void sub_08061FB8(Entity* this, struct_08061FB8* arg1) { void sub_08061FB8(Entity* this, ScriptExecutionContext* context) {
u8* temp = gUnk_0810B748; 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) { void sub_08061FD8(Entity* this) {

View File

@ -21,7 +21,7 @@ extern void SetSpriteSubEntryOffsetData1(Entity*, u32, u32);
extern void sub_0807000C(Entity*); extern void sub_0807000C(Entity*);
extern void (*const gUnk_08113A7C[])(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 SpriteLoadData gUnk_08113A1C[];
extern u32 script_08014A80; extern u32 script_08014A80;
@ -111,10 +111,9 @@ void WindTribespeople_Head(Entity* this) {
} }
} }
// body and head entities? void sub_0806C90C(Entity* this, ScriptExecutionContext* context) {
void sub_0806C90C(Entity* param_1, Entity* param_2) { context->condition = 0;
*(u32*)&param_2->animationState = 0; gUnk_08113A8C[this->type2](this, context);
gUnk_08113A8C[param_1->type2](param_1, param_2);
} }
void sub_0806C928(Entity* this) { void sub_0806C928(Entity* this) {

View File

@ -24,59 +24,59 @@ extern RoomControls gRoomControls;
extern void (*gUnk_08110BD8[])(Entity* ent); extern void (*gUnk_08110BD8[])(Entity* ent);
extern u16 gUnk_08110BE0[]; extern u16 gUnk_08110BE0[];
void Zelda(Entity* ent) { void Zelda(Entity* this) {
gUnk_08110BD8[ent->action](ent); gUnk_08110BD8[this->action](this);
} }
void sub_08066CCC(Entity* ent) { void sub_08066CCC(Entity* this) {
ent->action = 1; this->action = 1;
ent->spriteSettings.b.draw = 1; this->spriteSettings.b.draw = 1;
PrependEntityToList(ent, 7); PrependEntityToList(this, 7);
sub_0805E3A0(ent, 2); sub_0805E3A0(this, 2);
sub_0807DD50(ent); sub_0807DD50(this);
} }
void sub_08066CF8(Entity* ent) { void sub_08066CF8(Entity* this) {
sub_0807DD94(ent, NULL); sub_0807DD94(this, NULL);
} }
void sub_08066D04(Entity* ent) { void sub_08066D04(Entity* this) {
ent->parent = FindEntityBySubtype(7, 0x2E); this->parent = FindEntityBySubtype(7, 0x2E);
} }
void sub_08066D14(Entity* ent, u32* param_2) { void sub_08066D14(Entity* this, ScriptExecutionContext* context) {
Entity* parent; Entity* parent;
parent = ent->parent; parent = this->parent;
if (parent != NULL) { if (parent != NULL) {
ent->animationState = parent->animationState; this->animationState = parent->animationState;
ent->spriteSettings.b.draw = 1; this->spriteSettings.b.draw = 1;
CopyPosition(parent, ent); CopyPosition(parent, this);
sub_08068680(ent, ent->parent); sub_08068680(this, this->parent);
param_2[5] = 1; context->condition = 1;
} else { } 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; Entity* parent;
parent = ent->parent; parent = this->parent;
if (ent->parent != NULL) { if (this->parent != NULL) {
CopyPosition(ent, parent); CopyPosition(this, parent);
ent->parent->spriteSettings.b.draw = 1; this->parent->spriteSettings.b.draw = 1;
ent->parent->animationState = ent->animationState; this->parent->animationState = this->animationState;
ent->spriteSettings.b.draw = 0; this->spriteSettings.b.draw = 0;
ent->field_0x17 &= 0xFE; this->field_0x17 &= 0xFE;
sub_08068694(ent, ent->parent); sub_08068694(this, this->parent);
param_2[5] = 1; context->condition = 1;
} else { } else {
param_2[5] = 0; context->condition = 0;
} }
} }
void sub_08066D94(Entity* ent) { void sub_08066D94(Entity* this) {
u32 roomID; u32 roomID;
Entity* npc; Entity* npc;
@ -85,94 +85,94 @@ void sub_08066D94(Entity* ent) {
if (npc != NULL) { if (npc != NULL) {
npc->animationState = gPlayerEntity.animationState; npc->animationState = gPlayerEntity.animationState;
npc->flags |= 0x20; npc->flags |= 0x20;
npc->animationState = GetAnimationState(ent); npc->animationState = GetAnimationState(this);
roomID = gRoomControls.roomID; roomID = gRoomControls.roomID;
npc->field_0x74.HWORD = roomID; npc->field_0x74.HWORD = roomID;
CopyPosition(ent, npc); CopyPosition(this, npc);
} }
DeleteThisEntity(); DeleteThisEntity();
} }
void sub_08066DE4(Entity* ent) { void sub_08066DE4(Entity* this) {
Entity* pEVar1; Entity* pEVar1;
pEVar1 = FindEntityBySubtype(7, 0x2E); pEVar1 = FindEntityBySubtype(7, 0x2E);
if (pEVar1 != NULL) { if (pEVar1 != NULL) {
CopyPosition(ent, pEVar1); CopyPosition(this, pEVar1);
sub_080686C4(ent, pEVar1); sub_080686C4(this, pEVar1);
} }
} }
void sub_08066E08(Entity* ent) { void sub_08066E08(Entity* this) {
InitAnimationForceUpdate(ent, 0x50); InitAnimationForceUpdate(this, 0x50);
ent->field_0x80.HWORD = ent->animIndex; this->field_0x80.HWORD = this->animIndex;
} }
void sub_08066E20(Entity* ent) { void sub_08066E20(Entity* this) {
InitAnimationForceUpdate(ent, 0x44); InitAnimationForceUpdate(this, 0x44);
ent->field_0x80.HWORD = ent->animIndex; this->field_0x80.HWORD = this->animIndex;
} }
void sub_08066E38(Entity* ent) { void sub_08066E38(Entity* this) {
InitAnimationForceUpdate(ent, 0x48); InitAnimationForceUpdate(this, 0x48);
ent->field_0x80.HWORD = ent->animIndex; this->field_0x80.HWORD = this->animIndex;
} }
void sub_08066E50(Entity* ent) { void sub_08066E50(Entity* this) {
InitAnimationForceUpdate(ent, 0x4C); InitAnimationForceUpdate(this, 0x4C);
ent->field_0x80.HWORD = ent->animIndex; this->field_0x80.HWORD = this->animIndex;
} }
void sub_08066E68(Entity* ent) { void sub_08066E68(Entity* this) {
InitAnimationForceUpdate(ent, 0x54); InitAnimationForceUpdate(this, 0x54);
ent->field_0x80.HWORD = ent->animIndex; this->field_0x80.HWORD = this->animIndex;
} }
void sub_08066E80(Entity* ent, u8* param_2) { void sub_08066E80(Entity* this, ScriptExecutionContext* context) {
switch (param_2[0x18]) { switch (context->unk_18) {
case 0: case 0:
param_2[0x18]++; context->unk_18++;
InitAnimationForceUpdate(ent, 0x16); InitAnimationForceUpdate(this, 0x16);
break; break;
case 1: case 1:
UpdateAnimationSingleFrame(ent); UpdateAnimationSingleFrame(this);
if (ent->frames.all & 1) { if (this->frames.all & 1) {
param_2[0x18]++; context->unk_18++;
ent->field_0x20 = 0x20000; this->field_0x20 = 0x20000;
ent->frames.all &= 0xFE; this->frames.all &= 0xFE;
SoundReq(0x7C); SoundReq(0x7C);
} }
break; break;
case 2: case 2:
sub_0806F62C(ent, 0x100, 0x80); sub_0806F62C(this, 0x100, 0x80);
sub_08003FC4(ent, 0x2000); sub_08003FC4(this, 0x2000);
if (!(ent->frames.all & 1)) { if (!(this->frames.all & 1)) {
UpdateAnimationSingleFrame(ent); UpdateAnimationSingleFrame(this);
} }
if (ent->field_0x20 < 0) { if (this->field_0x20 < 0) {
param_2[0x18]++; context->unk_18++;
} }
break; break;
case 3: case 3:
sub_0806F62C(ent, 0x100, 0x80); sub_0806F62C(this, 0x100, 0x80);
UpdateAnimationSingleFrame(ent); UpdateAnimationSingleFrame(this);
if (sub_08003FC4(ent, 0x2000) == 0) { if (sub_08003FC4(this, 0x2000) == 0) {
param_2[0x18]++; context->unk_18++;
InitAnimationForceUpdate(ent, 0x1E); InitAnimationForceUpdate(this, 0x1E);
} }
break; break;
case 4: case 4:
UpdateAnimationSingleFrame(ent); UpdateAnimationSingleFrame(this);
if (ent->frames.b.f3) { if (this->frames.b.f3) {
gActiveScriptInfo.flags |= 1; gActiveScriptInfo.flags |= 1;
return; return;
} }
} }
ent->field_0x80.HWORD = ent->animIndex; this->field_0x80.HWORD = this->animIndex;
gActiveScriptInfo.commandSize = 0; gActiveScriptInfo.commandSize = 0;
} }
void sub_08066F94(void) { void sub_08066F94() {
u16 uVar1; u16 uVar1;
u16* puVar2; u16* puVar2;
@ -184,7 +184,7 @@ void sub_08066F94(void) {
} }
} }
void sub_08066FB8(void) { void sub_08066FB8() {
u16 uVar1; u16 uVar1;
u16* puVar2; u16* puVar2;

View File

@ -6,6 +6,7 @@
#include "greatFairy.h" #include "greatFairy.h"
#include "functions.h" #include "functions.h"
#include "save.h" #include "save.h"
#include "script.h"
enum { enum {
BEHAVIORS, BEHAVIORS,
@ -517,7 +518,7 @@ void sub_080873D0(Entity* this) {
} }
} }
void sub_080873FC(void) { void sub_080873FC() {
Entity* ent; Entity* ent;
SoundReq(0xf7); 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; Entity* ent;
sub_080791D0(); sub_080791D0();
@ -539,9 +540,9 @@ void sub_08087424(Entity* arg0, struct_08087424* arg1) {
sub_0805E3A0(ent, 2); sub_0805E3A0(ent, 2);
} }
switch (arg1->unk4) { switch (context->unk_04) {
case 0: case 0:
gSave.stats.arrowCount = arg1->unk4; gSave.stats.arrowCount = 0;
break; break;
case 1: case 1:
gSave.stats.bombCount = 0; gSave.stats.bombCount = 0;
@ -549,14 +550,14 @@ void sub_08087424(Entity* arg0, struct_08087424* arg1) {
} }
} }
void sub_0808747C(u32 arg0, u32 arg1) { void sub_0808747C(Entity* this, ScriptExecutionContext* context) {
u32 iVar1; u32 iVar1 = 0;
iVar1 = (u32)FindEntityInListByForm(0x6, 0xf, 0x6, 0xb, 0x0); iVar1 = (u32)FindEntityInListByForm(0x6, 0xf, 0x6, 0xb, 0x0);
if (iVar1 != 0) { if (iVar1 != 0) {
iVar1 = 1; iVar1 = 1;
} }
*(u32*)(arg1 + 0x14) = iVar1; context->condition = iVar1;
} }
// clang-format off // clang-format off

View File

@ -174,11 +174,10 @@ static u8 sub_08086954(Entity* this) {
return this->actionDelay; return this->actionDelay;
} }
// TODO: Second arg is some unknown struct. void sub_080869A4(Entity* this, ScriptExecutionContext* context) {
void sub_080869A4(Entity* entityA, u32* entityB) { context->condition = 0;
entityB[5] = 0; if (!sub_08086954(this)) {
if (!sub_08086954(entityA)) { this->actionDelay = 8;
entityA->actionDelay = 8; context->condition = 1;
entityB[5] = 1;
} }
} }

View File

@ -10,6 +10,7 @@
#include "main.h" #include "main.h"
#include "structures.h" #include "structures.h"
#include "save.h" #include "save.h"
#include "script.h"
void sub_0804B3C4(void* arg0) { void sub_0804B3C4(void* arg0) {
sub_0804B29C(arg0); sub_0804B29C(arg0);
@ -981,7 +982,7 @@ void sub_0804BF38(u32 arg0, struct_0804BF38* arg1)
} }
#else #else
NAKED NAKED
void sub_0804BF38(u32 arg0, void* arg1) { void sub_0804BF38(Entity* this, ScriptExecutionContext* context) {
asm(".include \"asm/non_matching/sub_0804BF38.inc\""); asm(".include \"asm/non_matching/sub_0804BF38.inc\"");
} }
#endif #endif
@ -3568,7 +3569,7 @@ void sub_0804D780(void) {
extern u16 gUnk_080EAE00; extern u16 gUnk_080EAE00;
void sub_0804D7EC(void) { void sub_0804D7EC() {
u16 temp; u16 temp;
u16* tilePos; u16* tilePos;
@ -3580,7 +3581,7 @@ void sub_0804D7EC(void) {
} }
} }
void sub_0804D810(void) { void sub_0804D810() {
u16 uVar1; u16 uVar1;
u16* puVar2; u16* puVar2;
@ -4795,7 +4796,7 @@ void sub_0804E7DC(void) {
extern u32 script_08009E58; extern u32 script_08009E58;
void sub_0804E864(void) { void sub_0804E864() {
gPlayerEntity.x.HALF.HI = gRoomControls.roomOriginX + 0x90; gPlayerEntity.x.HALF.HI = gRoomControls.roomOriginX + 0x90;
gPlayerEntity.y.HALF.HI = gRoomControls.roomOriginY + 0x38; gPlayerEntity.y.HALF.HI = gRoomControls.roomOriginY + 0x38;
sub_080751E8(1, 6, &script_08009E58); sub_080751E8(1, 6, &script_08009E58);
@ -5680,35 +5681,35 @@ void sub_0804F680(Entity* parent, s32 x, s32 y) {
} }
} }
void sub_0804F6A8(Entity* arg0) { void sub_0804F6A8(Entity* this) {
sub_0804F680(arg0, 0x1d8, 0x108); sub_0804F680(this, 0x1d8, 0x108);
sub_0804F680(arg0, 0x218, 0x188); sub_0804F680(this, 0x218, 0x188);
} }
void sub_0804F6C8(Entity* arg0) { void sub_0804F6C8(Entity* this) {
sub_0804F680(arg0, 0x1e8, 0x108); sub_0804F680(this, 0x1e8, 0x108);
sub_0804F680(arg0, 0x208, 0x188); sub_0804F680(this, 0x208, 0x188);
} }
void sub_0804F6E8(Entity* arg0) { void sub_0804F6E8(Entity* this) {
sub_0804F680(arg0, 0x1f8, 0x108); sub_0804F680(this, 0x1f8, 0x108);
sub_0804F680(arg0, 0x258, 0x138); sub_0804F680(this, 0x258, 0x138);
sub_0804F680(arg0, 0x1f8, 0x188); sub_0804F680(this, 0x1f8, 0x188);
sub_0804F680(arg0, 0x198, 0x158); sub_0804F680(this, 0x198, 0x158);
} }
void sub_0804F724(Entity* arg0) { void sub_0804F724(Entity* this) {
sub_0804F680(arg0, 0x208, 0x108); sub_0804F680(this, 0x208, 0x108);
sub_0804F680(arg0, 0x258, 0x148); sub_0804F680(this, 0x258, 0x148);
sub_0804F680(arg0, 0x1e8, 0x188); sub_0804F680(this, 0x1e8, 0x188);
sub_0804F680(arg0, 0x198, 0x148); sub_0804F680(this, 0x198, 0x148);
} }
void sub_0804F760(Entity* arg0) { void sub_0804F760(Entity* this) {
sub_0804F680(arg0, 0x218, 0x108); sub_0804F680(this, 0x218, 0x108);
sub_0804F680(arg0, 0x258, 0x158); sub_0804F680(this, 0x258, 0x158);
sub_0804F680(arg0, 0x1d8, 0x188); sub_0804F680(this, 0x1d8, 0x188);
sub_0804F680(arg0, 0x198, 0x138); sub_0804F680(this, 0x198, 0x138);
} }
void sub_0804F79C(Entity* parent) { 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, 0x41d, 1);
SetTileType(0x1d3, 0x621, 1); SetTileType(0x1d3, 0x621, 1);
} }
void sub_0804F830(void) { void sub_0804F830() {
SetTileType(0x1d4, 0x41e, 1); SetTileType(0x1d4, 0x41e, 1);
SetTileType(0x1d4, 0x620, 1); SetTileType(0x1d4, 0x620, 1);
} }
void sub_0804F854(void) { void sub_0804F854() {
SetTileType(0x1d5, 0x41f, 1); SetTileType(0x1d5, 0x41f, 1);
SetTileType(0x1d4, 0x4e5, 1); SetTileType(0x1d4, 0x4e5, 1);
SetTileType(0x1d5, 0x61f, 1); SetTileType(0x1d5, 0x61f, 1);
SetTileType(0x1d4, 0x559, 1); SetTileType(0x1d4, 0x559, 1);
} }
void sub_0804F89C(void) { void sub_0804F89C() {
SetTileType(0x1d6, 0x420, 1); SetTileType(0x1d6, 0x420, 1);
SetTileType(0x1d5, 0x525, 1); SetTileType(0x1d5, 0x525, 1);
SetTileType(0x1d6, 0x61e, 1); SetTileType(0x1d6, 0x61e, 1);
SetTileType(0x1d5, 0x519, 1); SetTileType(0x1d5, 0x519, 1);
} }
void sub_0804F8E0(void) { void sub_0804F8E0() {
SetTileType(0x1d3, 0x421, 1); SetTileType(0x1d3, 0x421, 1);
SetTileType(0x1d6, 0x565, 1); SetTileType(0x1d6, 0x565, 1);
SetTileType(0x1d3, 0x61d, 1); SetTileType(0x1d3, 0x61d, 1);
SetTileType(0x1d6, 0x4d9, 1); SetTileType(0x1d6, 0x4d9, 1);
} }
void sub_0804F928(void) { void sub_0804F928() {
sub_0807BA8C(0x41d, 1); sub_0807BA8C(0x41d, 1);
sub_0807BA8C(0x621, 1); sub_0807BA8C(0x621, 1);
} }
void sub_0804F944(void) { void sub_0804F944() {
sub_0807BA8C(0x41e, 1); sub_0807BA8C(0x41e, 1);
sub_0807BA8C(0x620, 1); sub_0807BA8C(0x620, 1);
} }
void sub_0804F960(void) { void sub_0804F960() {
sub_0807BA8C(0x41f, 1); sub_0807BA8C(0x41f, 1);
sub_0807BA8C(0x4e5, 1); sub_0807BA8C(0x4e5, 1);
sub_0807BA8C(0x61f, 1); sub_0807BA8C(0x61f, 1);
sub_0807BA8C(0x559, 1); sub_0807BA8C(0x559, 1);
} }
void sub_0804F994(void) { void sub_0804F994() {
sub_0807BA8C(0x420, 1); sub_0807BA8C(0x420, 1);
sub_0807BA8C(0x525, 1); sub_0807BA8C(0x525, 1);
sub_0807BA8C(0x61e, 1); sub_0807BA8C(0x61e, 1);
sub_0807BA8C(0x519, 1); sub_0807BA8C(0x519, 1);
} }
void sub_0804F9C8(void) { void sub_0804F9C8() {
sub_0807BA8C(0x421, 1); sub_0807BA8C(0x421, 1);
sub_0807BA8C(0x565, 1); sub_0807BA8C(0x565, 1);
sub_0807BA8C(0x61d, 1); sub_0807BA8C(0x61d, 1);

View File

@ -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]; entity->animationState = (entity->animationState & 0x80) | gUnk_0811E514[(u32)(temp << 0x18) >> 0x1c];
} }
void sub_0807DF28(void) { void sub_0807DF28() {
sub_0807DF38(); sub_0807DF38();
sub_08079184(); sub_08079184();
sub_08077B20(); sub_08077B20();
} }
void sub_0807DF38(void) { void sub_0807DF38() {
gUnk_0200AF00.filler0[1] = 0xff; gUnk_0200AF00.filler0[1] = 0xff;
gUnk_02034490[0] = 0xff; gUnk_02034490[0] = 0xff;
} }
void sub_0807DF50(void) { void sub_0807DF50() {
gUnk_02034490[0] = 0; gUnk_02034490[0] = 0;
gUnk_0200AF00.filler0[1] = 0; gUnk_0200AF00.filler0[1] = 0;
sub_0801C4A0(0); sub_0801C4A0(0);

View File

@ -18,7 +18,6 @@ void sub_0804AFF4(void) {
_call_via_r0(func); _call_via_r0(func);
} }
sub_0804B16C(); sub_0804B16C();
return;
} }
/* /*

View File

@ -11,6 +11,4 @@ void sub_08050008(u32 param_1, u32 param_2, u32 param_3) {
unk = &gFadeControl; unk = &gFadeControl;
*(unk + 1) = -1; *(unk + 1) = -1;
return;
} }

View File

@ -18,7 +18,6 @@ extern void DoFade(u32, u32);
void sub_08050024() { void sub_08050024() {
sub_0801E104(); sub_0801E104();
DoFade(5, 0x80 << 1); DoFade(5, 0x80 << 1);
return;
} }
void sub_08050038(u32 arg0) { void sub_08050038(u32 arg0) {

View File

@ -4,9 +4,7 @@ extern void sub_08000152(u32);
extern void sub_0807B778(u32, u32); extern void sub_0807B778(u32, u32);
extern void SetTileType(u32, 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) { if (param_1 == 53) {
sub_08000152(53); sub_08000152(53);
sub_0807B778(param_2, param_3); sub_0807B778(param_2, param_3);
@ -17,5 +15,4 @@ void sub_0807B7D8(u32 param_1, u32 param_2, u32 param_3)
} else { } else {
SetTileType(param_1, param_2, param_3); SetTileType(param_1, param_2, param_3);
} }
return;
} }

View File

@ -2,9 +2,7 @@
extern void SetTileType(u32, u32, u32); 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(620, param_1 + -65, 1);
SetTileType(627, param_1 + -65, 2); SetTileType(627, param_1 + -65, 2);
SetTileType(621, param_1 + -64, 1); SetTileType(621, param_1 + -64, 1);
@ -14,5 +12,4 @@ void sub_0807B820(u32 param_1)
SetTileType(623, param_1 + -1, 1); SetTileType(623, param_1 + -1, 1);
SetTileType(624, param_1, 1); SetTileType(624, param_1, 1);
SetTileType(626, param_1 + 1, 1); SetTileType(626, param_1 + 1, 1);
return;
} }

View File

@ -2,9 +2,7 @@
extern void SetTileType(u32, u32, u32); 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(636, param_1 + -65, 1);
SetTileType(643, param_1 + -65, 2); SetTileType(643, param_1 + -65, 2);
SetTileType(637, param_1 + -64, 1); SetTileType(637, param_1 + -64, 1);
@ -14,5 +12,4 @@ void sub_0807B8A8(u32 param_1)
SetTileType(639, param_1 + -1, 1); SetTileType(639, param_1 + -1, 1);
SetTileType(640, param_1, 1); SetTileType(640, param_1, 1);
SetTileType(642, param_1 + 1, 1); SetTileType(642, param_1 + 1, 1);
return;
} }

View File

@ -2,9 +2,7 @@
extern void SetTileType(u32, u32, u32); 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(652, param_1 + -65, 1);
SetTileType(659, param_1 + -65, 2); SetTileType(659, param_1 + -65, 2);
SetTileType(653, param_1 + -64, 1); SetTileType(653, param_1 + -64, 1);
@ -14,5 +12,4 @@ void sub_0807B930(int param_1)
SetTileType(655, param_1 + -1, 1); SetTileType(655, param_1 + -1, 1);
SetTileType(656, param_1, 1); SetTileType(656, param_1, 1);
SetTileType(658, param_1 + 1, 1); SetTileType(658, param_1 + 1, 1);
return;
} }

View File

@ -151,7 +151,7 @@ POINTER_MAP = {
'sub_0806C23C': 'Simon_CreateChest', 'sub_0806C23C': 'Simon_CreateChest',
'sub_0801637C': 'script_0801637C+1', 'sub_0801637C': 'script_0801637C+1',
'sub_08016383': 'script_08016384', 'sub_08016383': 'script_08016384',
'sub_0806C598': 'FUN_0806c598', 'sub_0806C598': 'sub_0806C598',
'sub_080A2138': 'Windcrest_Unlock', 'sub_080A2138': 'Windcrest_Unlock',
'sub_080A29BC': 'CreateDust' 'sub_080A29BC': 'CreateDust'
} }