document tile asm functions

This commit is contained in:
theo3
2023-12-31 17:29:08 -08:00
parent 5049daabc5
commit 37ac9cb0fb
147 changed files with 973 additions and 931 deletions
+1 -1
View File
@@ -195,7 +195,7 @@ void sub_0801B418(Entity* this) {
x = 0x10;
iVar3 = y - 0x10;
while (x >= -0x10) {
sub_08008796(this, 3, this->x.HALF.HI + x, this->y.HALF.HI + y);
DoTileInteraction(this, 3, this->x.HALF.HI + x, this->y.HALF.HI + y);
x -= 0x10;
}
y = iVar3;
+2 -2
View File
@@ -28,7 +28,7 @@ void PlayerItemBoomerang_Init(PlayerItemBoomerangEntity* this);
void PlayerItemBoomerang_Action2(PlayerItemBoomerangEntity* this);
void PlayerItemBoomerang_Action3(PlayerItemBoomerangEntity* this);
extern Entity* sub_08008782(Entity*, u32, s32, s32);
extern Entity* DoTileInteractionOffset(Entity*, u32, s32, s32);
extern bool32 sub_080040E2(Entity*, u8*);
extern Hitbox gUnk_081271CC;
extern u8 gUnk_08003E44;
@@ -257,5 +257,5 @@ Entity* sub_0801B864(Entity* this) {
sub_0800451C(this);
}
iVar1 = (this->direction >> 2) * 2;
return sub_08008782(this, 2, gUnk_080B782E[iVar1], gUnk_080B782E[iVar1 + 1]);
return DoTileInteractionOffset(this, 2, gUnk_080B782E[iVar1], gUnk_080B782E[iVar1 + 1]);
}
+1 -1
View File
@@ -279,7 +279,7 @@ void PlayerItemBottle_UseEmptyBottle(Entity* this) {
if (this->spriteSettings.flipX != 0) {
iVar2 = -iVar2;
}
if (GetRelativeCollisionTile(this, iVar2, (s8)ptr2[1]) == 0x10) {
if (GetActTileRelative(this, iVar2, (s8)ptr2[1]) == 0x10) {
this->type2 = ITEM_BOTTLE_WATER;
}
}
+2 -2
View File
@@ -37,7 +37,7 @@ typedef struct {
extern u8 gUnk_08003E44;
extern Entity* sub_08008782(Entity*, u32, s32, s32);
extern Entity* DoTileInteractionOffset(Entity*, u32, s32, s32);
extern void sub_08017744(Entity*);
extern void ModArrows(s32);
@@ -146,7 +146,7 @@ void PlayerItemBow_Action1(PlayerItemBowEntity* this) {
super->spriteSettings.draw ^= 1;
}
LinearMoveUpdate(super);
if (sub_08008782(super, (super->hurtType == 0x0e) ? 1 : 4, this->unk_6c, this->unk_70) != NULL) {
if (DoTileInteractionOffset(super, (super->hurtType == 0x0e) ? 1 : 4, this->unk_6c, this->unk_70) != NULL) {
if (super->hurtType != 0x0e) {
DeleteThisEntity();
}
+2 -2
View File
@@ -8,7 +8,7 @@
#include "functions.h"
#include "player.h"
extern Entity* sub_08008782(Entity*, u32, s32, s32);
extern Entity* DoTileInteractionOffset(Entity*, u32, s32, s32);
void PlayerItemDashSword_Action1(Entity* this);
void PlayerItemDashSword_Init(Entity* this);
@@ -81,7 +81,7 @@ void sub_0801B938(Entity* this) {
this->hitbox = (Hitbox*)&gUnk_080B7850[this->animationState >> 1];
ptr = &gUnk_080B7848[(this->animationState >> 1) * 2];
sub_08008782(this, -(gPlayerState.skills & SKILL_ROCK_BREAKER) != 0, ptr[0], ptr[1]);
DoTileInteractionOffset(this, -(gPlayerState.skills & SKILL_ROCK_BREAKER) != 0, ptr[0], ptr[1]);
sub_08078E84(this, &gPlayerEntity.base);
}
+1 -1
View File
@@ -79,7 +79,7 @@ void PlayerItemFireRodProjectile_Action1(PlayerItemFireRodProjectileEntity* this
CreateFx(super, FX_SWORD_MAGIC, 0);
DeleteThisEntity();
}
if (sub_08008790(super, 0xc)) {
if (DoTileInteractionHere(super, 0xc)) {
DeleteThisEntity();
}
super->child = CreatePlayerItem(PLAYER_ITEM_FIRE_ROD_PROJECTILE, 1, 0, this->unk_68);
+2 -2
View File
@@ -42,7 +42,7 @@ typedef struct {
u16 tileID;
} Obj11;
Obj11* sub_08008782(Entity*, u32, u32, u32);
Obj11* DoTileInteractionOffset(Entity*, u32, u32, u32);
extern const s8* const sOffsets[];
extern const s8 gUnk_0812AABC[];
@@ -101,7 +101,7 @@ static void sub_080ACC78(PlayerItemGustEntity* this) {
if (child_offsets[this->offset_iter] == 0) {
this->offset_iter = 0;
}
o = sub_08008782(super, 0xe, child_offsets[this->offset_iter], child_offsets[this->offset_iter + 1]);
o = DoTileInteractionOffset(super, 0xe, child_offsets[this->offset_iter], child_offsets[this->offset_iter + 1]);
if (o != NULL) {
child = CreateObject(BUSH, o->type, o->type2);
if (child != NULL) {
+4 -4
View File
@@ -25,7 +25,7 @@ extern void PlayerItemGustBig_Action1(PlayerItemGustBigEntity* this);
extern void PlayerItemGustBig_Action2(PlayerItemGustBigEntity* this);
extern void PlayerItemGustBig_Action3(PlayerItemGustBigEntity* this);
extern u32 sub_08007DD6(u32, const u16*);
extern u32 ActTileToTile(u32, const u16*);
extern const u8 gUnk_08003E44[];
@@ -136,7 +136,7 @@ void PlayerItemGustBig_Action2(PlayerItemGustBigEntity* this) {
s32 x;
if (super->child == NULL) {
GetNextFrame(super);
sub_08008790(super, 5);
DoTileInteractionHere(super, 5);
} else {
if ((super->child->gustJarState & 4) == 0) {
DeleteThisEntity();
@@ -174,10 +174,10 @@ void PlayerItemGustBig_Action2(PlayerItemGustBigEntity* this) {
if (super->type2 == 0) {
sub_0800451C(super);
}
if (sub_08007DD6(sub_080B1A0C(super, x, y), gUnk_080B3DF4) != 0) {
if (ActTileToTile(sub_080B1A0C(super, x, y), gUnk_080B3DF4) != 0) {
return;
}
if (GetRelativeCollisionTile(super, x, y) == 0x74) {
if (GetActTileRelative(super, x, y) == 0x74) {
return;
}
if (sub_080040D8(super, (u8*)gUnk_08003E44, super->x.HALF.HI + x, super->y.HALF.HI + y) == 0) {
+2 -2
View File
@@ -121,8 +121,8 @@ void PlayerItemHeldObject_SubAction2(PlayerItemHeldObjectEntity* this) {
super->direction = super->knockbackDirection;
super->knockbackDuration = 0;
}
if (GetRelativeCollisionTile(super, gUnk_081320C4[super->direction >> 2],
gUnk_081320C4[(super->direction >> 2) + 1]) == 0x74) {
if (GetActTileRelative(super, gUnk_081320C4[super->direction >> 2],
gUnk_081320C4[(super->direction >> 2) + 1]) == 0x74) {
LinearMoveUpdate(super);
} else {
tile = sub_080B1B0C(super);
@@ -30,7 +30,7 @@ void PlayerItemPacciCaneProjectile_Action4(PlayerItemPacciCaneProjectileEntity*
void sub_08070458(PlayerItemPacciCaneProjectileEntity* this);
extern void sub_08017744(Entity*);
extern u8* sub_08008782(Entity*, u32, u32, u32);
extern u8* DoTileInteractionOffset(Entity*, u32, u32, u32);
void PlayerItemPacciCaneProjectile(PlayerItemPacciCaneProjectileEntity* this) {
static void (*const PlayerItemPacciCaneProjectile_Actions[])(PlayerItemPacciCaneProjectileEntity*) = {
@@ -104,7 +104,7 @@ void PlayerItemPacciCaneProjectile_Action1(PlayerItemPacciCaneProjectileEntity*
cVar1 = gUnk_0811B9C8[super->animationState];
cVar2 = gUnk_0811B9C8[super->animationState + 1];
iVar3 = sub_08008782(super, 10, cVar1, cVar2);
iVar3 = DoTileInteractionOffset(super, 10, cVar1, cVar2);
if (iVar3) {
pEVar4 = CreateObject(OBJECT_53, iVar3[5], iVar3[2]);
if (pEVar4) {
@@ -135,7 +135,7 @@ void PlayerItemPacciCaneProjectile_Action1(PlayerItemPacciCaneProjectileEntity*
super->spritePriority.b0 = 7;
this->unk_7c = GetTileIndex(COORD_TO_TILE(super), super->collisionLayer);
InitializeAnimation(super, 0x14);
SetTile(0x4020, COORD_TO_TILE(super), super->collisionLayer);
SetBottomTile(0x4020, COORD_TO_TILE(super), super->collisionLayer);
return;
}
} else {
@@ -197,7 +197,7 @@ void sub_08070458(PlayerItemPacciCaneProjectileEntity* this) {
COLLISION_OFF(super);
super->speed = 0;
if (this->unk_7c != 0) {
SetTile(this->unk_7c, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
SetBottomTile(this->unk_7c, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
}
InitializeAnimation(super, 0x13);
sub_08017744(super);
+4 -4
View File
@@ -361,7 +361,7 @@ void sub_080A7A84(PlayerItemSwordEntity* this) {
uVar3 = -uVar3;
}
if (super->type != 0) {
sub_08008796(super, 0, super->x.HALF.HI + uVar3, super->y.HALF.HI + r5);
DoTileInteraction(super, 0, super->x.HALF.HI + uVar3, super->y.HALF.HI + r5);
} else if (super->z.WORD == 0) {
if (gPlayerState.skills & SKILL_ROCK_BREAKER) {
tmp2 = 1;
@@ -369,11 +369,11 @@ void sub_080A7A84(PlayerItemSwordEntity* this) {
tmp2 = 0;
}
new_var = uVar3;
if (((sub_08008796(super, tmp2, super->x.HALF.HI + new_var, super->y.HALF.HI + r5) == NULL) &&
if (((DoTileInteraction(super, tmp2, super->x.HALF.HI + new_var, super->y.HALF.HI + r5) == NULL) &&
(gPlayerState.sword_state != 0)) &&
((gPlayerState.sword_state & 0xc0) == 0)) {
new_var2 = super;
if (GetRelativeCollisionTile(new_var2, new_var, r5) == 0x2e) {
if (GetActTileRelative(new_var2, new_var, r5) == 0x2e) {
SoundReqClipped(&gPlayerEntity.base, SFX_ITEM_GLOVES_KNOCKBACK);
} else {
SoundReqClipped(&gPlayerEntity.base, SFX_METAL_CLINK);
@@ -406,7 +406,7 @@ void sub_080A7B98(PlayerItemSwordEntity* this) {
for (i = 0; i < 3; i++) {
xOffset = -0x10;
for (j = 0; j < 3; j++) {
sub_08008796(super, uVar2, super->x.HALF.HI + xOffset, super->y.HALF.HI + yOffset);
DoTileInteraction(super, uVar2, super->x.HALF.HI + xOffset, super->y.HALF.HI + yOffset);
xOffset += 0x10;
}
yOffset += 0x10;
+1 -1
View File
@@ -97,7 +97,7 @@ void PlayerItemSwordBeam_Action1(PlayerItemSwordBeamEntity* this) {
CreateFx(super, FX_SWORD_MAGIC, 0);
DeleteThisEntity();
}
if (sub_08008790(super, 0xc) != NULL) {
if (DoTileInteractionHere(super, 0xc) != NULL) {
DeleteThisEntity();
}
} else {