Merge branch 'master' into cleanup_declarations

This commit is contained in:
Henny022p
2021-03-15 22:56:23 +01:00
549 changed files with 18187 additions and 4914 deletions
-1
View File
@@ -32,7 +32,6 @@ void Anju(Entity* this) {
if (UpdateFuseInteraction(this)) {
this->action = 1;
}
default:
}
}
+6 -6
View File
@@ -109,8 +109,8 @@ void sub_08063410(Entity* this) {
if (this->type != 0) {
sub_0806346C(this);
}
sub_0807DDAC(this, NULL);
sub_0807DDE4(this);
ExecuteScriptForEntity(this, NULL);
HandleEntity0x82Actions(this);
GetNextFrame(this);
}
@@ -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->intVariable = 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);
}
+2 -2
View File
@@ -23,8 +23,8 @@ void sub_0806CF30(Entity* this) {
sub_0806D0B0(this);
sub_0807DD64(this);
} else {
sub_0807DDAC(this, NULL);
sub_0807DDE4(this);
ExecuteScriptForEntity(this, NULL);
HandleEntity0x82Actions(this);
}
switch (this->previousActionFlag) {
+19 -23
View File
@@ -196,53 +196,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*)&param_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*)&param_2->animationState = bVar1;
context->condition = bVar1;
uVar2 = GetInventoryValue(0x48); // spin attack
if (uVar2 == 0) {
*(u32*)&param_2->animationState = 0;
context->condition = 0;
}
uVar2 = GetInventoryValue(0x4b); // rock breaker
if (uVar2 == 0) {
*(u32*)&param_2->animationState = 0;
context->condition = 0;
}
uVar2 = GetInventoryValue(0x4a); // dash attack
if (uVar2 == 0) {
*(u32*)&param_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*)&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 itemID;
u32 uVar2;
*(u32*)&param_2->animationState = 0;
bVar1 = param_1->actionDelay;
context->condition = 0;
bVar1 = this->actionDelay;
if (bVar1 > 10)
return;
@@ -303,7 +300,7 @@ LABEL1:
return;
}
switchD_08068d12_caseD_0:
*(u32*)&param_2->animationState = 1;
context->condition = 1;
}
// Introduction dialoague
@@ -355,12 +352,12 @@ void sub_08068EB4(void) {
gPlayerState.field_0xab = 0;
}
void sub_08068EC4(Entity* param_1, Entity* param_2) {
if (gUnk_08111740[param_1->actionDelay] == gPlayerState.field_0xab) {
*(u16*)&param_2->flags = gUnk_0811172A[param_1->actionDelay];
*(u32*)&param_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*)&param_2->animationState = 0;
context->condition = 0;
}
}
@@ -387,7 +384,6 @@ void sub_08068F3C(Entity* this) {
}
void BladeBrothers_Fusion(Entity* this) {
if (this->action == 0) {
this->action += 1;
this->spriteSettings.b.draw = 0;
+1 -1
View File
@@ -8,8 +8,8 @@
#include "npc.h"
#include "structures.h"
#include "functions.h"
#include "script.h"
extern void sub_0807DD94(Entity*, u32);
void Carlov(Entity* this) {
if (this->action == 0) {
+5 -5
View File
@@ -4,9 +4,9 @@
#include "player.h"
#include "npc.h"
#include "functions.h"
#include "script.h"
extern SpriteLoadData gUnk_08110CA8[];
extern void sub_0807DDAC(Entity*, u32);
void Carpenter(Entity* this) {
if (*(u32*)&this->cutsceneBeh == 0) {
@@ -30,8 +30,8 @@ void Carpenter(Entity* this) {
sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)) + 4 + (this->type * 8));
sub_0806F118(this);
} else {
sub_0807DDAC(this, 0);
sub_0807DDE4(this);
ExecuteScriptForEntity(this, 0);
HandleEntity0x82Actions(this);
GetNextFrame(this);
}
break;
@@ -60,6 +60,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->intVariable + (this->animationState >> 1) + this->type * 8);
}
+1 -1
View File
@@ -20,7 +20,7 @@ void sub_08068FC0(Entity* ent) {
ent->action = 1;
ent->animationState = ent->type2;
ent->nonPlanarMovement = 0x40;
ent->speed = 0x40;
ent->field_0x6c.HALF.HI = 0xFF;
+10 -17
View File
@@ -7,19 +7,13 @@
#include "textbox.h"
#include "npc.h"
#include "functions.h"
#include "script.h"
extern void sub_0807DD94(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;
@@ -42,7 +36,6 @@ void Dampe(Entity* this) {
if (UpdateFuseInteraction(this)) {
this->action = 1;
}
default:
}
}
@@ -61,15 +54,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) {
@@ -78,16 +71,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;
}
@@ -102,10 +95,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;
}
}
+8 -8
View File
@@ -1,21 +1,21 @@
#include "global.h"
#include "entity.h"
#include "script.h"
#include "functions.h"
extern u32 gUnk_0813AD10;
extern u32 gUnk_0813AD24;
extern u32 gUnk_0813AD38;
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);
}
}
@@ -27,6 +27,6 @@ void sub_0806C588(void) {
DoExitTransition(&gUnk_0813AD24);
}
void FUN_0806c598(void) {
void sub_0806C598(void) {
DoExitTransition(&gUnk_0813AD38);
}
+24 -41
View File
@@ -6,8 +6,8 @@
#include "script.h"
extern Hitbox gUnk_080FD170;
extern void gUnk_08016030; // Cutscene data type?
extern void gUnk_0801606C; // Cutscene data type?
extern void script_08016030; // Cutscene data type?
extern void script_0801606C; // Cutscene data type?
extern void sub_0809623C(Entity*);
extern void sub_08096260(Entity*);
@@ -34,40 +34,26 @@ void EzloCap(Entity* this) {
sub_0805E3A0(this, 2);
sub_0807DD50(this);
}
sub_0807DDAC(this, NULL);
sub_0807DDE4(this);
ExecuteScriptForEntity(this, NULL);
HandleEntity0x82Actions(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->postScriptActions |= 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->x.HALF.HI = xOffset;
context->y.HALF.HI = yOffset;
xOffset -= this->x.HALF.HI;
this->direction = sub_080045DA(xOffset, yOffset - this->y.HALF.HI);
@@ -119,15 +105,16 @@ 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->intVariable]; // 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->intVariable],
(u32)(gUnk_081141E4[context->intVariable]));
}
// Returns the kinstone id?
@@ -168,11 +155,9 @@ 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;
gUnk_02033280.unk_07 |= 1;
void sub_0806DAAC(Entity* this, ScriptExecutionContext* context) {
context->condition = CheckKinstoneFused(sub_0806DA3C(this));
gActiveScriptInfo.flags |= 1;
}
// maybe actually execute the kinstone fusion?
@@ -202,29 +187,27 @@ 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);
if (ent != NULL) {
PositionRelative(this, ent, -0x80000, 0);
*(ScriptExecutionContext**)&ent->cutsceneBeh = StartCutscene(ent, &gUnk_08016030);
*(ScriptExecutionContext**)&ent->cutsceneBeh = StartCutscene(ent, &script_08016030);
}
ent = CreateObject(0x3e, 5, 0);
if (ent != NULL) {
PositionRelative(this, ent, 0x80000, 0);
*(ScriptExecutionContext**)&ent->cutsceneBeh = StartCutscene(ent, &gUnk_0801606C);
*(ScriptExecutionContext**)&ent->cutsceneBeh = StartCutscene(ent, &script_0801606C);
}
}
+1 -1
View File
@@ -34,7 +34,7 @@ void sub_0805FE48(Entity* this) {
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
sub_0806F118(this);
} else {
ExecuteScriptCommandSet(this, *(ScriptExecutionContext**)&this->cutsceneBeh);
ExecuteScript(this, *(ScriptExecutionContext**)&this->cutsceneBeh);
sub_0805FF2C(this, *(void**)&this->cutsceneBeh);
uVar4 = this->field_0x80.HWORD;
if (uVar4 < 8) {
+4 -4
View File
@@ -42,8 +42,8 @@ void ForestMinish(Entity* this) {
this->interactType = 0;
sub_0806F118(this);
} else {
sub_0807DDAC(this, NULL);
sub_0807DDE4(this);
ExecuteScriptForEntity(this, NULL);
HandleEntity0x82Actions(this);
if (this->frameDuration != 0xf0) {
sub_080600F0(this);
}
@@ -215,8 +215,8 @@ 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->intVariable);
}
void sub_08060318(void) {
+3 -3
View File
@@ -97,9 +97,9 @@ 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);
gUnk_02033280.unk_07 |= 1;
void sub_0806948C(Entity* this, ScriptExecutionContext* context) {
context->condition = CheckKinstoneFused((sub_08069480(this) << 24) >> 24);
gActiveScriptInfo.flags |= 1;
}
void sub_080694B0(Entity* this) {
+9 -11
View File
@@ -4,6 +4,7 @@
#include "flags.h"
#include "textbox.h"
#include "room.h"
#include "script.h"
#include "structures.h"
#include "functions.h"
@@ -20,7 +21,6 @@ typedef struct {
extern void sub_08063D24(Entity*);
extern void sub_0806EE20(Entity*);
extern void sub_08064428(Entity*);
extern void sub_0807DDAC(Entity*, u32);
extern void sub_0806EE04(Entity*, void*, u32);
void sub_08063DC8(Entity*);
void sub_08063F20(Entity*);
@@ -148,8 +148,8 @@ void sub_08063E90(Entity* this) {
}
void sub_08063F20(Entity* this) {
sub_0807DDAC(this, 0);
sub_0807DDE4(this);
ExecuteScriptForEntity(this, 0);
HandleEntity0x82Actions(this);
GetNextFrame(this);
if (this->interactType != 0) {
this->action++;
@@ -211,18 +211,16 @@ void sub_08064044(void) {
gScreenTransition.transitioningOut = 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->intVariable = 0;
switch (this->type2) {
case 0x11:
arg1->unk2 = 1;
context->intVariable = 1;
break;
case 0x12:
arg1->unk2 = 2;
context->intVariable = 2;
break;
case 0x13:
arg1->unk2 = 3;
context->intVariable = 3;
}
}
+6 -6
View File
@@ -25,8 +25,8 @@ void Librari(Entity* this) {
this->interactType = 0;
sub_0806F118(this);
} else {
sub_0807DDAC(this, NULL);
sub_0807DDE4(this);
ExecuteScriptForEntity(this, NULL);
HandleEntity0x82Actions(this);
UpdateAnimationSingleFrame(this);
}
break;
@@ -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);
@@ -60,7 +60,7 @@ void sub_0806B260(Entity* this, u32 arg1) {
extern u16 gUnk_08112D50[];
void sub_0806b2b4(Entity* this) {
void sub_0806B2B4(Entity* this) {
u32 index;
if (CheckLocalFlag(0xb3)) {
+2 -2
View File
@@ -35,8 +35,8 @@ void MayorHagen(Entity* this) {
sub_0806F118(this);
break;
}
sub_0807DDAC(this, NULL);
sub_0807DDE4(this);
ExecuteScriptForEntity(this, NULL);
HandleEntity0x82Actions(this);
UpdateAnimationSingleFrame(this);
break;
case 2:
+2 -2
View File
@@ -72,8 +72,8 @@ void sub_08068780(Entity* this) {
this->interactType = 0;
sub_0806F118(this);
} else {
sub_0807DDAC(this, NULL);
sub_0807DDE4(this);
ExecuteScriptForEntity(this, NULL);
HandleEntity0x82Actions(this);
GetNextFrame(this);
}
break;
+2 -2
View File
@@ -40,7 +40,7 @@ void sub_08060428(Entity* this) {
void* data;
this->actionDelay = 0x5a;
this->nonPlanarMovement = 0x180;
this->speed = 0x180;
if (this->type2 != 0) {
data = GetCurrentRoomProperty(this->type2);
} else {
@@ -195,7 +195,7 @@ void sub_08060700(Entity* entity, ScriptExecutionContext* context) {
u32 x = coords->x + gRoomControls.roomOriginX;
u32 y = coords->y + gRoomControls.roomOriginY;
sub_0807DEDC(entity, context, x, y);
gUnk_02033280.unk_07 |= 1;
gActiveScriptInfo.flags |= 1;
}
void sub_0806075C(Entity* this) {
+4 -4
View File
@@ -8,7 +8,7 @@ extern void sub_0806A8C8(Entity*);
extern void (*gUnk_08112260[])(Entity*);
extern void (*gUnk_08112278[])(Entity*);
extern void gUnk_08012F0C;
extern void script_08012F0C;
void Rem(Entity* this) {
gUnk_08112260[this->type](this);
@@ -18,8 +18,8 @@ void sub_0806a370(Entity* this) {
u8* pbVar1;
gUnk_08112278[this->action](this);
sub_0807DDAC(this, NULL);
sub_0807DDE4(this);
ExecuteScriptForEntity(this, NULL);
HandleEntity0x82Actions(this);
UpdateAnimationSingleFrame(this);
sub_0806ED78(this);
if (this->animIndex == 0xf) {
@@ -42,7 +42,7 @@ void sub_0806A3D8(Entity* this) {
this->actionDelay = 0xb4;
sub_0805E3A0(this, 2);
sub_0806A8C8(this);
uVar1 = StartCutscene(this, &gUnk_08012F0C);
uVar1 = StartCutscene(this, &script_08012F0C);
*(ScriptExecutionContext**)&this->cutsceneBeh = uVar1;
sub_0807DD94(this, NULL);
}
+2 -2
View File
@@ -41,8 +41,8 @@ void sub_0806C280(void) {
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->intVariable) {
case 0:
DoFade(0xd, 4);
break;
+6 -6
View File
@@ -125,8 +125,8 @@ void sub_080661BC(Entity* this) {
}
void sub_08066200(Entity* this) {
sub_0807DDAC(this, NULL);
sub_0807DDE4(this);
ExecuteScriptForEntity(this, NULL);
HandleEntity0x82Actions(this);
UpdateAnimationSingleFrame(this);
}
@@ -154,12 +154,12 @@ void sub_08066258(void) {
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) {
+3 -5
View File
@@ -62,15 +62,13 @@ void sub_08062C7C(Entity* ent) {
}
void sub_08062CA4(Entity* ent) {
sub_0807DDAC(ent, NULL);
sub_0807DDE4(ent);
ExecuteScriptForEntity(ent, NULL);
HandleEntity0x82Actions(ent);
GetNextFrame(ent);
}
void sub_08062CBC(Entity* ent) {
u32 uVar1;
uVar1 = CheckKinstoneFused(44);
u32 uVar1 = CheckKinstoneFused(44);
ShowNPCDialogue(ent, &gUnk_0810C2E4[(-uVar1 | uVar1) >> 31]);
}
+2 -2
View File
@@ -52,8 +52,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
+4 -4
View File
@@ -10,7 +10,7 @@
extern void (*gUnk_0810FEC4[])(Entity* this);
extern void (*gUnk_0810FEBC[])(Entity* this);
extern SpriteLoadData gUnk_0810FEB0;
extern u8 gUnk_0800B41C;
extern u8 script_0800B41C;
extern u8 gUnk_0810FED8[];
void sub_0806574C(Entity* this);
@@ -109,7 +109,7 @@ void sub_080656D4(Entity* this) {
} else {
if (this->interactType != 0) {
if (GetInventoryValue(0x37) != 0) { // keyLonLon
StartCutscene(this, (u16*)&gUnk_0800B41C);
StartCutscene(this, (u16*)&script_0800B41C);
goto label2;
} else {
this->field_0x68.HALF.HI = this->action;
@@ -136,12 +136,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) {
+16 -16
View File
@@ -11,7 +11,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 void sub_08078850(Entity*, u32, u32, u32*);
@@ -21,7 +21,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];
@@ -107,13 +107,13 @@ void sub_0806ACC4(Entity* this) {
this->interactType = 0;
sub_0806F118(this);
} else {
sub_0807DDAC(this, NULL);
ExecuteScriptForEntity(this, NULL);
sub_0806AEA8(this);
if (this->type2 == 10 && this->interactType) {
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;
@@ -177,7 +177,7 @@ void sub_0806AEA8(Entity* this) {
if (old & 0x20) {
sub_08003FC4(this, 0x4000);
}
sub_0807DDE4(this);
HandleEntity0x82Actions(this);
this->field_0x82.HWORD = old;
}
@@ -218,25 +218,25 @@ 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->intVariable + (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);
}
}
void sub_0806AFA0(Entity* this) {
if (sub_0806ED78(this)) {
sub_0806F62C(this, -this->nonPlanarMovement, this->direction);
sub_0806F62C(this, -this->speed, this->direction);
}
}
@@ -248,12 +248,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)) {
@@ -262,7 +262,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 {
+7 -11
View File
@@ -17,11 +17,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);
@@ -133,8 +128,8 @@ void sub_08061D64(Entity* this) {
this->field_0x68.HALF.HI = this->animIndex;
InitializeAnimation(this, (this->animIndex & -4) + sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
} else {
sub_0807DDAC(this, NULL);
sub_0807DDE4(this);
ExecuteScriptForEntity(this, NULL);
HandleEntity0x82Actions(this);
if (this->frameDuration == 0xff) {
this->frameDuration = gUnk_0810B680[this->type].unk2;
}
@@ -173,6 +168,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;
@@ -204,7 +200,7 @@ void sub_08061E90(Entity* this, Entity* arg1) {
}
this->direction = (u8)animIndex;
this->animationState = sub_0806F5B0(animIndex);
this->nonPlanarMovement = gUnk_0810B74A[this->type];
this->speed = gUnk_0810B74A[this->type];
}
animIndex = (this->animationState >> 1) + 4;
if (animIndex != this->animIndex) {
@@ -231,7 +227,7 @@ void sub_08061E90(Entity* this, Entity* arg1) {
arg1->spriteIndex = 1;
}
if (--arg1->spriteIndex != 0) {
gUnk_02033280.unk_06 = 0;
gActiveScriptInfo.commandSize = 0;
}
}
@@ -248,10 +244,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->intVariable], &gUnk_0810B740[context->intVariable]);
}
void sub_08061FD8(Entity* this) {
+6 -8
View File
@@ -9,13 +9,12 @@
#include "script.h"
extern void sub_0806C7D4(Entity*);
extern void sub_0807DD80(Entity*, u32*);
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 gUnk_08014A80;
extern u16 script_08014A80;
extern Dialog gUnk_08113ABC[];
extern u16 gUnk_08113B0C[];
@@ -48,7 +47,7 @@ void sub_0806C7D4(Entity* this) {
sub_0807DD94(this, NULL);
if ((this->type2 == 3) && (!CheckGlobalFlag(WARP_EVENT_END)) && (CheckLocalFlag(0x63)) && (CheckRoomFlag(0))) {
this->type2 = 7;
sub_0807DD80(this, &gUnk_08014A80);
sub_0807DD80(this, &script_08014A80);
}
}
}
@@ -102,10 +101,9 @@ void WindTribespeople_Head(Entity* this) {
}
}
// body and head entities?
void sub_0806C90C(Entity* param_1, Entity* param_2) {
*(u32*)&param_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) {
+77 -77
View File
@@ -14,59 +14,59 @@ extern void sub_080686C4(Entity*, Entity*);
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;
@@ -75,91 +75,91 @@ 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) {
gUnk_02033280.unk_07 |= 1;
UpdateAnimationSingleFrame(this);
if (this->frames.b.f3) {
gActiveScriptInfo.flags |= 1;
return;
}
}
ent->field_0x80.HWORD = ent->animIndex;
gUnk_02033280.unk_06 = 0;
this->field_0x80.HWORD = this->animIndex;
gActiveScriptInfo.commandSize = 0;
}
void sub_08066F94(void) {