Fix format

This commit is contained in:
octorock 2024-01-06 18:22:00 +01:00
parent 560dfa45b1
commit 1ecc23d534
46 changed files with 291 additions and 295 deletions

View File

@ -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);
@ -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);
@ -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.
*/
@ -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 {

View File

@ -79,7 +79,9 @@
#define ASM_FUNC(path, decl)
#else
#define ASM_FUNC(path, decl) \
NAKED decl { asm(".include " #path); }
NAKED decl { \
asm(".include " #path); \
}
#endif
#if NON_MATCHING

View File

@ -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

View File

@ -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.
@ -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];

View File

@ -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;

View File

@ -1,7 +1,6 @@
#ifndef TILES_H
#define TILES_H
typedef enum {
TILE_TYPE_0 = 0x0,
TILE_TYPE_1 = 0x1,
@ -1572,13 +1571,15 @@ typedef enum {
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,
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
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,
@ -1586,8 +1587,8 @@ typedef enum {
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,

View File

@ -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);
}
@ -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?

View File

@ -15,7 +15,6 @@
#include "save.h"
#include "tiles.h"
struct SalesOffering {
u8 field_0x0;
u8 field_0x1;

View File

@ -404,8 +404,7 @@ void sub_08031024(EyegoreEntity* this) {
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)) ||
if (!(((gMapTileTypeToCollisionData[uVar5] == 0) && (gMapTileTypeToCollisionData[uVar8] == 0)) ||
((this->unk_7b | 1) & 1) == 0)) {
if (super->direction >> 3 == super->animationState) {
this->unk_78 |= 0x20;

View File

@ -690,8 +690,8 @@ 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) -
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;
@ -901,7 +901,8 @@ 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;

View File

@ -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;

View File

@ -14,20 +14,20 @@
void FlameManager_Main(FlameManager* this) {
if (super->action == 0) {
this->tilePos = TILE(this->tilePos, this->field_0x3a);
if (GetTileTypeAtTilePos(this->tilePos, LAYER_TOP) == TILE_TYPE_117) {
this->x = TILE(this->x, this->y);
if (GetTileTypeAtTilePos(this->x, LAYER_TOP) == TILE_TYPE_117) {
super->action = 1;
SetTile(SPECIAL_TILE_106, this->tilePos, LAYER_BOTTOM);
SetTile(SPECIAL_TILE_106, this->x, LAYER_BOTTOM);
} else {
DeleteThisEntity();
}
}
if (GetTileTypeAtTilePos(this->tilePos, LAYER_BOTTOM) == SPECIAL_TILE_107) {
sub_0807B7D8(TILE_TYPE_118, this->tilePos, LAYER_TOP);
if (GetTileTypeAtTilePos(this->x, LAYER_BOTTOM) == SPECIAL_TILE_107) {
sub_0807B7D8(TILE_TYPE_118, this->x, LAYER_TOP);
DeleteThisEntity();
}
if (GetTileTypeAtTilePos(this->tilePos, LAYER_TOP) == TILE_TYPE_118) {
SetTile(SPECIAL_TILE_107, this->tilePos, LAYER_BOTTOM);
if (GetTileTypeAtTilePos(this->x, LAYER_TOP) == TILE_TYPE_118) {
SetTile(SPECIAL_TILE_107, this->x, LAYER_BOTTOM);
DeleteThisEntity();
}
}

View File

@ -35,14 +35,14 @@ typedef struct struct_08108764 {
u16 unk_06;
u16 unk_08;
u16 unk_0a;
}* unk_0c;
} * unk_0c;
struct {
u8 unk_00;
u8 unk_01;
u8 unk_02[2];
u16 unk_04;
u16 unk_06;
}* unk_10;
} * unk_10;
} struct_08108764;
extern struct_08108764 gUnk_08108764[];

View File

@ -488,9 +488,7 @@ void sub_0805A9CC(TempleOfDropletsManager* this) {
gScreen.bg3.updated = 1;
}
extern struct {
u8 unk_00[0x20];
} gUnk_085A97A0[];
extern struct { u8 unk_00[0x20]; } gUnk_085A97A0[];
void sub_0805AA58(TempleOfDropletsManager* this) {
if (--super->timer == 0) {

View File

@ -531,7 +531,8 @@ u32 CalcJumpDirection(Entity* this) {
static const u8 sTable[] = {
// actTile, animationState
ACT_TILE_43, DirectionSouth, ACT_TILE_42, DirectionNorth, ACT_TILE_45, DirectionEast, ACT_TILE_44, DirectionWest, 0x0,
ACT_TILE_43, DirectionSouth, ACT_TILE_42, DirectionNorth, ACT_TILE_45, DirectionEast,
ACT_TILE_44, DirectionWest, 0x0,
};
u32 actTile;

View File

@ -182,7 +182,9 @@ const NPCDefinition gNPCDefinition_52[] = {
#define MULTI_FORM(definition_ptr) \
{ \
{ 2, 0, 0, 0, 0, 0, 0 }, { .definition = (definition_ptr) } \
{ 2, 0, 0, 0, 0, 0, 0 }, { \
.definition = (definition_ptr) \
} \
}
const NPCDefinition gNPCDefinitions[] = {

View File

@ -188,10 +188,9 @@ void sub_0809B334(DoubleBookshelfEntity* this) {
}
void sub_0809B358(DoubleBookshelfEntity* this) {
static const u16 gUnk_08123D68[] = { SPECIAL_TILE_34, SPECIAL_TILE_34, SPECIAL_TILE_116,
SPECIAL_TILE_38, SPECIAL_TILE_116, SPECIAL_TILE_116,
SPECIAL_TILE_38, SPECIAL_TILE_116, SPECIAL_TILE_34,
SPECIAL_TILE_34 };
static const u16 gUnk_08123D68[] = { SPECIAL_TILE_34, SPECIAL_TILE_34, SPECIAL_TILE_116, SPECIAL_TILE_38,
SPECIAL_TILE_116, SPECIAL_TILE_116, SPECIAL_TILE_38, SPECIAL_TILE_116,
SPECIAL_TILE_34, SPECIAL_TILE_34 };
s32 index;
const u16* array = &gUnk_08123D68[this->unk_84];
u32 tilePos = this->tilePos + TILE_POS(-2, -2);

View File

@ -82,11 +82,13 @@ void EvilSpirit_Action1(EvilSpiritEntity* this) {
this->unk76 = this->unk7c;
this->unk7a = this->unk7c;
super->speed = 0x300;
super->direction =
CalculateDirectionFromOffsets(super->parent->x.WORD - super->x.WORD, super->parent->y.WORD - super->y.WORD) ^ 0x80;
super->direction = CalculateDirectionFromOffsets(super->parent->x.WORD - super->x.WORD,
super->parent->y.WORD - super->y.WORD) ^
0x80;
} else {
super->speed = 0x600;
dir = CalculateDirectionFromOffsets(gPlayerEntity.base.x.WORD - super->x.WORD, gPlayerEntity.base.y.WORD - super->y.WORD) ^
dir = CalculateDirectionFromOffsets(gPlayerEntity.base.x.WORD - super->x.WORD,
gPlayerEntity.base.y.WORD - super->y.WORD) ^
0x80;
if (dir != super->direction) {
if ((u8)(dir - super->direction) > 0x80) {

View File

@ -338,8 +338,7 @@ static void FurnitureUpdate(FurnitureEntity* this) {
break;
case 0x80:
if (gPlayerEntity.base.y.HALF.HI < super->y.HALF.HI + 8) {
if (gPlayerState.floor_type != SURFACE_LADDER &&
GetTileTypeAtEntity(super) == SPECIAL_TILE_23) {
if (gPlayerState.floor_type != SURFACE_LADDER && GetTileTypeAtEntity(super) == SPECIAL_TILE_23) {
SetTile(SPECIAL_TILE_38, this->tilePos, super->collisionLayer);
SetTile(SPECIAL_TILE_61, this->tilePos + TILE_POS(0, -1), super->collisionLayer);
SetTile(SPECIAL_TILE_61, this->tilePos + TILE_POS(0, -2), super->collisionLayer);

View File

@ -284,8 +284,7 @@ void sub_080812A0(ItemOnGroundEntity* this) {
}
void sub_080812A8(ItemOnGroundEntity* this) {
if (GetCollisionDataAtEntity(super) != COLLISION_DATA_15 &&
this->unk_6e != GetTileTypeAtEntity(super)) {
if (GetCollisionDataAtEntity(super) != COLLISION_DATA_15 && this->unk_6e != GetTileTypeAtEntity(super)) {
super->direction = 0;
super->speed = 0;
super->spriteSettings.draw = 1;

View File

@ -66,8 +66,7 @@ void LadderUp(Entity* this) {
default:
if (this->type2 == 0) {
if (gPlayerEntity.base.y.HALF.HI < this->y.HALF.HI) {
if (gPlayerState.floor_type != SURFACE_LADDER &&
(GetTileTypeAtEntity(this) == SPECIAL_TILE_23)) {
if (gPlayerState.floor_type != SURFACE_LADDER && (GetTileTypeAtEntity(this) == SPECIAL_TILE_23)) {
SetTile(SPECIAL_TILE_35, COORD_TO_TILE(this), this->collisionLayer);
RestorePrevTileEntity(COORD_TO_TILE_OFFSET(this, 0, 16), this->collisionLayer);
}

View File

@ -15,7 +15,6 @@
#include "sound.h"
#include "tiles.h"
typedef struct {
/*0x00*/ Entity base;
/*0x68*/ u8 unused1[8];

View File

@ -82,16 +82,11 @@ void MacroDecoration_Action1(MacroDecorationEntity* this) {
void sub_08097EB8(MacroDecorationEntity* this) {
static const s16 tilePosArray[] = {
0xff7e, SPECIAL_TILE_137, 0xff7f, SPECIAL_TILE_34,
0xff80, SPECIAL_TILE_34, 0xff81, SPECIAL_TILE_138,
0xffbe, SPECIAL_TILE_34, 0xffbf, SPECIAL_TILE_34,
0xffc0, SPECIAL_TILE_34, 0xffc1, SPECIAL_TILE_34,
0xfffe, SPECIAL_TILE_34, 0xffff, SPECIAL_TILE_34,
0, SPECIAL_TILE_34, 1, SPECIAL_TILE_34,
2, SPECIAL_TILE_139, 0x3e, SPECIAL_TILE_34,
0x3f, SPECIAL_TILE_34, 0x40, SPECIAL_TILE_38,
0x41, SPECIAL_TILE_34, 0x7e, SPECIAL_TILE_140,
0x7f, SPECIAL_TILE_140, 0x7fff, 0xffff,
0xff7e, SPECIAL_TILE_137, 0xff7f, SPECIAL_TILE_34, 0xff80, SPECIAL_TILE_34, 0xff81, SPECIAL_TILE_138,
0xffbe, SPECIAL_TILE_34, 0xffbf, SPECIAL_TILE_34, 0xffc0, SPECIAL_TILE_34, 0xffc1, SPECIAL_TILE_34,
0xfffe, SPECIAL_TILE_34, 0xffff, SPECIAL_TILE_34, 0, SPECIAL_TILE_34, 1, SPECIAL_TILE_34,
2, SPECIAL_TILE_139, 0x3e, SPECIAL_TILE_34, 0x3f, SPECIAL_TILE_34, 0x40, SPECIAL_TILE_38,
0x41, SPECIAL_TILE_34, 0x7e, SPECIAL_TILE_140, 0x7f, SPECIAL_TILE_140, 0x7fff, 0xffff,
};
const s16* tilePosPtr;
u16 tilePos = COORD_TO_TILE(super);

View File

@ -343,18 +343,22 @@ const KeyValuePair* const gUnk_081223D8[] = {
gUnk_08122436,
};
const KeyValuePair gUnk_081223E8[] = {
{ ACT_TILE_242, 1 }, { ACT_TILE_101, 1 }, { ACT_TILE_104, 1 }, { ACT_TILE_106, 1 }, { ACT_TILE_100, 1 }, { ACT_TILE_41, 1 },
{ ACT_TILE_242, 1 }, { ACT_TILE_101, 1 }, { ACT_TILE_104, 1 },
{ ACT_TILE_106, 1 }, { ACT_TILE_100, 1 }, { ACT_TILE_41, 1 },
};
const u16 gUnk_081223E8End = 0;
const KeyValuePair gUnk_08122402[] = {
{ ACT_TILE_243, 1 }, { ACT_TILE_102, 1 }, { ACT_TILE_104, 1 }, { ACT_TILE_105, 1 }, { ACT_TILE_100, 1 }, { ACT_TILE_41, 1 },
{ ACT_TILE_243, 1 }, { ACT_TILE_102, 1 }, { ACT_TILE_104, 1 },
{ ACT_TILE_105, 1 }, { ACT_TILE_100, 1 }, { ACT_TILE_41, 1 },
};
const u16 gUnk_08122402End = 0;
const KeyValuePair gUnk_0812241C[] = {
{ ACT_TILE_242, 1 }, { ACT_TILE_101, 1 }, { ACT_TILE_103, 1 }, { ACT_TILE_105, 1 }, { ACT_TILE_100, 1 }, { ACT_TILE_41, 1 },
{ ACT_TILE_242, 1 }, { ACT_TILE_101, 1 }, { ACT_TILE_103, 1 },
{ ACT_TILE_105, 1 }, { ACT_TILE_100, 1 }, { ACT_TILE_41, 1 },
};
const u16 gUnk_0812241CEnd = 0;
const KeyValuePair gUnk_08122436[] = {
{ ACT_TILE_243, 1 }, { ACT_TILE_102, 1 }, { ACT_TILE_106, 1 }, { ACT_TILE_103, 1 }, { ACT_TILE_100, 1 }, { ACT_TILE_41, 1 },
{ ACT_TILE_243, 1 }, { ACT_TILE_102, 1 }, { ACT_TILE_106, 1 },
{ ACT_TILE_103, 1 }, { ACT_TILE_100, 1 }, { ACT_TILE_41, 1 },
};
const u16 gUnk_08122436End = 0;

View File

@ -191,8 +191,8 @@ void sub_08084CAC(PlayerCloneEntity* this) {
if (((PlayerCloneEntity*)gPlayerClones[super->type])->unk70 == 0) {
ptr = &gUnk_080B4468[super->animationState & 6];
if (GetActTileForTileType(
GetTileTypeAtTilePos(COORD_TO_TILE_OFFSET(super, -ptr[0], -ptr[1]), super->collisionLayer)) == ACT_TILE_114) {
if (GetActTileForTileType(GetTileTypeAtTilePos(COORD_TO_TILE_OFFSET(super, -ptr[0], -ptr[1]),
super->collisionLayer)) == ACT_TILE_114) {
((PlayerCloneEntity*)gPlayerClones[0])->unk6c |= (1 << super->type);
} else {
((PlayerCloneEntity*)gPlayerClones[0])->unk6c &= ~(1 << super->type);

View File

@ -618,8 +618,7 @@ void (*const PushableFurniture_Actions[])(PushableFurnitureEntity*) = {
PushableFurniture_Action2,
};
const u16 gUnk_08121EE4[] = {
SPECIAL_TILE_43, SPECIAL_TILE_34, SPECIAL_TILE_44,
SPECIAL_TILE_36, SPECIAL_TILE_45, SPECIAL_TILE_37,
SPECIAL_TILE_43, SPECIAL_TILE_34, SPECIAL_TILE_44, SPECIAL_TILE_36, SPECIAL_TILE_45, SPECIAL_TILE_37,
};
const u16 gUnk_08121EF0[] = {
SPECIAL_TILE_38,

View File

@ -27,19 +27,8 @@ void StoneTablet_Init(Entity* this) {
SPECIAL_TILE_34, -2, SPECIAL_TILE_34, -1, SPECIAL_TILE_34, 0, SPECIAL_TILE_34, 1, 0xffff,
};
static const u16 gUnk_081232FE[] = {
SPECIAL_TILE_101,
-65,
SPECIAL_TILE_34,
-64,
SPECIAL_TILE_102,
-63,
SPECIAL_TILE_41,
-1,
SPECIAL_TILE_38,
0,
SPECIAL_TILE_42,
1,
0xffff,
SPECIAL_TILE_101, -65, SPECIAL_TILE_34, -64, SPECIAL_TILE_102, -63, SPECIAL_TILE_41, -1,
SPECIAL_TILE_38, 0, SPECIAL_TILE_42, 1, 0xffff,
};
this->action = 1;
this->spriteSettings.draw = 1;

View File

@ -1433,7 +1433,9 @@ const ObjectDefinition gObjectDefinition_0[] = {
#define MULTI_FORM(definition_ptr) \
{ \
{ 2, 0, 0, 0, 0, 0, 0 }, { .definition = definition_ptr } \
{ 2, 0, 0, 0, 0, 0, 0 }, { \
.definition = definition_ptr \
} \
}
const ObjectDefinition gObjectDefinitions[] = {
MULTI_FORM(gObjectDefinition_0),

View File

@ -342,7 +342,8 @@ void PlayerItemCellOverwriteSet(PlayerItemCellOverwriteSetEntity* this) {
Entity* player = &gPlayerEntity.base;
if (super->action == 0) {
this->tileType = GetTileTypeAtTilePos(TILE(player->x.HALF.HI + offsetByDirection[player->animationState & 0xe],
this->tileType =
GetTileTypeAtTilePos(TILE(player->x.HALF.HI + offsetByDirection[player->animationState & 0xe],
player->y.HALF.HI + offsetByDirection[(player->animationState & 0xe) + 1]),
super->collisionLayer);
super->action++;
@ -351,7 +352,8 @@ void PlayerItemCellOverwriteSet(PlayerItemCellOverwriteSetEntity* this) {
tmp = gInput.heldKeys & R_BUTTON;
if ((gInput.heldKeys & A_BUTTON) != 0) {
if ((gInput.newKeys & R_BUTTON) != 0) {
this->tileType = GetTileTypeAtTilePos(TILE(player->x.HALF.HI + offsetByDirection[player->animationState & 0xe],
this->tileType =
GetTileTypeAtTilePos(TILE(player->x.HALF.HI + offsetByDirection[player->animationState & 0xe],
player->y.HALF.HI + offsetByDirection[(player->animationState & 0xe) + 1]),
super->collisionLayer);
}
@ -387,13 +389,17 @@ void PlayerItemCellOverwriteSet(PlayerItemCellOverwriteSetEntity* this) {
DeleteThisEntity();
}
if ((gInput.heldKeys & B_BUTTON) != 0) {
sub_0807B7D8(this->tileType, TILE(player->x.HALF.HI + offsetByDirection[0], player->y.HALF.HI + offsetByDirection[1]),
sub_0807B7D8(this->tileType,
TILE(player->x.HALF.HI + offsetByDirection[0], player->y.HALF.HI + offsetByDirection[1]),
super->collisionLayer);
sub_0807B7D8(this->tileType, TILE(player->x.HALF.HI + offsetByDirection[2], player->y.HALF.HI + offsetByDirection[3]),
sub_0807B7D8(this->tileType,
TILE(player->x.HALF.HI + offsetByDirection[2], player->y.HALF.HI + offsetByDirection[3]),
super->collisionLayer);
sub_0807B7D8(this->tileType, TILE(player->x.HALF.HI + offsetByDirection[4], player->y.HALF.HI + offsetByDirection[5]),
sub_0807B7D8(this->tileType,
TILE(player->x.HALF.HI + offsetByDirection[4], player->y.HALF.HI + offsetByDirection[5]),
super->collisionLayer);
sub_0807B7D8(this->tileType, TILE(player->x.HALF.HI + offsetByDirection[6], player->y.HALF.HI + offsetByDirection[7]),
sub_0807B7D8(this->tileType,
TILE(player->x.HALF.HI + offsetByDirection[6], player->y.HALF.HI + offsetByDirection[7]),
super->collisionLayer);
}
}

View File

@ -897,8 +897,10 @@ void sub_08077F84(void) {
Entity* obj;
if ((gPlayerEntity.base.collisionLayer & 2) == 0) {
u32 tileType = GetTileTypeAtWorldCoords(gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI - 12, LAYER_TOP);
if (tileType == TILE_TYPE_835 || tileType == TILE_TYPE_836 || tileType == TILE_TYPE_837 || tileType == TILE_TYPE_838) {
u32 tileType =
GetTileTypeAtWorldCoords(gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI - 12, LAYER_TOP);
if (tileType == TILE_TYPE_835 || tileType == TILE_TYPE_836 || tileType == TILE_TYPE_837 ||
tileType == TILE_TYPE_838) {
sub_0807AA80(&gPlayerEntity.base);
gPlayerState.jump_status |= 8;
obj = CreateObject(ROTATING_TRAPDOOR, 0, 0);
@ -1968,7 +1970,8 @@ void RespawnPlayer(void) {
} else {
u32 i;
for (i = 0; i <= 0xf && gPlayerState.path_memory[i] != -1; i++) {
if (GetCollisionDataAtTilePos((u16)gPlayerState.path_memory[i], gPlayerState.path_memory[i] >> 0x1e) != COLLISION_DATA_15) {
if (GetCollisionDataAtTilePos((u16)gPlayerState.path_memory[i], gPlayerState.path_memory[i] >> 0x1e) !=
COLLISION_DATA_15) {
gPlayerEntity.base.collisionLayer = gPlayerState.path_memory[i] >> 0x1e;
gPlayerEntity.base.x.HALF.HI =
gRoomControls.origin_x + (gPlayerState.path_memory[i] & 0x3f) * 16 + 8;
@ -2354,13 +2357,16 @@ bool32 sub_08079C30(Entity* player) {
return TRUE;
}
if (gPlayerState.floor_type != FindValueForKey(GetActTileRelativeToEntity(player, 0, -1), gMapActTileToSurfaceType))
if (gPlayerState.floor_type !=
FindValueForKey(GetActTileRelativeToEntity(player, 0, -1), gMapActTileToSurfaceType))
return FALSE;
if (gPlayerState.floor_type != FindValueForKey(GetActTileRelativeToEntity(player, 2, 0), gMapActTileToSurfaceType))
if (gPlayerState.floor_type !=
FindValueForKey(GetActTileRelativeToEntity(player, 2, 0), gMapActTileToSurfaceType))
return FALSE;
if (gPlayerState.floor_type == FindValueForKey(GetActTileRelativeToEntity(player, -2, 0), gMapActTileToSurfaceType)) {
if (gPlayerState.floor_type ==
FindValueForKey(GetActTileRelativeToEntity(player, -2, 0), gMapActTileToSurfaceType)) {
return TRUE;
}
}
@ -2593,7 +2599,8 @@ void UpdateFloorType(void) {
SurfaceType GetSurfaceCalcType(Entity* param_1, s32 x, s32 y) {
u32 position = TILE(param_1->x.HALF.HI + (u32)x, param_1->y.HALF.HI + y);
u32 tileType = GetTileTypeAtWorldCoords(param_1->x.HALF.HI + x, param_1->y.HALF.HI + y, gPlayerEntity.base.collisionLayer);
u32 tileType =
GetTileTypeAtWorldCoords(param_1->x.HALF.HI + x, param_1->y.HALF.HI + y, gPlayerEntity.base.collisionLayer);
if (tileType != gPlayerState.tileType) {
gPlayerState.surfaceTimer = 0;
}

View File

@ -246,8 +246,7 @@ void sub_080AA9E0(Entity* this) {
}
void sub_080AAA68(Entity* this) {
static const u16 typeTiles[] = { SPECIAL_TILE_35, SPECIAL_TILE_37, SPECIAL_TILE_38,
SPECIAL_TILE_36 };
static const u16 typeTiles[] = { SPECIAL_TILE_35, SPECIAL_TILE_37, SPECIAL_TILE_38, SPECIAL_TILE_36 };
SetTile(typeTiles[this->type], TILE(this->x.HALF.HI, this->y.HALF.HI), this->collisionLayer);
}

View File

@ -201,9 +201,8 @@ static void sub_0804B058(EntityData* dat) {
if (EnemyEnableRespawn(uVar2) != 0) {
ent = LoadRoomEntity(dat);
if ((ent != NULL) && (ent->kind == ENEMY)) {
((Enemy*)ent)->idx =
uVar2 | 0x80; // TODO Set the room tracker flag that can be set by the enemy so it does not
// appear next time the room is visited?
((Enemy*)ent)->idx = uVar2 | 0x80; // TODO Set the room tracker flag that can be set by the
// enemy so it does not appear next time the room is visited?
}
}
} else {

View File

@ -629,8 +629,7 @@ void ButtonUIElement_Action1(UIElement* element) {
MAX_MOVEMENT = (!element->type2) ? 4 : 8;
if (element->type2 == 0 &&
(((gHUD.hideFlags >> element->type) & 1) || (gMessage.state & MESSAGE_ACTIVE) != 0)) {
if (element->type2 == 0 && (((gHUD.hideFlags >> element->type) & 1) || (gMessage.state & MESSAGE_ACTIVE) != 0)) {
y = (s16)gHUD.buttonY[element->type] - 0x28;
} else {
y = (s16)gHUD.buttonY[element->type];

View File

@ -61,8 +61,7 @@ void sub_08055994(void) {
layer = LAYER_BOTTOM;
}
SetTileType(TILE_TYPE_115,
(*(u16*)(gMenu.field_0xc + 8) >> 4 & 0x3f) | (*(u16*)(gMenu.field_0xc + 10) >> 4 & 0x3f) << 6,
layer);
(*(u16*)(gMenu.field_0xc + 8) >> 4 & 0x3f) | (*(u16*)(gMenu.field_0xc + 10) >> 4 & 0x3f) << 6, layer);
sub_080553E0((u32)gMenu.field_0x4);
SoundReq(SFX_SECRET_BIG);
}