Skip to content

Commit

Permalink
Fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
octorock committed Jan 6, 2024
1 parent 560dfa4 commit e4a600d
Show file tree
Hide file tree
Showing 41 changed files with 274 additions and 282 deletions.
5 changes: 0 additions & 5 deletions include/asm.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ extern u32 Random(void);
extern u32 GetRandomByWeight(const u8*);
extern void CloneTile(u32, u32, u32);



extern void SetTile(u32 tileIndex, u32 tilePos, u32 layer);

extern void UpdateScrollVram(void);
Expand Down Expand Up @@ -50,7 +48,6 @@ extern u32 sub_0800132C(struct Entity_*, struct Entity_*);
extern u32 sub_0800445C(struct Entity_*);
extern u32 CheckRectOnScreen(s32, s32, u32, u32);


extern u32 GetTileTypeRelativeToEntity(struct Entity_* entity, s32 xOffset, s32 yOffset);
extern u32 GetTileTypeAtEntity(struct Entity_* entity);
extern u32 GetTileTypeAtWorldCoords(s32 worldX, s32 worldY, u32 layer);
Expand All @@ -64,7 +61,6 @@ extern u32 GetActTileAtRoomCoords(u32 roomX, u32 roomY, u32 layer);
extern u32 GetActTileAtRoomTile(u32 roomTileX, u32 roomTileY, u32 layer);
extern u32 GetActTileAtTilePos(u16 tilePos, u8 layer);


/**
* Sets actTile for a tilePos.
*/
Expand Down Expand Up @@ -96,7 +92,6 @@ extern u32 GetCollisionDataAtTilePos(u32 tilePos, u32 layer);
*/
extern void SetCollisionData(u32 collisionData, u32 tilePos, u32 layer);


extern u32 GetActTileForTileType(u32 tileType);

typedef struct {
Expand Down
8 changes: 4 additions & 4 deletions include/manager/diggingCaveEntranceManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ enum DiggingCaveEntranceType {

typedef struct {
u16 sourceTilePos; /**< Tile position for the entrance in the source room. */
u8 sourceRoom; /**< @see RoomID */
u8 type; /**< @see DiggingCaveEntranceType */
u8 targetArea; /**< @see AreaID */
u8 targetRoom; /**< @see RoomID */
u8 sourceRoom; /**< @see RoomID */
u8 type; /**< @see DiggingCaveEntranceType */
u8 targetArea; /**< @see AreaID */
u8 targetRoom; /**< @see RoomID */
u16 targetTilePos; /**< Tile position for the entrance in the target room. */
} DiggingCaveEntrance;

Expand Down
4 changes: 2 additions & 2 deletions include/manager/flameManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
typedef struct {
struct Manager base;
u8 field_0x20[0x18];
s16 tilePos; // x
s16 field_0x3a; // y
s16 x; // After loading this stores the tilePos.
s16 y;
} FlameManager;

#endif // FLAMEMANAGER_H
25 changes: 15 additions & 10 deletions include/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,26 @@
* @brief The map consists of tiles to create the world.
*
* GBA graphics are made out of tiles with a size of 8px by 8px. We call those tiles *subTiles*.
* Four of those subTiles are combined together to form a bigger 16px by 16px tile (usually called metaTile). We call these *tiles*.
* Four of those subTiles are combined together to form a bigger 16px by 16px tile (usually called metaTile). We call
* these *tiles*.
*
* Each map can be up to 64 * 64 tiles big. The map consists of two layers of tiles gMapTop and gMapBottom.
* To access the map array the tilePos index can be used which goes from 0 to 64 * 64 = 4096.
* Each value in the MapLayer.mapData is a tileIndex which defined which tile of the tileSet should be used.
* The tileSet contains tiles from 0 to 2048. Special tileIndex from 0x4000 to 0x4096 can be used to denote special tiles.
* The tileSet contains tiles from 0 to 2048. Special tileIndex from 0x4000 to 0x4096 can be used to denote special
* tiles.
*
* A tile is created from four subTiles. The subTiles for each tile in the tileSet are stored in MapLayer.subTiles. This is loaded for the current area from gAreaTileSets_*.
* The subTiles can also be flipped or the palette changed. This is stored in bits 0xa to 0xf, see https://www.coranac.com/tonc/text/regbg.htm#sec-map.
* A tile is created from four subTiles. The subTiles for each tile in the tileSet are stored in MapLayer.subTiles. This
* is loaded for the current area from gAreaTileSets_*. The subTiles can also be flipped or the palette changed. This is
* stored in bits 0xa to 0xf, see https://www.coranac.com/tonc/text/regbg.htm#sec-map.
*
* Each tile in the tileSet also has a tileType defined. This is stored in MapLayer.tileTypes and loaded from gAreaTileSetTypes_*.
* The inverse dictionary from tileType to tileIndex is stored in MapLayer.tileIndices.
* Each tile in the tileSet also has a tileType defined. This is stored in MapLayer.tileTypes and loaded from
* gAreaTileSetTypes_*. The inverse dictionary from tileType to tileIndex is stored in MapLayer.tileIndices.
*
* The map also stores the collision for each tile in the tileMap layer in MapLayer.collisionData. By default this is filled from gMapTileTypeToCollisionData based on the tileType of the tiles.
* But it can also be loaded from gRoomCollisionMap_*.
* In MapLayer.actTiles some additional type for each tile is stored which is filled from gMapTileTypeToActTile based on the tileType of the tiles.
* The map also stores the collision for each tile in the tileMap layer in MapLayer.collisionData. By default this is
* filled from gMapTileTypeToCollisionData based on the tileType of the tiles. But it can also be loaded from
* gRoomCollisionMap_*. In MapLayer.actTiles some additional type for each tile is stored which is filled from
* gMapTileTypeToActTile based on the tileType of the tiles.
*/

// Maximum width or height of a map in tiles.
Expand Down Expand Up @@ -67,7 +71,8 @@ typedef struct {
*/
/*0x7004*/ u16 subTiles[TILESET_SIZE * 4];
/**
* Some sort of special behavior for tiles? Falling into holes or jumping off walls does not work when this is all zero.
* Some sort of special behavior for tiles? Falling into holes or jumping off walls does not work when this is all
* zero.
* @see ActTile
*/
/*0xb004*/ u8 actTiles[MAX_MAP_SIZE * MAX_MAP_SIZE];
Expand Down
4 changes: 2 additions & 2 deletions include/room.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ typedef struct {
u8 area;
u8 room;
u16 unk_02;
u32 enemyBits; /**< Flags that can be set on the tracked rooms. Used e.g. by the door mimic. (TODO probably to start in
the discovered state?)*/
u32 enemyBits; /**< Flags that can be set on the tracked rooms. Used e.g. by the door mimic. (TODO probably to start
in the discovered state?)*/
} RoomMemory;

extern RoomMemory* gCurrentRoomMemory;
Expand Down
57 changes: 29 additions & 28 deletions include/tiles.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#ifndef TILES_H
#define TILES_H


typedef enum {
TILE_TYPE_0 = 0x0,
TILE_TYPE_1 = 0x1,
Expand Down Expand Up @@ -1437,8 +1436,8 @@ typedef enum {
SPECIAL_TILE_32 = 0x4020, // Spring hole (Cane shot hole)
SPECIAL_TILE_33 = 0x4021,
SPECIAL_TILE_34 = 0x4022, // Furniture Center Locked Door/Frozen Element/Octo/O Shaped Ice (ToD) Big Chest
// Closed (ToD) Gust Jar Mushrooms (ToD) Perhaps this is just tiles that change on
// interaction?
// Closed (ToD) Gust Jar Mushrooms (ToD) Perhaps this is just tiles that change on
// interaction?
SPECIAL_TILE_35 = 0x4023, // Object Top
SPECIAL_TILE_36 = 0x4024, // Object Left
SPECIAL_TILE_37 = 0x4025, // Object Right
Expand Down Expand Up @@ -1466,7 +1465,7 @@ typedef enum {
SPECIAL_TILE_59 = 0x403b, // Green Bean in Hole
SPECIAL_TILE_60 = 0x403c,
SPECIAL_TILE_61 = 0x403d, // Minish Path Under Stick, Stone over hole in light rooms (ToD), Object Blocking
// Town doors
// Town doors
SPECIAL_TILE_62 = 0x403e, // Grave
SPECIAL_TILE_63 = 0x403f,
SPECIAL_TILE_64 = 0x4040, // Portal Top Left
Expand Down Expand Up @@ -1559,35 +1558,37 @@ typedef enum {
} SpecialTile;

typedef enum {
ACT_TILE_0 = 0x0, // TILE_ACT_CUT
ACT_TILE_1 = 0x1, // TILE_ACT_ROCKBREAKER
ACT_TILE_2 = 0x2, // TILE_ACT_BOOMERANG
ACT_TILE_3 = 0x3, // TILE_ACT_BOMB
ACT_TILE_4 = 0x4, // TILE_ACT_ARROW
ACT_TILE_5 = 0x5, // TILE_ACT_GUST
ACT_TILE_6 = 0x6, // TILE_ACT_LIFT
ACT_TILE_7 = 0x7, // TILE_ACT_FIRE
ACT_TILE_8 = 0x8, // TILE_ACT_PLAYER_WALK -> SURFACE_7
ACT_TILE_9 = 0x9, // TILE_ACT_ENEMY_WALK sub_0801FDE4(leever)
ACT_TILE_0 = 0x0, // TILE_ACT_CUT
ACT_TILE_1 = 0x1, // TILE_ACT_ROCKBREAKER
ACT_TILE_2 = 0x2, // TILE_ACT_BOOMERANG
ACT_TILE_3 = 0x3, // TILE_ACT_BOMB
ACT_TILE_4 = 0x4, // TILE_ACT_ARROW
ACT_TILE_5 = 0x5, // TILE_ACT_GUST
ACT_TILE_6 = 0x6, // TILE_ACT_LIFT
ACT_TILE_7 = 0x7, // TILE_ACT_FIRE
ACT_TILE_8 = 0x8, // TILE_ACT_PLAYER_WALK -> SURFACE_7
ACT_TILE_9 = 0x9, // TILE_ACT_ENEMY_WALK sub_0801FDE4(leever)
ACT_TILE_10 = 0xa, // TILE_ACT_PACCI sub_0801FDE4(leever), sub_08025AB8(puffstool)
ACT_TILE_11 = 0xb, // sub_0801FDE4(leever)
ACT_TILE_12 = 0xc, // TILE_ACT_SWORDBEAM sub_0801FDE4(leever)
ACT_TILE_13 = 0xd, // TILE_ACT_DIG -> SURFACE_PIT, sub_08094E30(cutsceneMiscObject), sub_08085B40(lilypadLarge), Pot_Action1,
// sub_080AD040(playerItemHeldObject), UpdatePlayerCollision, sub_0807B434(playerUtils), FX_FALL_DOWN
ACT_TILE_14 = 0xe, // TILE_ACT_MINIGUST -> SURFACE_SLOPE_GNDWATER
ACT_TILE_15 = 0xf, // -> SURFACE_SHALLOW_WATER, SPECIAL_TILE_145
ACT_TILE_13 =
0xd, // TILE_ACT_DIG -> SURFACE_PIT, sub_08094E30(cutsceneMiscObject), sub_08085B40(lilypadLarge), Pot_Action1,
// sub_080AD040(playerItemHeldObject), UpdatePlayerCollision, sub_0807B434(playerUtils), FX_FALL_DOWN
ACT_TILE_14 = 0xe, // TILE_ACT_MINIGUST -> SURFACE_SLOPE_GNDWATER
ACT_TILE_15 = 0xf, // -> SURFACE_SHALLOW_WATER, SPECIAL_TILE_145
ACT_TILE_16 = 0x10, // -> SURFACE_WATER, CheckWaterTile(chuchu), PlayerItemBottle_UseEmptyBottle, SPECIAL_TILE_137 -
// 140, sub_080AD040(playerItemHeldObject), FX_WATER_SPLASH
ACT_TILE_17 = 0x11, // -> SURFACE_14, sub_08085A44(lilypadLarge), sub_080AD040(playerItemHeldObject), FX_WATER_SPLASH
// 140, sub_080AD040(playerItemHeldObject), FX_WATER_SPLASH
ACT_TILE_17 =
0x11, // -> SURFACE_14, sub_08085A44(lilypadLarge), sub_080AD040(playerItemHeldObject), FX_WATER_SPLASH
ACT_TILE_18 = 0x12, // -> SURFACE_ICE, SPECIAL_TILE_117 - 124
ACT_TILE_19 = 0x13, // -> SURFACE_SWAMP, sub_0803163C(rope), sub_080AD040(playerItemHeldObject), FX_GREEN_SPLASH
ACT_TILE_20 = 0x14,
ACT_TILE_21 = 0x15,
ACT_TILE_22 = 0x16, // -> SURFACE_DUST
ACT_TILE_23 = 0x17, // -> SURFACE_2D
ACT_TILE_24 = 0x18, // -> SURFACE_16
ACT_TILE_25 = 0x19, // -> SURFACE_HOLE, CrenelBeanSprout_Action1, sub_08097144(objectOnPillar), sub_0808A644(pushableRock),
// sub_080701F8(playerItemPacciCaneProjectile)
ACT_TILE_25 = 0x19, // -> SURFACE_HOLE, CrenelBeanSprout_Action1, sub_08097144(objectOnPillar),
// sub_0808A644(pushableRock), sub_080701F8(playerItemPacciCaneProjectile)
ACT_TILE_26 = 0x1a,
ACT_TILE_27 = 0x1b, // -> SURFACE_BUTTON
ACT_TILE_28 = 0x1c,
Expand All @@ -1604,8 +1605,8 @@ typedef enum {
ACT_TILE_39 = 0x27, // -> SURFACE_SLOPE_GNDGND_H
ACT_TILE_40 = 0x28, // -> SURFACE_DOOR_13, SPECIAL_TILE_105, sub_080732D0(player), UpdateDoorTransition
ACT_TILE_41 = 0x29, // -> SURFACE_DOOR, sub_08076DF4(itemGustJar), Minecart_Action3, sub_080896B0(pushableStatue),
// SPECIAL_TILE_128, SPECIAL_TILE_131 - 136, SPECIAL_TILE_141, sub_080724DC(player),
// UpdateDoorTransition
// SPECIAL_TILE_128, SPECIAL_TILE_131 - 136, SPECIAL_TILE_141, sub_080724DC(player),
// UpdateDoorTransition
ACT_TILE_42 = 0x2a, // -> SURFACE_E, sub_080611D4(npc5)
ACT_TILE_43 = 0x2b, // -> SURFACE_D, sub_080611D4(npc5)
ACT_TILE_44 = 0x2c, // -> SURFACE_10, sub_080611D4(npc5)
Expand Down Expand Up @@ -1661,9 +1662,9 @@ typedef enum {
ACT_TILE_94 = 0x5e,
ACT_TILE_95 = 0x5f,
ACT_TILE_96 = 0x60,
ACT_TILE_97 = 0x61, // -> SURFACE_1B
ACT_TILE_98 = 0x62, // -> SURFACE_21
ACT_TILE_99 = 0x63, // -> SURFACE_24
ACT_TILE_97 = 0x61, // -> SURFACE_1B
ACT_TILE_98 = 0x62, // -> SURFACE_21
ACT_TILE_99 = 0x63, // -> SURFACE_24
ACT_TILE_100 = 0x64, // Minecart_Action3
ACT_TILE_101 = 0x65, // -> SURFACE_6, Minecart_Action3
ACT_TILE_102 = 0x66, // -> SURFACE_6, Minecart_Action3
Expand All @@ -1681,7 +1682,7 @@ typedef enum {
ACT_TILE_114 = 0x72,
ACT_TILE_115 = 0x73,
ACT_TILE_116 = 0x74, // -> SURFACE_EDGE, SPECIAL_TILE_126, SPECIAL_TILE_127, sub_08018E68(playerItemGustBig),
// sub_080AD040(playerItemHeldObject)
// sub_080AD040(playerItemHeldObject)
ACT_TILE_117 = 0x75,
ACT_TILE_240 = 0xf0, // -> SURFACE_HOLE, sub_0802F300(tektite), sub_0808A644(pushableRock), SPECIAL_TILE_32
ACT_TILE_241 = 0xf1, // -> SURFACE_LADDER, sub_0802F300(tektite), SPECIAL_TILE_20, UpdateDoorTransition
Expand Down
12 changes: 5 additions & 7 deletions src/beanstalkSubtask.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ u32 UpdatePlayerCollision(void) {
if (index != 0xff && (gRoomControls.scroll_flags & 4) == 0) {
ptr1 = &gUnk_080B4490[index * 2];
if (GetCollisionDataAtTilePos(COORD_TO_TILE_OFFSET(&gPlayerEntity.base, -ptr1[0], -ptr1[1]),
gPlayerEntity.base.collisionLayer) == COLLISION_DATA_255) {
gPlayerEntity.base.collisionLayer) == COLLISION_DATA_255) {
if ((((gPlayerState.flags & (PL_FLAGS10000 | PL_FLAGS2)) != 0) ||
((gPlayerState.sword_state & 0x10) != 0)) ||
((sub_080806BC(gPlayerEntity.base.x.HALF.HI - gRoomControls.origin_x,
Expand Down Expand Up @@ -934,8 +934,8 @@ bool32 sub_0801A980(void) {
const s16* ptr;
GetLayerByIndex(gPlayerEntity.base.collisionLayer); // TODO result unused?
ptr = &gUnk_080B44A8[gPlayerEntity.base.animationState & 6];
tileType =
GetTileTypeAtTilePos(COORD_TO_TILE_OFFSET(&gPlayerEntity.base, -ptr[0], -ptr[1]), gPlayerEntity.base.collisionLayer);
tileType = GetTileTypeAtTilePos(COORD_TO_TILE_OFFSET(&gPlayerEntity.base, -ptr[0], -ptr[1]),
gPlayerEntity.base.collisionLayer);
if (tileType < 0x4000) {
GetActTileForTileType(tileType);
}
Expand Down Expand Up @@ -1277,10 +1277,8 @@ void UnregisterInteractTile(u32 tilePos, s32 layer) {
}

const struct_080B44D0 gUnk_080B44D0[] = {
{ 0x67, SPECIAL_TILE_132 }, { 0x68, SPECIAL_TILE_133 },
{ 0x69, SPECIAL_TILE_134 }, { 0x6a, SPECIAL_TILE_135 },
{ 0x6b, SPECIAL_TILE_136 }, { 0x27, SPECIAL_TILE_131 },
{ 0x23, SPECIAL_TILE_141 }, { 0x0, 0x0 },
{ 0x67, SPECIAL_TILE_132 }, { 0x68, SPECIAL_TILE_133 }, { 0x69, SPECIAL_TILE_134 }, { 0x6a, SPECIAL_TILE_135 },
{ 0x6b, SPECIAL_TILE_136 }, { 0x27, SPECIAL_TILE_131 }, { 0x23, SPECIAL_TILE_141 }, { 0x0, 0x0 },
};

// used for minish houses, seems to overwrite all tiles with certain collision values on layer 1 for them?
Expand Down
2 changes: 1 addition & 1 deletion src/enemy/armos.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ bool32 sub_0803086C(ArmosEntity* this) {
centerY = super->y.HALF_U.HI - gRoomControls.origin_y;
// TODO for some reason the 0x3f of COORD_TO_TILE(super) needs to be forced to r2 here.
tilePos = ((((((super)->x.HALF.HI) - gRoomControls.origin_x) >> 4) & (r2 = 0x3f)) |
(((((super)->y.HALF.HI) - gRoomControls.origin_y) >> 4) & r2) << 6);
(((((super)->y.HALF.HI) - gRoomControls.origin_y) >> 4) & r2) << 6);

if (GetTileTypeAtTilePos(tilePos, super->collisionLayer) == SPECIAL_TILE_73) {
if (CheckPlayerInRegion(centerX, centerY, 2, 0xc) != 0) {
Expand Down
1 change: 0 additions & 1 deletion src/enemy/businessScrub.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "save.h"
#include "tiles.h"


struct SalesOffering {
u8 field_0x0;
u8 field_0x1;
Expand Down
7 changes: 3 additions & 4 deletions src/enemy/eyegore.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,11 +401,10 @@ void sub_08031024(EyegoreEntity* this) {
} else {
tmp2 = this->unk_7b >> 1;
uVar5 = GetTileTypeAtWorldCoords(super->x.HALF.HI + gUnk_080CE2C0[tmp2],
super->y.HALF.HI + gUnk_080CE2C0[tmp2 + 1], super->collisionLayer);
super->y.HALF.HI + gUnk_080CE2C0[tmp2 + 1], super->collisionLayer);
uVar8 = GetTileTypeAtWorldCoords(super->x.HALF.HI + gUnk_080CE2C0[tmp2 + 2],
super->y.HALF.HI + gUnk_080CE2C0[tmp2 + 3], super->collisionLayer);
if (!(((gMapTileTypeToCollisionData[uVar5] == 0) &&
(gMapTileTypeToCollisionData[uVar8] == 0)) ||
super->y.HALF.HI + gUnk_080CE2C0[tmp2 + 3], super->collisionLayer);
if (!(((gMapTileTypeToCollisionData[uVar5] == 0) && (gMapTileTypeToCollisionData[uVar8] == 0)) ||
((this->unk_7b | 1) & 1) == 0)) {
if (super->direction >> 3 == super->animationState) {
this->unk_78 |= 0x20;
Expand Down
4 changes: 2 additions & 2 deletions src/enemy/gyorgMale.c
Original file line number Diff line number Diff line change
Expand Up @@ -1070,8 +1070,8 @@ void sub_08047EA4(GyorgMaleEntity* this, u32 unk1) {
if (this->unk_7c & 1) {
tmp2 = sub_08047F68(this) << 8;
dir = CalculateDirectionFromOffsets(gPlayerEntity.base.x.HALF.HI - super->x.HALF.HI,
gPlayerEntity.base.y.HALF.HI - super->y.HALF.HI);

gPlayerEntity.base.y.HALF.HI - super->y.HALF.HI);
tmp = dir - (tmp / 256);
tmp &= 0xFF;
gPlayerEntity.base.x.WORD += (gSineTable[tmp] - gSineTable[dir]) * tmp2;
Expand Down
11 changes: 6 additions & 5 deletions src/enemy/octorokBoss.c
Original file line number Diff line number Diff line change
Expand Up @@ -690,9 +690,9 @@ void OctorokBoss_Action1_AimTowardsPlayer(OctorokBossEntity* this) {
s32 tmp1;
s32 tmp2;

tmp1 =
(u8)(CalculateDirectionFromOffsets(gPlayerEntity.base.x.WORD - super->x.WORD, gPlayerEntity.base.y.WORD - super->y.WORD) -
(((u8)(-this->angle.HALF.HI) ^ 0x80)));
tmp1 = (u8)(CalculateDirectionFromOffsets(gPlayerEntity.base.x.WORD - super->x.WORD,
gPlayerEntity.base.y.WORD - super->y.WORD) -
(((u8)(-this->angle.HALF.HI) ^ 0x80)));
if (IS_FROZEN(this) == FALSE) {
tmp2 = 8;
} else {
Expand Down Expand Up @@ -900,8 +900,9 @@ void OctorokBoss_ExecuteAttackVacuum(OctorokBossEntity* this) {

if (this->unk_80 == 0) {
super->direction =

CalculateDirectionFromOffsets(gPlayerEntity.base.x.WORD - super->x.WORD, gPlayerEntity.base.y.WORD - super->y.WORD);

CalculateDirectionFromOffsets(gPlayerEntity.base.x.WORD - super->x.WORD,
gPlayerEntity.base.y.WORD - super->y.WORD);
tmp = ((u8) - (this->angle.HALF.HI + 0x80)) - super->direction;
if (tmp < 0) {
tmp = -tmp;
Expand Down
2 changes: 1 addition & 1 deletion src/enemy/tektite.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ void sub_0802F300(TektiteEntity* this) {
} else if (super->collisions != COL_NONE) {
sub_0800417E(super, super->collisions);
} else if ((GetActTileAtEntity(super) & 0xf0) == 0x50) { // ACT_TILE_240 and ACT_TILE_241?
super->direction = (super->direction + 0x10) & (0x3 | DirectionNorthWest);
super->direction = (super->direction + 0x10) & (0x3 | DirectionNorthWest);
}

if (--super->timer == 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/item/itemMoleMitts.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ s32 sub_080774A0(void) {
u32 tilePos;

tilePos = COORD_TO_TILE_OFFSET((&gPlayerEntity.base), -gUnk_0811BE1E[gPlayerEntity.base.animationState & 6],
-gUnk_0811BE1E[(gPlayerEntity.base.animationState & 6) + 1]);
-gUnk_0811BE1E[(gPlayerEntity.base.animationState & 6) + 1]);

collisionData = GetCollisionDataAtTilePos(tilePos, gPlayerEntity.base.collisionLayer);

Expand Down
8 changes: 4 additions & 4 deletions src/manager/diggingCaveEntranceManager.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ void DiggingCaveEntranceManager_EnterEntrance(DiggingCaveEntranceManager* this,
gRoomControls.area = entr->targetArea;
gRoomControls.room = entr->targetRoom;
gDiggingCaveEntranceTransition.entrance = entr;
gDiggingCaveEntranceTransition.offsetX = gPlayerEntity.base.x.HALF.HI - gRoomControls.origin_x -
((entr->sourceTilePos & TILE_POS_X_COMPONENT) * 16);
gDiggingCaveEntranceTransition.offsetY = gPlayerEntity.base.y.HALF.HI - gRoomControls.origin_y -
((entr->sourceTilePos & TILE_POS_Y_COMPONENT) >> 2);
gDiggingCaveEntranceTransition.offsetX =
gPlayerEntity.base.x.HALF.HI - gRoomControls.origin_x - ((entr->sourceTilePos & TILE_POS_X_COMPONENT) * 16);
gDiggingCaveEntranceTransition.offsetY =
gPlayerEntity.base.y.HALF.HI - gRoomControls.origin_y - ((entr->sourceTilePos & TILE_POS_Y_COMPONENT) >> 2);

#ifndef EU
isDiggingCave = gDiggingCaveEntranceTransition.isDiggingCave;
Expand Down
Loading

0 comments on commit e4a600d

Please sign in to comment.