Split item files

This commit is contained in:
octorock
2021-06-11 12:22:15 +02:00
parent 3664b4a37b
commit fd640407bb
133 changed files with 7919 additions and 10287 deletions
+11 -5
View File
@@ -34,16 +34,22 @@ extern void (*const gUnk_080FE2A0[])();
void ForceEquipItem(u32, u8);
extern void sub_0807CAA0(u32, u32);
/*
Returns the slot the item is equipped in.
0: A
1: B
2: Not equipped
*/
u32 IsItemEquipped(u32 itemID) {
u32 ret;
u32 itemSlot;
if (itemID == gSave.stats.itemOnA)
ret = 0;
itemSlot = 0;
else if (itemID == gSave.stats.itemOnB)
ret = 1;
itemSlot = 1;
else
ret = 2;
return ret;
itemSlot = 2;
return itemSlot;
}
NONMATCH("asm/non_matching/PutItemOnSlot.inc", void PutItemOnSlot(u32 itemID)) {
+2 -1
View File
@@ -25,7 +25,8 @@ void sub_08077B98(UnkItemStruct* unk) {
}
}
void sub_08077BB8(UnkItemStruct* unk) {
void sub_08077BB8(ItemBehavior* beh) {
UnkItemStruct* unk = (UnkItemStruct*)beh; // @nocheckin
u8* temp = sub_08077C54(unk);
if (temp != NULL) {
temp[0x10] = 0x20;
+17 -14
View File
@@ -14,34 +14,36 @@ typedef struct {
u8 unk[16];
} Unk_struct;
void sub_08077DF4(Entity* ent, u32 arg1) {
void sub_08077DF4(ItemBehavior* beh, u32 arg1) {
Entity* ent = (Entity*)beh; // @nocheckin
*(u16*)&ent->flags = arg1;
if ((arg1 & 0xff) > 0xb8) {
arg1 += ent->type >> 1;
}
gPlayerEntity.spriteIndex = (short)(arg1 >> 8);
InitAnimationForceUpdate(&gPlayerEntity, (u8)arg1);
sub_08077E54(ent);
sub_08077E54(beh);
}
void UpdateItemAnim(Entity* ent) {
void UpdateItemAnim(ItemBehavior* beh) {
UpdateAnimationSingleFrame(&gPlayerEntity);
sub_08077E54(ent);
sub_08077E54(beh);
}
void sub_08077E3C(Entity* ent, u32 idx) {
void sub_08077E3C(ItemBehavior* ent, u32 idx) {
sub_080042BA(&gPlayerEntity, idx);
sub_08077E54(ent);
}
void sub_08077E54(Entity* ent) {
void sub_08077E54(ItemBehavior* beh) {
Entity* ent = (Entity*)beh; // @nocheckin
ent->action = gPlayerEntity.animIndex;
*(u8*)&ent->spriteIndex = gPlayerEntity.frameIndex;
ent->subAction = gPlayerEntity.frameDuration;
ent->actionDelay = gPlayerEntity.frames.all;
}
void sub_08077E78(void* arg0, u32 bits) {
void sub_08077E78(ItemBehavior* arg0, u32 bits) {
u8* pbVar1;
u32 not ;
@@ -62,10 +64,11 @@ void sub_08077E78(void* arg0, u32 bits) {
MemClear(arg0, 0x1c);
}
u32 sub_08077EC8(Unk_struct* arg0) {
u32 sub_08077EC8(ItemBehavior* beh) {
Unk_struct* arg0 = (Unk_struct*)beh; // @nocheckin
if ((gPlayerState.field_0x1a[1] & 8) != 0) {
sub_08077DF4((Entity*)arg0, 0x170);
sub_08077DF4(beh, 0x170);
arg0->unk[7] = 0x28;
arg0->unk[4] = 7;
arg0->unk[15] = 6;
@@ -75,15 +78,15 @@ u32 sub_08077EC8(Unk_struct* arg0) {
}
}
void sub_08077EFC(ItemBehavior* arg0) {
sub_08077F24(arg0, (u16)gPlayerState.field_0x90.HALF.LO);
bool32 sub_08077EFC(ItemBehavior* arg0) {
return sub_08077F24(arg0, (u16)gPlayerState.field_0x90.HALF.LO);
}
void sub_08077F10(ItemBehavior* arg0) {
sub_08077F24(arg0, (u16)gPlayerState.field_0x90.HALF.HI);
bool32 sub_08077F10(ItemBehavior* arg0) {
return sub_08077F24(arg0, (u16)gPlayerState.field_0x90.HALF.HI);
}
ASM_FUNC("asm/non_matching/sub_08077F24.inc", void sub_08077F24(ItemBehavior* beh, u32 arg1))
ASM_FUNC("asm/non_matching/sub_08077F24.inc", bool32 sub_08077F24(ItemBehavior* beh, u32 arg1))
void sub_08077F50(ItemBehavior* beh, u32 arg1) {
sub_08079184();
+1 -1
View File
@@ -76,7 +76,7 @@ extern void sub_0806FE84();
extern void sub_080788E0();
extern void sub_08078954();
extern void sub_0805EC60();
extern void sub_08017744();
extern void sub_08017744(Entity*);
extern void sub_0805E92C();
extern void UnloadHitbox();
extern void sub_0804AA1C();
+47
View File
@@ -0,0 +1,47 @@
#include "item.h"
#include "coord.h"
#include "audio.h"
#include "functions.h"
extern void (*const gUnk_0811BD98[])(ItemBehavior*, u32);
extern Entity* CreatePlayerBomb();
extern s8 gUnk_0811BDAC[];
extern void ModBombs(s32);
void ItemBomb(ItemBehavior* this, u32 arg1) {
gUnk_0811BD98[this->stateID](this, arg1);
}
void sub_08075FF8(ItemBehavior* this, u32 arg1) {
Entity* entity;
u32 maxBombs;
u32 bombCount;
s8* tmp;
s32 x;
s32 y;
if ((gPlayerState.jumpStatus | gPlayerState.field_0x3[1]) == 0) {
bombCount = 0;
for (entity = FindEntityByID(8, 2, 2); entity != NULL; entity = FindNextDuplicateID(entity, 2)) {
bombCount += 1;
}
maxBombs = this->behaviorID == 7 ? 3 : 1;
if (maxBombs > bombCount) {
entity = CreatePlayerBomb(this, 2);
if (entity != NULL) {
tmp = &gUnk_0811BDAC[gPlayerEntity.animationState & 6];
// TODO fix array access
x = tmp[0] << 0x10;
y = tmp[1] << 0x10;
PositionRelative(&gPlayerEntity, entity, x, y);
ModBombs(-1);
SoundReq(SFX_104);
}
}
}
sub_08077E78(this, arg1);
}
// TODO arg1 type not yet known, called by sub_080761C0 and sub_080762D8
ASM_FUNC("asm/non_matching/itemBomb/sub_08076088.inc", void sub_08076088(ItemBehavior* this, void* arg1))
+36
View File
@@ -0,0 +1,36 @@
#include "item.h"
#include "functions.h"
extern void (*const gUnk_0811BD78[])(ItemBehavior*, u32);
extern void sub_08078F60(void);
void ItemBoomerang(ItemBehavior* this, u32 arg1) {
gUnk_0811BD78[this->stateID](this, arg1);
}
void sub_08075D2C(ItemBehavior* this, u32 arg1) {
if (((gPlayerState.field_0x3[1] & 8) == 0) && (sub_08077C94(this, this->behaviorID) == NULL)) {
this->field_0x5[4] |= 0xf;
sub_0806F948(&gPlayerEntity);
sub_08077C0C(this, 0xb);
sub_08077D38(this, arg1);
gPlayerState.field_0x3[1] |= 8;
} else {
sub_08077E78(this, arg1);
}
}
void sub_08075D88(ItemBehavior* this, u32 arg1) {
if ((gPlayerState.field_0x3[1] & 0x80) == 0) {
if (((this->behaviorID == 0xc) && ((gPlayerState.field_0xa & 0x80) != 0)) && ((this->field_0x5[9] & 2) != 0)) {
sub_08078F60();
return;
}
UpdateItemAnim(this);
if ((this->field_0x5[9] & 0x80) == 0) {
return;
}
}
sub_08077E78(this, arg1);
}
+92
View File
@@ -0,0 +1,92 @@
#include "item.h"
#include "functions.h"
#include "save.h"
extern void (*const gUnk_0811BD80[])(ItemBehavior*, u32);
extern void sub_08077E3C(ItemBehavior*, u32);
void ItemBow(ItemBehavior* this, u32 arg1) {
gUnk_0811BD80[this->stateID](this, arg1);
}
void sub_08075DF4(ItemBehavior* this, u32 arg1) {
if ((gPlayerState.field_0x3[1] & 8) == 0) {
this->field_0x5[4] |= 0x80;
sub_0806F948(&gPlayerEntity);
sub_08077BB8(this);
sub_08077D38(this, arg1);
gPlayerState.field_0x1d[4] = 1;
} else {
sub_08077E78(this, arg1);
}
}
void sub_08075E40(ItemBehavior* this, u32 arg1) {
u8 bVar1;
if (gPlayerState.field_0x1d[4] != 0) {
bVar1 = gPlayerState.field_0x3[1] & 0x80;
if (bVar1 == 0) {
UpdateItemAnim(this);
if ((this->field_0x5[9] & 0x80) != 0) {
this->stateID = 2;
this->field_0x5[4] &= 0x7f;
if (gSave.stats.arrowCount != 0) {
this->field_0xf = bVar1;
gPlayerState.field_0xa &= ~(8 >> arg1);
}
}
return;
}
}
gPlayerState.field_0x1d[4] = 0;
sub_08077E78(this, arg1);
}
void sub_08075EC0(ItemBehavior* this, u32 arg1) {
u8 arrowCount;
s32 iVar2;
arrowCount = gSave.stats.arrowCount;
iVar2 = sub_08077EFC(this);
if (iVar2 != 0 && arrowCount != 0) {
if (((gPlayerState.field_0x3[1] & 0x80) != 0) || (gPlayerState.field_0x1d[4] == 0)) {
gPlayerState.field_0x1d[4] = 0;
sub_08077E78(this, arg1);
}
} else {
gPlayerState.field_0xa = (8 >> arg1) | gPlayerState.field_0xa;
sub_08077DF4(this, 0x27c);
this->field_0xf = 0xf;
this->field_0x5[4] |= 0xf;
this->stateID = 3;
}
}
void sub_08075F38(ItemBehavior* this, u32 arg1) {
if (((gPlayerState.field_0x3[1] & 0x80) == 0) && (gPlayerState.field_0x1d[4] != 0)) {
UpdateItemAnim(this);
if ((this->field_0x5[9] & 1) != 0) {
this->stateID = 4;
}
} else {
gPlayerState.field_0x1d[4] = 0;
sub_08077E78(this, arg1);
}
}
void sub_08075F84(ItemBehavior* this, u32 arg1) {
if (((gPlayerState.field_0x3[1] & 0x80) == 0) && (gPlayerState.field_0x1d[4] != 0)) {
if (GetInventoryValue(0x70) == 1) {
sub_08077E3C(this, 5);
} else {
UpdateItemAnim(this);
}
if ((this->field_0x5[9] & 0x80) == 0) {
return;
}
}
gPlayerState.field_0x1d[4] = 0;
sub_08077E78(this, arg1);
}
+9
View File
@@ -0,0 +1,9 @@
#include "item.h"
extern Entity* sub_08077BD4(ItemBehavior*);
extern void sub_08077E78(ItemBehavior*, u32);
void ItemDebug(ItemBehavior* beh, u32 arg1) {
sub_08077BD4(beh);
sub_08077E78(beh, arg1);
}
+28 -2
View File
@@ -1,10 +1,36 @@
#include "global.h"
#include "entity.h"
#include "item.h"
#include "functions.h"
extern void (*const gUnk_0811BDF4[])(ItemBehavior* beh, u32);
void ItemGustJar(ItemBehavior* beh, u32 arg1) {
void ItemGustJar(ItemBehavior* this, u32 arg1) {
gPlayerState.field_0xa8 = 3;
gUnk_0811BDF4[beh->stateID](beh, arg1);
gUnk_0811BDF4[this->stateID](this, arg1);
}
ASM_FUNC("asm/non_matching/itemGustJar/sub_08076DF4.inc", void sub_08076DF4(ItemBehavior* this, u32 arg1))
void sub_08076E60(ItemBehavior* this, u32 arg1) {
Entity* playerItem;
if ((gPlayerState.field_0x1c & 0xf) == 0) {
sub_08077E78(this, arg1);
}
if ((this->field_0x5[9] & 0x80) != 0) {
this->stateID = 2;
sub_08077DF4(this, 0x504);
gPlayerState.field_0xa = gPlayerState.field_0xa & ~(8 >> arg1);
playerItem = CreatePlayerItem(0x10, 0, 0, 0);
if (playerItem != NULL) {
playerItem->parent = &gPlayerEntity;
}
} else {
UpdateItemAnim(this);
}
}
ASM_FUNC("asm/non_matching/itemGustJar/sub_08076EC8.inc", void sub_08076EC8(ItemBehavior* this, u32 arg1))
ASM_FUNC("asm/non_matching/itemGustJar/sub_08076F64.inc", void sub_08076F64(ItemBehavior* this, u32 arg1))
+76
View File
@@ -0,0 +1,76 @@
#include "item.h"
#include "save.h"
#include "functions.h"
extern void (*const gUnk_0811BE28[])(ItemBehavior*, u32);
extern u8 gUnk_02002AC8[];
extern void sub_08077BB8(ItemBehavior*);
void ItemJarEmpty(ItemBehavior* this, u32 arg1) {
gUnk_0811BE28[this->stateID](this, arg1);
}
void sub_08077534(ItemBehavior* this, u32 arg1) {
u32 tmp;
sub_08077D38(this, arg1);
sub_0806F948(&gPlayerEntity);
sub_08077BB8(this);
this->field_0x5[4] |= 0xf;
tmp = this->behaviorID;
this->field_0x5[2] = gSave.filler86[tmp + 0x14];
switch (this->field_0x5[2]) {
case 0x20:
sub_08077DF4(this, 0x614);
return;
case 0x21:
case 0x22:
case 0x23:
case 0x24:
case 0x25:
case 0x29:
case 0x2a:
case 0x2b:
case 0x2c:
case 0x2d:
case 0x2e:
this->stateID = 3;
gPlayerEntity.animationState = 4;
gPlayerEntity.spriteSettings.b.flipX = 0;
sub_08077DF4(this, 0x2df);
break;
case 0x2f:
case 0x30:
case 0x31:
default:
this->stateID = 3;
sub_08077DF4(this, 0x610);
break;
}
gPlayerEntity.flags &= 0x7f;
}
void sub_08077618(ItemBehavior* this, u32 arg1) {
if ((this->field_0x5[9] & 0x80) != 0) {
sub_08077DF4(this, 0x618);
this->stateID += 1;
} else {
UpdateItemAnim(this);
}
}
void sub_08077640(ItemBehavior* this, u32 arg1) {
UpdateItemAnim(this);
if ((this->field_0x5[9] & 0x80) != 0) {
gPlayerEntity.flags |= 0x80;
sub_08077E78(this, arg1);
}
}
void sub_0807766C(ItemBehavior* this, u32 arg1) {
UpdateItemAnim(this);
if ((this->field_0x5[9] & 0x80) != 0) {
gPlayerEntity.flags |= 0x80;
sub_08077E78(this, arg1);
}
}
+126
View File
@@ -0,0 +1,126 @@
#include "item.h"
#include "functions.h"
#include "audio.h"
extern void (*const gUnk_0811BD68[])(ItemBehavior*, u32);
extern s8 gUnk_08126EEC[];
extern Entity* sub_08077BD4(ItemBehavior*);
extern bool32 sub_08077F10(ItemBehavior*);
extern void sub_0807AB44(Entity*, s32, s32);
void ItemLantern(ItemBehavior* this, u32 arg1) {
gUnk_0811BD68[this->stateID](this, arg1);
}
void sub_08075A0C(ItemBehavior* this, u32 arg1) {
Entity* object;
u32 itemSlot;
s8* tmp;
itemSlot = IsItemEquipped(this->behaviorID);
if (gPlayerState.heldObject != 0 || gPlayerState.playerAction == 0x18 || gPlayerState.jumpStatus != 0 ||
gPlayerState.field_0x2c != NULL || (gPlayerState.flags.all & 0x80) != 0) {
ForceEquipItem(0xf, itemSlot);
gPlayerState.flags.all &= 0xff7fffff;
ForceEquipItem(0xf, itemSlot);
sub_08077E78(this, arg1);
} else {
this->field_0x5[4] |= 0x80;
sub_08077D38(this, arg1);
sub_08077BD4(this);
sub_0806F948(&gPlayerEntity);
this->behaviorID = 0x10;
ForceEquipItem(0x10, itemSlot);
tmp = &gUnk_08126EEC[gPlayerEntity.animationState & 6];
object = CreateObjectWithParent(&gPlayerEntity, 0x45, 1, 0);
if (object != NULL) {
object->spriteVramOffset = gPlayerEntity.spriteVramOffset;
object->x.HALF.HI = tmp[0] + object->x.HALF.HI;
object->y.HALF.HI = tmp[1] + object->y.HALF.HI;
}
}
}
#ifdef EU
ASM_FUNC("asm/non_matching/eu/sub_08075ADC.inc", void sub_08075ADC(ItemBehavior* this, u32 arg1))
#else
void sub_08075ADC(ItemBehavior* this, u32 arg1) {
u32 bVar1;
if (gPlayerState.field_0x2c != NULL || (this->field_0x5[9] & 1) == 0 || (gPlayerState.flags.all & 0x110) != 0 ||
sub_08079D48() == 0) {
this->field_0xf = 0;
this->stateID += 1;
gPlayerState.flags.all |= 0x800000;
bVar1 = 8 >> arg1;
gPlayerState.field_0x3[1] = gPlayerState.field_0x3[1] & ~((bVar1 << 4) | bVar1);
bVar1 = ~bVar1;
gPlayerState.field_0xa = bVar1 & gPlayerState.field_0xa;
gPlayerState.keepFacing = bVar1 & gPlayerState.keepFacing;
SoundReq(SFX_ITEM_LANTERN_ON);
} else {
UpdateItemAnim(this);
}
}
#endif
void sub_08075B54(ItemBehavior* this, u32 arg1) {
u32 bVar1;
u32 itemSlot;
Entity* object;
s8* tmp;
if ((gPlayerState.flags.all & 0x110) == 0) {
itemSlot = IsItemEquipped(this->behaviorID);
if (!(((sub_08077F10(this) == 0) && (itemSlot < 2)) || (gPlayerState.jumpStatus != 0))) {
ForceEquipItem(0xf, itemSlot);
gPlayerState.flags.all &= 0xff7fffff;
sub_08077E78(this, arg1);
SoundReq(SFX_ITEM_LANTERN_OFF);
} else {
if (((gPlayerState.playerAction != 0x18) && (gPlayerEntity.frameIndex < 0x37)) &&
((u16)gPlayerEntity.spriteIndex == 6)) {
tmp = &gUnk_08126EEC[gPlayerEntity.animationState & 6];
if ((gPlayerState.jumpStatus == 0) &&
(sub_080002F0(TILE(gPlayerEntity.x.HALF.HI + tmp[0], gPlayerEntity.y.HALF.HI + tmp[1]),
gPlayerEntity.collisionLayer, 0x40) != 0)) {
this->field_0xf = 0xf;
this->stateID += 1;
gPlayerEntity.field_0x7a.HWORD = 2;
object = CreateObjectWithParent(&gPlayerEntity, 0x45, 1, 0);
if (object != NULL) {
object->spriteVramOffset = gPlayerEntity.spriteVramOffset;
object->x.HALF.HI = tmp[0] + object->x.HALF.HI;
object->y.HALF.HI = tmp[1] + object->y.HALF.HI;
}
sub_08077DF4(this, 0x60c);
bVar1 = (8 >> (arg1));
gPlayerState.field_0xa = bVar1 | gPlayerState.field_0xa;
gPlayerState.keepFacing = bVar1 | gPlayerState.keepFacing;
}
}
}
}
}
void sub_08075C9C(ItemBehavior* this, u32 arg1) {
s8* tmp;
UpdateItemAnim(this);
if ((this->field_0x5[9] & 0x10) != 0) {
tmp = &gUnk_08126EEC[gPlayerEntity.animationState & 6];
sub_0807AB44(&gPlayerEntity, tmp[0], tmp[1]);
}
if ((this->field_0x5[9] & 0x80) != 0) {
this->field_0xf = 0;
this->stateID -= 1;
gPlayerState.field_0xa = (~(8 >> arg1)) & gPlayerState.field_0xa;
gPlayerState.keepFacing = (~(8 >> arg1)) & gPlayerState.keepFacing;
} else {
gPlayerEntity.field_0x7a.HWORD += 1;
}
}
+101
View File
@@ -0,0 +1,101 @@
#include "item.h"
#include "functions.h"
#include "audio.h"
extern void (*const gUnk_0811BE04[])(ItemBehavior*, u32);
s32 sub_080774A0(void);
extern u8 gUnk_0811BE14[];
extern s32 sub_0800875A(Entity*, u32, ItemBehavior*);
extern void sub_08079E08();
void ItemMoleMitts(ItemBehavior* this, u32 arg1) {
gUnk_0811BE04[this->stateID](this, arg1);
}
void sub_08077130(ItemBehavior* this, u32 arg1) {
s32 iVar1;
if (gPlayerState.jumpStatus == 0) {
sub_08077D38(this, arg1);
gPlayerState.field_0x3c[1] = 1;
this->field_0x5[4] |= 0x80;
iVar1 = sub_080774A0();
if (iVar1 != 0) {
if (this->field_0x5[2] == 0) {
sub_08077DF4(this, 0x50c);
this->stateID = 2;
if (iVar1 == 0x56) {
if ((gPlayerEntity.animationState & 2) != 0) {
gPlayerEntity.y.HALF.HI = (gPlayerEntity.y.HALF.HI & 0xfff0) | 6;
} else {
gPlayerEntity.x.HALF.HI = (gPlayerEntity.x.HALF.HI & 0xfff0) | 8;
}
}
}
} else {
sub_08077DF4(this, 0x508);
this->stateID = 1;
}
} else {
sub_08077E78(this, arg1);
gPlayerState.field_0x3c[1] = 0;
}
}
void sub_080771C8(ItemBehavior* this, u32 arg1) {
Entity* object;
UpdateItemAnim(this);
if ((this->field_0x5[9] & 0x80) != 0) {
sub_08077E78(this, arg1);
gPlayerState.field_0x3c[1] = 0;
} else {
if (((this->field_0x5[9] & 0x20) != 0) && (this->field_0x5[3] == 0xff)) {
CreateObjectWithParent(&gPlayerEntity, 0x1e, this->field_0x5[9], 1);
}
if ((this->field_0x5[9] & 0x10) != 0) {
if (sub_0800875A(&gPlayerEntity, 0xd, this) == 0) {
sub_08077DF4(this, 0x520);
this->stateID = 3;
SoundReq(SFX_107);
} else {
if (this->field_0x5[3] != 0xff) {
object = CreateObjectWithParent(&gPlayerEntity, 0x1f, 0, this->field_0x2[1]);
if (object != NULL) {
object->actionDelay = this->field_0x5[2];
object->field_0xf = this->field_0x5[3];
object->animationState = gPlayerEntity.animationState & 6;
gPlayerEntity.frames.all = 0;
gPlayerEntity.frameDuration = gUnk_0811BE14[this->field_0x5[3]];
}
} else {
if ((this->field_0x2[1] == 0x0f) && (this->field_0x5[2] == 0x17)) {
this->field_0x5[3] = 0;
}
}
SoundReq(SFX_108);
}
}
}
}
ASM_FUNC("asm/non_matching/itemMoleMitts/sub_080772A8.inc", void sub_080772A8(ItemBehavior* this, u32 arg1))
void sub_08077448(ItemBehavior* this, u32 arg1) {
gPlayerEntity.direction = gPlayerEntity.animationState << 2 ^ 0x10;
gPlayerEntity.speed = 0x100;
if (((this->field_0x5[9] & 1) != 0) && (this->field_0x5[0] != 0)) {
sub_08079E08();
}
UpdateItemAnim(this);
if ((this->field_0x5[9] & 0x80) != 0) {
gPlayerState.field_0x3c[1] = 0;
sub_08077E78(this, arg1);
}
}
ASM_FUNC("asm/non_matching/itemMoleMitts/sub_080774A0.inc", s32 sub_080774A0(void))
+42 -29
View File
@@ -1,39 +1,52 @@
#include "item.h"
#include "audio.h"
#include "functions.h"
extern void (*const gOcarinaStates[4])(ItemBehavior*, u32);
extern void sub_08078F60(void);
extern void sub_0805E544(void);
#if 0
void Ocarina(ItemBehavior* beh, u32 inputFlags) {
gOcarinaStates[beh->stateID](beh, inputFlags);
gPlayerEntity.field_0x7a++;
extern void CreateBird(void);
extern void UnfreezeTime(void);
void ItemOcarina(ItemBehavior* this, u32 arg1) {
gOcarinaStates[this->stateID](this, arg1);
gPlayerEntity.field_0x7a.HWORD += 1;
}
void OcarinaUse(ItemBehavior *beh, u32 arg1)
{
u32 bVar1;
if (gPlayerState.playerAction == 0x18) {
PlayerChangeState(beh, arg1);
}
else {
beh->field_0x5[4] = beh->field_0x5[4] | 0xf;
gPlayerEntity.animationState = 4;
gPlayerEntity.spriteSettings.b.flipX = 0;
gPlayerEntity.flags &= 0x7f;
gPlayerEntity.field_0x7a = 2;
gPlayerState.flags.all |= 0x10000000;
gPlayerState.field_0x27[0] = 0xff;
gUnk_02034490[0] = 1;
bVar1 = (8 >> arg1);
gPlayerState.field_0xa |= bVar1;
gPlayerState.keepFacing |= bVar1;
sub_08078F60();
sub_08077D38(beh, arg1);
SoundReq(0x216);
sub_0805E544();
}
void OcarinaUse(ItemBehavior* this, u32 arg1) {
if (gPlayerState.playerAction == 0x18) {
sub_08077E78(this, arg1);
} else {
this->field_0x5[4] |= 0xf;
gPlayerEntity.animationState = 0x04;
gPlayerEntity.spriteSettings.b.flipX = 0;
gPlayerEntity.flags &= 0x7f;
gPlayerEntity.field_0x7a.HWORD = 2;
gPlayerState.flags.all |= 0x10000000;
gPlayerState.field_0x27[0] = -1;
gUnk_02034490[0] = 1;
gPlayerState.field_0xa = (8 >> arg1) | gPlayerState.field_0xa;
gPlayerState.keepFacing = (8 >> arg1) | gPlayerState.keepFacing;
sub_08078F60();
sub_08077D38(this, arg1);
SoundReq(SFX_216);
sub_0805E544();
}
}
#endif
NONMATCH("asm/non_matching/ocarina/OcarinaUpdate.inc", void OcarinaUpdate(ItemBehavior* this, u32 arg1)) {
// TODO regalloc
UpdateItemAnim(this);
if ((this->field_0x5[9] & 0x80) != 0) {
gPlayerEntity.flags |= 0x80;
gPlayerState.flags.all &= 0xefffffff;
gPlayerState.field_0x27[0] = 0;
gUnk_02034490[0] = 0;
CreateBird();
UnfreezeTime();
sub_08077E78(this, arg1);
}
}
END_NONMATCH
+77
View File
@@ -0,0 +1,77 @@
#include "item.h"
#include "audio.h"
#include "random.h"
#include "functions.h"
extern void (*const gUnk_0811BDCC[])(ItemBehavior* beh, u32);
void sub_08076964(ItemBehavior*, u32);
void ItemPegasusBoots(ItemBehavior* this, u32 arg1) {
u32 bVar1;
Entity* fx;
u32 uVar4;
if (gPlayerEntity.field_0x7a.HWORD != 0) {
gPlayerState.field_0x1d[1] = 0;
gPlayerState.field_0xe = 0;
sub_08077E78(this, arg1);
} else {
bVar1 = this->field_0x5[2] - 1;
this->field_0x5[2] = bVar1;
if ((bVar1 & 7) == 0) {
SoundReq(SFX_PLY_LAND);
}
if (((gPlayerState.flags.all & 0x80) == 0) && ((this->field_0x5[2] & 7) == 0)) {
if (gPlayerState.field_0x10[2] == 0x11) {
if (gPlayerEntity.spriteOffsetY == 0) {
CreateFx(&gPlayerEntity, 0x52, 0);
}
} else {
fx = CreateFx(&gPlayerEntity, 0x11, 0x40);
if ((fx != NULL) && (fx->y.HALF.HI = fx->y.HALF.HI + 2, this->stateID != 2)) {
uVar4 = Random() & 3;
if ((Random() & 1) != 0) {
uVar4 = -uVar4;
}
fx->y.HALF.HI += uVar4;
uVar4 = Random() & 7;
if ((Random() & 1) != 0) {
uVar4 = -uVar4;
}
fx->x.HALF.HI += uVar4;
}
}
}
gUnk_0811BDCC[this->stateID](this, arg1);
}
}
void sub_080768F8(ItemBehavior* this, u32 arg1) {
u32 bVar1;
u32 bVar2;
bVar1 = gPlayerState.field_0x1c | gPlayerState.field_0x3[1] | gPlayerState.heldObject | gPlayerState.jumpStatus;
bVar2 = (gPlayerState.flags.all & 0x1000);
bVar1 |= bVar2;
if (bVar1 == 0) {
gPlayerState.field_0x1d[1] = 1;
gPlayerState.field_0x1d[4] = bVar1;
if ((gPlayerState.flags.all & 0x80) == 0) {
this->field_0x5[2] = 0x10;
} else {
gPlayerState.field_0x8 = 0xc14;
}
sub_08077D38(this, arg1);
sub_08076964(this, arg1);
} else {
gPlayerState.field_0x1d[1] = 0;
gPlayerState.field_0xe = 0;
sub_08077E78(this, arg1);
}
}
ASM_FUNC("asm/non_matching/itemPegasusBoots/sub_08076964.inc", void sub_08076964(ItemBehavior* this, u32 arg1))
ASM_FUNC("asm/non_matching/itemPegasusBoots/sub_08076A88.inc", void sub_08076A88(ItemBehavior* this, u32 arg1))
+90
View File
@@ -0,0 +1,90 @@
#include "item.h"
#include "audio.h"
#include "functions.h"
void sub_08076758(ItemBehavior*, u32);
extern void sub_08077F84(void);
extern bool32 sub_08077EFC(ItemBehavior*);
/*void ItemRocsCape(ItemBehavior* this, u32 arg1) {
if (this->stateID != 0) {
sub_08076758(this, arg1);
return;
}
if (gPlayerState.field_0x2c == NULL) {
if (gPlayerState.field_0x0[1] == 0) {
if (((u8)(gPlayerState.field_0x1a[1] | gPlayerState.field_0xa | gPlayerState.field_0x3[1] |
gPlayerState.heldObject | gPlayerState.field_0x1c | gPlayerState.field_0x3c[1]) == 0) &&
((((1 < (u8)(gPlayerState.field_0x10[2] - 0x12) && (gPlayerState.field_0x10[2] != 1)) ||
(gPlayerEntity.height.WORD != 0)) ||
(gPlayerState.field_0x14 != 0)))) {
if ((gPlayerState.jumpStatus != 0) && ((gPlayerState.jumpStatus & 7) != 3))
goto _08076710;
if (-1 < gPlayerEntity.height.WORD) {
gPlayerEntity.field_0x20 = 0x20000;
gPlayerState.jumpStatus = 1;
gPlayerState.field_0x2c = NULL;
this->stateID += 1;
goto _0807673C;
}
}
} else {
if (((gPlayerState.heldObject | gPlayerState.field_0x3[1]) == 0) &&
(((gPlayerState.field_0x10[2] != 0x12 && (gPlayerState.field_0x10[2] != 1)) ||
((gPlayerEntity.height.WORD != 0 || (gPlayerState.field_0x14 != 0)))))) {
if ((gPlayerState.jumpStatus != 0) && ((gPlayerState.jumpStatus & 7) != 3)) {
_08076710:
sub_08076758(this, arg1);
return;
}
if (-1 < gPlayerEntity.height.WORD) {
gPlayerState.field_0x0[1] = 0;
this->stateID += 1;
gPlayerState.keepFacing = 0;
gPlayerState.jumpStatus = 1;
gPlayerState.field_0xe = -1;
gPlayerState.field_0x2c = NULL;
gPlayerEntity.field_0x20 = 0x20000;
_0807673C:
sub_08077F84();
SoundReq(SFX_PLY_VO4);
return;
}
}
}
}
sub_08077E78(this, arg1);
}
*/
ASM_FUNC("asm/non_matching/itemRocsCape/ItemRocsCape.inc", void ItemRocsCape(ItemBehavior* this, u32 arg1))
void sub_08076758(ItemBehavior* this, u32 arg1) {
s32 iVar1;
gPlayerState.field_0xe = 0;
if ((((gPlayerState.jumpStatus & 0x28) == 0) && (gPlayerState.jumpStatus != 0)) &&
((gPlayerState.jumpStatus & 7) != 3)) {
if (sub_08077EFC(this)) {
if (this->stateID < 2) {
if ((gPlayerEntity.field_0x20 < 1) && ((gPlayerState.jumpStatus & 0x10) == 0)) {
this->stateID = 2;
gPlayerEntity.field_0x7a.HWORD = 2;
gPlayerEntity.field_0x20 = 0x20000;
gPlayerState.jumpStatus |= 0x10;
gPlayerState.field_0x8 = 0x288;
SoundReq(SFX_172);
}
} else {
gPlayerEntity.field_0x7a.HWORD += 1;
}
} else {
if (this->stateID > 1) {
gPlayerEntity.field_0x7a.HWORD += 1;
gPlayerState.jumpStatus &= 0xef;
}
}
} else {
sub_08077E78(this, arg1);
}
}
+131
View File
@@ -0,0 +1,131 @@
#include "item.h"
#include "functions.h"
#include "audio.h"
extern void (*const gUnk_0811BD44[])(ItemBehavior*, u32);
void sub_080759B8(ItemBehavior*, u32);
extern u32 sub_08077EC8(ItemBehavior*);
void sub_08075694(ItemBehavior* this, u32 arg1);
void ItemSword(ItemBehavior* this, u32 arg1) {
gPlayerState.field_0xa8 = 0x02;
gUnk_0811BD44[this->stateID](this, arg1);
}
#ifdef EU
ASM_FUNC("asm/non_matching/eu/sub_08075338.inc", void sub_08075338(ItemBehavior* this, u32 arg1))
#else
ASM_FUNC("asm/non_matching/itemSword/sub_08075338.inc", void sub_08075338(ItemBehavior* this, u32 arg1))
#endif
ASM_FUNC("asm/non_matching/itemSword/sub_080754B8.inc", void sub_080754B8(ItemBehavior* this, u32 arg1))
void sub_08075580(ItemBehavior* this, u32 arg1) {
if ((sub_08077EFC(this) != 0) && (gPlayerState.jumpStatus == 0)) {
gPlayerState.field_0xa = gPlayerState.field_0xa & ~(8 >> arg1);
gPlayerState.field_0x1a[1] = 1;
gPlayerState.field_0x2c[0x40] = 0xd;
this->field_0xf = 0;
this->stateID = 2;
if ((gPlayerState.field_0xac & 0x200) != 0) {
this->field_0x5[2] = 0x28;
} else {
this->field_0x5[2] = 0x50;
}
sub_08077DF4(this, 0x168);
CreateObject(0x43, 0, 0);
return;
}
sub_080759B8(this, arg1);
}
void sub_080755F0(ItemBehavior* this, u32 arg1) {
if (sub_08077EFC(this) != 0) {
if (sub_08077EC8(this) == 0) {
if ((gPlayerState.field_0x1a[1] | gPlayerState.field_0x3[1]) != 0) {
if (--this->field_0x5[2] == 0) {
this->stateID = 3;
this->field_0x5[4] |= 0x80;
gPlayerState.field_0x1a[1] = gPlayerState.field_0x1a[1] | 0x20;
}
} else {
sub_080759B8(this, arg1);
}
}
} else {
sub_080759B8(this, arg1);
}
}
void sub_0807564C(ItemBehavior* this, u32 arg1) {
if ((gPlayerState.field_0x1a[1] | gPlayerState.field_0x3[1]) == 0) {
sub_080759B8(this, arg1);
} else {
if ((sub_08077EC8(this) == 0) && ((sub_08077EFC(this) == 0 || ((gPlayerState.field_0x1a[1] & 0x80) != 0)))) {
sub_08075694(this, arg1);
}
}
}
void sub_08075694(ItemBehavior* this, u32 arg1) {
this->field_0x5[2] = 1;
if ((gPlayerState.flags.all & 0x8000000) != 0) {
gPlayerState.flags.all &= 0xf7ffffff;
gPlayerState.flags.all &= 0xfffbffff;
sub_08077DF4(this, 300);
} else {
gPlayerState.field_0xab = 1;
sub_08077DF4(this, 0x124);
}
gPlayerState.field_0xa = (8 >> arg1) | gPlayerState.field_0xa;
this->stateID = 4;
this->field_0xf = 6;
gPlayerEntity.field_0x40 = 0x1e;
gPlayerState.field_0x1a[1] |= 0x40;
gPlayerState.field_0x1a[1] &= 0xdf;
if ((gPlayerState.field_0xa0[0] == 0x04) && ((gPlayerState.flags.all & 0x400000) == 0)) {
gPlayerState.field_0xa0[0] = 0x01;
sub_0807A108();
}
SoundReq(SFX_PLY_VO2);
}
ASM_FUNC("asm/non_matching/itemSword/sub_08075738.inc", void sub_08075738(ItemBehavior* this, u32 arg1))
void sub_08075898(ItemBehavior* this, u32 arg1) {
if (gPlayerState.field_0x3[1] == 0) {
sub_080759B8(this, arg1);
}
}
void sub_080758B0(ItemBehavior* this, u32 arg1) {
if (gPlayerState.field_0x3[1] == 0) {
sub_080759B8(this, arg1);
} else {
UpdateItemAnim(this);
if ((this->field_0x5[9] & 0x80) != 0) {
this->field_0xf = 0;
if ((gPlayerState.field_0x1a[1] & 0x20) != 0) {
this->stateID = 3;
} else {
this->stateID = 5;
}
gPlayerState.field_0x1a[1] &= 0xf7;
}
}
}
ASM_FUNC("asm/non_matching/itemSword/sub_08075900.inc", void sub_08075900(ItemBehavior* this, u32 arg1))
void sub_080759B8(ItemBehavior* this, u32 arg1) {
if ((gPlayerState.flags.all & 0x80) == 0) {
gPlayerEntity.field_0x40 = 0;
}
gPlayerState.flags.all &= 0xf7ffffff;
gPlayerState.field_0x1a[1] = 0;
gPlayerState.field_0x2c = NULL;
sub_08077E78(this, arg1);
}
+66
View File
@@ -0,0 +1,66 @@
#include "item.h"
#include "functions.h"
extern void (*const gUnk_0811BDB4[])(ItemBehavior*, u32);
u32 sub_08077F64(ItemBehavior* arg0, u32 unk);
void ItemTryPickupObject(ItemBehavior* this, u32 arg1) {
gUnk_0811BDB4[this->stateID](this, arg1);
}
ASM_FUNC("asm/non_matching/itemTryPickupObject/sub_080761C0.inc", void sub_080761C0(ItemBehavior* this, u32 arg1))
void sub_080762C4(ItemBehavior* this, u32 arg1, u8 arg2, u32 arg3) {
this->field_0x18 = arg1;
gPlayerState.heldObject = arg2;
sub_08077D38(this, arg3);
}
ASM_FUNC("asm/non_matching/itemTryPickupObject/sub_080762D8.inc", void sub_080762D8(ItemBehavior* this, u32 arg1))
void sub_08076488(ItemBehavior* this, u32 arg1) {
u32 bVar1;
s32 iVar2;
if (this->field_0x5[2] == 0) {
if (sub_08077F64(this, arg1) != 0) {
if (((*(u8*)((this->field_0x18) + 0x16) & 0xf0) == 0x10) && ((gScreenTransition.frameCount & 1U) != 0)) {
return;
}
UpdateItemAnim(this);
if ((this->field_0x5[9] & 0x80) != 0) {
gPlayerEntity.flags |= 0x80;
gPlayerState.heldObject = 4;
bVar1 = ~(8 >> arg1);
gPlayerState.keepFacing = bVar1 & gPlayerState.keepFacing;
gPlayerState.field_0xa = bVar1 & gPlayerState.field_0xa;
this->stateID += 1;
this->field_0xf = 0;
}
}
} else {
this->field_0x5[2] -= 1;
}
gPlayerState.field_0xa8 = 4;
}
ASM_FUNC("asm/non_matching/itemTryPickupObject/sub_08076518.inc", void sub_08076518(ItemBehavior* this, u32 arg1))
void sub_080765E0(ItemBehavior* this, u32 arg1) {
if (sub_08077F64(this, arg1) != 0) {
if ((this->field_0x5[9] & 0x80) != 0) {
sub_08077F50(this, arg1);
} else {
UpdateItemAnim(this);
}
}
}
void sub_0807660C(ItemBehavior* this, u32 arg1) {
UpdateItemAnim(this);
if ((--this->field_0x5[2] == 0xff) || (gPlayerState.field_0x0[1] == 0)) {
gPlayerState.field_0x0[1] = 0;
sub_08077E78(this, arg1);
}
}
+8 -6
View File
@@ -71,18 +71,20 @@ void sub_0804B0B0(u32 arg0, u32 arg1) {
LoadRoomEntityList(GetRoomProperty(arg0, arg1, 1));
}
void SetCurrentRoomPropertyList(u32 arg0, u32 arg1) {
void SetCurrentRoomPropertyList(u32 area, u32 room) {
u32** arr;
gUnk_02017654 = 0;
arr = &gAreaTable;
if (arr[arg0] != 0) {
gUnk_02017654 = arr[arg0][arg1];
if (arr[area] != 0) {
gUnk_02017654 = arr[area][room];
}
}
void sub_0804B0E8(u32 arg0, u32 arg1) {
void (*func)();
// init function at index 4 of room data
func = (void (*)())GetRoomProperty(arg0, arg1, 4);
if (func != NULL) {
func();
@@ -90,13 +92,13 @@ void sub_0804B0E8(u32 arg0, u32 arg1) {
}
// returns multiple types of data?
void* GetRoomProperty(u32 arg0, u32 arg1, u32 arg2) {
void* GetRoomProperty(u32 area, u32 room, u32 arg2) {
u32 temp;
u32** arr;
temp = 0;
arr = &gAreaTable;
if (arr[arg0] != NULL) {
temp = arr[arg0][arg1];
if (arr[area] != NULL) {
temp = arr[area][room];
if (temp != 0) {
temp = *(u32*)(arg2 * 4 + temp);
}
+39 -1
View File
@@ -122,7 +122,45 @@ ASM_FUNC("asm/non_matching/bigGoron/sub_0806D138.inc", void sub_0806D138(u8* par
ASM_FUNC("asm/non_matching/bigGoron/sub_0806D164.inc", void sub_0806D164(Entity* this))
ASM_FUNC("asm/non_matching/bigGoron/sub_0806D1D0.inc", void sub_0806D1D0(Entity* this))
void sub_0806D1D0(Entity* this) {
if (this->action == 0) {
if (sub_0806D00C(this) == NULL) {
DeleteThisEntity();
}
this->action = 1;
this->spriteOrientation.flipY = 3;
this->spriteRendering.b3 = 3;
this->spritePriority.b0 = 7;
this->spriteSettings.b.draw = 3;
this->frameIndex = 0;
this->actionDelay = 0x1e;
sub_0805E3A0(this, 2);
}
switch (this->subAction) {
case 0:
default:
if (--this->actionDelay == 0) {
this->actionDelay = (Random() & 0x7f) + 0x30;
this->field_0xf = 8;
this->frameIndex = 1;
}
if (this->field_0xf != 0) {
if (--this->field_0xf == 0) {
this->frameIndex = 0;
}
}
break;
case 1:
this->frameIndex = this->subAction;
break;
case 2:
this->spriteSettings.b.draw = 0;
break;
}
this->x.HALF.HI = this->parent->x.HALF.HI;
this->y.HALF.HI = this->parent->y.HALF.HI;
}
void sub_0806D274(Entity* this) {
Entity* npc;
+27 -1
View File
@@ -1,5 +1,7 @@
#include "global.h"
#include "entity.h"
#include "functions.h"
#include "flags.h"
extern void (*gUnk_0811423C[])(Entity*);
@@ -7,7 +9,31 @@ void ClothesRack(Entity* this) {
gUnk_0811423C[this->action](this);
}
ASM_FUNC("asm/non_matching/clothesRack/sub_0806DD90.inc", void sub_0806DD90(Entity* this))
void sub_0806DD90(Entity* this) {
u32 uVar1;
u32 uVar2;
u32 x;
u32 y;
this->action = 1;
uVar1 = CheckGlobalFlag(DRUG_1);
uVar2 = BOOLCAST(uVar1);
if (CheckGlobalFlag(DRUG_2) != 0) {
uVar2 = 2;
}
if (CheckGlobalFlag(DRUG_3) != 0) {
uVar2 = 3;
}
InitializeAnimation(this, uVar2);
x = this->x.HALF.HI;
y = this->y.HALF.HI;
SetTile(0x4072, TILE(x - 0x18, y - 0x10), this->collisionLayer);
SetTile(0x4072, TILE(x - 0x18, y), this->collisionLayer);
SetTile(0x4072, TILE(x - 0x18, y + 0x10), this->collisionLayer);
SetTile(0x4072, TILE(x + 0x18, y - 0x10), this->collisionLayer);
SetTile(0x4072, TILE(x + 0x18, y), this->collisionLayer);
SetTile(0x4072, TILE(x + 0x18, y + 0x10), this->collisionLayer);
}
void sub_0806DEC8(Entity* this) {
GetNextFrame(this);
+4 -1
View File
@@ -22,7 +22,10 @@ void Farmers_Head(Entity* this) {
sub_0807000C(this);
}
ASM_FUNC("asm/non_matching/farmers/sub_0806BC94.inc", void sub_0806BC94(Entity* this, ScriptExecutionContext* context))
void sub_0806BC94(Entity* this, ScriptExecutionContext* context) {
InitializeAnimation(this, context->intVariable + (BOOLCAST(this->spriteSettings.b.flipX) & 8U) +
(this->animationState >> 1));
}
void sub_0806BCB8(Entity* this) {
this->animationState = this->actionDelay;
+4 -1
View File
@@ -48,7 +48,10 @@ void sub_08063830(Entity* this) {
}
}
ASM_FUNC("asm/non_matching/sittingPerson/sub_08063850.inc", void sub_08063850(Entity* this))
void sub_08063850(Entity* this, ScriptExecutionContext* context) {
InitializeAnimation(this, context->intVariable + (BOOLCAST(this->spriteSettings.b.flipX) & 4U) +
(this->animationState >> 1));
}
void sub_08063874(Entity* this) {
this->animationState = this->actionDelay;
+6 -9
View File
@@ -370,20 +370,17 @@ void sub_08087114(Entity* this) {
}
}
NONMATCH("asm/greatFairy/sub_08087150.inc", void sub_08087150(Entity* this)) {
u32 temp;
void sub_08087150(Entity* this) {
GreatFairy_InitializeAnimation(this);
this->spriteSettings.b.draw = TRUE;
this->spriteSettings.b.draw = 1;
this->spriteOrientation.flipY = 0;
this->spriteRendering.b0 = 0;
this->spriteRendering.b3 = 0;
this->spritePriority.b0 = 3;
this->speed = 128;
this->speed = 0x80;
this->direction = 0x10;
temp = gUnk_0812079C[0];
this->palette.raw = ((temp & 0xf) << 4) | 0xf;
this->palette.b.b4 = gUnk_0812079C[0];
this->palette.b.b0 = gUnk_0812079C[0];
}
END_NONMATCH
void nullsub_516(Entity* this) {
}
+60
View File
@@ -0,0 +1,60 @@
#include "entity.h"
#include "player.h"
#include "functions.h"
extern void (*const gUnk_0812AA80[])(Entity*);
extern Hitbox* gUnk_0812AAD8[];
bool32 sub_080ACDB0(Entity*);
void sub_080ACC78(Entity*);
void sub_080ACECC(Entity*);
extern u8 gUnk_0812AAE8[];
void PlayerItem10(Entity* this) {
if ((gPlayerState.field_0x1c & 0x7f) != 1) {
DeleteThisEntity();
}
gUnk_0812AA80[this->action](this);
this->iframes = 0;
}
void sub_080ACC04(Entity* this) {
this->action = 1;
this->flags2 = gPlayerEntity.flags2;
this->direction = this->animationState << 2;
this->speed = 0x200;
this->flags |= 0xa0;
this->field_0x3c = 2;
this->hitbox = gUnk_0812AAD8[this->type];
this->field_0x70.WORD = 0x10;
sub_080ACDB0(this);
sub_0801766C(this);
}
void sub_080ACC5C(Entity* this) {
if (sub_080ACDB0(this) == FALSE) {
sub_080ACC78(this);
sub_080ACECC(this);
}
}
ASM_FUNC("asm/non_matching/playerItem10/sub_080ACC78.inc", void sub_080ACC78(Entity* this))
ASM_FUNC("asm/non_matching/playerItem10/sub_080ACDB0.inc", bool32 sub_080ACDB0(Entity* this))
void sub_080ACECC(Entity* this) {
Entity* entity;
if (this->type < 3 && this->attachedEntity == NULL && (s32) * (u32*)&this->field_0x78 >= 0 &&
gUnk_0812AAE8[this->type] <= *(u32*)&this->field_0x78) {
entity = CreatePlayerItem(0x10, this->type + 1, 0, 0);
if (entity != NULL) {
entity->parent = this;
this->attachedEntity = entity;
entity->x.HALF.HI = this->x.HALF.HI;
entity->y.HALF.HI = this->y.HALF.HI;
}
}
}
+24
View File
@@ -2,6 +2,7 @@
#include "entity.h"
#include "player.h"
#include "functions.h"
#include "audio.h"
extern void sub_08078CD0(Entity*);
extern void sub_08018FA0(Entity*);
@@ -91,3 +92,26 @@ void sub_08018DE8(Entity* this) {
}
sub_08078CD0(&gPlayerEntity);
}
ASM_FUNC("asm/non_matching/playerItem11/sub_08018E68.inc", void sub_08018E68(Entity* this))
void sub_08018F6C(Entity* this) {
if (this->attachedEntity != NULL) {
this->attachedEntity->subAction = 5;
this->attachedEntity->spriteSettings.b.draw = 1;
} else {
GetNextFrame(this);
if (this->frames.all == 0) {
return;
}
}
DeleteThisEntity();
}
void sub_08018FA0(Entity* this) {
this->collisionLayer = gPlayerEntity.collisionLayer;
if (this->collisionLayer == 0x02) {
this->type2 = 0x01;
}
SoundReq(this->type + SFX_EA);
}
+44
View File
@@ -0,0 +1,44 @@
#include "entity.h"
#include "functions.h"
#include "audio.h"
extern void (*const gUnk_0811B98C[])(Entity*);
extern void sub_08017744(Entity*);
void PlayerItem12(Entity* this) {
gUnk_0811B98C[this->action](this);
}
ASM_FUNC("asm/non_matching/playerItem12/sub_08070100.inc", void sub_08070100(Entity* this))
ASM_FUNC("asm/non_matching/playerItem12/sub_080701F8.inc", void sub_080701F8(Entity* this))
void sub_0807037C(Entity* this) {
GetNextFrame(this);
if ((this->frames.all & 0x80) != 0) {
DeleteThisEntity();
}
}
void sub_08070398(Entity* this) {
GetNextFrame(this);
sub_0806F69C(this);
if (sub_08003FC4(this, 0x2000) == 0) {
DeleteThisEntity();
}
}
ASM_FUNC("asm/non_matching/playerItem12/sub_080703BC.inc", void sub_080703BC(Entity* this))
void sub_08070458(Entity* this) {
this->action = 2;
this->flags &= 0x7f;
this->speed = 0;
if (this->field_0x7c.WORD != 0) {
SetTile(this->field_0x7c.WORD, TILE(this->x.HALF.HI, this->y.HALF.HI), this->collisionLayer);
}
InitializeAnimation(this, 0x13);
sub_08017744(this);
SoundReq(SFX_199);
}
+27
View File
@@ -0,0 +1,27 @@
#include "entity.h"
extern void (*const gUnk_081320A8[])(Entity*);
void PlayerItem13(Entity* this) {
gUnk_081320A8[this->subAction](this);
}
ASM_FUNC("asm/non_matching/playerItem13/sub_080ACF2C.inc", void sub_080ACF2C(Entity* this))
ASM_FUNC("asm/non_matching/playerItem13/sub_080ACFCC.inc", void sub_080ACFCC(Entity* this))
ASM_FUNC("asm/non_matching/playerItem13/sub_080AD040.inc", void sub_080AD040(Entity* this))
void sub_080AD274(Entity* this) {
DeleteThisEntity();
}
ASM_FUNC("asm/non_matching/playerItem13/sub_080AD27C.inc", void sub_080AD27C(Entity* this))
bool32 sub_080AD32C(Entity* this) {
bool32 result = FALSE;
if (((this->field_0x16 & 0xf0) == 0x10) || ((this->kind == 6 && ((this->id == 5 || (this->id == 0x7d)))))) {
result = TRUE;
}
return result;
}
+38
View File
@@ -0,0 +1,38 @@
#include "entity.h"
#include "audio.h"
#include "coord.h"
#include "functions.h"
extern void (*const gUnk_08127270[])(Entity*);
extern Hitbox gUnk_08127278;
void sub_080A310C(Entity*);
void PlayerItem15(Entity* this) {
gUnk_08127270[this->action](this);
}
void sub_080A3084(Entity* this) {
this->spriteSettings.b.draw = 1;
this->action = 0x01;
CopyPosition(this->parent, this);
if (this->type == 0) {
this->field_0x3c = gPlayerEntity.field_0x3c + 0x01;
this->hitbox = &gUnk_08127278;
this->speed = 0x400;
if (this->collisionLayer == 0x02) {
this->type2 = 0x01;
}
this->direction = this->animationState << 2;
*(u32*)&this->field_0x6c = 0x3c;
sub_0801766C(this);
sub_0806F69C(this);
SoundReq(SFX_ITEM_SWORD_BEAM);
} else {
this->actionDelay = 0x06;
}
InitializeAnimation(this, 0x18);
sub_080A310C(this);
}
ASM_FUNC("asm/non_matching/playerItem15/sub_080A310C.inc", void sub_080A310C(Entity* this))
+66
View File
@@ -0,0 +1,66 @@
#include "entity.h"
#include "functions.h"
extern void (*const gUnk_080B77FC[])(Entity*);
void sub_0801B804(Entity*);
void sub_0801B864(Entity*);
extern s8 gUnk_080B782E[];
extern void sub_08008782(Entity*, u32, s32, s32);
void PlayerItem3(Entity* this) {
gUnk_080B77FC[this->action](this);
if (this->animIndex != 0xb) {
if (this->animationState == 6) {
this->field_0x86.HWORD += 0x2000;
} else {
this->field_0x86.HWORD -= 0x2000;
}
sub_0805EC9C(this, 0x100, 0x100, this->field_0x86.HWORD);
}
this->field_0xf--;
if ((this->field_0xf & 0xf) == 0) {
EnqueueSFX(0xfb);
}
}
#ifdef EU
ASM_FUNC("asm/non_matching/eu/sub_0801B4C8.inc", void sub_0801B4C8(Entity* this))
#else
ASM_FUNC("asm/non_matching/playerItem3/sub_0801B4C8.inc", void sub_0801B4C8(Entity* this))
#endif
ASM_FUNC("asm/non_matching/playerItem3/sub_0801B584.inc", void sub_0801B584(Entity* this))
ASM_FUNC("asm/non_matching/playerItem3/sub_0801B680.inc", void sub_0801B680(Entity* this))
void sub_0801B7A8(Entity* this) {
sub_0801B804(this);
if (this->actionDelay != 0) {
this->actionDelay -= 1;
} else {
sub_0801B864(this);
if (this->speed < 0x280) {
this->speed += 8;
}
this->direction = GetFacingDirection(this, &gPlayerEntity);
sub_0806F69C(this);
if (sub_0800419C(this, &gPlayerEntity, 2, 2) != 0) {
DeleteThisEntity();
}
}
}
ASM_FUNC("asm/non_matching/playerItem3/sub_0801B804.inc", void sub_0801B804(Entity* this))
void sub_0801B864(Entity* this) {
s32 iVar1;
if (this->type2 == 0) {
sub_0800451C(this);
}
iVar1 = (this->direction >> 2) * 2;
sub_08008782(this, 2, gUnk_080B782E[iVar1], gUnk_080B782E[iVar1 + 1]);
}
+113
View File
@@ -0,0 +1,113 @@
#include "entity.h"
#include "player.h"
#include "functions.h"
extern void (*const gUnk_080B77C8[])(Entity*);
extern void sub_08078954(Entity*);
void sub_0801B418(Entity*);
void sub_0801B3A4(Entity*);
extern void (*const gUnk_080B77D8[])(Entity*);
extern void sub_08079BD8(Entity*);
extern void sub_08008796(Entity*, u32, u32, u32);
NONMATCH("asm/non_matching/playerItemBomb/PlayerItemBomb.inc", void PlayerItemBomb(Entity* this)) {
u8 uVar1;
gUnk_080B77C8[this->action](this);
GetNextFrame(this);
// TODO regalloc
uVar1 = this->action;
if (uVar1 != 0x03) {
if (this->actionDelay != 0) {
if (this->field_0x68.HALF.LO == 7) {
this->actionDelay -= 1;
}
if (this->actionDelay == 0) {
this->field_0xf = 0x50;
*(u32*)&this->field_0x68 = 0;
this->spriteRendering.b0 = 3;
sub_0805EC9C(this, 0x100, 0x100, 0);
}
} else {
if (this->field_0xf != 0) {
if (this->field_0xf-- == 0x01) {
if ((uVar1 == 0x02) && (this->subAction == 1)) {
gPlayerState.heldObject = 0;
}
this->action = 0x03;
this->spritePriority.b1 = 2;
this->actionDelay = 0x0f;
this->spriteSettings.b.draw = 0;
sub_0805EC60(this);
sub_08078954(this);
CreateObjectWithParent(this, 0x20, 0, 0);
sub_0801B418(this);
} else {
sub_0801B3A4(this);
}
}
}
}
}
END_NONMATCH
ASM_FUNC("asm/non_matching/playerItemBomb/sub_0801B250.inc", void sub_0801B250(Entity* this))
ASM_FUNC("asm/non_matching/playerItemBomb/sub_0801B2CC.inc", void sub_0801B2CC(Entity* this))
void sub_0801B318(Entity* this) {
gUnk_080B77D8[this->subAction](this);
}
void sub_0801B330(Entity* this) {
this->subAction += 1;
sub_08079BD8(this);
}
void sub_0801B340(Entity* this) {
this->spritePriority.b1 = 2;
}
void sub_0801B354(Entity* this) {
this->spritePriority.b1 = 3;
}
void sub_0801B368(Entity* this) {
this->action -= 1;
this->subAction = 0;
if (0x3c < this->actionDelay) {
this->actionDelay = 0x3c;
}
}
void sub_0801B384(Entity* this) {
DeleteThisEntity();
}
void sub_0801B38C(Entity* this) {
if (this->actionDelay-- == 0) {
DeleteThisEntity();
}
}
ASM_FUNC("asm/non_matching/playerItemBomb/sub_0801B3A4.inc", void sub_0801B3A4(Entity* this))
void sub_0801B418(Entity* this) {
s32 x;
s32 y;
s32 iVar3 = 0;
y = 0x10;
while (iVar3 >= -0x10) {
x = 0x10;
iVar3 = y - 0x10;
while (x >= -0x10) {
sub_08008796(this, 3, this->x.HALF.HI + x, this->y.HALF.HI + y);
x -= 0x10;
}
y = iVar3;
}
}
+30
View File
@@ -1,8 +1,38 @@
#include "global.h"
#include "entity.h"
#include "functions.h"
extern void (*const gUnk_080B3E30[])(Entity*);
void PlayerItemBow(Entity* this) {
gUnk_080B3E30[(this->action)](this);
}
ASM_FUNC("asm/non_matching/playerItemBow/sub_08018FE4.inc", void sub_08018FE4(Entity* this))
ASM_FUNC("asm/non_matching/playerItemBow/sub_0801917C.inc", void sub_0801917C(Entity* this))
void sub_08019410(Entity* this) {
if (this->actionDelay < 0xf) {
InitializeAnimation(this, this->animIndex);
} else {
GetNextFrame(this);
}
if (this->actionDelay-- == 0) {
DeleteThisEntity();
}
}
void sub_08019444(Entity* this) {
GetNextFrame(this);
sub_0806F69C(this);
if (sub_08003FC4(this, 0x2000) == 0) {
DeleteThisEntity();
}
}
void sub_08019468(Entity* this) {
if (this->field_0x40 == 0x0e) {
CreateFx(this, 0x50, 0);
}
}
+60
View File
@@ -0,0 +1,60 @@
#include "entity.h"
#include "player.h"
#include "functions.h"
extern void (*const gUnk_080B7840[])(Entity*);
extern void sub_08079BD8(Entity*);
void sub_0801B8FC(Entity*);
void sub_0801B938(Entity*);
extern void sub_08017744(Entity*);
void PlayerItemC(Entity* this) {
gUnk_080B7840[this->action](this);
}
void sub_0801B8B0(Entity* this) {
if (gPlayerState.field_0x1d[1] != 0) {
gPlayerState.field_0x2c = (u8*)this;
this->flags |= 0x20;
this->action = 0x01;
this->flags2 = 8;
sub_080AE008(this, 1, 3);
sub_08079BD8(this);
sub_0801766C(this);
sub_0801B8FC(this);
} else {
DeleteThisEntity();
}
}
NONMATCH("asm/non_matching/playerItemC/sub_0801B8FC.inc", void sub_0801B8FC(Entity* this)) {
Entity* pbVar1;
u32 tmp;
pbVar1 = (Entity*)gPlayerState.field_0x2c;
if ((Entity*)gPlayerState.field_0x2c != this) {
DeleteThisEntity();
} else {
if ((u8*)(u32)gPlayerState.field_0x1d[1] == NULL) {
gPlayerState.field_0x2c = (u8*)(u32)gPlayerState.field_0x1d[1];
DeleteThisEntity();
} else {
// TODO regalloc
gPlayerState.field_0x2c[0x10] |= 0x80;
pbVar1->field_0x3c = 0x21;
sub_0801B938(pbVar1);
}
}
}
END_NONMATCH
ASM_FUNC("asm/non_matching/playerItemC/sub_0801B938.inc", void sub_0801B938(Entity* this))
void sub_0801B9F0(Entity* this) {
this->flags &= 0x7f;
sub_08017744(this);
}
@@ -0,0 +1,4 @@
#include "entity.h"
ASM_FUNC("asm/non_matching/playerItemCellOverwriteSet/PlayerItemCellOverwriteSet.inc",
void PlayerItemCellOverwriteSet(Entity* this))
+75
View File
@@ -0,0 +1,75 @@
#include "entity.h"
#include "player.h"
#include "functions.h"
extern void (*const gUnk_08132700[])(Entity*);
extern Hitbox gUnk_08132B28;
void sub_080ADC84(Entity*);
void sub_080ADCA0(Entity*, u32);
void PlayerItemGustJar(Entity* this) {
if (((Entity*)gPlayerState.field_0x2c != this) || (gPlayerState.field_0x1c == 0)) {
DeleteThisEntity();
}
gUnk_08132700[this->action](this);
sub_08078E84(this, &gPlayerEntity);
}
void sub_080ADA6C(Entity* this) {
this->action = 1;
this->field_0xf = 0xf;
this->hitbox = &gUnk_08132B28;
this->hitbox->unk2[2] = 3;
this->hitbox->unk2[1] = 3;
this->hitbox->unk2[3] = 6;
this->hitbox->unk2[0] = 6;
sub_080ADC84(this);
sub_080AE008(this, 1, 3);
InitAnimationForceUpdate(this, this->animationState >> 1);
}
void sub_080ADAA8(Entity* this) {
sub_080ADC84(this);
if ((this->frames.all & 0x80) != 0) {
this->action = 2;
sub_080ADCA0(this, 0);
} else {
UpdateAnimationSingleFrame(this);
}
}
ASM_FUNC("asm/non_matching/playerItemGustJar/sub_080ADAD4.inc", void sub_080ADAD4(Entity* this))
void sub_080ADC14(Entity* this) {
switch (gPlayerState.field_0x1c & 0xf) {
case 6:
this->action += 1;
InitAnimationForceUpdate(this, (gPlayerEntity.animationState >> 1) + 4);
break;
case 1:
sub_080ADCA0(this, 0);
this->action = 2;
break;
default:
UpdateAnimationSingleFrame(this);
break;
}
}
void sub_080ADC60(Entity* this) {
if ((this->frames.all & 0x80) != 0) {
this->spriteSettings.b.draw = 0;
} else {
UpdateAnimationSingleFrame(this);
}
}
void sub_080ADC84(Entity* this) {
this->spriteSettings.b.flipX = gPlayerEntity.spriteSettings.b.flipX;
}
ASM_FUNC("asm/non_matching/playerItemGustJar/sub_080ADCA0.inc", void sub_080ADCA0(Entity* this, u32 param_1))
ASM_FUNC("asm/non_matching/playerItemGustJar/sub_080ADCDC.inc", void sub_080ADCDC(Entity* this))
+34
View File
@@ -0,0 +1,34 @@
#include "entity.h"
#include "player.h"
#include "functions.h"
extern void (*const gUnk_080FEEA8[])(Entity*);
extern bool32 AllocMutableHitbox(Entity*);
void sub_08054AC8(Entity*);
void PlayerItemLantern(Entity* this) {
gUnk_080FEEA8[this->action](this);
this->bitfield = 0;
}
NONMATCH("asm/non_matching/playerItemLantern/sub_08054A60.inc", void sub_08054A60(Entity* this)) {
this->flags |= 0xa0;
this->action = 0x01;
this->actionDelay = 0x04;
this->frameIndex = -1;
// TODO regalloc and mov 6 too early
this->scriptedScene = (this->scriptedScene & 0xf0) | 6;
this->field_0x3c = 7;
this->flags2 = -0x80;
this->animationState = gPlayerEntity.animationState & 0xe;
if (AllocMutableHitbox(this) == FALSE) {
DeleteThisEntity();
}
sub_0801766C(this);
sub_080AE008(this, 1, 3);
sub_08054AC8(this);
}
END_NONMATCH
ASM_FUNC("asm/non_matching/playerItemLantern/sub_08054AC8.inc", void sub_08054AC8(Entity* this))
+21
View File
@@ -0,0 +1,21 @@
#include "entity.h"
#include "audio.h"
#include "functions.h"
extern void (*const gUnk_0811B9D8[])(Entity*);
void sub_080704FC(Entity*);
void PlayerItemPacciCane(Entity* this) {
gUnk_0811B9D8[this->action](this);
}
void sub_080704D4(Entity* this) {
this->action = 1;
this->frameIndex = -1;
sub_080AE008(this, 1, 3);
SoundReq(SFX_10E);
sub_080704FC(this);
}
ASM_FUNC("asm/non_matching/playerItemPacciCane/sub_080704FC.inc", void sub_080704FC(Entity* this))
+15
View File
@@ -0,0 +1,15 @@
#include "entity.h"
extern void (*const gUnk_081271D4[])(Entity*);
void PlayerItemShield(Entity* this) {
if (*(int*)&this->field_0x6c != 0) {
*(int*)&this->field_0x6c += -1;
}
gUnk_081271D4[this->action](this);
}
ASM_FUNC("asm/non_matching/playerItemShield/sub_080A2D98.inc", void sub_080A2D98(Entity* this))
ASM_FUNC("asm/non_matching/playerItemShield/sub_080A2E00.inc", void sub_080A2E00(Entity* this))
+37
View File
@@ -0,0 +1,37 @@
#include "entity.h"
#include "functions.h"
extern void (*const gUnk_0812905C[])(Entity*);
extern u8 gUnk_08129096[];
void PlayerItemSword(Entity* this) {
gUnk_0812905C[this->action](this);
if (this->type == 0) {
sub_08078E84(this, &gPlayerEntity);
this->hitbox->offset_x += this->spriteOffsetX;
this->hitbox->offset_y += this->spriteOffsetY;
}
}
ASM_FUNC("asm/non_matching/playerItemSword/sub_080A758C.inc", void sub_080A758C(Entity* this))
ASM_FUNC("asm/non_matching/playerItemSword/sub_080A76CC.inc", void sub_080A76CC(Entity* this))
ASM_FUNC("asm/non_matching/playerItemSword/sub_080A7824.inc", void sub_080A7824(Entity* this))
ASM_FUNC("asm/non_matching/playerItemSword/sub_080A78B8.inc", void sub_080A78B8(Entity* this))
void sub_080A7A54(Entity* this) {
u8* tmp;
tmp = &gUnk_08129096[(gPlayerEntity.frameIndex - 0x6a) * 4];
this->hitbox->offset_x = tmp[0];
this->hitbox->offset_y = tmp[1];
this->hitbox->width = tmp[2];
this->hitbox->height = tmp[3];
}
ASM_FUNC("asm/non_matching/playerItemSword/sub_080A7A84.inc", void sub_080A7A84(Entity* this))
ASM_FUNC("asm/non_matching/playerItemSword/sub_080A7B98.inc", void sub_080A7B98(Entity* this))
+103
View File
@@ -0,0 +1,103 @@
#include "entity.h"
#include "player.h"
#include "coord.h"
#include "functions.h"
#include "audio.h"
extern void (*const gUnk_080B43F4[])(Entity*);
extern Hitbox gUnk_080B4408;
extern u8 gUnk_080B43FC[];
void sub_08019580(Entity*);
extern u8 gUnk_08003E44;
void sub_08019644(Entity*);
extern u8 gUnk_080B4400[];
void PlayerItemSwordBeam(Entity* this) {
gUnk_080B43F4[this->action](this);
}
void sub_08019498(Entity* this) {
CopyPosition(&gPlayerEntity, this);
this->action += 0x01;
this->spriteSettings.b.draw = 1;
this->field_0x3c = gPlayerEntity.field_0x3c + 1;
this->hitbox = &gUnk_080B4408;
this->speed = 0x380;
*(u32*)&this->field_0x74 = 2;
this->field_0x70.WORD = 0;
if (this->collisionLayer == 0x02) {
this->type2 = 0x01;
}
this->direction = this->animationState << 2;
*(u32*)&this->field_0x6c = 0x3c;
switch (this->animationState) {
case 0:
this->x.HALF.HI += -3;
this->y.HALF.HI += -8;
this->spriteSettings.raw |= 0x80;
break;
case 4:
this->x.HALF.HI += 2;
break;
case 2:
this->spriteSettings.b.flipX = 1;
this->x.HALF.HI += 1;
this->y.HALF.HI += -4;
break;
case 6:
this->x.HALF.HI -= 1;
this->y.HALF.HI += -4;
break;
}
InitializeAnimation(this, gUnk_080B43FC[this->animationState >> 1]);
sub_0801766C(this);
sub_0806F69C(this);
sub_08019580(this);
SoundReq(SFX_ITEM_SWORD_BEAM);
}
void sub_08019580(Entity* this) {
if (--*(int*)&this->field_0x6c != -1) {
GetNextFrame(this);
sub_0806F69C(this);
this->actionDelay += 0x01;
if (this->type2 == 0) {
sub_0800451C(this);
}
if ((sub_080002F0(TILE(this->x.HALF.HI, this->y.HALF.HI), gPlayerEntity.collisionLayer, 0x80) == 0) &&
(sub_080040D8(this, &gUnk_08003E44, this->x.HALF.HI, this->y.HALF.HI) != 0)) {
CreateFx(this, 0x19, 0);
DeleteThisEntity();
}
if (this->bitfield != 0) {
CreateFx(this, 0x19, 0);
DeleteThisEntity();
}
if (sub_08008790(this, 0xc) != NULL) {
DeleteThisEntity();
}
} else {
DeleteThisEntity();
}
sub_08019644(this);
}
void sub_08019644(Entity* this) {
s32 iVar1;
iVar1 = *(int*)&this->field_0x74 + -1;
*(int*)&this->field_0x74 = iVar1;
if (iVar1 == 0) {
*(int*)&this->field_0x74 = 2;
this->field_0x70.WORD += 1;
if (gUnk_080B4400[this->field_0x70.WORD] == 0xff) {
this->field_0x70.WORD = iVar1;
}
sub_0801D2B4(this, (u32)gUnk_080B4400[this->field_0x70.WORD]);
}
}
+25
View File
@@ -0,0 +1,25 @@
#include "entity.h"
extern void (*const gUnk_080B7870[])(Entity*);
void sub_0801BE38(Entity*);
void PlayerItemSwordSpin(Entity* this) {
gUnk_080B7870[this->action](this);
}
ASM_FUNC("asm/non_matching/playerItemSwordSpin/sub_0801BA18.inc", void sub_0801BA18(Entity* this))
ASM_FUNC("asm/non_matching/playerItemSwordSpin/sub_0801BB2C.inc", void sub_0801BB2C(Entity* this))
void sub_0801BC0C(Entity* this) {
sub_0801BE38(this);
}
ASM_FUNC("asm/non_matching/playerItemSwordSpin/sub_0801BC14.inc", void sub_0801BC14(Entity* this))
ASM_FUNC("asm/non_matching/playerItemSwordSpin/sub_0801BCB4.inc", void sub_0801BCB4(Entity* this))
ASM_FUNC("asm/non_matching/playerItemSwordSpin/sub_0801BDE8.inc", void sub_0801BDE8(Entity* this))
ASM_FUNC("asm/non_matching/playerItemSwordSpin/sub_0801BE38.inc", void sub_0801BE38(Entity* this))