name flag fields in structs

This commit is contained in:
Henny022p 2025-03-02 17:36:29 +00:00
parent cd2b8d4b53
commit 58c948b8c4
49 changed files with 209 additions and 209 deletions

View File

@ -6,8 +6,8 @@
typedef struct FlagAndOperatorManager { typedef struct FlagAndOperatorManager {
Manager base; Manager base;
u8 unk_20[0x1C]; u8 unk_20[0x1C];
u16 unk_3c; u16 setFlag;
u16 unk_3e; u16 checkFlags;
} FlagAndOperatorManager; } FlagAndOperatorManager;
#endif // FLAGANDOPERATORMANAGER_H #endif // FLAGANDOPERATORMANAGER_H

View File

@ -16,7 +16,7 @@ typedef struct {
s16 unk_38; s16 unk_38;
u16 unk_3a; u16 unk_3a;
u16 unk_3c; u16 unk_3c;
u16 unk_3e; u16 flag;
} Manager29; } Manager29;
#endif // MANAGER29_H #endif // MANAGER29_H

View File

@ -8,8 +8,8 @@ typedef struct {
u8 unk_20[0x18]; u8 unk_20[0x18];
s16 x; s16 x;
s16 y; s16 y;
u16 unk_3c; u16 flag1;
u16 flags; u16 flag2;
} MiscManager; } MiscManager;
#endif // MISCMANAGER_H #endif // MISCMANAGER_H

View File

@ -18,8 +18,8 @@ typedef struct {
s16 unk_36; s16 unk_36;
s16 unk_38; s16 unk_38;
s16 unk_3a; s16 unk_3a;
u16 unk_3c; u16 flag;
u16 unk_3e; // used u16 localFlag; // used
} TempleOfDropletsManager; } TempleOfDropletsManager;
#endif // TEMPLEOFDROPLETSMANAGER_H #endif // TEMPLEOFDROPLETSMANAGER_H

View File

@ -12,7 +12,7 @@ typedef struct {
/*0x6c*/ u16 unk_6c; /*0x6c*/ u16 unk_6c;
/*0x6e*/ u16 unk_6e; /*0x6e*/ u16 unk_6e;
/*0x70*/ u8 unused2[22]; /*0x70*/ u8 unused2[22];
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag;
} ItemOnGroundEntity; } ItemOnGroundEntity;
#endif // ITEMONGROUND_H #endif // ITEMONGROUND_H

View File

@ -19,7 +19,7 @@ typedef struct {
/*0x82*/ u8 unk_82; /*0x82*/ u8 unk_82;
/*0x83*/ u8 unk_83; /*0x83*/ u8 unk_83;
/*0x84*/ u8 unk_84[0x2]; /*0x84*/ u8 unk_84[0x2];
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag;
} PushableFurnitureEntity; } PushableFurnitureEntity;
#endif // PUSHABLEFURNITURE_H #endif // PUSHABLEFURNITURE_H

View File

@ -37,7 +37,7 @@ typedef struct {
/*0x80*/ u8 unk_80; /*0x80*/ u8 unk_80;
/*0x81*/ u8 unk_81; /*0x81*/ u8 unk_81;
/*0x82*/ u8 unused2[4]; /*0x82*/ u8 unused2[4];
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag;
} BusinessScrubEntity; } BusinessScrubEntity;
void sub_08028E9C(BusinessScrubEntity*); void sub_08028E9C(BusinessScrubEntity*);
@ -95,7 +95,7 @@ void BusinessScrub_Action0(BusinessScrubEntity* this) {
super->animationState = 0; super->animationState = 0;
super->direction = DirectionSouth; super->direction = DirectionSouth;
sub_08028E9C(this); sub_08028E9C(this);
if ((*(u8*)this->unk_7c & 1) || CheckFlags(this->unk_86)) { if ((*(u8*)this->unk_7c & 1) || CheckFlags(this->flag)) {
super->action = 4; super->action = 4;
super->timer = 120; super->timer = 120;
super->spritePriority.b1 = 1; super->spritePriority.b1 = 1;
@ -227,7 +227,7 @@ void BusinessScrub_Action3(BusinessScrubEntity* this) {
iVar1->z.HALF.HI -= 12; iVar1->z.HALF.HI -= 12;
SetEntityPriority(iVar1, PRIO_MESSAGE); SetEntityPriority(iVar1, PRIO_MESSAGE);
} }
SetFlag(this->unk_86); SetFlag(this->flag);
sub_0802925C(this); sub_0802925C(this);
} }
break; break;

View File

@ -22,7 +22,7 @@ typedef struct {
/*0x79*/ u8 unk_79; /*0x79*/ u8 unk_79;
/*0x7a*/ u8 unk_7a; /*0x7a*/ u8 unk_7a;
/*0x7b*/ u8 unk_7b; /*0x7b*/ u8 unk_7b;
/*0x7c*/ u16 unk_7c; /*0x7c*/ u16 flag;
/*0x7e*/ u8 unk_7e; /*0x7e*/ u8 unk_7e;
/*0x7f*/ u8 unk_7f; /*0x7f*/ u8 unk_7f;
/*0x80*/ u16 tileIndex1; /*0x80*/ u16 tileIndex1;
@ -152,7 +152,7 @@ void Eyegore_Init(EyegoreEntity* this) {
this->unk_76 = super->y.HALF.HI; this->unk_76 = super->y.HALF.HI;
this->unk_7e = 0x3c; this->unk_7e = 0x3c;
sub_08030F00(this); sub_08030F00(this);
if (this->unk_7c != 0) { if (this->flag != 0) {
super->flags &= ~ENT_COLLIDE; super->flags &= ~ENT_COLLIDE;
InitializeAnimation(super, 10); InitializeAnimation(super, 10);
} else { } else {
@ -161,7 +161,7 @@ void Eyegore_Init(EyegoreEntity* this) {
} }
void Eyegore_Action1(EyegoreEntity* this) { void Eyegore_Action1(EyegoreEntity* this) {
if ((this->unk_7c != 0) && CheckFlags(this->unk_7c)) { if ((this->flag != 0) && CheckFlags(this->flag)) {
sub_08031320(this); sub_08031320(this);
} }
} }

View File

@ -18,9 +18,9 @@ typedef struct {
u16 filler2; u16 filler2;
u16 unk_78; u16 unk_78;
u16 projectileTimer; u16 projectileTimer;
u16 unk_7c; u16 flag1;
u8 filler3[0x2]; u8 filler3[0x2];
u16 unk_80; u16 flag2;
u16 unk_82; u16 unk_82;
u16 unk_84; u16 unk_84;
} TorchTrapEntity; } TorchTrapEntity;
@ -77,35 +77,35 @@ void sub_0803CF38(TorchTrapEntity* this) {
void sub_0803CF94(TorchTrapEntity* this) { void sub_0803CF94(TorchTrapEntity* this) {
if (GetTileTypeAtTilePos(this->tilePos, super->collisionLayer) == TILE_TYPE_118) { if (GetTileTypeAtTilePos(this->tilePos, super->collisionLayer) == TILE_TYPE_118) {
this->unk_80 = 0; this->flag2 = 0;
TorchTrap_Reset(this); TorchTrap_Reset(this);
} else if (this->unk_7c && sub_0803CFD8(this)) { } else if (this->flag1 && sub_0803CFD8(this)) {
TorchTrap_Reset(this); TorchTrap_Reset(this);
} }
} }
bool32 sub_0803CFD8(TorchTrapEntity* this) { bool32 sub_0803CFD8(TorchTrapEntity* this) {
u32 result; u32 result;
if (this->unk_7c == 0) { if (this->flag1 == 0) {
result = TRUE; result = TRUE;
} else { } else {
result = CheckFlags(this->unk_7c); result = CheckFlags(this->flag1);
} }
return result; return result;
} }
bool32 sub_0803CFF0(TorchTrapEntity* this) { bool32 sub_0803CFF0(TorchTrapEntity* this) {
u32 result; u32 result;
if (this->unk_80 != 0) { if (this->flag2 != 0) {
if (this->unk_80 == this->unk_7c) { if (this->flag2 == this->flag1) {
u32 val = CheckFlags(this->unk_80); u32 val = CheckFlags(this->flag2);
result = FALSE; result = FALSE;
if (val == 0) { if (val == 0) {
result = TRUE; result = TRUE;
} }
return result; return result;
} else { } else {
return CheckFlags(this->unk_80); return CheckFlags(this->flag2);
} }
} }

View File

@ -40,7 +40,7 @@ void FallingItemManager_Action1(FallingItemManager* this) {
object->base.collisionLayer = this->field_0x36; object->base.collisionLayer = this->field_0x36;
object->base.x.HALF.HI = this->field_0x38 + gRoomControls.origin_x; object->base.x.HALF.HI = this->field_0x38 + gRoomControls.origin_x;
object->base.y.HALF.HI = this->field_0x3a + gRoomControls.origin_y; object->base.y.HALF.HI = this->field_0x3a + gRoomControls.origin_y;
object->unk_86 = this->field_0x3c; object->flag = this->field_0x3c;
} }
DeleteThisEntity(); DeleteThisEntity();
} }

View File

@ -10,12 +10,12 @@
void FlagAndOperatorManager_Main(FlagAndOperatorManager* this) { void FlagAndOperatorManager_Main(FlagAndOperatorManager* this) {
if (super->action == 0) { if (super->action == 0) {
super->action = 1; super->action = 1;
if (CheckFlags(this->unk_3c)) { if (CheckFlags(this->setFlag)) {
DeleteThisEntity(); DeleteThisEntity();
} }
} else { } else {
if (CheckFlags(this->unk_3e)) { if (CheckFlags(this->checkFlags)) {
SetFlag(this->unk_3c); SetFlag(this->setFlag);
DeleteThisEntity(); DeleteThisEntity();
} }
} }

View File

@ -16,12 +16,12 @@ void sub_0805CC3C(Manager29* this);
void Manager29_Main(Manager29* this) { void Manager29_Main(Manager29* this) {
if (super->action == 0) { if (super->action == 0) {
sub_0805CBD0(this); sub_0805CBD0(this);
if (CheckFlags(this->unk_3e)) { if (CheckFlags(this->flag)) {
sub_0805CC3C(this); sub_0805CC3C(this);
DeleteManager(this); DeleteManager(this);
} }
} else if (sub_0805CF80(this)) { } else if (sub_0805CF80(this)) {
SetFlag(this->unk_3e); SetFlag(this->flag);
DeleteManager(this); DeleteManager(this);
} }
} }

View File

@ -146,12 +146,12 @@ void MiscManager_Type1(MiscManager* this) {
super->subAction = 8; super->subAction = 8;
super->subtimer = 2; super->subtimer = 2;
} }
if (CheckFlags(this->flags)) { if (CheckFlags(this->flag2)) {
DeleteManager(super); DeleteManager(super);
} }
break; break;
case 1: case 1:
if (CheckFlags(this->flags)) { if (CheckFlags(this->flag2)) {
super->action = 2; super->action = 2;
super->timer = 120; super->timer = 120;
RequestPriorityDuration((Entity*)this, 240); RequestPriorityDuration((Entity*)this, 240);
@ -172,7 +172,7 @@ void MiscManager_Type1(MiscManager* this) {
} }
break; break;
default: default:
SetFlag(this->flags); SetFlag(this->flag2);
SetPlayerControl(1); SetPlayerControl(1);
DeleteThisEntity(); DeleteThisEntity();
} }
@ -236,14 +236,14 @@ void MiscManager_Type5(MiscManager* this) {
} }
break; break;
case 0: case 0:
if (CheckFlags(this->flags)) { if (CheckFlags(this->flag2)) {
DeleteThisEntity(); DeleteThisEntity();
} }
super->action = 1; super->action = 1;
SetTileType(TILE_TYPE_869, TILE_LOCAL(this->x, this->y), super->type2); SetTileType(TILE_TYPE_869, TILE_LOCAL(this->x, this->y), super->type2);
break; break;
case 1: case 1:
if (CheckFlags(this->flags)) { if (CheckFlags(this->flag2)) {
RequestPriorityDuration((Entity*)this, 75); RequestPriorityDuration((Entity*)this, 75);
super->timer = 45; super->timer = 45;
super->action++; super->action++;
@ -254,14 +254,14 @@ void MiscManager_Type5(MiscManager* this) {
void MiscManager_Type6(MiscManager* this) { void MiscManager_Type6(MiscManager* this) {
if (super->action == 0) { if (super->action == 0) {
super->action = 1; super->action = 1;
super->type2 = CheckFlags(this->flags); super->type2 = CheckFlags(this->flag2);
if (super->type2) { if (super->type2) {
gRoomVars.lightLevel = this->y; gRoomVars.lightLevel = this->y;
} else { } else {
gRoomVars.lightLevel = this->x; gRoomVars.lightLevel = this->x;
} }
} else { } else {
u32 tmp = CheckFlags(this->flags); u32 tmp = CheckFlags(this->flag2);
if (super->type2 != tmp) { if (super->type2 != tmp) {
super->type2 = tmp; super->type2 = tmp;
if (tmp) { if (tmp) {
@ -304,12 +304,12 @@ void MiscManager_Type8(MiscManager* this) {
void MiscManager_Type9(MiscManager* this) { void MiscManager_Type9(MiscManager* this) {
if (super->action == 0) { if (super->action == 0) {
super->action = 1; super->action = 1;
if (CheckFlags(this->flags)) { if (CheckFlags(this->flag2)) {
sub_080592EC(this); sub_080592EC(this);
DeleteThisEntity(); DeleteThisEntity();
} }
} else { } else {
if (CheckFlags(this->flags)) { if (CheckFlags(this->flag2)) {
sub_080592EC(this); sub_080592EC(this);
sub_0805930C(this); sub_0805930C(this);
#ifndef EU #ifndef EU
@ -346,8 +346,8 @@ void SetDirtTile(u32 tilePos) {
void MiscManager_TypeA(MiscManager* this) { void MiscManager_TypeA(MiscManager* this) {
super->action = 1; super->action = 1;
if (this->unk_3c == gTextRender.curToken.textIndex) { if (this->flag1 == gTextRender.curToken.textIndex) {
SetFlag(this->flags); SetFlag(this->flag2);
DeleteThisEntity(); DeleteThisEntity();
} }
} }
@ -372,10 +372,10 @@ bool32 sub_080593CC(MiscManager* this) {
void MiscManager_TypeC(MiscManager* this) { void MiscManager_TypeC(MiscManager* this) {
Entity* tmp; Entity* tmp;
if (CheckFlags(this->flags)) { if (CheckFlags(this->flag2)) {
DeleteThisEntity(); DeleteThisEntity();
} }
if (!CheckFlags(this->unk_3c)) if (!CheckFlags(this->flag1))
return; return;
tmp = CreateObject(SPECIAL_FX, FX_BIG_EXPLOSION, 0); tmp = CreateObject(SPECIAL_FX, FX_BIG_EXPLOSION, 0);
if (!tmp) if (!tmp)
@ -388,7 +388,7 @@ void MiscManager_TypeC(MiscManager* this) {
} }
void MiscManager_TypeD(MiscManager* this) { void MiscManager_TypeD(MiscManager* this) {
if (!CheckFlags(this->flags)) { if (!CheckFlags(this->flag2)) {
SetPlayerControl(3); SetPlayerControl(3);
if (gRoomControls.reload_flags) if (gRoomControls.reload_flags)
return; return;

View File

@ -60,7 +60,7 @@ void TempleOfDropletsManager_Main(TempleOfDropletsManager* this) {
void TempleOfDropletsManager_Type0(TempleOfDropletsManager* this) { void TempleOfDropletsManager_Type0(TempleOfDropletsManager* this) {
if (super->action == 0) { if (super->action == 0) {
sub_0805A89C(this); sub_0805A89C(this);
if (!CheckLocalFlag(this->unk_3e)) { if (!CheckLocalFlag(this->localFlag)) {
this->unk_23 = 1; this->unk_23 = 1;
} else { } else {
this->unk_23 = 2; this->unk_23 = 2;
@ -83,7 +83,7 @@ void TempleOfDropletsManager_Type1(TempleOfDropletsManager* this) {
sub_0805A89C(this); sub_0805A89C(this);
this->unk_23 = 1; this->unk_23 = 1;
sub_0805AAF0(1); sub_0805AAF0(1);
if (!CheckLocalFlag(this->unk_3e)) { if (!CheckLocalFlag(this->localFlag)) {
super->action = 1; super->action = 1;
gScreen.lcd.displayControl &= 0xB7FF; gScreen.lcd.displayControl &= 0xB7FF;
} else { } else {
@ -144,12 +144,12 @@ void TempleOfDropletsManager_Type2(TempleOfDropletsManager* this) {
this->unk_23 = 1; this->unk_23 = 1;
} }
sub_0805AAF0(this->unk_23); sub_0805AAF0(this->unk_23);
if (!CheckLocalFlag(this->unk_3e)) { if (!CheckLocalFlag(this->localFlag)) {
ClearFlag(this->unk_3c); ClearFlag(this->flag);
super->action = 1; super->action = 1;
gScreen.lcd.displayControl &= ~(DISPCNT_WIN1_ON | DISPCNT_BG3_ON); gScreen.lcd.displayControl &= ~(DISPCNT_WIN1_ON | DISPCNT_BG3_ON);
} else { } else {
SetFlag(this->unk_3c); SetFlag(this->flag);
super->action = 3; super->action = 3;
gScreen.lcd.displayControl |= DISPCNT_WIN1_ON | DISPCNT_BG3_ON; gScreen.lcd.displayControl |= DISPCNT_WIN1_ON | DISPCNT_BG3_ON;
} }
@ -162,7 +162,7 @@ void TempleOfDropletsManager_Type2(TempleOfDropletsManager* this) {
void sub_0805A4CC(TempleOfDropletsManager*, u32); void sub_0805A4CC(TempleOfDropletsManager*, u32);
void TempleOfDropletsManager_Type1_Action1(TempleOfDropletsManager* this) { void TempleOfDropletsManager_Type1_Action1(TempleOfDropletsManager* this) {
if (CheckLocalFlag(this->unk_3e)) { if (CheckLocalFlag(this->localFlag)) {
super->action = 2; super->action = 2;
sub_0805A4CC(this, 0); sub_0805A4CC(this, 0);
} }
@ -171,12 +171,12 @@ void TempleOfDropletsManager_Type1_Action1(TempleOfDropletsManager* this) {
void TempleOfDropletsManager_Type2_Action2(TempleOfDropletsManager* this) { void TempleOfDropletsManager_Type2_Action2(TempleOfDropletsManager* this) {
if (super->subAction != 0) { if (super->subAction != 0) {
super->action = 3; super->action = 3;
SetFlag(this->unk_3c); SetFlag(this->flag);
} }
} }
void TempleOfDropletsManager_Type2_Action3(TempleOfDropletsManager* this) { void TempleOfDropletsManager_Type2_Action3(TempleOfDropletsManager* this) {
if (!CheckLocalFlag(this->unk_3e)) { if (!CheckLocalFlag(this->localFlag)) {
super->action = 4; super->action = 4;
sub_0805A4CC(this, 1); sub_0805A4CC(this, 1);
} }
@ -185,7 +185,7 @@ void TempleOfDropletsManager_Type2_Action3(TempleOfDropletsManager* this) {
void TempleOfDropletsManager_Type2_Action4(TempleOfDropletsManager* this) { void TempleOfDropletsManager_Type2_Action4(TempleOfDropletsManager* this) {
if (super->subAction != 0) { if (super->subAction != 0) {
super->action = 1; super->action = 1;
ClearFlag(this->unk_3c); ClearFlag(this->flag);
} }
} }
@ -363,7 +363,7 @@ void TempleOfDropletsManager_Type6_Action3(TempleOfDropletsManager* this) {
void TempleOfDropletsManager_Type7(TempleOfDropletsManager* this) { void TempleOfDropletsManager_Type7(TempleOfDropletsManager* this) {
switch (super->action) { switch (super->action) {
case 0: case 0:
if (CheckLocalFlag(this->unk_3e)) { if (CheckLocalFlag(this->localFlag)) {
super->action = 1; super->action = 1;
} else { } else {
super->action = 2; super->action = 2;
@ -373,7 +373,7 @@ void TempleOfDropletsManager_Type7(TempleOfDropletsManager* this) {
SetEntityPriority((Entity*)this, PRIO_PLAYER_EVENT); SetEntityPriority((Entity*)this, PRIO_PLAYER_EVENT);
break; break;
case 1: case 1:
if (CheckLocalFlag(this->unk_3e)) if (CheckLocalFlag(this->localFlag))
break; break;
super->action = 2; super->action = 2;
sub_0805A4CC(this, 4); sub_0805A4CC(this, 4);
@ -384,7 +384,7 @@ void TempleOfDropletsManager_Type7(TempleOfDropletsManager* this) {
} }
break; break;
case 3: case 3:
if (!CheckLocalFlag(this->unk_3e)) if (!CheckLocalFlag(this->localFlag))
break; break;
super->action = 4; super->action = 4;
sub_0805A4CC(this, 4); sub_0805A4CC(this, 4);

View File

@ -16,7 +16,7 @@ typedef struct {
/*0x6c*/ u16 unk_6c; /*0x6c*/ u16 unk_6c;
/*0x6e*/ u16 unk_6e; /*0x6e*/ u16 unk_6e;
/*0x70*/ u8 unk_70[0x16]; /*0x70*/ u8 unk_70[0x16];
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag;
} BigIceBlockEntity; } BigIceBlockEntity;
extern void (*const BigIceBlock_Actions[])(BigIceBlockEntity*); extern void (*const BigIceBlock_Actions[])(BigIceBlockEntity*);
@ -40,7 +40,7 @@ void BigIceBlock(BigIceBlockEntity* this) {
void BigIceBlock_Init(BigIceBlockEntity* this) { void BigIceBlock_Init(BigIceBlockEntity* this) {
Entity* obj; Entity* obj;
if (CheckFlags(this->unk_86)) { if (CheckFlags(this->flag)) {
DeleteThisEntity(); DeleteThisEntity();
} }
super->action = 1; super->action = 1;
@ -88,9 +88,9 @@ void BigIceBlock_Action2(BigIceBlockEntity* this) {
SetAffineInfo(super, 0x100, tmp, 0); SetAffineInfo(super, 0x100, tmp, 0);
if (super->type != 1) { if (super->type != 1) {
if (super->type != 2) { if (super->type != 2) {
SetFlag(this->unk_86); SetFlag(this->flag);
} else { } else {
CreateGroundItemWithFlags(super, ITEM_SMALL_KEY, 0, this->unk_86); CreateGroundItemWithFlags(super, ITEM_SMALL_KEY, 0, this->flag);
} }
} }
super->action = 3; super->action = 3;

View File

@ -12,7 +12,7 @@
typedef struct { typedef struct {
/*0x00*/ Entity base; /*0x00*/ Entity base;
/*0x68*/ u8 unused1[30]; /*0x68*/ u8 unused1[30];
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag;
} BigVortexEntity; } BigVortexEntity;
void sub_08098E3C(Entity*); void sub_08098E3C(Entity*);
@ -39,7 +39,7 @@ void BigVortex_Init(BigVortexEntity* this) {
super->action = 1; super->action = 1;
super->z.HALF.HI = -0x10; super->z.HALF.HI = -0x10;
temp = this->unk_86; temp = this->flag;
if ((temp != 0) && !CheckFlags(temp)) { if ((temp != 0) && !CheckFlags(temp)) {
super->action = 1; super->action = 1;
@ -55,7 +55,7 @@ void BigVortex_Init(BigVortexEntity* this) {
void BigVortex_Action1(BigVortexEntity* this) { void BigVortex_Action1(BigVortexEntity* this) {
Entity* fx; Entity* fx;
if (CheckFlags(this->unk_86)) { if (CheckFlags(this->flag)) {
super->action = 2; super->action = 2;
super->timer = 45; super->timer = 45;
fx = CreateFx(super, FX_BIG_EXPLOSION2, 0); fx = CreateFx(super, FX_BIG_EXPLOSION2, 0);

View File

@ -16,7 +16,7 @@ typedef struct {
/*0x68*/ u8 unused1[24]; /*0x68*/ u8 unused1[24];
/*0x80*/ u8 unk_80; /*0x80*/ u8 unk_80;
/*0x81*/ u8 unused2[5]; /*0x81*/ u8 unused2[5];
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag;
} BookEntity; } BookEntity;
extern void (*const Book_Actions[])(BookEntity*); extern void (*const Book_Actions[])(BookEntity*);
@ -46,7 +46,7 @@ void Book_Init(BookEntity* this) {
} }
super->spriteOffsetY = 3; super->spriteOffsetY = 3;
if (CheckFlags(this->unk_86)) { if (CheckFlags(this->flag)) {
if (super->type2 == 0) { if (super->type2 == 0) {
super->y.HALF.HI += 48; super->y.HALF.HI += 48;
} }
@ -145,7 +145,7 @@ void Book_Action3(BookEntity* this) {
super->action = 4; super->action = 4;
super->spritePriority.b0 = 4; super->spritePriority.b0 = 4;
SetFlag(this->unk_86); SetFlag(this->flag);
fx = CreateFx(super, FX_DEATH, 0); fx = CreateFx(super, FX_DEATH, 0);
if (fx != NULL) { if (fx != NULL) {

View File

@ -20,8 +20,8 @@ typedef struct {
/*0x7a*/ u16 unk_7a; /*0x7a*/ u16 unk_7a;
/*0x7c*/ u16 unk_7c; /*0x7c*/ u16 unk_7c;
/*0x7e*/ u8 unk_7e[6]; /*0x7e*/ u8 unk_7e[6];
/*0x84*/ u16 unk_84; /*0x84*/ u16 flags2;
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag;
} BossDoorEntity; } BossDoorEntity;
extern bool32 gUnk_02036BB8; extern bool32 gUnk_02036BB8;
@ -47,10 +47,10 @@ void BossDoor(BossDoorEntity* this) {
} }
void BossDoor_Init(BossDoorEntity* this) { void BossDoor_Init(BossDoorEntity* this) {
if ((this->unk_84 != 0xffff) && CheckFlags(this->unk_84)) { if ((this->flags2 != 0xffff) && CheckFlags(this->flags2)) {
DeleteThisEntity(); DeleteThisEntity();
} }
if ((this->unk_86 != BEGIN) && CheckFlags(this->unk_86)) { if ((this->flag != BEGIN) && CheckFlags(this->flag)) {
DeleteThisEntity(); DeleteThisEntity();
} }
super->type2 = super->type >> 2; super->type2 = super->type >> 2;
@ -86,7 +86,7 @@ void BossDoor_Action1(BossDoorEntity* this) {
if (super->interactType != INTERACTION_NONE) { if (super->interactType != INTERACTION_NONE) {
super->action = 2; super->action = 2;
RemoveInteractableObject(super); RemoveInteractableObject(super);
SetFlag(this->unk_86); SetFlag(this->flag);
} }
} }
@ -155,7 +155,7 @@ void BossDoor_Action5(BossDoorEntity* this) {
} }
void BossDoor_Action6(BossDoorEntity* this) { void BossDoor_Action6(BossDoorEntity* this) {
if (CheckFlags(this->unk_86)) { if (CheckFlags(this->flag)) {
super->action = 2; super->action = 2;
} }
} }

View File

@ -16,7 +16,7 @@ typedef struct {
/*0x74*/ u16 tilePos; /*0x74*/ u16 tilePos;
/*0x76*/ u8 unused2[14]; /*0x76*/ u8 unused2[14];
/*0x84*/ u16 unk_84; /*0x84*/ u16 unk_84;
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag;
} ButtonEntity; } ButtonEntity;
void Button_Init(ButtonEntity* this); void Button_Init(ButtonEntity* this);
@ -45,7 +45,7 @@ void Button_Init(ButtonEntity* this) {
this->tilePos = (((super->x.HALF.HI - gRoomControls.origin_x) >> 4) & 0x3F) | this->tilePos = (((super->x.HALF.HI - gRoomControls.origin_x) >> 4) & 0x3F) |
((((super->y.HALF.HI - gRoomControls.origin_y) >> 4) & 0x3F) << 6); ((((super->y.HALF.HI - gRoomControls.origin_y) >> 4) & 0x3F) << 6);
this->unk_72 = GetTileTypeAtTilePos(this->tilePos, super->collisionLayer); this->unk_72 = GetTileTypeAtTilePos(this->tilePos, super->collisionLayer);
if (super->type == 0 && CheckFlags(this->unk_86)) { if (super->type == 0 && CheckFlags(this->flag)) {
super->action = 5; super->action = 5;
SetTileType(TILE_TYPE_122, this->tilePos, super->collisionLayer); SetTileType(TILE_TYPE_122, this->tilePos, super->collisionLayer);
} else { } else {
@ -114,7 +114,7 @@ void Button_Action4(ButtonEntity* this) {
} }
} else { } else {
super->action = 2; super->action = 2;
ClearFlag(this->unk_86); ClearFlag(this->flag);
SetTileType(TILE_TYPE_119, this->tilePos, super->collisionLayer); SetTileType(TILE_TYPE_119, this->tilePos, super->collisionLayer);
SoundReq(SFX_BUTTON_PRESS); SoundReq(SFX_BUTTON_PRESS);
} }
@ -276,7 +276,7 @@ bool32 sub_08081F7C(ButtonEntity* this, u32 tileType) {
super->child->spriteOffsetY = -4; super->child->spriteOffsetY = -4;
} else { } else {
if (super->timer == 6) { if (super->timer == 6) {
SetFlag(this->unk_86); SetFlag(this->flag);
SetTileType(tileType, this->tilePos, super->collisionLayer); SetTileType(tileType, this->tilePos, super->collisionLayer);
sub_08081F24(super); sub_08081F24(super);
SoundReq(SFX_BUTTON_PRESS); SoundReq(SFX_BUTTON_PRESS);

View File

@ -17,7 +17,7 @@ typedef struct {
/*0x70*/ u16 tilePos; /*0x70*/ u16 tilePos;
/*0x72*/ u16 unk_72; /*0x72*/ u16 unk_72;
/*0x74*/ u8 unk_74[0x12]; /*0x74*/ u8 unk_74[0x12];
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag;
} ChestSpawnerEntity; } ChestSpawnerEntity;
extern const Hitbox gUnk_0811F8A8; extern const Hitbox gUnk_0811F8A8;
@ -84,7 +84,7 @@ void ChestSpawner_Type2Init(ChestSpawnerEntity* this) {
sub_080842D8(this); sub_080842D8(this);
InitializeAnimation(super, 1); InitializeAnimation(super, 1);
} else { } else {
if (CheckFlags(this->unk_86) || super->type == 4) { if (CheckFlags(this->flag) || super->type == 4) {
sub_08083E20(this); sub_08083E20(this);
} else { } else {
super->action = 1; super->action = 1;
@ -94,7 +94,7 @@ void ChestSpawner_Type2Init(ChestSpawnerEntity* this) {
} }
void ChestSpawner_Type2Action1(ChestSpawnerEntity* this) { void ChestSpawner_Type2Action1(ChestSpawnerEntity* this) {
if (CheckFlags(this->unk_86)) { if (CheckFlags(this->flag)) {
gScreen.controls.layerFXControl = 0xf40; gScreen.controls.layerFXControl = 0xf40;
gScreen.controls.alphaBlend = 0x1000; gScreen.controls.alphaBlend = 0x1000;
gPauseMenuOptions.disabled = 1; gPauseMenuOptions.disabled = 1;
@ -235,7 +235,7 @@ void ChestSpawner_Type0Init(ChestSpawnerEntity* this) {
if (GetTileTypeAtEntity(super) == TILE_TYPE_116) { if (GetTileTypeAtEntity(super) == TILE_TYPE_116) {
DeleteThisEntity(); DeleteThisEntity();
} }
if (CheckFlags(this->unk_86)) { if (CheckFlags(this->flag)) {
super->action = 3; super->action = 3;
sub_0807B7D8(0x73, this->tilePos, super->collisionLayer); sub_0807B7D8(0x73, this->tilePos, super->collisionLayer);
if ((super->type & 1) == 0) { if ((super->type & 1) == 0) {
@ -245,7 +245,7 @@ void ChestSpawner_Type0Init(ChestSpawnerEntity* this) {
} }
void ChestSpawner_Type0Action1(ChestSpawnerEntity* this) { void ChestSpawner_Type0Action1(ChestSpawnerEntity* this) {
if (CheckFlags(this->unk_86)) { if (CheckFlags(this->flag)) {
super->action = 2; super->action = 2;
} }
} }
@ -274,7 +274,7 @@ void ChestSpawner_Type0Action3(ChestSpawnerEntity* this) {
if (GetTileTypeAtEntity(super) == TILE_TYPE_116) { if (GetTileTypeAtEntity(super) == TILE_TYPE_116) {
DeleteEntity(super); DeleteEntity(super);
} else { } else {
if (!CheckFlags(this->unk_86)) { if (!CheckFlags(this->flag)) {
if (this->unk_72 != 0) { if (this->unk_72 != 0) {
this->unk_72--; this->unk_72--;
} else { } else {

View File

@ -15,7 +15,7 @@ typedef struct {
/*0x82*/ u16 unk_82; /*0x82*/ u16 unk_82;
/*0x84*/ u8 unk_84; /*0x84*/ u8 unk_84;
/*0x85*/ u8 unk_85; /*0x85*/ u8 unk_85;
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag;
} DoubleBookshelfEntity; } DoubleBookshelfEntity;
void sub_0809B334(DoubleBookshelfEntity*); void sub_0809B334(DoubleBookshelfEntity*);
@ -59,7 +59,7 @@ void DoubleBookshelf_Init(DoubleBookshelfEntity* this) {
if (child != NULL) { if (child != NULL) {
(child->base).parent = super; (child->base).parent = super;
super->child = &child->base; super->child = &child->base;
if (CheckFlags(this->unk_86) == 0) { if (CheckFlags(this->flag) == 0) {
PositionRelative(super, &child->base, 0x100000, 0x100000); PositionRelative(super, &child->base, 0x100000, 0x100000);
child->unk_84 = 0; child->unk_84 = 0;
} else { } else {
@ -118,7 +118,7 @@ void sub_0809B0B0(DoubleBookshelfEntity* this) {
SetTile(SPECIAL_TILE_130, tilePos + 3, layer); SetTile(SPECIAL_TILE_130, tilePos + 3, layer);
SetTile(SPECIAL_TILE_34, tilePos + 2, layer); SetTile(SPECIAL_TILE_34, tilePos + 2, layer);
SetTile(SPECIAL_TILE_95, tilePos, layer); SetTile(SPECIAL_TILE_95, tilePos, layer);
SetFlag(((DoubleBookshelfEntity*)super->parent)->unk_86); SetFlag(((DoubleBookshelfEntity*)super->parent)->flag);
break; break;
case 3: case 3:
this->unk_84 = 0; this->unk_84 = 0;
@ -126,7 +126,7 @@ void sub_0809B0B0(DoubleBookshelfEntity* this) {
SetTile(SPECIAL_TILE_130, tilePos - 1, layer); SetTile(SPECIAL_TILE_130, tilePos - 1, layer);
SetTile(SPECIAL_TILE_34, tilePos, layer); SetTile(SPECIAL_TILE_34, tilePos, layer);
SetTile(SPECIAL_TILE_95, tilePos + 2, layer); SetTile(SPECIAL_TILE_95, tilePos + 2, layer);
ClearFlag(((DoubleBookshelfEntity*)super->parent)->unk_86); ClearFlag(((DoubleBookshelfEntity*)super->parent)->flag);
break; break;
case 4: case 4:
SetTile(SPECIAL_TILE_34, tilePos, layer); SetTile(SPECIAL_TILE_34, tilePos, layer);

View File

@ -10,7 +10,7 @@
typedef struct { typedef struct {
/*0x00*/ Entity base; /*0x00*/ Entity base;
/*0x68*/ u8 unk_68[0x1e]; /*0x68*/ u8 unk_68[0x1e];
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag;
} EnemyItemEntity; } EnemyItemEntity;
void sub_080A2500(EnemyItemEntity*); void sub_080A2500(EnemyItemEntity*);
@ -21,7 +21,7 @@ void EnemyItem(EnemyItemEntity* this) {
Entity* entity; Entity* entity;
LinkedList* list; LinkedList* list;
if (CheckFlags(this->unk_86)) { if (CheckFlags(this->flag)) {
sub_080A2500(this); sub_080A2500(this);
} }
if (super->action == 0) { if (super->action == 0) {
@ -63,7 +63,7 @@ void sub_080A2508(EnemyItemEntity* this) {
entity = (EnemyItemEntity*)CreateObjectWithParent(super, GROUND_ITEM, super->type, 0); entity = (EnemyItemEntity*)CreateObjectWithParent(super, GROUND_ITEM, super->type, 0);
if (entity != NULL) { if (entity != NULL) {
(entity->base).timer = 5; (entity->base).timer = 5;
entity->unk_86 = this->unk_86; entity->flag = this->flag;
} }
sub_080A2500(this); sub_080A2500(this);
} }
@ -74,7 +74,7 @@ void sub_080A2534(EnemyItemEntity* this) {
entity = (EnemyItemEntity*)CreateObjectWithParent(super, GROUND_ITEM, super->type, 0); entity = (EnemyItemEntity*)CreateObjectWithParent(super, GROUND_ITEM, super->type, 0);
if (entity != NULL) { if (entity != NULL) {
(entity->base).timer = 4; (entity->base).timer = 4;
entity->unk_86 = this->unk_86; entity->flag = this->flag;
} }
sub_080A2500(this); sub_080A2500(this);
} }

View File

@ -33,7 +33,7 @@ void Fairy_SubAction0(FairyEntity*);
void Fairy_SubAction1(FairyEntity*); void Fairy_SubAction1(FairyEntity*);
void Fairy_SubAction2(FairyEntity*); void Fairy_SubAction2(FairyEntity*);
extern void sub_08081404(Entity*, u32); extern void ItemOnGround_SetFlagAndDelete(Entity*, u32);
void Fairy(FairyEntity* this) { void Fairy(FairyEntity* this) {
static void (*const Fairy_Actions[])(FairyEntity*) = { static void (*const Fairy_Actions[])(FairyEntity*) = {
@ -167,7 +167,7 @@ void Fairy_Action2(FairyEntity* this) {
ProcessMovement1(super); ProcessMovement1(super);
if ((AnyPrioritySet() == 0) && (super->type2 == 0)) { if ((AnyPrioritySet() == 0) && (super->type2 == 0)) {
if (--this->unk_78 == 0) { if (--this->unk_78 == 0) {
sub_08081404(super, 0); ItemOnGround_SetFlagAndDelete(super, FALSE);
} }
if (this->unk_78 < 0x78) { if (this->unk_78 < 0x78) {
super->spriteSettings.draw ^= 1; super->spriteSettings.draw ^= 1;
@ -177,7 +177,7 @@ void Fairy_Action2(FairyEntity* this) {
void Fairy_Action3(FairyEntity* this) { void Fairy_Action3(FairyEntity* this) {
if (*(u16*)&super->child->kind != 0x308) { if (*(u16*)&super->child->kind != 0x308) {
sub_08081404(super, 0); ItemOnGround_SetFlagAndDelete(super, FALSE);
} else { } else {
CopyPosition(super->child, super); CopyPosition(super->child, super);
super->z.HALF.HI--; super->z.HALF.HI--;
@ -214,7 +214,7 @@ void Fairy_Action4(FairyEntity* this) {
if (--super->subtimer == 0) { if (--super->subtimer == 0) {
super->subtimer = 6; super->subtimer = 6;
if (--super->spriteOffsetY < -0x16) { if (--super->spriteOffsetY < -0x16) {
sub_08081404(super, 1); ItemOnGround_SetFlagAndDelete(super, TRUE);
} }
} }
if (super->spriteOffsetY < -0x11) { if (super->spriteOffsetY < -0x11) {

View File

@ -11,7 +11,7 @@
typedef struct { typedef struct {
/*0x00*/ Entity base; /*0x00*/ Entity base;
/*0x68*/ u8 unused1[30]; /*0x68*/ u8 unused1[30];
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag;
} FireplaceEntity; } FireplaceEntity;
void Fireplace_Action1(FireplaceEntity* this); void Fireplace_Action1(FireplaceEntity* this);
@ -31,7 +31,7 @@ void Fireplace_Init(FireplaceEntity* this) {
super->action = 1; super->action = 1;
super->spriteSettings.draw = 1; super->spriteSettings.draw = 1;
super->speed = 0x80; super->speed = 0x80;
if (CheckFlags(this->unk_86)) { if (CheckFlags(this->flag)) {
sub_0809B7DC(this); sub_0809B7DC(this);
DeleteThisEntity(); DeleteThisEntity();
} else { } else {
@ -44,7 +44,7 @@ void Fireplace_Init(FireplaceEntity* this) {
void Fireplace_Action1(FireplaceEntity* this) { void Fireplace_Action1(FireplaceEntity* this) {
sub_0809B7C0(this); sub_0809B7C0(this);
if (super->timer) { if (super->timer) {
SetFlag(this->unk_86); SetFlag(this->flag);
DeleteThisEntity(); DeleteThisEntity();
} }
} }

View File

@ -12,7 +12,7 @@
typedef struct { typedef struct {
/*0x00*/ Entity base; /*0x00*/ Entity base;
/*0x68*/ u8 unused1[30]; /*0x68*/ u8 unused1[30];
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag;
} FlameEntity; } FlameEntity;
extern void sub_0807AB44(Entity*, s32, s32); extern void sub_0807AB44(Entity*, s32, s32);
@ -43,7 +43,7 @@ void Flame_Init(FlameEntity* this) {
CopyPosition(super->parent, super); CopyPosition(super->parent, super);
break; break;
case 4: case 4:
if (!CheckFlags(this->unk_86)) { if (!CheckFlags(this->flag)) {
super->spriteSettings.draw = FALSE; super->spriteSettings.draw = FALSE;
super->subAction = 1; super->subAction = 1;
return; return;
@ -85,7 +85,7 @@ void Flame_Action1(FlameEntity* this) {
CopyPosition(super->parent, super); CopyPosition(super->parent, super);
break; break;
case 4: case 4:
val = CheckFlags(this->unk_86); val = CheckFlags(this->flag);
if (super->subAction == 0) { if (super->subAction == 0) {
if (val) if (val)
return; return;

View File

@ -14,8 +14,8 @@
typedef struct { typedef struct {
/*0x00*/ Entity base; /*0x00*/ Entity base;
/*0x68*/ u8 unused1[28]; /*0x68*/ u8 unused1[28];
/*0x84*/ u16 unk_84; /*0x84*/ u16 flag;
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag2;
} HeartContainerEntity; } HeartContainerEntity;
static void HeartContainer_Init(HeartContainerEntity* this); static void HeartContainer_Init(HeartContainerEntity* this);
@ -37,7 +37,7 @@ void HeartContainer(HeartContainerEntity* this) {
} }
static void HeartContainer_Init(HeartContainerEntity* this) { static void HeartContainer_Init(HeartContainerEntity* this) {
if (CheckFlags(this->unk_84)) { if (CheckFlags(this->flag)) {
DeleteThisEntity(); DeleteThisEntity();
} }
super->action = 1; super->action = 1;
@ -49,7 +49,7 @@ static void HeartContainer_Init(HeartContainerEntity* this) {
} }
static void HeartContainer_Action1(HeartContainerEntity* this) { static void HeartContainer_Action1(HeartContainerEntity* this) {
if (CheckFlags(this->unk_86)) { if (CheckFlags(this->flag2)) {
super->action = 2; super->action = 2;
super->spriteSettings.draw = 1; super->spriteSettings.draw = 1;
super->spriteRendering.b0 = 3; super->spriteRendering.b0 = 3;
@ -74,7 +74,7 @@ static void HeartContainer_Action2(HeartContainerEntity* this) {
static void HeartContainer_Action3(HeartContainerEntity* this) { static void HeartContainer_Action3(HeartContainerEntity* this) {
sub_08080CB4(super); sub_08080CB4(super);
if (!(gPlayerState.flags & PL_MINISH) && IsCollidingPlayer(super)) { if (!(gPlayerState.flags & PL_MINISH) && IsCollidingPlayer(super)) {
SetFlag(this->unk_84); SetFlag(this->flag);
CreateItemEntity(ITEM_HEART_CONTAINER, 0, 0); CreateItemEntity(ITEM_HEART_CONTAINER, 0, 0);
DeleteThisEntity(); DeleteThisEntity();
} }

View File

@ -15,7 +15,7 @@ typedef struct {
/*0x68*/ u8 unused1[8]; /*0x68*/ u8 unused1[8];
/*0x70*/ u16 unk_70; /*0x70*/ u16 unk_70;
/*0x72*/ u8 unused2[20]; /*0x72*/ u8 unused2[20];
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag;
} HiddenLadderDownEntity; } HiddenLadderDownEntity;
void HiddenLadderDown_Init(HiddenLadderDownEntity* this); void HiddenLadderDown_Init(HiddenLadderDownEntity* this);
@ -39,7 +39,7 @@ void HiddenLadderDown_Init(HiddenLadderDownEntity* this) {
super->animIndex = 0; super->animIndex = 0;
this->unk_70 = COORD_TO_TILE(super); this->unk_70 = COORD_TO_TILE(super);
puVar3 = &this->unk_70; puVar3 = &this->unk_70;
if (CheckFlags(this->unk_86) != 0) { if (CheckFlags(this->flag) != 0) {
super->action = 2; super->action = 2;
super->spriteSettings.draw = TRUE; super->spriteSettings.draw = TRUE;
SetTileType(TILE_TYPE_418, *puVar3 + TILE_POS(-1, -1), super->collisionLayer); SetTileType(TILE_TYPE_418, *puVar3 + TILE_POS(-1, -1), super->collisionLayer);
@ -58,6 +58,6 @@ void HiddenLadderDown_Action1(HiddenLadderDownEntity* this) {
if (GetTileTypeAtTilePos(this->unk_70, super->collisionLayer) == 0x1a6) { if (GetTileTypeAtTilePos(this->unk_70, super->collisionLayer) == 0x1a6) {
super->action = 2; super->action = 2;
super->spriteSettings.draw = TRUE; super->spriteSettings.draw = TRUE;
SetFlag(this->unk_86); SetFlag(this->flag);
} }
} }

View File

@ -51,7 +51,7 @@ void sub_080813D4(ItemOnGroundEntity* this);
void sub_080813E8(ItemOnGroundEntity* this); void sub_080813E8(ItemOnGroundEntity* this);
void sub_080813F0(ItemOnGroundEntity* this); void sub_080813F0(ItemOnGroundEntity* this);
bool32 CheckShouldPlayItemGetCutscene(ItemOnGroundEntity* this); bool32 CheckShouldPlayItemGetCutscene(ItemOnGroundEntity* this);
void sub_08081404(ItemOnGroundEntity*, u32); void ItemOnGround_SetFlagAndDelete(ItemOnGroundEntity*, u32);
typedef struct { typedef struct {
u8 unk0[2]; u8 unk0[2];
@ -107,7 +107,7 @@ void ItemOnGround_Init(ItemOnGroundEntity* this) {
sub_080810A8, sub_080810FC, sub_08081150, sub_08081134, sub_08081188, sub_080810A8, sub_080810A8, sub_080810FC, sub_08081150, sub_08081134, sub_08081188, sub_080810A8,
sub_080810A8, sub_080811AC, sub_080811C8, sub_080811D8, sub_080810A8, sub_080810A8, sub_080811AC, sub_080811C8, sub_080811D8, sub_080810A8,
}; };
if (this->unk_86 && CheckFlags(this->unk_86)) { if (this->flag && CheckFlags(this->flag)) {
DeleteThisEntity(); DeleteThisEntity();
} }
@ -257,7 +257,7 @@ void ItemOnGround_Action2(ItemOnGroundEntity* this) {
void sub_08081248(ItemOnGroundEntity* this) { void sub_08081248(ItemOnGroundEntity* this) {
sub_08081500(this); sub_08081500(this);
if (sub_080814C0(this)) { if (sub_080814C0(this)) {
sub_08081404(this, 0); ItemOnGround_SetFlagAndDelete(this, FALSE);
} else { } else {
sub_0800442E(super); sub_0800442E(super);
} }
@ -270,7 +270,7 @@ void sub_0808126C(ItemOnGroundEntity* this) {
void sub_0808127C(ItemOnGroundEntity* this) { void sub_0808127C(ItemOnGroundEntity* this) {
if (sub_080814C0(this)) { if (sub_080814C0(this)) {
sub_08081404(this, 0); ItemOnGround_SetFlagAndDelete(this, FALSE);
} else { } else {
sub_0808153C(this); sub_0808153C(this);
} }
@ -311,7 +311,7 @@ void nullsub_510(ItemOnGroundEntity* this) {
void ItemOnGround_Action3(ItemOnGroundEntity* this) { void ItemOnGround_Action3(ItemOnGroundEntity* this) {
Entity* other = super->child; Entity* other = super->child;
if (!(other->kind == PLAYER_ITEM && other->id == 3)) { if (!(other->kind == PLAYER_ITEM && other->id == 3)) {
sub_08081404(this, 0); ItemOnGround_SetFlagAndDelete(this, FALSE);
} else { } else {
CopyPosition(other, super); CopyPosition(other, super);
super->z.HALF.HI--; super->z.HALF.HI--;
@ -331,7 +331,7 @@ void ItemOnGround_Action4(ItemOnGroundEntity* this) {
super->spriteRendering.b3 = other->spriteRendering.b3; super->spriteRendering.b3 = other->spriteRendering.b3;
GravityUpdate(super, Q_8_8(40.0)); GravityUpdate(super, Q_8_8(40.0));
} else { } else {
sub_08081404(this, 1); ItemOnGround_SetFlagAndDelete(this, TRUE);
} }
} }
@ -360,9 +360,9 @@ void sub_080813F0(ItemOnGroundEntity* this) {
} }
} }
void sub_08081404(ItemOnGroundEntity* this, u32 arg1) { void ItemOnGround_SetFlagAndDelete(ItemOnGroundEntity* this, bool32 doSetFlag) {
if (arg1 && this->unk_86) { if (doSetFlag && this->flag) {
SetFlag(this->unk_86); SetFlag(this->flag);
} }
DeleteThisEntity(); DeleteThisEntity();
@ -472,7 +472,7 @@ void sub_0808153C(ItemOnGroundEntity* this) {
void sub_08081598(ItemOnGroundEntity* this) { void sub_08081598(ItemOnGroundEntity* this) {
if (super->health == 0) { if (super->health == 0) {
sub_08081404(this, 1); ItemOnGround_SetFlagAndDelete(this, 1);
} }
COLLISION_OFF(super); COLLISION_OFF(super);
@ -486,6 +486,6 @@ void sub_08081598(ItemOnGroundEntity* this) {
CopyPosition(super->child, super); CopyPosition(super->child, super);
super->z.HALF.HI -= 4; super->z.HALF.HI -= 4;
if (super->type != 0x5F && sub_08081420(this)) { if (super->type != 0x5F && sub_08081420(this)) {
sub_08081404(this, 1); ItemOnGround_SetFlagAndDelete(this, 1);
} }
} }

View File

@ -14,7 +14,7 @@
typedef struct { typedef struct {
/*0x00*/ Entity base; /*0x00*/ Entity base;
/*0x68*/ u8 unused1[30]; /*0x68*/ u8 unused1[30];
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag;
} JailBarsEntity; } JailBarsEntity;
static void SetJailBarTiles(JailBarsEntity* this, u32); static void SetJailBarTiles(JailBarsEntity* this, u32);
@ -34,7 +34,7 @@ void JailBars(JailBarsEntity* this) {
} }
void JailBars_Init(JailBarsEntity* this) { void JailBars_Init(JailBarsEntity* this) {
if (CheckFlags(this->unk_86) == 0) { if (CheckFlags(this->flag) == 0) {
super->action = 1; super->action = 1;
SetJailBarTiles(this, 0); SetJailBarTiles(this, 0);
} else { } else {
@ -48,7 +48,7 @@ void JailBars_Init(JailBarsEntity* this) {
} }
void JailBars_Action1(JailBarsEntity* this) { void JailBars_Action1(JailBarsEntity* this) {
if (CheckFlags(this->unk_86) != 0) { if (CheckFlags(this->flag) != 0) {
super->action = 2; super->action = 2;
SetJailBarTiles(this, 1); SetJailBarTiles(this, 1);
SoundReq(SFX_10B); SoundReq(SFX_10B);

View File

@ -12,7 +12,7 @@
typedef struct { typedef struct {
/*0x00*/ Entity base; /*0x00*/ Entity base;
/*0x68*/ u8 unk_68[30]; /*0x68*/ u8 unk_68[30];
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag;
} LightDoorEntity; } LightDoorEntity;
void LightDoor_Init(LightDoorEntity*); void LightDoor_Init(LightDoorEntity*);
@ -31,7 +31,7 @@ void LightDoor(LightDoorEntity* this) {
void LightDoor_Init(LightDoorEntity* this) { void LightDoor_Init(LightDoorEntity* this) {
if (super->type == 0) { if (super->type == 0) {
if (CheckFlags(this->unk_86)) { if (CheckFlags(this->flag)) {
DeleteThisEntity(); DeleteThisEntity();
} }
super->action = 1; super->action = 1;

View File

@ -19,8 +19,8 @@ typedef struct {
/*0x68*/ u8 unused1[12]; /*0x68*/ u8 unused1[12];
/*0x74*/ u16 unk_74; /*0x74*/ u16 unk_74;
/*0x76*/ u8 unused2[14]; /*0x76*/ u8 unused2[14];
/*0x84*/ u16 unk_84; /*0x84*/ u16 flag1;
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag2;
} LightableSwitchEntity; } LightableSwitchEntity;
static void sub_0809EB30(LightableSwitchEntity* this); static void sub_0809EB30(LightableSwitchEntity* this);
@ -69,10 +69,10 @@ void LightableSwitch_Type0_Init(LightableSwitchEntity* this) {
void LightableSwitch_Type0_Action1(LightableSwitchEntity* this) { void LightableSwitch_Type0_Action1(LightableSwitchEntity* this) {
if ((super->contactFlags & CONTACT_NOW) != 0) { if ((super->contactFlags & CONTACT_NOW) != 0) {
if (CheckFlags(this->unk_86) != 0) { if (CheckFlags(this->flag2) != 0) {
ClearFlag(this->unk_86); ClearFlag(this->flag2);
} else { } else {
SetFlag(this->unk_86); SetFlag(this->flag2);
} }
EnqueueSFX(SFX_110); EnqueueSFX(SFX_110);
} }
@ -82,7 +82,7 @@ void LightableSwitch_Type0_Action1(LightableSwitchEntity* this) {
static void sub_0809EABC(LightableSwitchEntity* this) { static void sub_0809EABC(LightableSwitchEntity* this) {
bool32 anySet = 0; bool32 anySet = 0;
if (CheckFlags(this->unk_86)) { if (CheckFlags(this->flag2)) {
anySet = 1; anySet = 1;
} }
if (super->frameIndex != anySet) { if (super->frameIndex != anySet) {
@ -141,7 +141,7 @@ void LightableSwitch_Type1_Init(LightableSwitchEntity* this) {
super->hitbox = (Hitbox*)&gHitbox_0; super->hitbox = (Hitbox*)&gHitbox_0;
sub_0809EAD8(this); sub_0809EAD8(this);
UpdateSpriteForCollisionLayer(super); UpdateSpriteForCollisionLayer(super);
if (CheckFlags(this->unk_84)) { if (CheckFlags(this->flag1)) {
super->action = 3; super->action = 3;
super->frameIndex = 2; super->frameIndex = 2;
} }
@ -152,21 +152,21 @@ void LightableSwitch_Type1_Action1(LightableSwitchEntity* this) {
super->action = 2; super->action = 2;
super->timer = 16; super->timer = 16;
super->frameIndex = 2; super->frameIndex = 2;
SetFlag(this->unk_86); SetFlag(this->flag2);
EnqueueSFX(SFX_110); EnqueueSFX(SFX_110);
} }
} }
void LightableSwitch_Type1_Action2(LightableSwitchEntity* this) { void LightableSwitch_Type1_Action2(LightableSwitchEntity* this) {
if (CheckFlags(this->unk_84)) { if (CheckFlags(this->flag1)) {
super->action = 3; super->action = 3;
} else { } else {
if (--super->timer == 0) { if (--super->timer == 0) {
super->action = 1; super->action = 1;
super->frameIndex = 3; super->frameIndex = 3;
ClearFlag(this->unk_86); ClearFlag(this->flag2);
EnqueueSFX(SFX_110); EnqueueSFX(SFX_110);
} }
} }

View File

@ -15,12 +15,12 @@ typedef struct {
/*0x68*/ u16 unk_68; /*0x68*/ u16 unk_68;
/*0x6a*/ u16 unk_6a; /*0x6a*/ u16 unk_6a;
/*0x6c*/ u8 unused1[26]; /*0x6c*/ u8 unused1[26];
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag;
} LitAreaEntity; } LitAreaEntity;
void LitArea(LitAreaEntity* this) { void LitArea(LitAreaEntity* this) {
if (super->action == 0) { if (super->action == 0) {
if (this->unk_86 != 0 && CheckFlags(this->unk_86) == 0) { if (this->flag != 0 && CheckFlags(this->flag) == 0) {
return; return;
} }
super->spriteSettings.draw = 1; super->spriteSettings.draw = 1;

View File

@ -25,8 +25,8 @@ typedef struct {
/*0x78*/ u8 unused2[6]; /*0x78*/ u8 unused2[6];
/*0x7e*/ u8 unk_7e; /*0x7e*/ u8 unk_7e;
/*0x7f*/ u8 unused3[5]; /*0x7f*/ u8 unused3[5];
/*0x84*/ u16 unk_84; /*0x84*/ u16 flags;
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag;
} LockedDoorEntity; } LockedDoorEntity;
void LockedDoor_Init(LockedDoorEntity* this); void LockedDoor_Init(LockedDoorEntity* this);
@ -102,7 +102,7 @@ const u8 gLockedDoorInteractDirections[] = {
}; };
void LockedDoor_Init(LockedDoorEntity* this) { void LockedDoor_Init(LockedDoorEntity* this) {
if (this->unk_84 != 0xFFFF && CheckFlags(this->unk_84)) { if (this->flags != 0xFFFF && CheckFlags(this->flags)) {
DeleteThisEntity(); DeleteThisEntity();
} }
if (!sub_080837B0(this)) if (!sub_080837B0(this))
@ -120,7 +120,7 @@ void LockedDoor_Init(LockedDoorEntity* this) {
this->unk_74 = GetTileIndex(this->unk_76, super->collisionLayer); this->unk_74 = GetTileIndex(this->unk_76, super->collisionLayer);
switch (super->type2) { switch (super->type2) {
case 0: case 0:
if (!CheckFlags(this->unk_86)) { if (!CheckFlags(this->flag)) {
if (super->type & 0x10) { if (super->type & 0x10) {
super->action = 3; super->action = 3;
} else { } else {
@ -132,14 +132,14 @@ void LockedDoor_Init(LockedDoorEntity* this) {
} }
break; break;
case 1: case 1:
if (!CheckFlags(this->unk_86)) { if (!CheckFlags(this->flag)) {
sub_08083638(this); sub_08083638(this);
} else { } else {
sub_080836A0(this); sub_080836A0(this);
} }
break; break;
case 2: case 2:
if (!CheckFlags(this->unk_86)) { if (!CheckFlags(this->flag)) {
super->frameIndex |= 4; super->frameIndex |= 4;
sub_080836DC(super, this->unk_7e, this->unk_76); sub_080836DC(super, this->unk_7e, this->unk_76);
if (!AreaIsDungeon()) { if (!AreaIsDungeon()) {
@ -209,10 +209,10 @@ void LockedDoor_Action5(LockedDoorEntity* this) {
void LockedDoor_Action6(LockedDoorEntity* this) { void LockedDoor_Action6(LockedDoorEntity* this) {
if (super->type2 == 0) { if (super->type2 == 0) {
if (!CheckFlags(this->unk_86)) if (!CheckFlags(this->flag))
return; return;
} else { } else {
if (CheckFlags(this->unk_86)) if (CheckFlags(this->flag))
return; return;
} }
sub_08083658(this); sub_08083658(this);
@ -220,22 +220,22 @@ void LockedDoor_Action6(LockedDoorEntity* this) {
void LockedDoor_Action7(LockedDoorEntity* this) { void LockedDoor_Action7(LockedDoorEntity* this) {
if (super->type2 == 0) { if (super->type2 == 0) {
if (CheckFlags(this->unk_86)) if (CheckFlags(this->flag))
return; return;
} else { } else {
if (!CheckFlags(this->unk_86)) if (!CheckFlags(this->flag))
return; return;
} }
super->action = 3; super->action = 3;
} }
void LockedDoor_Action8(LockedDoorEntity* this) { void LockedDoor_Action8(LockedDoorEntity* this) {
if (super->interactType == INTERACTION_NONE && !CheckFlags(this->unk_86)) if (super->interactType == INTERACTION_NONE && !CheckFlags(this->flag))
return; return;
super->action = 1; super->action = 1;
super->timer = 20; super->timer = 20;
sub_08083658(this); sub_08083658(this);
SetFlag(this->unk_86); SetFlag(this->flag);
ModDungeonKeys(-1); ModDungeonKeys(-1);
} }

View File

@ -16,7 +16,7 @@ typedef struct {
/*0x7c*/ u16 unk_7c; /*0x7c*/ u16 unk_7c;
/*0x7e*/ u16 unk_7e; /*0x7e*/ u16 unk_7e;
/*0x80*/ u8 unused2[6]; /*0x80*/ u8 unused2[6];
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag;
} MaskEntity; } MaskEntity;
void Mask_Init(MaskEntity* this); void Mask_Init(MaskEntity* this);
@ -36,7 +36,7 @@ void Mask(MaskEntity* this) {
void Mask_Init(MaskEntity* this) { void Mask_Init(MaskEntity* this) {
if (super->type2 & 0xC0) { if (super->type2 & 0xC0) {
if (CheckFlags(this->unk_86)) { if (CheckFlags(this->flag)) {
s32 field_0x0a; s32 field_0x0a;
switch (super->type2 & 0xC0) { switch (super->type2 & 0xC0) {
@ -49,7 +49,7 @@ void Mask_Init(MaskEntity* this) {
DeleteThisEntity(); DeleteThisEntity();
break; break;
default: default:
ClearFlag(this->unk_86); ClearFlag(this->flag);
} }
break; break;
@ -122,7 +122,7 @@ void Mask_Action2(MaskEntity* this) {
case 0x80: case 0x80:
EnqueueSFX(SFX_SECRET); EnqueueSFX(SFX_SECRET);
case 0x40: case 0x40:
SetFlag(this->unk_86); SetFlag(this->flag);
break; break;
} }

View File

@ -24,8 +24,8 @@ typedef struct {
/*0x78*/ u16 unk_78; /*0x78*/ u16 unk_78;
/*0x7a*/ u16 unk_7a; /*0x7a*/ u16 unk_7a;
/*0x7c*/ u8 unused2[8]; /*0x7c*/ u8 unused2[8];
/*0x84*/ u16 unk_84; /*0x84*/ u16 flag1;
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag2;
} MetalDoorEntity; } MetalDoorEntity;
extern u32 sub_08083734(Entity*, u32); extern u32 sub_08083734(Entity*, u32);
@ -45,7 +45,7 @@ void MetalDoor(MetalDoorEntity* this) {
} }
void MetalDoor_Init(MetalDoorEntity* this) { void MetalDoor_Init(MetalDoorEntity* this) {
if ((this->unk_84 != 0xffff) && CheckFlags(this->unk_84)) { if ((this->flag1 != 0xffff) && CheckFlags(this->flag1)) {
DeleteThisEntity(); DeleteThisEntity();
} }
super->action = 1; super->action = 1;
@ -97,7 +97,7 @@ void MetalDoor_Action2(MetalDoorEntity* this) {
} }
void MetalDoor_Action3(MetalDoorEntity* this) { void MetalDoor_Action3(MetalDoorEntity* this) {
if (CheckFlags(this->unk_86)) { if (CheckFlags(this->flag2)) {
super->action = 4; super->action = 4;
super->timer = 12; super->timer = 12;
super->direction = 0x10; super->direction = 0x10;

View File

@ -18,7 +18,7 @@ typedef struct {
/*0x78*/ u8 unk_78[0x6]; /*0x78*/ u8 unk_78[0x6];
/*0x7e*/ u8 unk_7e; /*0x7e*/ u8 unk_7e;
/*0x7f*/ u8 unk_7f[0x7]; /*0x7f*/ u8 unk_7f[0x7];
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag;
} MinecartDoorEntity; } MinecartDoorEntity;
extern bool32 sub_080837B0(Entity*); // lockedDoor extern bool32 sub_080837B0(Entity*); // lockedDoor
@ -95,7 +95,7 @@ void MinecartDoor_Action2(MinecartDoorEntity* this) {
void MinecartDoor_Action3(MinecartDoorEntity* this) { void MinecartDoor_Action3(MinecartDoorEntity* this) {
bool32 bVar3; bool32 bVar3;
if ((this->unk_7e != 0) && (CheckFlags(this->unk_86))) { if ((this->unk_7e != 0) && CheckFlags(this->flag)) {
return; return;
} }
if ((gPlayerState.flags & PL_IN_MINECART) != 0) { if ((gPlayerState.flags & PL_IN_MINECART) != 0) {
@ -128,7 +128,7 @@ void MinecartDoor_Action4(MinecartDoorEntity* this) {
} }
bool32 sub_08096CEC(MinecartDoorEntity* this) { bool32 sub_08096CEC(MinecartDoorEntity* this) {
if (this->unk_7e != 0 && CheckFlags(this->unk_86)) { if (this->unk_7e != 0 && CheckFlags(this->flag)) {
return TRUE; return TRUE;
} else { } else {
if ((gPlayerState.flags & PL_IN_MINECART) != 0) { if ((gPlayerState.flags & PL_IN_MINECART) != 0) {

View File

@ -11,7 +11,7 @@
typedef struct { typedef struct {
/*0x00*/ Entity base; /*0x00*/ Entity base;
/*0x68*/ u8 unk_68[0x1e]; /*0x68*/ u8 unk_68[0x1e];
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag;
} MinishPortalStoneEntity; } MinishPortalStoneEntity;
void MinishPortalStone_Init(MinishPortalStoneEntity* this); void MinishPortalStone_Init(MinishPortalStoneEntity* this);
@ -37,7 +37,7 @@ void MinishPortalStone_Init(MinishPortalStoneEntity* this) {
super->action = 1; super->action = 1;
super->spritePriority.b0 = 7; super->spritePriority.b0 = 7;
super->hitbox = (Hitbox*)&gUnk_08123328; super->hitbox = (Hitbox*)&gUnk_08123328;
if ((this->unk_86 == 0xffff) || (CheckFlags(this->unk_86))) { if ((this->flag == 0xffff) || CheckFlags(this->flag)) {
super->spriteSettings.draw = 1; super->spriteSettings.draw = 1;
super->action = 4; super->action = 4;
sub_08097CFC(this); sub_08097CFC(this);
@ -47,7 +47,7 @@ void MinishPortalStone_Init(MinishPortalStoneEntity* this) {
} }
void MinishPortalStone_Action1(MinishPortalStoneEntity* this) { void MinishPortalStone_Action1(MinishPortalStoneEntity* this) {
if (CheckFlags(this->unk_86)) { if (CheckFlags(this->flag)) {
SetPlayerControl(CONTROL_1); SetPlayerControl(CONTROL_1);
gPauseMenuOptions.disabled = 1; gPauseMenuOptions.disabled = 1;
RequestPriorityDuration(super, 30); RequestPriorityDuration(super, 30);

View File

@ -18,7 +18,7 @@ typedef struct {
/*0x68*/ u8 unused1[8]; /*0x68*/ u8 unused1[8];
/*0x70*/ u16 unk_70; /*0x70*/ u16 unk_70;
/*0x72*/ u8 unused2[20]; /*0x72*/ u8 unused2[20];
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag;
} ObjectAEntity; } ObjectAEntity;
extern u8 gUpdateVisibleTiles; extern u8 gUpdateVisibleTiles;
@ -35,7 +35,7 @@ void ObjectA(ObjectAEntity* this) {
uVar2 = TILE_TYPE_52; uVar2 = TILE_TYPE_52;
} }
this->unk_70 = uVar2; this->unk_70 = uVar2;
if (CheckFlags(this->unk_86) != 0) { if (CheckFlags(this->flag) != 0) {
SetTileType(this->unk_70, COORD_TO_TILE(super), super->collisionLayer); SetTileType(this->unk_70, COORD_TO_TILE(super), super->collisionLayer);
if ((gRoomControls.reload_flags & 1) != 0) { if ((gRoomControls.reload_flags & 1) != 0) {
gUpdateVisibleTiles = 0; gUpdateVisibleTiles = 0;
@ -46,7 +46,7 @@ void ObjectA(ObjectAEntity* this) {
} }
} else if (super->interactType != INTERACTION_NONE) { } else if (super->interactType != INTERACTION_NONE) {
SetTileType(this->unk_70, COORD_TO_TILE(super), super->collisionLayer); SetTileType(this->unk_70, COORD_TO_TILE(super), super->collisionLayer);
SetFlag(this->unk_86); SetFlag(this->flag);
CreateDust(super); CreateDust(super);
ModDungeonKeys(-1); ModDungeonKeys(-1);
DeleteThisEntity(); DeleteThisEntity();

View File

@ -32,7 +32,7 @@ void ObjectA8_Action2Subaction0(ObjectA8Entity*);
void ObjectA8_Action2Subaction1(ObjectA8Entity*); void ObjectA8_Action2Subaction1(ObjectA8Entity*);
void ObjectA8_Action2Subaction2(ObjectA8Entity*); void ObjectA8_Action2Subaction2(ObjectA8Entity*);
extern void sub_08081404(Entity*, u32); extern void ItemOnGround_SetFlagAndDelete(Entity*, u32);
void ObjectA8(ObjectA8Entity* this) { void ObjectA8(ObjectA8Entity* this) {
static void (*const ObjectA8_Actions[])(ObjectA8Entity*) = { static void (*const ObjectA8_Actions[])(ObjectA8Entity*) = {
@ -160,7 +160,7 @@ void ObjectA8_Action3(ObjectA8Entity* this) {
ProcessMovement1(super); ProcessMovement1(super);
if ((AnyPrioritySet() == 0) && (super->type == 0)) { if ((AnyPrioritySet() == 0) && (super->type == 0)) {
if (((gRoomTransition.frameCount & 1) != 0) && (--super->timer == 0)) { if (((gRoomTransition.frameCount & 1) != 0) && (--super->timer == 0)) {
sub_08081404(super, 0); ItemOnGround_SetFlagAndDelete(super, FALSE);
} }
if (super->timer < 0x3c) { if (super->timer < 0x3c) {
super->spriteSettings.draw ^= 1; super->spriteSettings.draw ^= 1;
@ -170,7 +170,7 @@ void ObjectA8_Action3(ObjectA8Entity* this) {
void ObjectA8_Action4(ObjectA8Entity* this) { void ObjectA8_Action4(ObjectA8Entity* this) {
if (*(u16*)&super->child->kind != 0xb08) { if (*(u16*)&super->child->kind != 0xb08) {
sub_08081404(super, 0); ItemOnGround_SetFlagAndDelete(super, FALSE);
} else { } else {
CopyPosition(super->child, super); CopyPosition(super->child, super);
super->z.HALF.HI--; super->z.HALF.HI--;
@ -217,7 +217,7 @@ void ObjectA8_Action6(ObjectA8Entity* this) {
if (--super->subtimer == 0) { if (--super->subtimer == 0) {
super->subtimer = 6; super->subtimer = 6;
if (--super->spriteOffsetY < -0x16) { if (--super->spriteOffsetY < -0x16) {
sub_08081404(super, 1); ItemOnGround_SetFlagAndDelete(super, TRUE);
} }
} }
if (super->spriteOffsetY < -0x11) { if (super->spriteOffsetY < -0x11) {

View File

@ -10,10 +10,10 @@
typedef struct { typedef struct {
/*0x00*/ Entity base; /*0x00*/ Entity base;
/*0x68*/ u16 unk_68; /*0x68*/ u16 flag;
} PinwheelEntity; } PinwheelEntity;
static const u16 gUnk_08125050[] = { static const u16 gPinwheelFlags[] = {
KUMOUE_02_AWASE_01, KUMOUE_02_AWASE_02, KUMOUE_02_AWASE_03, KUMOUE_02_AWASE_04, KUMOUE_02_AWASE_05, BEGIN_1, KUMOUE_02_AWASE_01, KUMOUE_02_AWASE_02, KUMOUE_02_AWASE_03, KUMOUE_02_AWASE_04, KUMOUE_02_AWASE_05, BEGIN_1,
}; };
extern u32 gUnk_020342F8; extern u32 gUnk_020342F8;
@ -38,9 +38,9 @@ void Pinwheel(PinwheelEntity* this) {
} }
void Pinwheel_Init(PinwheelEntity* this) { void Pinwheel_Init(PinwheelEntity* this) {
this->unk_68 = gUnk_08125050[super->type2]; this->flag = gPinwheelFlags[super->type2];
super->spritePriority.b0 = 7; super->spritePriority.b0 = 7;
if (CheckLocalFlag(this->unk_68) != 0) { if (CheckLocalFlag(this->flag) != 0) {
super->action = 2; super->action = 2;
} else { } else {
super->action = 1; super->action = 1;
@ -49,7 +49,7 @@ void Pinwheel_Init(PinwheelEntity* this) {
} }
void Pinwheel_Action1(PinwheelEntity* this) { void Pinwheel_Action1(PinwheelEntity* this) {
if (CheckLocalFlag(this->unk_68) != 0) { if (CheckLocalFlag(this->flag) != 0) {
super->action = 2; super->action = 2;
CreateDust(super); CreateDust(super);
} }

View File

@ -22,7 +22,7 @@ typedef struct {
/*0x72*/ u8 unused2[11]; /*0x72*/ u8 unused2[11];
/*0x7d*/ u8 unk_7d; /*0x7d*/ u8 unk_7d;
/*0x7e*/ u8 unused3[8]; /*0x7e*/ u8 unused3[8];
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag;
} PotEntity; } PotEntity;
void Pot_Action5(PotEntity*); void Pot_Action5(PotEntity*);
@ -60,7 +60,7 @@ void Pot(PotEntity* this) {
} }
void Pot_Init(PotEntity* this) { void Pot_Init(PotEntity* this) {
if (super->type2 == 1 && CheckFlags(this->unk_86)) { if (super->type2 == 1 && CheckFlags(this->flag)) {
DeleteThisEntity(); DeleteThisEntity();
} }
@ -306,7 +306,7 @@ static void BreakPot(PotEntity* this, Entity* parent) {
} }
if (super->type2 == 1) { if (super->type2 == 1) {
SetFlag(this->unk_86); SetFlag(this->flag);
} }
DeleteThisEntity(); DeleteThisEntity();
@ -327,7 +327,7 @@ u32 sub_0808288C(Entity* this, u32 form, u32 arg2, u32 arg3) {
if (entity != NULL) { if (entity != NULL) {
if (arg3 == 2) { if (arg3 == 2) {
entity->base.timer = 5; entity->base.timer = 5;
entity->unk_86 = ((PotEntity*)this)->unk_86; // This function is also used by flyingSkull. entity->flag = ((PotEntity*)this)->flag; // This function is also used by flyingSkull.
} else { } else {
entity->base.timer = 0; entity->base.timer = 0;
} }

View File

@ -73,7 +73,7 @@ void PushableFurniture_Init(PushableFurnitureEntity* this) {
this->unk_7e = (s8)super->subtimer + super->x.HALF_U.HI; this->unk_7e = (s8)super->subtimer + super->x.HALF_U.HI;
} }
if (super->parent == NULL) { if (super->parent == NULL) {
if (CheckFlags(this->unk_86)) { if (CheckFlags(this->flag)) {
condition++; condition++;
} }
} else { } else {
@ -228,7 +228,7 @@ bool32 sub_0808FC5C(PushableFurnitureEntity* this) {
this->unk_81 = 1; this->unk_81 = 1;
if (super->parent == NULL) { if (super->parent == NULL) {
SetFlag((u32)this->unk_86); SetFlag((u32)this->flag);
} else { } else {
if ((this->unk_82 & 0x80) != 0) { if ((this->unk_82 & 0x80) != 0) {
puVar5 = super->parent->spriteAnimation + 2; puVar5 = super->parent->spriteAnimation + 2;

View File

@ -19,10 +19,10 @@ typedef struct {
/*0x74*/ u16 unk_74; /*0x74*/ u16 unk_74;
/*0x76*/ u16 unk_76; /*0x76*/ u16 unk_76;
/*0x78*/ u16 unk_78; /*0x78*/ u16 unk_78;
/*0x7a*/ u16 unk_7a; /*0x7a*/ u16 flagValue;
/*0x7c*/ union SplitHWord unk_7c; /*0x7c*/ union SplitHWord unk_7c;
/*0x7e*/ u8 unused2[8]; /*0x7e*/ u8 unused2[8];
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag;
} RailtrackEntity; } RailtrackEntity;
void sub_08085394(RailtrackEntity* this); void sub_08085394(RailtrackEntity* this);
@ -58,8 +58,8 @@ void Railtrack_Init(RailtrackEntity* this) {
} }
super->animationState = super->type2 & 2; super->animationState = super->type2 & 2;
if (super->type == 3) { if (super->type == 3) {
uVar1 = CheckFlags(this->unk_86); uVar1 = CheckFlags(this->flag);
this->unk_7a = uVar1; this->flagValue = uVar1;
if ((u16)(uVar1 & -1) != 0) { if ((u16)(uVar1 & -1) != 0) {
super->animationState = (super->animationState + 2) & 3; super->animationState = (super->animationState + 2) & 3;
super->action = 3; super->action = 3;
@ -71,11 +71,11 @@ void Railtrack_Init(RailtrackEntity* this) {
} }
void Railtrack_Action1(RailtrackEntity* this) { void Railtrack_Action1(RailtrackEntity* this) {
if (CheckFlags(this->unk_86)) { if (CheckFlags(this->flag)) {
super->action = 2; super->action = 2;
super->subtimer = 8; super->subtimer = 8;
if (super->type == 1) { if (super->type == 1) {
ClearFlag(this->unk_86); ClearFlag(this->flag);
} }
super->animationState = (super->animationState + this->unk_7c.HALF.LO) & 3; super->animationState = (super->animationState + this->unk_7c.HALF.LO) & 3;
InitializeAnimation(super, super->animationState); InitializeAnimation(super, super->animationState);
@ -88,7 +88,7 @@ void Railtrack_Action2(RailtrackEntity* this) {
if (--super->subtimer == 0) { if (--super->subtimer == 0) {
super->action = 3; super->action = 3;
super->subtimer = super->timer; super->subtimer = super->timer;
this->unk_7a = CheckFlags(this->unk_86); this->flagValue = CheckFlags(this->flag);
super->animationState = (super->animationState + this->unk_7c.HALF.LO) & 3; super->animationState = (super->animationState + this->unk_7c.HALF.LO) & 3;
InitializeAnimation(super, super->animationState); InitializeAnimation(super, super->animationState);
sub_08085394(this); sub_08085394(this);
@ -103,13 +103,13 @@ void Railtrack_Action3(RailtrackEntity* this) {
case 1: case 1:
break; break;
case 2: case 2:
if (CheckFlags(this->unk_86) == 0) { if (CheckFlags(this->flag) == 0) {
super->action = 1; super->action = 1;
return; return;
} }
break; break;
case 3: case 3:
if (CheckFlags(this->unk_86) == this->unk_7a) { if (CheckFlags(this->flag) == this->flagValue) {
super->subtimer = 255; super->subtimer = 255;
} else { } else {
super->subtimer = 1; super->subtimer = 1;

View File

@ -18,7 +18,7 @@ typedef struct {
/*0x6e*/ u8 unk_6e[0x2]; /*0x6e*/ u8 unk_6e[0x2];
/*0x70*/ u16 tilePos; /*0x70*/ u16 tilePos;
/*0x72*/ u8 unk_72[0x14]; /*0x72*/ u8 unk_72[0x14];
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag;
} SmallIceBlockEntity; } SmallIceBlockEntity;
extern const s16 gUnk_080B4488[]; extern const s16 gUnk_080B4488[];
@ -51,7 +51,7 @@ void SmallIceBlock_Init(SmallIceBlockEntity* this) {
case 0: case 0:
case 1: case 1:
case 2: case 2:
if (CheckFlags(this->unk_86)) { if (CheckFlags(this->flag)) {
DeleteThisEntity(); DeleteThisEntity();
} }
} }
@ -81,7 +81,7 @@ void SmallIceBlock_Action1(SmallIceBlockEntity* this) {
EnqueueSFX(SFX_ICE_BLOCK_MELT); EnqueueSFX(SFX_ICE_BLOCK_MELT);
SmallIceBlock_Action3(this); SmallIceBlock_Action3(this);
if (super->type == 0) { if (super->type == 0) {
SetFlag(this->unk_86); SetFlag(this->flag);
} }
} else { } else {
if (!sub_0800442E(super)) { if (!sub_0800442E(super)) {
@ -138,10 +138,10 @@ void SmallIceBlock_Action3(SmallIceBlockEntity* this) {
} }
SetAffineInfo(super, 0x100, gUnk_08123748[super->timer >> 5], 0); SetAffineInfo(super, 0x100, gUnk_08123748[super->timer >> 5], 0);
if (super->type == 1) { if (super->type == 1) {
CreateGroundItemWithFlags(super, ITEM_SMALL_KEY, 0, this->unk_86); CreateGroundItemWithFlags(super, ITEM_SMALL_KEY, 0, this->flag);
SoundReq(SFX_SECRET); SoundReq(SFX_SECRET);
} else if (super->type == 2) { } else if (super->type == 2) {
CreateGroundItemWithFlags(super, ITEM_BIG_KEY, 0, this->unk_86); CreateGroundItemWithFlags(super, ITEM_BIG_KEY, 0, this->flag);
SoundReq(SFX_SECRET); SoundReq(SFX_SECRET);
} }
super->action = 4; super->action = 4;

View File

@ -17,7 +17,7 @@
typedef struct { typedef struct {
/*0x00*/ Entity base; /*0x00*/ Entity base;
/*0x68*/ u8 unused1[30]; /*0x68*/ u8 unused1[30];
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag;
} TreeHidingPortalEntity; } TreeHidingPortalEntity;
extern const s16 gUnk_080B4468[]; extern const s16 gUnk_080B4468[];
@ -42,7 +42,7 @@ void TreeHidingPortal(TreeHidingPortalEntity* this) {
} }
void TreeHidingPortal_Init(TreeHidingPortalEntity* this) { void TreeHidingPortal_Init(TreeHidingPortalEntity* this) {
if (CheckFlags(this->unk_86)) { if (CheckFlags(this->flag)) {
sub_0809E96C(this); sub_0809E96C(this);
DeleteThisEntity(); DeleteThisEntity();
} }
@ -79,7 +79,7 @@ void TreeHidingPortal_Action2(TreeHidingPortalEntity* this) {
void TreeHidingPortal_Action3(TreeHidingPortalEntity* this) { void TreeHidingPortal_Action3(TreeHidingPortalEntity* this) {
if (--super->timer == 0) { if (--super->timer == 0) {
SetFlag(this->unk_86); SetFlag(this->flag);
SetPlayerControl(0); SetPlayerControl(0);
SoundReq(SFX_SECRET_BIG); SoundReq(SFX_SECRET_BIG);
DeleteThisEntity(); DeleteThisEntity();

View File

@ -12,7 +12,7 @@
typedef struct { typedef struct {
/*0x00*/ Entity base; /*0x00*/ Entity base;
/*0x68*/ u8 unk_68[0x1e]; /*0x68*/ u8 unk_68[0x1e];
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag;
} UnusedSkullEntity; } UnusedSkullEntity;
void UnusedSkull_Init(UnusedSkullEntity*); void UnusedSkull_Init(UnusedSkullEntity*);
@ -40,9 +40,9 @@ void UnusedSkull_Init(UnusedSkullEntity* this) {
super->collisionMask = 2; super->collisionMask = 2;
super->hitbox = (Hitbox*)&gHitbox_4; super->hitbox = (Hitbox*)&gHitbox_4;
SetTile(SPECIAL_TILE_80, COORD_TO_TILE(super), super->collisionLayer); SetTile(SPECIAL_TILE_80, COORD_TO_TILE(super), super->collisionLayer);
if (super->type == 1 || CheckFlags(this->unk_86)) { if (super->type == 1 || CheckFlags(this->flag)) {
super->action = 3; super->action = 3;
SetFlag(this->unk_86); SetFlag(this->flag);
InitializeAnimation(super, 1); InitializeAnimation(super, 1);
} else { } else {
InitializeAnimation(super, super->type); InitializeAnimation(super, super->type);
@ -62,7 +62,7 @@ void UnusedSkull_Action2(UnusedSkullEntity* this) {
GetNextFrame(super); GetNextFrame(super);
if ((super->frame & 1) != 0) { if ((super->frame & 1) != 0) {
super->action = 3; super->action = 3;
SetFlag(this->unk_86); SetFlag(this->flag);
EnqueueSFX(SFX_BUTTON_PRESS); EnqueueSFX(SFX_BUTTON_PRESS);
} }
} }

View File

@ -18,7 +18,7 @@ typedef struct {
/*0x7d*/ u8 unk_7d; /*0x7d*/ u8 unk_7d;
/*0x7e*/ u8 unused3[6]; /*0x7e*/ u8 unused3[6];
/*0x84*/ u16 unk_84; /*0x84*/ u16 unk_84;
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag;
} WarpPointEntity; } WarpPointEntity;
extern void EnableDungeonWarp(u32); extern void EnableDungeonWarp(u32);
@ -58,7 +58,7 @@ void WarpPoint_Init(WarpPointEntity* this) {
super->hitbox = (Hitbox*)&gHitbox_1; super->hitbox = (Hitbox*)&gHitbox_1;
super->updatePriority = PRIO_NO_BLOCK; super->updatePriority = PRIO_NO_BLOCK;
InitializeAnimation(super, 0); InitializeAnimation(super, 0);
if (CheckFlags(this->unk_86)) { if (CheckFlags(this->flag)) {
sub_0808B830(this); sub_0808B830(this);
} else { } else {
if (AreaIsDungeon() && IsDungeonWarpActive(super->type)) { if (AreaIsDungeon() && IsDungeonWarpActive(super->type)) {
@ -77,7 +77,7 @@ void WarpPoint_Init(WarpPointEntity* this) {
} }
void WarpPoint_Action1(WarpPointEntity* this) { void WarpPoint_Action1(WarpPointEntity* this) {
if (CheckFlags(this->unk_86)) { if (CheckFlags(this->flag)) {
sub_0808B830(this); sub_0808B830(this);
if (AreaIsDungeon()) { if (AreaIsDungeon()) {
EnableDungeonWarp(super->type); EnableDungeonWarp(super->type);

View File

@ -189,7 +189,7 @@ Entity* CreateGroundItemWithFlags(Entity* parent, u32 form, u32 subtype, u32 fla
if (ent != NULL) { if (ent != NULL) {
ItemOnGroundEntity* this = (ItemOnGroundEntity*)ent; ItemOnGroundEntity* this = (ItemOnGroundEntity*)ent;
ent->timer = 5; ent->timer = 5;
this->unk_86 = flags; this->flag = flags;
} }
return ent; return ent;
} }

View File

@ -16,7 +16,7 @@ typedef struct {
/*0x68*/ u8 unused1[28]; /*0x68*/ u8 unused1[28];
/*0x84*/ u8 unk_84; /*0x84*/ u8 unk_84;
/*0x85*/ u8 unused2; /*0x85*/ u8 unused2;
/*0x86*/ u16 unk_86; /*0x86*/ u16 flag;
} SpiderWebEntity; } SpiderWebEntity;
typedef struct { typedef struct {
@ -134,7 +134,7 @@ void SpiderWeb_Init(SpiderWebEntity* this) {
&gUnk_080FD42C, &gUnk_080FD42C,
&gUnk_080FD434, &gUnk_080FD434,
}; };
if (CheckFlags(this->unk_86) != 0) { if (CheckFlags(this->flag) != 0) {
DeleteThisEntity(); DeleteThisEntity();
} }
super->action = 1; super->action = 1;
@ -251,7 +251,7 @@ void sub_080AAA68(Entity* this) {
} }
void sub_080AAAA8(SpiderWebEntity* this) { void sub_080AAAA8(SpiderWebEntity* this) {
SetFlag(this->unk_86); SetFlag(this->flag);
RestorePrevTileEntity(TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer); RestorePrevTileEntity(TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
DeleteThisEntity(); DeleteThisEntity();
} }