summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortheo3 <arisstephenson2@gmail.com>2023-12-31 17:29:08 -0800
committertheo3 <arisstephenson2@gmail.com>2023-12-31 17:34:02 -0800
commit37ac9cb0fb2d9ccb64286bab2cdf648e6f2541c5 (patch)
tree1556b8aba35a82f1cc0d538b93251a1b401f32f5 /src
parent5049daabc59d113152143d123aea2798d9487a0c (diff)
document tile asm functions
Diffstat (limited to 'src')
-rw-r--r--src/beanstalkSubtask.c46
-rw-r--r--src/code_08049DF4.c2
-rw-r--r--src/enemy/armos.c8
-rw-r--r--src/enemy/businessScrub.c4
-rw-r--r--src/enemy/chuchu.c24
-rw-r--r--src/enemy/chuchuBoss.c2
-rw-r--r--src/enemy/doorMimic.c4
-rw-r--r--src/enemy/enemy64.c16
-rw-r--r--src/enemy/eyegore.c20
-rw-r--r--src/enemy/flyingPot.c12
-rw-r--r--src/enemy/flyingSkull.c16
-rw-r--r--src/enemy/gyorgFemale.c2
-rw-r--r--src/enemy/helmasaur.c4
-rw-r--r--src/enemy/mazaalBracelet.c3
-rw-r--r--src/enemy/mazaalMacro.c2
-rw-r--r--src/enemy/octorokGolden.c2
-rw-r--r--src/enemy/pesto.c3
-rw-r--r--src/enemy/rollobite.c2
-rw-r--r--src/enemy/rupeeLike.c2
-rw-r--r--src/enemy/spinyBeetle.c4
-rw-r--r--src/enemy/stalfos.c2
-rw-r--r--src/enemy/vaatiProjectile.c2
-rw-r--r--src/enemy/wizzrobeFire.c4
-rw-r--r--src/enemy/wizzrobeIce.c4
-rw-r--r--src/enemy/wizzrobeWind.c6
-rw-r--r--src/interrupts.c4
-rw-r--r--src/item/itemMoleMitts.c4
-rw-r--r--src/item/itemTryPickupObject.c4
-rw-r--r--src/manager/diggingCaveEntranceManager.c6
-rw-r--r--src/manager/flameManager.c4
-rw-r--r--src/manager/manager29.c2
-rw-r--r--src/manager/tileChangeObserveManager.c2
-rw-r--r--src/manager/waterfallBottomManager.c2
-rw-r--r--src/movement.c2
-rw-r--r--src/npc/castorWildsStatue.c16
-rw-r--r--src/npc/clothesRack.c12
-rw-r--r--src/npc/dog.c2
-rw-r--r--src/npc/kid.c12
-rw-r--r--src/npc/npc5.c6
-rw-r--r--src/object/angryStatue.c2
-rw-r--r--src/object/bakerOven.c16
-rw-r--r--src/object/beanstalk.c10
-rw-r--r--src/object/bigIceBlock.c50
-rw-r--r--src/object/bigPushableLever.c14
-rw-r--r--src/object/board.c2
-rw-r--r--src/object/bollard.c4
-rw-r--r--src/object/bossDoor.c24
-rw-r--r--src/object/bush.c2
-rw-r--r--src/object/button.c8
-rw-r--r--src/object/cabinFurniture.c40
-rw-r--r--src/object/carlovObject.c6
-rw-r--r--src/object/crenelBeanSprout.c8
-rw-r--r--src/object/doubleBookshelf.c40
-rw-r--r--src/object/figurineDevice.c6
-rw-r--r--src/object/fireplace.c4
-rw-r--r--src/object/frozenWaterElement.c54
-rw-r--r--src/object/furniture.c56
-rw-r--r--src/object/gentariCurtain.c8
-rw-r--r--src/object/giantBookLadder.c24
-rw-r--r--src/object/giantLeaf.c2
-rw-r--r--src/object/giantRock2.c8
-rw-r--r--src/object/giantTwig.c92
-rw-r--r--src/object/jarPortal.c8
-rw-r--r--src/object/ladderUp.c10
-rw-r--r--src/object/lightDoor.c18
-rw-r--r--src/object/lightableSwitch.c2
-rw-r--r--src/object/lilypadLarge.c8
-rw-r--r--src/object/linkEmptyingBottle.c4
-rw-r--r--src/object/lockedDoor.c6
-rw-r--r--src/object/macroAcorn.c56
-rw-r--r--src/object/macroBook.c2
-rw-r--r--src/object/macroDecorations.c2
-rw-r--r--src/object/macroShoe.c6
-rw-r--r--src/object/mask.c4
-rw-r--r--src/object/metalDoor.c12
-rw-r--r--src/object/minecart.c10
-rw-r--r--src/object/minecartDoor.c4
-rw-r--r--src/object/minishVillageObject.c6
-rw-r--r--src/object/object30.c2
-rw-r--r--src/object/object37.c2
-rw-r--r--src/object/objectBlockingStairs.c18
-rw-r--r--src/object/objectOnPillar.c6
-rw-r--r--src/object/objectOnSpinyBeetle.c2
-rw-r--r--src/object/palaceArchway.c2
-rw-r--r--src/object/paper.c6
-rw-r--r--src/object/playerClone.c4
-rw-r--r--src/object/pot.c24
-rw-r--r--src/object/pullableMushroom.c2
-rw-r--r--src/object/pushableFurniture.c26
-rw-r--r--src/object/pushableGrave.c10
-rw-r--r--src/object/pushableLever.c8
-rw-r--r--src/object/pushableRock.c6
-rw-r--r--src/object/pushableStatue.c10
-rw-r--r--src/object/railtrack.c14
-rw-r--r--src/object/smallIceBlock.c8
-rw-r--r--src/object/smokeParticle.c6
-rw-r--r--src/object/treeThorns.c4
-rw-r--r--src/object/unusedSkull.c2
-rw-r--r--src/object/well.c2
-rw-r--r--src/physics.c6
-rw-r--r--src/player.c20
-rw-r--r--src/playerItem/playerItemBomb.c2
-rw-r--r--src/playerItem/playerItemBoomerang.c4
-rw-r--r--src/playerItem/playerItemBottle.c2
-rw-r--r--src/playerItem/playerItemBow.c4
-rw-r--r--src/playerItem/playerItemDashSword.c4
-rw-r--r--src/playerItem/playerItemFireRodProjectile.c2
-rw-r--r--src/playerItem/playerItemGust.c4
-rw-r--r--src/playerItem/playerItemGustBig.c8
-rw-r--r--src/playerItem/playerItemHeldObject.c4
-rw-r--r--src/playerItem/playerItemPacciCaneProjectile.c8
-rw-r--r--src/playerItem/playerItemSword.c8
-rw-r--r--src/playerItem/playerItemSwordBeam.c2
-rw-r--r--src/playerUtils.c98
-rw-r--r--src/projectile/boneProjectile.c2
-rw-r--r--src/projectile/cannonballProjectile.c8
-rw-r--r--src/projectile/dekuSeedProjectile.c6
-rw-r--r--src/projectile/dirtBallProjectile.c2
-rw-r--r--src/projectile/fireProjectile.c2
-rw-r--r--src/projectile/gleerokProjectile.c5
-rw-r--r--src/projectile/iceProjectile.c2
-rw-r--r--src/projectile/mandiblesProjectile.c2
-rw-r--r--src/projectile/removableDust.c2
-rw-r--r--src/projectile/rockProjectile.c4
-rw-r--r--src/projectile/spiderWeb.c2
-rw-r--r--src/projectile/windProjectile.c2
-rw-r--r--src/projectile/winder.c2
-rw-r--r--src/roomInit.c54
-rw-r--r--src/scroll.c14
-rw-r--r--src/text.c34
-rw-r--r--src/worldEvent/worldEvent17.c2
131 files changed, 701 insertions, 696 deletions
diff --git a/src/beanstalkSubtask.c b/src/beanstalkSubtask.c
index 3b26138a..beacfffc 100644
--- a/src/beanstalkSubtask.c
+++ b/src/beanstalkSubtask.c
@@ -217,7 +217,7 @@ u32 UpdatePlayerCollision(void) {
}
}
}
- layer = GetLayerByIndex(gPlayerEntity.base.collisionLayer);
+ layer = GetTileBuffer(gPlayerEntity.base.collisionLayer);
ptr1 = &gUnk_080B4468[gPlayerEntity.base.animationState & 6];
position = COORD_TO_TILE_OFFSET(&gPlayerEntity.base, -ptr1[0], -ptr1[1]);
tileType = GetTileType(position, gPlayerEntity.base.collisionLayer);
@@ -509,13 +509,13 @@ u32 UpdatePlayerCollision(void) {
if (gPlayerState.field_0x35 != 0) {
return 0;
}
- SetTile(0x4054, position, gPlayerEntity.base.collisionLayer);
+ SetBottomTile(0x4054, position, gPlayerEntity.base.collisionLayer);
return 4;
case 0x4053:
if (gPlayerState.field_0x35 != 6) {
return 0;
}
- SetTile(0x4054, position, gPlayerEntity.base.collisionLayer);
+ SetBottomTile(0x4054, position, gPlayerEntity.base.collisionLayer);
return 4;
case 0x4055:
position--;
@@ -529,7 +529,7 @@ u32 UpdatePlayerCollision(void) {
}
for (index = 0; index < 3; index++) {
if (sub_0801A8D0(gPlayerClones[index], 0) == position) {
- SetTile(0x4059, position, gPlayerEntity.base.collisionLayer);
+ SetBottomTile(0x4059, position, gPlayerEntity.base.collisionLayer);
return 4;
}
}
@@ -546,7 +546,7 @@ u32 UpdatePlayerCollision(void) {
}
for (index = 0; index < 3; index++) {
if (sub_0801A8D0(gPlayerClones[index], 6) == position) {
- SetTile(0x4059, position, gPlayerEntity.base.collisionLayer);
+ SetBottomTile(0x4059, position, gPlayerEntity.base.collisionLayer);
return 4;
}
}
@@ -563,7 +563,7 @@ u32 UpdatePlayerCollision(void) {
if ((gPlayerEntity.base.frame & 1) == 0) {
return 0;
}
- SetTile(0x4074, position, gPlayerEntity.base.collisionLayer);
+ SetBottomTile(0x4074, position, gPlayerEntity.base.collisionLayer);
gPlayerState.pushedObject = 0xa0;
gPlayerState.queued_action = PLAYER_PUSH;
gPlayerState.flags |= PL_BUSY;
@@ -582,7 +582,7 @@ u32 UpdatePlayerCollision(void) {
if ((gPlayerEntity.base.frame & 1) == 0) {
return 0;
}
- SetTile(0x4074, position, gPlayerEntity.base.collisionLayer);
+ SetBottomTile(0x4074, position, gPlayerEntity.base.collisionLayer);
sub_080001D0(0xd, position, gPlayerEntity.base.collisionLayer);
return 1;
default:
@@ -638,7 +638,7 @@ bool32 sub_0801A370(LayerStruct* layer, u32 position) {
if (!sub_0801A4F8()) {
return FALSE;
}
- topLayer = GetLayerByIndex(2);
+ topLayer = GetTileBuffer(2);
offset = gUnk_080B4488[gPlayerEntity.base.animationState >> 1];
pos = position + offset;
tileType = GetTileType(pos, gPlayerEntity.base.collisionLayer);
@@ -748,7 +748,7 @@ u32 sub_0801A570(Entity* this, u32 param_2) {
if (this == NULL) {
return 0xffff;
}
- layer = GetLayerByIndex(this->collisionLayer);
+ layer = GetTileBuffer(this->collisionLayer);
metatileTypes = layer->metatileTypes;
index1 = 4;
index2 = 2;
@@ -904,7 +904,7 @@ u32 sub_0801A8D0(Entity* this, u32 param_2) {
if (this == NULL)
return 0xffff;
- mapData = GetLayerByIndex(this->collisionLayer)->mapData;
+ mapData = GetTileBuffer(this->collisionLayer)->mapData;
if (param_2 == 0) {
position = COORD_TO_TILE_OFFSET(this, 0, 8);
tile = mapData[position];
@@ -930,7 +930,7 @@ u32 sub_0801A8D0(Entity* this, u32 param_2) {
bool32 sub_0801A980(void) {
u16 tileType;
const s16* ptr;
- GetLayerByIndex(gPlayerEntity.base.collisionLayer);
+ GetTileBuffer(gPlayerEntity.base.collisionLayer);
ptr = &gUnk_080B44A8[gPlayerEntity.base.animationState & 6];
tileType =
GetTileType(COORD_TO_TILE_OFFSET(&gPlayerEntity.base, -ptr[0], -ptr[1]), gPlayerEntity.base.collisionLayer);
@@ -982,7 +982,7 @@ bool32 sub_0801AA58(Entity* this, u32 param_2, u32 param_3) {
Entity* object;
u32 temp;
- layer = GetLayerByIndex(this->collisionLayer);
+ layer = GetTileBuffer(this->collisionLayer);
if (((layer->collisionData[param_2 + gUnk_080B4488[param_3 >> 3]] == 0) ||
((u8)(layer->collisionData[param_2 + gUnk_080B4488[param_3 >> 3]] - 0x20) < 0x20))) {
@@ -1007,7 +1007,7 @@ bool32 sub_0801AA58(Entity* this, u32 param_2, u32 param_3) {
void sub_0801AB08(u16* specialData, LayerStruct* layer) {
u16* metatiles;
u16* mapData;
- u16* mapDataClone;
+ u16* mapDataOriginal;
u16 index;
u16 innerIndex;
u32 tmp2;
@@ -1020,7 +1020,7 @@ void sub_0801AB08(u16* specialData, LayerStruct* layer) {
tmp3 = 2;
}
tmp2 = tmp3 << 0xc;
- mapDataClone = layer->mapDataClone;
+ mapDataOriginal = layer->mapDataOriginal;
mapData = layer->mapData;
for (index = 0; index < 0x40; index++) {
@@ -1028,7 +1028,7 @@ void sub_0801AB08(u16* specialData, LayerStruct* layer) {
if (mapData[0] < 0x4000) {
tmp1 = mapData[0] << 2;
} else {
- tmp1 = sub_0801AC68(tmp2, mapDataClone[0]);
+ tmp1 = sub_0801AC68(tmp2, mapDataOriginal[0]);
}
metatiles = layer->metatiles + tmp1;
specialData[0] = metatiles[0];
@@ -1039,7 +1039,7 @@ void sub_0801AB08(u16* specialData, LayerStruct* layer) {
if (mapData[1] < 0x4000) {
tmp1 = mapData[1] << 2;
} else {
- tmp1 = sub_0801AC68(tmp2 + 1, mapDataClone[1]);
+ tmp1 = sub_0801AC68(tmp2 + 1, mapDataOriginal[1]);
}
metatiles = layer->metatiles + tmp1;
specialData[0] = metatiles[0];
@@ -1050,7 +1050,7 @@ void sub_0801AB08(u16* specialData, LayerStruct* layer) {
if (mapData[2] < 0x4000) {
tmp1 = mapData[2] << 2;
} else {
- tmp1 = sub_0801AC68(tmp2 + 2, mapDataClone[2]);
+ tmp1 = sub_0801AC68(tmp2 + 2, mapDataOriginal[2]);
}
metatiles = layer->metatiles + tmp1;
specialData[0] = metatiles[0];
@@ -1061,7 +1061,7 @@ void sub_0801AB08(u16* specialData, LayerStruct* layer) {
if (mapData[3] < 0x4000) {
tmp1 = mapData[3] << 2;
} else {
- tmp1 = sub_0801AC68(tmp2 + 3, mapDataClone[3]);
+ tmp1 = sub_0801AC68(tmp2 + 3, mapDataOriginal[3]);
}
metatiles = layer->metatiles + tmp1;
specialData[0] = metatiles[0];
@@ -1071,7 +1071,7 @@ void sub_0801AB08(u16* specialData, LayerStruct* layer) {
specialData += 2;
mapData += 4;
- mapDataClone += 4;
+ mapDataOriginal += 4;
tmp2 = (u16)(tmp2 + 4);
}
specialData = specialData + 0x80;
@@ -1215,13 +1215,13 @@ void sub_0801AE44(bool32 loadGfx) {
void SetMultipleTiles(const TileData* tileData, u32 basePosition, u32 layer) {
while (tileData->tile != -1) {
- SetTile((u16)tileData->tile, basePosition + tileData->position, layer);
+ SetBottomTile((u16)tileData->tile, basePosition + tileData->position, layer);
tileData++;
}
}
// Add a new entry at the end of gUnk_0200B240
-void sub_0801AF48(u32 data, u32 position, u32 layer) {
+void RegisterInteractTile(u32 data, u32 position, u32 layer) {
u32 index;
if ((data < 0x4000) && (gRoomTransition.field30 == 0)) {
index = gRoomVars.tileEntityCount;
@@ -1233,7 +1233,7 @@ void sub_0801AF48(u32 data, u32 position, u32 layer) {
}
}
-void DeleteLoadedTileEntity(u32 position, s32 layer) {
+void UnregisterInteractTile(u32 position, s32 layer) {
u32 count;
struct_0200B240* ptr;
u32 positionLayer;
@@ -1289,7 +1289,7 @@ void sub_0801AFE4(void) {
for (x = 0; x < width; x++) {
for (ptr = gUnk_080B44D0; ptr->collision != 0; ptr++) {
if (ptr->collision == *collisionData) {
- SetTile(ptr->tileIndex, y * 0x40 + x, 1);
+ SetBottomTile(ptr->tileIndex, y * 0x40 + x, 1);
break;
}
}
diff --git a/src/code_08049DF4.c b/src/code_08049DF4.c
index ebfd458c..89cf6216 100644
--- a/src/code_08049DF4.c
+++ b/src/code_08049DF4.c
@@ -167,7 +167,7 @@ u32 sub_0804A044(Entity* entA, Entity* entB, u32 arg2) {
//! @bug flags & 5 can never equal 0xA
if (flags && ((flags & 5) != 0xA)) {
- layer = GetLayerByIndex(entA->collisionLayer);
+ layer = GetTileBuffer(entA->collisionLayer);
if (xDiff < 0) {
xDiff = -xDiff;
}
diff --git a/src/enemy/armos.c b/src/enemy/armos.c
index bd164871..db597408 100644
--- a/src/enemy/armos.c
+++ b/src/enemy/armos.c
@@ -403,11 +403,11 @@ void sub_080307D4(ArmosEntity* this) {
void sub_080307EC(ArmosEntity* this) {
u32 position = COORD_TO_TILE(super);
this->unk_78 = GetTileIndex(position, super->collisionLayer);
- SetTile(0x4022, position, (u32)super->collisionLayer);
+ SetBottomTile(0x4022, position, (u32)super->collisionLayer);
}
void sub_08030834(ArmosEntity* this) {
- SetTile(this->unk_78, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(this->unk_78, COORD_TO_TILE(super), super->collisionLayer);
}
bool32 sub_0803086C(ArmosEntity* this) {
@@ -435,11 +435,11 @@ bool32 sub_0803086C(ArmosEntity* this) {
return TRUE;
}
} else {
- SetTile(0x4022, pos, super->collisionLayer);
+ SetBottomTile(0x4022, pos, super->collisionLayer);
}
} else {
if (CheckPlayerInRegion(centerX, centerY + 6, 2, 5) != 0) {
- SetTile(0x4049, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(0x4049, COORD_TO_TILE(super), super->collisionLayer);
}
}
}
diff --git a/src/enemy/businessScrub.c b/src/enemy/businessScrub.c
index a770f1d9..5a2f0d9b 100644
--- a/src/enemy/businessScrub.c
+++ b/src/enemy/businessScrub.c
@@ -442,7 +442,7 @@ void sub_08028FFC(BusinessScrubEntity* this) {
super->x.HALF.HI = this->unk_78;
super->y.HALF.HI = this->unk_7a;
InitializeAnimation(super, 0);
- SetTile(0x4022, this->unk_76, super->collisionLayer);
+ SetBottomTile(0x4022, this->unk_76, super->collisionLayer);
}
void sub_08029078(BusinessScrubEntity* this) {
@@ -456,7 +456,7 @@ void sub_08029078(BusinessScrubEntity* this) {
super->spriteIndex = 0xd0;
sub_08028FDC(this);
sub_080290E0(this, 1);
- SetTile(this->unk_74, this->unk_76, super->collisionLayer);
+ SetBottomTile(this->unk_74, this->unk_76, super->collisionLayer);
}
}
diff --git a/src/enemy/chuchu.c b/src/enemy/chuchu.c
index 41ac71c4..95a08744 100644
--- a/src/enemy/chuchu.c
+++ b/src/enemy/chuchu.c
@@ -34,7 +34,7 @@ void sub_0801FAF8(ChuchuEntity* this);
void sub_0801FB14(ChuchuEntity* this);
void sub_0801FB34(ChuchuEntity* this);
void sub_0801FB68(ChuchuEntity* this);
-u32 sub_0801FBD0(ChuchuEntity* this);
+u32 CheckWaterTile(ChuchuEntity* this);
void Chuchu_JumpAtPlayer(ChuchuEntity* this);
extern void (*const Chuchu_Functions[])(ChuchuEntity*);
@@ -72,7 +72,7 @@ void Chuchu(ChuchuEntity* this) {
/* ... */
break;
case 2:
- sub_080043A8(super);
+ CreateDrownFX(super);
return;
}
}
@@ -196,7 +196,7 @@ void sub_0801F0C8(ChuchuEntity* this) {
}
void sub_0801F12C(ChuchuEntity* this) {
- if (sub_0801FBD0(this)) {
+ if (CheckWaterTile(this)) {
sub_0801F328(this);
} else {
if ((super->subtimer++ & 7) == 0) {
@@ -232,7 +232,7 @@ void sub_0801F1B0(ChuchuEntity* this) {
}
if (super->frame & ANIM_DONE) {
- if (sub_0801FBD0(this)) {
+ if (CheckWaterTile(this)) {
sub_0801F328(this);
} else {
sub_0801F340(this);
@@ -261,7 +261,7 @@ void sub_0801F270(ChuchuEntity* this) {
ProcessMovement5(super);
GetNextFrame(super);
- if (sub_0801FBD0(this))
+ if (CheckWaterTile(this))
return;
if (--super->timer != 0)
@@ -390,7 +390,7 @@ void sub_0801F4EC(ChuchuEntity* this) {
}
void sub_0801F508(ChuchuEntity* this) {
- if (sub_0801FBD0(this)) {
+ if (CheckWaterTile(this)) {
this->unk_83 = 0;
sub_0801F730(this);
} else {
@@ -429,7 +429,7 @@ void sub_0801F584(ChuchuEntity* this) {
}
if (super->frame & ANIM_DONE) {
- if (sub_0801FBD0(this)) {
+ if (CheckWaterTile(this)) {
this->unk_83 = 0;
sub_0801F730(this);
} else {
@@ -464,7 +464,7 @@ void sub_0801F688(ChuchuEntity* this) {
if (this->unk_83)
this->unk_83--;
- if (sub_0801FBD0(this) || this->unk_83) {
+ if (CheckWaterTile(this) || this->unk_83) {
super->direction = sub_08049F84(super, 1);
ProcessMovement5(super);
GetNextFrame(super);
@@ -572,7 +572,7 @@ void sub_0801F884(ChuchuEntity* this) {
}
void sub_0801F8C0(ChuchuEntity* this) {
- if (sub_0801FBD0(this)) {
+ if (CheckWaterTile(this)) {
sub_0801FAE0(this);
} else if (sub_08049FDC(super, 1) == 0) {
sub_0801F730(this);
@@ -605,7 +605,7 @@ void sub_0801F940(ChuchuEntity* this) {
}
if (super->frame & ANIM_DONE) {
- if (sub_0801FBD0(this)) {
+ if (CheckWaterTile(this)) {
sub_0801FAE0(this);
} else {
super->action = 6;
@@ -635,7 +635,7 @@ void sub_0801F9E0(ChuchuEntity* this) {
}
void sub_0801FA30(ChuchuEntity* this) {
- if (sub_0801FBD0(this)) {
+ if (CheckWaterTile(this)) {
super->direction = sub_08049F84(super, 1);
ProcessMovement5(super);
GetNextFrame(super);
@@ -714,7 +714,7 @@ void sub_0801FB68(ChuchuEntity* this) {
super->zVelocity = 0;
}
-u32 sub_0801FBD0(ChuchuEntity* this) {
+u32 CheckWaterTile(ChuchuEntity* this) {
if (GetActTile(super) == 0x10) {
return 1;
} else {
diff --git a/src/enemy/chuchuBoss.c b/src/enemy/chuchuBoss.c
index 0f054bdd..c9ee902c 100644
--- a/src/enemy/chuchuBoss.c
+++ b/src/enemy/chuchuBoss.c
@@ -561,7 +561,7 @@ void sub_080262A8(ChuchuBossEntity* this) {
gPlayerEntity.base.animationState = 0;
gRoomControls.camera_target = super;
gRoomControls.scrollSpeed = 1;
- SetTile(0x4022, 0x2c8, 1);
+ SetBottomTile(0x4022, 0x2c8, 1);
}
}
diff --git a/src/enemy/doorMimic.c b/src/enemy/doorMimic.c
index 344e284b..b7c57037 100644
--- a/src/enemy/doorMimic.c
+++ b/src/enemy/doorMimic.c
@@ -48,7 +48,7 @@ void DoorMimic_OnCollision(DoorMimicEntity* this) {
}
void DoorMimic_OnDeath(DoorMimicEntity* this) {
- SetTile(this->unk_7c, this->unk_7e, super->collisionLayer);
+ SetBottomTile(this->unk_7c, this->unk_7e, super->collisionLayer);
CreateFx(super, FX_POT_SHATTER, 0);
EnemyDisableRespawn(super);
DeleteThisEntity();
@@ -125,7 +125,7 @@ void sub_080221C0(DoorMimicEntity* this) {
u32 tile = COORD_TO_TILE(super) + gUnk_080B4488[super->type2];
this->unk_7e = tile;
this->unk_7c = GetTileIndex(tile, super->collisionLayer);
- SetTile(gUnk_080CB79C[super->type2], tile, super->collisionLayer);
+ SetBottomTile(gUnk_080CB79C[super->type2], tile, super->collisionLayer);
}
// clang-format off
diff --git a/src/enemy/enemy64.c b/src/enemy/enemy64.c
index 62bd707b..be47abc9 100644
--- a/src/enemy/enemy64.c
+++ b/src/enemy/enemy64.c
@@ -85,10 +85,10 @@ void Enemy64_Init(Enemy64Entity* this) {
Entity* tail;
if (CheckFlags(0x7c)) {
- SetTile(0x4081, 10, 2);
- SetTile(0x4081, 0x4a, 2);
- SetTile(0x4081, 0x8a, 2);
- SetTile(0x4081, 0xca, 2);
+ SetBottomTile(0x4081, 10, 2);
+ SetBottomTile(0x4081, 0x4a, 2);
+ SetBottomTile(0x4081, 0x8a, 2);
+ SetBottomTile(0x4081, 0xca, 2);
DeleteThisEntity();
} else {
sub_0807B7D8(0x323, 10, 1);
@@ -440,19 +440,19 @@ void Enemy64_Action4_SubAction7(Enemy64Entity* this) {
DeleteThisEntity();
} else if (super->timer == 16) {
sub_0807B7D8(0x36, 0xca, 1);
- SetTile(0x4081, 0xca, 2);
+ SetBottomTile(0x4081, 0xca, 2);
SoundReq(SFX_HEART_GET);
} else if (super->timer == 24) {
sub_0807B7D8(0x36, 0x8a, 1);
- SetTile(0x4081, 0x8a, 2);
+ SetBottomTile(0x4081, 0x8a, 2);
SoundReq(SFX_HEART_GET);
} else if (super->timer == 32) {
sub_0807B7D8(0x36, 0x4a, 1);
- SetTile(0x4081, 0x4a, 2);
+ SetBottomTile(0x4081, 0x4a, 2);
SoundReq(SFX_HEART_GET);
} else if (super->timer == 40) {
sub_0807B7D8(0x36, 10, 1);
- SetTile(0x4081, 10, 2);
+ SetBottomTile(0x4081, 10, 2);
SoundReq(SFX_HEART_GET);
}
}
diff --git a/src/enemy/eyegore.c b/src/enemy/eyegore.c
index b023469c..3b4ee58c 100644
--- a/src/enemy/eyegore.c
+++ b/src/enemy/eyegore.c
@@ -335,18 +335,18 @@ void sub_08030F00(EyegoreEntity* this) {
this->unk_84 = tileIndex;
tileIndex = GetTileIndex(position + 0x41, super->collisionLayer);
this->unk_86 = tileIndex;
- SetTile(0x4022, position, super->collisionLayer);
- SetTile(0x4022, position + 1, super->collisionLayer);
- SetTile(0x4022, position + 0x40, super->collisionLayer);
- SetTile(0x4022, position + 0x41, super->collisionLayer);
+ SetBottomTile(0x4022, position, super->collisionLayer);
+ SetBottomTile(0x4022, position + 1, super->collisionLayer);
+ SetBottomTile(0x4022, position + 0x40, super->collisionLayer);
+ SetBottomTile(0x4022, position + 0x41, super->collisionLayer);
}
void sub_08030FB4(EyegoreEntity* this) {
u32 position = COORD_TO_TILE_OFFSET(super, 8, 0x14);
- SetTile(this->unk_80, position, super->collisionLayer);
- SetTile(this->unk_82, position + 1, super->collisionLayer);
- SetTile(this->unk_84, position + 0x40, super->collisionLayer);
- SetTile(this->unk_86, position + 0x41, super->collisionLayer);
+ SetBottomTile(this->unk_80, position, super->collisionLayer);
+ SetBottomTile(this->unk_82, position + 1, super->collisionLayer);
+ SetBottomTile(this->unk_84, position + 0x40, super->collisionLayer);
+ SetBottomTile(this->unk_86, position + 0x41, super->collisionLayer);
}
void sub_08031024(EyegoreEntity* this) {
@@ -439,8 +439,8 @@ void sub_08031024(EyegoreEntity* this) {
void sub_08031250(EyegoreEntity* this) {
u32 tmp2;
u32 tmp = (u32)super->animationState * 4;
- sub_08008796(super, 9, super->x.HALF.HI + gUnk_080CE2C0[tmp], super->y.HALF.HI + gUnk_080CE2C0[tmp + 1]);
- sub_08008796(super, 9, super->x.HALF.HI + gUnk_080CE2C0[tmp + 2], super->y.HALF.HI + gUnk_080CE2C0[tmp + 3]);
+ DoTileInteraction(super, 9, super->x.HALF.HI + gUnk_080CE2C0[tmp], super->y.HALF.HI + gUnk_080CE2C0[tmp + 1]);
+ DoTileInteraction(super, 9, super->x.HALF.HI + gUnk_080CE2C0[tmp + 2], super->y.HALF.HI + gUnk_080CE2C0[tmp + 3]);
if (this->unk_79 != 0) {
tmp2 = 0;
if ((super->x.HALF.HI - (u32)this->unk_74) + 2 < 5) {
diff --git a/src/enemy/flyingPot.c b/src/enemy/flyingPot.c
index 74f0a3b5..cc868bc0 100644
--- a/src/enemy/flyingPot.c
+++ b/src/enemy/flyingPot.c
@@ -99,7 +99,7 @@ void FlyingPot_OnCollision(FlyingPotEntity* this) {
super->zVelocity = Q_16_16(2.625);
super->spritePriority.b1 = 1;
- SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
+ SetBottomTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
} else if (super->z.HALF.HI != 0) {
sub_08037408(this);
}
@@ -145,7 +145,7 @@ void FlyingPot_SubAction2(FlyingPotEntity* this) {
COLLISION_OFF(super);
super->spriteOffsetX = 0;
- SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
+ SetBottomTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
}
if (sub_0806F520(super)) {
@@ -177,7 +177,7 @@ void FlyingPot_Init(FlyingPotEntity* this) {
tile = TILE(super->x.HALF.HI, super->y.HALF.HI);
this->tileIndex = GetTileIndex(tile, super->collisionLayer);
- SetTile(0x4000, tile, super->collisionLayer);
+ SetBottomTile(0x4000, tile, super->collisionLayer);
InitializeAnimation(super, 5);
}
@@ -185,7 +185,7 @@ void FlyingPot_Action1(FlyingPotEntity* this) {
sub_08037418(this);
if (GetTileTypeByEntity(super) != 0x4000) {
- SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
+ SetBottomTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
sub_08037408(this);
}
@@ -210,7 +210,7 @@ void FlyingPot_Action2(FlyingPotEntity* this) {
super->flags2 = 0xF;
super->hitbox = &gUnk_080FD34C;
- SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
+ SetBottomTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
}
}
@@ -257,7 +257,7 @@ void sub_08037418(FlyingPotEntity* this) {
u32 tile = COORD_TO_TILE(super);
if (GetTileIndex(tile, super->collisionLayer) == 0x4067) {
- SetTile(this->tileIndex, tile, super->collisionLayer);
+ SetBottomTile(this->tileIndex, tile, super->collisionLayer);
DeleteThisEntity();
}
}
diff --git a/src/enemy/flyingSkull.c b/src/enemy/flyingSkull.c
index 7318f358..23ba5c87 100644
--- a/src/enemy/flyingSkull.c
+++ b/src/enemy/flyingSkull.c
@@ -50,7 +50,7 @@ void FlyingSkull_OnCollision(FlyingSkullEntity* this) {
COLLISION_OFF(super);
super->zVelocity = Q_16_16(2.625);
super->spritePriority.b1 = 1;
- SetTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
} else if (super->z.HALF.HI) {
sub_0803A0E0(this);
}
@@ -89,7 +89,7 @@ void sub_08039CE0(FlyingSkullEntity* this) {
super->timer = 1;
super->z.HALF.HI = -1;
super->spriteOffsetX = 0;
- SetTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
}
if (sub_0806F520(super)) {
@@ -121,7 +121,7 @@ void sub_08039D74(FlyingSkullEntity* this) {
tmp = COORD_TO_TILE(super);
this->unk_0x74 = GetTileIndex(tmp, super->collisionLayer);
- SetTile(0x4060, tmp, super->collisionLayer);
+ SetBottomTile(0x4060, tmp, super->collisionLayer);
InitializeAnimation(super, 0);
}
@@ -130,7 +130,7 @@ void sub_08039DD8(FlyingSkullEntity* this) {
if (super->type == 0) {
if (GetTileTypeByEntity(super) == 0x4073) {
- SetTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
sub_0803A0E0(this);
}
@@ -147,7 +147,7 @@ void sub_08039DD8(FlyingSkullEntity* this) {
if (player != NULL) {
player->type2 = 1;
CopyPosition(super, player);
- SetTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
DeleteEntity(super);
}
}
@@ -167,7 +167,7 @@ void sub_08039EE4(FlyingSkullEntity* this) {
super->hitbox = (Hitbox*)&gUnk_080FD340;
gPlayerEntity.base.animationState;
this->unk_0x76 = gPlayerEntity.base.animationState;
- SetTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
}
void sub_08039F4C(FlyingSkullEntity* this) {
@@ -200,7 +200,7 @@ void sub_08039FAC(FlyingSkullEntity* this) {
super->hitType = 0xa0;
super->flags2 = 0xf;
super->hitbox = (Hitbox*)&gUnk_080FD34C;
- SetTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
}
}
@@ -249,7 +249,7 @@ void sub_0803A0E0(FlyingSkullEntity* this) {
void sub_0803A100(FlyingSkullEntity* this) {
u32 tile = COORD_TO_TILE(super);
if (GetTileIndex(tile, super->collisionLayer) == 0x4067) {
- SetTile(this->unk_0x74, tile, super->collisionLayer);
+ SetBottomTile(this->unk_0x74, tile, super->collisionLayer);
DeleteThisEntity();
}
}
diff --git a/src/enemy/gyorgFemale.c b/src/enemy/gyorgFemale.c
index fbc0a222..baa1105b 100644
--- a/src/enemy/gyorgFemale.c
+++ b/src/enemy/gyorgFemale.c
@@ -250,7 +250,7 @@ void sub_080464C0(GyorgFemaleEntity* this) {
void sub_08046518(void) {
u16* ptr = gMapTop.metatileTypes;
u16* sl = &gMapTop.mapData[sub_08046518_offset];
- u16* stack1 = &gMapTop.mapDataClone[sub_08046518_offset];
+ u16* stack1 = &gMapTop.mapDataOriginal[sub_08046518_offset];
u8* stack2 = &gMapTop.unkData3[sub_08046518_offset];
u8* r6 = &gMapTop.collisionData[sub_08046518_offset];
u32 i;
diff --git a/src/enemy/helmasaur.c b/src/enemy/helmasaur.c
index 4a43753e..ab1437cc 100644
--- a/src/enemy/helmasaur.c
+++ b/src/enemy/helmasaur.c
@@ -373,8 +373,8 @@ void sub_0802C1C0(HelmasaurEntity* this) {
void sub_0802C1CC(HelmasaurEntity* this) {
const s8* ptr = &gUnk_080CD464[super->animationState << 2];
- sub_08008796(super, 9, super->x.HALF.HI + ptr[0], super->y.HALF.HI + ptr[1]);
- sub_08008796(super, 9, super->x.HALF.HI + ptr[2], super->y.HALF.HI + ptr[3]);
+ DoTileInteraction(super, 9, super->x.HALF.HI + ptr[0], super->y.HALF.HI + ptr[1]);
+ DoTileInteraction(super, 9, super->x.HALF.HI + ptr[2], super->y.HALF.HI + ptr[3]);
}
void sub_0802C218(HelmasaurEntity* this) {
diff --git a/src/enemy/mazaalBracelet.c b/src/enemy/mazaalBracelet.c
index 65e917a2..15e84846 100644
--- a/src/enemy/mazaalBracelet.c
+++ b/src/enemy/mazaalBracelet.c
@@ -167,7 +167,8 @@ void MazaalBracelet_OnCollision(MazaalBraceletEntity* this) {
if (super->type < 2) {
if (super->action != 0x2b) {
- if ((0 < super->iframes) && ((super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x15) || (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0xe))))) {
+ if ((0 < super->iframes) && ((super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x15) ||
+ (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0xe))))) {
super->action = 0x28;
COLLISION_OFF(super);
entity = (MazaalBraceletEntity*)super->parent;
diff --git a/src/enemy/mazaalMacro.c b/src/enemy/mazaalMacro.c
index a404cbdc..ef417421 100644
--- a/src/enemy/mazaalMacro.c
+++ b/src/enemy/mazaalMacro.c
@@ -96,7 +96,7 @@ void sub_08034CC4(MazaalMacroEntity* this) {
this->unk_78 = 0x4b0;
sub_08034F70(this);
InitializeAnimation(super, super->type);
- SetTile(0x4022, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(0x4022, COORD_TO_TILE(super), super->collisionLayer);
entity = CreateEnemy(MAZAAL_MACRO, 2);
if (entity != NULL) {
super->child = entity;
diff --git a/src/enemy/octorokGolden.c b/src/enemy/octorokGolden.c
index 82bb3c8f..0d6e6ddf 100644
--- a/src/enemy/octorokGolden.c
+++ b/src/enemy/octorokGolden.c
@@ -117,7 +117,7 @@ void sub_08037E14(Entity* this) {
s32 x, y;
this->timer = 8;
dir = (GetFacingDirection(this, &gPlayerEntity.base) + 4) & 0x18;
- layer = (u8*)GetLayerByIndex(this->collisionLayer)->collisionData;
+ layer = (u8*)GetTileBuffer(this->collisionLayer)->collisionData;
ptr = gUnk_080CF498 + (dir >> 2);
x = this->x.HALF.HI + *ptr;
y = this->y.HALF.HI + *(ptr + 1);
diff --git a/src/enemy/pesto.c b/src/enemy/pesto.c
index f0bdb5a2..e386d4b6 100644
--- a/src/enemy/pesto.c
+++ b/src/enemy/pesto.c
@@ -446,7 +446,8 @@ void sub_080244E8(PestoEntity* this) {
super->timer = 12;
this->unk_83 &= ~0x80;
entity = super->child;
- SetTile(((PestoEntity*)entity)->unk_70, COORD_TO_TILE(entity), entity->collisionLayer);
+ SetBottomTile(((PestoEntity*)entity)->unk_70, COORD_TO_TILE(entity),
+ entity->collisionLayer);
DeleteEntity(entity);
super->z.HALF.HI -= 0xe;
this->unk_78 -= 0xe;
diff --git a/src/enemy/rollobite.c b/src/enemy/rollobite.c
index 6031dd12..db6233e1 100644
--- a/src/enemy/rollobite.c
+++ b/src/enemy/rollobite.c
@@ -276,7 +276,7 @@ bool32 Rollobite_TryToHoleUp(RollobiteEntity* this) {
super->y.HALF.HI += 13;
super->zVelocity = Q_16_16(2.0);
InitializeAnimation(super, super->animationState + 0x14);
- SetTile(0x4034, tile, super->collisionLayer);
+ SetBottomTile(0x4034, tile, super->collisionLayer);
return TRUE;
}
}
diff --git a/src/enemy/rupeeLike.c b/src/enemy/rupeeLike.c
index 4831bf3b..7ebff811 100644
--- a/src/enemy/rupeeLike.c
+++ b/src/enemy/rupeeLike.c
@@ -40,7 +40,7 @@ void RupeeLike(RupeeLikeEntity* this) {
u32 uVar1;
if (super->type2 == 0) {
- uVar1 = (u8)sub_080043E8(super);
+ uVar1 = (u8)GetTileHazardType(super);
if (uVar1 != 0) {
if (super->action == 4) {
sub_080296D8(this);
diff --git a/src/enemy/spinyBeetle.c b/src/enemy/spinyBeetle.c
index d729bc52..297b3b51 100644
--- a/src/enemy/spinyBeetle.c
+++ b/src/enemy/spinyBeetle.c
@@ -94,7 +94,7 @@ void SpinyBeetle_Init(SpinyBeetleEntity* this) {
this->unk_7b = 0;
this->tile = COORD_TO_TILE(super);
this->tileIndex = GetTileIndex(this->tile, super->collisionLayer);
- SetTile(0x4022, this->tile, super->collisionLayer);
+ SetBottomTile(0x4022, this->tile, super->collisionLayer);
obj = CreateObject(OBJECT_ON_BEETLE, super->type, 0);
if (obj == NULL) {
@@ -259,7 +259,7 @@ void sub_08033B44(SpinyBeetleEntity* this) {
}
}
- SetTile(0x4022, this->tile, super->collisionLayer);
+ SetBottomTile(0x4022, this->tile, super->collisionLayer);
InitializeAnimation(super, 0);
}
diff --git a/src/enemy/stalfos.c b/src/enemy/stalfos.c
index 6c86aa18..b4a26dfb 100644
--- a/src/enemy/stalfos.c
+++ b/src/enemy/stalfos.c
@@ -437,7 +437,7 @@ void sub_08039AD4(StalfosEntity* this) {
super->action = 0xb;
super->child = projectile;
InitAnimationForceUpdate(super, super->animationState + 0x18);
- SetTile(0x4067, position, super->collisionLayer);
+ SetBottomTile(0x4067, position, super->collisionLayer);
return;
}
}
diff --git a/src/enemy/vaatiProjectile.c b/src/enemy/vaatiProjectile.c
index a7efe411..3df5abe6 100644
--- a/src/enemy/vaatiProjectile.c
+++ b/src/enemy/vaatiProjectile.c
@@ -285,6 +285,6 @@ void sub_0803E4D8(VaatiProjectileEntity* this) {
tile = TILE(super->x.HALF.HI, super->y.HALF.HI + 8);
if (sub_080B1B44(tile, gPlayerEntity.base.collisionLayer) != 0xff) {
- SetTile(0x4074, tile, gPlayerEntity.base.collisionLayer);
+ SetBottomTile(0x4074, tile, gPlayerEntity.base.collisionLayer);
}
}
diff --git a/src/enemy/wizzrobeFire.c b/src/enemy/wizzrobeFire.c
index 0253a142..b4c6656c 100644
--- a/src/enemy/wizzrobeFire.c
+++ b/src/enemy/wizzrobeFire.c
@@ -26,7 +26,7 @@ void WizzrobeFire_OnCollision(WizzrobeEntity* this) {
}
EnemyFunctionHandlerAfterCollision(super, WizzrobeFire_Functions);
if (super->health == 0) {
- SetTile(this->tileIndex, this->tilePosition, super->collisionLayer);
+ SetBottomTile(this->tileIndex, this->tilePosition, super->collisionLayer);
}
}
@@ -111,7 +111,7 @@ void WizzrobeFire_Action2(WizzrobeEntity* this) {
super->timer = 40;
super->subtimer = 0;
super->flags &= ~0x80;
- SetTile(this->tileIndex, this->tilePosition, super->collisionLayer);
+ SetBottomTile(this->tileIndex, this->tilePosition, super->collisionLayer);
EnqueueSFX(SFX_156);
InitializeAnimation(super, super->direction >> 3);
}
diff --git a/src/enemy/wizzrobeIce.c b/src/enemy/wizzrobeIce.c
index def00092..ae2dbcfe 100644
--- a/src/enemy/wizzrobeIce.c
+++ b/src/enemy/wizzrobeIce.c
@@ -35,7 +35,7 @@ void WizzrobeIce_OnCollision(WizzrobeEntity* this) {
}
}
if (super->health == 0) {
- SetTile(this->tileIndex, this->tilePosition, super->collisionLayer);
+ SetBottomTile(this->tileIndex, this->tilePosition, super->collisionLayer);
}
}
@@ -118,7 +118,7 @@ void WizzrobeIce_Action2(WizzrobeEntity* this) {
super->timer = 40;
super->subtimer = 0;
super->flags &= ~0x80;
- SetTile(this->tileIndex, this->tilePosition, super->collisionLayer);
+ SetBottomTile(this->tileIndex, this->tilePosition, super->collisionLayer);
EnqueueSFX(SFX_156);
InitializeAnimation(super, super->direction >> 3);
}
diff --git a/src/enemy/wizzrobeWind.c b/src/enemy/wizzrobeWind.c
index b4aeca23..18ee7116 100644
--- a/src/enemy/wizzrobeWind.c
+++ b/src/enemy/wizzrobeWind.c
@@ -42,7 +42,7 @@ void WizzrobeWind_OnCollision(WizzrobeEntity* this) {
}
}
if (super->health == 0) {
- SetTile(this->tileIndex, this->tilePosition, super->collisionLayer);
+ SetBottomTile(this->tileIndex, this->tilePosition, super->collisionLayer);
}
}
@@ -135,7 +135,7 @@ void WizzrobeWind_Action2(WizzrobeEntity* this) {
super->subtimer = 0;
super->flags &= ~0x80;
EnqueueSFX(SFX_156);
- SetTile(this->tileIndex, this->tilePosition, super->collisionLayer);
+ SetBottomTile(this->tileIndex, this->tilePosition, super->collisionLayer);
InitializeAnimation(super, super->direction >> 3);
}
break;
@@ -208,7 +208,7 @@ void sub_0802F888(WizzrobeEntity* this) {
super->direction = (sub_08049F84(super, 3) + 4) & 0x18;
this->tilePosition = COORD_TO_TILE(super);
this->tileIndex = GetTileIndex(this->tilePosition, super->collisionLayer);
- SetTile(0x4071, this->tilePosition, super->collisionLayer);
+ SetBottomTile(0x4071, this->tilePosition, super->collisionLayer);
}
void sub_0802F8E4(WizzrobeEntity* this) {
diff --git a/src/interrupts.c b/src/interrupts.c
index 5ea8bc64..f52a8da3 100644
--- a/src/interrupts.c
+++ b/src/interrupts.c
@@ -219,8 +219,8 @@ void PlayerUpdate(PlayerEntity* this) {
}
HandlePlayerLife(super);
DoPlayerAction(this);
- if ((super->z.WORD == 0) && (super->action == 1 || super->action == 9))
- sub_08008790(super, 8);
+ if ((super->z.WORD == 0) && (super->action == PLAYER_NORMAL || super->action == PLAYER_MINISH))
+ DoTileInteractionHere(super, 8);
sub_080171F0();
}
sub_08078FB0(super);
diff --git a/src/item/itemMoleMitts.c b/src/item/itemMoleMitts.c
index 7dfc8d27..6940a95b 100644
--- a/src/item/itemMoleMitts.c
+++ b/src/item/itemMoleMitts.c
@@ -6,7 +6,7 @@
#include "object.h"
s32 sub_080774A0(void);
-extern s32 sub_0800875A(Entity*, u32, ItemBehavior*);
+extern s32 DoItemTileInteraction(Entity*, u32, ItemBehavior*);
extern void UpdatePlayerMovement(void);
extern bool32 sub_0807B5B0(Entity*);
void sub_08077130(ItemBehavior*, u32);
@@ -70,7 +70,7 @@ void sub_080771C8(ItemBehavior* this, u32 index) {
CreateObjectWithParent(&gPlayerEntity.base, MOLE_MITTS_PARTICLE, this->playerFrame, 1);
}
if ((this->playerFrame & 0x10) != 0) {
- if (sub_0800875A(&gPlayerEntity.base, 0xd, this) == 0) {
+ if (DoItemTileInteraction(&gPlayerEntity.base, 0xd, this) == 0) {
SetItemAnim(this, ANIM_MOLEMITTS_MISS);
this->stateID = 3;
SoundReq(SFX_ITEM_GLOVES_AIR);
diff --git a/src/item/itemTryPickupObject.c b/src/item/itemTryPickupObject.c
index e721bb51..c908f04f 100644
--- a/src/item/itemTryPickupObject.c
+++ b/src/item/itemTryPickupObject.c
@@ -14,7 +14,7 @@ void sub_08076518(ItemBehavior*, u32);
void sub_080765E0(ItemBehavior*, u32);
void sub_0807660C(ItemBehavior*, u32);
-extern s32 sub_0800875A(Entity*, u32, ItemBehavior*);
+extern s32 DoItemTileInteraction(Entity*, u32, ItemBehavior*);
extern const u16 gUnk_0811BE38[];
extern const u16 gUnk_0811BE40[];
@@ -168,7 +168,7 @@ void sub_080762D8(ItemBehavior* this, u32 index) {
if (!gPlayerState.jump_status) {
- if (gPlayerState.heldObject == 1 && sub_0800875A(&gPlayerEntity.base, 6, this) != 0) {
+ if (gPlayerState.heldObject == 1 && DoItemTileInteraction(&gPlayerEntity.base, 6, this) != 0) {
sub_08076088(this, NULL, index);
return;
} else if (gUnk_0811BE38[gPlayerEntity.base.animationState >> 1] & gPlayerState.playerInput.heldInput) {
diff --git a/src/manager/diggingCaveEntranceManager.c b/src/manager/diggingCaveEntranceManager.c
index 7491eea4..8698db9e 100644
--- a/src/manager/diggingCaveEntranceManager.c
+++ b/src/manager/diggingCaveEntranceManager.c
@@ -53,9 +53,9 @@ void DiggingCaveEntranceManager_Init(DiggingCaveEntranceManager* this) {
tile = 0x81 << 7; // 0x4080
for (entrance = GetDiggingCaveEntranceForRoom(entrance, room); entrance != 0;
entrance = GetDiggingCaveEntranceForRoom(entrance, room)) {
- SetTile(tile, entrance->sourceTilePosition + TILE_POS(-1, 1), 1);
- SetTile(tile, entrance->sourceTilePosition + TILE_POS(0, 1), 1);
- SetTile(tile, entrance->sourceTilePosition + TILE_POS(1, 1), 1);
+ SetBottomTile(tile, entrance->sourceTilePosition + TILE_POS(-1, 1), 1);
+ SetBottomTile(tile, entrance->sourceTilePosition + TILE_POS(0, 1), 1);
+ SetBottomTile(tile, entrance->sourceTilePosition + TILE_POS(1, 1), 1);
entrance++;
}
}
diff --git a/src/manager/flameManager.c b/src/manager/flameManager.c
index 880324fd..46d2ad32 100644
--- a/src/manager/flameManager.c
+++ b/src/manager/flameManager.c
@@ -16,7 +16,7 @@ void FlameManager_Main(FlameManager* this) {
this->field_0x38 = TILE(this->field_0x38, this->field_0x3a);
if (GetTileType(this->field_0x38, 2) == 0x75) {
super->action = 1;
- SetTile(0x406a, this->field_0x38, 1);
+ SetBottomTile(0x406a, this->field_0x38, 1);
} else {
DeleteThisEntity();
}
@@ -26,7 +26,7 @@ void FlameManager_Main(FlameManager* this) {
DeleteThisEntity();
}
if (GetTileType(this->field_0x38, 2) == 0x76) {
- SetTile(0x406b, this->field_0x38, 1);
+ SetBottomTile(0x406b, this->field_0x38, 1);
DeleteThisEntity();
}
}
diff --git a/src/manager/manager29.c b/src/manager/manager29.c
index 02ed52ba..55a5548f 100644
--- a/src/manager/manager29.c
+++ b/src/manager/manager29.c
@@ -33,7 +33,7 @@ void sub_0805CBD0(Manager29* this) {
this->unk_38 = (this->unk_38 >> 4 & 0x3fU) | (((this->unk_3a << 0x10) >> 0x14 & 0x3fU) << 6);
this->unk_3a = (this->unk_3c >> 4 & 0x3f) | (((this->unk_36 + this->unk_37 * 0x100) >> 4 & 0x3fU) << 6);
this->unk_3c = GetTileType(this->unk_38, this->unk_34);
- layer = GetLayerByIndex(this->unk_34);
+ layer = GetTileBuffer(this->unk_34);
this->unk_28 = (u16*)layer->metatileTypes;
this->unk_2c = &layer->mapData[(s16)this->unk_3a];
}
diff --git a/src/manager/tileChangeObserveManager.c b/src/manager/tileChangeObserveManager.c
index f2ada610..77c24677 100644
--- a/src/manager/tileChangeObserveManager.c
+++ b/src/manager/tileChangeObserveManager.c
@@ -31,7 +31,7 @@ void TileChangeObserveManager_Init(TileChangeObserveManager* this) {
DeleteThisEntity();
} else {
super->action = 1;
- tile = &GetLayerByIndex(this->field_0x3a)->mapData[this->tilePosition];
+ tile = &GetTileBuffer(this->field_0x3a)->mapData[this->tilePosition];
this->observedTile = tile;
this->initialTile = tile[0];
}
diff --git a/src/manager/waterfallBottomManager.c b/src/manager/waterfallBottomManager.c
index a8e3f4c4..11b93c99 100644
--- a/src/manager/waterfallBottomManager.c
+++ b/src/manager/waterfallBottomManager.c
@@ -10,7 +10,7 @@
#include "functions.h"
void WaterfallBottomManager_Main(WaterfallBottomManager* this) {
- SetTile(0x4014, 0x5c3, 1);
+ SetBottomTile(0x4014, 0x5c3, 1);
if ((gRoomControls.origin_y + 200 < gPlayerEntity.base.y.HALF.HI) &&
((u32)(gPlayerEntity.base.x.HALF.HI - gRoomControls.origin_x) - 0x30 < 0x11)) {
gPlayerEntity.base.collisionLayer = 3;
diff --git a/src/movement.c b/src/movement.c
index 51e95932..f166c5b0 100644
--- a/src/movement.c
+++ b/src/movement.c
@@ -1612,7 +1612,7 @@ void CalculateEntityTileCollisions(Entity* this, u32 direction, u32 collisionTyp
u32 hitboxUnkX;
u32 hitboxUnkY;
- layer = GetLayerByIndex(this->collisionLayer)->collisionData;
+ layer = GetTileBuffer(this->collisionLayer)->collisionData;
hb = this->hitbox;
xMin = this->x.HALF.HI + hb->offset_x;
yMin = this->y.HALF.HI + hb->offset_y;
diff --git a/src/npc/castorWildsStatue.c b/src/npc/castorWildsStatue.c
index 86365860..1d0c6b07 100644
--- a/src/npc/castorWildsStatue.c
+++ b/src/npc/castorWildsStatue.c
@@ -78,20 +78,20 @@ void sub_08067418(CastorWildsStatueEntity* this) {
this->tilePos = COORD_TO_TILE(super);
if (super->type == 0) {
super->hitbox = (Hitbox*)&gUnk_08110E94;
- SetTile(0x4022, this->tilePos - 1, super->collisionLayer);
- SetTile(0x4022, this->tilePos, super->collisionLayer);
- SetTile(0x4022, this->tilePos + 0x3f, super->collisionLayer);
- SetTile(0x4022, this->tilePos + 0x40, super->collisionLayer);
+ SetBottomTile(0x4022, this->tilePos - 1, super->collisionLayer);
+ SetBottomTile(0x4022, this->tilePos, super->collisionLayer);
+ SetBottomTile(0x4022, this->tilePos + 0x3f, super->collisionLayer);
+ SetBottomTile(0x4022, this->tilePos + 0x40, super->collisionLayer);
} else {
super->collisionLayer = 3;
super->spriteOrientation.flipY = 1;
super->spriteRendering.b3 = 1;
super->spritePriority.b0 = 2;
if (CheckLocalFlag(HIKYOU_00_SEKIZOU) == 0) {
- SetTile(0x4022, 0xe81, 1);
- SetTile(0x4022, 0xe82, 1);
- SetTile(0x4022, 0xe83, 1);
- SetTile(0x4022, 0xec3, 1);
+ SetBottomTile(0x4022, 0xe81, 1);
+ SetBottomTile(0x4022, 0xe82, 1);
+ SetBottomTile(0x4022, 0xe83, 1);
+ SetBottomTile(0x4022, 0xec3, 1);
}
}
InitScriptForNPC(super);
diff --git a/src/npc/clothesRack.c b/src/npc/clothesRack.c
index 28de3bed..aa6ae533 100644
--- a/src/npc/clothesRack.c
+++ b/src/npc/clothesRack.c
@@ -36,12 +36,12 @@ void sub_0806DD90(Entity* this) {
InitializeAnimation(this, animIndex);
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);
+ SetBottomTile(0x4072, TILE(x - 0x18, y - 0x10), this->collisionLayer);
+ SetBottomTile(0x4072, TILE(x - 0x18, y), this->collisionLayer);
+ SetBottomTile(0x4072, TILE(x - 0x18, y + 0x10), this->collisionLayer);
+ SetBottomTile(0x4072, TILE(x + 0x18, y - 0x10), this->collisionLayer);
+ SetBottomTile(0x4072, TILE(x + 0x18, y), this->collisionLayer);
+ SetBottomTile(0x4072, TILE(x + 0x18, y + 0x10), this->collisionLayer);
}
void sub_0806DEC8(Entity* this) {
diff --git a/src/npc/dog.c b/src/npc/dog.c
index 3ca53e97..a6c7c0fe 100644
--- a/src/npc/dog.c
+++ b/src/npc/dog.c
@@ -235,7 +235,7 @@ void sub_08069B44(DogEntity* this) {
super->action = 4;
}
if ((super->type == 2) && (CheckLocalFlag(MACHI_02_DOG) == 0)) {
- SetTile(0x4072, TILE(super->x.HALF.HI, super->y.HALF.HI - 8), super->collisionLayer);
+ SetBottomTile(0x4072, TILE(super->x.HALF.HI, super->y.HALF.HI - 8), super->collisionLayer);
}
}
}
diff --git a/src/npc/kid.c b/src/npc/kid.c
index aa4bcbea..c6a57463 100644
--- a/src/npc/kid.c
+++ b/src/npc/kid.c
@@ -586,12 +586,12 @@ void sub_080626E0(Entity* this, ScriptExecutionContext* context) {
}
void sub_08062788(Entity* this, ScriptExecutionContext* context) {
- SetTile(0x4072, 0x60b, 1);
- SetTile(0x4072, 0x60c, 1);
- SetTile(0x4072, 0x60d, 1);
- SetTile(0x4072, 0x64b, 1);
- SetTile(0x4072, 0x64c, 1);
- SetTile(0x4072, 0x64d, 1);
+ SetBottomTile(0x4072, 0x60b, 1);
+ SetBottomTile(0x4072, 0x60c, 1);
+ SetBottomTile(0x4072, 0x60d, 1);
+ SetBottomTile(0x4072, 0x64b, 1);
+ SetBottomTile(0x4072, 0x64c, 1);
+ SetBottomTile(0x4072, 0x64d, 1);
}
void sub_080627E8(Entity* this, ScriptExecutionContext* context) {
diff --git a/src/npc/npc5.c b/src/npc/npc5.c
index dc301ae8..1b60767d 100644
--- a/src/npc/npc5.c
+++ b/src/npc/npc5.c
@@ -68,7 +68,7 @@ u32 PointInsideRadius(s32, s32, s32);
u32 sub_080611D4(Entity*);
extern u32 sub_08079FD4(Entity*, u32);
-extern void sub_08016AD2(Entity*);
+extern void UpdateCollisionLayer(Entity*);
bool32 sub_08061630(NPC5Entity*, s32, s32, s32);
bool32 sub_08061720(NPC5Entity*, s32, s32, s32);
@@ -471,7 +471,7 @@ bool32 sub_08061170(NPC5Entity* this) {
}
return FALSE;
} else {
- sub_08016AD2(super);
+ UpdateCollisionLayer(super);
return TRUE;
}
}
@@ -501,7 +501,7 @@ u32 sub_080611D4(Entity* this) {
ptr = (s8*)gUnk_0810AC4C;
a = ptr[x];
b = ptr[x + 1];
- uVar2 = GetRelativeCollisionTile(this, a, b);
+ uVar2 = GetActTileRelative(this, a, b);
ptr2 = gUnk_0810AC54;
do {
diff --git a/src/object/angryStatue.c b/src/object/angryStatue.c
index 0204c90e..687d32d9 100644
--- a/src/object/angryStatue.c
+++ b/src/object/angryStatue.c
@@ -29,7 +29,7 @@ void AngryStatue(Entity* this) {
void AngryStatue_Init(Entity* this) {
this->action = 1;
this->hitbox = (Hitbox*)&gUnk_080FD178;
- SetTile(0x4022, COORD_TO_TILE(this), this->collisionLayer);
+ SetBottomTile(0x4022, COORD_TO_TILE(this), this->collisionLayer);
InitializeAnimation(this, this->type);
}
diff --git a/src/object/bakerOven.c b/src/object/bakerOven.c
index 22b5fbbb..9a593e32 100644
--- a/src/object/bakerOven.c
+++ b/src/object/bakerOven.c
@@ -107,12 +107,12 @@ void sub_0809CDF0(BakerOvenEntity* this) {
(((super->y.HALF.HI - gRoomControls.origin_y) >> 4 & 0x3f) << 6);
y = this->unk_80;
- SetTile(0x402e, y - 0x01, super->collisionLayer);
- SetTile(0x4022, y - 0x00, super->collisionLayer);
- SetTile(0x4022, y + 0x01, super->collisionLayer);
- SetTile(0x4026, y - 0x41, super->collisionLayer);
- SetTile(0x4026, y - 0x40, super->collisionLayer);
- SetTile(0x4024, y - 0x3f, super->collisionLayer);
- SetTile(0x4026, y - 0x81, super->collisionLayer);
- SetTile(0x4026, y - 0x80, super->collisionLayer);
+ SetBottomTile(0x402e, y - 0x01, super->collisionLayer);
+ SetBottomTile(0x4022, y - 0x00, super->collisionLayer);
+ SetBottomTile(0x4022, y + 0x01, super->collisionLayer);
+ SetBottomTile(0x4026, y - 0x41, super->collisionLayer);
+ SetBottomTile(0x4026, y - 0x40, super->collisionLayer);
+ SetBottomTile(0x4024, y - 0x3f, super->collisionLayer);
+ SetBottomTile(0x4026, y - 0x81, super->collisionLayer);
+ SetBottomTile(0x4026, y - 0x80, super->collisionLayer);
}
diff --git a/src/object/beanstalk.c b/src/object/beanstalk.c
index fb6abf4e..db00d5d0 100644
--- a/src/object/beanstalk.c
+++ b/src/object/beanstalk.c
@@ -257,8 +257,8 @@ void Beanstalk_Action1Type7(BeanstalkEntity* this) {
this->unk_70 = TILE(super->x.HALF.HI, this->unk_6c);
while (TRUE) {
this->unk_70 = TILE(super->x.HALF.HI, this->unk_6c);
- SetTile(0x4017, this->unk_70, 2);
- SetTile(0x4017, this->unk_70, 1);
+ SetBottomTile(0x4017, this->unk_70, 2);
+ SetBottomTile(0x4017, this->unk_70, 1);
this->unk_6c += 0x10;
if (this->unk_6c >= gRoomControls.origin_y + gRoomControls.height)
break;
@@ -307,7 +307,7 @@ void Beanstalk_Action1Type8SubAction0(BeanstalkEntity* this) {
super->spriteOrientation.flipY = 2;
this->unk_70 = COORD_TO_TILE(super);
- SetTile(0x4017, this->unk_70, 1);
+ SetBottomTile(0x4017, this->unk_70, 1);
super->subAction = 1;
obj = CreateObjectWithParent(super, CHUCHU_BOSS_PARTICLE, 0, 0);
if (obj != NULL) {
@@ -339,12 +339,12 @@ void Beanstalk_Action1Type9(BeanstalkEntity* this) {
if (gPlayerState.floor_type == SURFACE_LADDER) {
super->spritePriority.b0 = 0;
if (sub_080B1A0C(super, 0, -0x18) != 0x4014) {
- SetTile(0x4014, COORD_TO_TILE_OFFSET(super, 0, 0x18), 1);
+ SetBottomTile(0x4014, COORD_TO_TILE_OFFSET(super, 0, 0x18), 1);
}
} else {
super->spritePriority.b0 = 5;
if (this->unk_72 != sub_080B1A0C(super, 0, -0x18)) {
- SetTile(this->unk_72, COORD_TO_TILE_OFFSET(super, 0, 0x18), 1);
+ SetBottomTile(this->unk_72, COORD_TO_TILE_OFFSET(super, 0, 0x18), 1);
}
}
}
diff --git a/src/object/bigIceBlock.c b/src/object/bigIceBlock.c
index e52d4323..126b0600 100644
--- a/src/object/bigIceBlock.c
+++ b/src/object/bigIceBlock.c
@@ -137,10 +137,10 @@ void sub_08099910(BigIceBlockEntity* this) {
switch (uVar2) {
default:
- SetTile(0x4022, position - 0x41, super->collisionLayer);
- SetTile(0x4022, position - 0x40, super->collisionLayer);
- SetTile(0x4022, position - 1, super->collisionLayer);
- SetTile(0x4022, position, super->collisionLayer);
+ SetBottomTile(0x4022, position - 0x41, super->collisionLayer);
+ SetBottomTile(0x4022, position - 0x40, super->collisionLayer);
+ SetBottomTile(0x4022, position - 1, super->collisionLayer);
+ SetBottomTile(0x4022, position, super->collisionLayer);
break;
case 1:
iVar1 = sub_080B1AE0(position - 0x41, super->collisionLayer);
@@ -148,27 +148,27 @@ void sub_08099910(BigIceBlockEntity* this) {
if (iVar1 == 0x12) {
uVar3 = 0x4079;
}
- SetTile(uVar3, position - 0x41, super->collisionLayer);
- SetTile(0x4022, position - 0x40, super->collisionLayer);
+ SetBottomTile(uVar3, position - 0x41, super->collisionLayer);
+ SetBottomTile(0x4022, position - 0x40, super->collisionLayer);
iVar1 = sub_080B1AE0(position - 0x3f, super->collisionLayer);
uVar3 = 0x4025;
if (iVar1 == 0x12) {
uVar3 = 0x407b;
}
- SetTile(uVar3, position - 0x3f, super->collisionLayer);
+ SetBottomTile(uVar3, position - 0x3f, super->collisionLayer);
iVar1 = sub_080B1AE0(position - 1, super->collisionLayer);
uVar3 = 0x4024;
if (iVar1 == 0x12) {
uVar3 = 0x4079;
}
- SetTile(uVar3, position - 1, super->collisionLayer);
- SetTile(0x4022, position, super->collisionLayer);
+ SetBottomTile(uVar3, position - 1, super->collisionLayer);
+ SetBottomTile(0x4022, position, super->collisionLayer);
iVar1 = sub_080B1AE0(position + 1, super->collisionLayer);
uVar3 = 0x4025;
if (iVar1 == 0x12) {
uVar3 = 0x407b;
}
- SetTile(uVar3, position + 1, super->collisionLayer);
+ SetBottomTile(uVar3, position + 1, super->collisionLayer);
return;
break;
case 2:
@@ -177,27 +177,27 @@ void sub_08099910(BigIceBlockEntity* this) {
if (iVar1 == 0x12) {
uVar3 = 0x4077;
}
- SetTile(uVar3, position - 0x41, super->collisionLayer);
+ SetBottomTile(uVar3, position - 0x41, super->collisionLayer);
iVar1 = sub_080B1AE0(position - 0x40, super->collisionLayer);
uVar3 = 0x4023;
if (iVar1 == 0x12) {
uVar3 = 0x4077;
}
- SetTile(uVar3, position - 0x40, super->collisionLayer);
- SetTile(0x4022, position - 1, super->collisionLayer);
- SetTile(0x4022, position, super->collisionLayer);
+ SetBottomTile(uVar3, position - 0x40, super->collisionLayer);
+ SetBottomTile(0x4022, position - 1, super->collisionLayer);
+ SetBottomTile(0x4022, position, super->collisionLayer);
iVar1 = sub_080B1AE0(position + 0x3f, super->collisionLayer);
uVar3 = 0x4026;
if (iVar1 == 0x12) {
uVar3 = 0x407c;
}
- SetTile(uVar3, position + 0x3f, super->collisionLayer);
+ SetBottomTile(uVar3, position + 0x3f, super->collisionLayer);
iVar1 = sub_080B1AE0(position + 0x40, super->collisionLayer);
uVar3 = 0x4026;
if (iVar1 == 0x12) {
uVar3 = 0x407c;
}
- SetTile(uVar3, position + 0x40, super->collisionLayer);
+ SetBottomTile(uVar3, position + 0x40, super->collisionLayer);
break;
case 3:
iVar1 = sub_080B1AE0(position - 0x41, super->collisionLayer);
@@ -205,50 +205,50 @@ void sub_08099910(BigIceBlockEntity* this) {
if (iVar1 == 0x12) {
uVar3 = 0x4075;
}
- SetTile(uVar3, position - 0x41, super->collisionLayer);
+ SetBottomTile(uVar3, position - 0x41, super->collisionLayer);
iVar1 = sub_080B1AE0(position - 0x40, super->collisionLayer);
uVar3 = 0x4023;
if (iVar1 == 0x12) {
uVar3 = 0x4077;
}
- SetTile(uVar3, position - 0x40, super->collisionLayer);
+ SetBottomTile(uVar3, position - 0x40, super->collisionLayer);
iVar1 = sub_080B1AE0(position - 0x3f, super->collisionLayer);
uVar3 = 0x4028;
if (iVar1 == 0x12) {
uVar3 = 0x4076;
}
- SetTile(uVar3, position - 0x3f, super->collisionLayer);
+ SetBottomTile(uVar3, position - 0x3f, super->collisionLayer);
iVar1 = sub_080B1AE0(position - 1, super->collisionLayer);
uVar3 = 0x4024;
if (iVar1 == 0x12) {
uVar3 = 0x4079;
}
- SetTile(uVar3, position - 1, super->collisionLayer);
- SetTile(0x4022, position, super->collisionLayer);
+ SetBottomTile(uVar3, position - 1, super->collisionLayer);
+ SetBottomTile(0x4022, position, super->collisionLayer);
iVar1 = sub_080B1AE0(position + 1, super->collisionLayer);
uVar3 = 0x4025;
if (iVar1 == 0x12) {
uVar3 = 0x407b;
}
- SetTile(uVar3, position + 1, super->collisionLayer);
+ SetBottomTile(uVar3, position + 1, super->collisionLayer);
iVar1 = sub_080B1AE0(position + 0x3f, super->collisionLayer);
uVar3 = 0x4029;
if (iVar1 == 0x12) {
uVar3 = 0x4078;
}
- SetTile(uVar3, position + 0x3f, super->collisionLayer);
+ SetBottomTile(uVar3, position + 0x3f, super->collisionLayer);
iVar1 = sub_080B1AE0(position + 0x40, super->collisionLayer);
uVar3 = 0x4026;
if (iVar1 == 0x12) {
uVar3 = 0x407c;
}
- SetTile(uVar3, position + 0x40, super->collisionLayer);
+ SetBottomTile(uVar3, position + 0x40, super->collisionLayer);
iVar1 = sub_080B1AE0(position + 0x41, super->collisionLayer);
uVar3 = 0x402a;
if (iVar1 == 0x12) {
uVar3 = 0x407a;
}
- SetTile(uVar3, position + 0x41, super->collisionLayer);
+ SetBottomTile(uVar3, position + 0x41, super->collisionLayer);
break;
}
}
diff --git a/src/object/bigPushableLever.c b/src/object/bigPushableLever.c
index e4110703..10dc9367 100644
--- a/src/object/bigPushableLever.c
+++ b/src/object/bigPushableLever.c
@@ -50,8 +50,8 @@ void BigPushableLever_Init(BigPushableLeverEntity* this) {
void BigPushableLever_Idle(BigPushableLeverEntity* this) {
if (BigPushableLever_ShouldStartPushing(this)) {
super->action = PUSHING;
- SetTile(this->tileIndexUpper, this->tilePositionUpper, super->collisionLayer);
- SetTile(this->tileIndexLower, this->tilePositionLower, super->collisionLayer);
+ SetBottomTile(this->tileIndexUpper, this->tilePositionUpper, super->collisionLayer);
+ SetBottomTile(this->tileIndexLower, this->tilePositionLower, super->collisionLayer);
EnqueueSFX(SFX_132);
RequestPriorityDuration(super, 30);
if (PlayerCanBeMoved()) {
@@ -90,8 +90,8 @@ void BigPushableLever_SetTiles(BigPushableLeverEntity* this) {
this->tilePositionLower = this->tilePositionUpper - 0x40;
this->tileIndexUpper = GetTileIndex(this->tilePositionUpper, super->collisionLayer);
this->tileIndexLower = GetTileIndex(this->tilePositionLower, super->collisionLayer);
- SetTile(0x4057, this->tilePositionUpper, super->collisionLayer);
- SetTile(0x4058, this->tilePositionLower, super->collisionLayer);
+ SetBottomTile(0x4057, this->tilePositionUpper, super->collisionLayer);
+ SetBottomTile(0x4058, this->tilePositionLower, super->collisionLayer);
InitializeAnimation(super, 1);
} else {
super->type2 = 1;
@@ -99,8 +99,8 @@ void BigPushableLever_SetTiles(BigPushableLeverEntity* this) {
this->tilePositionLower = this->tilePositionUpper - 1;
this->tileIndexUpper = GetTileIndex(this->tilePositionUpper, super->collisionLayer);
this->tileIndexLower = GetTileIndex(this->tilePositionLower, super->collisionLayer);
- SetTile(0x4055, this->tilePositionUpper, super->collisionLayer);
- SetTile(0x4056, this->tilePositionLower, super->collisionLayer);
+ SetBottomTile(0x4055, this->tilePositionUpper, super->collisionLayer);
+ SetBottomTile(0x4056, this->tilePositionLower, super->collisionLayer);
InitializeAnimation(super, 0);
}
}
@@ -111,7 +111,7 @@ bool32 BigPushableLever_ShouldStartPushing(BigPushableLeverEntity* this) {
return TRUE;
}
BigPushableLever_CalculateSpriteOffsets(this);
- SetTile(gUnk_081236E8[super->type2], this->tilePositionLower, super->collisionLayer);
+ SetBottomTile(gUnk_081236E8[super->type2], this->tilePositionLower, super->collisionLayer);
} else {
this->timer = 60;
super->spriteOffsetX = 0;
diff --git a/src/object/board.c b/src/object/board.c
index dbdcabea..be77640a 100644
--- a/src/object/board.c
+++ b/src/object/board.c
@@ -53,7 +53,7 @@ void Board_Init(BoardEntity* this) {
UpdateSpriteForCollisionLayer(super);
super->spritePriority.b0 = 6;
if (super->type == 0) {
- SetTile(0x4074, this->tile - 0x40, super->collisionLayer);
+ SetBottomTile(0x4074, this->tile - 0x40, super->collisionLayer);
}
sub_08098BE8(this);
}
diff --git a/src/object/bollard.c b/src/object/bollard.c
index 6a5d45cc..b21636c5 100644
--- a/src/object/bollard.c
+++ b/src/object/bollard.c
@@ -58,7 +58,7 @@ void Bollard_Action1(BollardEntity* this) {
}
super->action = 2;
InitializeAnimation(super, 3);
- SetTile(this->tileIndex, this->tile, super->collisionLayer);
+ SetBottomTile(this->tileIndex, this->tile, super->collisionLayer);
EnqueueSFX(SFX_1A5);
}
@@ -95,7 +95,7 @@ void sub_0808B3AC(BollardEntity* this) {
this->tile = COORD_TO_TILE(super);
this->tileIndex = GetTileIndex(this->tile, super->collisionLayer);
this->unk74 = sub_080B1B44(this->tile, super->collisionLayer);
- SetTile(0x400b, this->tile, super->collisionLayer);
+ SetBottomTile(0x400b, this->tile, super->collisionLayer);
}
void sub_0808B41C(BollardEntity* this) {
diff --git a/src/object/bossDoor.c b/src/object/bossDoor.c
index 8502dd14..0a408f4e 100644
--- a/src/object/bossDoor.c
+++ b/src/object/bossDoor.c
@@ -177,28 +177,28 @@ void sub_0808C500(BossDoorEntity* this) {
this->unk_78 = GetTileIndex(this->unk_74 - 1, super->collisionLayer);
this->unk_7a = GetTileIndex(this->unk_74, super->collisionLayer);
this->unk_7c = GetTileIndex(this->unk_74 + 1, super->collisionLayer);
- SetTile(0x4022, this->unk_74 - 1, super->collisionLayer);
- SetTile(0x4022, this->unk_74, super->collisionLayer);
- SetTile(0x4022, this->unk_74 + 1, super->collisionLayer);
+ SetBottomTile(0x4022, this->unk_74 - 1, super->collisionLayer);
+ SetBottomTile(0x4022, this->unk_74, super->collisionLayer);
+ SetBottomTile(0x4022, this->unk_74 + 1, super->collisionLayer);
} else {
this->unk_78 = GetTileIndex(this->unk_74 - 0x40, super->collisionLayer);
this->unk_7a = GetTileIndex(this->unk_74, super->collisionLayer);
this->unk_7c = GetTileIndex(this->unk_74 + 0x40, super->collisionLayer);
- SetTile(0x4022, this->unk_74 - 0x40, super->collisionLayer);
- SetTile(0x4022, this->unk_74, super->collisionLayer);
- SetTile(0x4022, this->unk_74 + 0x40, super->collisionLayer);
+ SetBottomTile(0x4022, this->unk_74 - 0x40, super->collisionLayer);
+ SetBottomTile(0x4022, this->unk_74, super->collisionLayer);
+ SetBottomTile(0x4022, this->unk_74 + 0x40, super->collisionLayer);
}
}
void sub_0808C5D0(BossDoorEntity* this) {
if ((this->unk_76 == 0) || (this->unk_76 == 2)) {
- SetTile(this->unk_78, this->unk_74 - 1, super->collisionLayer);
- SetTile(this->unk_7a, this->unk_74, super->collisionLayer);
- SetTile(this->unk_7c, this->unk_74 + 1, super->collisionLayer);
+ SetBottomTile(this->unk_78, this->unk_74 - 1, super->collisionLayer);
+ SetBottomTile(this->unk_7a, this->unk_74, super->collisionLayer);
+ SetBottomTile(this->unk_7c, this->unk_74 + 1, super->collisionLayer);
} else {
- SetTile(this->unk_78, this->unk_74 - 0x40, super->collisionLayer);
- SetTile(this->unk_7a, this->unk_74, super->collisionLayer);
- SetTile(this->unk_7c, this->unk_74 + 0x40, super->collisionLayer);
+ SetBottomTile(this->unk_78, this->unk_74 - 0x40, super->collisionLayer);
+ SetBottomTile(this->unk_7a, this->unk_74, super->collisionLayer);
+ SetBottomTile(this->unk_7c, this->unk_74 + 0x40, super->collisionLayer);
}
}
diff --git a/src/object/bush.c b/src/object/bush.c
index 38371e1e..4e086347 100644
--- a/src/object/bush.c
+++ b/src/object/bush.c
@@ -68,7 +68,7 @@ void Bush_Init(BushEntity* this) {
super->hitbox = (Hitbox*)&gUnk_081205B4;
this->unk_72 = 0;
this->unk_70 = GetTileIndex(COORD_TO_TILE(super), super->collisionLayer);
- SetTile(0x4022, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(0x4022, COORD_TO_TILE(super), super->collisionLayer);
InitializeAnimation(super, gUnk_08120588[super->type].unk_0);
}
diff --git a/src/object/button.c b/src/object/button.c
index ad621bc7..f0192ac7 100644
--- a/src/object/button.c
+++ b/src/object/button.c
@@ -105,7 +105,7 @@ void Button_Action4(ButtonEntity* this) {
super->timer--;
if (super->subtimer != 0) {
super->subtimer = 0;
- SetTile(0x4035, this->unk_74, super->collisionLayer);
+ SetBottomTile(0x4035, this->unk_74, super->collisionLayer);
}
if (sub_08081CB0(this)) {
super->action = 3;
@@ -230,7 +230,7 @@ void sub_08081E6C(ButtonEntity* this) {
if (tile < 0x4000)
return;
- r1 = GetLayerByIndex(r5);
+ r1 = GetTileBuffer(r5);
r4 = (super->type == 0 ? 0x7a : 0x78);
tmp = r1->metatiles;
tmp = tmp + (r1->unkData2[r4] << 2);
@@ -239,7 +239,7 @@ void sub_08081E6C(ButtonEntity* this) {
if (sub_08081F00((u32*)tmp2, (u32*)tmp))
return;
SetTileType(r4, r6, r5);
- SetTile(tile, r6, r5);
+ SetBottomTile(tile, r6, r5);
}
u32 sub_08081F00(u32* unk1, u32* unk2) {
@@ -279,7 +279,7 @@ bool32 sub_08081F7C(ButtonEntity* this, u32 r7) {
sub_08081F24(super);
SoundReq(SFX_BUTTON_PRESS);
if (this->unk_70 != 0xFFFF)
- SetTile(this->unk_70, this->unk_74, super->collisionLayer);
+ SetBottomTile(this->unk_70, this->unk_74, super->collisionLayer);
return FALSE;
}
}
diff --git a/src/object/cabinFurniture.c b/src/object/cabinFurniture.c
index e23df88c..2a9979ab 100644
--- a/src/object/cabinFurniture.c
+++ b/src/object/cabinFurniture.c
@@ -43,38 +43,38 @@ void CabinFurniture_Init(CabinFurnitureEntity* this) {
super->spritePriority.b0 = 6;
uVar7 = this->tile;
uVar6 = uVar7 - 1;
- SetTile(0x4022, uVar6, uVar1);
- SetTile(0x4022, uVar7, uVar1);
- SetTile(0x4022, uVar7 + 1, uVar1);
- SetTile(0x4022, uVar7 + 0x3f, uVar1);
- SetTile(0x4022, uVar7 + 0x40, uVar1);
- SetTile(0x4022, uVar7 + 0x41, uVar1);
- SetTile(0x403d, uVar7 - 0x41, uVar1);
- SetTile(0x403d, uVar7 - 0x40, uVar1);
- SetTile(0x4026, uVar7 - 0x3f, uVar1);
- SetTile(0x4026, uVar7 - 0x81, uVar1);
- SetTile(0x4026, uVar7 - 0x80, uVar1);
+ SetBottomTile(0x4022, uVar6, uVar1);
+ SetBottomTile(0x4022, uVar7, uVar1);
+ SetBottomTile(0x4022, uVar7 + 1, uVar1);
+ SetBottomTile(0x4022, uVar7 + 0x3f, uVar1);
+ SetBottomTile(0x4022, uVar7 + 0x40, uVar1);
+ SetBottomTile(0x4022, uVar7 + 0x41, uVar1);
+ SetBottomTile(0x403d, uVar7 - 0x41, uVar1);
+ SetBottomTile(0x403d, uVar7 - 0x40, uVar1);
+ SetBottomTile(0x4026, uVar7 - 0x3f, uVar1);
+ SetBottomTile(0x4026, uVar7 - 0x81, uVar1);
+ SetBottomTile(0x4026, uVar7 - 0x80, uVar1);
break;
case 1:
super->action = 1;
uVar6 = this->tile;
- SetTile(0x4022, uVar6, uVar1);
- SetTile(0x4022, uVar6 + 0x40, uVar1);
- SetTile(0x4025, uVar6 + 0x41, uVar1);
+ SetBottomTile(0x4022, uVar6, uVar1);
+ SetBottomTile(0x4022, uVar6 + 0x40, uVar1);
+ SetBottomTile(0x4025, uVar6 + 0x41, uVar1);
if (CheckLocalFlag(0x4f) == 0) {
- SetTile(0x402f, uVar6 + 1, uVar1);
+ SetBottomTile(0x402f, uVar6 + 1, uVar1);
} else {
- SetTile(0x402d, uVar6 + 1, uVar1);
+ SetBottomTile(0x402d, uVar6 + 1, uVar1);
}
break;
case 2:
super->action = 1;
uVar7 = this->tile;
uVar6 = uVar7 - 0x41;
- SetTile(0x4022, uVar6, uVar1);
- SetTile(0x4022, uVar7 - 0x40, uVar1);
- SetTile(0x4022, uVar7 - 1, uVar1);
- SetTile(0x4022, uVar7, uVar1);
+ SetBottomTile(0x4022, uVar6, uVar1);
+ SetBottomTile(0x4022, uVar7 - 0x40, uVar1);
+ SetBottomTile(0x4022, uVar7 - 1, uVar1);
+ SetBottomTile(0x4022, uVar7, uVar1);
break;
}
}
diff --git a/src/object/carlovObject.c b/src/object/carlovObject.c
index 2a093491..ea7d30a6 100644
--- a/src/object/carlovObject.c
+++ b/src/object/carlovObject.c
@@ -97,7 +97,7 @@ void CarlovObject_Type1Init(CarlovObjectEntity* this) {
if (super->timer == 0) {
super->action = 1;
super->subtimer = 120;
- SetTile(0x4022, this->unk_76, super->collisionLayer);
+ SetBottomTile(0x4022, this->unk_76, super->collisionLayer);
} else {
super->action = 3;
super->spriteSettings.draw = 0;
@@ -111,7 +111,7 @@ void CarlovObject_Type1Action1(CarlovObjectEntity* this) {
super->action = 2;
super->timer = 7;
super->direction = 0;
- SetTile(this->unk_74, this->unk_76, super->collisionLayer);
+ SetBottomTile(this->unk_74, this->unk_76, super->collisionLayer);
EnqueueSFX(SFX_10B);
}
}
@@ -140,7 +140,7 @@ void CarlovObject_Type1Action4(CarlovObjectEntity* this) {
super->action = 5;
sub_08083814(super, 2);
EnqueueSFX(SFX_10B);
- SetTile(0x4022, this->unk_76, super->collisionLayer);
+ SetBottomTile(0x4022, this->unk_76, super->collisionLayer);
}
}
diff --git a/src/object/crenelBeanSprout.c b/src/object/crenelBeanSprout.c
index cdadc583..b6512f06 100644
--- a/src/object/crenelBeanSprout.c
+++ b/src/object/crenelBeanSprout.c
@@ -54,13 +54,13 @@ void CrenelBeanSprout_Init(CrenelBeanSproutEntity* this) {
if (CheckGlobalFlag(WATERBEAN_OUT)) {
if (CheckGlobalFlag(WATERBEAN_PUT) == 0) {
PositionRelative(&gPlayerEntity.base, super, 0, 0x10000);
- SetTile(0x4022, 0xdc, super->collisionLayer);
+ SetBottomTile(0x4022, 0xdc, super->collisionLayer);
} else {
if (CheckLocalFlag(super->type2) == 0) {
InitializeAnimation(super, 10);
super->y.HALF.HI += 4;
super->action = 4;
- SetTile(0x403b, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(0x403b, COORD_TO_TILE(super), super->collisionLayer);
return;
}
super->type2 = 0;
@@ -107,7 +107,7 @@ void CrenelBeanSprout_Init(CrenelBeanSproutEntity* this) {
InitializeAnimation(super, 0xb);
super->y.HALF.HI += 4;
super->action = 4;
- SetTile(0x4032, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(0x4032, COORD_TO_TILE(super), super->collisionLayer);
return;
} else {
super->type2 = 0;
@@ -329,5 +329,5 @@ void sub_08096A78(CrenelBeanSproutEntity* this) {
SnapToTile(super);
super->y.HALF.HI += 4;
super->action = 3;
- SetTile(0x403b, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(0x403b, COORD_TO_TILE(super), super->collisionLayer);
}
diff --git a/src/object/doubleBookshelf.c b/src/object/doubleBookshelf.c
index cbc27c93..d1b0c1fe 100644
--- a/src/object/doubleBookshelf.c
+++ b/src/object/doubleBookshelf.c
@@ -98,39 +98,39 @@ void sub_0809B0B0(DoubleBookshelfEntity* this) {
case 0:
this->unk_84 = 0;
this->unk_82 = position + 2;
- SetTile(0x4082, position - 1, layer);
- SetTile(0x4022, position, layer);
- SetTile(0x4022, position + 1, layer);
- SetTile(0x4022, position + 2, layer);
+ SetBottomTile(0x4082, position - 1, layer);
+ SetBottomTile(0x4022, position, layer);
+ SetBottomTile(0x4022, position + 1, layer);
+ SetBottomTile(0x4022, position + 2, layer);
break;
case 1:
this->unk_84 = 1;
this->unk_82 = position;
- SetTile(0x405f, position, layer);
- SetTile(0x4022, position + 1, layer);
- SetTile(0x4022, position + 2, layer);
- SetTile(0x4082, position + 3, layer);
+ SetBottomTile(0x405f, position, layer);
+ SetBottomTile(0x4022, position + 1, layer);
+ SetBottomTile(0x4022, position + 2, layer);
+ SetBottomTile(0x4082, position + 3, layer);
break;
case 2:
this->unk_84 = 1;
this->unk_82 = position;
- SetTile(0x4082, position + 3, layer);
- SetTile(0x4022, position + 2, layer);
- SetTile(0x405f, position, layer);
+ SetBottomTile(0x4082, position + 3, layer);
+ SetBottomTile(0x4022, position + 2, layer);
+ SetBottomTile(0x405f, position, layer);
SetFlag(((DoubleBookshelfEntity*)super->parent)->unk_86);
break;
case 3:
this->unk_84 = 0;
this->unk_82 = position + 2;
- SetTile(0x4082, position - 1, layer);
- SetTile(0x4022, position, layer);
- SetTile(0x405f, position + 2, layer);
+ SetBottomTile(0x4082, position - 1, layer);
+ SetBottomTile(0x4022, position, layer);
+ SetBottomTile(0x405f, position + 2, layer);
ClearFlag(((DoubleBookshelfEntity*)super->parent)->unk_86);
break;
case 4:
- SetTile(0x4022, position, layer);
- SetTile(0x4022, position + 1, layer);
- SetTile(0x4022, position + 2, layer);
+ SetBottomTile(0x4022, position, layer);
+ SetBottomTile(0x4022, position + 1, layer);
+ SetBottomTile(0x4022, position + 2, layer);
break;
}
}
@@ -157,7 +157,7 @@ void sub_0809B274(DoubleBookshelfEntity* this) {
case 1:
if (player->x.HALF.HI + 0x1c > super->x.HALF.HI) {
this->unk_84 = 2;
- SetTile(0x4022, this->unk_80 + 2, 1);
+ SetBottomTile(0x4022, this->unk_80 + 2, 1);
sub_0809B358((DoubleBookshelfEntity*)super->child);
return;
}
@@ -182,7 +182,7 @@ void sub_0809B334(DoubleBookshelfEntity* this) {
s32 index;
u32 position = this->unk_80 - 0x81;
for (index = 2; index >= 0; index--, position++) {
- SetTile(0x4026, position, 1);
+ SetBottomTile(0x4026, position, 1);
}
}
@@ -194,7 +194,7 @@ void sub_0809B358(DoubleBookshelfEntity* this) {
const u16* array = &gUnk_08123D68[this->unk_84];
u32 position = this->unk_80 - 0x82;
for (index = 4; index >= 0;) {
- SetTile(*array, position, 1);
+ SetBottomTile(*array, position, 1);
index--;
position++;
array += 2;
diff --git a/src/object/figurineDevice.c b/src/object/figurineDevice.c
index d975556a..d21c51cd 100644
--- a/src/object/figurineDevice.c
+++ b/src/object/figurineDevice.c
@@ -305,9 +305,9 @@ void sub_08087F58(FigurineDeviceEntity* this) {
switch (super->type) {
case 0:
case 1:
- SetTile(0x4022, this->unk_78 - 1, 1);
- SetTile(0x4022, this->unk_78, 1);
- SetTile(0x4022, this->unk_78 + 1, 1);
+ SetBottomTile(0x4022, this->unk_78 - 1, 1);
+ SetBottomTile(0x4022, this->unk_78, 1);
+ SetBottomTile(0x4022, this->unk_78 + 1, 1);
break;
}
}
diff --git a/src/object/fireplace.c b/src/object/fireplace.c
index 98cfa2a6..4e463979 100644
--- a/src/object/fireplace.c
+++ b/src/object/fireplace.c
@@ -35,7 +35,7 @@ void Fireplace_Init(FireplaceEntity* this) {
DeleteThisEntity();
} else {
sub_0807B7D8(0x30b, TILE(super->x.HALF.HI, super->y.HALF.HI), 2);
- SetTile(0x4061, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
+ SetBottomTile(0x4061, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
}
Fireplace_Action1(this);
}
@@ -57,6 +57,6 @@ void sub_0809B7C0(FireplaceEntity* this) {
void sub_0809B7DC(FireplaceEntity* this) {
sub_0807B7D8(0xc3 << 2, TILE(super->x.HALF.HI, super->y.HALF.HI), 2);
- SetTile(0x4062, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
+ SetBottomTile(0x4062, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
super->timer = 1;
}
diff --git a/src/object/frozenWaterElement.c b/src/object/frozenWaterElement.c
index dd40d3ab..e9588e4e 100644
--- a/src/object/frozenWaterElement.c
+++ b/src/object/frozenWaterElement.c
@@ -113,33 +113,33 @@ void FrozenWaterElement_Action2(FrozenWaterElementEntity* this) {
void sub_0809C0A8(FrozenWaterElementEntity* this) {
u32 position = COORD_TO_TILE(super);
- SetTile(0x4022, position - 0x41, super->collisionLayer);
- SetTile(0x4022, position - 0x40, super->collisionLayer);
- SetTile(0x4022, position - 0x3f, super->collisionLayer);
- SetTile(0x4022, position - 2, super->collisionLayer);
- SetTile(0x4022, position - 1, super->collisionLayer);
- SetTile(0x4022, position, super->collisionLayer);
- SetTile(0x4022, position + 1, super->collisionLayer);
- SetTile(0x4022, position + 2, super->collisionLayer);
- SetTile(0x4022, position + 0x3e, super->collisionLayer);
- SetTile(0x4022, position + 0x3f, super->collisionLayer);
- SetTile(0x4022, position + 0x40, super->collisionLayer);
- SetTile(0x4022, position + 0x41, super->collisionLayer);
- SetTile(0x4022, position + 0x42, super->collisionLayer);
- SetTile(0x4022, position + 0x7f, super->collisionLayer);
- SetTile(0x4022, position + 0x80, super->collisionLayer);
- SetTile(0x4022, position + 0x81, super->collisionLayer);
- SetTile(0x4022, position + 0x13f, super->collisionLayer);
- SetTile(0x4022, position + 0x140, super->collisionLayer);
- SetTile(0x4022, position + 0x141, super->collisionLayer);
- SetTile(0x4022, position + 0x17f, super->collisionLayer);
- SetTile(0x4022, position + 0x181, super->collisionLayer);
- SetTile(0x4022, position + 0x1bd, super->collisionLayer);
- SetTile(0x4022, position + 0x1be, super->collisionLayer);
- SetTile(0x4022, position + 0x1bf, super->collisionLayer);
- SetTile(0x4022, position + 0x1c1, super->collisionLayer);
- SetTile(0x4022, position + 0x1c2, super->collisionLayer);
- SetTile(0x4022, position + 0x1c3, super->collisionLayer);
+ SetBottomTile(0x4022, position - 0x41, super->collisionLayer);
+ SetBottomTile(0x4022, position - 0x40, super->collisionLayer);
+ SetBottomTile(0x4022, position - 0x3f, super->collisionLayer);
+ SetBottomTile(0x4022, position - 2, super->collisionLayer);
+ SetBottomTile(0x4022, position - 1, super->collisionLayer);
+ SetBottomTile(0x4022, position, super->collisionLayer);
+ SetBottomTile(0x4022, position + 1, super->collisionLayer);
+ SetBottomTile(0x4022, position + 2, super->collisionLayer);
+ SetBottomTile(0x4022, position + 0x3e, super->collisionLayer);
+ SetBottomTile(0x4022, position + 0x3f, super->collisionLayer);
+ SetBottomTile(0x4022, position + 0x40, super->collisionLayer);
+ SetBottomTile(0x4022, position + 0x41, super->collisionLayer);
+ SetBottomTile(0x4022, position + 0x42, super->collisionLayer);
+ SetBottomTile(0x4022, position + 0x7f, super->collisionLayer);
+ SetBottomTile(0x4022, position + 0x80, super->collisionLayer);
+ SetBottomTile(0x4022, position + 0x81, super->collisionLayer);
+ SetBottomTile(0x4022, position + 0x13f, super->collisionLayer);
+ SetBottomTile(0x4022, position + 0x140, super->collisionLayer);
+ SetBottomTile(0x4022, position + 0x141, super->collisionLayer);
+ SetBottomTile(0x4022, position + 0x17f, super->collisionLayer);
+ SetBottomTile(0x4022, position + 0x181, super->collisionLayer);
+ SetBottomTile(0x4022, position + 0x1bd, super->collisionLayer);
+ SetBottomTile(0x4022, position + 0x1be, super->collisionLayer);
+ SetBottomTile(0x4022, position + 0x1bf, super->collisionLayer);
+ SetBottomTile(0x4022, position + 0x1c1, super->collisionLayer);
+ SetBottomTile(0x4022, position + 0x1c2, super->collisionLayer);
+ SetBottomTile(0x4022, position + 0x1c3, super->collisionLayer);
}
void sub_0809C23C(FrozenWaterElementEntity* this) {
diff --git a/src/object/furniture.c b/src/object/furniture.c
index 31d06f14..7a185287 100644
--- a/src/object/furniture.c
+++ b/src/object/furniture.c
@@ -217,14 +217,14 @@ static void FurnitureInit(FurnitureEntity* this) {
break;
case 0x40:
super->y.HALF.HI = (super->y.HALF.HI & ~0xF) | 4;
- SetTile(0x4017, this->tile - 128, 1);
- SetTile(0x4017, this->tile - 64, 1);
+ SetBottomTile(0x4017, this->tile - 128, 1);
+ SetBottomTile(0x4017, this->tile - 64, 1);
break;
case 0x80:
super->frameIndex = 0;
super->y.HALF.HI = (super->y.HALF.HI & ~0xF) | 6;
this->tile = COORD_TO_TILE(super);
- SetTile(0x4026, this->tile, super->collisionLayer);
+ SetBottomTile(0x4026, this->tile, super->collisionLayer);
break;
case 0x200:
break;
@@ -260,8 +260,8 @@ static void FurnitureInit(FurnitureEntity* this) {
tile = this->tile - 129;
cnt = super->type != 26 ? 3 : 2;
for (i = 0; i < cnt; ++i, ++tile) {
- SetTile(0x4026, tile, 2);
- SetTile(0x4026, tile, 1);
+ SetBottomTile(0x4026, tile, 2);
+ SetBottomTile(0x4026, tile, 1);
sub_080001D0(0, tile + 64, 1);
}
break;
@@ -287,22 +287,22 @@ static void FurnitureInit(FurnitureEntity* this) {
case STAIRCASE:
super->collisionLayer = 1;
super->spriteOrientation.flipY = 2;
- SetTile(0x4074, this->tile - 64, super->collisionLayer);
+ SetBottomTile(0x4074, this->tile - 64, super->collisionLayer);
sub_080001D0(63, this->tile - 64, super->collisionLayer);
- SetTile(0x4017, this->tile, super->collisionLayer);
- SetTile(0x4017, this->tile + 64, super->collisionLayer);
+ SetBottomTile(0x4017, this->tile, super->collisionLayer);
+ SetBottomTile(0x4017, this->tile + 64, super->collisionLayer);
break;
case MINISH_CHEESE:
if (super->type2 != 0)
super->spriteOffsetX = -4;
break;
case WOODEN_TABLE:
- SetTile(0x4023, this->tile - 65, super->collisionLayer);
- SetTile(0x4023, this->tile - 64, super->collisionLayer);
- SetTile(0x4023, this->tile - 63, super->collisionLayer);
+ SetBottomTile(0x4023, this->tile - 65, super->collisionLayer);
+ SetBottomTile(0x4023, this->tile - 64, super->collisionLayer);
+ SetBottomTile(0x4023, this->tile - 63, super->collisionLayer);
break;
case LOW_BOOKSHELF:
- SetTile(0x4022, this->tile + 65, super->collisionLayer);
+ SetBottomTile(0x4022, this->tile + 65, super->collisionLayer);
}
}
@@ -340,9 +340,9 @@ static void FurnitureUpdate(FurnitureEntity* this) {
case 0x80:
if (gPlayerEntity.base.y.HALF.HI < super->y.HALF.HI + 8) {
if (gPlayerState.floor_type != SURFACE_LADDER && GetTileTypeByEntity(super) == 0x4017) {
- SetTile(0x4026, this->tile, super->collisionLayer);
- SetTile(0x403D, this->tile - 64, super->collisionLayer);
- SetTile(0x403D, this->tile - 128, super->collisionLayer);
+ SetBottomTile(0x4026, this->tile, super->collisionLayer);
+ SetBottomTile(0x403D, this->tile - 64, super->collisionLayer);
+ SetBottomTile(0x403D, this->tile - 128, super->collisionLayer);
}
} else {
if (gPlayerEntity.base.collisionLayer & 2) {
@@ -350,9 +350,9 @@ static void FurnitureUpdate(FurnitureEntity* this) {
UpdateSpriteForCollisionLayer(&gPlayerEntity.base);
}
if (GetTileTypeByEntity(super) != 0x4017) {
- SetTile(0x4017, this->tile, super->collisionLayer);
- SetTile(0x4017, this->tile - 64, super->collisionLayer);
- SetTile(0x4014, this->tile - 128, super->collisionLayer);
+ SetBottomTile(0x4017, this->tile, super->collisionLayer);
+ SetBottomTile(0x4017, this->tile - 64, super->collisionLayer);
+ SetBottomTile(0x4014, this->tile - 128, super->collisionLayer);
}
}
break;
@@ -377,28 +377,28 @@ static void sub_08090B6C(FurnitureEntity* this) {
num = 2;
}
for (i = -num; i <= num; ++i) {
- SetTile(0x4022, tile + i, cl);
+ SetBottomTile(0x4022, tile + i, cl);
}
if (px & 8) {
sub_08090CDC(0x4024, tile - i, cl);
sub_08090CDC(0x4025, tile + i, cl);
} else {
- SetTile(0x4022, tile - i, cl);
+ SetBottomTile(0x4022, tile - i, cl);
}
break;
case 1:
num = w2 / 8;
for (i = -num; i <= num; i++) {
- SetTile(0x4022, tile + i, cl);
+ SetBottomTile(0x4022, tile + i, cl);
}
if (px & 8) {
sub_08090CDC(0x4024, tile - i, cl);
if (i != 0) {
- SetTile(0x4022, tile + i, cl);
+ SetBottomTile(0x4022, tile + i, cl);
}
} else {
if (i != 0) {
- SetTile(0x4022, tile - i, cl);
+ SetBottomTile(0x4022, tile - i, cl);
}
sub_08090CDC(0x4025, tile + i, cl);
}
@@ -406,10 +406,10 @@ static void sub_08090B6C(FurnitureEntity* this) {
case 2:
num = w2 / 4;
for (i = -num; i < num; ++i) {
- SetTile(0x4022, tile + i, cl);
+ SetBottomTile(0x4022, tile + i, cl);
}
if (px & 8) {
- SetTile(0x4022, tile + i, cl);
+ SetBottomTile(0x4022, tile + i, cl);
} else {
sub_08090CDC(0x4024, tile - i - 1, cl);
sub_08090CDC(0x4025, tile + i, cl);
@@ -418,7 +418,7 @@ static void sub_08090B6C(FurnitureEntity* this) {
case 3:
num = w2 / 4;
for (i = -num; i <= num; ++i) {
- SetTile(0x4022, tile + i, cl);
+ SetBottomTile(0x4022, tile + i, cl);
}
if (px & 8) {
sub_08090CDC(0x4025, tile + i, cl);
@@ -436,7 +436,7 @@ static void sub_08090CDC(u32 id, u32 pos, u32 layer) {
u32 id2;
if ((cur & 0x4000) == 0) {
- SetTile(id, pos, layer);
+ SetBottomTile(id, pos, layer);
} else {
switch (cur) {
case 0x4025:
@@ -474,7 +474,7 @@ static void sub_08090CDC(u32 id, u32 pos, u32 layer) {
default:
return;
}
- SetTile(next, pos, layer);
+ SetBottomTile(next, pos, layer);
}
}
diff --git a/src/object/gentariCurtain.c b/src/object/gentariCurtain.c
index d980d400..a4c5e2a6 100644
--- a/src/object/gentariCurtain.c
+++ b/src/object/gentariCurtain.c
@@ -59,8 +59,8 @@ void GentariCurtain_Init(GentariCurtainEntity* this) {
this->tile2 = COORD_TO_TILE_OFFSET(super, 0, -8);
this->tileIndex = GetTileIndex(this->tile, 1);
this->tileIndex2 = GetTileIndex(this->tile2, 1);
- SetTile(0x4022, this->tile, 1);
- SetTile(0x4022, this->tile2, 1);
+ SetBottomTile(0x4022, this->tile, 1);
+ SetBottomTile(0x4022, this->tile2, 1);
InitAnimationForceUpdate(super, 0);
} else {
super->action = 1;
@@ -80,8 +80,8 @@ void GentariCurtain_Action2(GentariCurtainEntity* this) {
UpdateAnimationSingleFrame(super);
if ((super->frame & ANIM_DONE) != 0) {
super->action = 3;
- SetTile(this->tileIndex, this->tile, 1);
- SetTile(this->tileIndex2, this->tile2, 1);
+ SetBottomTile(this->tileIndex, this->tile, 1);
+ SetBottomTile(this->tileIndex2, this->tile2, 1);
sub_08092214(this);
sub_0809223C(this);
InitAnimationForceUpdate(super, 1);
diff --git a/src/object/giantBookLadder.c b/src/object/giantBookLadder.c
index 1553723b..fb808a1b 100644
--- a/src/object/giantBookLadder.c
+++ b/src/object/giantBookLadder.c
@@ -50,33 +50,33 @@ void sub_0808E55C(GiantBookLadderEntity* this) {
case 2:
position = this->unk74;
unaff_r9 = position - 0x101;
- SetTile(0x408f, unaff_r9, super->collisionLayer);
- SetTile(0x408f, position - 0x100, super->collisionLayer);
- SetTile(0x406c, position - 0x102, super->collisionLayer);
- SetTile(0x406d, position - 0xff, super->collisionLayer);
+ SetBottomTile(0x408f, unaff_r9, super->collisionLayer);
+ SetBottomTile(0x408f, position - 0x100, super->collisionLayer);
+ SetBottomTile(0x406c, position - 0x102, super->collisionLayer);
+ SetBottomTile(0x406d, position - 0xff, super->collisionLayer);
type = super->type;
uVar5 = 6;
if (type != 0) {
uVar5 = 4;
- SetTile(0x4072, position + 0x3f, super->collisionLayer);
- SetTile(0x4072, position + 0x40, super->collisionLayer);
- SetTile(0x4072, position + 0x7f, super->collisionLayer);
- SetTile(0x4072, position + 0x80, super->collisionLayer);
+ SetBottomTile(0x4072, position + 0x3f, super->collisionLayer);
+ SetBottomTile(0x4072, position + 0x40, super->collisionLayer);
+ SetBottomTile(0x4072, position + 0x7f, super->collisionLayer);
+ SetBottomTile(0x4072, position + 0x80, super->collisionLayer);
}
break;
case 1:
position = this->unk74;
unaff_r9 = position - 1;
- SetTile(0x408e, unaff_r9, super->collisionLayer);
- SetTile(0x408e, position, super->collisionLayer);
+ SetBottomTile(0x408e, unaff_r9, super->collisionLayer);
+ SetBottomTile(0x408e, position, super->collisionLayer);
uVar5 = 2;
break;
}
for (uVar4 = 0; uVar4 < uVar5; uVar4++) {
unaff_r9 += 0x40;
- SetTile(0x408e, unaff_r9, super->collisionLayer);
- SetTile(0x408e, unaff_r9 + 1, super->collisionLayer);
+ SetBottomTile(0x408e, unaff_r9, super->collisionLayer);
+ SetBottomTile(0x408e, unaff_r9 + 1, super->collisionLayer);
}
}
diff --git a/src/object/giantLeaf.c b/src/object/giantLeaf.c
index 5c6b1d3c..3ef82f75 100644
--- a/src/object/giantLeaf.c
+++ b/src/object/giantLeaf.c
@@ -35,6 +35,6 @@ void sub_0808D618(Entity* this) {
((((this->y.HALF.HI - gRoomControls.origin_y) >> 4) & 0x3F) * 64);
for (i = 0; i < 13; i++) {
- SetTile(16500, tilePos + arr[i], 1);
+ SetBottomTile(16500, tilePos + arr[i], 1);
}
}
diff --git a/src/object/giantRock2.c b/src/object/giantRock2.c
index 2f5765da..4370663b 100644
--- a/src/object/giantRock2.c
+++ b/src/object/giantRock2.c
@@ -38,10 +38,10 @@ void GiantRock2_Init(GiantRock2Entity* this) {
position = (this->tile - 0x80);
tileIndex = 0x4022;
for (index = 4; index > -1; index--) {
- SetTile(tileIndex, position - 2, collisionLayer);
- SetTile(tileIndex, position - 1, collisionLayer);
- SetTile(tileIndex, position, collisionLayer);
- SetTile(tileIndex, position + 1, collisionLayer);
+ SetBottomTile(tileIndex, position - 2, collisionLayer);
+ SetBottomTile(tileIndex, position - 1, collisionLayer);
+ SetBottomTile(tileIndex, position, collisionLayer);
+ SetBottomTile(tileIndex, position + 1, collisionLayer);
position += 0x40;
}
}
diff --git a/src/object/giantTwig.c b/src/object/giantTwig.c
index 62deab7a..a308adf0 100644
--- a/src/object/giantTwig.c
+++ b/src/object/giantTwig.c
@@ -155,7 +155,7 @@ void sub_08093984(GiantTwigEntity* this) {
}
for (index = 0; index < 0x13; index++) {
- SetTile(0x4074, array[index] + this->tilePosition, 1);
+ SetBottomTile(0x4074, array[index] + this->tilePosition, 1);
}
}
@@ -174,47 +174,47 @@ void GiantTwig_Type3Idle(GiantTwigEntity* this) {
void sub_08093A1C(GiantTwigEntity* this) {
switch (super->type) {
case 0:
- SetTile(0x4024, this->tilePosition + 0x3c, super->collisionLayer);
- SetTile(0x4022, this->tilePosition + 0x3d, super->collisionLayer);
- SetTile(0x4022, this->tilePosition + 0x3e, super->collisionLayer);
- SetTile(0x4029, this->tilePosition + 0x7c, super->collisionLayer);
- SetTile(0x4026, this->tilePosition + 0x7d, super->collisionLayer);
- SetTile(0x4026, this->tilePosition + 0x7e, super->collisionLayer);
- SetTile(0x403d, this->tilePosition + 0x40, super->collisionLayer);
- SetTile(0x403d, this->tilePosition + 0x80, super->collisionLayer);
- SetTile(0x4027, this->tilePosition + 0x41, super->collisionLayer);
- SetTile(0x4023, this->tilePosition + 0x42, super->collisionLayer);
- SetTile(0x406d, this->tilePosition + 0x43, super->collisionLayer);
- SetTile(0x4029, this->tilePosition + 0x81, super->collisionLayer);
- SetTile(0x4026, this->tilePosition + 0x82, super->collisionLayer);
- SetTile(0x4026, this->tilePosition + 0x83, super->collisionLayer);
+ SetBottomTile(0x4024, this->tilePosition + 0x3c, super->collisionLayer);
+ SetBottomTile(0x4022, this->tilePosition + 0x3d, super->collisionLayer);
+ SetBottomTile(0x4022, this->tilePosition + 0x3e, super->collisionLayer);
+ SetBottomTile(0x4029, this->tilePosition + 0x7c, super->collisionLayer);
+ SetBottomTile(0x4026, this->tilePosition + 0x7d, super->collisionLayer);
+ SetBottomTile(0x4026, this->tilePosition + 0x7e, super->collisionLayer);
+ SetBottomTile(0x403d, this->tilePosition + 0x40, super->collisionLayer);
+ SetBottomTile(0x403d, this->tilePosition + 0x80, super->collisionLayer);
+ SetBottomTile(0x4027, this->tilePosition + 0x41, super->collisionLayer);
+ SetBottomTile(0x4023, this->tilePosition + 0x42, super->collisionLayer);
+ SetBottomTile(0x406d, this->tilePosition + 0x43, super->collisionLayer);
+ SetBottomTile(0x4029, this->tilePosition + 0x81, super->collisionLayer);
+ SetBottomTile(0x4026, this->tilePosition + 0x82, super->collisionLayer);
+ SetBottomTile(0x4026, this->tilePosition + 0x83, super->collisionLayer);
break;
case 1:
if ((super->type2 & 1) != 0) {
- SetTile(0x406d, this->tilePosition - 0x81, super->collisionLayer);
- SetTile(0x4022, this->tilePosition - 0x41, super->collisionLayer);
- SetTile(0x4029, this->tilePosition - 2, super->collisionLayer);
- SetTile(0x4026, this->tilePosition - 1, super->collisionLayer);
- SetTile(0x4022, this->tilePosition, super->collisionLayer);
- SetTile(0x406d, this->tilePosition + 1, super->collisionLayer);
- SetTile(0x406e, this->tilePosition + 0x40, super->collisionLayer);
- SetTile(0x4022, this->tilePosition + 0x41, super->collisionLayer);
- SetTile(0x406d, this->tilePosition + 0x42, super->collisionLayer);
+ SetBottomTile(0x406d, this->tilePosition - 0x81, super->collisionLayer);
+ SetBottomTile(0x4022, this->tilePosition - 0x41, super->collisionLayer);
+ SetBottomTile(0x4029, this->tilePosition - 2, super->collisionLayer);
+ SetBottomTile(0x4026, this->tilePosition - 1, super->collisionLayer);
+ SetBottomTile(0x4022, this->tilePosition, super->collisionLayer);
+ SetBottomTile(0x406d, this->tilePosition + 1, super->collisionLayer);
+ SetBottomTile(0x406e, this->tilePosition + 0x40, super->collisionLayer);
+ SetBottomTile(0x4022, this->tilePosition + 0x41, super->collisionLayer);
+ SetBottomTile(0x406d, this->tilePosition + 0x42, super->collisionLayer);
} else {
- SetTile(0x406c, this->tilePosition - 0x7f, super->collisionLayer);
- SetTile(0x4022, this->tilePosition - 0x3f, super->collisionLayer);
- SetTile(0x406c, this->tilePosition - 1, super->collisionLayer);
- SetTile(0x4022, this->tilePosition, super->collisionLayer);
- SetTile(0x4026, this->tilePosition + 1, super->collisionLayer);
- SetTile(0x402a, this->tilePosition + 2, super->collisionLayer);
- SetTile(0x406c, this->tilePosition + 0x3e, super->collisionLayer);
- SetTile(0x4022, this->tilePosition + 0x3f, super->collisionLayer);
- SetTile(0x406f, this->tilePosition + 0x40, super->collisionLayer);
+ SetBottomTile(0x406c, this->tilePosition - 0x7f, super->collisionLayer);
+ SetBottomTile(0x4022, this->tilePosition - 0x3f, super->collisionLayer);
+ SetBottomTile(0x406c, this->tilePosition - 1, super->collisionLayer);
+ SetBottomTile(0x4022, this->tilePosition, super->collisionLayer);
+ SetBottomTile(0x4026, this->tilePosition + 1, super->collisionLayer);
+ SetBottomTile(0x402a, this->tilePosition + 2, super->collisionLayer);
+ SetBottomTile(0x406c, this->tilePosition + 0x3e, super->collisionLayer);
+ SetBottomTile(0x4022, this->tilePosition + 0x3f, super->collisionLayer);
+ SetBottomTile(0x406f, this->tilePosition + 0x40, super->collisionLayer);
return;
}
break;
case 3:
- SetTile(0x4022, this->tilePosition, super->collisionLayer);
+ SetBottomTile(0x4022, this->tilePosition, super->collisionLayer);
break;
}
}
@@ -223,12 +223,12 @@ void sub_08093C70(GiantTwigEntity* this) {
if (this->unk_78 != 0) {
if (gPlayerState.heldObject != 0) {
this->unk_78 = 0;
- SetTile(0x4022, this->tilePosition + 0x3f, super->collisionLayer);
- SetTile(0x4022, this->tilePosition + 0x40, super->collisionLayer);
- SetTile(0x4022, this->tilePosition + 0x41, super->collisionLayer);
- SetTile(0x4026, this->tilePosition + 0x7f, super->collisionLayer);
- SetTile(0x4026, this->tilePosition + 0x80, super->collisionLayer);
- SetTile(0x4026, this->tilePosition + 0x81, super->collisionLayer);
+ SetBottomTile(0x4022, this->tilePosition + 0x3f, super->collisionLayer);
+ SetBottomTile(0x4022, this->tilePosition + 0x40, super->collisionLayer);
+ SetBottomTile(0x4022, this->tilePosition + 0x41, super->collisionLayer);
+ SetBottomTile(0x4026, this->tilePosition + 0x7f, super->collisionLayer);
+ SetBottomTile(0x4026, this->tilePosition + 0x80, super->collisionLayer);
+ SetBottomTile(0x4026, this->tilePosition + 0x81, super->collisionLayer);
}
} else {
@@ -236,12 +236,12 @@ void sub_08093C70(GiantTwigEntity* this) {
if (--this->unk_7a == 0) {
this->unk_78++;
this->unk_7a = 0x3c;
- SetTile(0x403d, this->tilePosition + 0x3f, super->collisionLayer);
- SetTile(0x403d, this->tilePosition + 0x40, super->collisionLayer);
- SetTile(0x4027, this->tilePosition + 0x41, super->collisionLayer);
- SetTile(0x403d, this->tilePosition + 0x7f, super->collisionLayer);
- SetTile(0x403d, this->tilePosition + 0x80, super->collisionLayer);
- SetTile(0x4029, this->tilePosition + 0x81, super->collisionLayer);
+ SetBottomTile(0x403d, this->tilePosition + 0x3f, super->collisionLayer);
+ SetBottomTile(0x403d, this->tilePosition + 0x40, super->collisionLayer);
+ SetBottomTile(0x4027, this->tilePosition + 0x41, super->collisionLayer);
+ SetBottomTile(0x403d, this->tilePosition + 0x7f, super->collisionLayer);
+ SetBottomTile(0x403d, this->tilePosition + 0x80, super->collisionLayer);
+ SetBottomTile(0x4029, this->tilePosition + 0x81, super->collisionLayer);
}
}
}
diff --git a/src/object/jarPortal.c b/src/object/jarPortal.c
index f2e4f852..cd77b956 100644
--- a/src/object/jarPortal.c
+++ b/src/object/jarPortal.c
@@ -183,10 +183,10 @@ void sub_0808C148(JarPortalEntity* this, u32 a2) {
pos = COORD_TO_TILE(super);
if (!a2) {
- SetTile(16530, pos - 1, super->collisionLayer);
- SetTile(16531, pos, super->collisionLayer);
- SetTile(16532, pos + 63, super->collisionLayer);
- SetTile(16533, pos + 64, super->collisionLayer);
+ SetBottomTile(16530, pos - 1, super->collisionLayer);
+ SetBottomTile(16531, pos, super->collisionLayer);
+ SetBottomTile(16532, pos + 63, super->collisionLayer);
+ SetBottomTile(16533, pos + 64, super->collisionLayer);
} else {
RestorePrevTileEntity(pos - 1, super->collisionLayer);
RestorePrevTileEntity(pos, super->collisionLayer);
diff --git a/src/object/ladderUp.c b/src/object/ladderUp.c
index cfdadfb9..7bd66824 100644
--- a/src/object/ladderUp.c
+++ b/src/object/ladderUp.c
@@ -37,7 +37,7 @@ void LadderUp(Entity* this) {
return;
}
this->y.HALF.HI = (this->y.HALF.HI & 0xfff0) + 0xc;
- SetTile(0x4023, COORD_TO_TILE(this), this->collisionLayer);
+ SetBottomTile(0x4023, COORD_TO_TILE(this), this->collisionLayer);
break;
case 1:
if (GravityUpdate(this, Q_8_8(16.0)) == 0) {
@@ -66,16 +66,16 @@ void LadderUp(Entity* this) {
if (this->type2 == 0) {
if (gPlayerEntity.base.y.HALF.HI < this->y.HALF.HI) {
if (gPlayerState.floor_type != SURFACE_LADDER && (GetTileTypeByEntity(this) == 0x4017)) {
- SetTile(0x4023, COORD_TO_TILE(this), this->collisionLayer);
+ SetBottomTile(0x4023, COORD_TO_TILE(this), this->collisionLayer);
RestorePrevTileEntity(COORD_TO_TILE_OFFSET(this, 0, 0x10), this->collisionLayer);
}
} else {
if (GetTileTypeByEntity(this) != 0x4017) {
- SetTile(0x4017, COORD_TO_TILE(this), this->collisionLayer);
+ SetBottomTile(0x4017, COORD_TO_TILE(this), this->collisionLayer);
if (this->type == 0) {
- SetTile(0x4017, COORD_TO_TILE_OFFSET(this, 0, 0x10), this->collisionLayer);
+ SetBottomTile(0x4017, COORD_TO_TILE_OFFSET(this, 0, 0x10), this->collisionLayer);
} else {
- SetTile(0x4014, COORD_TO_TILE_OFFSET(this, 0, 0x10), this->collisionLayer);
+ SetBottomTile(0x4014, COORD_TO_TILE_OFFSET(this, 0, 0x10), this->collisionLayer);
}
}
}
diff --git a/src/object/lightDoor.c b/src/object/lightDoor.c
index e128c65c..5062c26f 100644
--- a/src/object/lightDoor.c
+++ b/src/object/lightDoor.c
@@ -87,13 +87,13 @@ void LightDoor_Action4(LightDoorEntity* this) {
void sub_080850FC(LightDoorEntity* this) {
u32 position = COORD_TO_TILE(super);
u32 layer = super->collisionLayer;
- SetTile(0x403d, position - 0x41, layer);
- SetTile(0x403d, position - 0x40, layer);
- SetTile(0x403d, position - 0x3f, layer);
- SetTile(0x403d, position - 1, layer);
- SetTile(0x403d, position, layer);
- SetTile(0x403d, position + 1, layer);
- SetTile(0x403d, position + 0x3f, layer);
- SetTile(0x403d, position + 0x40, layer);
- SetTile(0x403d, position + 0x41, layer);
+ SetBottomTile(0x403d, position - 0x41, layer);
+ SetBottomTile(0x403d, position - 0x40, layer);
+ SetBottomTile(0x403d, position - 0x3f, layer);
+ SetBottomTile(0x403d, position - 1, layer);
+ SetBottomTile(0x403d, position, layer);
+ SetBottomTile(0x403d, position + 1, layer);
+ SetBottomTile(0x403d, position + 0x3f, layer);
+ SetBottomTile(0x403d, position + 0x40, layer);
+ SetBottomTile(0x403d, position + 0x41, layer);
}
diff --git a/src/object/lightableSwitch.c b/src/object/lightableSwitch.c
index 8c68f708..06bb3244 100644
--- a/src/object/lightableSwitch.c
+++ b/src/object/lightableSwitch.c
@@ -99,7 +99,7 @@ static void sub_0809EAD8(LightableSwitchEntity* this) {
UpdateRailMovement(super, (u16**)&super->child, &this->unk_74);
} else {
- SetTile(0x4050, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(0x4050, COORD_TO_TILE(super), super->collisionLayer);
}
}
diff --git a/src/object/lilypadLarge.c b/src/object/lilypadLarge.c
index 9bc15399..b4bd9c60 100644
--- a/src/object/lilypadLarge.c
+++ b/src/object/lilypadLarge.c
@@ -329,10 +329,10 @@ void LilypadLarge_Action2(LilypadLargeEntity* this) {
void sub_08085A44(LilypadLargeEntity* this) {
super->speed = 0x200;
- if (GetRelativeCollisionTile(super, 0x10, 0x18) != 0x11) {
+ if (GetActTileRelative(super, 0x10, 0x18) != 0x11) {
super->direction = 0x18;
} else {
- if (GetRelativeCollisionTile(super, -0x10, 0x18) != 0x11) {
+ if (GetActTileRelative(super, -0x10, 0x18) != 0x11) {
super->direction = 8;
} else {
super->direction = 0x10;
@@ -353,7 +353,7 @@ void sub_08085A98(LilypadLargeEntity* this) {
this->unk_78.WORD -= 0x20000;
SetAffineInfo(super, this->unk_78.HALF_U.HI, this->unk_78.HALF_U.HI, this->unk_7c.HALF_U.HI);
}
- if (GetRelativeCollisionTile(super, 0, 0x18) != 0x11) {
+ if (GetActTileRelative(super, 0, 0x18) != 0x11) {
super->subAction = 2;
if (gArea.locationIndex == 0x1b) {
super->y.HALF.HI += 0xd0;
@@ -456,7 +456,7 @@ void LilypadLarge_Action5(LilypadLargeEntity* this) {
void sub_08085D28(LilypadLargeEntity* this) {
if (((gPlayerState.framestate != PL_STATE_TALKEZLO) && ((gPlayerState.flags & PL_FLAGS2) != 0)) &&
- (GetRelativeCollisionTile(super, 0, 0x18) == 0x11)) {
+ (GetActTileRelative(super, 0, 0x18) == 0x11)) {
super->action = 2;
super->subAction = 0;
PausePlayer();
diff --git a/src/object/linkEmptyingBottle.c b/src/object/linkEmptyingBottle.c
index e3b77637..0c47f3a8 100644
--- a/src/object/linkEmptyingBottle.c
+++ b/src/object/linkEmptyingBottle.c
@@ -118,8 +118,8 @@ void sub_08094980(LinkEmptyingBottleEntity* this, u32 searchTileIndex, u32 repla
xOffset = gUnk_08122A28[index];
yOffset = gUnk_08122A28[index + 1];
if (searchTileIndex == sub_080B1A0C(super, xOffset, yOffset)) {
- SetTile(replaceTileIndex, TILE(super->x.HALF.HI + xOffset, super->y.HALF.HI + yOffset),
- super->collisionLayer);
+ SetBottomTile(replaceTileIndex, TILE(super->x.HALF.HI + xOffset, super->y.HALF.HI + yOffset),
+ super->collisionLayer);
}
index += 2;
}
diff --git a/src/object/lockedDoor.c b/src/object/lockedDoor.c
index d7f089a2..8f4bcbc3 100644
--- a/src/object/lockedDoor.c
+++ b/src/object/lockedDoor.c
@@ -162,7 +162,7 @@ void LockedDoor_Action1(LockedDoorEntity* this) {
if (--super->timer == 0) {
super->action = 2;
super->timer = 7;
- SetTile(this->unk_74, this->unk_76, super->collisionLayer);
+ SetBottomTile(this->unk_74, this->unk_76, super->collisionLayer);
EnqueueSFX(SFX_10B);
}
}
@@ -262,12 +262,12 @@ void sub_080836A0(LockedDoorEntity* this) {
super->spriteSettings.draw = 1;
super->x.HALF.HI = this->unk_70;
super->y.HALF.HI = this->unk_72;
- SetTile(0x4022, this->unk_76, super->collisionLayer);
+ SetBottomTile(0x4022, this->unk_76, super->collisionLayer);
}
void sub_080836DC(Entity* this, u32 unk_0, u32 unk_1) {
const struct_0811F680* tmp;
- SetTile(0x4022, unk_1, this->collisionLayer);
+ SetBottomTile(0x4022, unk_1, this->collisionLayer);
this->timer = 7;
this->spriteSettings.draw = 1;
this->direction = (unk_0 << 3) ^ DirectionSouth;
diff --git a/src/object/macroAcorn.c b/src/object/macroAcorn.c
index a7f32871..4997cb1f 100644
--- a/src/object/macroAcorn.c
+++ b/src/object/macroAcorn.c
@@ -74,38 +74,38 @@ void sub_0809E5F0(MacroAcornEntity* this) {
this->unk_80 = position;
switch (super->type) {
case 2:
- SetTile(0x4022, position - 0x3d, 1);
- SetTile(0x406d, position - 0x3c, 1);
+ SetBottomTile(0x4022, position - 0x3d, 1);
+ SetBottomTile(0x406d, position - 0x3c, 1);
case 0:
- SetTile(0x406c, position - 0x42, 1);
- SetTile(0x4022, position - 0x41, 1);
- SetTile(0x4022, position - 0x40, 1);
- SetTile(0x4022, position - 0x3f, 1);
- SetTile(0x4022, position - 2, 1);
- SetTile(0x4022, position - 1, 1);
- SetTile(0x4022, position, 1);
- SetTile(0x4022, position + 1, 1);
- SetTile(0x406e, position + 0x3e, 1);
- SetTile(0x4022, position + 0x3f, 1);
- SetTile(0x4022, position + 0x40, 1);
- SetTile(0x406f, position + 0x41, 1);
+ SetBottomTile(0x406c, position - 0x42, 1);
+ SetBottomTile(0x4022, position - 0x41, 1);
+ SetBottomTile(0x4022, position - 0x40, 1);
+ SetBottomTile(0x4022, position - 0x3f, 1);
+ SetBottomTile(0x4022, position - 2, 1);
+ SetBottomTile(0x4022, position - 1, 1);
+ SetBottomTile(0x4022, position, 1);
+ SetBottomTile(0x4022, position + 1, 1);
+ SetBottomTile(0x406e, position + 0x3e, 1);
+ SetBottomTile(0x4022, position + 0x3f, 1);
+ SetBottomTile(0x4022, position + 0x40, 1);
+ SetBottomTile(0x406f, position + 0x41, 1);
break;
case 3:
- SetTile(0x4022, position - 0x44, 1);
- SetTile(0x406c, position - 0x45, 1);
+ SetBottomTile(0x4022, position - 0x44, 1);
+ SetBottomTile(0x406c, position - 0x45, 1);
case 1:
- SetTile(0x4022, position - 0x42, 1);
- SetTile(0x4022, position - 0x41, 1);
- SetTile(0x4022, position - 0x40, 1);
- SetTile(0x406d, position - 0x3f, 1);
- SetTile(0x4022, position - 2, 1);
- SetTile(0x4022, position - 1, 1);
- SetTile(0x4022, position, 1);
- SetTile(0x4022, position + 1, 1);
- SetTile(0x406e, position + 0x3e, 1);
- SetTile(0x4022, position + 0x3f, 1);
- SetTile(0x4022, position + 0x40, 1);
- SetTile(0x406f, position + 0x41, 1);
+ SetBottomTile(0x4022, position - 0x42, 1);
+ SetBottomTile(0x4022, position - 0x41, 1);
+ SetBottomTile(0x4022, position - 0x40, 1);
+ SetBottomTile(0x406d, position - 0x3f, 1);
+ SetBottomTile(0x4022, position - 2, 1);
+ SetBottomTile(0x4022, position - 1, 1);
+ SetBottomTile(0x4022, position, 1);
+ SetBottomTile(0x4022, position + 1, 1);
+ SetBottomTile(0x406e, position + 0x3e, 1);
+ SetBottomTile(0x4022, position + 0x3f, 1);
+ SetBottomTile(0x4022, position + 0x40, 1);
+ SetBottomTile(0x406f, position + 0x41, 1);
break;
}
}
diff --git a/src/object/macroBook.c b/src/object/macroBook.c
index c0cb253e..0fe65615 100644
--- a/src/object/macroBook.c
+++ b/src/object/macroBook.c
@@ -150,7 +150,7 @@ void sub_0809A958(MacroBookEntity* this) {
for (index = 0; index < 5; index++, tilePos += 0x40) {
for (index2 = 0; index2 < 4; index2++, tileIndexPtr++) {
if ((*tileIndexPtr & 0x4000) != 0) {
- SetTile(*tileIndexPtr, tilePos + index2, 1);
+ SetBottomTile(*tileIndexPtr, tilePos + index2, 1);
}
}
}
diff --git a/src/object/macroDecorations.c b/src/object/macroDecorations.c
index 4e886ae0..c6142185 100644
--- a/src/object/macroDecorations.c
+++ b/src/object/macroDecorations.c
@@ -87,7 +87,7 @@ void sub_08097EB8(MacroDecorationEntity* this) {
const s16* tilePosPtr;
u16 tile = COORD_TO_TILE(super);
for (tilePosPtr = tilePosArray; *tilePosPtr != 0x7fff; tilePosPtr += 2) {
- SetTile((u16)tilePosPtr[1], tile + tilePosPtr[0], 1);
+ SetBottomTile((u16)tilePosPtr[1], tile + tilePosPtr[0], 1);
}
}
diff --git a/src/object/macroShoe.c b/src/object/macroShoe.c
index 2d4b5ac2..574fcf20 100644
--- a/src/object/macroShoe.c
+++ b/src/object/macroShoe.c
@@ -39,9 +39,9 @@ void MacroShoe_Init(Entity* this) {
this->action = 1;
this->hitbox = (Hitbox*)MacroShoe_TypeHitboxes[this->type];
if (this->type2 == 1) {
- SetTile(0x4024, 0x410, 1);
- SetTile(0x4026, 0x411, 1);
- SetTile(0x4025, 0x412, 1);
+ SetBottomTile(0x4024, 0x410, 1);
+ SetBottomTile(0x4026, 0x411, 1);
+ SetBottomTile(0x4025, 0x412, 1);
}
}
diff --git a/src/object/mask.c b/src/object/mask.c
index 46cfdb9e..e517a8bb 100644
--- a/src/object/mask.c
+++ b/src/object/mask.c
@@ -74,7 +74,7 @@ void Mask_Init(MaskEntity* this) {
this->unk_7a = sub_080B1B44(this->unk_7e, 1);
- SetTile(0x4022, this->unk_7e, 1);
+ SetBottomTile(0x4022, this->unk_7e, 1);
}
// Probably related to knocking it down
@@ -99,7 +99,7 @@ void Mask_Action1(MaskEntity* this) {
}
// Presumably, make the mask fall
- SetTile(this->unk_7c, this->unk_7e, 1);
+ SetBottomTile(this->unk_7c, this->unk_7e, 1);
sub_08000148(this->unk_7a, this->unk_7e, 1);
diff --git a/src/object/metalDoor.c b/src/object/metalDoor.c
index 0c7fbfd0..c0bbc874 100644
--- a/src/object/metalDoor.c
+++ b/src/object/metalDoor.c
@@ -118,13 +118,13 @@ void sub_080A080C(MetalDoorEntity* this) {
this->unk_76 = GetTileIndex(this->unk_74 - 1, super->collisionLayer);
this->unk_78 = GetTileIndex(this->unk_74, super->collisionLayer);
this->unk_7a = GetTileIndex(this->unk_74 + 1, super->collisionLayer);
- SetTile(0x4022, this->unk_74 - 1, super->collisionLayer);
- SetTile(0x4022, this->unk_74, super->collisionLayer);
- SetTile(0x4022, this->unk_74 + 1, super->collisionLayer);
+ SetBottomTile(0x4022, this->unk_74 - 1, super->collisionLayer);
+ SetBottomTile(0x4022, this->unk_74, super->collisionLayer);
+ SetBottomTile(0x4022, this->unk_74 + 1, super->collisionLayer);
}
void sub_080A0870(MetalDoorEntity* this) {
- SetTile(this->unk_76, this->unk_74 - 1, super->collisionLayer);
- SetTile(this->unk_78, this->unk_74, super->collisionLayer);
- SetTile(this->unk_7a, this->unk_74 + 1, super->collisionLayer);
+ SetBottomTile(this->unk_76, this->unk_74 - 1, super->collisionLayer);
+ SetBottomTile(this->unk_78, this->unk_74, super->collisionLayer);
+ SetBottomTile(this->unk_7a, this->unk_74 + 1, super->collisionLayer);
}
diff --git a/src/object/minecart.c b/src/object/minecart.c
index 64fb239d..b13f2c7e 100644
--- a/src/object/minecart.c
+++ b/src/object/minecart.c
@@ -59,7 +59,7 @@ void Minecart_Init(MinecartEntity* this) {
super->speed = 0x700;
super->spritePriority.b1 = 3;
InitAnimationForceUpdate(super, super->type2 + 4 + super->animationState);
- SetTile(0x4022, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(0x4022, COORD_TO_TILE(super), super->collisionLayer);
}
void Minecart_Action1(MinecartEntity* this) {
@@ -163,9 +163,9 @@ void Minecart_Action3(MinecartEntity* this) {
super->subtimer = 60;
}
- uVar3 = GetRelativeCollisionTile(super, gUnk_081223C8[super->animationState * 2],
- gUnk_081223C8[super->animationState * 2 + 1]);
- iVar2 = sub_08007DD6(uVar3, gUnk_081223D8[super->animationState]);
+ uVar3 = GetActTileRelative(super, gUnk_081223C8[super->animationState * 2],
+ gUnk_081223C8[super->animationState * 2 + 1]);
+ iVar2 = ActTileToTile(uVar3, gUnk_081223D8[super->animationState]);
if (iVar2 == 0) {
super->direction = DirectionTurnAround(super->direction);
super->animationState = AnimationStateFlip90(super->animationState);
@@ -290,7 +290,7 @@ void Minecart_Action6(MinecartEntity* this) {
minecartData->room = gRoomControls.room;
minecartData->animationState = super->animationState;
InitAnimationForceUpdate(super, super->animationState + 0x10);
- SetTile(0x4022, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(0x4022, COORD_TO_TILE(super), super->collisionLayer);
} else {
UpdateAnimationSingleFrame(super);
gPlayerEntity.base.spritePriority.b0 = super->spritePriority.b0 - 1;
diff --git a/src/object/minecartDoor.c b/src/object/minecartDoor.c
index 6c70abd8..c74e1109 100644
--- a/src/object/minecartDoor.c
+++ b/src/object/minecartDoor.c
@@ -63,7 +63,7 @@ void MinecartDoor_Init(MinecartDoorEntity* this) {
} else {
super->action = 1;
super->spriteSettings.draw = 1;
- SetTile(0x4022, this->unk_76, super->collisionLayer);
+ SetBottomTile(0x4022, this->unk_76, super->collisionLayer);
}
}
}
@@ -73,7 +73,7 @@ void MinecartDoor_Action1(MinecartDoorEntity* this) {
super->action = 2;
super->timer = 7;
super->direction = super->type << 3;
- SetTile(this->unk_74, this->unk_76, super->collisionLayer);
+ SetBottomTile(this->unk_74, this->unk_76, super->collisionLayer);
EnqueueSFX(SFX_10B);
}
}
diff --git a/src/object/minishVillageObject.c b/src/object/minishVillageObject.c
index ef5c9780..a4a3e48c 100644
--- a/src/object/minishVillageObject.c
+++ b/src/object/minishVillageObject.c
@@ -83,7 +83,7 @@ void MinishVillageObject_Type1(Entity* this) {
this->subtimer = 0;
this->frameIndex = 0;
this->spritePriority.b0 = 7;
- SetTile(0x4069, COORD_TO_TILE(this) - 0x40, 1);
+ SetBottomTile(0x4069, COORD_TO_TILE(this) - 0x40, 1);
break;
case 2:
if ((gRoomTransition.frameCount & 3U) == 0) {
@@ -217,7 +217,7 @@ void MinishVillageObject_Type8_Init(Entity* this) {
if (this->type2 != 0) {
tilePosition -= 0x40;
}
- SetTile(0x4069, tilePosition, this->collisionLayer);
+ SetBottomTile(0x4069, tilePosition, this->collisionLayer);
}
}
@@ -230,7 +230,7 @@ void MinishVillageObject_Type8_Action1(Entity* this) {
this->timer = 8;
this->spriteRendering.alphaBlend = 0;
gScreen.controls.layerFXControl = 0;
- SetTile(0x4069, COORD_TO_TILE(this), this->collisionLayer);
+ SetBottomTile(0x4069, COORD_TO_TILE(this), this->collisionLayer);
}
}
}
diff --git a/src/object/object30.c b/src/object/object30.c
index 61b3448f..7d2acb49 100644
--- a/src/object/object30.c
+++ b/src/object/object30.c
@@ -40,7 +40,7 @@ void Object30_Init(Object30Entity* this) {
const u16* ptr;
switch (super->type) {
case 0:
- data = GetLayerByIndex(super->collisionLayer);
+ data = GetTileBuffer(super->collisionLayer);
ptr = &data->mapData[sub_0806F798(super)];
this->unk_6c = (u16*)ptr;
this->unk_68 = ptr[0];
diff --git a/src/object/object37.c b/src/object/object37.c
index 35f32e93..e0b08edc 100644
--- a/src/object/object37.c
+++ b/src/object/object37.c
@@ -34,7 +34,7 @@ void Object37(Entity* this) {
void Object37_Init(Object37Entity* this) {
u16* puVar1;
- puVar1 = GetLayerByIndex(super->collisionLayer)->mapData + sub_0806F798(super);
+ puVar1 = GetTileBuffer(super->collisionLayer)->mapData + sub_0806F798(super);
this->unk78 = puVar1;
this->unk70 = *puVar1;
super->action = 1;
diff --git a/src/object/objectBlockingStairs.c b/src/object/objectBlockingStairs.c
index b35f6777..83c6e976 100644
--- a/src/object/objectBlockingStairs.c
+++ b/src/object/objectBlockingStairs.c
@@ -133,23 +133,23 @@ void ObjectBlockingStairs_Action1(ObjectBlockingStairsEntity* this) {
if (this->unk7b & 0x80) {
this->unk7b &= ~0x80;
if ((this->unk7b & 0x40) != 0) {
- SetTile(0x402c, this->tilePos - 1, super->collisionLayer);
- SetTile(0x403d, this->tilePos + 1, super->collisionLayer);
+ SetBottomTile(0x402c, this->tilePos - 1, super->collisionLayer);
+ SetBottomTile(0x403d, this->tilePos + 1, super->collisionLayer);
} else {
- SetTile(0x403d, this->tilePos - 1, super->collisionLayer);
- SetTile(0x402d, this->tilePos + 1, super->collisionLayer);
+ SetBottomTile(0x403d, this->tilePos - 1, super->collisionLayer);
+ SetBottomTile(0x402d, this->tilePos + 1, super->collisionLayer);
}
} else if (this->unk7b & 0x40) {
if (xDist >= 5) {
this->unk7b &= ~(0x40 | 0x80);
- SetTile(0x403d, this->tilePos - 1, super->collisionLayer);
- SetTile(0x402d, this->tilePos + 1, super->collisionLayer);
+ SetBottomTile(0x403d, this->tilePos - 1, super->collisionLayer);
+ SetBottomTile(0x402d, this->tilePos + 1, super->collisionLayer);
}
} else {
if (-xDist > 4) {
this->unk7b |= 0x40;
- SetTile(0x402c, this->tilePos - 1, super->collisionLayer);
- SetTile(0x403d, this->tilePos + 1, super->collisionLayer);
+ SetBottomTile(0x402c, this->tilePos - 1, super->collisionLayer);
+ SetBottomTile(0x403d, this->tilePos + 1, super->collisionLayer);
}
}
}
@@ -223,7 +223,7 @@ void sub_080931A4(ObjectBlockingStairsEntity* this, u32 param_2) {
for (index = 0, iVar5 = 0; index < 9; index++) {
u32 pos = tilePos + iVar5 + index - 1;
- SetTile(pTileTypes[index], pos, collisionLayer);
+ SetBottomTile(pTileTypes[index], pos, collisionLayer);
switch (index) {
case 2:
iVar5 = 0x3d;
diff --git a/src/object/objectOnPillar.c b/src/object/objectOnPillar.c
index 98501c8e..f0525f1d 100644
--- a/src/object/objectOnPillar.c
+++ b/src/object/objectOnPillar.c
@@ -192,7 +192,7 @@ void sub_08097098(ObjectOnPillarEntity* this) {
u16 tileType;
this->unk_76 = 0x20;
EnqueueSFX(SFX_10F);
- SetTile(this->tileIndex, this->tilePosition, super->collisionLayer);
+ SetBottomTile(this->tileIndex, this->tilePosition, super->collisionLayer);
tileType = GetTileType(gUnk_080B4488[super->direction >> 3] + this->tilePosition, super->collisionLayer);
if ((tileType == 0x79) || tileType == 0x77) {
super->spriteOffsetY = 2;
@@ -202,7 +202,7 @@ void sub_08097098(ObjectOnPillarEntity* this) {
void sub_080970F4(ObjectOnPillarEntity* this) {
this->tilePosition = COORD_TO_TILE(super);
this->tileIndex = GetTileIndex(this->tilePosition, super->collisionLayer);
- SetTile(0x4036, this->tilePosition, super->collisionLayer);
+ SetBottomTile(0x4036, this->tilePosition, super->collisionLayer);
}
bool32 sub_08097144(ObjectOnPillarEntity* this) {
@@ -255,7 +255,7 @@ void sub_080971E0(ObjectOnPillarEntity* this) {
super->action = 4;
super->frameIndex = 1;
super->spritePriority.b0 = 7;
- SetTile(0, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(0, COORD_TO_TILE(super), super->collisionLayer);
DeleteThisEntity();
break;
case 1:
diff --git a/src/object/objectOnSpinyBeetle.c b/src/object/objectOnSpinyBeetle.c
index aa28ae96..aafecc5b 100644
--- a/src/object/objectOnSpinyBeetle.c
+++ b/src/object/objectOnSpinyBeetle.c
@@ -152,7 +152,7 @@ void ObjectOnSpinyBeetle_Action2Subaction2(ObjectOnSpinyBeetleEntity* this) {
}
void ObjectOnSpinyBeetle_Action2Subaction3(ObjectOnSpinyBeetleEntity* this) {
- switch (sub_080043E8(super)) {
+ switch (GetTileHazardType(super)) {
case 2:
CreateFx(super, FX_WATER_SPLASH, 0);
break;
diff --git a/src/object/palaceArchway.c b/src/object/palaceArchway.c
index 4f545bef..77ca2a74 100644
--- a/src/object/palaceArchway.c
+++ b/src/object/palaceArchway.c
@@ -22,7 +22,7 @@ void PalaceArchway_Init(Entity* this) {
this->frameIndex = this->type2;
this->spriteRendering.b3 = 3;
this->spritePriority.b0 = 7;
- SetTile(0x4069, COORD_TO_TILE(this), this->collisionLayer);
+ SetBottomTile(0x4069, COORD_TO_TILE(this), this->collisionLayer);
}
void PalaceArchway_Action1(Entity* this) {
diff --git a/src/object/paper.c b/src/object/paper.c
index 62e49ff7..541d86a5 100644
--- a/src/object/paper.c
+++ b/src/object/paper.c
@@ -40,7 +40,7 @@ void Paper_Type0(Entity* this) {
}
this->spriteSettings.draw = 0;
}
- SetTile(0x4051, COORD_TO_TILE(this), 1);
+ SetBottomTile(0x4051, COORD_TO_TILE(this), 1);
}
void Paper_Type1(Entity* this) {
@@ -60,8 +60,8 @@ void Paper_Type2(Entity* this) {
this->action = 1;
this->y.HALF.HI++;
this->spriteOffsetY = -1;
- SetTile(0x4051, COORD_TO_TILE(this) - 1, 1);
- SetTile(0x4051, COORD_TO_TILE(this), 1);
+ SetBottomTile(0x4051, COORD_TO_TILE(this) - 1, 1);
+ SetBottomTile(0x4051, COORD_TO_TILE(this), 1);
}
void Paper_Action1(Entity* this) {
diff --git a/src/object/playerClone.c b/src/object/playerClone.c
index a5e8bed4..c6e65188 100644
--- a/src/object/playerClone.c
+++ b/src/object/playerClone.c
@@ -51,7 +51,7 @@ void PlayerClone_Init(PlayerCloneEntity* this) {
super->y.HALF.HI = (super->y.HALF.HI & 0xfff0) | 8;
this->tilePos = COORD_TO_TILE(super);
InitializeAnimation(super, 8);
- SetTile(0x4016, this->tilePos, super->collisionLayer);
+ SetBottomTile(0x4016, this->tilePos, super->collisionLayer);
SoundReq(SFX_112);
}
@@ -109,7 +109,7 @@ void PlayerClone_Action2(PlayerCloneEntity* this) {
if (gPlayerEntity.base.iframes >= 1) {
gPlayerState.chargeState.action = 1;
} else {
- GetActTile(super);
+ GetActTile(super); // leftover from debugging?
sub_08084B1C(this);
super->x.HALF.HI = gPlayerEntity.base.x.HALF.HI + this->unk78;
super->y.HALF.HI = gPlayerEntity.base.y.HALF.HI + this->unk7a;
diff --git a/src/object/pot.c b/src/object/pot.c
index 0575dc87..3901820e 100644
--- a/src/object/pot.c
+++ b/src/object/pot.c
@@ -48,7 +48,7 @@ void sub_0808270C(PotEntity* this);
void sub_080826FC(PotEntity* this);
extern void RegisterCarryEntity(Entity*);
-extern void sub_08016A6C(Entity*);
+extern void CheckOnLayerTransition(Entity*);
void Pot(PotEntity* this) {
static void (*const Pot_Actions[])(PotEntity*) = {
@@ -83,7 +83,7 @@ void Pot_Init(PotEntity* this) {
DeleteThisEntity();
}
- SetTile(0x4000, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(0x4000, COORD_TO_TILE(super), super->collisionLayer);
InitializeAnimation(super, 5);
}
@@ -96,7 +96,7 @@ void Pot_Action1(PotEntity* this) {
super->subAction = 0;
break;
case 0x1D:
- SetTile((u16)this->unk_70, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile((u16)this->unk_70, COORD_TO_TILE(super), super->collisionLayer);
super->action = 5;
super->zVelocity = Q_16_16(2.625);
super->spriteOffsetY = 0;
@@ -120,11 +120,11 @@ void Pot_Action1(PotEntity* this) {
super->speed >>= 1;
super->timer = 64;
}
- SetTile((u16)this->unk_70, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile((u16)this->unk_70, COORD_TO_TILE(super), super->collisionLayer);
EnqueueSFX(SFX_10F);
break;
case 0x4067:
- SetTile((u16)this->unk_70, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile((u16)this->unk_70, COORD_TO_TILE(super), super->collisionLayer);
DeleteThisEntity();
break;
default:
@@ -132,7 +132,7 @@ void Pot_Action1(PotEntity* this) {
CreateFx(super, FX_FALL_DOWN, 0);
} else if (tileType == 0x4005) {
gPlayerState.lastSwordMove = SWORD_MOVE_BREAK_POT;
- SetTile((u16)this->unk_70, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile((u16)this->unk_70, COORD_TO_TILE(super), super->collisionLayer);
}
BreakPot(this, NULL);
break;
@@ -158,7 +158,7 @@ void sub_08082510(PotEntity* this) {
super->hitType = 1;
super->flags2 = gPlayerEntity.base.flags2;
super->spriteOffsetY = 0;
- SetTile((u16)this->unk_70, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile((u16)this->unk_70, COORD_TO_TILE(super), super->collisionLayer);
super->subAction++;
}
@@ -170,7 +170,7 @@ void sub_08082588(PotEntity* this) {
}
void sub_0808259C(PotEntity* this) {
- switch (sub_080043E8(super)) {
+ switch (GetTileHazardType(super)) {
case 2:
CreateFx(super, FX_WATER_SPLASH, 0);
break;
@@ -209,7 +209,7 @@ void Pot_Action4(PotEntity* this) {
sub_0800445C(super);
if (super->timer-- != 0) {
LinearMoveUpdate(super);
- sub_08016A6C(super);
+ CheckOnLayerTransition(super);
return;
}
@@ -230,7 +230,7 @@ void Pot_Action4(PotEntity* this) {
BreakPot(this, NULL);
break;
default:
- SetTile(0x4000, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(0x4000, COORD_TO_TILE(super), super->collisionLayer);
RegisterCarryEntity(super);
break;
}
@@ -253,7 +253,7 @@ void sub_0808270C(PotEntity* this) {
if ((gPlayerState.field_0x1c & 0xF) != 0x1 || (super->contactFlags & 0x7F) != 0x13) {
super->spriteOffsetX = 0;
super->action = 1;
- SetTile(0x4000, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(0x4000, COORD_TO_TILE(super), super->collisionLayer);
} else {
sub_0806F4E8(super);
}
@@ -264,7 +264,7 @@ void sub_08082778(PotEntity* this) {
super->timer = 1;
super->spriteOffsetX = 0;
super->spriteOffsetY = -2;
- SetTile((u16)this->unk_70, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile((u16)this->unk_70, COORD_TO_TILE(super), super->collisionLayer);
}
if ((gPlayerState.field_0x1c & 0xF) != 0x1 || (super->contactFlags & 0x7F) != 0x13) {
diff --git a/src/object/pullableMushroom.c b/src/object/pullableMushroom.c
index 63fcdfbb..b8f6eabc 100644
--- a/src/object/pullableMushroom.c
+++ b/src/object/pullableMushroom.c
@@ -59,7 +59,7 @@ void PullableMushroom_Init(PullableMushroomEntity* this) {
super->spritePriority.b0 = 4;
super->hitbox = (Hitbox*)&gUnk_080FD224;
super->carryFlags = 1;
- SetTile(0x4022, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(0x4022, COORD_TO_TILE(super), super->collisionLayer);
super->health = 1;
super->collisionFlags = 7;
super->hitType = 0x6e;
diff --git a/src/object/pushableFurniture.c b/src/object/pushableFurniture.c
index 327dfbe6..ec391f0c 100644
--- a/src/object/pushableFurniture.c
+++ b/src/object/pushableFurniture.c
@@ -295,12 +295,12 @@ void sub_0808FDE8(PushableFurnitureEntity* this) {
iVar2 = GetTileIndex(uVar3, 1);
if (iVar2 == 0x402e) {
if ((((uVar1 & 0xf0) != 0) && ((uVar1 & 0xf0) != 0x50)) || ((uVar1 & 5) == 0)) {
- SetTile(0x402c, uVar3, 1);
+ SetBottomTile(0x402c, uVar3, 1);
}
} else {
iVar2 = sub_080B1B44(uVar3, 1);
if ((iVar2 == 5) && ((((uVar1 & 0xf0) == 0 || ((uVar1 & 0xf0) == 0x50)) && ((uVar1 & 5) != 0)))) {
- SetTile(0x402e, uVar3, 1);
+ SetBottomTile(0x402e, uVar3, 1);
}
}
uVar3 = (u32)this->unk_72;
@@ -308,12 +308,12 @@ void sub_0808FDE8(PushableFurnitureEntity* this) {
iVar2 = GetTileIndex(uVar3, 1);
if (iVar2 == 0x402f) {
if ((((uVar1 & 0xf0) != 0) && ((uVar1 & 0xf0) != 0x50)) || ((uVar1 & 10) == 0)) {
- SetTile(0x402d, uVar3, 1);
+ SetBottomTile(0x402d, uVar3, 1);
}
} else {
iVar2 = sub_080B1B44(uVar3, 1);
if (((iVar2 == 10) && (((uVar1 & 0xf0) == 0 || ((uVar1 & 0xf0) == 0x50)))) && ((uVar1 & 10) != 0)) {
- SetTile(0x402f, uVar3, 1);
+ SetBottomTile(0x402f, uVar3, 1);
}
}
}
@@ -361,13 +361,13 @@ void sub_0808FF50(PushableFurnitureEntity* this) {
case 0:
this->unk_70 = tmp;
this->unk_74 = GetTileIndex(this->unk_70, 1);
- SetTile(0x404a, tmp, 1);
+ SetBottomTile(0x404a, tmp, 1);
break;
case 1:
if ((tmp2 & 8) != 0) {
this->unk_70 = this->unk_7c;
this->unk_74 = GetTileIndex(this->unk_70, 1);
- SetTile(gUnk_08121EE4[this->unk_81], position, 1);
+ SetBottomTile(gUnk_08121EE4[this->unk_81], position, 1);
this->unk_72 = tmp + 1;
this->unk_76 = GetTileIndex(this->unk_72, 1);
sub_08090094(this, gUnk_08121EE4[this->unk_81 + 4], this->unk_72);
@@ -375,7 +375,7 @@ void sub_0808FF50(PushableFurnitureEntity* this) {
} else {
this->unk_72 = this->unk_7c;
this->unk_76 = GetTileIndex(this->unk_72, 1);
- SetTile(gUnk_08121EE4[this->unk_81], position, 1);
+ SetBottomTile(gUnk_08121EE4[this->unk_81], position, 1);
this->unk_70 = tmp - 1;
this->unk_74 = GetTileIndex(this->unk_70, 1);
sub_08090094(this, gUnk_08121EE4[this->unk_81 + 2], this->unk_70);
@@ -400,14 +400,14 @@ void sub_08090094(PushableFurnitureEntity* this, u32 param_2, u32 tilePos) {
if (tmp1 == 5) {
index = 0x4022;
}
- SetTile(index, tilePos, 1);
+ SetBottomTile(index, tilePos, 1);
return;
case 0x402d:
case 0x402f:
if (tmp1 == 5) {
index = 0x4022;
}
- SetTile(index, tilePos, 1);
+ SetBottomTile(index, tilePos, 1);
return;
case 0x4024:
case 0x402c:
@@ -415,10 +415,10 @@ void sub_08090094(PushableFurnitureEntity* this, u32 param_2, u32 tilePos) {
if (tmp1 == 10) {
index = 0x4022;
}
- SetTile(index, tilePos, 1);
+ SetBottomTile(index, tilePos, 1);
return;
default:
- SetTile(index, tilePos, 1);
+ SetBottomTile(index, tilePos, 1);
return;
}
}
@@ -470,7 +470,7 @@ void sub_08090094(PushableFurnitureEntity* this, u32 param_2, u32 tilePos) {
break;
}
- SetTile(index, tilePos, 1);
+ SetBottomTile(index, tilePos, 1);
}
void sub_08090254(PushableFurnitureEntity* this) {
@@ -572,7 +572,7 @@ void sub_0809028C(PushableFurnitureEntity* this, u32 param_2) {
}
void sub_08090480(u32 param_1, u32 param_2) {
- SetTile(gUnk_08121EF0[param_1], param_2, 1);
+ SetBottomTile(gUnk_08121EF0[param_1], param_2, 1);
}
void sub_08090498(PushableFurnitureEntity* this) {
diff --git a/src/object/pushableGrave.c b/src/object/pushableGrave.c
index eb343f09..75fe9463 100644
--- a/src/object/pushableGrave.c
+++ b/src/object/pushableGrave.c
@@ -68,12 +68,12 @@ void PushableGrave_Init(PushableGraveEntity* this) {
tileIndex = PushableGrave_Tiles[super->type2];
if (super->type == 0) {
super->hitbox = (Hitbox*)&gUnk_080FD578;
- SetTile(tileIndex, tilePosition - 1, super->collisionLayer);
- SetTile(tileIndex, tilePosition, super->collisionLayer);
+ SetBottomTile(tileIndex, tilePosition - 1, super->collisionLayer);
+ SetBottomTile(tileIndex, tilePosition, super->collisionLayer);
super->y.HALF.HI += 2;
} else {
super->hitbox = (Hitbox*)&gUnk_080FD570;
- SetTile(tileIndex, tilePosition, super->collisionLayer);
+ SetBottomTile(tileIndex, tilePosition, super->collisionLayer);
if (super->type2 == 2) {
SetMultipleTiles((TileData*)gUnk_081232C0, tilePosition, super->collisionLayer);
}
@@ -133,9 +133,9 @@ void sub_080977F4(PushableGraveEntity* this) {
super->action = 4;
super->spriteOffsetY = 0;
tilePosition = COORD_TO_TILE(super);
- SetTile(0x4022, tilePosition, super->collisionLayer);
+ SetBottomTile(0x4022, tilePosition, super->collisionLayer);
if (super->type == 0) {
- SetTile(0x4022, tilePosition - 1, super->collisionLayer);
+ SetBottomTile(0x4022, tilePosition - 1, super->collisionLayer);
}
if (this->pushedFlag != 0) {
SetFlag(this->pushedFlag);
diff --git a/src/object/pushableLever.c b/src/object/pushableLever.c
index bfdc1a46..f7633eae 100644
--- a/src/object/pushableLever.c
+++ b/src/object/pushableLever.c
@@ -50,7 +50,7 @@ void PushableLever_Idle(PushableLeverEntity* this) {
super->action = PUSHING;
super->spriteOffsetX = 0;
super->spriteOffsetY = 0;
- SetTile(this->tileIndex, this->tilePosition, super->collisionLayer);
+ SetBottomTile(this->tileIndex, this->tilePosition, super->collisionLayer);
EnqueueSFX(SFX_16A);
RequestPriorityDuration(super, 30);
if (PlayerCanBeMoved()) {
@@ -87,13 +87,13 @@ void PushableLever_SetTiles(PushableLeverEntity* this) {
super->type2 = 0;
this->tilePosition = COORD_TO_TILE_OFFSET(super, 0, 0x10);
this->tileIndex = GetTileIndex(this->tilePosition, super->collisionLayer);
- SetTile(TILE_INITIAL, this->tilePosition, super->collisionLayer);
+ SetBottomTile(TILE_INITIAL, this->tilePosition, super->collisionLayer);
InitializeAnimation(super, 1);
} else {
super->type2 = 1;
this->tilePosition = COORD_TO_TILE_OFFSET(super, 0x10, 0);
this->tileIndex = GetTileIndex(this->tilePosition, super->collisionLayer);
- SetTile(TILE_PUSHED, this->tilePosition, super->collisionLayer);
+ SetBottomTile(TILE_PUSHED, this->tilePosition, super->collisionLayer);
InitializeAnimation(super, 0);
}
}
@@ -104,7 +104,7 @@ bool32 PushableLever_ShouldStartPushing(PushableLeverEntity* this) {
return TRUE;
}
PushableLever_CalculateSpriteOffsets(this);
- SetTile(PushableLever_Tiles[super->type2], this->tilePosition, super->collisionLayer);
+ SetBottomTile(PushableLever_Tiles[super->type2], this->tilePosition, super->collisionLayer);
} else {
this->timer = 60;
super->spriteOffsetX = 0;
diff --git a/src/object/pushableRock.c b/src/object/pushableRock.c
index 00d8739a..f008712b 100644
--- a/src/object/pushableRock.c
+++ b/src/object/pushableRock.c
@@ -54,7 +54,7 @@ void PushableRock_Action1(PushableRockEntity* this) {
} else {
super->spriteSettings.flipX = 0;
}
- SetTile(this->tileIndex, this->tilePosition, super->collisionLayer);
+ SetBottomTile(this->tileIndex, this->tilePosition, super->collisionLayer);
super->action = 2;
InitializeAnimation(super, (super->animationState >> 1) + 1);
EnqueueSFX(SFX_10F);
@@ -92,7 +92,7 @@ void sub_0808A644(PushableRockEntity* this) {
this->unk_72 = sub_080B1B44(this->tilePosition, super->collisionLayer);
tmp = sub_080B1AE0(this->tilePosition, super->collisionLayer);
if ((tmp == 0x19) || (tmp == 0xf0)) {
- SetTile(0x4015, this->tilePosition, super->collisionLayer);
+ SetBottomTile(0x4015, this->tilePosition, super->collisionLayer);
super->action = 3;
if (!CheckFlags(this->pushedFlag)) {
SetFlag(this->pushedFlag);
@@ -102,7 +102,7 @@ void sub_0808A644(PushableRockEntity* this) {
InitializeAnimation(super, 6);
}
} else {
- SetTile(0x401b, this->tilePosition, super->collisionLayer);
+ SetBottomTile(0x401b, this->tilePosition, super->collisionLayer);
}
}
diff --git a/src/object/pushableStatue.c b/src/object/pushableStatue.c
index 1755dc5b..5da8d0e8 100644
--- a/src/object/pushableStatue.c
+++ b/src/object/pushableStatue.c
@@ -155,7 +155,7 @@ void PushableStatue_Action4(PushableStatueEntity* this) {
} else {
super->spriteSettings.draw = 1;
super->action = 1;
- SetTile(0x400b, this->unk_84, super->collisionLayer);
+ SetBottomTile(0x400b, this->unk_84, super->collisionLayer);
sub_080894C8(this);
}
}
@@ -163,9 +163,9 @@ void PushableStatue_Action4(PushableStatueEntity* this) {
void sub_08089454(PushableStatueEntity* this) {
this->unk_84 = COORD_TO_TILE(super);
this->unk_80 = GetTileIndex(this->unk_84, super->collisionLayer);
- SetTile(0x400b, this->unk_84, super->collisionLayer);
+ SetBottomTile(0x400b, this->unk_84, super->collisionLayer);
if (super->collisionLayer == 2 && GetTileType(this->unk_84, 1) == 0x310) {
- SetTile(0x400b, this->unk_84, 1);
+ SetBottomTile(0x400b, this->unk_84, 1);
}
}
@@ -194,7 +194,7 @@ void sub_08089538(PushableStatueEntity* this) {
u16 tileType;
this->unk_86 = 0x20;
EnqueueSFX(SFX_10F);
- SetTile(this->unk_80, this->unk_84, super->collisionLayer);
+ SetBottomTile(this->unk_80, this->unk_84, super->collisionLayer);
if ((super->collisionLayer == 2) && (GetTileType(this->unk_84, 1) == 0x400b)) {
CloneTile(0x310, this->unk_84, 1);
}
@@ -264,7 +264,7 @@ bool32 sub_080896B0(void) {
uVar4 = COORD_TO_TILE_OFFSET(&gPlayerEntity.base, -ptr[0], -ptr[1]) - uVar1;
val = sub_080B1AE0(uVar4, gPlayerEntity.base.collisionLayer);
if ((val - 0x26 > 1) && (val != 0x29)) {
- layer = GetLayerByIndex(gPlayerEntity.base.collisionLayer);
+ layer = GetTileBuffer(gPlayerEntity.base.collisionLayer);
iVar2 = (uVar4 * 0x10000) >> 0x10;
tmp1 = layer->collisionData[iVar2];
tmp2 = layer->collisionData[(iVar2 - uVar1)];
diff --git a/src/object/railtrack.c b/src/object/railtrack.c
index 5582202f..63172e5a 100644
--- a/src/object/railtrack.c
+++ b/src/object/railtrack.c
@@ -65,7 +65,7 @@ void Railtrack_Init(RailtrackEntity* this) {
}
}
InitializeAnimation(super, super->animationState);
- this->unk_70 = &GetLayerByIndex(super->collisionLayer)->mapData[COORD_TO_TILE(super)];
+ this->unk_70 = &GetTileBuffer(super->collisionLayer)->mapData[COORD_TO_TILE(super)];
sub_08085394(this);
}
@@ -140,13 +140,13 @@ void sub_08085394(RailtrackEntity* this) {
tile = COORD_TO_TILE(super);
this->unk_74 = *(layerData - offset);
- SetTile(uVar1, tile - offset, super->collisionLayer);
+ SetBottomTile(uVar1, tile - offset, super->collisionLayer);
this->unk_76 = layerData[0x0];
- SetTile(uVar1, tile - 0x0, super->collisionLayer);
+ SetBottomTile(uVar1, tile - 0x0, super->collisionLayer);
this->unk_78 = layerData[offset];
- SetTile(uVar1, tile + offset, super->collisionLayer);
+ SetBottomTile(uVar1, tile + offset, super->collisionLayer);
}
void sub_0808543C(RailtrackEntity* this) {
@@ -156,9 +156,9 @@ void sub_0808543C(RailtrackEntity* this) {
temp = gUnk_080B4488[super->animationState / 2][0];
uVar2 = COORD_TO_TILE(super);
- SetTile(this->unk_74, uVar2 - temp, super->collisionLayer);
- SetTile(this->unk_76, uVar2, super->collisionLayer);
- SetTile(this->unk_78, uVar2 + temp, super->collisionLayer);
+ SetBottomTile(this->unk_74, uVar2 - temp, super->collisionLayer);
+ SetBottomTile(this->unk_76, uVar2, super->collisionLayer);
+ SetBottomTile(this->unk_78, uVar2 + temp, super->collisionLayer);
}
u32 sub_080854A8(RailtrackEntity* this) {
diff --git a/src/object/smallIceBlock.c b/src/object/smallIceBlock.c
index 836dc648..e7931190 100644
--- a/src/object/smallIceBlock.c
+++ b/src/object/smallIceBlock.c
@@ -99,7 +99,7 @@ void SmallIceBlock_Action1(SmallIceBlockEntity* this) {
if (obj != NULL) {
CopyPosition(super, obj);
}
- SetTile(this->unk_6c, this->unk_70, super->collisionLayer);
+ SetBottomTile(this->unk_6c, this->unk_70, super->collisionLayer);
DeleteEntity(super);
break;
@@ -158,7 +158,7 @@ void SmallIceBlock_Action4(SmallIceBlockEntity* this) {
DeleteThisEntity();
} else {
if (super->timer == 0x30) {
- SetTile(this->unk_6c, this->unk_70, super->collisionLayer);
+ SetBottomTile(this->unk_6c, this->unk_70, super->collisionLayer);
}
SetAffineInfo(super, 0x100, (0x3c - super->timer) * 0x20 + 0x100, 0);
if ((super->timer & 1) != 0) {
@@ -177,14 +177,14 @@ void SmallIceBlock_Action4(SmallIceBlockEntity* this) {
void sub_08099468(SmallIceBlockEntity* this) {
this->unk_70 = COORD_TO_TILE(super);
this->unk_6c = GetTileIndex(this->unk_70, super->collisionLayer);
- SetTile(0x405a, this->unk_70, super->collisionLayer);
+ SetBottomTile(0x405a, this->unk_70, super->collisionLayer);
}
void sub_080994B8(SmallIceBlockEntity* this) {
u16 tileType;
EnqueueSFX(SFX_ICE_BLOCK_SLIDE);
- SetTile(this->unk_6c, this->unk_70, super->collisionLayer);
+ SetBottomTile(this->unk_6c, this->unk_70, super->collisionLayer);
if ((super->collisionLayer == 2) && (GetTileType(this->unk_70, 1) == 0x405a)) {
CloneTile(0x310, this->unk_70, 1);
}
diff --git a/src/object/smokeParticle.c b/src/object/smokeParticle.c
index ab50e2b8..4c24717a 100644
--- a/src/object/smokeParticle.c
+++ b/src/object/smokeParticle.c
@@ -74,14 +74,14 @@ void sub_080878CC(Entity* this) {
switch (GetTileType(pos, layer)) {
case 0x368:
case 0x367:
- sub_08008796(this, 3, x + itX, y + itY);
+ DoTileInteraction(this, 3, x + itX, y + itY);
break;
default:
- SetTile(0x4022, pos, layer);
+ SetBottomTile(0x4022, pos, layer);
break;
}
} else {
- sub_08008796(this, 3, x + itX, y + itY);
+ DoTileInteraction(this, 3, x + itX, y + itY);
}
}
}
diff --git a/src/object/treeThorns.c b/src/object/treeThorns.c
index a51bf700..66f26cc6 100644
--- a/src/object/treeThorns.c
+++ b/src/object/treeThorns.c
@@ -29,8 +29,8 @@ void TreeThorns(Entity* this) {
this->flags2 = 1;
this->hitbox = (Hitbox*)&gHitbox_1;
tilePos = COORD_TO_TILE(this);
- SetTile(0x4066, tilePos - 1, *layer);
- SetTile(0x4065, tilePos, *layer);
+ SetBottomTile(0x4066, tilePos - 1, *layer);
+ SetBottomTile(0x4065, tilePos, *layer);
UpdateSpriteForCollisionLayer(this);
ent = CreateObject(TREE_THORNS, 1, 0);
if (ent != NULL) {
diff --git a/src/object/unusedSkull.c b/src/object/unusedSkull.c
index 40303016..d594d5c1 100644
--- a/src/object/unusedSkull.c
+++ b/src/object/unusedSkull.c
@@ -38,7 +38,7 @@ void UnusedSkull_Init(UnusedSkullEntity* this) {
super->hurtType = 0x47;
super->flags2 = 2;
super->hitbox = (Hitbox*)&gHitbox_4;
- SetTile(0x4050, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(0x4050, COORD_TO_TILE(super), super->collisionLayer);
if (super->type == 1 || CheckFlags(this->unk_86)) {
super->action = 3;
SetFlag(this->unk_86);
diff --git a/src/object/well.c b/src/object/well.c
index c48948b1..fbf85d13 100644
--- a/src/object/well.c
+++ b/src/object/well.c
@@ -33,7 +33,7 @@ void Well_Init(WellEntity* this) {
super->action = 1;
tilePos = COORD_TO_TILE(super);
this->unk_80 = tilePos;
- SetTile(16509, this->unk_80, 1);
+ SetBottomTile(16509, this->unk_80, 1);
}
void Well_Action1(WellEntity* this) {
diff --git a/src/physics.c b/src/physics.c
index ac34b999..04eae6c1 100644
--- a/src/physics.c
+++ b/src/physics.c
@@ -45,7 +45,7 @@ u32 sub_0806F39C(Entity* ent) {
}
if (dist > 64) {
- sub_080027EA(&gPlayerEntity.base, ent->speed, ent->direction);
+ LinearMoveDirectionOLD(&gPlayerEntity.base, ent->speed, ent->direction);
return 1;
}
return 0;
@@ -402,7 +402,7 @@ bool32 CheckPlayerProximity(u32 x, u32 y, u32 distX, u32 DistY) {
}
bool32 sub_0806FC24(u32 param_1, u32 param_2) {
- u32 val = sub_08007DD6(param_1, gUnk_080046A4);
+ u32 val = ActTileToTile(param_1, gUnk_080046A4);
if (!val)
return 0;
@@ -411,7 +411,7 @@ bool32 sub_0806FC24(u32 param_1, u32 param_2) {
const u16* sub_0806FC50(u32 param_1, u32 param_2) {
const u16* rv;
- u32 val = sub_08007DD6(param_1, gUnk_080046A4);
+ u32 val = ActTileToTile(param_1, gUnk_080046A4);
if (!val || ((gUnk_080047F6[val << 2] >> param_2) & 0x1) == 0) {
rv = 0;
} else {
diff --git a/src/player.c b/src/player.c
index 4f0dec35..064b47ec 100644
--- a/src/player.c
+++ b/src/player.c
@@ -894,7 +894,7 @@ static void sub_08071130(PlayerEntity* this) {
if (this->unk_74 != NULL)
ResetCollisionLayer(this->unk_74);
- sub_08008790(super, 7);
+ DoTileInteractionHere(super, 7);
if (gPlayerState.field_0x14)
return;
@@ -2195,7 +2195,7 @@ static void PlayerInHoleInit(PlayerEntity* this) {
super->timer = 1;
}
}
- SetTile(0x4070, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(0x4070, COORD_TO_TILE(super), super->collisionLayer);
ResetActiveItems();
PlayerInHoleUpdate(this);
SoundReq(SFX_81);
@@ -2252,7 +2252,7 @@ static void sub_08072B5C(PlayerEntity* this) {
return;
}
- SetTile(0x4021, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(0x4021, COORD_TO_TILE(super), super->collisionLayer);
super->direction = Direction8FromAnimationState(super->animationState);
temp = sub_0807A2F8(1);
if (!temp) {
@@ -2288,7 +2288,7 @@ static void sub_08072C48(PlayerEntity* this) {
if (GravityUpdate(super, GRAVITY_RATE))
return;
- sub_08008790(super, 7);
+ DoTileInteractionHere(super, 7);
if (gPlayerState.field_0x14) {
if (PlayerCheckNEastTile()) {
gPlayerState.surfacePositionSameTimer = 7;
@@ -2364,13 +2364,13 @@ static void sub_08072D54(PlayerEntity* this) {
uVar2 = GetTileType(sub_0806F730(super), super->collisionLayer);
switch (super->subtimer) {
case 0:
- if (sub_08007DD6(uVar2, sTileTable[gPlayerEntity.base.animationState >> 1])) {
+ if (ActTileToTile(uVar2, sTileTable[gPlayerEntity.base.animationState >> 1])) {
super->timer = 1;
super->subtimer = 1;
}
break;
case 1:
- if (sub_08007DD6(uVar2, sTileTable[gPlayerEntity.base.animationState >> 1])) {
+ if (ActTileToTile(uVar2, sTileTable[gPlayerEntity.base.animationState >> 1])) {
super->timer = 1;
} else {
super->subtimer = 2;
@@ -2378,7 +2378,7 @@ static void sub_08072D54(PlayerEntity* this) {
break;
case 2:
super->animationState ^= 4;
- if (sub_08007DD6(uVar2, sTileTable[gPlayerEntity.base.animationState >> 1]) != 0) {
+ if (ActTileToTile(uVar2, sTileTable[gPlayerEntity.base.animationState >> 1]) != 0) {
super->timer = 1;
super->subtimer = 3;
}
@@ -2386,7 +2386,7 @@ static void sub_08072D54(PlayerEntity* this) {
break;
case 3:
super->animationState ^= 4;
- if (sub_08007DD6(uVar2, sTileTable[gPlayerEntity.base.animationState >> 1])) {
+ if (ActTileToTile(uVar2, sTileTable[gPlayerEntity.base.animationState >> 1])) {
super->timer = 1;
} else {
super->subtimer = 4;
@@ -2410,7 +2410,7 @@ static void sub_08072D54(PlayerEntity* this) {
} else {
sub_08004542(super);
}
- sub_08008790(super, 7);
+ DoTileInteractionHere(super, 7);
if (gPlayerState.field_0x14 != 0) {
if (PlayerCheckNEastTile()) {
gPlayerState.surfacePositionSameTimer = 7;
@@ -3504,7 +3504,7 @@ void SurfaceAction_16(PlayerEntity* this) {
(super->x.HALF.HI & 0xFFF0) | 8, (super->y.HALF.HI & 0xFFF0) | 8, super->x.HALF.HI, super->y.HALF.HI);
}
if ((gPlayerState.flags & PL_MINISH) == 0)
- sub_08008790(super, 7);
+ DoTileInteractionHere(super, 7);
}
}
diff --git a/src/playerItem/playerItemBomb.c b/src/playerItem/playerItemBomb.c
index 5535277f..0a08c55d 100644
--- a/src/playerItem/playerItemBomb.c
+++ b/src/playerItem/playerItemBomb.c
@@ -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;
diff --git a/src/playerItem/playerItemBoomerang.c b/src/playerItem/playerItemBoomerang.c
index ca380e3e..46bc2ca4 100644
--- a/src/playerItem/playerItemBoomerang.c
+++ b/src/playerItem/playerItemBoomerang.c
@@ -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]);
}
diff --git a/src/playerItem/playerItemBottle.c b/src/playerItem/playerItemBottle.c
index 8196ba8b..962f8d7a 100644
--- a/src/playerItem/playerItemBottle.c
+++ b/src/playerItem/playerItemBottle.c
@@ -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;
}
}
diff --git a/src/playerItem/playerItemBow.c b/src/playerItem/playerItemBow.c
index ecedd873..4495475b 100644
--- a/src/playerItem/playerItemBow.c
+++ b/src/playerItem/playerItemBow.c
@@ -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();
}
diff --git a/src/playerItem/playerItemDashSword.c b/src/playerItem/playerItemDashSword.c
index ef127535..126d17bb 100644
--- a/src/playerItem/playerItemDashSword.c
+++ b/src/playerItem/playerItemDashSword.c
@@ -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);
}
diff --git a/src/playerItem/playerItemFireRodProjectile.c b/src/playerItem/playerItemFireRodProjectile.c
index eb5c4005..c80c7894 100644
--- a/src/playerItem/playerItemFireRodProjectile.c
+++ b/src/playerItem/playerItemFireRodProjectile.c
@@ -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);
diff --git a/src/playerItem/playerItemGust.c b/src/playerItem/playerItemGust.c
index 40e2a1be..d77d1747 100644
--- a/src/playerItem/playerItemGust.c
+++ b/src/playerItem/playerItemGust.c
@@ -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) {
diff --git a/src/playerItem/playerItemGustBig.c b/src/playerItem/playerItemGustBig.c
index e0adbfcb..a2e18c99 100644
--- a/src/playerItem/playerItemGustBig.c
+++ b/src/playerItem/playerItemGustBig.c
@@ -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) {
diff --git a/src/playerItem/playerItemHeldObject.c b/src/playerItem/playerItemHeldObject.c
index dee58c8b..669c77ca 100644
--- a/src/playerItem/playerItemHeldObject.c
+++ b/src/playerItem/playerItemHeldObject.c
@@ -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);
diff --git a/src/playerItem/playerItemPacciCaneProjectile.c b/src/playerItem/playerItemPacciCaneProjectile.c
index a5725d17..4c4bc005 100644
--- a/src/playerItem/playerItemPacciCaneProjectile.c
+++ b/src/playerItem/playerItemPacciCaneProjectile.c
@@ -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);
diff --git a/src/playerItem/playerItemSword.c b/src/playerItem/playerItemSword.c
index e9e45087..bed81f9f 100644
--- a/src/playerItem/playerItemSword.c
+++ b/src/playerItem/playerItemSword.c
@@ -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;
diff --git a/src/playerItem/playerItemSwordBeam.c b/src/playerItem/playerItemSwordBeam.c
index 0d572c09..4b110c43 100644
--- a/src/playerItem/playerItemSwordBeam.c
+++ b/src/playerItem/playerItemSwordBeam.c
@@ -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 {
diff --git a/src/playerUtils.c b/src/playerUtils.c
index 7820a1e5..8ff5a7f9 100644
--- a/src/playerUtils.c
+++ b/src/playerUtils.c
@@ -59,7 +59,7 @@ extern ItemDefinition gItemDefinitions[];
extern ItemBehavior* (*const gCreateItemsFuncs[])(Item);
-extern void DeleteLoadedTileEntity(u32, u32);
+extern void UnregisterInteractTile(u32, u32);
extern const u8 gUnk_080B3E80[]; // collisionData for tileType?
@@ -1910,7 +1910,7 @@ void sub_080792D8(void) {
gPlayerState.animation = ANIM_BOUNCE_NOCAP;
}
}
- sub_080027EA(playerEntity, 0x280, playerEntity->knockbackDirection);
+ LinearMoveDirectionOLD(playerEntity, 0x280, playerEntity->knockbackDirection);
sub_0807A5B8(playerEntity->knockbackDirection);
}
}
@@ -2003,10 +2003,10 @@ bool32 sub_08079550(void) {
}
uVar3 = sub_080B1AE0(tilePos1, gPlayerEntity.base.collisionLayer);
- uVar3 = sub_08007DD6(uVar3, gUnk_0811C1E8[gPlayerEntity.base.animationState >> 1]);
+ uVar3 = ActTileToTile(uVar3, gUnk_0811C1E8[gPlayerEntity.base.animationState >> 1]);
if (uVar3 != 0) {
uVar3 = sub_080B1AE0(tilePos2, gPlayerEntity.base.collisionLayer);
- uVar3 = sub_08007DD6(uVar3, gUnk_0811C1E8[gPlayerEntity.base.animationState >> 1]);
+ uVar3 = ActTileToTile(uVar3, gUnk_0811C1E8[gPlayerEntity.base.animationState >> 1]);
if (uVar3 != 0) {
gPlayerState.pushedObject |= 0x80;
if (gPlayerState.dash_state == 0 && (++gPlayerEntity.base.subtimer <= 5)) {
@@ -2332,13 +2332,13 @@ bool32 sub_08079C30(Entity* param_1) {
return TRUE;
}
- if (gPlayerState.floor_type != sub_08007DD6(GetRelativeCollisionTile(param_1, 0, -1), (u16*)gUnk_08007CAC))
+ if (gPlayerState.floor_type != ActTileToTile(GetActTileRelative(param_1, 0, -1), (u16*)gUnk_08007CAC))
return FALSE;
- if (gPlayerState.floor_type != sub_08007DD6(GetRelativeCollisionTile(param_1, 2, 0), (u16*)gUnk_08007CAC))
+ if (gPlayerState.floor_type != ActTileToTile(GetActTileRelative(param_1, 2, 0), (u16*)gUnk_08007CAC))
return FALSE;
- if (gPlayerState.floor_type == sub_08007DD6(GetRelativeCollisionTile(param_1, -2, 0), (u16*)gUnk_08007CAC)) {
+ if (gPlayerState.floor_type == ActTileToTile(GetActTileRelative(param_1, -2, 0), (u16*)gUnk_08007CAC)) {
return TRUE;
}
}
@@ -2350,7 +2350,7 @@ bool32 sub_08079D48(void) {
return TRUE;
} else {
if (!PlayerCheckNEastTile()) {
- if (!sub_08007DD6((u16)GetActTile(&gPlayerEntity.base), gUnk_0811C268)) {
+ if (!ActTileToTile((u16)GetActTile(&gPlayerEntity.base), gUnk_0811C268)) {
return TRUE;
}
}
@@ -2397,7 +2397,7 @@ void sub_08079E58(s32 speed, u32 direction) {
sub_08079E90(direction);
}
sub_080085B0(&gPlayerEntity.base);
- sub_080027EA(&gPlayerEntity.base, (s16)speed, (u8)direction);
+ LinearMoveDirectionOLD(&gPlayerEntity.base, (s16)speed, (u8)direction);
sub_0807A5B8(direction);
}
@@ -2588,8 +2588,8 @@ SurfaceType GetSurfaceCalcType(Entity* param_1, s32 x, s32 y) {
gPlayerState.surfaceTimer++;
}
gPlayerState.floor_type_last = gPlayerState.floor_type;
- tileType = GetRelativeCollisionTile(param_1, x, y);
- return sub_08007DD6(tileType, (u16*)gUnk_08007CAC);
+ tileType = GetActTileRelative(param_1, x, y);
+ return ActTileToTile(tileType, (u16*)gUnk_08007CAC);
}
void EnablePlayerDraw(Entity* this) {
@@ -2633,8 +2633,8 @@ u32 sub_0807A2F8(u32 param_1) {
iVar4 = 0;
uVar2 = sub_08004202(&gPlayerEntity.base, auStack36, uVar2);
if (sub_080B1B44(uVar2 >> 1, 1)) {
- if (!sub_08007DD6((u16)sub_080B1AE0((u16)(uVar2 >> 1), gPlayerEntity.base.collisionLayer),
- gUnk_0811C1D8[gPlayerEntity.base.animationState >> 1])) {
+ if (!ActTileToTile((u16)sub_080B1AE0((u16)(uVar2 >> 1), gPlayerEntity.base.collisionLayer),
+ gUnk_0811C1D8[gPlayerEntity.base.animationState >> 1])) {
break;
}
} else {
@@ -2643,8 +2643,8 @@ u32 sub_0807A2F8(u32 param_1) {
uVar1 = sub_08004202(&gPlayerEntity.base, auStack36, uVar1);
if (sub_080B1B44(uVar1 >> 1, 1)) {
- if (!sub_08007DD6((u16)sub_080B1AE0((uVar1 >> 1), gPlayerEntity.base.collisionLayer),
- gUnk_0811C1D8[gPlayerEntity.base.animationState >> 1])) {
+ if (!ActTileToTile((u16)sub_080B1AE0((uVar1 >> 1), gPlayerEntity.base.collisionLayer),
+ gUnk_0811C1D8[gPlayerEntity.base.animationState >> 1])) {
break;
}
} else {
@@ -2857,7 +2857,7 @@ u32 GetCollisionTileInFront(Entity* this) {
x = 0;
break;
}
- return GetRelativeCollisionTile(this, x, y);
+ return GetActTileRelative(this, x, y);
}
void nullsub_505(void) {
@@ -2941,7 +2941,7 @@ void sub_0807AB44(Entity* this, s32 xOffset, s32 yOffset) {
if (object != NULL) {
PositionRelative(this, object, xOffset << 0x10, yOffset << 0x10);
object->child = (Entity*)ptr;
- SetTile(0x404f, COORD_TO_TILE(object), object->collisionLayer);
+ SetBottomTile(0x404f, COORD_TO_TILE(object), object->collisionLayer);
}
}
}
@@ -3263,8 +3263,8 @@ void SetTileType(u32 tileType, u32 position, u32 layer) {
u16* dest;
if (tileType < 0x800) {
- DeleteLoadedTileEntity(position, layer);
- data = GetLayerByIndex(layer);
+ UnregisterInteractTile(position, layer);
+ data = GetTileBuffer(layer);
metatile = data->unkData2[tileType];
data->mapData[position] = metatile;
collisionData = gUnk_080B3E80[tileType];
@@ -3290,7 +3290,7 @@ void SetTileType(u32 tileType, u32 position, u32 layer) {
}
}
} else if (tileType >= 0x4000) { // The tile type actually directly is a tileIndex
- SetTile(tileType, position, layer);
+ SetBottomTile(tileType, position, layer);
} else {
RestorePrevTileEntity(position, layer);
}
@@ -3426,16 +3426,16 @@ void sub_0807B778(u32 position, u32 layer) {
}
}
-void sub_0807B7D8(u32 param_1, u32 param_2, u32 param_3) {
- if (param_1 == 53) {
- CloneTile(53, param_2, param_3);
- sub_0807B778(param_2, param_3);
- sub_0807B778(param_2 + 1, param_3);
- sub_0807B778(param_2 - 1, param_3);
- sub_0807B778(param_2 + 64, param_3);
- sub_0807B778(param_2 - 64, param_3);
+void sub_0807B7D8(u32 type, u32 pos, u32 layer) {
+ if (type == 53) {
+ CloneTile(53, pos, layer);
+ sub_0807B778(pos, layer);
+ sub_0807B778(pos + 1, layer);
+ sub_0807B778(pos - 1, layer);
+ sub_0807B778(pos + 64, layer);
+ sub_0807B778(pos - 64, layer);
} else {
- SetTileType(param_1, param_2, param_3);
+ SetTileType(type, pos, layer);
}
}
@@ -3481,8 +3481,8 @@ void sub_0807B9B8(u32 tileIndex, u32 position, u32 layer) {
u16* dest;
u16 tileType;
- DeleteLoadedTileEntity(position, layer);
- data = GetLayerByIndex(layer);
+ UnregisterInteractTile(position, layer);
+ data = GetTileBuffer(layer);
data->mapData[position] = tileIndex;
tileType = data->metatileTypes[tileIndex];
data->collisionData[position] = gUnk_080B3E80[tileType];
@@ -3512,9 +3512,9 @@ void RestorePrevTileEntity(u32 position, u32 layer) {
u16* dest;
u16* src;
- DeleteLoadedTileEntity(position, layer);
- data = GetLayerByIndex(layer);
- data->mapData[position] = tileIndex = data->mapDataClone[position];
+ UnregisterInteractTile(position, layer);
+ data = GetTileBuffer(layer);
+ data->mapData[position] = tileIndex = data->mapDataOriginal[position];
tileType = data->metatileTypes[tileIndex];
data->collisionData[position] = gUnk_080B3E80[tileType];
data->unkData3[position] = gUnk_080B37A0[tileType];
@@ -3548,7 +3548,7 @@ void sub_0807BB98(s32 basePosition, u32 layer, u32 width, u32 height) {
u32 x;
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++) {
- SetTile(0x4072, basePosition + x, layer);
+ SetBottomTile(0x4072, basePosition + x, layer);
}
basePosition += 0x40;
}
@@ -3853,21 +3853,21 @@ void LoadRoomGfx(void) {
tmp = TRUE;
}
if (gRoomTransition.field2d == 0) {
- MemCopy(gMapBottom.mapData, gMapBottom.mapDataClone, sizeof(gMapBottom.mapData));
- MemCopy(gMapTop.mapData, gMapTop.mapDataClone, sizeof(gMapBottom.mapData));
+ MemCopy(gMapBottom.mapData, gMapBottom.mapDataOriginal, sizeof(gMapBottom.mapData));
+ MemCopy(gMapTop.mapData, gMapTop.mapDataOriginal, sizeof(gMapBottom.mapData));
} else if (gRoomTransition.field2d == 2) {
MemCopy(gMapBottom.mapData, gMapBottom.unkData3, 0x1000);
- MemCopy(gMapBottom.mapDataClone, gMapBottom.mapData, 0x1000);
- MemCopy(gMapBottom.unkData3, gMapBottom.mapDataClone, 0x1000);
+ MemCopy(gMapBottom.mapDataOriginal, gMapBottom.mapData, 0x1000);
+ MemCopy(gMapBottom.unkData3, gMapBottom.mapDataOriginal, 0x1000);
MemCopy(gMapBottom.mapData + 0x800, gMapBottom.unkData3, 0x1000);
- MemCopy(gMapBottom.mapDataClone + 0x800, gMapBottom.mapData + 0x800, 0x1000);
- MemCopy(gMapBottom.unkData3, gMapBottom.mapDataClone + 0x800, 0x1000);
+ MemCopy(gMapBottom.mapDataOriginal + 0x800, gMapBottom.mapData + 0x800, 0x1000);
+ MemCopy(gMapBottom.unkData3, gMapBottom.mapDataOriginal + 0x800, 0x1000);
MemCopy(gMapTop.mapData, gMapTop.unkData3, 0x1000);
- MemCopy(gMapTop.mapDataClone, gMapTop.mapData, 0x1000);
- MemCopy(gMapTop.unkData3, gMapTop.mapDataClone, 0x1000);
+ MemCopy(gMapTop.mapDataOriginal, gMapTop.mapData, 0x1000);
+ MemCopy(gMapTop.unkData3, gMapTop.mapDataOriginal, 0x1000);
MemCopy(gMapTop.mapData + 0x800, gMapTop.unkData3, 0x1000);
- MemCopy(gMapTop.mapDataClone + 0x800, gMapTop.mapData + 0x800, 0x1000);
- MemCopy(gMapTop.unkData3, gMapTop.mapDataClone + 0x800, 0x1000);
+ MemCopy(gMapTop.mapDataOriginal + 0x800, gMapTop.mapData + 0x800, 0x1000);
+ MemCopy(gMapTop.unkData3, gMapTop.mapDataOriginal + 0x800, 0x1000);
}
if (!tmp) {
sub_0807BBE4();
@@ -3946,10 +3946,10 @@ void sub_0807C460(void) {
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++) {
if (*mapBottom > 0x3fff) {
- SetTile(*mapBottom, position, 1);
+ SetBottomTile(*mapBottom, position, 1);
}
if (*mapTop > 0x3fff) {
- SetTile(*mapTop, position, 2);
+ SetBottomTile(*mapTop, position, 2);
}
mapBottom++;
mapTop++;
@@ -4188,8 +4188,8 @@ void sub_0807C810(void) {
*/
void CloneMapData(void) {
gRoomTransition.field2d = 1;
- MemCopy(&gMapBottom.mapData, &gMapBottom.mapDataClone, 0x2000);
- MemCopy(&gMapTop.mapData, &gMapTop.mapDataClone, 0x2000);
+ MemCopy(&gMapBottom.mapData, &gMapBottom.mapDataOriginal, 0x2000);
+ MemCopy(&gMapTop.mapData, &gMapTop.mapDataOriginal, 0x2000);
}
void sub_0807C898(void) {
diff --git a/src/projectile/boneProjectile.c b/src/projectile/boneProjectile.c
index 82c2156c..d1052df8 100644
--- a/src/projectile/boneProjectile.c
+++ b/src/projectile/boneProjectile.c
@@ -44,7 +44,7 @@ void BoneProjectile_Action1(Entity* this) {
if (IsProjectileOffScreen(this)) {
DeleteEntity(this);
} else {
- sub_08016AD2(this);
+ UpdateCollisionLayer(this);
if (--this->timer == 0) {
this->action = 2;
this->speed = 0x120;
diff --git a/src/projectile/cannonballProjectile.c b/src/projectile/cannonballProjectile.c
index 5f2e7e04..c5b4244f 100644
--- a/src/projectile/cannonballProjectile.c
+++ b/src/projectile/cannonballProjectile.c
@@ -63,15 +63,15 @@ void CannonballProjectile_Action2(Entity* this) {
}
bool32 sub_080AB5F4(Entity* this) {
- switch (sub_080043E8(this)) {
+ switch (GetTileHazardType(this)) {
case 1:
- CreateItemOnGround(this);
+ CreatePitFallFX(this);
return TRUE;
case 2:
- sub_080043A8(this);
+ CreateDrownFX(this);
return TRUE;
case 3:
- CreateChestSpawner(this);
+ CreateLavaDrownFX(this);
return TRUE;
}
return FALSE;
diff --git a/src/projectile/dekuSeedProjectile.c b/src/projectile/dekuSeedProjectile.c
index 302615fe..c086f251 100644
--- a/src/projectile/dekuSeedProjectile.c
+++ b/src/projectile/dekuSeedProjectile.c
@@ -60,13 +60,13 @@ void DekuSeedProjectile_Action1(Entity* this) {
if (IsProjectileOffScreen(this)) {
DeleteThisEntity();
}
- sub_08016AD2(this);
+ UpdateCollisionLayer(this);
if (--this->timer == 0) {
this->action = 4;
}
} else {
sub_0800417E(this, this->collisions);
- sub_08016AD2(this);
+ UpdateCollisionLayer(this);
InitializeAnimation(this, 0x19);
sub_080A86A0(this);
}
@@ -99,7 +99,7 @@ void DekuSeedProjectile_Action2(Entity* this) {
}
} else {
sub_0800417E(this, this->collisions);
- sub_08016AD2(this);
+ UpdateCollisionLayer(this);
InitializeAnimation(this, 0x19);
sub_080A86A0(this);
}
diff --git a/src/projectile/dirtBallProjectile.c b/src/projectile/dirtBallProjectile.c
index 3da1926c..2ef3867e 100644
--- a/src/projectile/dirtBallProjectile.c
+++ b/src/projectile/dirtBallProjectile.c
@@ -136,7 +136,7 @@ void DirtBallProjectile_Action2(Entity* this) {
return;
}
- tmp = sub_080043E8(this);
+ tmp = GetTileHazardType(this);
if (tmp != 0) {
switch (tmp) {
case 2:
diff --git a/src/projectile/fireProjectile.c b/src/projectile/fireProjectile.c
index fa5e2d5c..cd81f3d3 100644
--- a/src/projectile/fireProjectile.c
+++ b/src/projectile/fireProjectile.c
@@ -57,7 +57,7 @@ void FireProjectile_Action2(Entity* this) {
if (IsProjectileOffScreen(this)) {
DeleteEntity(this);
} else {
- sub_08016AD2(this);
+ UpdateCollisionLayer(this);
}
} else {
this->action = 3;
diff --git a/src/projectile/gleerokProjectile.c b/src/projectile/gleerokProjectile.c
index cac30dd3..d40d2a92 100644
--- a/src/projectile/gleerokProjectile.c
+++ b/src/projectile/gleerokProjectile.c
@@ -28,7 +28,8 @@ void GleerokProjectile(GleerokProjectileEntity* this) {
}
void GleerokProjectile_OnTick(GleerokProjectileEntity* this) {
- if (((super->type != 3) && ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0)) && ((super->contactFlags & 0x7f) != 0x1e)) {
+ if (((super->type != 3) && ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0)) &&
+ ((super->contactFlags & 0x7f) != 0x1e)) {
super->action = 3;
COLLISION_OFF(super);
InitializeAnimation(super, 0x53);
@@ -95,7 +96,7 @@ void GleerokProjectile_Init(GleerokProjectileEntity* this) {
void GleerokProjectile_Action1(GleerokProjectileEntity* this) {
if (super->type == 3) {
if (GravityUpdate(super, Q_8_8(24.0)) == 0) {
- sub_08008790(super, 7);
+ DoTileInteractionHere(super, 7);
CreateFx(super, FX_ROCK, 0);
DeleteThisEntity();
}
diff --git a/src/projectile/iceProjectile.c b/src/projectile/iceProjectile.c
index 1fa2ea7a..7a430b38 100644
--- a/src/projectile/iceProjectile.c
+++ b/src/projectile/iceProjectile.c
@@ -59,7 +59,7 @@ void IceProjectile_Action2(Entity* this) {
if (IsProjectileOffScreen(this)) {
DeleteEntity(this);
} else {
- sub_08016AD2(this);
+ UpdateCollisionLayer(this);
}
} else {
this->action = 3;
diff --git a/src/projectile/mandiblesProjectile.c b/src/projectile/mandiblesProjectile.c
index 0062d622..64142a9c 100644
--- a/src/projectile/mandiblesProjectile.c
+++ b/src/projectile/mandiblesProjectile.c
@@ -118,7 +118,7 @@ void MandiblesProjectile_Action2(MandiblesProjectileEntity* this) {
}
this->unk_78 = TILE(super->x.HALF.HI, super->y.HALF.HI);
if (GetTileType(this->unk_78, super->collisionLayer) == 0x4000) {
- SetTile(0x4005, this->unk_78, super->collisionLayer);
+ SetBottomTile(0x4005, this->unk_78, super->collisionLayer);
}
}
diff --git a/src/projectile/removableDust.c b/src/projectile/removableDust.c
index 40ef0640..e89cd3b4 100644
--- a/src/projectile/removableDust.c
+++ b/src/projectile/removableDust.c
@@ -91,7 +91,7 @@ void sub_080AA494(RemovableDustEntity* this) {
}
super->type2 = index;
super->spritePriority.b0 = 7;
- SetTile(0x4068, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
+ SetBottomTile(0x4068, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
}
void sub_080AA534(Entity* this) {
diff --git a/src/projectile/rockProjectile.c b/src/projectile/rockProjectile.c
index e8ebe565..7dc35d0c 100644
--- a/src/projectile/rockProjectile.c
+++ b/src/projectile/rockProjectile.c
@@ -43,7 +43,7 @@ void RockProjectile_Action1(Entity* this) {
if (IsProjectileOffScreen(this)) {
DeleteEntity(this);
} else {
- sub_08016AD2(this);
+ UpdateCollisionLayer(this);
if (--this->timer == 0) {
this->action = 3;
}
@@ -51,7 +51,7 @@ void RockProjectile_Action1(Entity* this) {
} else {
sub_0800417E(this, this->collisions);
sub_080A8178(this);
- sub_08016AD2(this);
+ UpdateCollisionLayer(this);
}
}
diff --git a/src/projectile/spiderWeb.c b/src/projectile/spiderWeb.c
index b2e97623..c1cb7adc 100644
--- a/src/projectile/spiderWeb.c
+++ b/src/projectile/spiderWeb.c
@@ -246,7 +246,7 @@ void sub_080AA9E0(Entity* this) {
void sub_080AAA68(Entity* this) {
static const u16 typeTiles[] = { 16419, 16421, 16422, 16420 };
- SetTile(typeTiles[this->type], TILE(this->x.HALF.HI, this->y.HALF.HI), this->collisionLayer);
+ SetBottomTile(typeTiles[this->type], TILE(this->x.HALF.HI, this->y.HALF.HI), this->collisionLayer);
}
void sub_080AAAA8(SpiderWebEntity* this) {
diff --git a/src/projectile/windProjectile.c b/src/projectile/windProjectile.c
index 499409f2..2682b104 100644
--- a/src/projectile/windProjectile.c
+++ b/src/projectile/windProjectile.c
@@ -64,7 +64,7 @@ void WindProjectile_Action2(Entity* this) {
if (IsProjectileOffScreen(this)) {
DeleteEntity(this);
} else {
- sub_08016AD2(this);
+ UpdateCollisionLayer(this);
}
} else {
this->action = 3;
diff --git a/src/projectile/winder.c b/src/projectile/winder.c
index 5cbea569..b8caaefb 100644
--- a/src/projectile/winder.c
+++ b/src/projectile/winder.c
@@ -119,7 +119,7 @@ void Winder_SetPositions(WinderEntity* this) {
bool32 Winder_CheckForRailings(WinderEntity* this, u32 dir) {
u32 tile;
u32 val;
- LayerStruct* layer = GetLayerByIndex(super->collisionLayer);
+ LayerStruct* layer = GetTileBuffer(super->collisionLayer);
u32 collisionData;
tile = TILE(super->x.HALF.HI, super->y.HALF.HI);
diff --git a/src/roomInit.c b/src/roomInit.c
index 2f832223..8c1b6899 100644
--- a/src/roomInit.c
+++ b/src/roomInit.c
@@ -807,10 +807,10 @@ extern EntityData gUnk_080D7D34;
void sub_StateChange_GreatFairies_Exit(void) {
if (GetInventoryValue(ITEM_FOURSWORD)) {
- SetTile(0x4072, 0x14d, 1);
- SetTile(0x4072, 0x10c, 1);
- SetTile(0x4090, 0x14c, 1);
- SetTile(0x4090, 0x18c, 1);
+ SetBottomTile(0x4072, 0x14d, 1);
+ SetBottomTile(0x4072, 0x10c, 1);
+ SetBottomTile(0x4090, 0x14c, 1);
+ SetBottomTile(0x4090, 0x18c, 1);
LoadRoomEntityList(&gUnk_080D7D34);
}
}
@@ -1051,8 +1051,8 @@ void sub_StateChange_RoyalValley_Main(void) {
EnableRandomDrops();
sub_08059278();
- SetTile(0x4072, 0xa47, 1);
- SetTile(0x4072, 0xc47, 1);
+ SetBottomTile(0x4072, 0xa47, 1);
+ SetBottomTile(0x4072, 0xc47, 1);
if (CheckGlobalFlag(MAZE_CLEAR))
if (gRoomTransition.player_status.start_pos_x == 0x78 && gRoomTransition.player_status.start_pos_y == 0x278)
@@ -4446,7 +4446,7 @@ void sub_0804E150(void) {
uVar3 = 1 << gSave.global_progress;
for (; pTileData[1] != 0; pTileData += 3) {
if ((pTileData[0] & uVar3) != 0) {
- SetTile(pTileData[2], pTileData[1], 1);
+ SetBottomTile(pTileData[2], pTileData[1], 1);
}
}
if (CheckLocalFlag(SHOP05_OPEN) == 0) {
@@ -4454,7 +4454,7 @@ void sub_0804E150(void) {
uVar3 = 1 << gSave.global_progress;
for (; pTileData[0] != 0; pTileData += 3) {
if ((pTileData[0] & uVar3) != 0) {
- SetTile(pTileData[2], pTileData[1], 1);
+ SetBottomTile(pTileData[2], pTileData[1], 1);
}
}
}
@@ -4463,7 +4463,7 @@ void sub_0804E150(void) {
uVar3 = 1 << gSave.global_progress;
for (; pTileData[0] != 0; pTileData += 3) {
if ((pTileData[0] & uVar3) != 0) {
- SetTile(pTileData[2], pTileData[1], 1);
+ SetBottomTile(pTileData[2], pTileData[1], 1);
}
}
}
@@ -5043,22 +5043,22 @@ void sub_StateChange_LakeHylia_Main(void) {
if ((gSave.global_progress > 3) && CheckGlobalFlag(TINGLE_TALK1ST)) {
LoadRoomEntityList(&gUnk_080F3C44);
}
- SetTile(0x4091, 0x590, 1);
- SetTile(0x4091, 0x591, 1);
- SetTile(0x4091, 0x592, 1);
- SetTile(0x4091, 0x593, 1);
- SetTile(0x4091, 0x594, 1);
- SetTile(0x4091, 0x5d0, 1);
- SetTile(0x4091, 0x610, 1);
- SetTile(0x4091, 0x650, 1);
- SetTile(0x4091, 0x5d4, 1);
- SetTile(0x4091, 0x614, 1);
- SetTile(0x4091, 0x654, 1);
- SetTile(0x4091, 0x690, 1);
- SetTile(0x4091, 0x691, 1);
- SetTile(0x4091, 0x692, 1);
- SetTile(0x4091, 0x693, 1);
- SetTile(0x4091, 0x694, 1);
+ SetBottomTile(0x4091, 0x590, 1);
+ SetBottomTile(0x4091, 0x591, 1);
+ SetBottomTile(0x4091, 0x592, 1);
+ SetBottomTile(0x4091, 0x593, 1);
+ SetBottomTile(0x4091, 0x594, 1);
+ SetBottomTile(0x4091, 0x5d0, 1);
+ SetBottomTile(0x4091, 0x610, 1);
+ SetBottomTile(0x4091, 0x650, 1);
+ SetBottomTile(0x4091, 0x5d4, 1);
+ SetBottomTile(0x4091, 0x614, 1);
+ SetBottomTile(0x4091, 0x654, 1);
+ SetBottomTile(0x4091, 0x690, 1);
+ SetBottomTile(0x4091, 0x691, 1);
+ SetBottomTile(0x4091, 0x692, 1);
+ SetBottomTile(0x4091, 0x693, 1);
+ SetBottomTile(0x4091, 0x694, 1);
}
u32 sub_unk3_LakeHylia_Beanstalk(void) {
@@ -5733,8 +5733,8 @@ void sub_StateChange_HyruleField_LonLonRanch(void) {
}
if (!CheckKinstoneFused(KINSTONE_29)) {
LoadRoomEntityList(&gUnk_080F7860);
- SetTile(0x4072, 0xd88, 1);
- SetTile(0x4096, 0xdc8, 1);
+ SetBottomTile(0x4072, 0xd88, 1);
+ SetBottomTile(0x4096, 0xdc8, 1);
}
if ((gSave.global_progress > 3) && CheckGlobalFlag(TINGLE_TALK1ST)) {
LoadRoomEntityList(&gUnk_080F78A0);
diff --git a/src/scroll.c b/src/scroll.c
index 7c30e701..3baf20fb 100644
--- a/src/scroll.c
+++ b/src/scroll.c
@@ -64,7 +64,7 @@ void sub_08080910(s32);
extern u8 gMapDataTopSpecial[];
-extern const s8 gUnk_080169A4[];
+extern const s8 gShakeOffsets[];
void UpdateScroll(void) {
static void (*const gUnk_0811E768[])(RoomControls*) = {
@@ -350,8 +350,8 @@ void sub_08080040(RoomControls* controls) {
void sub_08080108(RoomControls* controls) {
controls->scrollSubAction = 4;
- MemCopy(gMapBottom.mapData, gMapBottom.mapDataClone, sizeof(gMapBottom.mapData));
- MemCopy(gMapTop.mapData, gMapTop.mapDataClone, sizeof(gMapTop.mapData));
+ MemCopy(gMapBottom.mapData, gMapBottom.mapDataOriginal, sizeof(gMapBottom.mapData));
+ MemCopy(gMapTop.mapData, gMapTop.mapDataOriginal, sizeof(gMapTop.mapData));
sub_08080368();
gUnk_02034480.unk_00 = gUnk_0200B640;
MemCopy(gUnk_02022830, gUnk_020246B0, 0x1800);
@@ -422,8 +422,8 @@ u32 sub_08080278(void) {
u16* ptr1 = (u16*)gUnk_02022830;
u16* mapBottomData = gMapBottom.mapData;
u16* mapTopData = gMapTop.mapData;
- u16* mapBottomDataClone = gMapBottom.mapDataClone;
- u16* mapTopDataClone = gMapTop.mapDataClone;
+ u16* mapBottomDataClone = gMapBottom.mapDataOriginal;
+ u16* mapTopDataClone = gMapTop.mapDataOriginal;
u32 width = gRoomControls.width >> 4;
u32 height = (gRoomControls.height >> 4) << 6;
@@ -761,7 +761,7 @@ void sub_08080930(u32 unused) {
SetInitializationPriority();
}
-LayerStruct* GetLayerByIndex(u32 param_1) {
+LayerStruct* GetTileBuffer(u32 param_1) {
if (param_1 == 2) {
return &gMapTop;
} else {
@@ -904,7 +904,7 @@ void sub_08080BC4(void) {
tmpY = ((gRoomControls.scroll_y - gRoomControls.origin_y) & 0xf) + 8;
if (gRoomControls.shake_duration != 0) {
gRoomControls.shake_duration--;
- ptr = &gUnk_080169A4[gRoomControls.shake_magnitude * 0x10 + (gRoomControls.shake_duration & 0xe)];
+ ptr = &gShakeOffsets[gRoomControls.shake_magnitude * 0x10 + (gRoomControls.shake_duration & 0xe)];
if (gMapBottom.bgSettings != NULL) {
gMapBottom.bgSettings->xOffset = ptr[0] + tmpX;
gMapBottom.bgSettings->yOffset = ptr[1] + tmpY;
diff --git a/src/text.c b/src/text.c
index 6cadf99c..b8ee3169 100644
--- a/src/text.c
+++ b/src/text.c
@@ -7,6 +7,8 @@
#include "message.h"
#include "fileselect.h"
+extern void UnpackTextNibbles(void*, u8*);
+
extern u8 gUnk_02036AD8;
extern u8 gUnk_02036A58;
@@ -609,19 +611,19 @@ u32 sub_0805F76C(u32 textIdOrPtr, WStruct* param_2) {
}
static u32 sub_0805F7A0(u32 param_1) {
- u32 uVar1;
- u32 uVar2;
- u32 uVar3;
+ u32 mask;
+ u32 i;
+ u32 j;
- uVar1 = 0xf;
- for (uVar2 = 0; uVar2 < 8; uVar2++) {
- if (uVar1 != (param_1 & uVar1))
+ mask = 0xf;
+ for (i = 0; i < 8; i++) {
+ if (mask != (param_1 & mask))
break;
- uVar1 <<= 4;
+ mask <<= 4;
}
- for (uVar3 = uVar2; (uVar2 < 8 && (uVar1 != (param_1 & uVar1))); uVar1 <<= 4, uVar2++) {}
- uVar2 -= uVar3;
- return (uVar2 << 8) | uVar3;
+ for (j = i; (i < 8 && (mask != (param_1 & mask))); mask <<= 4, i++) {}
+ i -= j;
+ return (i << 8) | j;
}
u32 sub_0805F7DC(u32 r0, WStruct* r1) {
@@ -656,12 +658,12 @@ void sub_0805F820(WStruct* r0, u32* r1) {
u32 uVar7;
u8* puVar8;
u8* temp;
- void* temp2;
+ void* buffer_loc;
VStruct* temp3;
u32 temp4;
if (r0->unk4 - r0->unk6 > 0) {
- sub_08002724(r1, &gUnk_02036A58);
+ UnpackTextNibbles(r1, &gUnk_02036A58);
if (r0->unk1 == 0) {
u32 tmp = sub_0805F7A0(*r1);
uVar6 = tmp & 0xf;
@@ -680,7 +682,7 @@ void sub_0805F820(WStruct* r0, u32* r1) {
}
puVar8 = &gUnk_02036A58 + uVar6;
- temp2 = r0->unk8;
+ buffer_loc = r0->unk8;
temp = gUnk_0810942E[r0->bgColor].filler0[r0->charColor * 2];
uVar7 = r0->unk6;
r0->unk6 += uVar3;
@@ -688,13 +690,13 @@ void sub_0805F820(WStruct* r0, u32* r1) {
temp4 = r0->unk04;
if (temp4 != 1) {
while (uVar3-- > 0) {
- sub_080026C4(puVar8, temp2, temp, uVar7);
+ sub_080026C4(puVar8, buffer_loc, temp, uVar7);
puVar8++;
uVar7++;
}
} else {
while (uVar3-- > 0) {
- sub_080026F2(puVar8, temp2, temp, uVar7);
+ sub_080026F2(puVar8, buffer_loc, temp, uVar7);
puVar8++;
uVar7++;
}
@@ -730,7 +732,7 @@ void sub_0805F918(u32 idx, u32 idx2, void* dest) {
idx3 = 0;
for (i = 0; i < 3; i++) {
puVar2 = &gUnk_02036A58;
- sub_08002724(puVar1, &gUnk_02036A58);
+ UnpackTextNibbles(puVar1, &gUnk_02036A58);
puVar1 += 0x40;
for (j = 0; j < 8; j++) {
diff --git a/src/worldEvent/worldEvent17.c b/src/worldEvent/worldEvent17.c
index 9b96ecb4..3541626d 100644
--- a/src/worldEvent/worldEvent17.c
+++ b/src/worldEvent/worldEvent17.c
@@ -34,7 +34,7 @@ void sub_08054EB8(Entity* this, ScriptExecutionContext* context) {
void sub_08054EFC(Entity* this, ScriptExecutionContext* context) {
Entity* effect;
u32 tmp = COORD_TO_TILE(this) - 0x40;
- SetTile(0x4074, tmp, 1);
+ SetBottomTile(0x4074, tmp, 1);
this->collisionLayer = 2;
UpdateSpriteForCollisionLayer(this);
effect = CreateFx(this, FX_BIG_EXPLOSION, 0);