Document various fields and functions

This commit is contained in:
Tal Hayon
2022-08-06 15:21:41 +03:00
parent 64c2f2476d
commit 18ef0d34b4
79 changed files with 378 additions and 346 deletions
+1 -1
View File
@@ -59,7 +59,7 @@ void BigPushableLever_Idle(BigPushableLeverEntity* this) {
RequestPriorityDuration(super, 30);
if (PlayerCanBeMoved()) {
gPlayerState.pushedObject = 0x98;
gPlayerState.queued_action = 5;
gPlayerState.queued_action = PLAYER_PUSH;
gPlayerState.flags |= PL_BUSY;
gPlayerEntity.x.HALF.LO = 0;
gPlayerEntity.y.HALF.LO = 0;
+1 -1
View File
@@ -225,7 +225,7 @@ void Bird_Type8(Entity* this) {
PlayerCanBeMoved() && (EntityInRectRadius(this, &gPlayerEntity, 0xe, 0xe))) {
s32 z = gPlayerEntity.z.HALF.HI - this->z.HALF.HI - 8;
if ((u16)z < 0x20 && gPlayerEntity.health != 0) {
pEVar5 = CreateObject(0x95, 10, 0);
pEVar5 = CreateObject(BIRD, 10, 0);
if (pEVar5 != NULL) {
this->child = pEVar5;
this->action = 2;
+1 -1
View File
@@ -123,7 +123,7 @@ void ChestSpawner_Type2Action2(ChestSpawnerEntity* this) {
super->subAction = 1;
break;
case 1:
if ((super->type == 5) || (gPlayerEntity.action == 1)) {
if ((super->type == 5) || (gPlayerEntity.action == PLAYER_NORMAL)) {
super->subAction = 2;
super->timer = 8;
super->subtimer = 0;
+4 -4
View File
@@ -221,7 +221,7 @@ void sub_0808F3DC(Entity* this) {
}
if (this->type == 5 && (this->frame & 1)) {
Entity* entity = CreateObjectWithParent(this->child, 0x49, 8, 0);
Entity* entity = CreateObjectWithParent(this->child, CHUCHU_BOSS_START_PARTICLE, 8, 0);
if (entity != NULL) {
entity->parent = this->parent;
entity->child = this->parent->parent;
@@ -288,19 +288,19 @@ void sub_0808F554(Entity* this) {
}
void sub_0808F5EC(Entity* this) {
Entity* entity = CreateObjectWithParent(this->child, 0x49, 5, 0);
Entity* entity = CreateObjectWithParent(this->child, CHUCHU_BOSS_START_PARTICLE, 5, 0);
if (entity != NULL) {
entity->parent = this;
entity->child = this->child;
}
entity = CreateObjectWithParent(this->child, 0x49, 6, 0);
entity = CreateObjectWithParent(this->child, CHUCHU_BOSS_START_PARTICLE, 6, 0);
if (entity != NULL) {
entity->parent = this;
entity->child = this->child;
}
entity = CreateObjectWithParent(this->child, 0x49, 7, 0);
entity = CreateObjectWithParent(this->child, CHUCHU_BOSS_START_PARTICLE, 7, 0);
if (entity != NULL) {
entity->parent = this;
entity->child = this->child;
+1 -1
View File
@@ -173,7 +173,7 @@ void sub_0809D91C(Entity* this) {
bool32 sub_0809D93C(Entity* this, const struct_gUnk_08123FB0* param_2) {
u32 uVar1;
if (gPlayerEntity.action == 6 && ((param_2->unk0c >> gPlayerEntity.animationState & 1) != 0)) {
if (gPlayerEntity.action == PLAYER_BOUNCE && ((param_2->unk0c >> gPlayerEntity.animationState & 1) != 0)) {
uVar1 = (gPlayerEntity.x.HALF.HI - this->x.HALF.HI) + param_2->unk08 + param_2->unk0a;
if (param_2->unk0a * 2 <= (u16)uVar1) {
return 0;
+2 -2
View File
@@ -421,12 +421,12 @@ void GyorgBossObject_SpawnChildren(u32 unk0, bool32 fromBlue, u32 animationState
tmp->attackOffsetY = -p->offsetY;
break;
case 1:
tmp->attackOffsetX = p->offsetY + 0xF0;
tmp->attackOffsetX = p->offsetY + DISPLAY_WIDTH;
tmp->attackOffsetY = p->offsetX;
break;
case 2:
tmp->attackOffsetX = p->offsetX;
tmp->attackOffsetY = p->offsetY + 0xA0;
tmp->attackOffsetY = p->offsetY + DISPLAY_HEIGHT;
break;
case 3:
tmp->attackOffsetX = -p->offsetY;
+1 -1
View File
@@ -92,7 +92,7 @@ void ItemForSale_Action1(ItemForSaleEntity* this) {
super->interactType = 0;
super->action = 3;
gRoomVars.animFlags = 1;
gPlayerState.queued_action = 7;
gPlayerState.queued_action = PLAYER_08070E9C;
}
} else {
if (super->interactType != 0) {
+1 -1
View File
@@ -518,7 +518,7 @@ u32 sub_0809E2C4(KeyStealingTakkuriEntity* this, u32 param_2) {
uVar1 = roomY - tmp->unk_2 + tmp->unk_5;
uVar2 = tmp->unk_5 * 2;
if (uVar2 > (u16)uVar1) {
if (tmp->unk_6 == gPlayerEntity.animationState && gPlayerEntity.action == 6) {
if (tmp->unk_6 == gPlayerEntity.animationState && gPlayerEntity.action == PLAYER_BOUNCE) {
return 1;
}
return 2;
+6 -6
View File
@@ -94,14 +94,14 @@ void sub_0809B97C(LightRayEntity* this, u32 param_2) {
if (tmp1 < 0) {
tmp1 = 0;
}
if (0xf0 < tmp1) {
tmp1 = 0xf0;
if (DISPLAY_WIDTH < tmp1) {
tmp1 = DISPLAY_WIDTH;
}
if (tmp2 < 0) {
tmp2 = 0;
}
if (0xf0 < tmp2) {
tmp2 = 0xf0;
if (DISPLAY_WIDTH < tmp2) {
tmp2 = DISPLAY_WIDTH;
}
gScreen.controls.window0HorizontalDimensions = (tmp1 << 8) | tmp2;
}
@@ -124,8 +124,8 @@ void LightRay_Type1(LightRayEntity* this) {
}
gPlayerEntity.animationState = tmp;
gScreen.lcd.displayControl = (gScreen.lcd.displayControl & 0xbfff) | 0x2000;
gScreen.controls.window0HorizontalDimensions = 0xf0;
gScreen.controls.window0VerticalDimensions = 0xa0;
gScreen.controls.window0HorizontalDimensions = DISPLAY_WIDTH;
gScreen.controls.window0VerticalDimensions = DISPLAY_HEIGHT;
break;
case 1:
if (super->timer != 0) {
+1 -1
View File
@@ -72,7 +72,7 @@ void MinishEmoticon_Action1(Entity* this) {
animIndex = origAnimIndex + 0x19;
}
} else {
if ((gPlayerState.framestate == 1) || (gPlayerState.framestate == 25)) {
if (gPlayerState.framestate == PL_STATE_WALK || gPlayerState.framestate == PL_STATE_PUSH) {
animIndex = origAnimIndex + 4;
if (this->animIndex != animIndex) {
this->z.WORD = 0;
+3 -2
View File
@@ -42,7 +42,8 @@ void Object70_Action1(Entity* this) {
if (this->type == 0) {
if (gPlayerEntity.z.WORD == 0) {
if ((((gPlayerState.dash_state & 0x40) == 0) && (gPlayerState.floor_type == SURFACE_SWAMP)) &&
((gPlayerEntity.action == 1 || ((gPlayerEntity.action == 0x18 || (gPlayerEntity.action == 4)))))) {
((gPlayerEntity.action == PLAYER_NORMAL ||
((gPlayerEntity.action == PLAYER_ROLL || (gPlayerEntity.action == PLAYER_JUMP)))))) {
goto _080974FA;
} else {
if (gPlayerEntity.z.WORD == 0) {
@@ -65,7 +66,7 @@ void Object70_Action1(Entity* this) {
}
} else {
if (gPlayerEntity.action != 0x1e) {
if (gPlayerEntity.action != PLAYER_USEENTRANCE) {
if (this->collisionLayer == 1) {
gPlayerEntity.spriteOrientation.flipY = 2;
} else {
+1 -1
View File
@@ -162,7 +162,7 @@ void ObjectBlockingStairs_Action2(ObjectBlockingStairsEntity* this) {
} else {
if (gPlayerState.heldObject == 0x12) {
if ((gPlayerEntity.frame & 2) != 0 && ++super->subtimer > 8) {
gPlayerState.queued_action = 16;
gPlayerState.queued_action = PLAYER_PULL;
gPlayerState.field_0x38 = 0x40;
gPlayerState.flags |= PL_BUSY;
gPlayerEntity.x.HALF.LO = 0;
+1 -1
View File
@@ -129,7 +129,7 @@ void ObjectOnPillar_SubAction0(ObjectOnPillarEntity* this) {
}
sub_08097008(this);
if (sub_080896B0()) {
gPlayerState.queued_action = 0x10;
gPlayerState.queued_action = PLAYER_PULL;
gPlayerState.field_0x38 = 0x20;
gPlayerState.flags |= PL_BUSY;
gPlayerEntity.x.HALF.LO = 0;
+1 -1
View File
@@ -79,7 +79,7 @@ void OctorokBossObject_Init(Entity* this) {
}
}
this->speed = 0xf0 - (Random() & 0x3f);
this->speed = DISPLAY_WIDTH - (Random() & 0x3f);
LinearMoveAngle(this, ((s16)this->speed >> 1) << 8, (u32)this->direction);
LinearMoveAngle(this, ((s16)this->speed >> 1) << 8, (u32)this->direction);
InitializeAnimation(this, 5);
+2 -2
View File
@@ -105,8 +105,8 @@ void PlayerClone_Action2(PlayerCloneEntity* this) {
super->subtimer--;
}
if (gPlayerState.chargeState.action == 5 && gPlayerClones[super->type] != NULL && gPlayerState.framestate != 19 &&
super->health != 0) {
if (gPlayerState.chargeState.action == 5 && gPlayerClones[super->type] != NULL &&
gPlayerState.framestate != PL_STATE_TALKEZLO && super->health != 0) {
if (gPlayerEntity.iframes >= 1) {
gPlayerState.chargeState.action = 1;
} else {
+4 -4
View File
@@ -234,8 +234,8 @@ void sub_0808AEB0(PullableMushroomEntity* this) {
super->subtimer = 1;
} else {
if (((super->subtimer != 0) && (gPlayerEntity.action == 1)) && (gPlayerState.swim_state == 0)) {
gPlayerState.queued_action = 0x1b;
if (((super->subtimer != 0) && (gPlayerEntity.action == PLAYER_NORMAL)) && (gPlayerState.swim_state == 0)) {
gPlayerState.queued_action = PLAYER_08072C9C;
gPlayerState.field_0x38 = uVar1;
gPlayerState.field_0x39 = super->direction ^ 0x10;
gPlayerState.field_0x3a = sub_0808B1F0(this, &gPlayerEntity);
@@ -315,9 +315,9 @@ void sub_0808B0BC(PullableMushroomEntity* this) {
ent.base.x.HALF.HI = ptr[0] + gPlayerEntity.x.HALF.HI;
ent.base.y.HALF.HI = ptr[1] + gPlayerEntity.y.HALF.HI;
if (sub_0800419C(&ent.base, super, 7, 7)) {
if ((gPlayerEntity.action != 1) || (gPlayerState.swim_state != 0))
if ((gPlayerEntity.action != PLAYER_NORMAL) || (gPlayerState.swim_state != 0))
return;
gPlayerState.queued_action = 0x1b;
gPlayerState.queued_action = PLAYER_08072C9C;
gPlayerState.field_0x38 = uVar2;
gPlayerState.field_0x39 = super->direction ^ 0x10;
gPlayerState.field_0x3a = sub_0808B1F0((PullableMushroomEntity*)super->parent, &gPlayerEntity);
+3 -3
View File
@@ -352,9 +352,9 @@ void sub_0808FDE8(PushableFurnitureEntity* this) {
bool32 sub_0808FECC(PushableFurnitureEntity* this) {
bool32 result = TRUE;
if (!((gPlayerState.flags & PL_MINISH) == 0 && (gPlayerEntity.action == 6) && (gPlayerEntity.animationState == 0) &&
(gPlayerEntity.y.HALF.HI - super->y.HALF.HI < 0x14) && (super->x.HALF.HI + 0xc > gPlayerEntity.x.HALF.HI) &&
(super->x.HALF.HI - 12 < gPlayerEntity.x.HALF.HI))) {
if (!((gPlayerState.flags & PL_MINISH) == 0 && (gPlayerEntity.action == PLAYER_BOUNCE) &&
(gPlayerEntity.animationState == 0) && (gPlayerEntity.y.HALF.HI - super->y.HALF.HI < 0x14) &&
(super->x.HALF.HI + 0xc > gPlayerEntity.x.HALF.HI) && (super->x.HALF.HI - 12 < gPlayerEntity.x.HALF.HI))) {
result = FALSE;
}
return result;
+1 -1
View File
@@ -58,7 +58,7 @@ void PushableLever_Idle(PushableLeverEntity* this) {
RequestPriorityDuration(super, 30);
if (PlayerCanBeMoved()) {
gPlayerState.pushedObject = 0x90;
gPlayerState.queued_action = 5;
gPlayerState.queued_action = PLAYER_PUSH;
gPlayerState.flags |= PL_BUSY;
gPlayerEntity.x.HALF.LO = 0;
gPlayerEntity.y.HALF.LO = 0;
+1 -1
View File
@@ -130,7 +130,7 @@ void PushableStatue_SubAction0(PushableStatueEntity* this) {
}
}
if (sub_080896B0()) {
gPlayerState.queued_action = 0x10;
gPlayerState.queued_action = PLAYER_PULL;
gPlayerState.field_0x38 = 0x20;
gPlayerState.flags |= 1;
gPlayerEntity.x.HALF.LO = 0;
+1 -1
View File
@@ -59,7 +59,7 @@ void Vaati1Portal_Action2(Entity* this) {
void sub_080A0190(Entity* this) {
this->subAction = 1;
CopyPosition(this, &gPlayerEntity);
gPlayerState.queued_action = 3;
gPlayerState.queued_action = PLAYER_FALL;
gPlayerState.field_0x38 = 0;
gPlayerState.flags |= PL_PIT_IS_EXIT;
}
+4 -4
View File
@@ -62,9 +62,9 @@ void Whirlwind_Action1(Entity* this) {
if (this->spriteSettings.draw != 0) {
GetNextFrame(this);
if ((((((gPlayerState.flags & PL_MINISH) == 0)) && (gPlayerState.field_0x3c == 0)) &&
((gPlayerEntity.action == 4 || ((gPlayerEntity.flags & ENT_COLLIDE) != 0)))) &&
((gPlayerEntity.action != 6 && (sub_0800419C(this, &gPlayerEntity, 0xc, 0xc) != 0)))) {
if (((gPlayerState.flags & PL_PARACHUTE) == 0) && (gPlayerEntity.action != 4)) {
((gPlayerEntity.action == PLAYER_JUMP || ((gPlayerEntity.flags & ENT_COLLIDE) != 0)))) &&
((gPlayerEntity.action != PLAYER_BOUNCE && (sub_0800419C(this, &gPlayerEntity, 0xc, 0xc) != 0)))) {
if (((gPlayerState.flags & PL_PARACHUTE) == 0) && (gPlayerEntity.action != PLAYER_JUMP)) {
if ((this->type2 != 1) && (-0x10 < gPlayerEntity.z.HALF.HI)) {
return;
}
@@ -76,7 +76,7 @@ void Whirlwind_Action1(Entity* this) {
sub_08004542(&gPlayerEntity);
gPlayerEntity.collisionLayer = 1;
gPlayerEntity.flags |= ENT_COLLIDE;
gPlayerState.queued_action = 0x1f;
gPlayerState.queued_action = PLAYER_PARACHUTE;
gPlayerState.field_0x38 = this->type2;
gPlayerState.field_0x39 = 0xff;
this->spritePriority.b0 = gPlayerEntity.spritePriority.b0 - 1;