clang-format and newlines

This commit is contained in:
theo3
2020-11-13 23:27:50 -08:00
parent 8fd7481395
commit 3079c016b4
236 changed files with 4010 additions and 4415 deletions
+4 -5
View File
@@ -4,8 +4,7 @@
extern u32 CheckIsDungeon();
void Archway(Entity *this)
{
void Archway(Entity* this) {
u32 v1;
u32 v2;
u32 v3;
@@ -20,8 +19,8 @@ void Archway(Entity *this)
this->collisionLayer = 2;
UpdateSpriteForCollisionLayer(this);
v3 = CheckIsDungeon();
if (v3 != 0) {
this->spritePriority.b0 = (this->spritePriority.b0 & 0xf8) | 1;
if (v3 != 0) {
this->spritePriority.b0 = (this->spritePriority.b0 & 0xf8) | 1;
}
}
}
}
+1 -2
View File
@@ -30,8 +30,7 @@ void sub_0808F658(Entity* this) {
void sub_0808F6E0(Entity* this) {
sub_0806F69C(this);
if ((s16)this->x.HALF.HI < (s16)this->field_0x78.HWORD ||
(s16)this->x.HALF.HI > (s16)this->field_0x7a.HWORD)
if ((s16)this->x.HALF.HI < (s16)this->field_0x78.HWORD || (s16)this->x.HALF.HI > (s16)this->field_0x7a.HWORD)
this->action = 2;
}
+1 -1
View File
@@ -108,4 +108,4 @@ void sub_08098E88(Entity* this) {
PositionRelative(this, ent2, 0, -0x20000);
ent2->spriteOffsetY = 0x10;
}
}
}
+1 -1
View File
@@ -141,4 +141,4 @@ void sub_0809D178(Entity* this) {
} else {
GetNextFrame(this);
}
}
}
+20 -15
View File
@@ -19,8 +19,8 @@ void sub_08081AE0(Entity* this) {
if (this->cutsceneBeh.HWORD != 0) {
this->collisionLayer = this->cutsceneBeh.HWORD;
}
this->field_0x74.HWORD = (((this->x.HALF.HI - gRoomControls.roomOriginX)>>4) & 0x3F) |
((((this->y.HALF.HI - gRoomControls.roomOriginY)>>4) & 0x3F) << 6);
this->field_0x74.HWORD = (((this->x.HALF.HI - gRoomControls.roomOriginX) >> 4) & 0x3F) |
((((this->y.HALF.HI - gRoomControls.roomOriginY) >> 4) & 0x3F) << 6);
this->field_0x70.HALF.HI = GetTileType(this->field_0x74.HWORD, this->collisionLayer);
if (this->entityType.form == 0 && CheckFlags(this->field_0x86.HWORD)) {
this->action = 5;
@@ -36,7 +36,7 @@ void sub_08081AE0(Entity* this) {
void sub_08081B84(Entity* this) {
if (sub_08081E3C(this)) {
this->action=2;
this->action = 2;
this->field_0x70.HALF.HI = GetTileType(this->field_0x74.HWORD, this->collisionLayer);
}
}
@@ -167,7 +167,7 @@ Entity* sub_08081D74(Entity* this) {
}
}
}
this->attachedEntity=ent;
this->attachedEntity = ent;
return ent;
}
@@ -190,7 +190,8 @@ u32 sub_08081E3C(Entity* this) {
tmp2 = GetTileType(this->field_0x74.HWORD, this->collisionLayer);
tmp1 = gUnk_0811EE50;
do {
if (*tmp1 == tmp2) return 1;
if (*tmp1 == tmp2)
return 1;
} while (*++tmp1);
return 0;
}
@@ -203,10 +204,10 @@ extern u16 gMapDataTopSpecial[0x2000];
void sub_08081E6C(Entity* this) {
u32 r4;
u16 *tmp, *r1;
u8 *tmp2;
u8* tmp2;
u32 r6 = this->field_0x74.HWORD;
u32 r5 = this->collisionLayer;
u32 tile = GetTileType(r6,r5);
u32 tile = GetTileType(r6, r5);
if (tile < 0x4000)
return;
r1 = GetLayerByIndex(r5);
@@ -215,11 +216,11 @@ void sub_08081E6C(Entity* this) {
r1 += 0x3002 + r4;
tmp = tmp + (*r1 << 2);
tmp2 = (r5 == 2 ? gMapDataTopSpecial : (u8*)&gUnk_02019EE0);
tmp2 += (((0x3f & r6)<<1)+((0xfc0 & r6)<<2))<<1;
tmp2 += (((0x3f & r6) << 1) + ((0xfc0 & r6) << 2)) << 1;
if (sub_08081F00((u32*)tmp2, (u32*)tmp))
return;
SetTileType(r4, r6, r5);
SetTile(tile,r6,r5);
SetTile(tile, r6, r5);
}
#else
NAKED
@@ -229,8 +230,10 @@ void sub_08081E6C(Entity* this) {
#endif
u32 sub_08081F00(u32* unk1, u32* unk2) {
if (*unk1 != *unk2) return 0;
if (unk1[0x40] != unk2[1]) return 0;
if (*unk1 != *unk2)
return 0;
if (unk1[0x40] != unk2[1])
return 0;
return 1;
}
@@ -251,9 +254,10 @@ void sub_08081F24(Entity* this) {
u32 sub_08081F7C(Entity* this, u32 r7) {
u16 tmp;
if (this->actionDelay == 0) return 1;
if (this->actionDelay == 0)
return 1;
if (--this->actionDelay > 6) {
if(this->attachedEntity)
if (this->attachedEntity)
this->attachedEntity->spriteOffsetY = 0xfc;
} else {
if (this->actionDelay == 6) {
@@ -275,12 +279,13 @@ extern void sub_080044AE(Entity*, u32, u32);
void sub_08081FF8(Entity* this) {
u32 direction;
u32 i;
if (this->attachedEntity != &gPlayerEntity) return;
if (this->attachedEntity != &gPlayerEntity)
return;
direction = GetFacingDirection(this->attachedEntity, this);
sub_080044AE(this->attachedEntity, 0x200, direction);
for (i = 0; i < 3; i++) {
if (gUnk_03004040[i]) {
sub_080044AE(gUnk_03004040[i],0x200, direction);
sub_080044AE(gUnk_03004040[i], 0x200, direction);
}
}
}
+10 -13
View File
@@ -11,25 +11,22 @@ extern void (*const gUnk_0811F808[])(Entity*);
extern void (*const gUnk_0811F818[])(Entity*);
extern u32 gUnk_0811F8B0;
void ChestSpawner(Entity* this)
{
gUnk_0811F7E8[this->entityType.form](this);
void ChestSpawner(Entity* this) {
gUnk_0811F7E8[this->entityType.form](this);
}
void sub_08083DF0(Entity* this) {
gUnk_0811F808[this->action](this);
}
void sub_08083E08(Entity *this)
{
gUnk_0811F818[this->action](this);
void sub_08083E08(Entity* this) {
gUnk_0811F818[this->action](this);
}
void sub_08083E20(Entity *this)
{
this->action = 3;
this->spriteSettings.b.draw = 1;
this->spriteRendering.alphaBlend = 0;
sub_080842D8(this);
sub_08078828(this);
void sub_08083E20(Entity* this) {
this->action = 3;
this->spriteSettings.b.draw = 1;
this->spriteRendering.alphaBlend = 0;
sub_080842D8(this);
sub_08078828(this);
}
+51 -63
View File
@@ -11,76 +11,64 @@ extern void sub_0809EE24(Entity*);
extern void (*const gUnk_081243D4[])(Entity*);
void Fan(Entity *this)
{
gUnk_081243D4[this->action](this);
void Fan(Entity* this) {
gUnk_081243D4[this->action](this);
}
void sub_0809ED30(Entity *this)
{
this->direction = (this->entityType.form ^ 2) << 3;
sub_0809EE34(this);
sub_0809EFB0(this);
InitializeAnimation(this, this->entityType.form);
}
void sub_0809ED54(Entity *this)
{
u16 uVar1;
u32 iVar2;
if (((this->cutsceneBeh.HWORD == 0) || CheckFlags(this->cutsceneBeh.HWORD)) &&
((this->entityType.parameter != 1 ||
(--this->field_0x74.HWORD == 0)))) {
sub_0809EE08(this);
}
}
void sub_0809ED88(Entity *this)
{
sub_0809F08C();
sub_0809EE44(this);
if (this->field_0x86.HWORD != 0) {
if (this->cutsceneBeh.HWORD == this->field_0x86.HWORD) {
if (CheckFlags(this->cutsceneBeh.HWORD)) {
return;
}
}
else if (!CheckFlags(this->cutsceneBeh.HWORD)) {
return;
}
sub_0809EE24(this);
}
else if (((this->entityType).parameter == 1) &&
(--this->field_0x74.HWORD == 0)) {
sub_0809EE24(this);
}
}
void sub_0809EDE4(Entity *this)
{
sub_0809F08C();
sub_0809EE44(this);
if (this->frames.b.f3) {
void sub_0809ED30(Entity* this) {
this->direction = (this->entityType.form ^ 2) << 3;
sub_0809EE34(this);
}
sub_0809EFB0(this);
InitializeAnimation(this, this->entityType.form);
}
void sub_0809EE08(Entity *this)
{
this->action = 2;
this->field_0x74.HWORD = *((u8 *)&this->field_0x7c + 3) << 2;
InitializeAnimation(this, this->entityType.form);
void sub_0809ED54(Entity* this) {
u16 uVar1;
u32 iVar2;
if (((this->cutsceneBeh.HWORD == 0) || CheckFlags(this->cutsceneBeh.HWORD)) &&
((this->entityType.parameter != 1 || (--this->field_0x74.HWORD == 0)))) {
sub_0809EE08(this);
}
}
void sub_0809EE24(Entity *this)
{
this->action = 3;
InitializeAnimation(this, this->entityType.form + 4);
void sub_0809ED88(Entity* this) {
sub_0809F08C();
sub_0809EE44(this);
if (this->field_0x86.HWORD != 0) {
if (this->cutsceneBeh.HWORD == this->field_0x86.HWORD) {
if (CheckFlags(this->cutsceneBeh.HWORD)) {
return;
}
} else if (!CheckFlags(this->cutsceneBeh.HWORD)) {
return;
}
sub_0809EE24(this);
} else if (((this->entityType).parameter == 1) && (--this->field_0x74.HWORD == 0)) {
sub_0809EE24(this);
}
}
void sub_0809EE34(Entity *this)
{
this->action = 1;
this->field_0x74.HWORD = this->actionDelay << 2;
void sub_0809EDE4(Entity* this) {
sub_0809F08C();
sub_0809EE44(this);
if (this->frames.b.f3) {
sub_0809EE34(this);
}
}
void sub_0809EE08(Entity* this) {
this->action = 2;
this->field_0x74.HWORD = *((u8*)&this->field_0x7c + 3) << 2;
InitializeAnimation(this, this->entityType.form);
}
void sub_0809EE24(Entity* this) {
this->action = 3;
InitializeAnimation(this, this->entityType.form + 4);
}
void sub_0809EE34(Entity* this) {
this->action = 1;
this->field_0x74.HWORD = this->actionDelay << 2;
}
+2 -2
View File
@@ -5,9 +5,9 @@
void FloatingBlock(Entity* this) {
if (this->action == 0) {
this->action = 1;
this->frameIndex=this->entityType.form;
this->frameIndex = this->entityType.form;
this->spritePriority.b0 = 0xe;
this->collisionLayer = 1;
UpdateSpriteForCollisionLayer(this);
}
}
}
+1 -1
View File
@@ -41,4 +41,4 @@ void sub_08092000(Entity* this) {
this->spriteSettings.b.draw = TRUE;
SetFlag(this->field_0x86.HWORD);
}
}
}
Executable → Regular
+12 -15
View File
@@ -11,7 +11,7 @@ typedef struct {
/*0x05*/ u8 unk5;
/*0x06*/ u8 unk6;
/*0x07*/ u8 unk7;
/*0x08*/ u8 *unk8;
/*0x08*/ u8* unk8;
} unk_DoorProperty;
typedef struct {
@@ -42,7 +42,7 @@ void sub_080866D8(Entity* this) {
if (this->action == 0) {
this->action = 1;
*((u32 *)(&this->field_0x68)) = 0;
*((u32*)(&this->field_0x68)) = 0;
this->field_0x6c.HALF.LO = this->actionDelay;
sub_0805E3A0(this, 6);
}
@@ -50,8 +50,7 @@ void sub_080866D8(Entity* this) {
prop = GetCurrentRoomProperty(this->field_0x6c.HALF.LO);
for (i = 0; prop->unk0 != 0xFFFF && i < 32; prop++, i++) {
int mask = 1 << i;
if ((*((u32 *)(&this->field_0x68)) & mask) == 0 &&
sub_080867CC(prop->unk5) &&
if ((*((u32*)(&this->field_0x68)) & mask) == 0 && sub_080867CC(prop->unk5) &&
sub_080562CC(prop->unk0, prop->unk2, 32, 32)) {
entity = CreateObject(0x19, prop->unk7, prop->unk6);
if (entity) {
@@ -64,9 +63,9 @@ void sub_080866D8(Entity* this) {
entity->collisionLayer = prop->unk4;
entity->previousActionFlag = prop->unk5;
UpdateSpriteForCollisionLayer(entity);
*((u32 *)(&this->field_0x68)) |= mask;
*((u32*)(&this->field_0x68)) |= mask;
if (prop->unk8) {
*((u32 **)(&entity->cutsceneBeh)) = StartCutscene(entity, prop->unk8);
*((u32**)(&entity->cutsceneBeh)) = StartCutscene(entity, prop->unk8);
}
}
}
@@ -85,7 +84,7 @@ static bool32 sub_080867CC(u32 arg0) {
void sub_080867E4(Entity* this) {
if (!sub_080562CC(this->field_0x68.HWORD, this->field_0x6a.HWORD, 32, 32)) {
*((u32 *)(&this->parent->field_0x68)) = *((u32 *)(&this->parent->field_0x68)) & ~(1 << this->field_0x6c.HALF.LO);
*((u32*)(&this->parent->field_0x68)) = *((u32*)(&this->parent->field_0x68)) & ~(1 << this->field_0x6c.HALF.LO);
DeleteThisEntity();
}
sub_0808681C(this);
@@ -118,8 +117,8 @@ static void sub_0808681C(Entity* this) {
}
if (this->flags & 0x2) {
ExecuteScriptCommandSet(this, *(u32 **)&this->cutsceneBeh);
sub_080868EC(this, *(void **)&this->cutsceneBeh);
ExecuteScriptCommandSet(this, *(u32**)&this->cutsceneBeh);
sub_080868EC(this, *(void**)&this->cutsceneBeh);
}
}
@@ -130,8 +129,8 @@ void sub_080868B0(Entity* this) {
this->boundingBox = &gUnk_081206AC;
this->actionDelay = 8;
}
ExecuteScriptCommandSet(this, *(u32 **)&this->cutsceneBeh);
sub_080868EC(this, *(void **)&this->cutsceneBeh);
ExecuteScriptCommandSet(this, *(u32**)&this->cutsceneBeh);
sub_080868EC(this, *(void**)&this->cutsceneBeh);
}
static void sub_080868EC(Entity* entity, unk_80868EC* arg1) {
@@ -165,10 +164,8 @@ void sub_0808692C(Entity* this) {
static u8 sub_08086954(Entity* this) {
if (sub_0800445C(this)) {
if (sub_0806ED9C(this, 6, 20) >= 0 &&
gPlayerEntity.animationState == 0 &&
(u16)gPlayerState.field_0x90.HALF.LO == 0x400 &&
gPlayerState.jumpStatus == 0) {
if (sub_0806ED9C(this, 6, 20) >= 0 && gPlayerEntity.animationState == 0 &&
(u16)gPlayerState.field_0x90.HALF.LO == 0x400 && gPlayerState.jumpStatus == 0) {
this->actionDelay--;
}
} else {
Executable → Regular
+1 -3
View File
@@ -268,9 +268,7 @@ void sub_080812A8(Entity* this) {
void sub_080812E8(Entity* this) {
PlayerState* playerState = &gPlayerState;
if ((playerState->swimState & 0x80) &&
!(playerState->flags.all & 0x80) &&
sub_080177A0(this, &gPlayerEntity)) {
if ((playerState->swimState & 0x80) && !(playerState->flags.all & 0x80) && sub_080177A0(this, &gPlayerEntity)) {
sub_080810FC(this);
}
}
+36 -41
View File
@@ -11,54 +11,49 @@ extern void (*const gUnk_08124950[])(Entity*);
extern u8 gUnk_08124960;
extern u8 gUnk_0812497A;
void JailBars(Entity *this)
{
void JailBars(Entity* this) {
gUnk_08124950[this->action](this);
}
void sub_080A08C4(Entity *this)
{
if (CheckFlags(this->field_0x86.HWORD) == 0) {
this->action = 1;
sub_080A0960(this, 0);
}
else {
this->action = 3;
InitializeAnimation(this,1);
sub_080A0960(this, 1);
}
this->spriteSettings.b.draw = 3; // ???
this->collisionLayer = 1;
UpdateSpriteForCollisionLayer(this);
void sub_080A08C4(Entity* this) {
if (CheckFlags(this->field_0x86.HWORD) == 0) {
this->action = 1;
sub_080A0960(this, 0);
} else {
this->action = 3;
InitializeAnimation(this, 1);
sub_080A0960(this, 1);
}
this->spriteSettings.b.draw = 3; // ???
this->collisionLayer = 1;
UpdateSpriteForCollisionLayer(this);
}
void sub_080A0910(Entity *this)
{
if (CheckFlags(this->field_0x86.HWORD) != 0) {
this->action = 2;
sub_080A0960(this, 1);
PlaySFX(0x10b);
}
void sub_080A0910(Entity* this) {
if (CheckFlags(this->field_0x86.HWORD) != 0) {
this->action = 2;
sub_080A0960(this, 1);
PlaySFX(0x10b);
}
}
void sub_080A0938(Entity *this)
{
GetNextFrame(this);
if ((this->frames.b.f3) != 0) {
this->action = 3;
InitializeAnimation(this, 1);
}
void sub_080A0938(Entity* this) {
GetNextFrame(this);
if ((this->frames.b.f3) != 0) {
this->action = 3;
InitializeAnimation(this, 1);
}
}
void nullsub_127(Entity* this) {}
void sub_080A0960(Entity *this, u32 arg1)
{
u8 *puVar1;
puVar1 = &gUnk_08124960;
if (arg1 == 1) {
puVar1 = &gUnk_0812497A;
}
sub_0801AF18(puVar1, COORD_TO_TILE(this), 1);
void nullsub_127(Entity* this) {
}
void sub_080A0960(Entity* this, u32 arg1) {
u8* puVar1;
puVar1 = &gUnk_08124960;
if (arg1 == 1) {
puVar1 = &gUnk_0812497A;
}
sub_0801AF18(puVar1, COORD_TO_TILE(this), 1);
}
+2 -1
View File
@@ -142,4 +142,5 @@ void sub_0809EC08(Entity* this) {
}
}
void nullsub_126(Entity* this) { }
void nullsub_126(Entity* this) {
}
+25 -28
View File
@@ -8,35 +8,33 @@ extern void sub_080A2CC0(Entity*, Entity**, u16*);
extern u16 gUnk_08123318[];
void LilypadSmall(Entity *this)
{
u32 rand;
u16 *psVar4;
if (this->action == 0) {
this->action = 1;
this->actionDelay = 0x5a;
rand = Random();
this->field_0xf = rand;
this->frameIndex = (rand >> 0x10) & 3;
this->spriteSettings.b.draw = TRUE;
this->spritePriority.b0 = 7;
this->attachedEntity = GetCurrentRoomProperty(this->entityType.parameter);
sub_080A2CC0(this, &this->attachedEntity, &this->field_0x70.HALF.LO);
}
sub_080A2BE4(this, sub_08097ADC(this));
sub_08097B24(this);
psVar4 = (u16 *)&this->field_0x70;
if (--*psVar4 == 0) {
sub_080A2CC0(this, &this->attachedEntity, psVar4);
}
void LilypadSmall(Entity* this) {
u32 rand;
u16* psVar4;
if (this->action == 0) {
this->action = 1;
this->actionDelay = 0x5a;
rand = Random();
this->field_0xf = rand;
this->frameIndex = (rand >> 0x10) & 3;
this->spriteSettings.b.draw = TRUE;
this->spritePriority.b0 = 7;
this->attachedEntity = GetCurrentRoomProperty(this->entityType.parameter);
sub_080A2CC0(this, &this->attachedEntity, &this->field_0x70.HALF.LO);
}
sub_080A2BE4(this, sub_08097ADC(this));
sub_08097B24(this);
psVar4 = (u16*)&this->field_0x70;
if (--*psVar4 == 0) {
sub_080A2CC0(this, &this->attachedEntity, psVar4);
}
}
u32 sub_08097ADC(Entity *this)
{
u32 sub_08097ADC(Entity* this) {
if ((gPlayerState.flags.all & 0x80) == 0) {
return 0;
} else if (sub_080041A0(this,&gPlayerEntity,8,8) == 0) {
} else if (sub_080041A0(this, &gPlayerEntity, 8, 8) == 0) {
return 0;
} else if (sub_08079F8C() == 0) {
return 0;
@@ -50,11 +48,10 @@ u32 sub_08097ADC(Entity *this)
}
}
void sub_08097B24(Entity *this)
{
void sub_08097B24(Entity* this) {
u32 temp;
u32 temp2;
u16 *temp3;
u16* temp3;
if (--this->actionDelay == 0) {
this->actionDelay = 0x5a;
+16 -19
View File
@@ -6,7 +6,7 @@
extern Entity gPlayerEntity;
extern u16 gScreenTransition[];
extern void (*MaskActionFuncs[])(Entity *);
extern void (*MaskActionFuncs[])(Entity*);
extern void DeleteThisEntity();
@@ -21,15 +21,14 @@ extern s16 sub_080001DA(u16, u32);
extern u16 sub_080002E0(u16, u32);
extern void EnqueueSFX(u32);
extern void sub_080044EC(Entity *, u16);
extern void sub_0805457C(Entity *, s32);
extern void sub_080044EC(Entity*, u16);
extern void sub_0805457C(Entity*, s32);
void Mask(Entity *this) {
void Mask(Entity* this) {
MaskActionFuncs[this->action](this);
}
void sub_080929A4(Entity *this) {
void sub_080929A4(Entity* this) {
if (this->entityType.parameter & 0xC0) {
if (CheckFlags(this->field_0x86.HWORD)) {
s32 field_0x0a;
@@ -37,7 +36,7 @@ void sub_080929A4(Entity *this) {
switch (this->entityType.parameter & 0xC0) {
case 0x40:
field_0x0a = gScreenTransition[0x5];
switch (field_0x0a) {
case 0x44D ... 0x44F:
case 0x182:
@@ -51,7 +50,7 @@ void sub_080929A4(Entity *this) {
DeleteThisEntity();
break;
}
switchEnd:
switchEnd:
}
}
@@ -59,7 +58,7 @@ void sub_080929A4(Entity *this) {
this->field_0x20 = 0x18000;
this->field_0x78.HWORD = ((Random() & 7) << 10) | 0x2000;
this->field_0xf = this->actionDelay >> 1;
this->actionDelay = 0;
@@ -74,7 +73,7 @@ void sub_080929A4(Entity *this) {
}
// Probably related to knocking it down
void sub_08092A94(Entity *this) {
void sub_08092A94(Entity* this) {
// Check for the first frame of bonking animation
if (gPlayerEntity.action != 6) {
return;
@@ -89,13 +88,14 @@ void sub_08092A94(Entity *this) {
return;
}
if (this->x.HALF.HI - gPlayerEntity.x.HALF.HI >= this->field_0xf || this->x.HALF.HI - gPlayerEntity.x.HALF.HI <= -this->field_0xf) {
if (this->x.HALF.HI - gPlayerEntity.x.HALF.HI >= this->field_0xf ||
this->x.HALF.HI - gPlayerEntity.x.HALF.HI <= -this->field_0xf) {
return;
}
// Presumably, make the mask fall
SetTile((u16)this->field_0x7c.HALF.LO, this->field_0x7c.HALF.HI, 1);
sub_08000148(this->field_0x7a.HWORD, this->field_0x7c.HALF.HI, 1);
this->action = 2;
@@ -107,26 +107,23 @@ void sub_08092A94(Entity *this) {
}
// Probably falling down
void sub_08092B0C(Entity *this) {
void sub_08092B0C(Entity* this) {
if (this->actionDelay == 1) {
this->action = 3;
this->actionDelay = 0;
switch (this->entityType.parameter & 0xC0)
{
switch (this->entityType.parameter & 0xC0) {
case 0x80:
EnqueueSFX(0x72);
case 0x40:
SetFlag(this->field_0x86.HWORD);
break;
}
CreateFx(this, 5, 0);
sub_0805457C(this, 3);
}
else {
} else {
sub_080044EC(this, this->field_0x78.HWORD);
if (this->height.HALF.HI == 0) {
@@ -135,6 +132,6 @@ void sub_08092B0C(Entity *this) {
}
}
void Mask_Delete(Entity *this) {
void Mask_Delete(Entity* this) {
DeleteThisEntity();
}
+75 -82
View File
@@ -20,96 +20,89 @@ void MetalDoor(Entity* this) {
gUnk_0812493C[this->action](this);
}
void sub_080A0684(Entity *this)
{
if ((this->cutsceneBeh.HWORD != 0xffff) && CheckFlags(this->cutsceneBeh.HWORD)) {
DeleteThisEntity();
}
this->action = 1;
this->nonPlanarMovement = 0x300;
this->spriteSettings.b.draw = 0;
this->frameIndex = 0;
this->spriteSettings.b.flipY = 1;
this->boundingBox = &gUnk_080FD180;
this->spritePriority.b0 = 5;
this->field_0x70.HALF.LO = this->x.HALF.HI;
this->field_0x70.HALF.HI = this->y.HALF.HI;
this->field_0x74.HWORD = COORD_TO_TILE(this);
}
void sub_080A0718(Entity *this)
{
if (sub_08083734(this, 2) != 0) {
this->action = 2;
this->actionDelay = 0xc;
this->spriteSettings.b.draw = TRUE;
this->direction = 0;
this->y.HALF.HI += 0x24;
sub_080A080C(this);
}
}
void sub_080A074C(Entity *this)
{
u8 bVar1;
Entity *ent;
sub_0806F69C(this);
if (--this->actionDelay == 0) {
this->action = 3;
this->height.HALF.HI = 0;
this->x.HALF.HI = this->field_0x70.HALF.LO;
this->y.HALF.HI = this->field_0x70.HALF.HI;
ent = CreateFx(this, 0x11, 0x40);
if (ent != NULL) {
ent->x.HALF.HI += 0xc;
ent->y.HALF.HI -= 0xc;
void sub_080A0684(Entity* this) {
if ((this->cutsceneBeh.HWORD != 0xffff) && CheckFlags(this->cutsceneBeh.HWORD)) {
DeleteThisEntity();
}
ent = CreateFx(this, 0x11, 0x40);
if (ent != NULL) {
ent->x.HALF.HI -= 0xc;
ent->y.HALF.HI -= 0xc;
this->action = 1;
this->nonPlanarMovement = 0x300;
this->spriteSettings.b.draw = 0;
this->frameIndex = 0;
this->spriteSettings.b.flipY = 1;
this->boundingBox = &gUnk_080FD180;
this->spritePriority.b0 = 5;
this->field_0x70.HALF.LO = this->x.HALF.HI;
this->field_0x70.HALF.HI = this->y.HALF.HI;
this->field_0x74.HWORD = COORD_TO_TILE(this);
}
void sub_080A0718(Entity* this) {
if (sub_08083734(this, 2) != 0) {
this->action = 2;
this->actionDelay = 0xc;
this->spriteSettings.b.draw = TRUE;
this->direction = 0;
this->y.HALF.HI += 0x24;
sub_080A080C(this);
}
EnqueueSFX(0x10b);
}
}
void sub_080A07BC(Entity *this)
{
if (CheckFlags(this->field_0x86.HWORD)) {
this->action = 4;
this->actionDelay = 0xc;
this->direction = 0x10;
this->y.HALF.HI += 2;
sub_080A0870(this);
PlaySFX(0x10b);
}
void sub_080A074C(Entity* this) {
u8 bVar1;
Entity* ent;
sub_0806F69C(this);
if (--this->actionDelay == 0) {
this->action = 3;
this->height.HALF.HI = 0;
this->x.HALF.HI = this->field_0x70.HALF.LO;
this->y.HALF.HI = this->field_0x70.HALF.HI;
ent = CreateFx(this, 0x11, 0x40);
if (ent != NULL) {
ent->x.HALF.HI += 0xc;
ent->y.HALF.HI -= 0xc;
}
ent = CreateFx(this, 0x11, 0x40);
if (ent != NULL) {
ent->x.HALF.HI -= 0xc;
ent->y.HALF.HI -= 0xc;
}
EnqueueSFX(0x10b);
}
}
void sub_080A07F0(Entity *this)
{
sub_0806F69C(this);
if (--this->actionDelay == 0) {
DeleteThisEntity();
}
void sub_080A07BC(Entity* this) {
if (CheckFlags(this->field_0x86.HWORD)) {
this->action = 4;
this->actionDelay = 0xc;
this->direction = 0x10;
this->y.HALF.HI += 2;
sub_080A0870(this);
PlaySFX(0x10b);
}
}
void sub_080A080C(Entity *this)
{
this->field_0x76.HWORD = sub_080001DA(this->field_0x74.HWORD - 1, this->collisionLayer);
this->field_0x78.HWORD = sub_080001DA(this->field_0x74.HWORD, this->collisionLayer);
this->field_0x7a.HWORD = sub_080001DA(this->field_0x74.HWORD + 1, this->collisionLayer);
SetTile(0x4022, this->field_0x74.HWORD - 1, this->collisionLayer);
SetTile(0x4022, this->field_0x74.HWORD, this->collisionLayer);
SetTile(0x4022, this->field_0x74.HWORD + 1, this->collisionLayer);
void sub_080A07F0(Entity* this) {
sub_0806F69C(this);
if (--this->actionDelay == 0) {
DeleteThisEntity();
}
}
void sub_080A0870(Entity *this)
{
SetTile(this->field_0x76.HWORD, this->field_0x74.HWORD - 1, this->collisionLayer);
SetTile(this->field_0x78.HWORD, this->field_0x74.HWORD, this->collisionLayer);
SetTile(this->field_0x7a.HWORD, this->field_0x74.HWORD + 1, this->collisionLayer);
void sub_080A080C(Entity* this) {
this->field_0x76.HWORD = sub_080001DA(this->field_0x74.HWORD - 1, this->collisionLayer);
this->field_0x78.HWORD = sub_080001DA(this->field_0x74.HWORD, this->collisionLayer);
this->field_0x7a.HWORD = sub_080001DA(this->field_0x74.HWORD + 1, this->collisionLayer);
SetTile(0x4022, this->field_0x74.HWORD - 1, this->collisionLayer);
SetTile(0x4022, this->field_0x74.HWORD, this->collisionLayer);
SetTile(0x4022, this->field_0x74.HWORD + 1, this->collisionLayer);
}
void sub_080A0870(Entity* this) {
SetTile(this->field_0x76.HWORD, this->field_0x74.HWORD - 1, this->collisionLayer);
SetTile(this->field_0x78.HWORD, this->field_0x74.HWORD, this->collisionLayer);
SetTile(this->field_0x7a.HWORD, this->field_0x74.HWORD + 1, this->collisionLayer);
}
+33 -36
View File
@@ -93,40 +93,37 @@ void sub_080917DC(Entity* this) {
}
}
void sub_080918A4(Entity *this)
{
if (sub_080041A0(this, &gPlayerEntity, 2, 2) != 0) {
gPlayerEntity.x.HALF.HI = this->x.HALF.HI;
gPlayerEntity.y.HALF.HI = this->y.HALF.HI;
if (gPlayerEntity.height.HALF.HI > -0x10) {
if ((s32)gPlayerEntity.field_0x20 > -1) {
return;
}
gPlayerEntity.animationState = this->animationState << 1;
gPlayerState.flags.all = (gPlayerState.flags.all ^ 0x4000000) | 0x1000;
this->action++;
this->field_0xf = 1;
this->flags |= 0x20;
this->damageType = 0x97;
this->field_0x3c = (gPlayerEntity.field_0x3c + 1) | 0x20;
this->flags2 = gPlayerEntity.flags2;
this->field_0x40 = 0x18;
this->field_0x44 = 8;
sub_0801766C(this);
sub_0807BA8C(COORD_TO_TILE(this), this->collisionLayer);
PlaySFX(0x137);
void sub_080918A4(Entity* this) {
if (sub_080041A0(this, &gPlayerEntity, 2, 2) != 0) {
gPlayerEntity.x.HALF.HI = this->x.HALF.HI;
gPlayerEntity.y.HALF.HI = this->y.HALF.HI;
if (gPlayerEntity.height.HALF.HI > -0x10) {
if ((s32)gPlayerEntity.field_0x20 > -1) {
return;
}
gPlayerEntity.animationState = this->animationState << 1;
gPlayerState.flags.all = (gPlayerState.flags.all ^ 0x4000000) | 0x1000;
this->action++;
this->field_0xf = 1;
this->flags |= 0x20;
this->damageType = 0x97;
this->field_0x3c = (gPlayerEntity.field_0x3c + 1) | 0x20;
this->flags2 = gPlayerEntity.flags2;
this->field_0x40 = 0x18;
this->field_0x44 = 8;
sub_0801766C(this);
sub_0807BA8C(COORD_TO_TILE(this), this->collisionLayer);
PlaySFX(0x137);
}
} else {
gPlayerEntity.direction = GetFacingDirection(&gPlayerEntity, this);
}
if (gPlayerEntity.field_0x20 < 0) {
gPlayerEntity.spritePriority.b0 = this->spritePriority.b0 - 1;
}
}
else {
gPlayerEntity.direction = GetFacingDirection(&gPlayerEntity, this);
}
if (gPlayerEntity.field_0x20 < 0) {
gPlayerEntity.spritePriority.b0 = this->spritePriority.b0 - 1;
}
}
void sub_080919AC(Entity *this)
{
void sub_080919AC(Entity* this) {
u32 iVar2;
u32 uVar3;
@@ -138,7 +135,7 @@ void sub_080919AC(Entity *this)
if ((gPlayerEntity.frames.all & 0xf) == 0) {
this->flags = this->flags & 0x7f;
CopyPosition(this,&gPlayerEntity);
CopyPosition(this, &gPlayerEntity);
if ((gPlayerEntity.frames.all & 0xf0) == 0x10) {
this->spriteOffsetY = 1;
} else {
@@ -148,7 +145,7 @@ void sub_080919AC(Entity *this)
this->flags = this->flags | 0x80;
gPlayerEntity.nonPlanarMovement = 0;
sub_0806F69C(this);
CopyPosition(this,&gPlayerEntity);
CopyPosition(this, &gPlayerEntity);
gPlayerEntity.spritePriority.b0 = this->spritePriority.b0 - 1;
if (!sub_08091DDC(this)) {
if ((gScreenTransition.frameCount & 0xf) == 0) {
@@ -160,7 +157,8 @@ void sub_080919AC(Entity *this)
this->field_0xf = 0x3c;
}
uVar3 = sub_080002B4(this, gUnk_081223C8[this->animationState * 2], gUnk_081223C8[this->animationState * 2 + 1]);
uVar3 = sub_080002B4(this, gUnk_081223C8[this->animationState * 2],
gUnk_081223C8[this->animationState * 2 + 1]);
iVar2 = sub_08007DD6(uVar3, gUnk_081223D8[this->animationState]);
if (iVar2 == 0) {
this->direction = this->direction ^ 0x10;
@@ -207,8 +205,7 @@ void sub_080919AC(Entity *this)
gPlayerEntity.animationState = this->animationState << 1;
if (this->animIndex == this->animationState) {
UpdateAnimationSingleFrame(this);
}
else {
} else {
InitAnimationForceUpdate(this, this->animationState);
}
}
+6 -6
View File
@@ -1,7 +1,7 @@
#include "global.h"
#include "entity.h"
extern void (*MineralWaterSourceActionFuncs[])(Entity *);
extern void (*MineralWaterSourceActionFuncs[])(Entity*);
typedef struct {
u8 field_0x00;
@@ -12,14 +12,14 @@ typedef struct {
extern UnkStruct_MineralWater MineralWaterSourceParameters[];
extern bool32 sub_0806FBD8(Entity *);
extern bool32 sub_0806FBD8(Entity*);
void MineralWaterSource(Entity *this) {
void MineralWaterSource(Entity* this) {
MineralWaterSourceActionFuncs[this->action](this);
}
void MineralWaterSource_Init(Entity *this) {
UnkStruct_MineralWater *unknownParameters;
void MineralWaterSource_Init(Entity* this) {
UnkStruct_MineralWater* unknownParameters;
if (!sub_0806FBD8(this)) {
return;
@@ -42,6 +42,6 @@ void MineralWaterSource_Init(Entity *this) {
this->action = 1;
}
void sub_080973DC(Entity *this) {
void sub_080973DC(Entity* this) {
this->bitfield = 0;
}
+13 -17
View File
@@ -1,30 +1,26 @@
#include "global.h"
#include "entity.h"
extern void (* const gUnk_081247F8[])(Entity*);
extern void (*const gUnk_081247F8[])(Entity*);
void MinishLight(Entity* this)
{
gUnk_081247F8[this->action](this);
void MinishLight(Entity* this) {
gUnk_081247F8[this->action](this);
}
void sub_0809F840(Entity* this)
{
this->action = 1;
this->frameIndex = 0;
this->actionDelay = 0x20;
this->field_0xf = 0;
void sub_0809F840(Entity* this) {
this->action = 1;
this->frameIndex = 0;
this->actionDelay = 0x20;
this->field_0xf = 0;
if (this->entityType.parameter != 0)
{
this->spriteSettings.b.flipX = 1;
}
if (this->entityType.parameter != 0) {
this->spriteSettings.b.flipX = 1;
}
UpdateSpriteForCollisionLayer(this);
UpdateSpriteForCollisionLayer(this);
}
void sub_0809F868(Entity* this)
{
void sub_0809F868(Entity* this) {
if (--this->actionDelay == 0) {
if (this->field_0xf == 0) {
if (++this->frameIndex == 3) {
+12 -14
View File
@@ -7,20 +7,18 @@ extern void LoadFixedGFX(Entity*, u32);
extern void (*const gUnk_08122254[])(Entity*);
void MinishSizedEntrance(Entity* this)
{
gUnk_08122254[this->action](this);
void MinishSizedEntrance(Entity* this) {
gUnk_08122254[this->action](this);
}
void sub_08090EC0(Entity *this)
{
this->action = 1;
this->spriteRendering.b3 = 3;
this->spritePriority.b0 = 7;
this->frameIndex = (this->entityType).parameter;
if (CheckIsDungeon()) {
this->frameIndex += 4;
sub_080AE068(this);
LoadFixedGFX(this, 0x184);
}
void sub_08090EC0(Entity* this) {
this->action = 1;
this->spriteRendering.b3 = 3;
this->spritePriority.b0 = 7;
this->frameIndex = (this->entityType).parameter;
if (CheckIsDungeon()) {
this->frameIndex += 4;
sub_080AE068(this);
LoadFixedGFX(this, 0x184);
}
}
+11 -12
View File
@@ -4,16 +4,15 @@
extern u32 CheckRectOnScreen(s16, s16, u32, u32);
extern void DeleteThisEntity();
void Object1C(Entity *this)
{
s32 iVar1;
if (this->action == 0) {
this->action = 1;
}
iVar1 = CheckRectOnScreen(this->field_0x80.HWORD, this->field_0x82.HWORD, 0x10, 0x10);
if (iVar1 == 0) {
this->parent->field_0x20 &= ~(1 << this->entityType.parameter);
DeleteThisEntity();
}
void Object1C(Entity* this) {
s32 iVar1;
if (this->action == 0) {
this->action = 1;
}
iVar1 = CheckRectOnScreen(this->field_0x80.HWORD, this->field_0x82.HWORD, 0x10, 0x10);
if (iVar1 == 0) {
this->parent->field_0x20 &= ~(1 << this->entityType.parameter);
DeleteThisEntity();
}
}
+6 -7
View File
@@ -5,14 +5,13 @@ void DeleteThisEntity();
extern void (*gUnk_081208A0[])(Entity*);
void Object1D(Entity *this)
{
gUnk_081208A0[this->action](this);
void Object1D(Entity* this) {
gUnk_081208A0[this->action](this);
}
void sub_080874F8(Entity* this)
{
DeleteThisEntity();
void sub_080874F8(Entity* this) {
DeleteThisEntity();
}
void nullsub_117(Entity* this){}
void nullsub_117(Entity* this) {
}
+8 -9
View File
@@ -9,15 +9,14 @@ void Object2A(Entity* this) {
gUnk_08120DD0[this->action](this);
}
void sub_08089B18(Entity *this)
{
this->action = 1;
this->spriteSettings.b.draw = TRUE;
if (this->entityType.parameter != 0) {
this->actionDelay = this->entityType.parameter;
}
InitializeAnimation(this, 0);
switch (this->entityType.form) {
void sub_08089B18(Entity* this) {
this->action = 1;
this->spriteSettings.b.draw = TRUE;
if (this->entityType.parameter != 0) {
this->actionDelay = this->entityType.parameter;
}
InitializeAnimation(this, 0);
switch (this->entityType.form) {
case 1:
this->y.HALF.HI -= 8;
this->actionDelay = 0x28;
Executable → Regular
+5 -6
View File
@@ -179,7 +179,7 @@ void sub_0808EA28(Entity* this) {
u32 var1;
if (this->entityType.form == 3) {
if (((struct_02000000 *)0x2000000)->gameLanguage > 1) {
if (((struct_02000000*)0x2000000)->gameLanguage > 1) {
this->spriteSettings.b.draw = 2;
} else {
this->spriteSettings.b.draw = 0;
@@ -298,7 +298,7 @@ void sub_0808EBB8(Entity* this) {
case 0:
break;
case 1:
y = ((struct_02000000 *)0x2000000)->gameLanguage * 16 + 24;
y = ((struct_02000000*)0x2000000)->gameLanguage * 16 + 24;
x = 112;
break;
case 2:
@@ -407,7 +407,7 @@ void sub_0808ED98(Entity* this) {
void sub_0808EE00(Entity* this) {
int var0, var1, var2;
var0 = ((struct_02000000 *)0x2000000)->gameLanguage != 0;
var0 = ((struct_02000000*)0x2000000)->gameLanguage != 0;
var1 = this->entityType.form - 10;
this->frameIndex = gUnk_08121D38[var0][var1];
this->x.HALF.HI = gUnk_08121D18[var0][var1];
@@ -426,7 +426,6 @@ void sub_0808EE00(Entity* this) {
}
void nullsub_522(Entity* this) {
}
void sub_0808EE98(Entity* this) {
@@ -458,9 +457,9 @@ void sub_0808EF24(Entity* this) {
} else {
this->spriteSettings.b.draw = 2;
if (this->entityType.form == 21) {
var0 = ((struct_02000000 *)0x2000000)->messageSpeed;
var0 = ((struct_02000000*)0x2000000)->messageSpeed;
} else {
var0 = ((struct_02000000 *)0x2000000)->brightnessPref;
var0 = ((struct_02000000*)0x2000000)->brightnessPref;
}
this->frameIndex = this->lastFrameIndex + var0;
}
+77 -86
View File
@@ -11,7 +11,7 @@ static void sub_0808F244(Entity*);
extern void sub_0806FCF4(Entity*, u32, u32, u32);
extern void sub_0808F5EC(Entity*);
extern bool32 sub_0806F3E4(Entity *);
extern bool32 sub_0806F3E4(Entity*);
extern void (*const gUnk_08121E5C[])(Entity*);
extern void (*const gUnk_08121E88[])(Entity*);
@@ -63,98 +63,89 @@ static void sub_0808F14C(Entity* this) {
}
}
void sub_0808F170(Entity *this)
{
*(u32 *)&this->field_0x74 -= 0x20;
*(u32 *)&this->field_0x78 += 0x20;
sub_0806FCF4(this, *(u32 *)&this->field_0x78, 8, 2);
if (*(u32 *)&this->field_0x78 > 0x1ff) {
this->action++;
}
sub_0808F2B0(this);
}
void sub_0808F1A4(Entity *this)
{
*(u32 *)&this->field_0x78 += 0x10;
*(u32 *)&this->field_0x74 += 0x10;
sub_0806FCF4(this, *(u32 *)&this->field_0x78, 8, 2);
if (*(u32 *)&this->field_0x78 > 0x3ff) {
this->attachedEntity->action = 0xff;
DeleteThisEntity();
}
else {
void sub_0808F170(Entity* this) {
*(u32*)&this->field_0x74 -= 0x20;
*(u32*)&this->field_0x78 += 0x20;
sub_0806FCF4(this, *(u32*)&this->field_0x78, 8, 2);
if (*(u32*)&this->field_0x78 > 0x1ff) {
this->action++;
}
sub_0808F2B0(this);
}
}
void sub_0808F1E0(Entity *this)
{
void sub_0808F1A4(Entity* this) {
*(u32*)&this->field_0x78 += 0x10;
*(u32*)&this->field_0x74 += 0x10;
sub_0806FCF4(this, *(u32*)&this->field_0x78, 8, 2);
if (*(u32*)&this->field_0x78 > 0x3ff) {
this->attachedEntity->action = 0xff;
DeleteThisEntity();
} else {
sub_0808F2B0(this);
}
}
void sub_0808F1E0(Entity* this) {
gUnk_08121E98[this->action](this);
}
void sub_0808F1F8(Entity *this)
{
u8 bVar1;
this->spriteRendering.b0 = 3;
this->action++;
this->spriteRendering.b3 = this->parent->spriteRendering.b3;
this->spriteOrientation.flipY = this->parent->spriteOrientation.flipY;
this->spritePriority.b0 = 7;
InitializeAnimation(this, 1);
sub_0808F244(this);
}
void sub_0808F1F8(Entity* this) {
u8 bVar1;
static void sub_0808F244(Entity *this)
{
this->spriteSettings.b.draw = this->parent->spriteSettings.b.draw;
this->y.HALF.HI = this->parent->y.HALF.HI + 3;
this->x.HALF.HI = (*(s8*)&this->attachedEntity->spriteOffsetX + this->attachedEntity->x.HALF.HI);
this->height.WORD = 0;
*(u32 *)&this->field_0x74 = 0x80 - this->parent->height.HALF.HI;
*(u32 *)&this->field_0x78 = 0x100 - this->parent->height.HALF.HI;
*(u32 *)&this->field_0x70.WORD = *((u8 *)&this->parent->field_0x7c + 3);
sub_0808F2B0(this);
if ((this->parent->field_0x6c.HALF.HI & 2) != 0) {
DeleteThisEntity();
}
}
static void sub_0808F2B0(Entity *this)
{
sub_0805EC9C(this, *(u32 *)&this->field_0x74, *(u32 *)&this->field_0x78, this->field_0x70.WORD);
}
void sub_0808F2C0(Entity *this)
{
if (this->action == 0) {
this->spriteRendering.b0 = 3;
this->action++;
this->spriteRendering.b3 = this->parent->spriteRendering.b3;
this->spriteOrientation.flipY = this->parent->spriteOrientation.flipY;
this->spriteSettings.b.draw = 1;
this->spritePriority.b0 = 7;
this->height.WORD = 0;
InitializeAnimation(this, 1);
sub_0808F244(this);
}
static void sub_0808F244(Entity* this) {
this->spriteSettings.b.draw = this->parent->spriteSettings.b.draw;
this->y.HALF.HI = this->parent->y.HALF.HI + 3;
this->x.HALF.HI = this->parent->x.HALF.HI;
InitializeAnimation(this,3);
}
if (this->parent->height.HALF.HI == 0) {
*(u32 *)&this->field_0x74 = *(u32 *)&this->parent->field_0x74;
*(u32 *)&this->field_0x78 = *(u32 *)&this->parent->field_0x78;
}
else {
*(u32 *)&this->field_0x74 = 0x200 - this->parent->height.HALF.HI;
*(u32 *)&this->field_0x78 = this->parent->height.HALF.HI * -2 + 0x300;
}
*(u32 *)&this->field_0x70 = 0;
sub_0808F2B0(this);
sub_0806FCF4(this,*(u32 *)&this->field_0x78,8,2);
if (this->action == 0xff) {
DeleteThisEntity();
}
this->x.HALF.HI = (*(s8*)&this->attachedEntity->spriteOffsetX + this->attachedEntity->x.HALF.HI);
this->height.WORD = 0;
*(u32*)&this->field_0x74 = 0x80 - this->parent->height.HALF.HI;
*(u32*)&this->field_0x78 = 0x100 - this->parent->height.HALF.HI;
*(u32*)&this->field_0x70.WORD = *((u8*)&this->parent->field_0x7c + 3);
sub_0808F2B0(this);
if ((this->parent->field_0x6c.HALF.HI & 2) != 0) {
DeleteThisEntity();
}
}
static void sub_0808F2B0(Entity* this) {
sub_0805EC9C(this, *(u32*)&this->field_0x74, *(u32*)&this->field_0x78, this->field_0x70.WORD);
}
void sub_0808F2C0(Entity* this) {
if (this->action == 0) {
this->action++;
this->spriteRendering.b3 = this->parent->spriteRendering.b3;
this->spriteOrientation.flipY = this->parent->spriteOrientation.flipY;
this->spriteSettings.b.draw = 1;
this->spritePriority.b0 = 7;
this->height.WORD = 0;
this->y.HALF.HI = this->parent->y.HALF.HI + 3;
this->x.HALF.HI = this->parent->x.HALF.HI;
InitializeAnimation(this, 3);
}
if (this->parent->height.HALF.HI == 0) {
*(u32*)&this->field_0x74 = *(u32*)&this->parent->field_0x74;
*(u32*)&this->field_0x78 = *(u32*)&this->parent->field_0x78;
} else {
*(u32*)&this->field_0x74 = 0x200 - this->parent->height.HALF.HI;
*(u32*)&this->field_0x78 = this->parent->height.HALF.HI * -2 + 0x300;
}
*(u32*)&this->field_0x70 = 0;
sub_0808F2B0(this);
sub_0806FCF4(this, *(u32*)&this->field_0x78, 8, 2);
if (this->action == 0xff) {
DeleteThisEntity();
}
}
void sub_0808F370(Entity* this) {
@@ -168,7 +159,7 @@ void sub_0808F370(Entity* this) {
u8 flag = this->parent->previousActionFlag - 1;
if (flag < 5) {
if (this->field_0x70.WORD == 0) {
if (--(*(u32 *)&this->field_0x74) == -1) {
if (--(*(u32*)&this->field_0x74) == -1) {
this->field_0x70.WORD = gUnk_08121EA0[Random() & 1];
}
} else {
@@ -178,7 +169,7 @@ void sub_0808F370(Entity* this) {
}
} else {
this->action = 0;
*(u32 *)&this->field_0x74 = 0;
*(u32*)&this->field_0x74 = 0;
}
}
}
@@ -201,7 +192,7 @@ void sub_0808F3DC(Entity* this) {
}
ResolveEntityOnTop(this->attachedEntity, this);
} else {
if (*(u32 *)&this->parent->field_0x74 == 0) {
if (*(u32*)&this->parent->field_0x74 == 0) {
if (this->entityType.form == 8) {
this->attachedEntity->damageType = this->damageType;
}
@@ -260,8 +251,8 @@ void sub_0808F554(Entity* this) {
}
if (this->action != 0) {
if (*(u32 *)&this->cutsceneBeh) {
if (--(*(u32 *)&this->cutsceneBeh) == 0) {
if (*(u32*)&this->cutsceneBeh) {
if (--(*(u32*)&this->cutsceneBeh) == 0) {
DeleteThisEntity();
}
}
@@ -294,5 +285,5 @@ void sub_0808F5EC(Entity* this) {
entity->attachedEntity = this->attachedEntity;
}
*(u32 *)&this->field_0x74 = 600;
*(u32*)&this->field_0x74 = 600;
}
+2 -2
View File
@@ -2,8 +2,8 @@
#include "entity.h"
#include "functions.h"
void Object7E(Entity *this) {
void Object7E(Entity* this) {
if (this->parent->next == NULL) {
DeleteThisEntity();
}
+27 -29
View File
@@ -42,39 +42,37 @@ void sub_08099E10(Entity* this) {
}
}
void sub_08099E58(Entity *this)
{
GetNextFrame(this);
if (this->frames.b.f3) {
this->frames.b.f3 = 0;
this->actionDelay++;
if (this->actionDelay == 3) {
this->action = 3;
this->frameIndex = 4;
void sub_08099E58(Entity* this) {
GetNextFrame(this);
if (this->frames.b.f3) {
this->frames.b.f3 = 0;
this->actionDelay++;
if (this->actionDelay == 3) {
this->action = 3;
this->frameIndex = 4;
}
}
}
}
void sub_08099E8C(Entity *this)
{
if (sub_080041A0(this, &gPlayerEntity, 0xc, 0xc)) {
if (this->previousActionFlag == 0) {
sub_08099ECC(this);
sub_0805E4E0(this, 0x1e);
void sub_08099E8C(Entity* this) {
if (sub_080041A0(this, &gPlayerEntity, 0xc, 0xc)) {
if (this->previousActionFlag == 0) {
sub_08099ECC(this);
sub_0805E4E0(this, 0x1e);
}
if (CheckLocalFlag(0x75)) {
sub_0805B390(0x7);
}
}
if (CheckLocalFlag(0x75)) {
sub_0805B390(0x7);
}
}
}
void nullsub_534(Entity* this) {}
void sub_08099ECC(Entity *this)
{
this->previousActionFlag = 1;
CopyPosition(this, &gPlayerEntity);
gPlayerState.playerAction = 3;
gPlayerState.field_0x34[4] = 0;
gPlayerState.flags.all |= 0x8000;
void nullsub_534(Entity* this) {
}
void sub_08099ECC(Entity* this) {
this->previousActionFlag = 1;
CopyPosition(this, &gPlayerEntity);
gPlayerState.playerAction = 3;
gPlayerState.field_0x34[4] = 0;
gPlayerState.flags.all |= 0x8000;
}
+32 -34
View File
@@ -6,39 +6,37 @@ extern BoundingBox gUnk_080FD168;
extern void SetTile(u32, u32, u32);
void Object9E(Entity *this)
{
Entity *ent;
u32 tilePos;
u8 *layer;
if (this->action == 0) {
this->action = 1;
this->spritePriority.b0 = 6;
if ((this->entityType).form == 0) {
this->flags = this->flags | 0x80;
this->frameIndex = 1;
layer = &this->collisionLayer;
*layer = 1;
this->field_0x3c = 7;
this->field_0x40 = 0x48;
this->damageType = 0x7a;
this->flags2 = 1;
this->boundingBox = &gUnk_080FD168;
tilePos = COORD_TO_TILE(this);
SetTile(0x4066, tilePos - 1, *layer);
SetTile(0x4065, tilePos, *layer);
UpdateSpriteForCollisionLayer(this);
ent = CreateObject(0x9e,1,0);
if (ent != NULL) {
this->attachedEntity = ent;
CopyPosition(this, ent);
}
void Object9E(Entity* this) {
Entity* ent;
u32 tilePos;
u8* layer;
if (this->action == 0) {
this->action = 1;
this->spritePriority.b0 = 6;
if ((this->entityType).form == 0) {
this->flags = this->flags | 0x80;
this->frameIndex = 1;
layer = &this->collisionLayer;
*layer = 1;
this->field_0x3c = 7;
this->field_0x40 = 0x48;
this->damageType = 0x7a;
this->flags2 = 1;
this->boundingBox = &gUnk_080FD168;
tilePos = COORD_TO_TILE(this);
SetTile(0x4066, tilePos - 1, *layer);
SetTile(0x4065, tilePos, *layer);
UpdateSpriteForCollisionLayer(this);
ent = CreateObject(0x9e, 1, 0);
if (ent != NULL) {
this->attachedEntity = ent;
CopyPosition(this, ent);
}
} else {
this->frameIndex = 0;
this->collisionLayer = 2;
UpdateSpriteForCollisionLayer(this);
}
}
else {
this->frameIndex = 0;
this->collisionLayer = 2;
UpdateSpriteForCollisionLayer(this);
}
}
}
+8 -8
View File
@@ -8,9 +8,9 @@ extern BoundingBox gUnk_080FD170;
extern u8 gUnk_02000070;
void ObjectA(Entity *this) {
u32 uVar2;
void ObjectA(Entity* this) {
u32 uVar2;
if (this->action == 0) {
this->action = 1;
this->boundingBox = &gUnk_080FD170;
@@ -30,10 +30,10 @@ void ObjectA(Entity *this) {
sub_080787CC(this);
}
} else if (this->interactType != 0) {
SetTileType(*(u16*)&this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer);
SetFlag(this->field_0x86.HWORD);
CreateDust(this);
sub_080526F8(-1);
DeleteThisEntity();
SetTileType(*(u16*)&this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer);
SetFlag(this->field_0x86.HWORD);
CreateDust(this);
sub_080526F8(-1);
DeleteThisEntity();
}
}
+22 -23
View File
@@ -9,28 +9,27 @@ extern void (*gUnk_08124824[])(Entity*);
extern Entity gPlayerEntity;
void ObjectA8(Entity *this)
{
if ((this->bitfield & 0x80) != 0) {
switch(this->bitfield & 0x7f) {
case 0:
case 1:
case 4:
case 5:
case 6:
case 8:
case 9:
case 10:
case 0xb:
case 0xc:
case 0x1e:
case 0x1f:
this->action = 5;
this->attachedEntity = &gPlayerEntity;
CreateItemEntity((this->entityType).form, 0, 0);
DeleteThisEntity();
void ObjectA8(Entity* this) {
if ((this->bitfield & 0x80) != 0) {
switch (this->bitfield & 0x7f) {
case 0:
case 1:
case 4:
case 5:
case 6:
case 8:
case 9:
case 10:
case 0xb:
case 0xc:
case 0x1e:
case 0x1f:
this->action = 5;
this->attachedEntity = &gPlayerEntity;
CreateItemEntity((this->entityType).form, 0, 0);
DeleteThisEntity();
}
}
}
gUnk_08124824[this->action](this);
sub_08080CB4(this);
gUnk_08124824[this->action](this);
sub_08080CB4(this);
}
+8 -8
View File
@@ -9,13 +9,13 @@ void PalaceArchway(Entity* this) {
gUnk_081246EC[this->action](this);
}
void sub_0809F2A0(Entity *this)
{
this->action = 1;
this->frameIndex = this->entityType.parameter;
this->spriteRendering.b3 = 3;
this->spritePriority.b0 = 7;
SetTile(0x4069, COORD_TO_TILE(this), this->collisionLayer);
void sub_0809F2A0(Entity* this) {
this->action = 1;
this->frameIndex = this->entityType.parameter;
this->spriteRendering.b3 = 3;
this->spritePriority.b0 = 7;
SetTile(0x4069, COORD_TO_TILE(this), this->collisionLayer);
}
void nullsub_537() {}
void nullsub_537() {
}
+14 -15
View File
@@ -13,31 +13,30 @@ extern void (*gUnk_0812505C[])(Entity*);
void Pinwheel(Entity* this) {
u16 x = this->currentHealth;
if ((x & 0x7f) != 0) {
if (ReadBit(&gUnk_020342F8,x-1) == 0) {
DeleteThisEntity();
}
if (ReadBit(&gUnk_020342F8, x - 1) == 0) {
DeleteThisEntity();
}
}
gUnk_0812505C[this->action](this);
}
void sub_080A23DC(Entity *this) {
void sub_080A23DC(Entity* this) {
this->field_0x68.HWORD = gUnk_08125050[this->entityType.parameter];
this->spritePriority.b0 = 7;
if (CheckLocalFlag(this->field_0x68.HWORD) !=0) {
if (CheckLocalFlag(this->field_0x68.HWORD) != 0) {
this->action = 2;
}
else {
} else {
this->action = 1;
}
InitializeAnimation(this,0);
InitializeAnimation(this, 0);
}
void sub_080A2420(Entity *this) {
if (CheckLocalFlag(this->field_0x68.HWORD) != 0) {
this->action = 2;
CreateDust(this);
}
void sub_080A2420(Entity* this) {
if (CheckLocalFlag(this->field_0x68.HWORD) != 0) {
this->action = 2;
CreateDust(this);
}
}
void sub_080A243C(Entity *this) {
void sub_080A243C(Entity* this) {
GetNextFrame(this);
}
}
Executable → Regular
-1
View File
@@ -128,7 +128,6 @@ void sub_08082510(Entity* this) {
this->previousActionFlag++;
}
void nullsub_511(Entity* this) {
}
+30 -34
View File
@@ -13,46 +13,42 @@ void Smoke(Entity* this) {
gUnk_08121060[this->entityType.form](this);
}
void sub_0808A40C(Entity *this)
{
Entity *ent;
if (this->action == 0) {
this->action = 1;
this->actionDelay = 0x28;
}
if (--this->actionDelay == 0) {
this->actionDelay = 0x40 - (Random() & 0x1f);
ent = CreateObject(0x2d, 1, 0);
if (ent != NULL) {
CopyPosition(this,ent);
ent->x.HALF.HI += gUnk_08121068[(Random() & 7)];
void sub_0808A40C(Entity* this) {
Entity* ent;
if (this->action == 0) {
this->action = 1;
this->actionDelay = 0x28;
}
if (--this->actionDelay == 0) {
this->actionDelay = 0x40 - (Random() & 0x1f);
ent = CreateObject(0x2d, 1, 0);
if (ent != NULL) {
CopyPosition(this, ent);
ent->x.HALF.HI += gUnk_08121068[(Random() & 7)];
}
}
}
}
void sub_0808A46C(Entity *this)
{
void sub_0808A46C(Entity* this) {
gUnk_08121070[this->action](this);
}
void sub_0808A484(Entity *this)
{
this->action = 1;
this->spriteSettings.b.draw = TRUE;
this->nonPlanarMovement = 0x40;
this->direction = 6;
this->spriteRendering.b3 = 1;
this->spritePriority.b0 = 0;
this->spriteOrientation.flipY = 1;
InitializeAnimation(this, 0x28);
void sub_0808A484(Entity* this) {
this->action = 1;
this->spriteSettings.b.draw = TRUE;
this->nonPlanarMovement = 0x40;
this->direction = 6;
this->spriteRendering.b3 = 1;
this->spritePriority.b0 = 0;
this->spriteOrientation.flipY = 1;
InitializeAnimation(this, 0x28);
}
void sub_0808A4D0(Entity *this)
{
GetNextFrame(this);
sub_0806F69C(this);
if (this->frames.b.f3) {
DeleteEntity(this);
}
void sub_0808A4D0(Entity* this) {
GetNextFrame(this);
sub_0806F69C(this);
if (this->frames.b.f3) {
DeleteEntity(this);
}
}
+11 -13
View File
@@ -13,19 +13,17 @@ void SwordsmanNewsletter(Entity* this) {
gUnk_081228B0[this->action](this);
}
void sub_080933D8(Entity *this)
{
this->action = 1;
this->frameIndex = this->entityType.form;
UpdateSpriteForCollisionLayer(this);
this->boundingBox = &gUnk_081228A8;
sub_080787B4(this);
void sub_080933D8(Entity* this) {
this->action = 1;
this->frameIndex = this->entityType.form;
UpdateSpriteForCollisionLayer(this);
this->boundingBox = &gUnk_081228A8;
sub_080787B4(this);
}
void sub_080933FC(Entity *this)
{
if (this->interactType != 0) {
this->interactType = 0;
TextboxNoOverlap(gUnk_081228B8[this->entityType.form], this);
}
void sub_080933FC(Entity* this) {
if (this->interactType != 0) {
this->interactType = 0;
TextboxNoOverlap(gUnk_081228B8[this->entityType.form], this);
}
}
+24 -27
View File
@@ -10,34 +10,31 @@ extern void (*const ThoughtBubble_Behaviors[])(Entity*);
extern u16 ThoughtBubble_SFX[];
void ThoughtBubble(Entity* this)
{
ThoughtBubble_Behaviors[this->action](this);
void ThoughtBubble(Entity* this) {
ThoughtBubble_Behaviors[this->action](this);
}
void ThoughtBubble_Init(Entity *this)
{
this->action = 1;
this->spriteSettings.b.draw = 1;
if (this->actionDelay == 0) {
this->actionDelay = 0x2d;
}
this->spriteOrientation.flipY = 1;
InitializeAnimation(this, this->entityType.parameter);
PlaySFX(ThoughtBubble_SFX[this->entityType.parameter]);
}
void ThoughtBubble_Update(Entity *this)
{
if (this->parent != NULL) {
this->x.HALF.HI = this->parent->x.HALF.HI;
this->y.HALF.HI = this->parent->y.HALF.HI;
this->height.HALF.HI = this->parent->height.HALF.HI;
}
if ((this->entityType).parameter != 2) {
if (--this->actionDelay == 0) {
DeleteThisEntity();
void ThoughtBubble_Init(Entity* this) {
this->action = 1;
this->spriteSettings.b.draw = 1;
if (this->actionDelay == 0) {
this->actionDelay = 0x2d;
}
}
GetNextFrame(this);
this->spriteOrientation.flipY = 1;
InitializeAnimation(this, this->entityType.parameter);
PlaySFX(ThoughtBubble_SFX[this->entityType.parameter]);
}
void ThoughtBubble_Update(Entity* this) {
if (this->parent != NULL) {
this->x.HALF.HI = this->parent->x.HALF.HI;
this->y.HALF.HI = this->parent->y.HALF.HI;
this->height.HALF.HI = this->parent->height.HALF.HI;
}
if ((this->entityType).parameter != 2) {
if (--this->actionDelay == 0) {
DeleteThisEntity();
}
}
GetNextFrame(this);
}
+2 -3
View File
@@ -82,7 +82,6 @@ void sub_0809E918(Entity* this) {
}
}
void sub_0809E96C(Entity *this)
{
CreateMinishEntrance(COORD_TO_TILE_OFFSET(this, 0x20, 0x8));
void sub_0809E96C(Entity* this) {
CreateMinishEntrance(COORD_TO_TILE_OFFSET(this, 0x20, 0x8));
}
+15 -18
View File
@@ -2,24 +2,21 @@
#include "entity.h"
#include "functions.h"
void WindTribeFlag(Entity *this)
{
if (this->action == 0) {
this->action++;
this->collisionLayer = 2;
if ((this->entityType).form == 0) {
this->spriteSettings.b.flipX = 0;
void WindTribeFlag(Entity* this) {
if (this->action == 0) {
this->action++;
this->collisionLayer = 2;
if ((this->entityType).form == 0) {
this->spriteSettings.b.flipX = 0;
} else {
this->spriteSettings.b.flipX = 1;
}
UpdateSpriteForCollisionLayer(this);
InitializeAnimation(this, 0);
} else {
GetNextFrame(this);
}
else {
this->spriteSettings.b.flipX = 1;
if (this->frameDuration == 0xff) {
this->frameDuration = (Random() & 0xf) + 0x10;
}
UpdateSpriteForCollisionLayer(this);
InitializeAnimation(this,0);
}
else {
GetNextFrame(this);
}
if (this->frameDuration == 0xff) {
this->frameDuration = (Random() & 0xf) + 0x10;
}
}
+15 -18
View File
@@ -7,29 +7,26 @@ extern void sub_0807DDAC(Entity*, u32);
extern void sub_0807DDE4(Entity*);
extern void sub_08078850(Entity*, u32, u32, u8*);
extern void PlaySFX(u32);
extern Entity* CreateFx (Entity*, u32, u32);
extern Entity* CreateFx(Entity*, u32, u32);
extern u8 gUnk_08125010;
void Windcrest(Entity *this)
{
if (this->action == 0) {
this->action++;
this->frameIndex = 0;
sub_0807DD64(this);
}
sub_0807DDAC(this, 0);
sub_0807DDE4(this);
void Windcrest(Entity* this) {
if (this->action == 0) {
this->action++;
this->frameIndex = 0;
sub_0807DD64(this);
}
sub_0807DDAC(this, 0);
sub_0807DDE4(this);
}
void sub_080A2124(Entity *this)
{
sub_08078850(this, 1, 0xe, &gUnk_08125010);
void sub_080A2124(Entity* this) {
sub_08078850(this, 1, 0xe, &gUnk_08125010);
}
void Windcrest_Unlock(Entity *this)
{
PlaySFX(0x72);
gUnk_02002A40.windcrests = gUnk_02002A40.windcrests | 1 << (this->entityType.parameter + 0x18);
CreateFx(this, 0x46, 0);
void Windcrest_Unlock(Entity* this) {
PlaySFX(0x72);
gUnk_02002A40.windcrests = gUnk_02002A40.windcrests | 1 << (this->entityType.parameter + 0x18);
CreateFx(this, 0x46, 0);
}