Merge branch 'master' into transitions

This commit is contained in:
Henny022p
2022-03-23 22:43:39 +01:00
369 changed files with 5173 additions and 10141 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ void CopyOAM(void) {
void DrawEntities(void) {
void (*fn)(void);
gOAMControls._0[6] = gRoomTransition.field_0x2c[3] ? 15 : 0;
gOAMControls._0[6] = gRoomTransition.field_0x2c[2] ? 15 : 0;
gOAMControls._4 = gRoomControls.aff_x + gRoomControls.scroll_x;
gOAMControls._6 = gRoomControls.aff_y + gRoomControls.scroll_y;
gOAMControls.field_0x1++;
+60 -9
View File
@@ -1,25 +1,76 @@
#define NENT_DEPRECATED
#include "global.h"
extern u32* gUnk_020354B0;
extern u32 gRoomMemory;
#include "room.h"
extern void MemFill32(u32, void*, u32);
void sub_08049DCC(RoomMemory*);
RoomMemory* sub_08049D88(void);
void ClearRoomMemory(void) {
MemFill32(0xFFFFFFFF, &gRoomMemory, 0x40);
gUnk_020354B0 = &gRoomMemory;
MemFill32(0xFFFFFFFF, gRoomMemory, 0x40);
gUnk_020354B0 = gRoomMemory;
}
void sub_08049CF4(u8* arg0) {
u8 field_0x6c = *(arg0 + 0x6c);
void sub_08049CF4(GenericEntity* ent) {
u8 field_0x6c = ent->field_0x6c.HALF.LO;
if (field_0x6c & 0x80) {
*(gUnk_020354B0 + 1) |= 1 << (field_0x6c & 0x1f);
gUnk_020354B0->unk_04 |= 1 << (field_0x6c & 0x1f);
}
}
u32 sub_08049D1C(u32 arg0) {
u32 bitmask = *(gUnk_020354B0 + 1) >> arg0;
u32 bitmask = gUnk_020354B0->unk_04 >> arg0;
u32 output = 1;
output &= ~bitmask;
return output;
}
void UpdateRoomTracker(void) {
gUnk_020354B0 = gRoomMemory;
do {
if (gUnk_020354B0->area == gRoomControls.area && gUnk_020354B0->room == gRoomControls.room) {
sub_08049DCC(gUnk_020354B0);
return;
}
gUnk_020354B0++;
} while (gUnk_020354B0 < gRoomMemory + 8);
gUnk_020354B0 = sub_08049D88();
}
RoomMemory* sub_08049D88(void) {
RoomMemory* rm = gRoomMemory;
RoomMemory* r1 = rm + 1;
do {
if (r1->unk_02 > rm->unk_02) {
rm = r1;
}
r1++;
} while (r1 < gRoomMemory + 8);
rm->area = gRoomControls.area;
rm->room = gRoomControls.room;
rm->unk_02 = 0xFFFF;
rm->unk_04 = 0;
sub_08049DCC(rm);
return rm;
}
void sub_08049DCC(RoomMemory* rm) {
RoomMemory* r1 = gRoomMemory;
do {
if (r1->unk_02 < rm->unk_02) {
r1->unk_02++;
}
r1++;
} while (r1 < gRoomMemory + 8);
rm->unk_02 = 0;
}
+324
View File
@@ -0,0 +1,324 @@
#define NENT_DEPRECATED
#include "asm.h"
#include "global.h"
#include "entity.h"
#include "functions.h"
#include "map.h"
#include "player.h"
#include "room.h"
extern Entity* gUnk_020000B0;
extern Entity* (*const gUnk_080D3BE8[])(void);
extern void ReplaceMonitoredEntity(Entity*, Entity*);
Entity* sub_08049DF4(u32 arg0) {
if (gUnk_020000B0 != NULL) {
return gUnk_020000B0;
}
return gUnk_080D3BE8[arg0]();
}
Entity* sub_08049E18(void) {
if ((gPlayerState.field_0x3c[0] == 0) && !(gPlayerState.flags & 0x22189b75)) {
gUnk_020000B0 = &gPlayerEntity;
return &gPlayerEntity;
}
return NULL;
}
Entity* sub_08049E4C(void) {
if ((gPlayerState.field_0x3c[0] == 0) && !(gPlayerState.flags & 0x22189bf5)) {
gUnk_020000B0 = &gPlayerEntity;
return &gPlayerEntity;
}
return NULL;
}
Entity* sub_08049E80(void) {
if ((gPlayerState.field_0x3c[0] != 0) || !(gPlayerState.flags & 0x80)) {
return NULL;
}
gUnk_020000B0 = &gPlayerEntity;
return &gPlayerEntity;
}
Entity* sub_08049EB0(void) {
if ((gPlayerState.field_0x3c[0] == 0) && !(gPlayerState.flags & 0x80190)) {
gUnk_020000B0 = &gPlayerEntity;
return &gPlayerEntity;
}
return NULL;
}
u32 sub_08049EE4(Entity* ent) {
GenericEntity* genEnt = (GenericEntity*)ent;
u16 tempLO = genEnt->field_0x70.HALF.LO + 4 * genEnt->field_0x6e.HALF.LO;
u16 tempHI = genEnt->field_0x70.HALF.HI + 4 * genEnt->field_0x6e.HALF.HI;
return CalculateDirectionTo(genEnt->base.x.HALF.HI, genEnt->base.y.HALF.HI, tempLO, tempHI);
}
bool32 sub_08049F1C(Entity* entA, Entity* entB, s32 maxDist) {
if ((entA->collisionLayer & entB->collisionLayer) != 0) {
s32 xDiff = entB->x.HALF.HI - entA->x.HALF.HI;
s32 yDiff = entB->y.HALF.HI - entA->y.HALF.HI;
s32 maxDistSq = maxDist * maxDist;
s32 distSq = xDiff * xDiff + yDiff * yDiff;
if (maxDistSq >= distSq) {
return TRUE;
}
}
return FALSE;
}
bool32 PlayerInRange(Entity* ent, u32 arg1, s32 maxDist) {
Entity* tempEnt = sub_08049DF4(arg1);
if (tempEnt == NULL) {
return FALSE;
} else {
return sub_08049F1C(ent, tempEnt, maxDist);
}
}
u32 sub_08049F84(Entity* ent, s32 arg2) {
Entity* target = sub_08049DF4(arg2);
if (target == NULL) {
return 0xFF;
} else {
return GetFacingDirection(ent, target);
}
}
bool32 sub_08049FA0(Entity* ent) {
GenericEntity* genEnt = (GenericEntity*)ent;
u32 temp = 8 * genEnt->field_0x6e.HALF.LO;
if (temp >= genEnt->base.x.HALF.HI - genEnt->field_0x70.HALF_U.LO) {
temp = 8 * genEnt->field_0x6e.HALF.HI;
if (temp >= genEnt->base.y.HALF.HI - genEnt->field_0x70.HALF_U.HI) {
return TRUE;
}
}
return FALSE;
}
bool32 sub_08049FDC(Entity* ent, u32 arg1) {
u32 temp;
GenericEntity* genEnt = (GenericEntity*)ent;
GenericEntity* tempEnt = (GenericEntity*)sub_08049DF4(arg1);
if (tempEnt != NULL) {
temp = 8 * genEnt->field_0x6e.HALF.LO;
if (temp >= tempEnt->base.x.HALF.HI - genEnt->field_0x70.HALF_U.LO) {
temp = 8 * genEnt->field_0x6e.HALF.HI;
if (temp >= tempEnt->base.y.HALF.HI - genEnt->field_0x70.HALF_U.HI) {
return TRUE;
}
}
}
return FALSE;
}
u32 sub_0804A024(Entity* ent, u32 arg1, u32 arg2) {
Entity* tempEnt = sub_08049DF4(arg1);
if (tempEnt == NULL) {
return 0xFF;
} else {
return sub_0804A044(ent, tempEnt, arg2);
}
}
u32 sub_0804A168(Entity*, Entity*, LayerStruct*);
u32 sub_0804A318(Entity*, Entity*, LayerStruct*);
u32 sub_0804A044(Entity* entA, Entity* entB, u32 arg2) {
LayerStruct* layer;
s32 ret;
s32 yDiff;
s32 xDiff;
s32 flags;
if ((entB->collisionLayer & entA->collisionLayer) != 0) {
flags = 0;
xDiff = entB->x.HALF.HI + entB->hitbox->offset_x - entA->x.HALF.HI - entA->hitbox->offset_x;
if (arg2 >= xDiff + (arg2 >> 1)) {
flags |= 1;
}
if (arg2 << 1 >= xDiff + arg2) {
flags |= 2;
}
yDiff = entB->y.HALF.HI + entB->hitbox->offset_y - entA->y.HALF.HI - entA->hitbox->offset_y;
if (arg2 >= yDiff + (arg2 >> 1)) {
flags |= 4;
}
if (arg2 << 1 >= yDiff + arg2) {
flags |= 8;
}
//! @bug flags & 5 can never equal 0xA
if (flags && ((flags & 5) != 0xA)) {
layer = GetLayerByIndex(entA->collisionLayer);
if (xDiff < 0) {
xDiff = -xDiff;
}
if (yDiff < 0) {
yDiff = -yDiff;
}
if (xDiff < yDiff) {
if (flags & 1) {
ret = sub_0804A168(entA, entB, layer);
if (ret != 0xFF) {
return ret;
}
}
if (!(flags & 4)) {
return 0xFF;
}
ret = sub_0804A318(entA, entB, layer);
} else {
if (flags & 4) {
ret = sub_0804A318(entA, entB, layer);
if (ret != 0xFF) {
return ret;
}
}
if (!(flags & 1)) {
return 0xFF;
}
ret = sub_0804A168(entA, entB, layer);
}
if (ret != 0xFF) {
return ret;
}
}
}
return 0xFF;
}
bool32 sub_0804A4BC(u8* arg0, u8* arg1, s32 arg2, u32 arg3);
u32 sub_0804A168(Entity* entA, Entity* entB, LayerStruct* layer) {
u32 uVar2;
u32 uVar3;
u32 tile1;
u32 tile2;
if (entB->y.HALF.HI > entA->y.HALF.HI) {
uVar2 = entA->x.HALF.HI - 4;
uVar3 = ((uVar2 & 0xF) < 8) ? 10 : 5;
tile1 = TILE(uVar2, entA->y.HALF.HI + 10);
tile2 = TILE(uVar2, entB->y.HALF.HI);
if (sub_0804A4BC(&layer->collisionData[tile1], &layer->collisionData[tile2], 0x40, uVar3)) {
uVar2 = entA->x.HALF.HI + 4;
uVar3 ^= 0xF;
tile1 = TILE(uVar2, entA->y.HALF.HI + 10);
tile2 = TILE(uVar2, entB->y.HALF.HI);
if (sub_0804A4BC(&layer->collisionData[tile1], &layer->collisionData[tile2], 0x40, uVar3)) {
return 0x10;
}
}
} else {
uVar2 = entA->x.HALF.HI - 4;
uVar3 = ((uVar2 & 0xF) < 8) ? 10 : 5;
tile1 = TILE(uVar2, entA->y.HALF.HI - 10);
tile2 = TILE(uVar2, entB->y.HALF.HI);
if (sub_0804A4BC(&layer->collisionData[tile1], &layer->collisionData[tile2], -0x40, uVar3)) {
uVar2 = entA->x.HALF.HI + 4;
uVar3 ^= 0xF;
tile1 = TILE(uVar2, entA->y.HALF.HI - 10);
tile2 = TILE(uVar2, entB->y.HALF.HI);
if (sub_0804A4BC(&layer->collisionData[tile1], &layer->collisionData[tile2], -0x40, uVar3)) {
return 0;
}
}
}
return 0xFF;
}
u32 sub_0804A318(Entity* entA, Entity* entB, LayerStruct* layer) {
u32 uVar2;
u32 uVar3;
u32 tile1;
u32 tile2;
if (entB->x.HALF.HI > entA->x.HALF.HI) {
uVar2 = entA->y.HALF.HI - 4;
uVar3 = ((uVar2 & 0xF) < 8) ? 0xC : 3;
tile1 = TILE(entA->x.HALF.HI + 10, uVar2);
tile2 = TILE(entB->x.HALF.HI, uVar2);
if (sub_0804A4BC(&layer->collisionData[tile1], &layer->collisionData[tile2], 1, uVar3)) {
uVar2 = entA->y.HALF.HI + 4;
uVar3 ^= 0xF;
tile1 = TILE(entA->x.HALF.HI + 10, uVar2);
tile2 = TILE(entB->x.HALF.HI, uVar2);
if (sub_0804A4BC(&layer->collisionData[tile1], &layer->collisionData[tile2], 1, uVar3)) {
return 8;
}
}
} else {
uVar2 = entA->y.HALF.HI - 4;
uVar3 = ((uVar2 & 0xF) < 8) ? 0xC : 3;
tile1 = TILE(entA->x.HALF.HI - 10, uVar2);
tile2 = TILE(entB->x.HALF.HI, uVar2);
if (sub_0804A4BC(&layer->collisionData[tile1], &layer->collisionData[tile2], -1, uVar3)) {
uVar2 = entA->y.HALF.HI + 4;
uVar3 ^= 0xF;
tile1 = TILE(entA->x.HALF.HI - 10, uVar2);
tile2 = TILE(entB->x.HALF.HI, uVar2);
if (sub_0804A4BC(&layer->collisionData[tile1], &layer->collisionData[tile2], -1, uVar3)) {
return 0x18;
}
}
}
return 0xFF;
}
bool32 sub_0804A4BC(u8* arg0, u8* arg1, s32 arg2, u32 arg3) {
while (arg0 != arg1) {
u8 r0 = *arg0;
if (r0 != 0) {
if (r0 > 0xF) {
return FALSE;
}
r0 &= arg3;
if (r0 != 0) {
return FALSE;
}
}
arg0 += arg2;
}
return TRUE;
}
void sub_0804A4E4(Entity* entA, Entity* entB) {
GenericEntity* r5 = (GenericEntity*)entA;
GenericEntity* r6 = (GenericEntity*)entB;
r6->field_0x6c.HALF.HI = (r5->field_0x6c.HALF.HI & 0x40) | 4;
r6->field_0x6c.HALF.LO = r5->field_0x6c.HALF.LO;
r6->field_0x70.HALF.LO = r5->field_0x70.HALF.LO;
r6->field_0x70.HALF.HI = r5->field_0x70.HALF.HI;
r6->field_0x6e.HALF.LO = r5->field_0x6e.HALF.LO;
r6->field_0x6e.HALF.HI = r5->field_0x6e.HALF.HI;
CopyPositionAndSpriteOffset(&r5->base, &r6->base);
if (r5->field_0x6c.HALF.HI & 0x40) {
ReplaceMonitoredEntity(&r5->base, &r6->base);
}
}
+13 -13
View File
@@ -32,7 +32,7 @@ void sub_0805EC60(Entity* this) {
}
}
ASM_FUNC("asm/non_matching/sub_0805EC9C.inc", bool32 sub_0805EC9C(Entity* ent, u32 param_2, u32 param_3, u32 param_4))
ASM_FUNC("asm/non_matching/SetAffineInfo.inc", bool32 SetAffineInfo(Entity* ent, u32 param_2, u32 param_3, u32 param_4))
void sub_0805ECEC(int param_1, u32 param_2, u32 param_3, u32 param_4) {
u16* temp;
@@ -45,46 +45,46 @@ void sub_0805ECEC(int param_1, u32 param_2, u32 param_3, u32 param_4) {
temp[2] = param_4;
}
void sub_0805ED14(u32 param_1) {
void InitPlayerMacro(u32 param_1) {
gPlayerState.field_0x9c = param_1;
gPlayerState.field_0x98 = 0;
gPlayerState.field_0x9a = 0;
}
ASM_FUNC("asm/non_matching/code_0805EC04/sub_0805ED30.inc", void sub_0805ED30())
ASM_FUNC("asm/non_matching/code_0805EC04/UpdatePlayerInput.inc", void UpdatePlayerInput())
u32 sub_0805EE04(u32 param_1) {
u32 result = (s32) - (param_1 & 0x200) >> 0x1f & 0x1000;
if ((param_1 & 0x100) != 0) {
u32 ConvInputToState(u32 keys) {
u32 result = (s32) - (keys & 0x200) >> 0x1f & 0x1000;
if (keys & R_BUTTON) {
result |= 0x20;
result |= 0x8000;
result |= 0x80;
}
if ((param_1 & 1) != 0) {
if (keys & A_BUTTON) {
result |= 0x8;
result |= 0x41;
}
if ((param_1 & 2) != 0) {
if (keys & B_BUTTON) {
result |= 0x10;
result |= 0x2;
}
if ((param_1 & 0x10) != 0) {
if (keys & DPAD_RIGHT) {
result |= 0x100;
}
if ((param_1 & 0x20) != 0) {
if (keys & DPAD_LEFT) {
result |= 0x200;
}
if ((param_1 & 0x40) != 0) {
if (keys & DPAD_UP) {
result |= 0x400;
}
if ((param_1 & 0x80) != 0) {
if (keys & DPAD_DOWN) {
result |= 0x800;
}
return result;
}
void sub_0805EE88(void) {
if ((gRoomTransition.field_0x2c[3] != 0) && ((gRoomTransition.frameCount & 3) == 0)) {
if ((gRoomTransition.field_0x2c[2] != 0) && ((gRoomTransition.frameCount & 3) == 0)) {
LoadPaletteGroup((((u32)gRoomTransition.frameCount & 0xc) >> 2) + 0x2f);
}
}
+1 -1
View File
@@ -370,7 +370,7 @@ s32 sub_08017B1C(Entity* org, Entity* tgt, u32 direction, ColSettings* settings)
s32 sub_08017B58(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
if ((tgt->field_0x3a & 4) != 0) {
if (tgt->field_0x1d) {
s32 x = tgt->field_0x1d = tgt->field_0x1d - gPlayerState.field_0x1d;
s32 x = tgt->field_0x1d = tgt->field_0x1d - gPlayerState.gustJarSpeed;
if (x << 24 <= 0) {
tgt->field_0x1d = 0;
tgt->subAction = 2;
+1 -1
View File
@@ -47,7 +47,7 @@ void sub_0801D000(u32 a1) {
tmp = 0;
}
roomTransition->field_0x2c[3] = tmp;
roomTransition->field_0x2c[2] = tmp;
if (a1) {
CleanUpObjPalettes();
sub_0801CFD0(0xf);
+26 -24
View File
@@ -1,6 +1,8 @@
#define NENT_DEPRECATED
#include "asm.h"
#include "area.h"
#include "player.h"
#include "new_player.h"
#include "coord.h"
#include "common.h"
#include "sound.h"
@@ -20,7 +22,6 @@ extern const u16 gUnk_080047F6[];
u32 sub_0806F58C(Entity*, Entity*);
u32 sub_0806FCA0(Entity*, Entity*);
void UnloadHitbox(Entity*);
extern u32 sub_08007DD6(u32, const u16*);
u32 PointInsideRadius(s32 x, s32 y, s32 radius);
extern void sub_0806FEE8(struct_gUnk_020000C0_1*, u32, u32, u32);
@@ -39,7 +40,7 @@ void sub_0806F38C(void) {
u32 sub_0806F39C(Entity* ent) {
s32 dist;
if (gPlayerEntity.animationState & 2) {
if (gNewPlayerEntity.base.animationState & 2) {
dist = ent->x.HALF.HI - gPlayerEntity.x.HALF.HI;
} else {
dist = ent->y.HALF.HI - gPlayerEntity.y.HALF.HI;
@@ -56,12 +57,12 @@ u32 sub_0806F39C(Entity* ent) {
}
bool32 sub_0806F3E4(Entity* ent) {
Entity tmp_ent;
GenericEntity tmp_ent;
s8* p;
if ((gPlayerState.field_0x1c & 0x7F) != 1)
return 0;
switch (gPlayerState.field_0x1d) {
switch (gPlayerState.gustJarSpeed) {
case 1:
ent->knockbackSpeed += 64;
break;
@@ -75,15 +76,15 @@ bool32 sub_0806F3E4(Entity* ent) {
if (ent->knockbackSpeed > 0x500)
ent->knockbackSpeed = 0x500;
p = &gUnk_08126EE4[gPlayerEntity.animationState & 0xE];
tmp_ent.x.HALF.HI = p[0] + gPlayerEntity.x.HALF.HI;
tmp_ent.y.HALF.HI = p[1] + gPlayerEntity.y.HALF.HI;
LinearMoveDirection(ent, ent->knockbackSpeed, GetFacingDirection(ent, &tmp_ent));
if (sub_0800419C(&tmp_ent, ent, 4, 4)) {
tmp_ent.base.x.HALF.HI = p[0] + gPlayerEntity.x.HALF.HI;
tmp_ent.base.y.HALF.HI = p[1] + gPlayerEntity.y.HALF.HI;
LinearMoveDirection(ent, ent->knockbackSpeed, GetFacingDirection(ent, &tmp_ent.base));
if (sub_0800419C(&tmp_ent.base, ent, 4, 4)) {
u32 state = ent->field_0x1c & 0xF;
if (state == 2) {
Entity* item;
ent->subAction = 3;
(Entity*)gPlayerEntity.field_0x70.WORD = ent;
gNewPlayerEntity.unk_70 = ent;
gPlayerState.field_0x1c = 7;
item = CreatePlayerItem(0x11, 0, 0, 0);
if (item != NULL) {
@@ -117,7 +118,7 @@ void sub_0806F4E8(Entity* ent) {
}
}
u32 sub_0806F520(Entity* ent) {
bool32 sub_0806F520(Entity* ent) {
if (ent->bitfield == 0x93)
return 1;
ent->field_0x3a &= ~4;
@@ -329,46 +330,46 @@ void sub_0806FA90(Entity* source, Entity* target, s32 offsetX, s32 offsetY) {
PositionRelative(source, target, Q_16_16(offsetX), Q_16_16(offsetY));
}
void SortEntityAbove(Entity* param_1, Entity* param_2) {
param_2->spritePriority.b0 = gSpriteSortAboveTable[param_1->spritePriority.b0];
void SortEntityAbove(Entity* below_ent, Entity* above_ent) {
above_ent->spritePriority.b0 = gSpriteSortAboveTable[below_ent->spritePriority.b0];
}
void SortEntityBelow(Entity* param_1, Entity* param_2) {
param_2->spritePriority.b0 = gSpriteSortBelowTable[param_1->spritePriority.b0];
void SortEntityBelow(Entity* above_ent, Entity* below_ent) {
below_ent->spritePriority.b0 = gSpriteSortBelowTable[above_ent->spritePriority.b0];
}
void sub_0806FB00(Entity* ent, u32 param_1, u32 param_2, u32 param_3) {
void sub_0806FB00(GenericEntity* ent, u32 param_1, u32 param_2, u32 param_3) {
if (param_3 == 0) {
param_3 = 1;
}
ent->field_0x7c.BYTES.byte2 = 0;
ent->field_0x7c.BYTES.byte3 = param_3;
ent->field_0x80.HWORD = ent->x.HALF.HI;
ent->field_0x82.HWORD = ent->y.HALF.HI;
ent->field_0x80.HWORD = ent->base.x.HALF.HI;
ent->field_0x82.HWORD = ent->base.y.HALF.HI;
ent->cutsceneBeh.HWORD = param_1;
ent->field_0x86.HWORD = param_2;
}
bool32 sub_0806FB38(Entity* ent) {
bool32 sub_0806FB38(GenericEntity* ent) {
s32 val;
u32 rv;
if (ent->field_0x7c.BYTES.byte2 < ent->field_0x7c.BYTES.byte3) {
ent->field_0x7c.BYTES.byte2++;
ent->x.HALF.HI =
ent->base.x.HALF.HI =
((((((s16)ent->cutsceneBeh.HWORD - (s16)ent->field_0x80.HWORD) * ent->field_0x7c.BYTES.byte2) << 8) /
ent->field_0x7c.BYTES.byte3) >>
8) +
ent->field_0x80.HWORD;
ent->y.HALF.HI =
ent->base.y.HALF.HI =
(((((((s16)ent->field_0x86.HWORD - (s16)ent->field_0x82.HWORD) * ent->field_0x7c.BYTES.byte2) << 8) /
ent->field_0x7c.BYTES.byte3) >>
8)) +
ent->field_0x82.HWORD;
rv = 0;
} else {
ent->x.HALF.HI = ent->cutsceneBeh.HWORD;
ent->y.HALF.HI = ent->field_0x86.HWORD;
ent->base.x.HALF.HI = ent->cutsceneBeh.HWORD;
ent->base.y.HALF.HI = ent->field_0x86.HWORD;
rv = 1;
}
return rv;
@@ -380,9 +381,10 @@ void sub_0806FBB4(Entity* ent) {
}
}
void AllocMutableHitbox(Entity* ent) {
void* AllocMutableHitbox(Entity* ent) {
UnloadHitbox(ent);
ent->hitbox = zMalloc(sizeof(Hitbox3D));
return ent->hitbox;
}
void UnloadHitbox(Entity* ent) {
@@ -538,7 +540,7 @@ u32 LoadExtraSpriteData(Entity* ent, const SpriteLoadData* data) {
return 1;
}
void sub_0806FE84(Entity* ent) {
void UnloadOBJPalette2(Entity* ent) {
u32 index;
u32 spriteAnimation = ent->spriteAnimation[2];
ent->spriteAnimation[2] = 0;
+1 -1
View File
@@ -216,7 +216,7 @@ void sub_080A3198(u32 param_1, u32 param_2) {
MemClear(gUnk_08127C98 - 0x1e, 0x180);
if (r4 != 0) {
sub_0805F46C(r4, &gUnk_08127C98);
sub_0805F46C(r4, (Font*)&gUnk_08127C98); // TODO
}
gScreen.bg0.updated = 1;
+7 -7
View File
@@ -155,7 +155,7 @@ void sub_08031B48(Entity* this) {
this->frame = 0;
COLLISION_ON(this);
} else {
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 0x3;
this->actionDelay = gUnk_080CE5B0[Random() & 7];
InitializeAnimation(this, 1);
@@ -188,7 +188,7 @@ void sub_08031B98(Entity* this) {
void sub_08031C1C(Entity* this) {
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = '\x01';
this->actionDelay = gUnk_080CE5B8[Random() & 7];
this->spriteSettings.draw = 0;
@@ -199,7 +199,7 @@ void sub_08031C58(Entity* this) {
Entity *a, *b;
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
if (gEntCount < 0x43) {
u32 tmp = Random();
tmp &= 3;
@@ -274,7 +274,7 @@ void sub_08031DA0(Entity* this) {
}
void sub_08031DC4(Entity* this) {
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 1;
this->actionDelay = 0xb4;
this->spriteSettings.draw = 0;
@@ -360,7 +360,7 @@ void sub_08031F54(Entity* this) {
void sub_08031FB0(Entity* this) {
GetNextFrame(this);
if ((this->frame & 0x80) && (this->parent || --this->actionDelay == 0)) {
if ((this->frame & ANIM_DONE) && (this->parent || --this->actionDelay == 0)) {
this->action = 4;
this->direction = sub_08049F84(this, 1);
*(u8*)&this->field_0x76 = 0;
@@ -469,7 +469,7 @@ void sub_08032204(Entity* this) {
this->frame = 0;
this->frameDuration = (Random() & 0x30) + 30;
} else {
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 9;
InitializeAnimation(this, 13);
}
@@ -478,7 +478,7 @@ void sub_08032204(Entity* this) {
void sub_08032248(Entity* this) {
if (GravityUpdate(this, Q_8_8(24.0)) == 0) {
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
((Entity*)this->field_0x7c.WORD)->actionDelay--;
DeleteEntity(this);
+8 -8
View File
@@ -113,7 +113,7 @@ void sub_080301D4(ArmosEntity* this) {
void sub_08030240(ArmosEntity* this) {
if (super->animIndex == 6) {
if ((super->frame & 0x80) == 0) {
if ((super->frame & ANIM_DONE) == 0) {
GetNextFrame(super);
}
}
@@ -188,8 +188,8 @@ void sub_08030338(ArmosEntity* this) {
EnqueueSFX(SFX_12A);
return;
}
bVar2 = super->frame & 0x80;
if ((super->frame & 0x80) != 0) {
bVar2 = super->frame & ANIM_DONE;
if ((super->frame & ANIM_DONE) != 0) {
if (this->unk_80 != 2) {
super->action = 3;
super->animationState = 0xff;
@@ -244,7 +244,7 @@ NONMATCH("asm/non_matching/armos/sub_080304BC.inc", void sub_080304BC(ArmosEntit
u32 tmp;
sub_080309A8(this);
tmp = super->frame & 0x80;
tmp = super->frame & ANIM_DONE;
if (tmp != 0) {
sub_08030580(this);
} else {
@@ -267,7 +267,7 @@ void sub_080304F4(ArmosEntity* this) {
}
void sub_08030524(ArmosEntity* this) {
if ((super->frame & 0x80) == 0) {
if ((super->frame & ANIM_DONE) == 0) {
sub_080309A8(this);
} else if (super->frame == 1) {
super->frame = 0;
@@ -277,7 +277,7 @@ void sub_08030524(ArmosEntity* this) {
void sub_08030554(ArmosEntity* this) {
sub_080309A8(this);
if ((super->frame & 0x80) != 0) {
if ((super->frame & ANIM_DONE) != 0) {
super->action = 3;
sub_080309C8(this, (u32)super->animationState);
sub_080306C4(this);
@@ -306,12 +306,12 @@ bool32 sub_08030650(ArmosEntity* this) {
return 1;
}
} else if (this->unk_80 != 2) {
if ((sub_08049FDC(super, 1) == 0) || (0x20 < (gUnk_020000B0->x.HALF.HI - super->x.HALF.HI) + 0x10U)) {
if (!sub_08049FDC(super, 1) || (0x20 < (gUnk_020000B0->x.HALF.HI - super->x.HALF.HI) + 0x10U)) {
return FALSE;
}
return TRUE;
} else {
if (sub_08049FDC(super, 1) == 0) {
if (!sub_08049FDC(super, 1)) {
return FALSE;
}
if (gUnk_020000B0->x.HALF.HI >= (s32)(gRoomControls.origin_x + 0xa8)) {
+1 -1
View File
@@ -150,7 +150,7 @@ void sub_0803E71C(BallChainSoldierEntity* this) {
}
void sub_0803E75C(BallChainSoldierEntity* this) {
if ((super->frame & 0x80) == 0) {
if ((super->frame & ANIM_DONE) == 0) {
UpdateAnimationSingleFrame(super);
} else {
if (--super->actionDelay == 0) {
+4 -4
View File
@@ -117,7 +117,7 @@ void sub_080218CC(Entity* this) {
this->frameDuration = 1;
}
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 2;
this->actionDelay = (Random() & 0x38) + 8;
this->field_0xf = 1;
@@ -209,7 +209,7 @@ void sub_08021AD8(Entity* this) {
this->frameDuration = 1;
}
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 2;
this->actionDelay = 20;
((u8*)&this->field_0x86)[0] = 60;
@@ -268,7 +268,7 @@ void sub_08021C58(Entity* this) {
this->frameDuration = 1;
}
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 2;
this->actionDelay = 60;
this->field_0xf = 1;
@@ -280,7 +280,7 @@ void sub_08021C58(Entity* this) {
}
void sub_08021CD0(Entity* this) {
if ((this->frame & 0x80) == 0)
if ((this->frame & ANIM_DONE) == 0)
GetNextFrame(this);
if (sub_08049F84(this, 1) == 0xff)
+2 -2
View File
@@ -245,7 +245,7 @@ void sub_0802CAF8(Entity* this) {
EnqueueSFX(SFX_104);
}
sub_0802CC18(this);
sub_08078930(this);
RegisterCarryEntity(this);
if (this->field_0xf && this->z.HALF.HI == 0) {
this->field_0xf = 0;
COLLISION_ON(this);
@@ -286,7 +286,7 @@ void sub_0802CBC4(Entity* this) {
if (this->field_0x82.HALF.HI) {
sub_08079184();
}
sub_08078954(this);
FreeCarryEntity(this);
ent = CreateObjectWithParent(this, OBJECT_20, 0, 0);
if (ent) {
+5 -5
View File
@@ -289,7 +289,7 @@ void sub_0802AB40(Entity* this) {
#endif
void sub_0802AC08(Entity* this) {
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 2;
this->subAction = 0;
this->actionDelay = 0x40;
@@ -470,7 +470,7 @@ void sub_0802AED4(Entity* this) {
}
} else {
if (!sub_0800442E(this)) {
sub_08078930(this);
RegisterCarryEntity(this);
}
}
if (this->type2 != 0 && this->field_0x80.HALF.HI) {
@@ -535,7 +535,7 @@ NONMATCH("asm/non_matching/bombPeahat/sub_0802AFC8.inc", void sub_0802AFC8(Entit
this->field_0x82.HWORD ^= 0x8000;
}
tmp = 0x130 - (this->field_0x82.HWORD & 0xf0);
sub_0805EC9C(this, tmp, tmp, 0);
SetAffineInfo(this, tmp, tmp, 0);
}
if (this->field_0xf & flag) {
this->palette.b.b0 = this->palette.b.b4;
@@ -572,7 +572,7 @@ void sub_0802B048(Entity* this) {
this->field_0xf = 0x50;
this->field_0x82.HWORD = 0;
this->spriteRendering.b0 = 3;
sub_0805EC9C(this, 0x100, 0x100, 0);
SetAffineInfo(this, 0x100, 0x100, 0);
}
} else {
if (this->field_0xf) {
@@ -587,7 +587,7 @@ void sub_0802B048(Entity* this) {
this->spriteSettings.draw = 0;
COLLISION_ON(this);
this->field_0x7a.HALF.HI = 0;
sub_08078954(this);
FreeCarryEntity(this);
if (this->parent->next) {
this->parent->field_0x80.HALF.HI = 0;
}
+5 -5
View File
@@ -112,7 +112,7 @@ void sub_08028A74(Entity* this) {
switch (this->subAction) {
case 0:
unk = 1;
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->subAction = 1;
this->actionDelay = 0x3c;
this->field_0xf = 0x10;
@@ -150,7 +150,7 @@ void sub_08028A74(Entity* this) {
break;
case 3:
unk = 2;
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->subAction = 4;
this->actionDelay = 0x50;
sub_080290E0(this, 1);
@@ -189,7 +189,7 @@ void sub_08028BC4(Entity* this) {
switch (this->subAction) {
case 0:
if (this->actionDelay == 0) {
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->subAction = 1;
sub_08028FDC(this);
sub_080290E0(this, 5);
@@ -200,7 +200,7 @@ void sub_08028BC4(Entity* this) {
}
break;
case 1:
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 4;
this->subAction = 0;
this->actionDelay = 0x1e;
@@ -384,7 +384,7 @@ void sub_08028F0C(Entity* this) {
SetPlayerControl(1);
}
MessageFromTarget(dialog);
gMessage.field_0x10 = offer->price;
gMessage.rupees = offer->price;
}
}
+5 -5
View File
@@ -100,7 +100,7 @@ void sub_08045CE0(BusinessScrubPrologueEntity* this) {
switch (super->subAction) {
case 0:
r6 = 1;
if (super->frame & 0x80) {
if (super->frame & ANIM_DONE) {
super->subAction = 1;
super->actionDelay = 0x3c;
super->field_0xf = 0x10;
@@ -133,7 +133,7 @@ void sub_08045CE0(BusinessScrubPrologueEntity* this) {
break;
case 3:
r6 = 2;
if (super->frame & 0x80) {
if (super->frame & ANIM_DONE) {
super->subAction = 4;
super->actionDelay = 0x50;
sub_08046030(this, 1);
@@ -170,7 +170,7 @@ void sub_08045E14(BusinessScrubPrologueEntity* this) {
switch (super->subAction) {
case 0:
if (super->actionDelay == 0) {
if (super->frame & 0x80) {
if (super->frame & ANIM_DONE) {
super->subAction = 1;
sub_08045F98(this);
sub_08046030(this, 5);
@@ -181,7 +181,7 @@ void sub_08045E14(BusinessScrubPrologueEntity* this) {
}
break;
case 1:
if (super->frame & 0x80) {
if (super->frame & ANIM_DONE) {
super->action = 5;
super->subAction = 0;
sub_08046030(this, 0);
@@ -222,7 +222,7 @@ void sub_08045EDC(BusinessScrubPrologueEntity* this) {
super->frame &= 0xfe;
sub_080954AC(super, this->unk_84);
EnqueueSFX(SFX_18D);
} else if (super->frame & 0x80) {
} else if (super->frame & ANIM_DONE) {
super->action = 5;
super->subAction = 0;
sub_08046030(this, 1);
+1 -1
View File
@@ -64,7 +64,7 @@ void sub_0802B56C(Entity* this) {
void sub_0802B5C8(Entity* this) {
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 1;
this->actionDelay = 30;
InitializeAnimation(this, 0);
+18 -18
View File
@@ -123,7 +123,7 @@ void Chuchu_OnCollision(Entity* this) {
}
void Chuchu_OnGrabbed(Entity* this) {
if (sub_0806F520(this) == 0 && this->confusedTime) {
if (!sub_0806F520(this) && this->confusedTime) {
Create0x68FX(this, FX_STARS);
InitializeAnimation(this, 6);
} else {
@@ -155,7 +155,7 @@ void Chuchu_OnDeath(Entity* this) {
}
void Chuchu_OnConfused(Entity* this) {
if ((this->frame & 0x80) == 0)
if ((this->frame & ANIM_DONE) == 0)
GetNextFrame(this);
GenericConfused(this);
}
@@ -173,7 +173,7 @@ void nullsub_4(Entity* this) {
void sub_0801F0C8(Entity* this) {
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 3;
this->actionDelay = (Random() & 3) + 0xc;
this->field_0xf = Random();
@@ -221,7 +221,7 @@ void sub_0801F1B0(Entity* this) {
GetNextFrame(this);
}
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
if (sub_0801FBD0(this)) {
sub_0801F328(this);
} else {
@@ -240,7 +240,7 @@ void sub_0801F228(Entity* this) {
void sub_0801F250(Entity* this) {
GetNextFrame(this);
if (this->frame & 0x80)
if (this->frame & ANIM_DONE)
sub_0801F360(this);
}
@@ -267,7 +267,7 @@ void sub_0801F270(Entity* this) {
void sub_0801F2CC(Entity* this) {
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 1;
this->spriteSettings.draw = 0;
InitializeAnimation(this, 4);
@@ -277,7 +277,7 @@ void sub_0801F2CC(Entity* this) {
void sub_0801F2F8(Entity* this) {
GravityUpdate(this, 0x1800);
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
sub_0801F340(this);
sub_0804AA1C(this);
}
@@ -362,7 +362,7 @@ void sub_0801F48C(Entity* this) {
void sub_0801F494(Entity* this) {
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 3;
this->field_0xf = 30;
this->direction = sub_08049F84(this, 1);
@@ -418,7 +418,7 @@ void sub_0801F584(Entity* this) {
GetNextFrame(this);
}
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
if (sub_0801FBD0(this)) {
this->field_0x82.HALF.HI = 0;
sub_0801F730(this);
@@ -440,7 +440,7 @@ void sub_0801F61C(Entity* this) {
void sub_0801F638(Entity* this) {
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 8;
this->field_0xf = 30;
this->direction = sub_08049F84(this, 1);
@@ -465,7 +465,7 @@ void sub_0801F688(Entity* this) {
void sub_0801F6CC(Entity* this) {
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 1;
this->spriteSettings.draw = 0;
InitializeAnimation(this, 4);
@@ -475,7 +475,7 @@ void sub_0801F6CC(Entity* this) {
void sub_0801F6F8(Entity* this) {
GravityUpdate(this, 0x1800);
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 4;
this->speed = 0x20;
sub_0804AA1C(this);
@@ -538,7 +538,7 @@ void sub_0801F7FC(Entity* this) {
void sub_0801F840(Entity* this) {
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
sub_0801FB14(this);
COLLISION_ON(this);
this->spritePriority.b0 = 4;
@@ -594,7 +594,7 @@ void sub_0801F940(Entity* this) {
GetNextFrame(this);
}
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
if (sub_0801FBD0(this)) {
sub_0801FAE0(this);
} else {
@@ -614,7 +614,7 @@ void sub_0801F9C4(Entity* this) {
void sub_0801F9E0(Entity* this) {
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 8;
this->field_0xf = 30;
this->direction = sub_08049F84(this, 1);
@@ -639,7 +639,7 @@ void sub_0801FA30(Entity* this) {
void sub_0801FA78(Entity* this) {
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 1;
this->spriteSettings.draw = 0;
InitializeAnimation(this, 4);
@@ -650,7 +650,7 @@ void sub_0801FA78(Entity* this) {
void sub_0801FAAC(Entity* this) {
GravityUpdate(this, 0x1800);
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
sub_0801FB14(this);
this->speed = 0x20;
sub_0804AA1C(this);
@@ -705,7 +705,7 @@ void sub_0801FB68(Entity* this) {
}
u32 sub_0801FBD0(Entity* this) {
if (sub_080B1AA8(this) == 0x10) {
if (GetTileUnderEntity(this) == 0x10) {
return 1;
} else {
return 0;
+2 -2
View File
@@ -164,7 +164,7 @@ void sub_08038F20(CuccoAggrEntity* this) {
sub_08039298(this);
GetNextFrame(super);
if (super->frame & 0x80) {
if (super->frame & ANIM_DONE) {
sub_0803901C(this);
}
}
@@ -328,7 +328,7 @@ void CuccoAggr_CreateFx(CuccoAggrEntity* this) {
void sub_08039298(CuccoAggrEntity* this) {
if (super->type2 == 0) {
sub_08078930(super);
RegisterCarryEntity(super);
}
}
+2 -2
View File
@@ -49,7 +49,7 @@ void sub_08048268(Entity* this) {
}
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->actionDelay = 0;
InitializeAnimation(this, 0);
}
@@ -58,7 +58,7 @@ void sub_08048268(Entity* this) {
void sub_08048294(Entity* this) {
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 3;
SetLocalFlag(0x72);
InitializeAnimation(this, 1);
+13 -15
View File
@@ -141,7 +141,7 @@ void sub_08020D9C(Entity* this) {
void sub_08020DB4(Entity* this) {
UpdateAnimationSingleFrame(this);
if (this->frame & 0x80)
if (this->frame & ANIM_DONE)
sub_08021390(this);
}
@@ -161,7 +161,7 @@ void sub_08020DD4(Entity* this) {
void sub_08020E28(Entity* this) {
UpdateAnimationSingleFrame(this);
if (this->frame & 0x80)
if (this->frame & ANIM_DONE)
sub_080213B0(this);
}
@@ -170,14 +170,14 @@ void sub_08020E48(Entity* this) {
sub_080213F0(this);
} else {
UpdateAnimationSingleFrame(this);
if (this->frame & 0x80)
if (this->frame & ANIM_DONE)
sub_080213B0(this);
}
}
void sub_08020E78(Entity* this) {
UpdateAnimationSingleFrame(this);
if (this->frame & 0x80)
if (this->frame & ANIM_DONE)
sub_08021390(this);
}
@@ -211,7 +211,7 @@ void sub_08020E98(Entity* this) {
void sub_08020F28(Entity* this) {
UpdateAnimationSingleFrame(this);
if (this->frame & 0x80)
if (this->frame & ANIM_DONE)
sub_08021400(this);
}
@@ -241,7 +241,7 @@ void sub_08020F48(Entity* this) {
}
void sub_08020FAC(Entity* this) {
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
if (this->field_0x7a.HALF.LO) {
this->field_0x7a.HALF.LO--;
} else {
@@ -264,7 +264,7 @@ void sub_08020FE4(Entity* this) {
void sub_08021010(Entity* this) {
UpdateAnimationSingleFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->hitType = 0x56;
sub_080213F0(this);
}
@@ -280,7 +280,7 @@ void sub_08021038(Entity* this) {
EnqueueSFX(SFX_10E);
}
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
sub_08021588(this);
if (this->field_0x7c.BYTES.byte0) {
this->field_0x7c.BYTES.byte0--;
@@ -300,7 +300,7 @@ void sub_080210A8(Entity* this) {
this->frame = 0;
sub_08021588(this);
EnqueueSFX(SFX_15D);
} else if (this->frame & 0x80) {
} else if (this->frame & ANIM_DONE) {
sub_08021390(this);
}
}
@@ -330,7 +330,7 @@ void sub_080210E4(Entity* this) {
}
void sub_08021170(Entity* this) {
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
if (this->field_0x7a.HALF.HI) {
this->field_0x7a.HALF.HI--;
} else {
@@ -346,7 +346,7 @@ void sub_080211A0(Entity* this) {
sub_08021390(this);
} else {
UpdateAnimationSingleFrame(this);
if (this->frame & 0x80)
if (this->frame & ANIM_DONE)
sub_080213B0(this);
}
}
@@ -357,7 +357,7 @@ void sub_080211D0(Entity* this)
UpdateAnimationSingleFrame(this);
sub_0802159C(this);
if (this->frame & 0x80)
if (this->frame & ANIM_DONE)
sub_08021390(this);
}
@@ -365,7 +365,7 @@ void sub_080211F4(Entity* this) {
UpdateAnimationSingleFrame(this);
sub_08021600(this);
if (this->frame & 0x80)
if (this->frame & ANIM_DONE)
sub_08021390(this);
}
@@ -610,8 +610,6 @@ void sub_08021644(Entity* this) {
}
}
extern u32 sub_08049F1C(Entity*, Entity*, u32);
u32 sub_08021664(Entity* this, Entity* ent) {
switch (this->animationState) {
case 0:
+2 -2
View File
@@ -75,7 +75,7 @@ void sub_080220D8(Entity* this) {
void sub_080220F0(Entity* this) {
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
const PosOffset* off;
u32 i;
@@ -107,7 +107,7 @@ void sub_08022174(Entity* this) {
void sub_08022198(Entity* this) {
sub_0800445C(this);
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 1;
this->actionDelay = 0x5a;
}
+1 -1
View File
@@ -207,7 +207,7 @@ void Enemy4D_Action6(Enemy4DEntity* this) {
}
void Enemy4D_Action7(Enemy4DEntity* this) {
if ((super->frame & 0x80) == 0) {
if ((super->frame & ANIM_DONE) == 0) {
UpdateAnimationSingleFrame(super);
} else {
if (--super->actionDelay == 0) {
+3 -3
View File
@@ -154,7 +154,7 @@ void sub_08040D30(Enemy50Entity* this) {
}
void sub_08040D90(Enemy50Entity* this) {
if (sub_0806F520()) {
if (sub_0806F520(super)) {
Enemy50_SubActions[super->subAction](this);
} else {
sub_08041128(this);
@@ -223,7 +223,7 @@ void Enemy50_Action2(Enemy50Entity* this) {
void Enemy50_Action3(Enemy50Entity* this) {
GetNextFrame(super);
if ((super->frame & 0x80) != 0) {
if ((super->frame & ANIM_DONE) != 0) {
super->flags |= 0x80;
this->unk_7c = this->unk_80 * ((Random() & 0x30) + 0x3c) + 0x78;
sub_08041128(this);
@@ -292,7 +292,7 @@ void Enemy50_Action7(Enemy50Entity* this) {
void Enemy50_Action8(Enemy50Entity* this) {
sub_0803F738(this);
GetNextFrame(super);
if ((super->frame & 0x80) != 0) {
if ((super->frame & ANIM_DONE) != 0) {
super->action = 9;
this->unk_78 = 0;
InitializeAnimation(super, 4);
+1 -1
View File
@@ -54,7 +54,7 @@ void Enemy64(Enemy64Entity* this) {
super->subAction = 0;
}
Enemy64_Actions[super->action](this);
sub_0805EC9C(super, 0xaa, 0xaa, this->unk_78);
SetAffineInfo(super, 0xaa, 0xaa, this->unk_78);
super->animationState = -(this->unk_78 >> 8);
sub_080499F0(this);
this->unk_7d = super->spriteSettings.draw;
+1 -1
View File
@@ -54,7 +54,7 @@ void sub_08023000(Entity* this, int frames) {
tmp *= -1;
this->spriteRendering.b0 = 3;
sub_0805EC9C(this, tmp, 0x80, 0);
SetAffineInfo(this, tmp, 0x80, 0);
}
// clang-format off
+6 -6
View File
@@ -196,7 +196,7 @@ void Eyegore_Action3(EyegoreEntity* this) {
super->spriteOffsetX = gUnk_080CE2BC[--super->actionDelay & 3];
} else {
GetNextFrame(super);
if ((super->frame & 0x80) != 0) {
if ((super->frame & ANIM_DONE) != 0) {
super->flags |= ENT_COLLIDE;
super->animationState = 2;
sub_08030E58(this);
@@ -214,7 +214,7 @@ void Eyegore_Action4(EyegoreEntity* this) {
sub_08030E3C(this);
break;
case 2:
if ((super->frame & 0x80) != 0) {
if ((super->frame & ANIM_DONE) != 0) {
super->animationState = this->unk_7f;
InitializeAnimation(super, super->animationState + 4);
}
@@ -227,7 +227,7 @@ void Eyegore_Action4(EyegoreEntity* this) {
break;
default:
if ((super->frame & 0x80) != 0) {
if ((super->frame & ANIM_DONE) != 0) {
InitializeAnimation(super, super->animationState);
if ((this->unk_79 & 0x80) != 0) {
super->action = 5;
@@ -252,7 +252,7 @@ void Eyegore_Action5(EyegoreEntity* this) {
sub_08030E3C(this);
break;
case 2:
if ((super->frame & 0x80) != 0) {
if ((super->frame & ANIM_DONE) != 0) {
super->animationState = this->unk_7f;
InitializeAnimation(super, super->animationState + 4);
}
@@ -261,7 +261,7 @@ void Eyegore_Action5(EyegoreEntity* this) {
}
break;
default:
if ((super->frame & 0x80) != 0) {
if ((super->frame & ANIM_DONE) != 0) {
InitializeAnimation(super, super->animationState);
if (sub_08049FDC(super, 1)) {
sub_08030E58(this);
@@ -280,7 +280,7 @@ void Eyegore_Action5(EyegoreEntity* this) {
void Eyegore_Action6(EyegoreEntity* this) {
GetNextFrame(super);
if ((super->frame & 0x80) != 0) {
if ((super->frame & ANIM_DONE) != 0) {
super->action = 2;
}
}
+264
View File
@@ -0,0 +1,264 @@
/**
* @file flyingPot.c
* @ingroup Enemies
*
* @brief Flying pot enemy
*/
#define NENT_DEPRECATED
#include "functions.h"
#include "enemy.h"
#include "player.h"
#include "room.h"
extern void (*const gUnk_080012C8[])(Entity*);
extern Hitbox gUnk_080FD34C;
typedef struct {
/* 0x00 */ Entity base;
/* 0x68 */ u8 filler[0xC];
/* 0x74 */ u16 tileIndex;
} FlyingPotEntity;
enum FlyingPotActions {
/* 0 */ FLYING_POT_ACTION_0,
/* 1 */ FLYING_POT_ACTION_1,
/* 2 */ FLYING_POT_ACTION_2,
/* 3 */ FLYING_POT_ACTION_3,
/* 4 */ FLYING_POT_ACTION_4,
/* 5 */ FLYING_POT_ACTION_5,
/* 6 */ FLYING_POT_ACTION_6,
};
enum FlyingPotSubActions {
/* 0 */ FLYING_POT_SUBACTION_0,
/* 1 */ FLYING_POT_SUBACTION_1,
/* 2 */ FLYING_POT_SUBACTION_2,
/* 3 */ FLYING_POT_SUBACTION_3,
/* 4 */ FLYING_POT_SUBACTION_DO_NOTHING,
/* 5 */ FLYING_POT_SUBACTION_5,
};
// Functions
void FlyingPot_OnTick(FlyingPotEntity*); // 0803708C
void FlyingPot_OnCollision(FlyingPotEntity*); // 080370A4
void FlyingPot_OnGrabbed(FlyingPotEntity*); // 0803712C
// Subactions
void FlyingPot_SubAction0(FlyingPotEntity*); // 08037144
void FlyingPot_SubAction1(FlyingPotEntity*); // 0803715C
void FlyingPot_SubAction2(FlyingPotEntity*); // 0803718C
void FlyingPot_SubAction3(FlyingPotEntity*); // 080371F8
void FlyingPot_SubActionDoNothing(FlyingPotEntity*);
void FlyingPot_SubAction5(FlyingPotEntity*); // 08037218
// Actions
void FlyingPot_Init(FlyingPotEntity*); // ? // 08037220
void FlyingPot_Action1(FlyingPotEntity*); // 08037280
void FlyingPot_Action2(FlyingPotEntity*); // 080372E8
void FlyingPot_Action3(FlyingPotEntity*); // 0803737C
void FlyingPot_Action4(FlyingPotEntity*); // 080373B0
void FlyingPot_Action5(FlyingPotEntity*); // 080373C8
void FlyingPot_Action6(FlyingPotEntity*); // 080373E0
void sub_08037408(FlyingPotEntity*);
void sub_08037418(FlyingPotEntity*);
void (*const FlyingPot_Functions[])(Entity*) = {
(EntityActionPtr)FlyingPot_OnTick,
(EntityActionPtr)FlyingPot_OnCollision,
GenericKnockback,
GenericDeath,
GenericConfused,
(EntityActionPtr)FlyingPot_OnGrabbed,
};
void FlyingPot(Entity* thisx) {
s32 index = sub_080012DC(thisx);
if (index != 0) {
gUnk_080012C8[index](thisx);
} else {
FlyingPot_Functions[GetNextFunction(thisx)](thisx);
}
}
void FlyingPot_OnTick(FlyingPotEntity* this) {
static void (*const FlyingPot_Actions[])(FlyingPotEntity*) = {
FlyingPot_Init, FlyingPot_Action1, FlyingPot_Action2, FlyingPot_Action3,
FlyingPot_Action4, FlyingPot_Action5, FlyingPot_Action6,
};
FlyingPot_Actions[super->action](this);
}
void FlyingPot_OnCollision(FlyingPotEntity* this) {
sub_08037418(this);
if (super->bitfield == 0x9D) {
super->action = FLYING_POT_ACTION_6;
COLLISION_OFF(super);
super->zVelocity = 0x2A000;
super->spritePriority.b1 = 1;
SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
} else if (super->z.HALF.HI != 0) {
sub_08037408(this);
}
EnemyFunctionHandlerAfterCollision(super, FlyingPot_Functions);
}
void FlyingPot_OnGrabbed(FlyingPotEntity* this) {
static void (*const FlyingPot_SubActions[])(FlyingPotEntity*) = {
FlyingPot_SubAction0, FlyingPot_SubAction1, FlyingPot_SubAction2,
FlyingPot_SubAction3, FlyingPot_SubActionDoNothing, FlyingPot_SubAction5,
};
FlyingPot_SubActions[super->subAction](this);
}
void FlyingPot_SubAction0(FlyingPotEntity* this) {
sub_08037418(this);
super->subAction = FLYING_POT_SUBACTION_1;
super->actionDelay = 0;
super->field_0x1d = 0x30;
}
void FlyingPot_SubAction1(FlyingPotEntity* this) {
sub_08037418(this);
if (sub_0806F520(super)) {
sub_0806F4E8(super);
} else {
super->spriteOffsetX = 0;
if (super->z.HALF.HI != 0) {
sub_08037408(this);
}
}
}
void FlyingPot_SubAction2(FlyingPotEntity* this) {
if (super->actionDelay == 0) {
sub_08037418(this);
super->actionDelay = 1;
COLLISION_OFF(super);
super->spriteOffsetX = 0;
SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
}
if (sub_0806F520(super)) {
sub_0806F3E4(super);
} else {
sub_08037408(this);
}
}
void FlyingPot_SubAction3(FlyingPotEntity* this) {
if (!(gPlayerState.field_0x1c & 0xF)) {
sub_08037408(this);
}
}
void FlyingPot_SubActionDoNothing(FlyingPotEntity* this) {
}
void FlyingPot_SubAction5(FlyingPotEntity* this) {
sub_08037408(this);
}
void FlyingPot_Init(FlyingPotEntity* this) {
u32 tile;
super->action = FLYING_POT_ACTION_1;
super->field_0x1c = 2;
super->y.HALF.HI += 3;
tile = TILE(super->x.HALF.HI, super->y.HALF.HI);
this->tileIndex = GetTileIndex(tile, super->collisionLayer);
SetTile(0x4000, tile, super->collisionLayer);
InitializeAnimation(super, 5);
}
void FlyingPot_Action1(FlyingPotEntity* this) {
sub_08037418(this);
if (GetTileTypeByEntity(super) != 0x4000) {
SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
sub_08037408(this);
}
if (PlayerInRange(super, 1, 0x40)) {
super->action = FLYING_POT_ACTION_2;
super->actionDelay = 30;
}
}
void FlyingPot_Action2(FlyingPotEntity* this) {
static const u8 offsets[] = { -1, 1, 1, -1 };
sub_08037418(this);
super->spriteOffsetX += offsets[super->actionDelay & 3];
if (--super->actionDelay == 0) {
super->action = FLYING_POT_ACTION_3;
super->spritePriority.b1 = 1;
super->spriteOffsetX = 0;
super->hitType = 0xA0;
super->flags2 = 0xF;
super->hitbox = &gUnk_080FD34C;
SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
}
}
void FlyingPot_Action3(FlyingPotEntity* this) {
super->z.WORD -= 0x10000;
if (super->z.HALF.HI <= -6) {
super->action = FLYING_POT_ACTION_4;
super->actionDelay = 10;
super->direction = GetFacingDirection(super, &gPlayerEntity);
}
}
void FlyingPot_Action4(FlyingPotEntity* this) {
if (--super->actionDelay == 0) {
super->action = FLYING_POT_ACTION_5;
}
}
void FlyingPot_Action5(FlyingPotEntity* this) {
ProcessMovement2(super);
if (super->collisions != 0) {
sub_08037408(this);
}
}
void FlyingPot_Action6(FlyingPotEntity* this) {
if (super->zVelocity < 0) {
super->spriteSettings.flipY = 1;
}
if (!GravityUpdate(super, 0x2000)) {
sub_08037408(this);
}
}
void sub_08037408(FlyingPotEntity* this) {
CreateFx(super, FX_POT_SHATTER, 0);
DeleteThisEntity();
}
void sub_08037418(FlyingPotEntity* this) {
u32 tile = COORD_TO_TILE(super);
if (GetTileIndex(tile, super->collisionLayer) == 0x4067) {
SetTile(this->tileIndex, tile, super->collisionLayer);
DeleteThisEntity();
}
}
+2 -2
View File
@@ -20,7 +20,7 @@ void (*const gUnk_080CFBD4[])(FlyingSkullEntity*);
const s8 gUnk_080CFBE4[4];
extern s32 sub_080012DC(Entity*);
extern void sub_08078930(Entity*);
extern void RegisterCarryEntity(Entity*);
void sub_0803A100(FlyingSkullEntity* this);
void sub_0803A0E0(FlyingSkullEntity* this);
@@ -130,7 +130,7 @@ void sub_08039DD8(FlyingSkullEntity* this) {
sub_0803A0E0(this);
}
sub_08078930(super);
RegisterCarryEntity(super);
} else {
if ((gPlayerState.flags & PL_MINISH) == 0) {
Entity* ent = &gPlayerEntity;
+2 -2
View File
@@ -113,7 +113,7 @@ void Ghini_OnConfused(GhiniEntity* this) {
}
void Ghini_OnGrabbed(GhiniEntity* this) {
if (sub_0806F520()) {
if (sub_0806F520(super)) {
Ghini_SubActions[super->subAction](this);
} else {
sub_0803F51C(this);
@@ -250,7 +250,7 @@ void Ghini_Action7(GhiniEntity* this) {
void Ghini_Action8(GhiniEntity* this) {
sub_0803F738(this);
GetNextFrame(super);
if ((super->frame & 0x80) != 0) {
if ((super->frame & ANIM_DONE) != 0) {
super->action = 9;
super->flags |= 0x80;
this->unk_78 = 0;
+2 -5
View File
@@ -42,9 +42,6 @@ void sub_08037ACC(GibdoEntity*);
void Gibdo_CreateObjects(GibdoEntity*);
void sub_08037A14(GibdoEntity*);
extern void sub_0804A4E4(Entity*, Entity*);
u32 sub_0804A044(Entity*, Entity*, u32);
void (*const Gibdo_Functions[6])(Entity*);
void (*const gUnk_080CF2AC[9])(GibdoEntity*);
extern Entity* gUnk_020000B0;
@@ -164,7 +161,7 @@ void sub_08037624(GibdoEntity* this) {
void sub_08037690(GibdoEntity* this) {
UpdateAnimationSingleFrame(super);
if ((super->frame & 0x80) != 0) {
if ((super->frame & ANIM_DONE) != 0) {
this->field_0x77 = 0x14;
sub_08037794(this);
} else {
@@ -196,7 +193,7 @@ void sub_080376D0(GibdoEntity* this) {
void sub_0803773C(GibdoEntity* this) {
UpdateAnimationSingleFrame(super);
if ((super->frame & 0x80) != 0) {
if ((super->frame & ANIM_DONE) != 0) {
sub_08037794(this);
}
}
+5 -5
View File
@@ -549,7 +549,7 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D86C.inc", void sub_0802D86C(GleerokE
UpdateAnimationSingleFrame(super);
if ((super->frame & 0x80) == 0)
if ((super->frame & ANIM_DONE) == 0)
return;
enemy = CreateEnemy(GLEEROK, 6);
@@ -569,7 +569,7 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D86C.inc", void sub_0802D86C(GleerokE
GetNextFrame(super);
if ((super->frame & 0x80) == 0)
if ((super->frame & ANIM_DONE) == 0)
return;
enemy = CreateEnemy(GLEEROK, 3);
@@ -998,7 +998,7 @@ void sub_0802E0B8(GleerokEntity* this) {
void sub_0802E1D0(GleerokEntity* this) {
Gleerok_HeapStruct* heap = this->unk_84;
if (!(super->frame & 0x80)) {
if (!(super->frame & ANIM_DONE)) {
GetNextFrame(super);
}
if (super->frame & 0x3f) {
@@ -1144,7 +1144,7 @@ void sub_0802E448(GleerokEntity* this) {
void sub_0802E4C0(GleerokEntity* this) {
GetNextFrame(super);
if (super->frame & 0x80) {
if (super->frame & ANIM_DONE) {
if (super->action != 2) {
this->unk_74 = 0;
this->unk_75 = 8;
@@ -1220,7 +1220,7 @@ NONMATCH("asm/non_matching/gleerok/sub_0802E518.inc", void sub_0802E518(GleerokE
r7 += heap->ent2->actionDelay;
} else {
if (super->iframes == 0) {
if ((super->animIndex != (heap->filler[0x15] >> 3) + 0x2f) || (super->frame & 0x80) != 0) {
if ((super->animIndex != (heap->filler[0x15] >> 3) + 0x2f) || (super->frame & ANIM_DONE) != 0) {
r7 = (heap->filler[0x15] >> 3) + 0x28;
}
} else {
+1 -1
View File
@@ -56,7 +56,7 @@ void GyorgChild_OnGrabbed(GyorgChildEntity* this) {
GyorgChild_OnGrabbed_Action1,
GyorgChild_OnGrabbed_Action3,
};
if (sub_0806F520()) {
if (sub_0806F520(super)) {
GyorgChild_OnGrabbed_Actions[super->subAction](this);
}
}
+3 -3
View File
@@ -125,7 +125,7 @@ void sub_08048B2C(GyorgFemaleEyeEntity* this) {
void sub_08048B84(GyorgFemaleEyeEntity* this) {
GetNextFrame(super);
if (super->frame & 0x80) {
if (super->frame & ANIM_DONE) {
super->action = 3;
super->flags |= ENT_COLLIDE;
super->hitType = 0x1E;
@@ -155,7 +155,7 @@ void sub_08048BB0(GyorgFemaleEyeEntity* this) {
SoundReq(SFX_ITEM_GLOVES_KNOCKBACK);
}
GetNextFrame(super);
if (super->frame & 0x80) {
if (super->frame & ANIM_DONE) {
super->hitType = 0x1E;
InitializeAnimation(super, gUnk_080D2010[(super->animationState << 3) + super->type]);
UpdateAnimationVariableFrames(super, 7);
@@ -176,7 +176,7 @@ void sub_08048BB0(GyorgFemaleEyeEntity* this) {
void sub_08048CEC(GyorgFemaleEyeEntity* this) {
GetNextFrame(super);
if (super->frame & 0x80) {
if (super->frame & ANIM_DONE) {
super->action = 1;
InitializeAnimation(super, gUnk_080D2010[(super->animationState << 3) + super->type]);
}
+3 -3
View File
@@ -106,7 +106,7 @@ void GyorgMale(GyorgMaleEntity* this) {
}
gUnk_080D1AFC[super->action](this);
if (super->action != 7) {
sub_0805EC9C(super, 0xaa, 0xaa, this->unk_78);
SetAffineInfo(super, 0xaa, 0xaa, this->unk_78);
}
super->animationState = -(this->unk_78 >> 8);
sub_08048004(this);
@@ -986,7 +986,7 @@ void sub_08047BF0(GyorgMaleEntity* this) {
}
}
}
sub_0805EC9C(super, 0xAA, 0xAA, this->unk_78);
SetAffineInfo(super, 0xAA, 0xAA, this->unk_78);
}
void sub_08047D24(GyorgMaleEntity* this) {
@@ -1005,7 +1005,7 @@ void sub_08047D24(GyorgMaleEntity* this) {
} else {
sub_08047E58(this);
}
sub_0805EC9C(super, this->unk_7e, this->unk_7e, this->unk_78);
SetAffineInfo(super, this->unk_7e, this->unk_7e, this->unk_78);
}
}
+2 -2
View File
@@ -79,7 +79,7 @@ void GyorgMaleEye_Init(GyorgMaleEyeEntity* this) {
void GyorgMaleEye_Action1(GyorgMaleEyeEntity* this) {
sub_08048F50(this);
GetNextFrame(super);
if ((super->frame & 0x80) != 0) {
if ((super->frame & ANIM_DONE) != 0) {
super->action = 2;
super->flags |= 0x80;
super->actionDelay = 0x2d;
@@ -98,7 +98,7 @@ void GyorgMaleEye_Action2(GyorgMaleEyeEntity* this) {
void GyorgMaleEye_Action3(GyorgMaleEyeEntity* this) {
sub_08048F50(this);
GetNextFrame(super);
if ((super->frame & 0x80) != 0) {
if ((super->frame & ANIM_DONE) != 0) {
DeleteThisEntity();
}
}
+2 -2
View File
@@ -79,7 +79,7 @@ void sub_0802BC74(Entity* this) {
sub_0802C1C0(this);
this->subAction = 1;
this->field_0x1d = 60;
this->animationState = (gPlayerEntity.animationState >> 1) ^ 2;
this->animationState = AnimationStateFlip90(gPlayerEntity.animationState >> 1);
InitializeAnimation(this, this->animationState);
}
@@ -92,7 +92,7 @@ void sub_0802BCA8(Entity* this) {
Entity* ent;
this->action = 7;
this->actionDelay = 0x5a;
this->actionDelay = 90;
this->zVelocity = Q_16_16(1.5);
this->hitType = 0x19;
this->field_0x3a = this->field_0x3a & 0xfb;
+1 -1
View File
@@ -85,7 +85,7 @@ void sub_0803248C(Entity* this) {
void sub_080324CC(Entity* this) {
if (sub_080325E8(this) == 0) {
UpdateAnimationSingleFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
sub_080326FC(this);
sub_08032740(this);
}
+1 -1
View File
@@ -79,7 +79,7 @@ void Keese_Fly(Entity* this) {
this->field_0x7a.HWORD--;
}
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
sub_08021F24(this);
} else {
ProcessMovement1(this);
+3 -3
View File
@@ -152,7 +152,7 @@ void Lakitu_Hide(Entity* this) {
void Lakitu_EndHide(Entity* this) {
UpdateAnimationSingleFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = IDLE;
this->actionDelay = 0x3c;
@@ -180,7 +180,7 @@ void Lakitu_Idle(Entity* this) {
void Lakitu_BeginHide(Entity* this) {
UpdateAnimationSingleFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 1;
this->spriteSettings.draw = 0;
@@ -191,7 +191,7 @@ void Lakitu_BeginHide(Entity* this) {
void Lakitu_Lightning(Entity* this) {
UpdateAnimationSingleFrame(this);
if (!(this->frame & 0x80)) {
if (!(this->frame & ANIM_DONE)) {
return;
}
+1 -1
View File
@@ -34,7 +34,7 @@ void LakituCloud_OnKnockback(Entity* this) {
}
void LakituCloud_OnGrabbed(Entity* this) {
if (sub_0806F520(this) == 0) {
if (!sub_0806F520(this)) {
if (this->subAction == 2) {
sub_0803CE3C(this);
}
+2 -2
View File
@@ -85,7 +85,7 @@ void Leever_Idle(Entity* this) {
void Leever_DigUp(Entity* this) {
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 3;
if (this->type == LeeverForm_Red) {
this->field_0x74.HWORD = 180;
@@ -113,7 +113,7 @@ void Leever_Attack(Entity* this) {
void Leever_DigDown(Entity* this) {
Leever_Move(this);
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 1;
this->actionDelay = 0xf0;
this->spriteSettings.draw = FALSE;
+2 -2
View File
@@ -277,7 +277,7 @@ void sub_08029D14(Entity* this) {
}
} else {
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 4;
this->actionDelay = 0x78;
this->hitType = 0x6c;
@@ -299,7 +299,7 @@ void sub_08029D78(Entity* this) {
void sub_08029DAC(Entity* this) {
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 6;
this->parent->field_0x76.HALF.HI = 1;
InitializeAnimation(this, this->animationState + 8);
+21 -21
View File
@@ -238,7 +238,7 @@ void sub_0803A364(Entity* this) {
break;
case 4:
GetNextFrame(this);
if ((this->frame & 0x80) != 0) {
if ((this->frame & ANIM_DONE) != 0) {
this->subAction = 5;
}
break;
@@ -261,7 +261,7 @@ void sub_0803A364(Entity* this) {
break;
case 7:
GetNextFrame(this);
if ((this->frame & 0x80) != 0) {
if ((this->frame & ANIM_DONE) != 0) {
this->subAction = 8;
this->spriteSettings.draw = 0;
InitAnimationForceUpdate(this->child, 8);
@@ -270,7 +270,7 @@ void sub_0803A364(Entity* this) {
break;
case 8:
sub_0803B55C(this);
if ((this->child->frame & 0x80) == 0) {
if ((this->child->frame & ANIM_DONE) == 0) {
return;
}
uVar1 = 9;
@@ -286,7 +286,7 @@ void sub_0803A364(Entity* this) {
break;
case 10:
sub_0803B55C(this);
if ((this->child->frame & 0x80) != 0) {
if ((this->child->frame & ANIM_DONE) != 0) {
this->subAction = 0xb;
this->spriteSettings.draw = 1;
InitializeAnimation(this, 4);
@@ -294,7 +294,7 @@ void sub_0803A364(Entity* this) {
break;
case 0xb:
GetNextFrame(this);
if ((this->frame & 0x80) == 0) {
if ((this->frame & ANIM_DONE) == 0) {
return;
}
if (this->type2 != 0) {
@@ -365,7 +365,7 @@ void sub_0803A60C(Entity* this) {
index = ((this->parent->field_0xf >> 4) + 3);
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
GetNextFrame(this);
if ((this->frame & 0x80) != 0) {
if ((this->frame & ANIM_DONE) != 0) {
this->action = 6;
this->spriteSettings.draw = 0;
InitAnimationForceUpdate(this->child, 8);
@@ -482,7 +482,7 @@ void sub_0803A814(Entity* this) {
index = ((this->parent->field_0xf >> 4) + 3);
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
sub_0803B55C(this);
if ((this->child->frame & 0x80) != 0) {
if ((this->child->frame & ANIM_DONE) != 0) {
this->action = 0xe;
this->spriteSettings.draw = 1;
InitializeAnimation(this, 4);
@@ -497,7 +497,7 @@ void sub_0803A86C(Entity* this) {
index = ((this->parent->field_0xf >> 4) + 3);
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
GetNextFrame(this);
if ((this->frame & 0x80) != 0) {
if ((this->frame & ANIM_DONE) != 0) {
COLLISION_ON(this);
sub_0803B59C(this);
}
@@ -619,7 +619,7 @@ void sub_0803AB10(Entity* this) {
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
LinearMoveUpdate(this);
sub_0803B55C(this);
if ((this->child->frame & 0x80) != 0) {
if ((this->child->frame & ANIM_DONE) != 0) {
this->action = 0x15;
this->actionDelay = 0xf;
}
@@ -649,7 +649,7 @@ void sub_0803ABB4(Entity* this) {
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
GetNextFrame(this);
sub_0803B55C(this);
if ((this->child->frame & 0x80) != 0) {
if ((this->child->frame & ANIM_DONE) != 0) {
this->action = 0x17;
COLLISION_ON(this);
this->speed = 0x180;
@@ -768,7 +768,7 @@ void sub_0803ADF4(Entity* this) {
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
UpdateAnimationSingleFrame(this);
GetNextFrame(this);
if ((this->frame & 0x80) != 0) {
if ((this->frame & ANIM_DONE) != 0) {
this->action = 0x1c;
this->actionDelay = 0x1e;
this->spriteSettings.draw = 0;
@@ -803,7 +803,7 @@ void sub_0803AEC4(Entity* this) {
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
UpdateAnimationSingleFrame(this);
GetNextFrame(this);
if ((this->frame & 0x80) != 0) {
if ((this->frame & ANIM_DONE) != 0) {
COLLISION_ON(this);
sub_0803B59C(this);
}
@@ -818,7 +818,7 @@ void sub_0803AF18(Entity* this) {
void sub_0803AF50(Entity* this) {
GetNextFrame(this);
if ((this->frame & 0x80) != 0) {
if ((this->frame & ANIM_DONE) != 0) {
this->action = 0x20;
this->spriteSettings.draw = 0;
InitAnimationForceUpdate(this->child, 8);
@@ -827,7 +827,7 @@ void sub_0803AF50(Entity* this) {
void sub_0803AF7C(Entity* this) {
sub_0803B55C(this);
if ((this->child->frame & 0x80) != 0) {
if ((this->child->frame & ANIM_DONE) != 0) {
this->action = 0x21;
this->actionDelay = 0xf;
}
@@ -892,7 +892,7 @@ void sub_0803B074(Entity* this) {
index = ((this->parent->field_0xf >> 4) + 3);
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
sub_0803B55C(this);
if ((this->child->frame & 0x80) != 0) {
if ((this->child->frame & ANIM_DONE) != 0) {
this->action = 0x27;
this->spriteSettings.draw = 1;
InitializeAnimation(this, 4);
@@ -903,7 +903,7 @@ void sub_0803B074(Entity* this) {
void sub_0803B0D4(Entity* this) {
UpdateAnimationSingleFrame(this);
GetNextFrame(this);
if ((this->frame & 0x80) != 0) {
if ((this->frame & ANIM_DONE) != 0) {
COLLISION_ON(this);
sub_0803B59C(this);
}
@@ -938,7 +938,7 @@ void sub_0803B144(Entity* this) {
void sub_0803B17C(Entity* this) {
GetNextFrame(this);
if ((this->frame & 0x80) != 0) {
if ((this->frame & ANIM_DONE) != 0) {
this->action = 0x2b;
COLLISION_ON(this);
this->hitType = 0x18;
@@ -951,7 +951,7 @@ void sub_0803B1B8(Entity* this) {
Entity* temp;
u16 val;
if ((this->frame & 0x80) == 0) {
if ((this->frame & ANIM_DONE) == 0) {
GetNextFrame(this);
UpdateAnimationSingleFrame(this->child);
}
@@ -994,7 +994,7 @@ void sub_0803B2D0(Entity* this) {
Entity* entity;
GetNextFrame(this);
if ((this->frame & 0x80) != 0) {
if ((this->frame & ANIM_DONE) != 0) {
this->action = 0x2d;
this->spriteSettings.draw = 0;
entity = *(Entity**)&this->field_0x74;
@@ -1009,7 +1009,7 @@ void sub_0803B30C(Entity* this) {
Entity* entity;
entity = *(Entity**)&this->field_0x74;
if ((entity->frame & 0x80) != 0) {
if ((entity->frame & ANIM_DONE) != 0) {
this->action = 0x2e;
sub_0803B8E8(this, 0x13);
InitializeAnimation(entity, 0);
@@ -1064,7 +1064,7 @@ void sub_0803B3F4(Entity* this) {
index = ((this->parent->field_0xf >> 4) + 3);
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
GetNextFrame(this);
if ((this->frame & 0x80) != 0) {
if ((this->frame & ANIM_DONE) != 0) {
this->hitType = 0x17;
if (this->type == 0) {
this->hitbox = (Hitbox*)&gUnk_080FD35C;
+2 -2
View File
@@ -757,7 +757,7 @@ void sub_08034B0C(Entity* this) {
this->actionDelay--;
} else {
GetNextFrame(this);
if ((this->frame & 0x80) == 0) {
if ((this->frame & ANIM_DONE) == 0) {
return;
}
this->action = 2;
@@ -789,7 +789,7 @@ void sub_08034B38(Entity* this) {
void sub_08034BA0(Entity* this) {
GetNextFrame(this);
if ((this->frame & 0x80) != 0) {
if ((this->frame & ANIM_DONE) != 0) {
this->parent->field_0x7c.HALF.HI = 0xff;
DeleteEntity(this);
}
+1 -1
View File
@@ -170,7 +170,7 @@ void sub_08023288(Entity* this) {
void sub_08023330(Entity* this) {
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 4;
this->actionDelay = 0x19;
COLLISION_ON(this);
+3 -3
View File
@@ -94,7 +94,7 @@ void sub_0801EB9C(Entity* this) {
void Octorok_Initialize(Entity* this) {
sub_0804A720(this);
if (this->type == 2) {
this->animationState = this->type;
this->animationState = 2;
} else {
this->animationState = Random() & 3;
}
@@ -141,13 +141,13 @@ void Octorok_ShootNut(Entity* this) {
}
}
if (this->frame & 0x80)
if (this->frame & ANIM_DONE)
Octorok_Pause(this);
}
void Octorok_Pause(Entity* this) {
this->action = 1;
this->actionDelay = (Random() & 0x38) + 0x18;
this->actionDelay = (Random() & 0x38) + 24;
}
void Octorok_Turn(Entity* this) {
+7 -7
View File
@@ -125,7 +125,7 @@ void OctorokBoss_Hit(OctorokBossEntity* this) {
sub_08078B48();
}
sub_0800445C(super);
sub_0805EC9C(super, this->unk_76, this->unk_74, this->angle.HWORD);
SetAffineInfo(super, this->unk_76, this->unk_74, this->angle.HWORD);
}
void OctorokBoss_Hit_SubAction0(OctorokBossEntity* this) {
@@ -327,7 +327,7 @@ void OctorokBoss_Intro(OctorokBossEntity* this) {
gUnk_02034490.unk0 = 1;
sub_08036F60(this);
OctorokBoss_Intro_SubActions[super->subAction](this);
sub_0805EC9C(super, this->unk_76, this->unk_74, this->angle.HWORD);
SetAffineInfo(super, this->unk_76, this->unk_74, this->angle.HWORD);
}
void OctorokBoss_Intro_SubAction0(OctorokBossEntity* this) {
@@ -475,7 +475,7 @@ void OctorokBoss_Action1(OctorokBossEntity* this) {
sub_08036914(super, angle, radius);
this->angle.HALF.HI = ((OctorokBossEntity*)super->parent)->angle.HALF.HI +
OctorokBoss_LegAngleOffset2[super->type - 1] + this->timer;
sub_0805EC9C(super, this->unk_76, this->unk_74, this->angle.HWORD);
SetAffineInfo(super, this->unk_76, this->unk_74, this->angle.HWORD);
break;
case TAIL:
@@ -522,7 +522,7 @@ void OctorokBoss_Action1(OctorokBossEntity* this) {
sub_080369D0(this, GET_TAIL_RADIUS(this), 4);
}
super->bitfield = 0;
sub_0805EC9C(super, this->unk_76, this->unk_74, -this->angle.HWORD ^ 0x8000);
SetAffineInfo(super, this->unk_76, this->unk_74, -this->angle.HWORD ^ 0x8000);
break;
case MOUTH:
@@ -546,7 +546,7 @@ void OctorokBoss_Action1(OctorokBossEntity* this) {
sub_08036914(super, angle, radius);
this->angle.HALF.HI = ((OctorokBossEntity*)super->parent)->angle.HALF.HI;
sub_0805EC9C(super, this->unk_76, this->unk_74, this->angle.HWORD);
SetAffineInfo(super, this->unk_76, this->unk_74, this->angle.HWORD);
sub_0800445C(super);
}
break;
@@ -562,7 +562,7 @@ void OctorokBoss_Action1(OctorokBossEntity* this) {
}
}
OctorokBoss_Action1_SubActions[super->subAction](this);
sub_0805EC9C(super, this->unk_76, this->unk_74, this->angle.HWORD);
SetAffineInfo(super, this->unk_76, this->unk_74, this->angle.HWORD);
break;
}
}
@@ -905,7 +905,7 @@ void OctorokBoss_Burning(OctorokBossEntity* this) {
CreateProjectileWithParent(super, OCTOROK_BOSS_PROJECTILE, 3);
}
}
sub_0805EC9C(super, this->unk_76, this->unk_74, this->angle.HWORD);
SetAffineInfo(super, this->unk_76, this->unk_74, this->angle.HWORD);
}
void OctorokBoss_Burning_SubAction0(OctorokBossEntity* this) {
+1 -4
View File
@@ -8,9 +8,6 @@ extern void (*const gUnk_080012C8[])(Entity*);
const s8 gUnk_080CF490[];
const u8 gUnk_080CF498[];
extern s32 sub_080012DC(Entity*);
extern u32 sub_0804A044(Entity*, Entity*, u32);
void sub_08037E14(Entity* this);
bool32 sub_08037E90(Entity* this);
@@ -90,7 +87,7 @@ void sub_08037D54(Entity* this) {
EnqueueSFX(SFX_124);
}
}
} else if (this->frame & 0x80) {
} else if (this->frame & ANIM_DONE) {
if (--this->actionDelay == 0) {
this->action = 1;
this->field_0xf = 0x3c;
+2 -5
View File
@@ -19,9 +19,6 @@ extern const s8 gUnk_080CA5D4[];
void sub_080205F8(Entity*);
void sub_08020604(Entity*);
extern u32 sub_08049F1C(Entity*, Entity*, u32);
extern void sub_0804AA1C(Entity*);
extern Entity* gUnk_020000B0;
enum {
@@ -289,7 +286,7 @@ void Peahat_Recover(Entity* this) {
void Peahat_Hop(Entity* this) {
GetNextFrame(this);
if (--this->actionDelay == 0) {
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 9;
this->zVelocity = Q_16_16(1.5);
this->animationState = PeahatAnimation_NewPropeller;
@@ -313,7 +310,7 @@ void Peahat_Hop(Entity* this) {
void Peahat_Takeoff(Entity* this) {
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 1;
this->hitType = 0x70;
this->field_0x82.HALF.LO = 1;
+2 -2
View File
@@ -237,7 +237,7 @@ void sub_080253D4(Entity* this) {
void sub_0802541C(Entity* this) {
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 3;
this->field_0xf = 1;
this->zVelocity = Q_16_16(2);
@@ -270,7 +270,7 @@ void sub_0802547C(Entity* this) {
void sub_080254B4(Entity* this) {
GravityUpdate(this, Q_16_16(0.125));
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
if (this->z.HALF.HI == 0) {
if (this->cutsceneBeh.HWORD == 0) {
this->hitType = 0x82;
-2
View File
@@ -8,8 +8,6 @@
#include "enemy.h"
#include "functions.h"
extern void sub_0804A4E4(Entity*, Entity*);
extern void (*const RockChuchu_Functions[])(Entity*);
extern void (*const gUnk_080CB960[])(Entity*);
+5 -5
View File
@@ -21,7 +21,7 @@ void sub_08020A7C(Entity*);
bool32 Rollobite_TryToHoleUp(Entity*);
bool32 Rollobite_IsRolledUp(Entity*);
extern void sub_08078930(Entity*);
extern void RegisterCarryEntity(Entity*);
void Rollobite(Entity* this) {
EnemyFunctionHandler(this, Rollobite_Functions);
@@ -175,7 +175,7 @@ void Rollobite_Turn(Entity* this) {
void Rollobite_RolledUp(Entity* this) {
u32 unk;
if ((this->frame & 0x80) == 0)
if ((this->frame & ANIM_DONE) == 0)
GetNextFrame(this);
unk = sub_080044EC(this, 0x2800);
@@ -185,7 +185,7 @@ void Rollobite_RolledUp(Entity* this) {
this->action = 5;
InitializeAnimation(this, this->animationState + 12);
}
sub_08078930(this);
RegisterCarryEntity(this);
} else {
if (unk == 1)
EnqueueSFX(SFX_104);
@@ -197,7 +197,7 @@ void Rollobite_RolledUp(Entity* this) {
void Rollobite_Unroll(Entity* this) {
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
COLLISION_ON(this);
this->speed = 0x100;
this->hitType = 34;
@@ -206,7 +206,7 @@ void Rollobite_Unroll(Entity* this) {
InitializeAnimation(this, this->animationState);
} else {
if ((this->frame & 1) == 0)
sub_08078930(this);
RegisterCarryEntity(this);
}
}
+2 -3
View File
@@ -12,7 +12,6 @@ extern void (*const Rope_Functions[6])(Entity*);
extern void (*const gUnk_080CE460[4])(Entity*);
extern void (*const gUnk_080CE470[3])(Entity*);
extern Entity* gUnk_020000B0;
extern u32 sub_0804A044(Entity*, Entity*, u32);
void sub_08031600(Entity*);
u32 sub_0803163C(Entity*);
@@ -39,7 +38,7 @@ void Rope_OnCollision(Entity* this) {
}
void Rope_OnGrabbed(Entity* this) {
if (sub_0806F520()) {
if (sub_0806F520(this)) {
gUnk_080CE470[this->subAction](this);
}
}
@@ -174,7 +173,7 @@ void sub_08031600(Entity* this) {
u32 sub_0803163C(Entity* this) {
u32 h;
if (sub_080B1AA8(this) == 0x13) {
if (GetTileUnderEntity(this) == 0x13) {
h = this->field_0x7a.HWORD / 2;
} else {
h = this->field_0x7a.HWORD;
-3
View File
@@ -14,9 +14,6 @@ extern void (*const gUnk_080012C8[])(Entity*);
extern void (*const RopeGolden_Functions[6])(Entity*);
extern void (*const gUnk_080CF4E0[4])(Entity*);
extern s32 sub_080012DC(Entity*);
extern u32 sub_0804A044(Entity*, Entity*, u32);
void sub_080383AC(Entity*);
void sub_080383E4(Entity*);
+2 -2
View File
@@ -122,7 +122,7 @@ void sub_08029474(Entity* this) {
u32 bVar1;
sub_080296C8(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 3;
this->actionDelay = 8;
bVar1 = GetFacingDirection(this, &gPlayerEntity);
@@ -196,7 +196,7 @@ void sub_08029610(Entity* this) {
void sub_08029630(Entity* this) {
sub_080296C8(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->field_0x80.HALF.HI = 1;
this->child->spriteSettings.draw = FALSE;
sub_080297F0(this);
+1 -1
View File
@@ -142,7 +142,7 @@ void sub_08038B08(ScissorsBeetleEntity* this) {
}
UpdateAnimationSingleFrame(super);
if (super->frame & 0x80) {
if (super->frame & ANIM_DONE) {
super->action = 4;
this->unk_82 = 3;
super->actionDelay = 0x32;
-2
View File
@@ -15,8 +15,6 @@ typedef struct {
void sub_08044FF8(Entity*);
void sub_08045178(Entity*, Entity*, int, int);
extern void sub_0804A4E4(Entity*, Entity*);
extern void (*const gUnk_080D16BC[])(Entity*);
extern void (*const Slime_Functions[])(Entity*);
extern u8 gUnk_080D16D0[4]; // Entity count per form
+3 -7
View File
@@ -8,13 +8,9 @@
#include "enemy.h"
#include "functions.h"
extern s32 sub_080012DC(Entity*);
bool32 PlayerInRange(Entity*, u32, u32);
void sub_08023E10(Entity*);
void sub_08023E54(Entity*);
void sub_08023E9C(Entity*);
void sub_0804A4E4(Entity*, Entity*);
extern void (*const gUnk_080012C8[])(Entity*);
@@ -134,7 +130,7 @@ void sub_08023CE0(Entity* this) {
default:
GetNextFrame(this);
if (this->frame) {
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
Entity* ent = CreateEnemy(SLUGGULA, 1);
if (ent) {
sub_0804A4E4(this, ent);
@@ -157,7 +153,7 @@ void sub_08023E10(Entity* this) {
}
GetNextFrame(this);
if (this->frame & 0x80)
if (this->frame & ANIM_DONE)
DeleteEntity(this);
}
@@ -178,7 +174,7 @@ extern Entity* gUnk_020000B0;
void sub_08023E9C(Entity* this) {
u32 uVar3 = Random();
if (sub_08049FA0(this) == 0 && (uVar3 & 1)) {
if (!sub_08049FA0(this) && (uVar3 & 1)) {
this->direction = DirectionRoundUp(sub_08049EE4(this));
} else if (sub_08049FDC(this, 1) && (uVar3 & 6)) {
u32 uVar3 = GetFacingDirection(this, gUnk_020000B0) - this->direction;
+1 -1
View File
@@ -171,7 +171,7 @@ void sub_08033A7C(SpinyBeetleEntity* this) {
}
GetNextFrame(super);
if ((super->frame & 0x80) == 0)
if ((super->frame & ANIM_DONE) == 0)
return;
super->action = 3;
+4 -9
View File
@@ -9,11 +9,6 @@
#include "functions.h"
#include "hitbox.h"
extern void sub_08001318(Entity*);
extern u32 PlayerInRange(Entity*, u32, u32);
extern void sub_0804A4E4(Entity*, Entity*);
extern void sub_0804AA1C(Entity*);
u32 sub_080228CC(Entity*);
u32 sub_080228F0(Entity*);
@@ -181,7 +176,7 @@ void sub_080226EC(Entity* this) {
void sub_08022780(Entity* this) {
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 4;
InitializeAnimation(this, 3);
EnqueueSFX(SFX_194);
@@ -201,7 +196,7 @@ void sub_080227AC(Entity* this) {
this->hitType = 0x5c;
}
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 2;
this->field_0xf = gUnk_080CBA60[Random() & 3];
InitializeAnimation(this, 0);
@@ -211,7 +206,7 @@ void sub_080227AC(Entity* this) {
void sub_0802281C(Entity* this) {
GravityUpdate(this, Q_8_8(24.0));
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 2;
this->speed = 0x20;
InitializeAnimation(this, 0);
@@ -234,7 +229,7 @@ void sub_08022854(Entity* this) {
void sub_0802289C(Entity* this) {
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 2;
this->speed = 0x20;
this->field_0x80.HALF.HI = 0x78;
+2 -2
View File
@@ -123,7 +123,7 @@ void sub_08039418(StalfosEntity* this) {
}
void sub_08039438(StalfosEntity* this) {
if (sub_0806F520()) {
if (sub_0806F520(super)) {
Stalfos_SubActions[super->subAction](this);
}
}
@@ -269,7 +269,7 @@ void Stalfos_Action11(StalfosEntity* this) {
void Stalfos_Action12(StalfosEntity* this) {
UpdateAnimationSingleFrame(super);
if ((super->frame & 0x80) != 0) {
if ((super->frame & ANIM_DONE) != 0) {
if (super->type2 == 1) {
sub_0803998C(this);
DeleteEntity(super->child);
+1 -1
View File
@@ -74,7 +74,7 @@ void Takkuri_OnCollision(TakkuriEntity* this) {
void Takkuri_OnGrabbed(TakkuriEntity* this) {
gUnk_080CFF6C[super->subAction](this);
GetNextFrame(super);
if (sub_0806F520(super) == 0) {
if (!sub_0806F520(super)) {
super->action = 2;
super->subAction = 0;
this->unk_0x84 = 2;
+4 -4
View File
@@ -97,7 +97,7 @@ void sub_0802F284(Entity* this) {
if (this->actionDelay != 0) {
this->actionDelay--;
} else if (this->field_0xf != 0) {
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 2;
this->actionDelay = 0x10;
this->field_0xf = this->type;
@@ -105,7 +105,7 @@ void sub_0802F284(Entity* this) {
sub_0802F45C(this);
InitializeAnimation(this, 2);
}
} else if (this->frame & 0x80) {
} else if (this->frame & ANIM_DONE) {
this->field_0xf = 0x40;
InitializeAnimation(this, 1);
}
@@ -137,7 +137,7 @@ void sub_0802F300(Entity* this) {
return;
} else if (this->collisions != 0) {
sub_0800417E(this, this->collisions);
} else if ((sub_080B1AA8(this) & 0xf0) == 0x50) {
} else if ((GetTileUnderEntity(this) & 0xf0) == 0x50) {
this->direction = (this->direction + 0x10) & 0x1f;
}
@@ -167,7 +167,7 @@ void sub_0802F3F4(Entity* this) {
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
if ((*(u8*)&this->field_0x7c.HALF.LO < 2) && ((this->type % 2) != 0)) {
this->action = 2;
this->actionDelay = 0x10;
+4 -4
View File
@@ -85,7 +85,7 @@ void sub_08037Fe0(Entity* this) {
if (this->actionDelay != 0) {
this->actionDelay--;
} else if (this->field_0xf != 0) {
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 2;
this->actionDelay = 6;
this->field_0xf = 0;
@@ -93,7 +93,7 @@ void sub_08037Fe0(Entity* this) {
sub_08038168(this);
InitializeAnimation(this, 2);
}
} else if (this->frame & 0x80) {
} else if (this->frame & ANIM_DONE) {
this->field_0xf = 0x40;
InitializeAnimation(this, 1);
}
@@ -116,7 +116,7 @@ void sub_08038048(Entity* this) {
return;
} else if (this->collisions != 0) {
sub_0800417E(this, this->collisions);
} else if ((sub_080B1AA8(this) & 0xf0) == 0x50) {
} else if ((GetTileUnderEntity(this) & 0xf0) == 0x50) {
this->direction = (this->direction + 0x10) & 0x1f;
}
@@ -141,7 +141,7 @@ void sub_08038048(Entity* this) {
void sub_08038110(Entity* this) {
UpdateAnimationVariableFrames(this, 2);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
if (this->field_0x80.HALF.LO < 5) {
this->action = 2;
this->actionDelay = 8;
+1 -1
View File
@@ -713,7 +713,7 @@ void sub_08042FD8(Entity* this) {
this->frame = 0;
}
} else {
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
if (--this->field_0xf == 0) {
this->subAction = 8;
this->actionDelay = 0x3c;
+1 -1
View File
@@ -162,7 +162,7 @@ void sub_08044868(Entity* this) {
if (this->field_0x82.HALF.HI) {
switch (this->field_0x74.HALF.LO) {
case 0:
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->field_0x74.HALF.LO = 1;
this->direction = sub_080045B4(this, vaati->x.HALF.HI, vaati->y.HALF.HI - 0x10);
this->speed = 0x180;
+1 -1
View File
@@ -153,7 +153,7 @@ void VaatiProjectileFunction0Action2(Entity* this) {
}
void VaatiProjectileFunction0Action3(Entity* this) {
if (this->child->frame & 0x80) {
if (this->child->frame & ANIM_DONE) {
if (--this->z.HALF.HI <= -0x18) {
this->action = 4;
this->actionDelay = (Random() & 0xf) + 0xf;
+3 -3
View File
@@ -235,7 +235,7 @@ void VaatiRebornEnemyType0Action2(Entity* this) {
}
break;
case 1:
if ((this->frame & 0x80) != 0) {
if ((this->frame & ANIM_DONE) != 0) {
this->field_0x74.HALF.LO = 2;
this->spriteSettings.draw = 0;
this->actionDelay = 0x10;
@@ -260,7 +260,7 @@ void VaatiRebornEnemyType0Action2(Entity* this) {
}
break;
case 3:
if ((this->frame & 0x80) != 0) {
if ((this->frame & ANIM_DONE) != 0) {
this->spriteSettings.draw = 1;
if (4 < this->field_0x80.HALF.HI) {
this->x.HALF.HI = gPlayerEntity.x.HALF.HI;
@@ -318,7 +318,7 @@ void VaatiRebornEnemyType0Action3(Entity* this) {
}
break;
case 2:
if ((this->frame & 0x80) != 0) {
if ((this->frame & ANIM_DONE) != 0) {
this->field_0x74.HALF.LO = 3;
InitAnimationForceUpdate(this, 0);
}
+4 -4
View File
@@ -675,7 +675,7 @@ void VaatiTransfiguredType2Action1(Entity* this) {
}
break;
case 1:
if ((this->frame & 0x80) != 0) {
if ((this->frame & ANIM_DONE) != 0) {
this->field_0x74.HALF.LO = 0;
this->field_0xf = (Random() & 0x7f) + 0x17;
InitAnimationForceUpdate(this, 0);
@@ -790,7 +790,7 @@ void VaatiTransfiguredType5Action1(Entity* this) {
this->field_0x80.HALF.LO = 0;
this->spriteSettings.draw = 0;
} else {
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->frame &= ~0x80;
if (gEntCount < 0x47) {
sub_08040648(this, this->type, 1);
@@ -814,13 +814,13 @@ void VaatiTransfiguredType5Action2(Entity* this) {
}
if (this->field_0x80.HALF.LO == 0) {
if (this->parent->parent->action != 6) {
if ((this->frame & 0x80) != 0) {
if ((this->frame & ANIM_DONE) != 0) {
this->field_0x80.HALF.LO += 1;
InitializeAnimation(this, 3);
}
}
} else {
if ((this->frame & 0x80) != 0) {
if ((this->frame & ANIM_DONE) != 0) {
DeleteThisEntity();
}
}
+3 -3
View File
@@ -129,7 +129,7 @@ void VaatiTransfiguredEyeFunction0Action0(Entity* this) {
void VaatiTransfiguredEyeFunction0Action1(Entity* this) {
sub_08045A28(this);
if (this->field_0x82.HALF.LO == 0) {
if ((this->frame & 0x80) != 0) {
if ((this->frame & ANIM_DONE) != 0) {
if (this->type != 0) {
COLLISION_ON(this);
}
@@ -169,7 +169,7 @@ void VaatiTransfiguredEyeFunction0Action2(Entity* this) {
void VaatiTransfiguredEyeFunction0Action3(Entity* this) {
sub_08045A28(this);
if ((this->frame & 0x80) != 0) {
if ((this->frame & ANIM_DONE) != 0) {
this->action = 2;
if (this->type != 0) {
if (this->actionDelay == 0) {
@@ -187,7 +187,7 @@ void VaatiTransfiguredEyeFunction0Action4(Entity* this) {
sub_08045A28(this);
if (this->field_0xf == 0) {
if ((this->frame & 0x80) != 0) {
if ((this->frame & ANIM_DONE) != 0) {
this->field_0xf = 0x20;
}
} else {
+4 -4
View File
@@ -365,7 +365,7 @@ void VaatiWrathType0Action6(Entity* this) {
type1->frame &= 0xfd;
}
} else {
if ((type1->frame & 0x80) != 0) {
if ((type1->frame & ANIM_DONE) != 0) {
sub_0804235C(this);
}
}
@@ -546,7 +546,7 @@ void VaatiWrathType0ActionC(Entity* this) {
entity->frame &= 0xfe;
InitAnimationForceUpdate(this, 9);
} else {
if (entity->frame & 0x80) {
if (entity->frame & ANIM_DONE) {
sub_0804235C(this);
}
}
@@ -617,7 +617,7 @@ void sub_08041BE8(Entity* this) {
void sub_08041CD0(Entity* this) {
GetNextFrame(((VaatiWrathHeapStruct*)this->myHeap)->type2);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
if (this->actionDelay != 0) {
this->actionDelay--;
} else {
@@ -964,7 +964,7 @@ u32 sub_080422C0(Entity* this, u32 unk1) {
type1->frame &= 0xfb;
InitAnimationForceUpdate(this, 3);
} else {
if (type1->frame & 0x80) {
if (type1->frame & ANIM_DONE) {
InitAnimationForceUpdate(this, 0);
type1->subAction = 0;
InitializeAnimation(type1, 0xc);
+4 -4
View File
@@ -56,7 +56,7 @@ void VaatiWrathEyeAction0(Entity* this) {
void VaatiWrathEyeAction1(Entity* this) {
sub_080485D8(this);
GetNextFrame(this);
if ((this->frame & 0x80) != 0) {
if ((this->frame & ANIM_DONE) != 0) {
this->action = 2;
InitializeAnimation(this, 1);
}
@@ -105,7 +105,7 @@ void VaatiWrathEyeAction4(Entity* this) {
}
} else {
GetNextFrame(this);
if ((this->frame & 0x80) != 0) {
if ((this->frame & ANIM_DONE) != 0) {
this->action = 5;
this->actionDelay = 0;
}
@@ -137,7 +137,7 @@ void VaatiWrathEyeAction6(Entity* this) {
InitializeAnimation(this, 6);
}
} else {
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
this->action = 7;
this->actionDelay = 120;
this->field_0xf = 0;
@@ -193,7 +193,7 @@ void VaatiWrathEyeAction8(Entity* this) {
void VaatiWrathEyeAction9(Entity* this) {
sub_080485FC(this);
GetNextFrame(this);
if ((this->frame & 0x80) != 0) {
if ((this->frame & ANIM_DONE) != 0) {
this->action = 4;
this->actionDelay = 1;
this->parent->field_0x7a.HALF.HI = (this->parent->field_0x7a.HALF.HI & 0xf) | (1 << this->type);
+3 -3
View File
@@ -112,7 +112,7 @@ void sub_0802A610(Entity* this) {
GetNextFrame(this);
sub_0802A7D0(this);
flags = this->frame & 0x80;
flags = this->frame & ANIM_DONE;
if (flags) {
this->action = 4;
this->actionDelay = 0x1e;
@@ -154,7 +154,7 @@ void sub_0802A69C(Entity* this) {
/* sigh... */
GetNextFrame(this);
flags = this->frame & 0x80;
flags = this->frame & ANIM_DONE;
if (flags) {
this->action = 6;
this->actionDelay = 0x1e;
@@ -193,7 +193,7 @@ void sub_0802A78C(Entity* this) {
void sub_0802A7D0(Entity* this) {
u32 unk = gUnk_080CD0B0[(this->field_0x7c.BYTES.byte1++ >> 3) & 7] + 0x100;
sub_0805EC9C(this, unk, unk, 0);
SetAffineInfo(this, unk, unk, 0);
}
// clang-format off
void (*const WallMaster_Functions[])(Entity*) = {
+2 -2
View File
@@ -131,7 +131,7 @@ void sub_0802CE68(Entity* this) {
}
sub_0802CFD8(this);
GetNextFrame(this);
frames = this->frame & 0x80;
frames = this->frame & ANIM_DONE;
if (frames) {
this->action = 4;
this->actionDelay = 30;
@@ -169,7 +169,7 @@ ASM_FUNC("asm/non_matching/wallMaster2/sub_0802CF8C.inc", void sub_0802CF8C(Enti
void sub_0802CFD8(Entity* this) {
u32 unk = gUnk_080CD740[(this->field_0x7a.HALF.LO++ >> 3) & 7];
sub_0805EC9C(this, (s16)this->field_0x74.HWORD + unk, 0x100 + unk, this->field_0x76.HWORD);
SetAffineInfo(this, (s16)this->field_0x74.HWORD + unk, 0x100 + unk, this->field_0x76.HWORD);
}
// clang-format off
+1 -1
View File
@@ -56,7 +56,7 @@ void sub_0802A2B4(Entity* this) {
void sub_0802A2FC(Entity* this) {
GetNextFrame(this);
if (this->frame & 0x80) {
if (this->frame & ANIM_DONE) {
DeleteEntity(this);
} else if (this->frame & 1) {
COLLISION_OFF(this);
+1 -1
View File
@@ -69,7 +69,7 @@ void Wisp_OnCollision(Entity* this) {
}
void Wisp_OnGrabbed(Entity* this) {
if (sub_0806F520() != 0) {
if (sub_0806F520(this)) {
gUnk_080CEB98[this->subAction](this);
}
}
+14 -15
View File
@@ -9,15 +9,14 @@ extern u8 gUnk_081091F8[];
extern u8 gUnk_081091EE[];
extern u8 gUpdateVisibleTiles;
extern Manager gUnk_02033290;
void sub_0805ED30(void);
void UpdatePlayerInput(void);
void ClearHitboxList(void);
void sub_0805EE88(void);
void ClearAllDeletedEntities(void);
void DeleteAllEntities(void);
void sub_0805E98C(void);
extern void sub_0806FE84(Entity*);
extern void UnloadOBJPalette2(Entity*);
extern void sub_08017744(Entity*);
extern void UnloadHitbox(Entity*);
extern void sub_0804AA1C(Entity*);
void ClearDeletedEntity(Entity*);
@@ -64,8 +63,8 @@ void sub_0805E248(void) {
gUpdateVisibleTiles = 0;
}
void sub_0805E374(Entity* e) {
u8 r3 = gRoomTransition.player_status.field_0x24[8];
void SetDefaultPriorityForKind(Entity* e) {
u8 r3 = gRoomTransition.entity_update_type;
u8* array = gUnk_081091F8;
if (r3 != 2) {
@@ -201,7 +200,7 @@ void UpdateEntities(void) {
gRoomVars.filler1[0] = gRoomVars.field_0x4;
gRoomVars.field_0x4 = 0;
sub_0805ED30();
UpdatePlayerInput();
UpdatePriority();
ClearHitboxList();
sub_0806F0A4();
@@ -232,7 +231,7 @@ void EraseAllEntities(void) {
}
extern Entity gUnk_030015A0[0x48];
extern Entity gUnk_03003BE0;
extern Entity gCarryEntities;
NONMATCH("asm/non_matching/GetEmptyEntity.inc", Entity* GetEmptyEntity()) {
u8 flags_ip;
@@ -263,7 +262,7 @@ NONMATCH("asm/non_matching/GetEmptyEntity.inc", Entity* GetEmptyEntity()) {
ClearDeletedEntity(ptr);
return ptr;
}
} while (++ptr < &gUnk_03003BE0);
} while (++ptr < &gCarryEntities);
flags_ip = 0;
rv = NULL;
@@ -343,9 +342,9 @@ void DeleteEntity(Entity* ent) {
if (ent->next) {
UnloadGFXSlots(ent);
UnloadOBJPalette(ent);
sub_0806FE84(ent);
UnloadOBJPalette2(ent);
sub_080788E0(ent);
sub_08078954(ent);
FreeCarryEntity(ent);
sub_0805EC60(ent);
sub_08017744(ent);
ReleaseTransitionManager(ent);
@@ -437,15 +436,15 @@ void ReleaseTransitionManager(void* mgr) {
}
}
extern Entity gUnk_020369F0;
extern LinkedList gEntityListsBackup;
void sub_0805E958(void) {
MemCopy(&gEntityLists, &gUnk_020369F0, 0x48);
MemCopy(&gEntityLists, &gEntityListsBackup, 0x48);
sub_0805E98C();
}
void sub_0805E974(void) {
MemCopy(&gUnk_020369F0, &gEntityLists, 0x48);
MemCopy(&gEntityListsBackup, &gEntityLists, 0x48);
}
void sub_0805E98C(void) {
@@ -479,7 +478,7 @@ void DeleteSleepingEntities(void) {
list = &gEntityLists[0];
do {
for (ent = list->first; (u32)ent != (u32)list; ent = next) {
for (ent = list->first; (intptr_t)ent != (intptr_t)list; ent = next) {
next = ent->next;
if (ent->flags & ENT_DELETED)
DeleteEntityAny(ent);
@@ -501,7 +500,7 @@ void AppendEntityToList(Entity* entity, u32 listIndex) {
} else {
gManagerCount++;
}
sub_0805E374(entity);
SetDefaultPriorityForKind(entity);
}
void PrependEntityToList(Entity* entity, u32 listIndex) {
+4 -4
View File
@@ -106,12 +106,12 @@ void sub_08051458(void);
void CreateDialogBox(u32 arg0, u32 arg1) {
u32 sfx;
struct_080FC844 var0;
Font var0;
sub_08050384();
MemCopy(&gUnk_080FC844, &var0, sizeof(gUnk_080FC844));
sub_08056FEC(arg1, gUnk_020227E8);
var0.unk10 |= gUnk_080FC85C[arg0][0] << 0xC;
var0.gfx_src |= gUnk_080FC85C[arg0][0] << 0xC;
sub_0805F46C(gUnk_080FC85C[arg0][1], &var0);
sfx = gUnk_080FC85C[arg0][2];
if (sfx) {
@@ -296,7 +296,7 @@ static void sub_0805066C(void) {
void sub_0805070C(void) {
u32 i;
int j;
struct_02036540* var0;
WStruct* var0;
char* name;
var0 = sub_0805F2C8();
@@ -322,7 +322,7 @@ void sub_0805070C(void) {
void sub_08050790(void) {
u32 i, j;
struct_02036540* var0;
WStruct* var0;
u32 var1;
var0 = sub_0805F2C8();
+1 -20
View File
@@ -86,7 +86,6 @@ extern void* gAreaMetatiles[];
extern void* gUnk_080B755C[];
extern void** gAreaTable[];
extern void CreateDialogBox(u32, u32);
extern void FinalizeSave(void);
extern void ClearArmosData(void);
extern void ClearRoomMemory(void);
@@ -169,24 +168,6 @@ typedef struct {
} struct_08127F94;
extern struct_08127F94 gUnk_08127F94[];
typedef struct {
u16* dest;
void* gfx_dest;
void* buffer_loc;
u32 _c;
u16 gfx_src;
u8 width;
u8 right_align : 1;
u8 sm_border : 1;
u8 unused : 1;
u8 draw_border : 1;
u8 border_type : 4;
u8 fill_type;
u8 _15;
u8 _16;
u8 stylized;
} Font;
typedef struct {
u8 dest_off[8];
u8 _8;
@@ -408,7 +389,7 @@ static void GameMain_ChangeRoom(void) {
sub_0801855C();
}
#elif defined(DEMO_JP)
if (gRoomTransition.field_0x2c[5])
if (gRoomTransition.field_0x2c[4])
CheckAreaDiscovery();
if (gArea.inventoryGfxIdx != 0xff) {
sub_0801855C();
+2 -2
View File
@@ -14,7 +14,7 @@ extern u8 gUnk_03003DE0;
extern u8 gUnk_03000C30;
extern u8 gUpdateVisibleTiles;
extern Entity gUnk_03003BE0;
extern Entity gCarryEntities;
extern Entity* gPlayerClones[3];
extern u16 gUnk_080B2CD8[];
@@ -334,7 +334,7 @@ void sub_080171F0(void) {
gPlayerState.mobility = 0;
gPlayerState.speed_modifier = 0;
gPlayerState.field_0xaa = 0;
MemClear(&gUnk_03003BE0, 0x8c);
MemClear(&gCarryEntities, 0x8c);
gPlayerEntity.spriteOffsetY = gPlayerState.field_0x3f;
gPlayerState.field_0x3f = 0;
sub_0807B0C8();
+3 -3
View File
@@ -29,7 +29,7 @@ void sub_08075FF8(ItemBehavior* this, u32 arg1) {
}
maxBombs = this->behaviorID == 7 ? 3 : 1;
if (maxBombs > bombCount) {
entity = CreatePlayerBomb(this, 2);
entity = CreatePlayerItemWithParent(this, 2);
if (entity != NULL) {
tmp = &gUnk_0811BDAC[gPlayerEntity.animationState & 6];
// TODO fix array access
@@ -41,8 +41,8 @@ void sub_08075FF8(ItemBehavior* this, u32 arg1) {
}
}
}
sub_08077E78(this, arg1);
DeletePlayerItem(this, arg1);
}
// TODO arg1 type not yet known, called by sub_080761C0 and sub_080762D8
// TODO arg1 type not yet known, called by ItemPickupCheck and sub_080762D8
ASM_FUNC("asm/non_matching/itemBomb/sub_08076088.inc", void sub_08076088(ItemBehavior* this, void* arg1))
+2 -2
View File
@@ -15,7 +15,7 @@ void sub_08075D2C(ItemBehavior* this, u32 arg1) {
sub_08077D38(this, arg1);
gPlayerState.field_0x3[1] |= 8;
} else {
sub_08077E78(this, arg1);
DeletePlayerItem(this, arg1);
}
}
@@ -30,5 +30,5 @@ void sub_08075D88(ItemBehavior* this, u32 arg1) {
return;
}
}
sub_08077E78(this, arg1);
DeletePlayerItem(this, arg1);
}
+5 -5
View File
@@ -16,7 +16,7 @@ void sub_08075DF4(ItemBehavior* this, u32 arg1) {
sub_08077D38(this, arg1);
gPlayerState.field_0x1f[2] = 1;
} else {
sub_08077E78(this, arg1);
DeletePlayerItem(this, arg1);
}
}
@@ -39,7 +39,7 @@ void sub_08075E40(ItemBehavior* this, u32 arg1) {
}
}
gPlayerState.field_0x1f[2] = 0;
sub_08077E78(this, arg1);
DeletePlayerItem(this, arg1);
}
void sub_08075EC0(ItemBehavior* this, u32 arg1) {
@@ -51,7 +51,7 @@ void sub_08075EC0(ItemBehavior* this, u32 arg1) {
if (iVar2 != 0 && arrowCount != 0) {
if (((gPlayerState.field_0x3[1] & 0x80) != 0) || (gPlayerState.field_0x1f[2] == 0)) {
gPlayerState.field_0x1f[2] = 0;
sub_08077E78(this, arg1);
DeletePlayerItem(this, arg1);
}
} else {
gPlayerState.field_0xa = (8 >> arg1) | gPlayerState.field_0xa;
@@ -70,7 +70,7 @@ void sub_08075F38(ItemBehavior* this, u32 arg1) {
}
} else {
gPlayerState.field_0x1f[2] = 0;
sub_08077E78(this, arg1);
DeletePlayerItem(this, arg1);
}
}
@@ -86,5 +86,5 @@ void sub_08075F84(ItemBehavior* this, u32 arg1) {
}
}
gPlayerState.field_0x1f[2] = 0;
sub_08077E78(this, arg1);
DeletePlayerItem(this, arg1);
}
+2 -2
View File
@@ -1,9 +1,9 @@
#include "item.h"
extern Entity* sub_08077BD4(ItemBehavior*);
extern void sub_08077E78(ItemBehavior*, u32);
extern void DeletePlayerItem(ItemBehavior*, u32);
void ItemDebug(ItemBehavior* beh, u32 arg1) {
sub_08077BD4(beh);
sub_08077E78(beh, arg1);
DeletePlayerItem(beh, arg1);
}
+11 -11
View File
@@ -18,12 +18,12 @@ void sub_08076DF4(ItemBehavior* this, u32 arg1) {
this->field_0x5[5] = gPlayerEntity.animationState;
this->field_0x5[4] |= 0x80;
this->field_0x5[4]++;
gPlayerState.field_0x1d = 1;
gPlayerState.gustJarSpeed = 1;
*(u32*)&gPlayerEntity.field_0x74 = 0;
gPlayerState.field_0x1c = 1;
sub_08077BB8(this);
} else {
sub_08077E78(this, arg1);
DeletePlayerItem(this, arg1);
}
}
@@ -31,7 +31,7 @@ void sub_08076E60(ItemBehavior* this, u32 arg1) {
Entity* playerItem;
if ((gPlayerState.field_0x1c & 0xf) == 0) {
sub_08077E78(this, arg1);
DeletePlayerItem(this, arg1);
}
if ((this->field_0x5[9] & 0x80) != 0) {
this->stateID = 2;
@@ -48,18 +48,18 @@ void sub_08076E60(ItemBehavior* this, u32 arg1) {
void sub_08076EC8(ItemBehavior* this, u32 arg1) {
if ((gPlayerState.field_0x1c & 0xf) == 0) {
sub_08077E78(this, arg1);
DeletePlayerItem(this, arg1);
return;
}
if (sub_08077EFC(this)) {
u32 val;
if (this->field_0x5[2] > 0xef) {
gPlayerState.field_0x1d = 3;
gPlayerState.gustJarSpeed = 3;
} else if (++this->field_0x5[2] > 0x77) {
gPlayerState.field_0x1d = 2;
gPlayerState.gustJarSpeed = 2;
} else {
gPlayerState.field_0x1d = 1;
gPlayerState.gustJarSpeed = 1;
}
if (gPlayerEntity.subAction == 0x1b) {
@@ -93,7 +93,7 @@ void sub_08076F64(ItemBehavior* this, u32 arg1) {
if (this->field_0x5[3]) {
this->field_0x5[3] = 0;
this->field_0x5[2] = 0;
gPlayerState.field_0x1d = 1;
gPlayerState.gustJarSpeed = 1;
player = &gPlayerEntity;
*(u32*)&player->field_0x74 = 0;
gPlayerState.field_0x1c = 1;
@@ -137,7 +137,7 @@ void sub_08076F64(ItemBehavior* this, u32 arg1) {
if (this->field_0x5[9] & 1) {
gPlayerState.field_0x1c = 5;
gPlayerEntity.field_0x70.WORD = 0;
if (gPlayerState.field_0x1d) {
if (gPlayerState.gustJarSpeed) {
CreatePlayerItem(0x11, 0, 0, 0);
}
}
@@ -157,7 +157,7 @@ void sub_08076F64(ItemBehavior* this, u32 arg1) {
case 7:
sub_08077DF4(this, 0x514);
gPlayerState.field_0x1c = 3;
gPlayerState.field_0x1d = 0;
gPlayerState.gustJarSpeed = 0;
break;
case 1:
case 2:
@@ -169,7 +169,7 @@ void sub_08076F64(ItemBehavior* this, u32 arg1) {
case0:
gPlayerState.field_0x1c = 0;
gPlayerEntity.field_0x70.WORD = 0;
sub_08077E78(this, arg1);
DeletePlayerItem(this, arg1);
break;
}
}
+2 -2
View File
@@ -62,7 +62,7 @@ void sub_08077640(ItemBehavior* this, u32 arg1) {
UpdateItemAnim(this);
if ((this->field_0x5[9] & 0x80) != 0) {
gPlayerEntity.flags |= ENT_COLLIDE;
sub_08077E78(this, arg1);
DeletePlayerItem(this, arg1);
}
}
@@ -70,6 +70,6 @@ void sub_0807766C(ItemBehavior* this, u32 arg1) {
UpdateItemAnim(this);
if ((this->field_0x5[9] & 0x80) != 0) {
gPlayerEntity.flags |= ENT_COLLIDE;
sub_08077E78(this, arg1);
DeletePlayerItem(this, arg1);
}
}
+4 -4
View File
@@ -27,7 +27,7 @@ void sub_08075A0C(ItemBehavior* this, u32 arg1) {
ForceEquipItem(ITEM_LANTERN_OFF, itemSlot);
gPlayerState.flags &= ~PL_USE_LANTERN;
ForceEquipItem(ITEM_LANTERN_OFF, itemSlot);
sub_08077E78(this, arg1);
DeletePlayerItem(this, arg1);
} else {
this->field_0x5[4] |= 0x80;
sub_08077D38(this, arg1);
@@ -79,7 +79,7 @@ void sub_08075B54(ItemBehavior* this, u32 arg1) {
if (!(((sub_08077F10(this) == 0) && (itemSlot < 2)) || (gPlayerState.jump_status != 0))) {
ForceEquipItem(ITEM_LANTERN_OFF, itemSlot);
gPlayerState.flags &= ~PL_USE_LANTERN;
sub_08077E78(this, arg1);
DeletePlayerItem(this, arg1);
SoundReq(SFX_ITEM_LANTERN_OFF);
} else {
if (((gPlayerState.queued_action != PLAYER_ROLL) && (gPlayerEntity.frameIndex < 0x37)) &&
@@ -100,8 +100,8 @@ void sub_08075B54(ItemBehavior* this, u32 arg1) {
}
sub_08077DF4(this, 0x60c);
bVar1 = (8 >> (arg1));
gPlayerState.field_0xa = bVar1 | gPlayerState.field_0xa;
gPlayerState.keepFacing = bVar1 | gPlayerState.keepFacing;
gPlayerState.field_0xa |= bVar1;
gPlayerState.keepFacing |= bVar1;
}
}
}
+3 -3
View File
@@ -41,7 +41,7 @@ void sub_08077130(ItemBehavior* this, u32 arg1) {
this->stateID = 1;
}
} else {
sub_08077E78(this, arg1);
DeletePlayerItem(this, arg1);
gPlayerState.field_0x3c[1] = 0;
}
}
@@ -51,7 +51,7 @@ void sub_080771C8(ItemBehavior* this, u32 arg1) {
UpdateItemAnim(this);
if ((this->field_0x5[9] & 0x80) != 0) {
sub_08077E78(this, arg1);
DeletePlayerItem(this, arg1);
gPlayerState.field_0x3c[1] = 0;
} else {
if (((this->field_0x5[9] & 0x20) != 0) && (this->field_0x5[3] == 0xff)) {
@@ -94,7 +94,7 @@ void sub_08077448(ItemBehavior* this, u32 arg1) {
UpdateItemAnim(this);
if ((this->field_0x5[9] & 0x80) != 0) {
gPlayerState.field_0x3c[1] = 0;
sub_08077E78(this, arg1);
DeletePlayerItem(this, arg1);
}
}
+2 -2
View File
@@ -15,7 +15,7 @@ void ItemOcarina(ItemBehavior* this, u32 arg1) {
void OcarinaUse(ItemBehavior* this, u32 arg1) {
if (gPlayerState.queued_action == PLAYER_ROLL) {
sub_08077E78(this, arg1);
DeletePlayerItem(this, arg1);
} else {
this->field_0x5[4] |= 0xf;
gPlayerEntity.animationState = 0x04;
@@ -44,7 +44,7 @@ NONMATCH("asm/non_matching/ocarina/OcarinaUpdate.inc", void OcarinaUpdate(ItemBe
gUnk_02034490.unk0 = 0;
CreateBird();
ResetPlayerEventPriority();
sub_08077E78(this, arg1);
DeletePlayerItem(this, arg1);
}
}
END_NONMATCH
+2 -2
View File
@@ -18,10 +18,10 @@ void sub_08076C98(ItemBehavior* beh, u32 arg1) {
void sub_08076CBC(ItemBehavior* beh, u32 arg1) {
if ((beh->field_0x5[9] & 0x80) != 0) {
sub_08077E78(beh, arg1);
DeletePlayerItem(beh, arg1);
} else {
if ((beh->field_0x5[9] & 0x40) != 0) {
CreatePlayerBomb(beh, 0x12);
CreatePlayerItemWithParent(beh, 0x12);
}
UpdateItemAnim(beh);
}
+6 -6
View File
@@ -26,7 +26,7 @@ void ItemPegasusBoots(ItemBehavior* this, u32 arg1) {
if (gPlayerEntity.field_0x7a.HWORD != 0) {
gPlayerState.dash_state = 0;
gPlayerState.field_0xe = 0;
sub_08077E78(this, arg1);
DeletePlayerItem(this, arg1);
} else {
bVar1 = this->field_0x5[2] - 1;
this->field_0x5[2] = bVar1;
@@ -78,7 +78,7 @@ void sub_080768F8(ItemBehavior* this, u32 arg1) {
} else {
gPlayerState.dash_state = 0;
gPlayerState.field_0xe = 0;
sub_08077E78(this, arg1);
DeletePlayerItem(this, arg1);
}
}
@@ -95,7 +95,7 @@ void sub_08076964(ItemBehavior* this, u32 arg1) {
if ((++gPlayerState.dash_state) == 0x1e) {
if ((gPlayerState.flags & PL_FLAGS2) != 0) {
gPlayerState.dash_state = 0;
sub_08077E78(this, arg1);
DeletePlayerItem(this, arg1);
return;
}
gPlayerState.dash_state = 0x40;
@@ -105,7 +105,7 @@ void sub_08076964(ItemBehavior* this, u32 arg1) {
(gPlayerState.skills & SKILL_DASH_ATTACK) != 0) {
gPlayerState.field_0xab = 3;
sub_08077DF4(this, 0x298);
bombEntity = CreatePlayerBomb(this, 0xc);
bombEntity = CreatePlayerItemWithParent(this, 0xc);
if (bombEntity != NULL) {
if (ItemIsSword(gSave.stats.itemButtons[SLOT_A]) != 0) {
uVar3 = gSave.stats.itemButtons[SLOT_A];
@@ -127,7 +127,7 @@ void sub_08076964(ItemBehavior* this, u32 arg1) {
}
}
gPlayerState.dash_state = 0;
sub_08077E78(this, arg1);
DeletePlayerItem(this, arg1);
}
void sub_08076A88(ItemBehavior* this, u32 arg1) {
@@ -170,5 +170,5 @@ void sub_08076A88(ItemBehavior* this, u32 arg1) {
}
}
gPlayerState.dash_state = 0;
sub_08077E78(this, arg1);
DeletePlayerItem(this, arg1);
}
+2 -2
View File
@@ -55,7 +55,7 @@ void ItemRocsCape(ItemBehavior* this, u32 arg1) {
}
}
}
sub_08077E78(this, arg1);
DeletePlayerItem(this, arg1);
}
void sub_08076758(ItemBehavior* this, u32 arg1) {
@@ -84,6 +84,6 @@ void sub_08076758(ItemBehavior* this, u32 arg1) {
}
}
} else {
sub_08077E78(this, arg1);
DeletePlayerItem(this, arg1);
}
}
+2 -2
View File
@@ -30,7 +30,7 @@ void sub_08076D34(ItemBehavior* beh, u32 arg1) {
}
} else {
gPlayerState.field_0x3[0] = 0;
sub_08077E78(beh, arg1);
DeletePlayerItem(beh, arg1);
}
}
@@ -40,6 +40,6 @@ void sub_08076D94(ItemBehavior* beh, u32 arg1) {
UpdateItemAnim(beh);
} else {
gPlayerState.field_0x3[0] = 0;
sub_08077E78(beh, arg1);
DeletePlayerItem(beh, arg1);
}
}
+3 -3
View File
@@ -107,7 +107,7 @@ void sub_080754B8(ItemBehavior* this, u32 arg1) {
if (gPlayerEntity.frameSpriteSettings & 1) {
iVar1 = sub_0807B014();
if (iVar1 && FindEntityByID(PLAYER_ITEM, PLAYER_ITEM_SWORD_BEAM1, 2) == 0) {
CreatePlayerBomb(this, 0xf);
CreatePlayerItemWithParent(this, 0xf);
if (iVar1 == 0xf) {
gPlayerState.field_0xab = 5;
} else {
@@ -228,7 +228,7 @@ void sub_08075738(ItemBehavior* this, u32 arg1) {
} else {
if (((((gPlayerEntity.frameSpriteSettings & 1) != 0) && ((gPlayerState.sword_state & 0x80) == 0)) &&
((gPlayerState.skills & SKILL_FOURSWORD) != 0))) {
Entity* bombEnt = CreatePlayerBomb(this, 0x14);
Entity* bombEnt = CreatePlayerItemWithParent(this, 0x14);
if (bombEnt) {
bombEnt->animationState = (gPlayerEntity.animationState & 6) | 0x80;
}
@@ -313,5 +313,5 @@ void sub_080759B8(ItemBehavior* this, u32 arg1) {
gPlayerState.flags &= ~PL_SWORD_THRUST;
gPlayerState.sword_state = 0;
gPlayerState.item = NULL;
sub_08077E78(this, arg1);
DeletePlayerItem(this, arg1);
}
+2 -2
View File
@@ -9,7 +9,7 @@ void ItemTryPickupObject(ItemBehavior* this, u32 arg1) {
gUnk_0811BDB4[this->stateID](this, arg1);
}
ASM_FUNC("asm/non_matching/itemTryPickupObject/sub_080761C0.inc", void sub_080761C0(ItemBehavior* this, u32 arg1))
ASM_FUNC("asm/non_matching/itemTryPickupObject/ItemPickupCheck.inc", void ItemPickupCheck(ItemBehavior* this, u32 arg1))
void sub_080762C4(ItemBehavior* this, u32 arg1, u8 arg2, u32 arg3) {
this->field_0x18 = arg1;
@@ -61,6 +61,6 @@ void sub_0807660C(ItemBehavior* this, u32 arg1) {
UpdateItemAnim(this);
if ((--this->field_0x5[2] == 0xff) || (gPlayerState.field_0x0[1] == 0)) {
gPlayerState.field_0x0[1] = 0;
sub_08077E78(this, arg1);
DeletePlayerItem(this, arg1);
}
}
+2 -2
View File
@@ -137,8 +137,8 @@ u32 sub_0805B1CC(Manager1A* this) {
u32 re = 0;
if (CheckPlayerProximity(this->unk_20, this->unk_22, this->unk_24, this->unk_26)) {
if ((gPlayerState.flags & PL_DROWNING) && (gPlayerState.flags & PL_BUSY)) {
gPlayerState.flags |= PL_FLAGS8000;
} else if (gPlayerState.flags & PL_FLAGS8000) {
gPlayerState.flags |= PL_PIT_IS_EXIT;
} else if (gPlayerState.flags & PL_PIT_IS_EXIT) {
re = 1;
}
}
+6 -6
View File
@@ -12,7 +12,7 @@ void Manager4_Main(Manager* this) {
gUnk_08107C70[this->action](this);
}
extern void sub_080805F8(void);
extern void UpdateIsDiggingCave(void);
extern DiggingCaveEntrance* sub_08057AA8(DiggingCaveEntrance*, int);
@@ -21,8 +21,8 @@ void sub_0805786C(Manager* this) {
u8 room;
u8 area;
u16 uVar = 0x81 << 7;
sub_080805F8();
if (gUnk_03004030.unk_08 != 0) {
UpdateIsDiggingCave();
if (gUnk_03004030.isDiggingCave != 0) {
if (gUnk_03004030.unk_00 == 0) {
gUnk_03004030.unk_0a = 0xFF;
room = gRoomControls.room;
@@ -66,7 +66,7 @@ void sub_08057A18(Manager*, DiggingCaveEntrance*);
u32 sub_0805795C(Manager* this, DiggingCaveEntrance* entr) {
u16 offsetX, offsetY, offsetX2, offsetY2;
u32 tmp, tmp2;
if (gUnk_03004030.unk_08) {
if (gUnk_03004030.isDiggingCave) {
offsetX = gPlayerEntity.x.HALF.HI - gRoomControls.origin_x;
offsetY = gPlayerEntity.y.HALF.HI - gRoomControls.origin_y;
offsetX2 = (entr->unk_00 & 0x3F) * 16 + 8;
@@ -105,10 +105,10 @@ void sub_08057A18(Manager* this, DiggingCaveEntrance* entr) {
gUnk_03004030.unk_06 = gPlayerEntity.y.HALF.HI - gRoomControls.origin_y - ((entr->unk_00 & 0xFC0) >> 2);
#ifndef EU
tmp = gUnk_03004030.unk_08;
tmp = gUnk_03004030.isDiggingCave;
if (!tmp) {
if ((entr->target_room | 0x80) != gUnk_03004030.unk_0b) {
gUnk_02034480.unk_00 = gUnk_03004030.unk_08;
gUnk_02034480.unk_00 = gUnk_03004030.isDiggingCave;
}
gUnk_03004030.unk_0b = entr->target_room | 0x80;
}
+15 -18
View File
@@ -15,16 +15,6 @@
#include "enemy.h"
#include "functions.h"
typedef struct {
u8 filler0[0x1];
u8 unk1;
u8 charColor;
u8 bgColor;
u16 unk4;
u16 unk6;
u8* unk8;
} struct_02036540;
extern u32 sub_08000E44(u32);
extern void sub_080A3B74(void);
extern s32 sub_080A3B48(void);
@@ -32,9 +22,9 @@ extern void sub_0805ECEC(u32, u32, u32, u32);
extern void sub_0801C2F0(u32, u32);
extern void sub_0801E6C8(u32);
extern void sub_0801E798(u32);
extern struct_02036540* sub_0805F2C8(void);
extern void sub_0805F300(struct_02036540*);
extern u32 sub_0805F76C(u8*, struct_02036540*);
extern WStruct* sub_0805F2C8(void);
extern void sub_0805F300(WStruct*);
extern u32 sub_0805F76C(u8*, WStruct*);
typedef struct {
void* sourceAddress;
@@ -55,7 +45,7 @@ extern const u8 gGlobalGfxAndPalettes[];
extern u8 gTextGfxBuffer[];
extern u8 gUnk_02002AC0[];
u32 sub_080A44E0(struct_02036540*, u8*, u32);
u32 sub_080A44E0(WStruct*, u8*, u32);
u32 sub_080A4418(u32, u32);
u32 sub_080A43DC(u32);
u32 sub_080A43A8(u32);
@@ -74,13 +64,20 @@ Subtask KinstoneMenu_Type2;
Subtask KinstoneMenu_Type3;
Subtask KinstoneMenu_Type4;
Subtask KinstoneMenu_Type5;
ASM_FUNC("asm/non_matching/menu/kinstone_menu/sub_080A3B48.inc", s32 sub_080A3B48(void))
void sub_080A3B74(void) {
gKinstoneMenu.unk2f = 0;
}
void Subtask_KinstoneMenu(void) {
static Subtask* const kinstoneMenuTypes[] = {
KinstoneMenu_Type0, KinstoneMenu_Type1, KinstoneMenu_Type2,
KinstoneMenu_Type3, KinstoneMenu_Type4, KinstoneMenu_Type5,
};
#if !(defined(DEMO_USA) || defined(DEMO_JP))
gRoomTransition.player_status.field_0x24[8] = 2;
gRoomTransition.entity_update_type = 2;
FlushSprites();
kinstoneMenuTypes[gMenu.menuType]();
sub_080A3B74();
@@ -90,7 +87,7 @@ void Subtask_KinstoneMenu(void) {
UpdateEntities();
DrawEntities();
CopyOAM();
gRoomTransition.player_status.field_0x24[8] = 0;
gRoomTransition.entity_update_type = 0;
#endif
}
@@ -594,7 +591,7 @@ void KinstoneMenu_080A4468(void) {
}
u32 KinstoneMenu_080A4494(void) {
struct_02036540* psVar1;
WStruct* psVar1;
u8* r1;
u32 ret;
@@ -617,7 +614,7 @@ u32 KinstoneMenu_080A4494(void) {
return ret;
}
u32 sub_080A44E0(struct_02036540* param_1, u8* param_2, u32 param_3) {
u32 sub_080A44E0(WStruct* param_1, u8* param_2, u32 param_3) {
u32 uVar1;
u32 size;
+12 -12
View File
@@ -31,17 +31,17 @@ enum {
};
extern void WriteBit(u32*, u32);
extern void sub_0805EF40(Token* tok, const u8*);
extern bool32 sub_0805EF40(Token* tok, const u8*);
extern void RecoverUI(u32 bottomPt, u32 topPt);
extern void RefreshUI(void);
extern void sub_0805F918(u32, u32, u32);
extern void sub_0805F918(u32, u32, void*);
extern u32 DecToHex(u32, u8*, u32);
u32 sub_08056FEC(u32, u8*);
u32 GetCharacter(Token* tok);
extern void sub_0805EEB4(Token* tok, u32 textIdx);
u16 sub_0805F7DC(u32, u8*);
u32 GetFontStrWith(u8*, u32);
u32 sub_0805F7DC(u32, WStruct*);
u32 GetFontStrWith(Token*, u32);
static void StatusUpdate(u32 status);
@@ -270,7 +270,7 @@ END_NONMATCH
if (gTextRender.renderStatus == RENDER_INIT) {
gTextRender.renderStatus = RENDER_UPDATE;
gTextRender._98.bytes.b1 = 1;
sub_08056F88(gTextRender.message.unk3, gTextRender._50.unk3);
sub_08056F88(gTextRender.message.unk3, gTextRender._50.bgColor);
SoundReq(SFX_TEXTBOX_OPEN);
}
@@ -315,7 +315,7 @@ static u32 MsgUpdate(void) {
}
static void TextDispInit(TextRender* this) {
if ((gTextRender.curToken.flags & 1) == 0) {
if (gTextRender.curToken.unk00 == 0) {
if (gTextRender._98.bytes.b1 == 0) {
StatusUpdate(MSG_DIE);
}
@@ -398,7 +398,7 @@ NONMATCH("asm/non_matching/textbox/RunTextCommand.inc", /*static*/ u16 RunTextCo
StatusUpdate(MSG_CLOSE);
break;
case 4:
this->_50.unk6 += (this->_50.unk4 - this->_50.unk6 - GetFontStrWith(&this->curToken.flags, 0)) / 2;
this->_50.unk6 += (this->_50.unk4 - this->_50.unk6 - GetFontStrWith(&this->curToken, 0)) / 2;
break;
case 5:
gMessage.unk = this->curToken.param;
@@ -427,7 +427,7 @@ NONMATCH("asm/non_matching/textbox/RunTextCommand.inc", /*static*/ u16 RunTextCo
break;
case 9:
gTextRender.message.unk3 = this->curToken.param;
sub_08056F88(this->curToken.param, this->_50.unk3);
sub_08056F88(this->curToken.param, this->_50.bgColor);
break;
case 10:
this->message.textWindowPosY = this->curToken.param;
@@ -488,14 +488,14 @@ NONMATCH("asm/non_matching/textbox/RunTextCommand.inc", /*static*/ u16 RunTextCo
PaletteChange(this, palette);
}
}
return sub_0805F7DC(chr, &this->_50.unk0);
return sub_0805F7DC(chr, &this->_50);
}
END_NONMATCH
/*static*/ void PaletteChange(TextRender* this, u32 id) {
u32 temp = id % 8;
this->_8f = temp;
this->_50.unk2 = temp;
this->_50.charColor = temp;
}
const u8 gUnk_08107C0F[] = { 0x8, 0x1e, 0x4, 0x12, 0x0 };
@@ -813,12 +813,12 @@ void sub_08056F88(u32 unk_1, u32 unk_2) {
uVar1 = unk_1 << 4 | unk_2;
if (gTextRender._9c != uVar1) {
gTextRender._9c = uVar1;
sub_0805F918(unk_1, unk_2, 0x0600CF60);
sub_0805F918(unk_1, unk_2, (void*)0x0600CF60);
}
}
static void sub_08056FBC(TextRender* ctb) {
sub_08056FEC(ctb->message.field_0x10, &ctb->_66[0x2]);
sub_08056FEC(ctb->message.rupees, &ctb->_66[0x2]);
sub_08056FEC(ctb->message.field_0x14, &ctb->_66[0xa]);
sub_08056FEC(ctb->message.field_0x18, &ctb->_77[0x1]);
sub_08056FEC(ctb->message.field_0x1c, &ctb->_77[0x9]);

Some files were not shown because too many files have changed in this diff Show More