Rename metaTiles

Now the 16x16 tiles are just called tiles and the 8x8 tiles are called subTiles.
This commit is contained in:
octorock
2024-01-06 14:59:48 +01:00
parent c3b771a209
commit aced0bef69
195 changed files with 9739 additions and 9736 deletions
+146 -146
View File
@@ -54,9 +54,9 @@ extern const Data gUnk_080B44C2[];
void sub_0801AD6C(const Data*, u32);
bool32 sub_0801A4F8(void);
bool32 sub_0801AA58(Entity*, u32, u32);
void RenderMapLayerToTileMap(u16* tileMap, MapLayer* mapLayer);
void RenderMapLayerToSubTileMap(u16* subTileMap, MapLayer* mapLayer);
u32 GetMetaTileSetIndexForSpecialTile(u32 position, u32 data);
u32 GetTileSetIndexForSpecialTile(u32 position, u32 tileIndex);
extern u32 sub_0807BDB8(Entity* this, u32 param_2);
extern void sub_0804B388(u32 a1, u32 a2);
@@ -202,7 +202,7 @@ u32 UpdatePlayerCollision(void) {
index = sub_0807BDB8(&gPlayerEntity.base, direction >> 2);
if (index != 0xff && (gRoomControls.scroll_flags & 4) == 0) {
ptr1 = &gUnk_080B4490[index * 2];
if (GetCollisionDataAtMetaTilePos(COORD_TO_TILE_OFFSET(&gPlayerEntity.base, -ptr1[0], -ptr1[1]),
if (GetCollisionDataAtTilePos(COORD_TO_TILE_OFFSET(&gPlayerEntity.base, -ptr1[0], -ptr1[1]),
gPlayerEntity.base.collisionLayer) == COLLISION_DATA_255) {
if ((((gPlayerState.flags & (PL_FLAGS10000 | PL_FLAGS2)) != 0) ||
((gPlayerState.sword_state & 0x10) != 0)) ||
@@ -220,9 +220,9 @@ u32 UpdatePlayerCollision(void) {
mapLayer = GetLayerByIndex(gPlayerEntity.base.collisionLayer);
ptr1 = &gUnk_080B4468[gPlayerEntity.base.animationState & 6];
position = COORD_TO_TILE_OFFSET(&gPlayerEntity.base, -ptr1[0], -ptr1[1]);
tileType = GetMetaTileType(position, gPlayerEntity.base.collisionLayer);
tileType = GetTileType(position, gPlayerEntity.base.collisionLayer);
if (tileType < 0x4000) {
direction = GetVvvForMetaTileType(tileType);
direction = GetVvvForTileType(tileType);
} else {
direction = tileType;
}
@@ -230,7 +230,7 @@ u32 UpdatePlayerCollision(void) {
animationState2 = animationState1 & 0xff;
switch (direction) {
case SPECIAL_META_TILE_0:
case SPECIAL_TILE_0:
if (sub_0801A458(mapLayer, position, 2) == 0) {
return 0;
}
@@ -261,7 +261,7 @@ u32 UpdatePlayerCollision(void) {
if ((gPlayerEntity.base.direction & DIR_NOT_MOVING_CHECK) != 0) {
return 0;
}
if (GetCollisionDataAtMetaTilePos(position, gPlayerEntity.base.collisionLayer) != COLLISION_DATA_15) {
if (GetCollisionDataAtTilePos(position, gPlayerEntity.base.collisionLayer) != COLLISION_DATA_15) {
return 0;
}
if (sub_08079778() == 0) {
@@ -281,12 +281,12 @@ u32 UpdatePlayerCollision(void) {
}
sub_08078AC0(4, 0, 1);
return 0;
case SPECIAL_META_TILE_27:
case SPECIAL_TILE_27:
if (sub_0801A2B0(mapLayer, position, 0xb) == 0) {
return 0;
}
// Start moving the boulder.
mapLayer->mapData[position] = SPECIAL_META_TILE_28 + (gPlayerEntity.base.animationState / 2);
mapLayer->mapData[position] = SPECIAL_TILE_28 + (gPlayerEntity.base.animationState / 2);
gPlayerState.pushedObject = 0xa0;
gPlayerState.queued_action = PLAYER_PUSH;
gPlayerState.flags |= PL_BUSY;
@@ -306,7 +306,7 @@ u32 UpdatePlayerCollision(void) {
return 0;
case VVV_58:
case VVV_91:
case SPECIAL_META_TILE_81:
case SPECIAL_TILE_81:
if (gPlayerState.flags & PL_MINISH) {
return 0;
}
@@ -346,7 +346,7 @@ u32 UpdatePlayerCollision(void) {
sub_0804B388(position, gPlayerEntity.base.collisionLayer);
return 2;
case VVV_61:
case SPECIAL_META_TILE_64 ... SPECIAL_META_TILE_72:
case SPECIAL_TILE_64 ... SPECIAL_TILE_72:
if ((gPlayerState.flags & PL_DRUGGED) != 0) {
return 0;
}
@@ -374,14 +374,14 @@ u32 UpdatePlayerCollision(void) {
gPlayerEntity.base.zVelocity = 0x20000;
COLLISION_OFF(&gPlayerEntity.base);
return 1;
case SPECIAL_META_TILE_11:
case SPECIAL_TILE_11:
if (sub_0801A2B0(mapLayer, position, 8) == 0) {
return 0;
}
if ((gPlayerEntity.base.collisionLayer == 3) && (gMapTop.mapData[position] == SPECIAL_META_TILE_11)) {
gMapTop.mapData[position] = SPECIAL_META_TILE_12 + (gPlayerEntity.base.animationState >> 1);
if ((gPlayerEntity.base.collisionLayer == 3) && (gMapTop.mapData[position] == SPECIAL_TILE_11)) {
gMapTop.mapData[position] = SPECIAL_TILE_12 + (gPlayerEntity.base.animationState >> 1);
} else {
mapLayer->mapData[position] = SPECIAL_META_TILE_12 + (gPlayerEntity.base.animationState >> 1);
mapLayer->mapData[position] = SPECIAL_TILE_12 + (gPlayerEntity.base.animationState >> 1);
}
gPlayerState.pushedObject = 0xa0;
gPlayerState.queued_action = PLAYER_PUSH;
@@ -390,12 +390,12 @@ u32 UpdatePlayerCollision(void) {
gPlayerEntity.base.y.HALF.LO = 0;
gPlayerEntity.base.direction = Direction8FromAnimationState(gPlayerEntity.base.animationState);
return 1;
case SPECIAL_META_TILE_90:
case SPECIAL_TILE_90:
if (sub_0801A2B0(mapLayer, position, 2) == 0) {
return 0;
}
// Move ice block.
mapLayer->mapData[position] = SPECIAL_META_TILE_91 + (gPlayerEntity.base.animationState >> 1);
mapLayer->mapData[position] = SPECIAL_TILE_91 + (gPlayerEntity.base.animationState >> 1);
gPlayerState.pushedObject = 0x98;
gPlayerState.queued_action = PLAYER_PUSH;
gPlayerState.flags |= PL_BUSY;
@@ -403,11 +403,11 @@ u32 UpdatePlayerCollision(void) {
gPlayerEntity.base.y.HALF.LO = 0;
gPlayerEntity.base.direction = Direction8FromAnimationState(gPlayerEntity.base.animationState);
return 1;
case SPECIAL_META_TILE_54:
case SPECIAL_TILE_54:
if (sub_0801A2B0(mapLayer, position, 0xb) == 0) {
return 0;
}
mapLayer->mapData[position] = SPECIAL_META_TILE_55 + (gPlayerEntity.base.animationState >> 1);
mapLayer->mapData[position] = SPECIAL_TILE_55 + (gPlayerEntity.base.animationState >> 1);
gPlayerState.pushedObject = 0xa0;
gPlayerState.queued_action = PLAYER_PUSH;
gPlayerState.flags |= PL_BUSY;
@@ -415,7 +415,7 @@ u32 UpdatePlayerCollision(void) {
gPlayerEntity.base.y.HALF.LO = 0;
gPlayerEntity.base.direction = Direction8FromAnimationState(gPlayerEntity.base.animationState);
return 1;
case SPECIAL_META_TILE_62:
case SPECIAL_TILE_62:
if ((animationState1 & 0xff) != 0) {
return 0;
}
@@ -425,7 +425,7 @@ u32 UpdatePlayerCollision(void) {
if ((gPlayerEntity.base.frame & 2) == 0) {
return 0;
}
mapLayer->mapData[position] = SPECIAL_META_TILE_63;
mapLayer->mapData[position] = SPECIAL_TILE_63;
gPlayerState.pushedObject = 0x82;
gPlayerState.queued_action = PLAYER_PUSH;
gPlayerState.flags |= PL_BUSY;
@@ -474,9 +474,9 @@ u32 UpdatePlayerCollision(void) {
gPlayerEntity.base.y.HALF.LO = 0;
gPlayerEntity.base.direction = pushedBlock->direction;
return 1;
case SPECIAL_META_TILE_43 ... SPECIAL_META_TILE_45:
case SPECIAL_TILE_43 ... SPECIAL_TILE_45:
if (sub_0801A370(mapLayer, position) != 0) {
mapLayer->mapData[position] = SPECIAL_META_TILE_48 + ((gPlayerEntity.base.animationState & 4) >> 2);
mapLayer->mapData[position] = SPECIAL_TILE_48 + ((gPlayerEntity.base.animationState & 4) >> 2);
if ((gPlayerState.flags & PL_MINISH) != 0) {
gPlayerState.pushedObject = 0xa0;
} else {
@@ -491,11 +491,11 @@ u32 UpdatePlayerCollision(void) {
} else {
return 0;
}
case SPECIAL_META_TILE_74:
case SPECIAL_TILE_74:
if (sub_0801A458(mapLayer, position, 8) == 0) {
return 0;
}
mapLayer->mapData[position] = SPECIAL_META_TILE_75 + (gPlayerEntity.base.animationState >> 1);
mapLayer->mapData[position] = SPECIAL_TILE_75 + (gPlayerEntity.base.animationState >> 1);
if ((gPlayerState.flags & PL_MINISH) != 0) {
gPlayerState.pushedObject = 0xc0;
} else {
@@ -507,22 +507,22 @@ u32 UpdatePlayerCollision(void) {
gPlayerEntity.base.y.HALF.LO = 0;
gPlayerEntity.base.direction = Direction8FromAnimationState(gPlayerEntity.base.animationState);
return 1;
case SPECIAL_META_TILE_82:
case SPECIAL_TILE_82:
if (gPlayerState.field_0x35 != 0) {
return 0;
}
SetMetaTile(SPECIAL_META_TILE_84, position, gPlayerEntity.base.collisionLayer);
SetTile(SPECIAL_TILE_84, position, gPlayerEntity.base.collisionLayer);
return 4;
case SPECIAL_META_TILE_83:
case SPECIAL_TILE_83:
if (gPlayerState.field_0x35 != 6) {
return 0;
}
SetMetaTile(SPECIAL_META_TILE_84, position, gPlayerEntity.base.collisionLayer);
SetTile(SPECIAL_TILE_84, position, gPlayerEntity.base.collisionLayer);
return 4;
case SPECIAL_META_TILE_85:
case SPECIAL_TILE_85:
position--;
// fallthrough
case SPECIAL_META_TILE_86:
case SPECIAL_TILE_86:
if (gPlayerState.field_0x35 != 0) {
return 0;
}
@@ -531,15 +531,15 @@ u32 UpdatePlayerCollision(void) {
}
for (index = 0; index < 3; index++) {
if (sub_0801A8D0(gPlayerClones[index], 0) == position) {
SetMetaTile(SPECIAL_META_TILE_89, position, gPlayerEntity.base.collisionLayer);
SetTile(SPECIAL_TILE_89, position, gPlayerEntity.base.collisionLayer);
return 4;
}
}
return 0;
case SPECIAL_META_TILE_87:
case SPECIAL_TILE_87:
position -= 0x40;
// fallthrough
case SPECIAL_META_TILE_88:
case SPECIAL_TILE_88:
if (gPlayerState.field_0x35 != 6) {
return 0;
}
@@ -548,12 +548,12 @@ u32 UpdatePlayerCollision(void) {
}
for (index = 0; index < 3; index++) {
if (sub_0801A8D0(gPlayerClones[index], 6) == position) {
SetMetaTile(SPECIAL_META_TILE_89, position, gPlayerEntity.base.collisionLayer);
SetTile(SPECIAL_TILE_89, position, gPlayerEntity.base.collisionLayer);
return 4;
}
}
return 0;
case SPECIAL_META_TILE_95:
case SPECIAL_TILE_95:
animationState3 = 2;
animationState3 &= animationState1;
if (animationState3 == 0) {
@@ -565,7 +565,7 @@ u32 UpdatePlayerCollision(void) {
if ((gPlayerEntity.base.frame & 1) == 0) {
return 0;
}
SetMetaTile(SPECIAL_META_TILE_116, position, gPlayerEntity.base.collisionLayer);
SetTile(SPECIAL_TILE_116, position, gPlayerEntity.base.collisionLayer);
gPlayerState.pushedObject = 0xa0;
gPlayerState.queued_action = PLAYER_PUSH;
gPlayerState.flags |= PL_BUSY;
@@ -573,7 +573,7 @@ u32 UpdatePlayerCollision(void) {
gPlayerEntity.base.y.HALF.LO = 0;
gPlayerEntity.base.direction = Direction8FromAnimationState(gPlayerEntity.base.animationState);
return 1;
case SPECIAL_META_TILE_125:
case SPECIAL_TILE_125:
animationState3 = gPlayerEntity.base.animationState;
if ((animationState2) != 4) {
return 0;
@@ -584,8 +584,8 @@ u32 UpdatePlayerCollision(void) {
if ((gPlayerEntity.base.frame & 1) == 0) {
return 0;
}
SetMetaTile(SPECIAL_META_TILE_116, position, gPlayerEntity.base.collisionLayer);
SetVvvAtMetaTilePos(VVV_13, position, gPlayerEntity.base.collisionLayer);
SetTile(SPECIAL_TILE_116, position, gPlayerEntity.base.collisionLayer);
SetVvvAtTilePos(VVV_13, position, gPlayerEntity.base.collisionLayer);
return 1;
default:
return 0;
@@ -602,7 +602,7 @@ bool32 sub_0801A2B0(MapLayer* mapLayer, u32 position, u32 collisionType) {
if ((((gPlayerState.field_0x35 | gPlayerState.direction) & DIR_NOT_MOVING_CHECK) == 0) &&
((gPlayerEntity.base.frame & 1) != 0)) {
position = (u16)(position - (-uVar1)); // necessary for match
temp4 = GetVvvForMetaTileType(GetMetaTileType(position, gPlayerEntity.base.collisionLayer));
temp4 = GetVvvForTileType(GetTileType(position, gPlayerEntity.base.collisionLayer));
switch (temp4) {
case 0x52:
break;
@@ -643,18 +643,18 @@ bool32 sub_0801A370(MapLayer* mapLayer, u32 position) {
topLayer = GetLayerByIndex(LAYER_TOP);
offset = gUnk_080B4488[gPlayerEntity.base.animationState >> 1];
pos = position + offset;
tileType = GetMetaTileType(pos, gPlayerEntity.base.collisionLayer);
tileType = GetTileType(pos, gPlayerEntity.base.collisionLayer);
switch (tileType) {
case SPECIAL_META_TILE_43:
case SPECIAL_TILE_43:
pos += offset;
break;
case SPECIAL_META_TILE_44 ... SPECIAL_META_TILE_47:
case SPECIAL_TILE_44 ... SPECIAL_TILE_47:
return TRUE;
}
if (topLayer->collisionData[pos - 0x80] == 0x46) {
return FALSE;
}
switch ((u16)GetVvvForMetaTileType(GetMetaTileType(pos, gPlayerEntity.base.collisionLayer))) {
switch ((u16)GetVvvForTileType(GetTileType(pos, gPlayerEntity.base.collisionLayer))) {
case 0x52:
return FALSE;
case 0x26:
@@ -690,8 +690,8 @@ bool32 sub_0801A458(MapLayer* mapLayer, u32 position, u32 collisionType) {
s32 offset = gUnk_080B4488[gPlayerEntity.base.animationState >> 1];
if (sub_0801A4F8()) {
pos = position + offset;
tileType = GetMetaTileType(pos, gPlayerEntity.base.collisionLayer);
switch (GetVvvForMetaTileType(tileType)) {
tileType = GetTileType(pos, gPlayerEntity.base.collisionLayer);
switch (GetVvvForTileType(tileType)) {
case 0x52:
case 0x26:
case 0x27:
@@ -744,14 +744,14 @@ u32 sub_0801A570(Entity* this, u32 param_2) {
u32 position;
u32 index1;
u32 index2;
u16* metatileTypes;
u16* tileTypes;
u8* collisionData;
if (this == NULL) {
return 0xffff;
}
layer = GetLayerByIndex(this->collisionLayer);
metatileTypes = layer->metatileTypes;
tileTypes = layer->tileTypes;
index1 = 4;
index2 = 2;
switch (this->animationState >> 1) {
@@ -759,7 +759,7 @@ u32 sub_0801A570(Entity* this, u32 param_2) {
default:
position = COORD_TO_TILE_OFFSET(this, 0, 10);
do {
if (metatileTypes[layer->mapData[position]] == 0x370)
if (tileTypes[layer->mapData[position]] == 0x370)
break;
position--;
index1--;
@@ -767,7 +767,7 @@ u32 sub_0801A570(Entity* this, u32 param_2) {
position = position - 0x40;
do {
if (metatileTypes[layer->mapData[(position)]] != 0x374)
if (tileTypes[layer->mapData[(position)]] != 0x374)
break;
index2++;
position -= 0x40;
@@ -777,7 +777,7 @@ u32 sub_0801A570(Entity* this, u32 param_2) {
return position;
}
index1 = GetMetaTileType(position, this->collisionLayer);
index1 = GetTileType(position, this->collisionLayer);
if ((index1 - 0x369) > 1) {
position = 0xffff;
} else {
@@ -793,7 +793,7 @@ u32 sub_0801A570(Entity* this, u32 param_2) {
case 1:
position = COORD_TO_TILE_OFFSET(this, -10, 0);
do {
if (layer->metatileTypes[layer->mapData[position]] == 0x370)
if (layer->tileTypes[layer->mapData[position]] == 0x370)
break;
position += 0x40;
index1--;
@@ -801,7 +801,7 @@ u32 sub_0801A570(Entity* this, u32 param_2) {
position = position - 0x40;
do {
if (metatileTypes[layer->mapData[(position)]] != 0x374)
if (tileTypes[layer->mapData[(position)]] != 0x374)
break;
index2++;
position -= 0x40;
@@ -811,7 +811,7 @@ u32 sub_0801A570(Entity* this, u32 param_2) {
return position;
}
index1 = GetMetaTileType(position, this->collisionLayer);
index1 = GetTileType(position, this->collisionLayer);
if (!(index1 == 0x369) && !(index1 == 0x36d))
position = 0xffff;
else {
@@ -827,7 +827,7 @@ u32 sub_0801A570(Entity* this, u32 param_2) {
case 2:
position = COORD_TO_TILE_OFFSET(this, 0, -10);
do {
if (layer->metatileTypes[layer->mapData[position]] == 0x36f)
if (layer->tileTypes[layer->mapData[position]] == 0x36f)
break;
position++;
index1--;
@@ -835,7 +835,7 @@ u32 sub_0801A570(Entity* this, u32 param_2) {
position = position - 1;
do {
if (metatileTypes[layer->mapData[position]] != 0x372)
if (tileTypes[layer->mapData[position]] != 0x372)
break;
index2++;
position--;
@@ -845,7 +845,7 @@ u32 sub_0801A570(Entity* this, u32 param_2) {
return position;
}
index1 = GetMetaTileType(position, this->collisionLayer);
index1 = GetTileType(position, this->collisionLayer);
if (!(index1 == 0x369) && !(index1 == 0x36b))
position = 0xffff;
else {
@@ -861,7 +861,7 @@ u32 sub_0801A570(Entity* this, u32 param_2) {
case 3:
position = COORD_TO_TILE_OFFSET(this, 10, 0);
do {
if (layer->metatileTypes[layer->mapData[position]] == 0x36f)
if (layer->tileTypes[layer->mapData[position]] == 0x36f)
break;
position -= 0x40;
index1--;
@@ -869,7 +869,7 @@ u32 sub_0801A570(Entity* this, u32 param_2) {
position = position - 1;
do {
if (metatileTypes[layer->mapData[position]] != 0x372)
if (tileTypes[layer->mapData[position]] != 0x372)
break;
index2++;
position--;
@@ -879,7 +879,7 @@ u32 sub_0801A570(Entity* this, u32 param_2) {
return position;
}
index1 = GetMetaTileType(position, this->collisionLayer);
index1 = GetTileType(position, this->collisionLayer);
if (!(index1 == 0x369) && !(index1 == 0x36c))
position = 0xffff;
else {
@@ -900,7 +900,7 @@ u32 sub_0801A570(Entity* this, u32 param_2) {
u32 sub_0801A8D0(Entity* this, u32 param_2) {
u16* mapData;
u32 tile;
u32 tileIndex;
u32 position;
if (this == NULL)
@@ -909,20 +909,20 @@ u32 sub_0801A8D0(Entity* this, u32 param_2) {
mapData = GetLayerByIndex(this->collisionLayer)->mapData;
if (param_2 == 0) {
position = COORD_TO_TILE_OFFSET(this, 0, 8);
tile = mapData[position];
if (tile == SPECIAL_META_TILE_85) {
tileIndex = mapData[position];
if (tileIndex == SPECIAL_TILE_85) {
return position - 1;
}
if (tile == SPECIAL_META_TILE_86) {
if (tileIndex == SPECIAL_TILE_86) {
return position;
}
} else {
position = COORD_TO_TILE_OFFSET(this, 8, 0);
tile = mapData[position];
if (tile == SPECIAL_META_TILE_87) {
tileIndex = mapData[position];
if (tileIndex == SPECIAL_TILE_87) {
return position - 0x40;
}
if (tile == SPECIAL_META_TILE_88) {
if (tileIndex == SPECIAL_TILE_88) {
return position;
}
}
@@ -935,9 +935,9 @@ bool32 sub_0801A980(void) {
GetLayerByIndex(gPlayerEntity.base.collisionLayer); // TODO result unused?
ptr = &gUnk_080B44A8[gPlayerEntity.base.animationState & 6];
tileType =
GetMetaTileType(COORD_TO_TILE_OFFSET(&gPlayerEntity.base, -ptr[0], -ptr[1]), gPlayerEntity.base.collisionLayer);
GetTileType(COORD_TO_TILE_OFFSET(&gPlayerEntity.base, -ptr[0], -ptr[1]), gPlayerEntity.base.collisionLayer);
if (tileType < 0x4000) {
GetVvvForMetaTileType(tileType);
GetVvvForTileType(tileType);
}
return FALSE;
}
@@ -1006,99 +1006,99 @@ bool32 sub_0801AA58(Entity* this, u32 param_2, u32 param_3) {
return FALSE;
}
void RenderMapLayerToTileMap(u16* tileMap, MapLayer* mapLayer) {
void RenderMapLayerToSubTileMap(u16* subTileMap, MapLayer* mapLayer) {
u16* tiles;
u16* mapData;
u16* mapDataOriginal;
u16 metaTileY;
u16 metaTileX;
u32 metaTilePositionAndLayer;
u16 tileY;
u16 tileX;
u32 tilePosAndLayer;
u32 layerIndex;
// Index into the metatileset at MapLayer.metatiles
u32 metaTileSetIndex;
// Index into the tileset at MapLayer.tiles
u32 tileSetIndex;
if (mapLayer == &gMapBottom) {
layerIndex = 1;
} else {
layerIndex = 2;
}
metaTilePositionAndLayer = layerIndex << 0xc;
tilePosAndLayer = layerIndex << 0xc;
mapDataOriginal = mapLayer->mapDataOriginal;
mapData = mapLayer->mapData;
for (metaTileY = 0; metaTileY < 0x40; metaTileY++) {
for (metaTileX = 0; metaTileX < 0x10; metaTileX++) {
for (tileY = 0; tileY < 0x40; tileY++) {
for (tileX = 0; tileX < 0x10; tileX++) {
// inner loop seems to be unrolled four times for some reason?
if (mapData[0] < 0x4000) {
metaTileSetIndex = mapData[0] * 4;
tileSetIndex = mapData[0] * 4;
} else {
metaTileSetIndex = GetMetaTileSetIndexForSpecialTile(metaTilePositionAndLayer, mapDataOriginal[0]);
tileSetIndex = GetTileSetIndexForSpecialTile(tilePosAndLayer, mapDataOriginal[0]);
}
tiles = mapLayer->metatiles + metaTileSetIndex;
tileMap[0] = tiles[0];
tileMap[1] = tiles[1];
tileMap[0x80 + 0] = tiles[2];
tileMap[0x80 + 1] = tiles[3];
tileMap += 2;
tiles = mapLayer->tiles + tileSetIndex;
subTileMap[0] = tiles[0];
subTileMap[1] = tiles[1];
subTileMap[0x80 + 0] = tiles[2];
subTileMap[0x80 + 1] = tiles[3];
subTileMap += 2;
if (mapData[1] < 0x4000) {
metaTileSetIndex = mapData[1] * 4;
tileSetIndex = mapData[1] * 4;
} else {
metaTileSetIndex = GetMetaTileSetIndexForSpecialTile(metaTilePositionAndLayer + 1, mapDataOriginal[1]);
tileSetIndex = GetTileSetIndexForSpecialTile(tilePosAndLayer + 1, mapDataOriginal[1]);
}
tiles = mapLayer->metatiles + metaTileSetIndex;
tileMap[0] = tiles[0];
tileMap[1] = tiles[1];
tileMap[0x80 + 0] = tiles[2];
tileMap[0x80 + 1] = tiles[3];
tileMap += 2;
tiles = mapLayer->tiles + tileSetIndex;
subTileMap[0] = tiles[0];
subTileMap[1] = tiles[1];
subTileMap[0x80 + 0] = tiles[2];
subTileMap[0x80 + 1] = tiles[3];
subTileMap += 2;
if (mapData[2] < 0x4000) {
metaTileSetIndex = mapData[2] * 4;
tileSetIndex = mapData[2] * 4;
} else {
metaTileSetIndex = GetMetaTileSetIndexForSpecialTile(metaTilePositionAndLayer + 2, mapDataOriginal[2]);
tileSetIndex = GetTileSetIndexForSpecialTile(tilePosAndLayer + 2, mapDataOriginal[2]);
}
tiles = mapLayer->metatiles + metaTileSetIndex;
tileMap[0] = tiles[0];
tileMap[1] = tiles[1];
tileMap[0x80 + 0] = tiles[2];
tileMap[0x80 + 1] = tiles[3];
tileMap += 2;
tiles = mapLayer->tiles + tileSetIndex;
subTileMap[0] = tiles[0];
subTileMap[1] = tiles[1];
subTileMap[0x80 + 0] = tiles[2];
subTileMap[0x80 + 1] = tiles[3];
subTileMap += 2;
if (mapData[3] < 0x4000) {
metaTileSetIndex = mapData[3] * 4;
tileSetIndex = mapData[3] * 4;
} else {
metaTileSetIndex = GetMetaTileSetIndexForSpecialTile(metaTilePositionAndLayer + 3, mapDataOriginal[3]);
tileSetIndex = GetTileSetIndexForSpecialTile(tilePosAndLayer + 3, mapDataOriginal[3]);
}
tiles = mapLayer->metatiles + metaTileSetIndex;
tileMap[0] = tiles[0];
tileMap[1] = tiles[1];
tileMap[0x80 + 0] = tiles[2];
tileMap[0x80 + 1] = tiles[3];
tileMap += 2;
tiles = mapLayer->tiles + tileSetIndex;
subTileMap[0] = tiles[0];
subTileMap[1] = tiles[1];
subTileMap[0x80 + 0] = tiles[2];
subTileMap[0x80 + 1] = tiles[3];
subTileMap += 2;
mapData += 4;
mapDataOriginal += 4;
metaTilePositionAndLayer = (u16)(metaTilePositionAndLayer + 4);
tilePosAndLayer = (u16)(tilePosAndLayer + 4);
}
tileMap = tileMap + 0x80;
subTileMap = subTileMap + 0x80;
}
}
u32 GetMetaTileSetIndexForSpecialTile(u32 metaTilePosAndLayer, u32 mapDataClone) {
u32 GetTileSetIndexForSpecialTile(u32 tilePosAndLayer, u32 tileIndex) {
u32 index;
SpecialTileEntry* ptr;
u32 count;
ptr = gMetaTilesForSpecialTiles;
ptr = gTilesForSpecialTiles;
count = gRoomVars.tileEntityCount;
for (index = 0; index < count; ptr++, index++) {
if (metaTilePosAndLayer == ptr->metaTilePosAndLayer) {
return ptr->metaTileIndex * 4;
if (tilePosAndLayer == ptr->tilePosAndLayer) {
return ptr->tileIndex * 4;
}
}
return mapDataClone * 4;
return tileIndex * 4;
}
void sub_0801AC98(void) {
@@ -1116,7 +1116,7 @@ void sub_0801AC98(void) {
for (indexY = 0; indexY < height; indexY++) {
for (indexX = 0; indexX < width; indexX++, position++) {
for (ptr = gUnk_080B44C0; ptr->tileType != 0xffff; ptr++) {
if (ptr->tileType == GetMetaTileType(position, 1)) {
if (ptr->tileType == GetTileType(position, 1)) {
if (gUnk_080B44B8[ptr->unk_a] != 0) {
sub_0801AD6C(ptr, position);
break;
@@ -1125,7 +1125,7 @@ void sub_0801AC98(void) {
}
for (ptr = gUnk_080B44C2; ptr->tileType != 0xffff; ptr++) {
if (ptr->tileType == GetMetaTileType(position, 2)) {
if (ptr->tileType == GetTileType(position, 2)) {
if (gUnk_080B44B8[ptr->unk_a] != 0) {
sub_0801AD6C(ptr, position);
break;
@@ -1137,7 +1137,7 @@ void sub_0801AC98(void) {
}
}
void sub_0801AD6C(const Data* param_1, u32 tilePosition) {
void sub_0801AD6C(const Data* param_1, u32 tilePos) {
Entity* entity;
Manager* manager;
s32 tmpX1;
@@ -1152,9 +1152,9 @@ void sub_0801AD6C(const Data* param_1, u32 tilePosition) {
entity->id = (u8)param_1->id;
entity->type = (u8)param_1->type;
entity->type2 = (u8)param_1->type2;
tmpX1 = ((u16)tilePosition & 0x3f) * 0x10 + 8;
tmpX1 = ((u16)tilePos & 0x3f) * 0x10 + 8;
entity->x.HALF.HI = tmpX1 + gRoomControls.origin_x;
tmpY1 = (s16)((tilePosition & 0xfc0) >> 2) + 8;
tmpY1 = (s16)((tilePos & 0xfc0) >> 2) + 8;
entity->y.HALF.HI = tmpY1 + gRoomControls.origin_y;
entity->collisionLayer = 0;
ResolveCollisionLayer(entity);
@@ -1168,9 +1168,9 @@ void sub_0801AD6C(const Data* param_1, u32 tilePosition) {
manager->type = (u8)param_1->type;
manager->type2 = (u8)param_1->type2;
// TODO are these fields common for all managers or does this usually create managers of certain types?
tmpX2 = ((u16)tilePosition & 0x3f) * 0x10 + 8;
tmpX2 = ((u16)tilePos & 0x3f) * 0x10 + 8;
*(u16*)(&manager[1].timer + 10) = tmpX2 + gRoomControls.origin_x;
tmpY2 = (s16)((tilePosition & 0xfc0) >> 2) + 8;
tmpY2 = (s16)((tilePos & 0xfc0) >> 2) + 8;
*(u16*)(&manager[1].timer + 12) = tmpY2 + gRoomControls.origin_y;
AppendEntityToList((Entity*)manager, gEntityListLUT[manager->kind]);
}
@@ -1210,10 +1210,10 @@ void sub_0801AE44(bool32 loadGfx) {
}
if ((gRoomControls.scroll_flags & 1) == 0) {
if (gMapBottom.bgSettings != NULL) {
RenderMapLayerToTileMap(gMapDataBottomSpecial, &gMapBottom);
RenderMapLayerToSubTileMap(gMapDataBottomSpecial, &gMapBottom);
}
if (gMapTop.bgSettings != NULL) {
RenderMapLayerToTileMap(gMapDataTopSpecial, &gMapTop);
RenderMapLayerToSubTileMap(gMapDataTopSpecial, &gMapTop);
}
} else {
sub_0807C4F8();
@@ -1222,34 +1222,34 @@ void sub_0801AE44(bool32 loadGfx) {
}
void SetMultipleTiles(const TileData* tileData, u32 basePosition, u32 layer) {
while (tileData->tile != -1) {
SetMetaTile((u16)tileData->tile, basePosition + tileData->position, layer);
while (tileData->tileIndex != -1) {
SetTile((u16)tileData->tileIndex, basePosition + tileData->tilePosOffset, layer);
tileData++;
}
}
// Add a new entry at the end of gMetaTilesForSpecialTiles
void RegisterInteractTile(u32 metaTileIndex, u32 metaTilePos, u32 layer) {
// Add a new entry at the end of gTilesForSpecialTiles
void RegisterInteractTile(u32 tileIndex, u32 tilePos, u32 layer) {
u32 index;
if ((metaTileIndex < 0x4000) && (gRoomTransition.field30 == 0)) {
if ((tileIndex < 0x4000) && (gRoomTransition.field30 == 0)) {
index = gRoomVars.tileEntityCount;
if (index < 0x100) {
gMetaTilesForSpecialTiles[index].metaTileIndex = metaTileIndex;
gMetaTilesForSpecialTiles[index].metaTilePosAndLayer = (layer << 12) | metaTilePos;
gTilesForSpecialTiles[index].tileIndex = tileIndex;
gTilesForSpecialTiles[index].tilePosAndLayer = (layer << 12) | tilePos;
gRoomVars.tileEntityCount = index + 1;
}
}
}
void UnregisterInteractTile(u32 metaTilePos, s32 layer) {
void UnregisterInteractTile(u32 tilePos, s32 layer) {
u32 count;
SpecialTileEntry* ptr;
u32 metaTilePosAndLayer;
u32 tilePosAndLayer;
u32 t;
layer = layer << 12;
metaTilePosAndLayer = metaTilePos | layer;
ptr = gMetaTilesForSpecialTiles;
tilePosAndLayer = tilePos | layer;
ptr = gTilesForSpecialTiles;
count = gRoomVars.tileEntityCount;
t = 0;
@@ -1257,13 +1257,13 @@ void UnregisterInteractTile(u32 metaTilePos, s32 layer) {
return;
}
if (metaTilePosAndLayer == ptr->metaTilePosAndLayer) {
if (tilePosAndLayer == ptr->tilePosAndLayer) {
count--;
gRoomVars.tileEntityCount = count;
ptr[0] = ptr[count];
return;
}
while (metaTilePosAndLayer != ptr->metaTilePosAndLayer) {
while (tilePosAndLayer != ptr->tilePosAndLayer) {
ptr++;
t++;
if (t >= count) {
@@ -1272,15 +1272,15 @@ void UnregisterInteractTile(u32 metaTilePos, s32 layer) {
}
count--;
gRoomVars.tileEntityCount = count;
ptr = gMetaTilesForSpecialTiles;
ptr = gTilesForSpecialTiles;
ptr[t] = ptr[count];
}
const struct_080B44D0 gUnk_080B44D0[] = {
{ 0x67, SPECIAL_META_TILE_132 }, { 0x68, SPECIAL_META_TILE_133 },
{ 0x69, SPECIAL_META_TILE_134 }, { 0x6a, SPECIAL_META_TILE_135 },
{ 0x6b, SPECIAL_META_TILE_136 }, { 0x27, SPECIAL_META_TILE_131 },
{ 0x23, SPECIAL_META_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?
@@ -1299,7 +1299,7 @@ void sub_0801AFE4(void) {
for (x = 0; x < width; x++) {
for (ptr = gUnk_080B44D0; ptr->collision != 0; ptr++) {
if (ptr->collision == *collisionData) {
SetMetaTile(ptr->tileIndex, y * 0x40 + x, LAYER_BOTTOM);
SetTile(ptr->tileIndex, y * 0x40 + x, LAYER_BOTTOM);
break;
}
}
+1413 -1413
View File
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -503,13 +503,13 @@ void ClearOAM(void) {
void ResetScreenRegs(void) {
MemClear(&gScreen, sizeof(gScreen));
gScreen.bg0.tilemap = &gBG0Buffer;
gScreen.bg0.subTileMap = &gBG0Buffer;
gScreen.bg0.control = 0x1F0C;
gScreen.bg1.tilemap = &gBG1Buffer;
gScreen.bg1.subTileMap = &gBG1Buffer;
gScreen.bg1.control = 0x1C01;
gScreen.bg2.tilemap = &gBG2Buffer;
gScreen.bg2.subTileMap = &gBG2Buffer;
gScreen.bg2.control = 0x1D02;
gScreen.bg3.tilemap = &gBG3Buffer;
gScreen.bg3.subTileMap = &gBG3Buffer;
gScreen.bg3.control = 0x1E03;
gScreen.lcd.displayControl = 0x140;
gScreen.lcd.displayControlMask = 0xffff;
+2 -2
View File
@@ -596,10 +596,10 @@ void sub_08053D34(void) {
if (gMenu.field_0xa != 0) {
gMenu.field_0xa = 0;
if (CheckLocalFlagByBank(FLAG_BANK_7, 0x3d)) {
SetMetaTileType(META_TILE_TYPE_116, TILE_POS(4, 3), LAYER_BOTTOM);
SetTileType(TILE_TYPE_116, TILE_POS(4, 3), LAYER_BOTTOM);
}
if (CheckLocalFlagByBank(FLAG_BANK_7, 0x3e)) {
SetMetaTileType(META_TILE_TYPE_116, TILE_POS(12, 3), LAYER_BOTTOM);
SetTileType(TILE_TYPE_116, TILE_POS(12, 3), LAYER_BOTTOM);
}
}
if (gFadeControl.active == 0) {
+3 -3
View File
@@ -3,9 +3,9 @@
/*
Tiles for the borders of the cave that are loaded during the transition.
When the player goes inside a cave during the start of the enter transition the border metatilemap is loaded and at the
end the metatilemap for the cave is loaded. When the player goes out of a cave during the start of the leave transition
the border metatilemap is loaded and at the end the metatilemap for the outside is loaded.
When the player goes inside a cave during the start of the enter transition the border tilemap is loaded and at the
end the tilemap for the cave is loaded. When the player goes out of a cave during the start of the leave transition
the border tilemap is loaded and at the end the tilemap for the outside is loaded.
*/
const MapDataDefinition gCaveBorder_LakeWoods_enter_start[] = {
+9 -9
View File
@@ -403,18 +403,18 @@ void sub_080307D4(ArmosEntity* this) {
}
void sub_080307EC(ArmosEntity* this) {
u32 metaTilePos = COORD_TO_TILE(super);
this->unk_78 = GetMetaTileIndex(metaTilePos, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos, (u32)super->collisionLayer);
u32 tilePos = COORD_TO_TILE(super);
this->unk_78 = GetTileIndex(tilePos, super->collisionLayer);
SetTile(SPECIAL_TILE_34, tilePos, (u32)super->collisionLayer);
}
void sub_08030834(ArmosEntity* this) {
SetMetaTile(this->unk_78, COORD_TO_TILE(super), super->collisionLayer);
SetTile(this->unk_78, COORD_TO_TILE(super), super->collisionLayer);
}
bool32 sub_0803086C(ArmosEntity* this) {
u32 uVar2;
u32 metaTilePos;
u32 tilePos;
u16 centerY;
u16 centerX;
FORCE_REGISTER(u32 r2, r2);
@@ -424,10 +424,10 @@ bool32 sub_0803086C(ArmosEntity* this) {
centerX = super->x.HALF_U.HI - gRoomControls.origin_x;
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.
metaTilePos = ((((((super)->x.HALF.HI) - gRoomControls.origin_x) >> 4) & (r2 = 0x3f)) |
tilePos = ((((((super)->x.HALF.HI) - gRoomControls.origin_x) >> 4) & (r2 = 0x3f)) |
(((((super)->y.HALF.HI) - gRoomControls.origin_y) >> 4) & r2) << 6);
if (GetMetaTileType(metaTilePos, super->collisionLayer) == SPECIAL_META_TILE_73) {
if (GetTileType(tilePos, super->collisionLayer) == SPECIAL_TILE_73) {
if (CheckPlayerInRegion(centerX, centerY, 2, 0xc) != 0) {
if (CheckPlayerInRegion(centerX, centerY - 4, 2, 4) != 0) {
gPlayerEntity.base.spritePriority.b0 = 3;
@@ -436,11 +436,11 @@ bool32 sub_0803086C(ArmosEntity* this) {
return TRUE;
}
} else {
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos, super->collisionLayer);
SetTile(SPECIAL_TILE_34, tilePos, super->collisionLayer);
}
} else {
if (CheckPlayerInRegion(centerX, centerY + 6, 2, 5) != 0) {
SetMetaTile(SPECIAL_META_TILE_73, COORD_TO_TILE(super), super->collisionLayer);
SetTile(SPECIAL_TILE_73, COORD_TO_TILE(super), super->collisionLayer);
}
}
}
+2 -2
View File
@@ -212,7 +212,7 @@ void sub_0802AAC0(BombPeahatEntity* this) {
super->child = NULL;
#ifdef EU
} else if (entity->timer == 0) {
if (GetCollisionDataAtMetaTilePos(COORD_TO_TILE(super), 1) == 0) {
if (GetCollisionDataAtTilePos(COORD_TO_TILE(super), 1) == 0) {
if (EntityInRectRadius(super, &gPlayerEntity.base, 0x10, 0x10) && entity->subtimer <= 0x50) {
this->unk_81 = 0;
}
@@ -685,7 +685,7 @@ void sub_0802B204(BombPeahatEntity* this) {
bool32 sub_0802B234(BombPeahatEntity* this) {
bool32 ret = FALSE;
if (GetMetaTileTypeByEntity(super) - 0x1c4 > 1)
if (GetTileTypeByEntity(super) - 0x1c4 > 1)
ret = TRUE;
return ret;
}
+3 -3
View File
@@ -105,7 +105,7 @@ void BusinessScrub_Action0(BusinessScrubEntity* this) {
} else {
super->timer = 0;
this->unk_76 = COORD_TO_TILE(super);
this->unk_74 = GetMetaTileIndex(this->unk_76, super->collisionLayer);
this->unk_74 = GetTileIndex(this->unk_76, super->collisionLayer);
super->hurtType = 0x41;
sub_08028FFC(this);
}
@@ -444,7 +444,7 @@ void sub_08028FFC(BusinessScrubEntity* this) {
super->x.HALF.HI = this->unk_78;
super->y.HALF.HI = this->unk_7a;
InitializeAnimation(super, 0);
SetMetaTile(SPECIAL_META_TILE_34, this->unk_76, super->collisionLayer);
SetTile(SPECIAL_TILE_34, this->unk_76, super->collisionLayer);
}
void sub_08029078(BusinessScrubEntity* this) {
@@ -458,7 +458,7 @@ void sub_08029078(BusinessScrubEntity* this) {
super->spriteIndex = 0xd0;
sub_08028FDC(this);
sub_080290E0(this, 1);
SetMetaTile(this->unk_74, this->unk_76, super->collisionLayer);
SetTile(this->unk_74, this->unk_76, super->collisionLayer);
}
}
+1 -1
View File
@@ -562,7 +562,7 @@ void sub_080262A8(ChuchuBossEntity* this) {
gPlayerEntity.base.animationState = 0;
gRoomControls.camera_target = super;
gRoomControls.scrollSpeed = 1;
SetMetaTile(SPECIAL_META_TILE_34, TILE_POS(8, 11), LAYER_BOTTOM);
SetTile(SPECIAL_TILE_34, TILE_POS(8, 11), LAYER_BOTTOM);
}
}
+1 -1
View File
@@ -243,7 +243,7 @@ void sub_080387F0(CloudPiranhaEntity* this) {
const s8* ptr;
if ((super->action != 4) && (this->unk_82 == 0)) {
collisionData = GetCollisionDataAtMetaTilePos(COORD_TO_TILE(super), super->collisionLayer);
collisionData = GetCollisionDataAtTilePos(COORD_TO_TILE(super), super->collisionLayer);
if ((collisionData == COLLISION_DATA_15) || (collisionData == COLLISION_DATA_42)) {
this->unk_82 = 0x20;
}
+7 -7
View File
@@ -49,7 +49,7 @@ void DoorMimic_OnCollision(DoorMimicEntity* this) {
}
void DoorMimic_OnDeath(DoorMimicEntity* this) {
SetMetaTile(this->unk_7c, this->unk_7e, super->collisionLayer);
SetTile(this->unk_7c, this->unk_7e, super->collisionLayer);
CreateFx(super, FX_POT_SHATTER, 0);
EnemyDisableRespawn(super);
DeleteThisEntity();
@@ -125,8 +125,8 @@ void sub_08022198(DoorMimicEntity* this) {
void sub_080221C0(DoorMimicEntity* this) {
u32 tilePos = COORD_TO_TILE(super) + gUnk_080B4488[super->type2];
this->unk_7e = tilePos;
this->unk_7c = GetMetaTileIndex(tilePos, super->collisionLayer);
SetMetaTile(gUnk_080CB79C[super->type2], tilePos, super->collisionLayer);
this->unk_7c = GetTileIndex(tilePos, super->collisionLayer);
SetTile(gUnk_080CB79C[super->type2], tilePos, super->collisionLayer);
}
// clang-format off
@@ -191,10 +191,10 @@ const PosOffset gUnk_080CB76C[][6] = {
};
const u16 gUnk_080CB79C[] = {
SPECIAL_META_TILE_35,
SPECIAL_META_TILE_37,
SPECIAL_META_TILE_38,
SPECIAL_META_TILE_36,
SPECIAL_TILE_35,
SPECIAL_TILE_37,
SPECIAL_TILE_38,
SPECIAL_TILE_36,
};
+8 -8
View File
@@ -86,10 +86,10 @@ void Enemy64_Init(Enemy64Entity* this) {
Entity* tail;
if (CheckFlags(0x7c)) {
SetMetaTile(SPECIAL_META_TILE_129, TILE_POS(10, 0), LAYER_TOP);
SetMetaTile(SPECIAL_META_TILE_129, TILE_POS(10, 1), LAYER_TOP);
SetMetaTile(SPECIAL_META_TILE_129, TILE_POS(10, 2), LAYER_TOP);
SetMetaTile(SPECIAL_META_TILE_129, TILE_POS(10, 3), LAYER_TOP);
SetTile(SPECIAL_TILE_129, TILE_POS(10, 0), LAYER_TOP);
SetTile(SPECIAL_TILE_129, TILE_POS(10, 1), LAYER_TOP);
SetTile(SPECIAL_TILE_129, TILE_POS(10, 2), LAYER_TOP);
SetTile(SPECIAL_TILE_129, TILE_POS(10, 3), LAYER_TOP);
DeleteThisEntity();
} else {
sub_0807B7D8(0x323, TILE_POS(10, 0), LAYER_BOTTOM);
@@ -441,19 +441,19 @@ void Enemy64_Action4_SubAction7(Enemy64Entity* this) {
DeleteThisEntity();
} else if (super->timer == 16) {
sub_0807B7D8(0x36, TILE_POS(10, 3), LAYER_BOTTOM);
SetMetaTile(SPECIAL_META_TILE_129, TILE_POS(10, 3), LAYER_TOP);
SetTile(SPECIAL_TILE_129, TILE_POS(10, 3), LAYER_TOP);
SoundReq(SFX_HEART_GET);
} else if (super->timer == 24) {
sub_0807B7D8(0x36, TILE_POS(10, 2), LAYER_BOTTOM);
SetMetaTile(SPECIAL_META_TILE_129, TILE_POS(10, 2), LAYER_TOP);
SetTile(SPECIAL_TILE_129, TILE_POS(10, 2), LAYER_TOP);
SoundReq(SFX_HEART_GET);
} else if (super->timer == 32) {
sub_0807B7D8(0x36, TILE_POS(10, 1), LAYER_BOTTOM);
SetMetaTile(SPECIAL_META_TILE_129, TILE_POS(10, 1), LAYER_TOP);
SetTile(SPECIAL_TILE_129, TILE_POS(10, 1), LAYER_TOP);
SoundReq(SFX_HEART_GET);
} else if (super->timer == 40) {
sub_0807B7D8(0x36, TILE_POS(10, 0), LAYER_BOTTOM);
SetMetaTile(SPECIAL_META_TILE_129, TILE_POS(10, 0), LAYER_TOP);
SetTile(SPECIAL_TILE_129, TILE_POS(10, 0), LAYER_TOP);
SoundReq(SFX_HEART_GET);
}
}
+19 -19
View File
@@ -34,7 +34,7 @@ typedef struct {
extern Entity* sub_08017A90(Entity*, Entity*);
extern Entity* gUnk_020000B0;
extern const u8 gMapMetaTileTypeToCollisionData[];
extern const u8 gMapTileTypeToCollisionData[];
void sub_08031344(EyegoreEntity*);
void sub_08031344(EyegoreEntity*);
@@ -327,27 +327,27 @@ void sub_08030E80(EyegoreEntity* this) {
}
void sub_08030F00(EyegoreEntity* this) {
u32 metaTilePos = COORD_TO_TILE_OFFSET(super, 8, 20);
u16 tileIndex = GetMetaTileIndex(metaTilePos + TILE_POS(0, 0), super->collisionLayer);
u32 tilePos = COORD_TO_TILE_OFFSET(super, 8, 20);
u16 tileIndex = GetTileIndex(tilePos + TILE_POS(0, 0), super->collisionLayer);
this->tileIndex1 = tileIndex;
tileIndex = GetMetaTileIndex(metaTilePos + TILE_POS(1, 0), super->collisionLayer);
tileIndex = GetTileIndex(tilePos + TILE_POS(1, 0), super->collisionLayer);
this->tileIndex2 = tileIndex;
tileIndex = GetMetaTileIndex(metaTilePos + TILE_POS(0, 1), super->collisionLayer);
tileIndex = GetTileIndex(tilePos + TILE_POS(0, 1), super->collisionLayer);
this->tileIndex3 = tileIndex;
tileIndex = GetMetaTileIndex(metaTilePos + TILE_POS(1, 1), super->collisionLayer);
tileIndex = GetTileIndex(tilePos + TILE_POS(1, 1), super->collisionLayer);
this->tileIndex4 = tileIndex;
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos + 1, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos + TILE_POS(0, 1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos + TILE_POS(1, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_34, tilePos, super->collisionLayer);
SetTile(SPECIAL_TILE_34, tilePos + 1, super->collisionLayer);
SetTile(SPECIAL_TILE_34, tilePos + TILE_POS(0, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_34, tilePos + TILE_POS(1, 1), super->collisionLayer);
}
void sub_08030FB4(EyegoreEntity* this) {
u32 metaTilePos = COORD_TO_TILE_OFFSET(super, 8, 20);
SetMetaTile(this->tileIndex1, metaTilePos + TILE_POS(0, 0), super->collisionLayer);
SetMetaTile(this->tileIndex2, metaTilePos + TILE_POS(1, 0), super->collisionLayer);
SetMetaTile(this->tileIndex3, metaTilePos + TILE_POS(0, 1), super->collisionLayer);
SetMetaTile(this->tileIndex4, metaTilePos + TILE_POS(1, 1), super->collisionLayer);
u32 tilePos = COORD_TO_TILE_OFFSET(super, 8, 20);
SetTile(this->tileIndex1, tilePos + TILE_POS(0, 0), super->collisionLayer);
SetTile(this->tileIndex2, tilePos + TILE_POS(1, 0), super->collisionLayer);
SetTile(this->tileIndex3, tilePos + TILE_POS(0, 1), super->collisionLayer);
SetTile(this->tileIndex4, tilePos + TILE_POS(1, 1), super->collisionLayer);
}
void sub_08031024(EyegoreEntity* this) {
@@ -400,12 +400,12 @@ void sub_08031024(EyegoreEntity* this) {
}
} else {
tmp2 = this->unk_7b >> 1;
uVar5 = GetMetaTileTypeByPos(super->x.HALF.HI + gUnk_080CE2C0[tmp2],
uVar5 = GetTileTypeByPos(super->x.HALF.HI + gUnk_080CE2C0[tmp2],
super->y.HALF.HI + gUnk_080CE2C0[tmp2 + 1], super->collisionLayer);
uVar8 = GetMetaTileTypeByPos(super->x.HALF.HI + gUnk_080CE2C0[tmp2 + 2],
uVar8 = GetTileTypeByPos(super->x.HALF.HI + gUnk_080CE2C0[tmp2 + 2],
super->y.HALF.HI + gUnk_080CE2C0[tmp2 + 3], super->collisionLayer);
if (!(((gMapMetaTileTypeToCollisionData[uVar5] == 0) &&
(gMapMetaTileTypeToCollisionData[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;
+1 -1
View File
@@ -151,7 +151,7 @@ void sub_0802C4B0(FallingBoulderEntity* this) {
u32 index;
u32 rand;
switch (GetMetaTileIndex(this->unk_7e, super->collisionLayer)) {
switch (GetTileIndex(this->unk_7e, super->collisionLayer)) {
case 0x1ab ... 0x1af:
offset = 8;
break;
+11 -11
View File
@@ -100,7 +100,7 @@ void FlyingPot_OnCollision(FlyingPotEntity* this) {
super->zVelocity = Q_16_16(2.625);
super->spritePriority.b1 = 1;
SetMetaTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
} else if (super->z.HALF.HI != 0) {
sub_08037408(this);
}
@@ -146,7 +146,7 @@ void FlyingPot_SubAction2(FlyingPotEntity* this) {
COLLISION_OFF(super);
super->spriteOffsetX = 0;
SetMetaTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
}
if (sub_0806F520(super)) {
@@ -170,23 +170,23 @@ void FlyingPot_SubAction5(FlyingPotEntity* this) {
}
void FlyingPot_Init(FlyingPotEntity* this) {
u32 tile;
u32 tilePos;
super->action = FLYING_POT_ACTION_1;
super->gustJarFlags = 2;
super->y.HALF.HI += 3;
tile = TILE(super->x.HALF.HI, super->y.HALF.HI);
this->tileIndex = GetMetaTileIndex(tile, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_0, tile, super->collisionLayer);
tilePos = TILE(super->x.HALF.HI, super->y.HALF.HI);
this->tileIndex = GetTileIndex(tilePos, super->collisionLayer);
SetTile(SPECIAL_TILE_0, tilePos, super->collisionLayer);
InitializeAnimation(super, 5);
}
void FlyingPot_Action1(FlyingPotEntity* this) {
sub_08037418(this);
if (GetMetaTileTypeByEntity(super) != SPECIAL_META_TILE_0) {
SetMetaTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
if (GetTileTypeByEntity(super) != SPECIAL_TILE_0) {
SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
sub_08037408(this);
}
@@ -211,7 +211,7 @@ void FlyingPot_Action2(FlyingPotEntity* this) {
super->collisionMask = 0xF;
super->hitbox = &gUnk_080FD34C;
SetMetaTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
}
}
@@ -257,8 +257,8 @@ void sub_08037408(FlyingPotEntity* this) {
void sub_08037418(FlyingPotEntity* this) {
u32 tilePos = COORD_TO_TILE(super);
if (GetMetaTileIndex(tilePos, super->collisionLayer) == SPECIAL_META_TILE_103) {
SetMetaTile(this->tileIndex, tilePos, super->collisionLayer);
if (GetTileIndex(tilePos, super->collisionLayer) == SPECIAL_TILE_103) {
SetTile(this->tileIndex, tilePos, super->collisionLayer);
DeleteThisEntity();
}
}
+12 -12
View File
@@ -14,7 +14,7 @@
typedef struct {
Entity base;
u8 filler[0xc];
u16 metaTileIndex;
u16 tileIndex;
u8 unk_0x76;
} FlyingSkullEntity;
@@ -51,7 +51,7 @@ void FlyingSkull_OnCollision(FlyingSkullEntity* this) {
COLLISION_OFF(super);
super->zVelocity = Q_16_16(2.625);
super->spritePriority.b1 = 1;
SetMetaTile(this->metaTileIndex, COORD_TO_TILE(super), super->collisionLayer);
SetTile(this->tileIndex, COORD_TO_TILE(super), super->collisionLayer);
} else if (super->z.HALF.HI) {
sub_0803A0E0(this);
}
@@ -90,7 +90,7 @@ void sub_08039CE0(FlyingSkullEntity* this) {
super->timer = 1;
super->z.HALF.HI = -1;
super->spriteOffsetX = 0;
SetMetaTile(this->metaTileIndex, COORD_TO_TILE(super), super->collisionLayer);
SetTile(this->tileIndex, COORD_TO_TILE(super), super->collisionLayer);
}
if (sub_0806F520(super)) {
@@ -121,8 +121,8 @@ void sub_08039D74(FlyingSkullEntity* this) {
super->y.HALF.HI += 3;
tilePos = COORD_TO_TILE(super);
this->metaTileIndex = GetMetaTileIndex(tilePos, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_96, tilePos, super->collisionLayer);
this->tileIndex = GetTileIndex(tilePos, super->collisionLayer);
SetTile(SPECIAL_TILE_96, tilePos, super->collisionLayer);
InitializeAnimation(super, 0);
}
@@ -130,8 +130,8 @@ void sub_08039DD8(FlyingSkullEntity* this) {
sub_0803A100(this);
if (super->type == 0) {
if (GetMetaTileTypeByEntity(super) == SPECIAL_META_TILE_115) {
SetMetaTile(this->metaTileIndex, COORD_TO_TILE(super), super->collisionLayer);
if (GetTileTypeByEntity(super) == SPECIAL_TILE_115) {
SetTile(this->tileIndex, COORD_TO_TILE(super), super->collisionLayer);
sub_0803A0E0(this);
}
@@ -148,7 +148,7 @@ void sub_08039DD8(FlyingSkullEntity* this) {
if (player != NULL) {
player->type2 = 1;
CopyPosition(super, player);
SetMetaTile(this->metaTileIndex, COORD_TO_TILE(super), super->collisionLayer);
SetTile(this->tileIndex, COORD_TO_TILE(super), super->collisionLayer);
DeleteEntity(super);
}
}
@@ -168,7 +168,7 @@ void sub_08039EE4(FlyingSkullEntity* this) {
super->hitbox = (Hitbox*)&gUnk_080FD340;
gPlayerEntity.base.animationState;
this->unk_0x76 = gPlayerEntity.base.animationState;
SetMetaTile(this->metaTileIndex, COORD_TO_TILE(super), super->collisionLayer);
SetTile(this->tileIndex, COORD_TO_TILE(super), super->collisionLayer);
}
void sub_08039F4C(FlyingSkullEntity* this) {
@@ -201,7 +201,7 @@ void sub_08039FAC(FlyingSkullEntity* this) {
super->hitType = 0xa0;
super->collisionMask = 0xf;
super->hitbox = (Hitbox*)&gUnk_080FD34C;
SetMetaTile(this->metaTileIndex, COORD_TO_TILE(super), super->collisionLayer);
SetTile(this->tileIndex, COORD_TO_TILE(super), super->collisionLayer);
}
}
@@ -249,8 +249,8 @@ void sub_0803A0E0(FlyingSkullEntity* this) {
void sub_0803A100(FlyingSkullEntity* this) {
u32 tilePos = COORD_TO_TILE(super);
if (GetMetaTileIndex(tilePos, super->collisionLayer) == SPECIAL_META_TILE_103) {
SetMetaTile(this->metaTileIndex, tilePos, super->collisionLayer);
if (GetTileIndex(tilePos, super->collisionLayer) == SPECIAL_TILE_103) {
SetTile(this->tileIndex, tilePos, super->collisionLayer);
DeleteThisEntity();
}
}
+4 -4
View File
@@ -33,7 +33,7 @@ void sub_08046518(void);
void sub_080467DC(GyorgFemaleEntity*);
extern u8 gUpdateVisibleTiles;
extern u8 gMapMetaTileTypeToCollisionData[];
extern u8 gMapTileTypeToCollisionData[];
extern const MapDataDefinition gGyorgMapping0[];
extern const MapDataDefinition gGyorgMapping1[];
@@ -248,7 +248,7 @@ void sub_080464C0(GyorgFemaleEntity* this) {
#define sub_08046518_offset 0x658
void sub_08046518(void) {
u16* ptr = gMapTop.metatileTypes;
u16* ptr = gMapTop.tileTypes;
u16* sl = &gMapTop.mapData[sub_08046518_offset];
u16* stack1 = &gMapTop.mapDataOriginal[sub_08046518_offset];
u8* stack2 = &gMapTop.vvv[sub_08046518_offset];
@@ -260,8 +260,8 @@ void sub_08046518(void) {
u16 new_var;
stack1[j] = sl[j];
new_var = ptr[sl[j]];
stack2[j] = gMapMetaTileTypeToVvv[new_var];
r6[j] = gMapMetaTileTypeToCollisionData[new_var];
stack2[j] = gMapTileTypeToVvv[new_var];
r6[j] = gMapTileTypeToCollisionData[new_var];
}
sl += 0x40;
stack1 += 0x40;
+3 -3
View File
@@ -345,7 +345,7 @@ void sub_08029DE4(MadderpillarEntity* this) {
}
void sub_08029E0C(MadderpillarEntity* this) {
u32 tile;
u32 tilePos;
s32 uVar4;
s32 iVar3;
u32 i;
@@ -358,10 +358,10 @@ void sub_08029E0C(MadderpillarEntity* this) {
ptr = &gUnk_080CCDC8[uVar2];
uVar4 = (Random() & 1) * 2 - 1;
iVar3 = ((s32)Random() & 0xf) % 3;
tile = COORD_TO_TILE(super);
tilePos = COORD_TO_TILE(super);
for (i = 0; i < 3; i++) {
dir = ptr[iVar3];
if (GetCollisionDataAtMetaTilePos(gUnk_080B4488[dir >> 3] + tile, super->collisionLayer) == 0) {
if (GetCollisionDataAtTilePos(gUnk_080B4488[dir >> 3] + tilePos, super->collisionLayer) == 0) {
local_24 = dir;
if (super->direction - this->unk_74 != dir - super->direction)
break;
+4 -4
View File
@@ -97,7 +97,7 @@ void sub_08034CC4(MazaalMacroEntity* this) {
this->unk_78 = 0x4b0;
sub_08034F70(this);
InitializeAnimation(super, super->type);
SetMetaTile(SPECIAL_META_TILE_34, COORD_TO_TILE(super), super->collisionLayer);
SetTile(SPECIAL_TILE_34, COORD_TO_TILE(super), super->collisionLayer);
entity = CreateEnemy(MAZAAL_MACRO, 2);
if (entity != NULL) {
super->child = entity;
@@ -285,11 +285,11 @@ u32 sub_08035084(MazaalMacroEntity* this) {
}
void sub_08035120(MazaalMacroEntity* this) {
s32 tile;
s32 tilePos;
u32 i;
tile = COORD_TO_TILE(super);
tilePos = COORD_TO_TILE(super);
for (i = 0; i < 0x18; i++) {
sub_0807B600(tile + gUnk_080CEED8[i]);
sub_0807B600(tilePos + gUnk_080CEED8[i]);
}
}
+7 -7
View File
@@ -37,7 +37,7 @@ typedef struct {
} MoldwormEntity;
extern void SoundReqClipped(Entity*, u32);
extern bool32 sub_08023A38(u32 metaTileType);
extern bool32 sub_08023A38(u32 tileType);
void sub_08023990(MoldwormEntity*, u32, u32);
void sub_08023A88(MoldwormEntity*, u32);
@@ -186,7 +186,7 @@ void sub_08023288(MoldwormEntity* this) {
for (i = 0; i < 0x10; i++) {
u32 x = gPlayerEntity.base.x.HALF.HI + gUnk_080CBC70[idx + 0];
u32 y = gPlayerEntity.base.y.HALF.HI + gUnk_080CBC70[idx + 1];
if (sub_08023A38(GetMetaTileTypeByPos(x, y, gPlayerEntity.base.collisionLayer))) {
if (sub_08023A38(GetTileTypeByPos(x, y, gPlayerEntity.base.collisionLayer))) {
sub_08023990(this, x, y);
return;
}
@@ -221,7 +221,7 @@ void sub_08023398(MoldwormEntity* this) {
}
if (--this->unk_78.HWORD == 0) {
if (sub_08023A38(GetMetaTileTypeByEntity(super))) {
if (sub_08023A38(GetTileTypeByEntity(super))) {
super->action = 5;
this->unk_7f = 0;
COLLISION_OFF(super);
@@ -513,12 +513,12 @@ void sub_080239F0(MoldwormEntity* this) {
this->unk_87 = 0x88;
}
bool32 sub_08023A38(u32 metaTileType) {
if (metaTileType == META_TILE_TYPE_26 || metaTileType == META_TILE_TYPE_41) {
bool32 sub_08023A38(u32 tileType) {
if (tileType == TILE_TYPE_26 || tileType == TILE_TYPE_41) {
return TRUE;
} else {
metaTileType = gMapMetaTileTypeToVvv[metaTileType];
if (metaTileType == VVV_9 || metaTileType == VVV_11 || metaTileType == VVV_10 || metaTileType == VVV_12) {
tileType = gMapTileTypeToVvv[tileType];
if (tileType == VVV_9 || tileType == VVV_11 || tileType == VVV_10 || tileType == VVV_12) {
return TRUE;
} else {
return FALSE;
+2 -2
View File
@@ -352,7 +352,7 @@ void sub_080244E8(PestoEntity* this) {
switch (this->unk_80) {
case 0:
if (--super->timer == 0) {
if (GetCollisionDataAtMetaTilePos(COORD_TO_TILE(super), 1) == 0) {
if (GetCollisionDataAtTilePos(COORD_TO_TILE(super), 1) == 0) {
this->unk_80++;
this->unk_82++;
super->subtimer = 0;
@@ -446,7 +446,7 @@ void sub_080244E8(PestoEntity* this) {
super->timer = 12;
this->unk_83 &= ~0x80;
entity = super->child;
SetMetaTile(((PestoEntity*)entity)->unk_70, COORD_TO_TILE(entity), entity->collisionLayer);
SetTile(((PestoEntity*)entity)->unk_70, COORD_TO_TILE(entity), entity->collisionLayer);
DeleteEntity(entity);
super->z.HALF.HI -= 0xe;
this->unk_78 -= 0xe;
+23 -23
View File
@@ -22,10 +22,10 @@ typedef struct {
/*0x82*/ u8 unk_82;
/*0x83*/ u8 unused2[1];
/*0x84*/ u16 unk_84;
/*0x86*/ u16 unk_86;
/*0x86*/ u16 tilePos;
} PuffstoolEntity;
extern u8 gMapMetaTileTypeToCollisionData[];
extern u8 gMapTileTypeToCollisionData[];
bool32 sub_080258C4(PuffstoolEntity*);
void sub_08025B18(PuffstoolEntity*);
@@ -183,7 +183,7 @@ void sub_08025230(PuffstoolEntity* this) {
if (sub_0802571C(this)) {
super->action = 2;
super->timer = 240;
this->unk_86 = COORD_TO_TILE(super);
this->tilePos = COORD_TO_TILE(super);
}
} else {
this->unk_78--;
@@ -191,20 +191,20 @@ void sub_08025230(PuffstoolEntity* this) {
}
void sub_080252E0(PuffstoolEntity* this) {
u32 tile;
u32 tilePos;
super->direction = CalculateDirectionTo(super->x.HALF.HI, super->y.HALF.HI, this->unk_7c, this->unk_7e);
sub_08025C44(this);
GetNextFrame(super);
tile = COORD_TO_TILE(super);
if (tile == this->unk_86) {
tilePos = COORD_TO_TILE(super);
if (tilePos == this->tilePos) {
if (--super->timer == 0) {
sub_080256B4(this);
}
} else {
this->unk_86 = tile;
this->tilePos = tilePos;
super->timer = 240;
}
@@ -428,27 +428,27 @@ bool32 sub_0802571C(PuffstoolEntity* this) {
}
bool32 sub_080257EC(PuffstoolEntity* this, u32 x, u32 y) {
u16 metaTileType = sub_080B1A48(x - 0x00, y - 0x00, super->collisionLayer);
if (metaTileType != 0x312 && gMapMetaTileTypeToVvv[metaTileType] != VVV_22 &&
gMapMetaTileTypeToCollisionData[metaTileType] == 0) {
u16 tileType = sub_080B1A48(x - 0x00, y - 0x00, super->collisionLayer);
if (tileType != 0x312 && gMapTileTypeToVvv[tileType] != VVV_22 &&
gMapTileTypeToCollisionData[tileType] == 0) {
return TRUE;
}
metaTileType = sub_080B1A48(x - 0x10, y - 0x00, super->collisionLayer);
if (metaTileType != 0x312 && gMapMetaTileTypeToVvv[metaTileType] != VVV_22 &&
gMapMetaTileTypeToCollisionData[metaTileType] == 0) {
tileType = sub_080B1A48(x - 0x10, y - 0x00, super->collisionLayer);
if (tileType != 0x312 && gMapTileTypeToVvv[tileType] != VVV_22 &&
gMapTileTypeToCollisionData[tileType] == 0) {
return TRUE;
}
metaTileType = sub_080B1A48(x - 0x00, y - 0x10, super->collisionLayer);
if (metaTileType != 0x312 && gMapMetaTileTypeToVvv[metaTileType] != VVV_22 &&
gMapMetaTileTypeToCollisionData[metaTileType] == 0) {
tileType = sub_080B1A48(x - 0x00, y - 0x10, super->collisionLayer);
if (tileType != 0x312 && gMapTileTypeToVvv[tileType] != VVV_22 &&
gMapTileTypeToCollisionData[tileType] == 0) {
return TRUE;
}
metaTileType = sub_080B1A48(x - 0x10, y - 0x10, super->collisionLayer);
if (metaTileType != 0x312 && gMapMetaTileTypeToVvv[metaTileType] != VVV_22 &&
gMapMetaTileTypeToCollisionData[metaTileType] == 0) {
tileType = sub_080B1A48(x - 0x10, y - 0x10, super->collisionLayer);
if (tileType != 0x312 && gMapTileTypeToVvv[tileType] != VVV_22 &&
gMapTileTypeToCollisionData[tileType] == 0) {
return TRUE;
}
@@ -528,12 +528,12 @@ void sub_08025A54(PuffstoolEntity* this) {
}
}
bool32 sub_08025AB8(u32 metaTilePos, u32 layer) {
if (GetCollisionDataAtMetaTilePos(metaTilePos, layer))
bool32 sub_08025AB8(u32 tilePos, u32 layer) {
if (GetCollisionDataAtTilePos(tilePos, layer))
return FALSE;
if (GetVvvAtMetaTilePos(metaTilePos, layer) == VVV_10) {
sub_0807B7D8(0x61, metaTilePos, layer);
if (GetVvvAtTilePos(tilePos, layer) == VVV_10) {
sub_0807B7D8(0x61, tilePos, layer);
return TRUE;
}
+2 -2
View File
@@ -267,7 +267,7 @@ void sub_08020A7C(RollobiteEntity* this) {
bool32 Rollobite_TryToHoleUp(RollobiteEntity* this) {
if (Rollobite_IsRolledUp(this) && super->z.HALF.HI == 0) {
u32 tilePos = COORD_TO_TILE(super);
u32 tileType = GetMetaTileType(tilePos, super->collisionLayer);
u32 tileType = GetTileType(tilePos, super->collisionLayer);
if ((tileType * 0x10000 - 0x710000U) >> 0x10 < 2) {
super->action = 6;
COLLISION_OFF(super);
@@ -277,7 +277,7 @@ bool32 Rollobite_TryToHoleUp(RollobiteEntity* this) {
super->y.HALF.HI += 13;
super->zVelocity = Q_16_16(2.0);
InitializeAnimation(super, super->animationState + 0x14);
SetMetaTile(SPECIAL_META_TILE_52, tilePos, super->collisionLayer);
SetTile(SPECIAL_TILE_52, tilePos, super->collisionLayer);
return TRUE;
}
}
+14 -14
View File
@@ -13,7 +13,7 @@
typedef struct {
Entity base;
u8 filler[0xc];
u16 tile;
u16 tilePos;
u16 tileIndex;
u8 unk_78;
u8 unk_79;
@@ -93,9 +93,9 @@ void SpinyBeetle_Init(SpinyBeetleEntity* this) {
this->unk_7a = 0;
this->unk_78 = 0;
this->unk_7b = 0;
this->tile = COORD_TO_TILE(super);
this->tileIndex = GetMetaTileIndex(this->tile, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, this->tile, super->collisionLayer);
this->tilePos = COORD_TO_TILE(super);
this->tileIndex = GetTileIndex(this->tilePos, super->collisionLayer);
SetTile(SPECIAL_TILE_34, this->tilePos, super->collisionLayer);
obj = CreateObject(OBJECT_ON_BEETLE, super->type, 0);
if (obj == NULL) {
@@ -117,7 +117,7 @@ void sub_08033958(SpinyBeetleEntity* this) {
u32 direction;
if (sub_08033DF0(this)) {
sub_08033E1C(this);
SetMetaTileByIndex(this->tileIndex, this->tile, super->collisionLayer);
SetTileByIndex(this->tileIndex, this->tilePos, super->collisionLayer);
return;
}
@@ -166,7 +166,7 @@ void sub_08033958(SpinyBeetleEntity* this) {
COLLISION_ON(super);
super->y.WORD = (super->y.WORD & 0xfff00000) | 0xC0000;
SetMetaTileByIndex(this->tileIndex, this->tile, super->collisionLayer);
SetTileByIndex(this->tileIndex, this->tilePos, super->collisionLayer);
InitializeAnimation(super, 2);
}
@@ -237,10 +237,10 @@ void sub_08033B44(SpinyBeetleEntity* this) {
this->unk_80 = super->y.WORD;
super->spritePriority.b1 = 0;
this->unk_7b = 0x78;
this->tile = COORD_TO_TILE(super);
this->tileIndex = GetMetaTileIndex(this->tile, super->collisionLayer);
this->tilePos = COORD_TO_TILE(super);
this->tileIndex = GetTileIndex(this->tilePos, super->collisionLayer);
if (this->tileIndex != SPECIAL_META_TILE_34) {
if (this->tileIndex != SPECIAL_TILE_34) {
stop++;
} else {
switch (DirectionRound(super->direction) >> 2) {
@@ -260,7 +260,7 @@ void sub_08033B44(SpinyBeetleEntity* this) {
}
}
SetMetaTile(SPECIAL_META_TILE_34, this->tile, super->collisionLayer);
SetTile(SPECIAL_TILE_34, this->tilePos, super->collisionLayer);
InitializeAnimation(super, 0);
}
@@ -319,17 +319,17 @@ void sub_08033C94(SpinyBeetleEntity* this) {
void sub_08033D78(SpinyBeetleEntity* this) {
u32 dir = DirectionRound(super->direction) >> 2;
const s8* ptr = gUnk_080CEC1C + dir;
s32 tile;
s32 tilePos;
u32 type;
tile = COORD_TO_TILE_OFFSET(super, -ptr[0], -ptr[1]);
type = GetMetaTileType(tile, super->collisionLayer);
tilePos = COORD_TO_TILE_OFFSET(super, -ptr[0], -ptr[1]);
type = GetTileType(tilePos, super->collisionLayer);
switch (type) {
case 0x1c4:
case 0x1c5:
break;
default:
if (GetCollisionDataAtMetaTilePos(tile, super->collisionLayer) - 1 > 0x3e)
if (GetCollisionDataAtTilePos(tilePos, super->collisionLayer) - 1 > 0x3e)
ProcessMovement0(super);
break;
}
+2 -2
View File
@@ -438,7 +438,7 @@ void sub_08039AD4(StalfosEntity* this) {
super->action = 0xb;
super->child = projectile;
InitAnimationForceUpdate(super, super->animationState + 0x18);
SetMetaTile(SPECIAL_META_TILE_103, position, super->collisionLayer);
SetTile(SPECIAL_TILE_103, position, super->collisionLayer);
return;
}
}
@@ -456,7 +456,7 @@ u32 sub_08039B28(StalfosEntity* this) {
}
ptr2 = &gUnk_080CF930[super->animationState * 2];
pos = COORD_TO_TILE_OFFSET(super, -ptr2[0], -ptr2[1]);
tileType = GetMetaTileType(pos, (u32)super->collisionLayer);
tileType = GetTileType(pos, (u32)super->collisionLayer);
ptr = gUnk_080CF938;
do {
+4 -4
View File
@@ -14,7 +14,7 @@
typedef struct {
Entity base;
u8 filler[0xc];
u16 metaTilePos;
u16 tilePos;
u16 filler2;
u16 unk_78;
u16 projectileTimer;
@@ -46,7 +46,7 @@ void TorchTrap_Init(TorchTrapEntity* this) {
this->unk_84 &= 0xfff;
sub_0804A720(super);
super->action = 1;
this->metaTilePos = this->unk_82 & 0xfff;
this->tilePos = this->unk_82 & 0xfff;
super->x.HALF.HI = ((this->unk_82 & 0x3f) << 4) + 8 + gRoomControls.origin_x;
super->y.HALF.HI = ((this->unk_82 & 0xfc0) >> 2) + (gRoomControls.origin_y + 8);
super->direction = ((s16)this->unk_82 & 0xf000) >> 10;
@@ -76,7 +76,7 @@ void sub_0803CF38(TorchTrapEntity* this) {
}
void sub_0803CF94(TorchTrapEntity* this) {
if (GetMetaTileType(this->metaTilePos, super->collisionLayer) == META_TILE_TYPE_118) {
if (GetTileType(this->tilePos, super->collisionLayer) == TILE_TYPE_118) {
this->unk_80 = 0;
TorchTrap_Reset(this);
} else if (this->unk_7c && sub_0803CFD8(this)) {
@@ -141,7 +141,7 @@ void TorchTrap_CreateProjectile(TorchTrapEntity* this) {
void sub_0803D0B0(TorchTrapEntity* this) {
super->action = 3;
sub_0807B7D8(META_TILE_TYPE_117, this->metaTilePos, super->collisionLayer);
sub_0807B7D8(TILE_TYPE_117, this->tilePos, super->collisionLayer);
}
void (*const gTorchTrapActions[])(TorchTrapEntity*) = {
+1 -1
View File
@@ -241,7 +241,7 @@ void sub_0802EFB8(VaatiEyesMacroEntity* this) {
uVar1 = (uVar3 + 4) & 0x18;
}
collisionData =
GetCollisionDataAtMetaTilePos(TILE(super->x.HALF.HI, super->y.HALF.HI) + gUnk_080B4488[((uVar1) >> 3)], 1);
GetCollisionDataAtTilePos(TILE(super->x.HALF.HI, super->y.HALF.HI) + gUnk_080B4488[((uVar1) >> 3)], 1);
if (collisionData != 0) {
super->direction = DIR_NONE;
} else {
+3 -3
View File
@@ -282,8 +282,8 @@ bool32 sub_0803E4A0(VaatiProjectileEntity* this) {
}
void sub_0803E4D8(VaatiProjectileEntity* this) {
u32 metaTilePos = TILE(super->x.HALF.HI, super->y.HALF.HI + 8);
if (GetCollisionDataAtMetaTilePos(metaTilePos, gPlayerEntity.base.collisionLayer) != COLLISION_DATA_255) {
SetMetaTile(SPECIAL_META_TILE_116, metaTilePos, gPlayerEntity.base.collisionLayer);
u32 tilePos = TILE(super->x.HALF.HI, super->y.HALF.HI + 8);
if (GetCollisionDataAtTilePos(tilePos, gPlayerEntity.base.collisionLayer) != COLLISION_DATA_255) {
SetTile(SPECIAL_TILE_116, tilePos, gPlayerEntity.base.collisionLayer);
}
}
+2 -2
View File
@@ -26,7 +26,7 @@ void WizzrobeFire_OnCollision(WizzrobeEntity* this) {
}
EnemyFunctionHandlerAfterCollision(super, WizzrobeFire_Functions);
if (super->health == 0) {
SetMetaTile(this->tileIndex, this->tilePosition, super->collisionLayer);
SetTile(this->tileIndex, this->tilePos, super->collisionLayer);
}
}
@@ -111,7 +111,7 @@ void WizzrobeFire_Action2(WizzrobeEntity* this) {
super->timer = 40;
super->subtimer = 0;
super->flags &= ~0x80;
SetMetaTile(this->tileIndex, this->tilePosition, super->collisionLayer);
SetTile(this->tileIndex, this->tilePos, super->collisionLayer);
EnqueueSFX(SFX_156);
InitializeAnimation(super, super->direction >> 3);
}
+2 -2
View File
@@ -35,7 +35,7 @@ void WizzrobeIce_OnCollision(WizzrobeEntity* this) {
}
}
if (super->health == 0) {
SetMetaTile(this->tileIndex, this->tilePosition, super->collisionLayer);
SetTile(this->tileIndex, this->tilePos, super->collisionLayer);
}
}
@@ -118,7 +118,7 @@ void WizzrobeIce_Action2(WizzrobeEntity* this) {
super->timer = 40;
super->subtimer = 0;
super->flags &= ~0x80;
SetMetaTile(this->tileIndex, this->tilePosition, super->collisionLayer);
SetTile(this->tileIndex, this->tilePos, super->collisionLayer);
EnqueueSFX(SFX_156);
InitializeAnimation(super, super->direction >> 3);
}
+9 -9
View File
@@ -44,7 +44,7 @@ void WizzrobeWind_OnCollision(WizzrobeEntity* this) {
}
}
if (super->health == 0) {
SetMetaTile(this->tileIndex, this->tilePosition, super->collisionLayer);
SetTile(this->tileIndex, this->tilePos, super->collisionLayer);
}
}
@@ -137,7 +137,7 @@ void WizzrobeWind_Action2(WizzrobeEntity* this) {
super->subtimer = 0;
super->flags &= ~0x80;
EnqueueSFX(SFX_156);
SetMetaTile(this->tileIndex, this->tilePosition, super->collisionLayer);
SetTile(this->tileIndex, this->tilePos, super->collisionLayer);
InitializeAnimation(super, super->direction >> 3);
}
break;
@@ -208,15 +208,15 @@ void WizzrobeWind_Action3(WizzrobeEntity* this) {
void sub_0802F888(WizzrobeEntity* this) {
super->direction = (sub_08049F84(super, 3) + 4) & 0x18;
this->tilePosition = COORD_TO_TILE(super);
this->tileIndex = GetMetaTileIndex(this->tilePosition, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_113, this->tilePosition, super->collisionLayer);
this->tilePos = COORD_TO_TILE(super);
this->tileIndex = GetTileIndex(this->tilePos, super->collisionLayer);
SetTile(SPECIAL_TILE_113, this->tilePos, super->collisionLayer);
}
void sub_0802F8E4(WizzrobeEntity* this) {
u16 uVar1;
s32 iVar4;
u32 metaTilePos;
u32 tilePos;
u32 uVar7;
u32 uVar8;
@@ -234,9 +234,9 @@ void sub_0802F8E4(WizzrobeEntity* this) {
uVar1 = this->unk_72;
iVar4 = ((s32)(rand)&0x7ff0) % (this->unk_6f << 3);
uVar7 = (uVar1 + iVar4) | 8;
metaTilePos = TILE(uVar8, uVar7);
if ((GetCollisionDataAtMetaTilePos(metaTilePos, super->collisionLayer) == 0) &&
(GetMetaTileIndex(metaTilePos, super->collisionLayer) != SPECIAL_META_TILE_113)) {
tilePos = TILE(uVar8, uVar7);
if ((GetCollisionDataAtTilePos(tilePos, super->collisionLayer) == 0) &&
(GetTileIndex(tilePos, super->collisionLayer) != SPECIAL_TILE_113)) {
super->x.HALF.HI = (s16)uVar8;
super->y.HALF.HI = (s16)uVar7;
if (sub_08049FA0(super) != 0) {
+20 -20
View File
@@ -47,29 +47,29 @@ const u8 gEntityListLUT[] = {
// TODO: wrong file, maybe an "enter.c" according to lexicographical order
void sub_0805E248(void) {
s32 metaTilePos;
s32 tilePos;
metaTilePos = gDiggingCaveEntranceTransition.entrance->targetTilePosition;
tilePos = gDiggingCaveEntranceTransition.entrance->targetTilePosition;
if (gRoomControls.area == AREA_VEIL_FALLS || gRoomControls.area == AREA_VEIL_FALLS_DIG_CAVE) {
SetMetaTileType(META_TILE_TYPE_636, metaTilePos + TILE_POS(-1, -1), LAYER_BOTTOM);
SetMetaTileType(META_TILE_TYPE_643, metaTilePos + TILE_POS(-1, -1), LAYER_TOP);
SetMetaTileType(META_TILE_TYPE_637, metaTilePos + TILE_POS(0, -1), LAYER_BOTTOM);
SetMetaTileType(META_TILE_TYPE_644, metaTilePos + TILE_POS(0, -1), LAYER_TOP);
SetMetaTileType(META_TILE_TYPE_638, metaTilePos + TILE_POS(1, -1), LAYER_BOTTOM);
SetMetaTileType(META_TILE_TYPE_645, metaTilePos + TILE_POS(1, -1), LAYER_TOP);
SetMetaTileType(META_TILE_TYPE_639, metaTilePos + TILE_POS(-1, 0), LAYER_BOTTOM);
SetMetaTileType(META_TILE_TYPE_640, metaTilePos + TILE_POS(0, 0), LAYER_BOTTOM);
SetMetaTileType(META_TILE_TYPE_642, metaTilePos + TILE_POS(1, 0), LAYER_BOTTOM);
SetTileType(TILE_TYPE_636, tilePos + TILE_POS(-1, -1), LAYER_BOTTOM);
SetTileType(TILE_TYPE_643, tilePos + TILE_POS(-1, -1), LAYER_TOP);
SetTileType(TILE_TYPE_637, tilePos + TILE_POS(0, -1), LAYER_BOTTOM);
SetTileType(TILE_TYPE_644, tilePos + TILE_POS(0, -1), LAYER_TOP);
SetTileType(TILE_TYPE_638, tilePos + TILE_POS(1, -1), LAYER_BOTTOM);
SetTileType(TILE_TYPE_645, tilePos + TILE_POS(1, -1), LAYER_TOP);
SetTileType(TILE_TYPE_639, tilePos + TILE_POS(-1, 0), LAYER_BOTTOM);
SetTileType(TILE_TYPE_640, tilePos + TILE_POS(0, 0), LAYER_BOTTOM);
SetTileType(TILE_TYPE_642, tilePos + TILE_POS(1, 0), LAYER_BOTTOM);
} else {
SetMetaTileType(META_TILE_TYPE_620, metaTilePos + TILE_POS(-1, -1), LAYER_BOTTOM);
SetMetaTileType(META_TILE_TYPE_627, metaTilePos + TILE_POS(-1, -1), LAYER_TOP);
SetMetaTileType(META_TILE_TYPE_621, metaTilePos + TILE_POS(0, -1), LAYER_BOTTOM);
SetMetaTileType(META_TILE_TYPE_628, metaTilePos + TILE_POS(0, -1), LAYER_TOP);
SetMetaTileType(META_TILE_TYPE_622, metaTilePos + TILE_POS(1, -1), LAYER_BOTTOM);
SetMetaTileType(META_TILE_TYPE_629, metaTilePos + TILE_POS(1, -1), LAYER_TOP);
SetMetaTileType(META_TILE_TYPE_623, metaTilePos + TILE_POS(-1, 0), LAYER_BOTTOM);
SetMetaTileType(META_TILE_TYPE_624, metaTilePos + TILE_POS(0, 0), LAYER_BOTTOM);
SetMetaTileType(META_TILE_TYPE_626, metaTilePos + TILE_POS(1, 0), LAYER_BOTTOM);
SetTileType(TILE_TYPE_620, tilePos + TILE_POS(-1, -1), LAYER_BOTTOM);
SetTileType(TILE_TYPE_627, tilePos + TILE_POS(-1, -1), LAYER_TOP);
SetTileType(TILE_TYPE_621, tilePos + TILE_POS(0, -1), LAYER_BOTTOM);
SetTileType(TILE_TYPE_628, tilePos + TILE_POS(0, -1), LAYER_TOP);
SetTileType(TILE_TYPE_622, tilePos + TILE_POS(1, -1), LAYER_BOTTOM);
SetTileType(TILE_TYPE_629, tilePos + TILE_POS(1, -1), LAYER_TOP);
SetTileType(TILE_TYPE_623, tilePos + TILE_POS(-1, 0), LAYER_BOTTOM);
SetTileType(TILE_TYPE_624, tilePos + TILE_POS(0, 0), LAYER_BOTTOM);
SetTileType(TILE_TYPE_626, tilePos + TILE_POS(1, 0), LAYER_BOTTOM);
}
gUpdateVisibleTiles = 0;
}
+8 -8
View File
@@ -40,20 +40,20 @@ u32 CheckRoomFlag(u32 flag) {
return ReadBit(&gRoomVars.flags, flag);
}
u32 CheckLocalFlagsByBank(u32 offset, u32 flag, u32 length) {
return CheckBits(gSave.flags, offset + flag, length);
u32 CheckLocalFlagsByBank(u32 offset, u32 flag, u32 count) {
return CheckBits(gSave.flags, offset + flag, count);
}
u32 CheckLocalFlags(u32 flag, u32 length) {
return CheckLocalFlagsByBank(gArea.localFlagOffset, flag, length);
u32 CheckLocalFlags(u32 flag, u32 count) {
return CheckLocalFlagsByBank(gArea.localFlagOffset, flag, count);
}
u32 CheckGlobalFlags(u32 flag, u32 length) {
return CheckLocalFlagsByBank(FLAG_BANK_0, flag, length);
u32 CheckGlobalFlags(u32 flag, u32 count) {
return CheckLocalFlagsByBank(FLAG_BANK_0, flag, count);
}
u32 CheckRoomFlags(u32 flag, u32 length) {
return CheckBits(&gRoomVars.flags, flag, length);
u32 CheckRoomFlags(u32 flag, u32 count) {
return CheckBits(&gRoomVars.flags, flag, count);
}
void SetLocalFlagByBank(u32 offset, u32 flag) {
+3 -3
View File
@@ -35,7 +35,7 @@ void ResetTimerFlags(void);
extern void** gAreaTilesets[];
extern void** gAreaRoomMaps[];
extern void* gAreaMetatiles[];
extern void* gAreaTiles[];
extern void** gAreaTable[];
typedef struct {
@@ -558,7 +558,7 @@ void InitRoomResInfo(RoomResInfo* info, RoomHeader* r_hdr, u32 area, u32 room) {
info->pixel_height = r_hdr->pixel_height;
info->tileset = *(gAreaTilesets[area] + r_hdr->tileset_id);
info->map = *(gAreaRoomMaps[area] + room);
info->metatiles = gAreaMetatiles[area];
info->tiles = gAreaTiles[area];
info->bg_anim = (void*)gUnk_080B755C[area];
info->exits = gExitLists[area][room];
if (gAreaTable[area] != NULL) {
@@ -662,7 +662,7 @@ void sub_08052FF4(u32 area, u32 room) {
gArea.currentRoomInfo.pixel_height = r_hdr->pixel_height;
gArea.currentRoomInfo.tileset = *(gAreaTilesets[area] + r_hdr->tileset_id);
gArea.currentRoomInfo.map = *(gAreaRoomMaps[area] + room);
gArea.currentRoomInfo.metatiles = gAreaMetatiles[area];
gArea.currentRoomInfo.tiles = gAreaTiles[area];
gArea.currentRoomInfo.bg_anim = (void*)gUnk_080B755C[area];
}
+2 -2
View File
@@ -87,11 +87,11 @@ void UpdateDisplayControls(void) {
}
void sub_08016CA8(BgSettings* bg) {
if (bg->updated && bg->tilemap != NULL) {
if (bg->updated && bg->subTileMap != NULL) {
u32 dest;
bg->updated = 0;
dest = bg->control;
DmaCopy32(3, bg->tilemap, ((dest << 3) & 0xF800) + VRAM, gUnk_080B2CD8[dest >> 14]);
DmaCopy32(3, bg->subTileMap, ((dest << 3) & 0xF800) + VRAM, gUnk_080B2CD8[dest >> 14]);
}
}
+4 -4
View File
@@ -177,18 +177,18 @@ void sub_08077448(ItemBehavior* this, u32 index) {
s32 sub_080774A0(void) {
static const s8 gUnk_0811BE1E[] = { 0, -13, 13, 0, 0, 16, -13, 0, 0, 0 };
u32 collisionData;
u32 metaTilePos;
u32 tilePos;
metaTilePos = COORD_TO_TILE_OFFSET((&gPlayerEntity.base), -gUnk_0811BE1E[gPlayerEntity.base.animationState & 6],
tilePos = COORD_TO_TILE_OFFSET((&gPlayerEntity.base), -gUnk_0811BE1E[gPlayerEntity.base.animationState & 6],
-gUnk_0811BE1E[(gPlayerEntity.base.animationState & 6) + 1]);
collisionData = GetCollisionDataAtMetaTilePos(metaTilePos, gPlayerEntity.base.collisionLayer);
collisionData = GetCollisionDataAtTilePos(tilePos, gPlayerEntity.base.collisionLayer);
if (collisionData > 0x16)
return 0;
if (collisionData < 0xf)
return 0;
if (GetVvvAtMetaTilePos(metaTilePos, gPlayerEntity.base.collisionLayer) != VVV_86) {
if (GetVvvAtTilePos(tilePos, gPlayerEntity.base.collisionLayer) != VVV_86) {
return 1;
} else {
return 0x56;
+51 -51
View File
@@ -335,7 +335,7 @@ void sub_0801876C(u32 worldEventId, bool32 isKinstoneFused) {
if (isKinstoneFused == 0) {
return;
}
SetMetaTileType(META_TILE_TYPE_360, (ptr->x >> 4 & 0x3f) | (ptr->y >> 4 & 0x3f) << 6, LAYER_BOTTOM);
SetTileType(TILE_TYPE_360, (ptr->x >> 4 & 0x3f) | (ptr->y >> 4 & 0x3f) << 6, LAYER_BOTTOM);
break;
case WORLD_EVENT_TYPE_11:
if (isKinstoneFused != 0) {
@@ -354,12 +354,12 @@ void sub_0801876C(u32 worldEventId, bool32 isKinstoneFused) {
*(u16*)&ent->gustJarState = ptr->y + gRoomControls.origin_y;
}
if (ptr->entity_idx == 0) {
SetMetaTileType(META_TILE_TYPE_141, (ptr->x >> 4 & 0x3f) | (ptr->y >> 4 & 0x3f) << 6, LAYER_BOTTOM);
SetTileType(TILE_TYPE_141, (ptr->x >> 4 & 0x3f) | (ptr->y >> 4 & 0x3f) << 6, LAYER_BOTTOM);
} else {
uVar5 = (ptr->x >> 4 & 0x3f) | (ptr->y >> 4 & 0x3f) << 6;
SetMetaTileType(META_TILE_TYPE_140, uVar5 - 1, LAYER_BOTTOM);
uVar3 = META_TILE_TYPE_142;
SetMetaTileType(uVar3, uVar5, LAYER_BOTTOM);
SetTileType(TILE_TYPE_140, uVar5 - 1, LAYER_BOTTOM);
uVar3 = TILE_TYPE_142;
SetTileType(uVar3, uVar5, LAYER_BOTTOM);
}
break;
case WORLD_EVENT_TYPE_24:
@@ -390,67 +390,67 @@ void sub_0801876C(u32 worldEventId, bool32 isKinstoneFused) {
void sub_080189EC(u32 worldEventId) {
u32 i;
int iVar1;
int metaTilePos;
int tilePos;
const WorldEvent* ptr;
ptr = &gWorldEvents[worldEventId];
metaTilePos = (ptr->x >> 4) & 0x3f;
metaTilePos |= ((ptr->y >> 4) & 0x3f) << 6;
metaTilePos -= TILE_POS(2, 1);
tilePos = (ptr->x >> 4) & 0x3f;
tilePos |= ((ptr->y >> 4) & 0x3f) << 6;
tilePos -= TILE_POS(2, 1);
for (i = 0; i < 4; i++) {
SetMetaTileType(i + META_TILE_TYPE_479, metaTilePos + i, LAYER_TOP);
SetTileType(i + TILE_TYPE_479, tilePos + i, LAYER_TOP);
}
metaTilePos += TILE_POS(0, 1);
tilePos += TILE_POS(0, 1);
for (i = 0; i < 4; i++) {
SetMetaTileType(i + META_TILE_TYPE_483, metaTilePos + i, LAYER_TOP);
SetMetaTileType(i + META_TILE_TYPE_475, metaTilePos + i, LAYER_BOTTOM);
SetTileType(i + TILE_TYPE_483, tilePos + i, LAYER_TOP);
SetTileType(i + TILE_TYPE_475, tilePos + i, LAYER_BOTTOM);
}
}
void sub_08018A58(u32 worldEventId) {
u32 i;
int metaTileType;
int tileType;
u32 j;
int metaTilePos;
int tilePos;
const WorldEvent* ptr;
ptr = &gWorldEvents[worldEventId];
metaTilePos = (ptr->x >> 4) & 0x3f;
metaTilePos |= ((ptr->y >> 4) & 0x3f) << 6;
metaTilePos -= TILE_POS(3, 1);
metaTileType = META_TILE_TYPE_562;
tilePos = (ptr->x >> 4) & 0x3f;
tilePos |= ((ptr->y >> 4) & 0x3f) << 6;
tilePos -= TILE_POS(3, 1);
tileType = TILE_TYPE_562;
for (i = 0; i < 4; metaTilePos += TILE_POS(0, 1), i++) {
for (i = 0; i < 4; tilePos += TILE_POS(0, 1), i++) {
for (j = 0; j < 7; j++) {
SetMetaTileType(metaTileType++, metaTilePos + j, LAYER_BOTTOM);
SetTileType(tileType++, tilePos + j, LAYER_BOTTOM);
}
}
}
void sub_08018AB4(int metaTilePos) {
void sub_08018AB4(int tilePos) {
u32 i;
int iVar2;
u32 j;
int iVar6;
iVar2 = META_TILE_TYPE_488;
iVar6 = META_TILE_TYPE_500;
iVar2 = TILE_TYPE_488;
iVar6 = TILE_TYPE_500;
for (i = 0; i < 3; i++) {
j = 0;
for (; j < 4; j++) {
SetMetaTileType(iVar2++, metaTilePos + j, LAYER_BOTTOM);
SetMetaTileType(iVar6++, metaTilePos + TILE_POS(0, -1) + j, LAYER_TOP);
SetTileType(iVar2++, tilePos + j, LAYER_BOTTOM);
SetTileType(iVar6++, tilePos + TILE_POS(0, -1) + j, LAYER_TOP);
}
metaTilePos += TILE_POS(0, 1);
tilePos += TILE_POS(0, 1);
}
}
void sub_08018B10(int metaTilePos) {
void sub_08018B10(int tilePos) {
int iVar1;
u32 index;
int iVar3;
@@ -459,34 +459,34 @@ void sub_08018B10(int metaTilePos) {
iVar4 = 0x1f0;
iVar3 = 0x1fc;
index = 0;
iVar1 = metaTilePos - TILE_POS(0, 1);
iVar1 = tilePos - TILE_POS(0, 1);
for (; index < 4; iVar1++, index++) {
SetMetaTileType(iVar4++, metaTilePos + index, LAYER_BOTTOM);
SetMetaTileType(iVar3++, iVar1, LAYER_TOP);
SetTileType(iVar4++, tilePos + index, LAYER_BOTTOM);
SetTileType(iVar3++, iVar1, LAYER_TOP);
}
}
void sub_08018B50(u32 worldEventId) {
u32 i;
int metaTileType;
int tileType;
u32 j;
int metaTilePos;
int tilePos;
const WorldEvent* ptr;
ptr = &gWorldEvents[worldEventId];
if ((ptr->entity_idx & 0x80) == 0) {
metaTileType = META_TILE_TYPE_512;
tileType = TILE_TYPE_512;
} else {
metaTileType = META_TILE_TYPE_537;
tileType = TILE_TYPE_537;
}
metaTilePos = (ptr->x >> 4) & 0x3f;
metaTilePos |= ((ptr->y >> 4) & 0x3f) << 6;
metaTilePos -= TILE_POS(2, 2);
tilePos = (ptr->x >> 4) & 0x3f;
tilePos |= ((ptr->y >> 4) & 0x3f) << 6;
tilePos -= TILE_POS(2, 2);
for (i = 0; i < 5; metaTilePos += 0x40, i++) {
for (i = 0; i < 5; tilePos += 0x40, i++) {
for (j = 0; j < 5; j++) {
SetMetaTileType(metaTileType++, metaTilePos + j, LAYER_BOTTOM);
SetTileType(tileType++, tilePos + j, LAYER_BOTTOM);
}
}
}
@@ -494,22 +494,22 @@ void sub_08018B50(u32 worldEventId) {
// TODO world event that loads tile entity
void sub_08018BB4(u32 worldEventId) {
u32 layer;
TileEntity tile;
TileEntity tileEntity;
const WorldEvent* ptr;
u32 position;
MemCopy(gUnk_080FEAC8 + worldEventId, &tile, sizeof(TileEntity));
MemCopy(gUnk_080FEAC8 + worldEventId, &tileEntity, sizeof(TileEntity));
ptr = &gWorldEvents[worldEventId];
tile.tilePos = (ptr->x >> 4 & 0x3f) | (((ptr->y) >> 4 & 0x3f) << 6);
LoadSmallChestTile2(&tile);
if (CheckLocalFlag(tile.localFlag) == 0) {
position = tile.tilePos;
if ((tile._6 & 1) == 0) {
tileEntity.tilePos = (ptr->x >> 4 & 0x3f) | (((ptr->y) >> 4 & 0x3f) << 6);
LoadSmallChestTile2(&tileEntity);
if (CheckLocalFlag(tileEntity.localFlag) == 0) {
position = tileEntity.tilePos;
if ((tileEntity._6 & 1) == 0) {
layer = 1;
} else {
layer = 2;
}
SetMetaTileType(META_TILE_TYPE_115, position, layer);
SetTileType(TILE_TYPE_115, position, layer);
}
}
@@ -519,7 +519,7 @@ void CreateMinishEntrance(u32 tilePos) {
for (y = 0; y <= 3; y++) {
for (x = 0; x <= 4; x++) {
SetMetaTileType(tileID++, tilePos + x, LAYER_BOTTOM);
SetTileType(tileID++, tilePos + x, LAYER_BOTTOM);
}
tilePos += 0x40;
}
@@ -529,7 +529,7 @@ void sub_08018C58(u32 tilePos) {
u32 i;
for (i = 0; i < 6; i += 2, tilePos += 0x40) {
SetMetaTileType(META_TILE_TYPE_608 + i, tilePos, LAYER_BOTTOM);
SetMetaTileType(META_TILE_TYPE_609 + i, tilePos + 1, LAYER_BOTTOM);
SetTileType(TILE_TYPE_608 + i, tilePos, LAYER_BOTTOM);
SetTileType(TILE_TYPE_609 + i, tilePos + 1, LAYER_BOTTOM);
}
}
+103 -103
View File
@@ -13,7 +13,7 @@
#include "sound.h"
#include "tiles.h"
u32 BombableWallManager_GetBombableType(u32 metaTilePos, u32 layer);
u32 BombableWallManager_GetBombableType(u32 tilePos, u32 layer);
void BombableWallManager_DestroyWall(BombableWallManager*);
u32 getArchwayType(void);
@@ -37,8 +37,8 @@ void BombableWallManager_Main(BombableWallManager* this) {
void BombableWallManager_Init(BombableWallManager* this) {
super->action = 1;
this->metaTilePos = (this->x >> 4 & 0x3fU) | (((this->y << 0x10) >> 0x14 & 0x3fU) << 6);
super->type = BombableWallManager_GetBombableType(this->metaTilePos, this->layer);
this->tilePos = (this->x >> 4 & 0x3fU) | (((this->y << 0x10) >> 0x14 & 0x3fU) << 6);
super->type = BombableWallManager_GetBombableType(this->tilePos, this->layer);
if (CheckLocalFlag(this->flag) != 0) {
BombableWallManager_DestroyWall(this);
DeleteManager(super);
@@ -46,7 +46,7 @@ void BombableWallManager_Init(BombableWallManager* this) {
}
void BombableWallManager_Action1(BombableWallManager* this) {
if (GetVvvAtMetaTilePos(this->metaTilePos, this->layer) != VVV_46) {
if (GetVvvAtTilePos(this->tilePos, this->layer) != VVV_46) {
super->action = 2;
super->timer = 90;
BombableWallManager_DestroyWall(this);
@@ -61,29 +61,29 @@ void BombableWallManager_Action2(BombableWallManager* this) {
}
}
u32 BombableWallManager_GetBombableType(u32 metaTilePos, u32 layer) {
u32 metaTileType = GetMetaTileType(metaTilePos, layer);
u32 BombableWallManager_GetBombableType(u32 tilePos, u32 layer) {
u32 tileType = GetTileType(tilePos, layer);
switch (metaTileType) {
case META_TILE_TYPE_236:
switch (tileType) {
case TILE_TYPE_236:
return 1;
case META_TILE_TYPE_191:
case TILE_TYPE_191:
return 4;
case META_TILE_TYPE_175:
case TILE_TYPE_175:
return 0;
case META_TILE_TYPE_204:
case TILE_TYPE_204:
return 2;
case META_TILE_TYPE_223:
case TILE_TYPE_223:
return 3;
case META_TILE_TYPE_255:
case TILE_TYPE_255:
return 0;
case META_TILE_TYPE_277:
case TILE_TYPE_277:
return 1;
case META_TILE_TYPE_264:
case TILE_TYPE_264:
return 2;
case META_TILE_TYPE_272:
case TILE_TYPE_272:
return 3;
case META_TILE_TYPE_261:
case TILE_TYPE_261:
return 4;
}
return 0xff;
@@ -95,38 +95,38 @@ void BombableWallManager_DestroyWall(BombableWallManager* this) {
BombableWallManager_DestroyWall3, BombableWallManager_DestroyWall4,
};
if (super->type != 0xff) {
gUnk_08108CE8[super->type](this->metaTilePos, this->layer);
gUnk_08108CE8[super->type](this->tilePos, this->layer);
}
}
void BombableWallManager_DestroyWall0(u32 metaTilePos, u32 layer) {
SetMetaTileType(META_TILE_TYPE_177, metaTilePos + TILE_POS(-1, -1), layer);
SetMetaTileType(META_TILE_TYPE_178, metaTilePos + TILE_POS(0, -1), layer);
SetMetaTileType(META_TILE_TYPE_179, metaTilePos + TILE_POS(1, -1), layer);
SetMetaTileType(META_TILE_TYPE_180, metaTilePos + TILE_POS(-1, 0), layer);
SetMetaTileType(META_TILE_TYPE_183, metaTilePos + TILE_POS(1, 0), layer);
void BombableWallManager_DestroyWall0(u32 tilePos, u32 layer) {
SetTileType(TILE_TYPE_177, tilePos + TILE_POS(-1, -1), layer);
SetTileType(TILE_TYPE_178, tilePos + TILE_POS(0, -1), layer);
SetTileType(TILE_TYPE_179, tilePos + TILE_POS(1, -1), layer);
SetTileType(TILE_TYPE_180, tilePos + TILE_POS(-1, 0), layer);
SetTileType(TILE_TYPE_183, tilePos + TILE_POS(1, 0), layer);
if (layer == LAYER_BOTTOM) {
if (AreaHasEnemies()) {
Entity* object = CreateObject(ARCHWAY, 0xe, 0);
if (object != NULL) {
object->x.HALF.HI = ((metaTilePos & 0x3f) << 4) + 8 + gRoomControls.origin_x;
object->y.HALF.HI = ((metaTilePos & 0xfc0) >> 2) - 8 + gRoomControls.origin_y;
object->x.HALF.HI = ((tilePos & 0x3f) << 4) + 8 + gRoomControls.origin_x;
object->y.HALF.HI = ((tilePos & 0xfc0) >> 2) - 8 + gRoomControls.origin_y;
}
SetMetaTileType(META_TILE_TYPE_181, metaTilePos, LAYER_BOTTOM);
SetTileType(TILE_TYPE_181, tilePos, LAYER_BOTTOM);
} else {
if (AreaIsDungeon()) {
SetMetaTileType(META_TILE_TYPE_181, metaTilePos, LAYER_BOTTOM);
SetTileType(TILE_TYPE_181, tilePos, LAYER_BOTTOM);
} else {
SetMetaTileType(META_TILE_TYPE_182, metaTilePos, LAYER_BOTTOM);
SetTileType(TILE_TYPE_182, tilePos, LAYER_BOTTOM);
}
}
SetMetaTileType(META_TILE_TYPE_184, metaTilePos + TILE_POS(-1, -1), LAYER_TOP);
SetMetaTileType(META_TILE_TYPE_185, metaTilePos + TILE_POS(0, -1), LAYER_TOP);
SetMetaTileType(META_TILE_TYPE_186, metaTilePos + TILE_POS(1, -1), LAYER_TOP);
SetTileType(TILE_TYPE_184, tilePos + TILE_POS(-1, -1), LAYER_TOP);
SetTileType(TILE_TYPE_185, tilePos + TILE_POS(0, -1), LAYER_TOP);
SetTileType(TILE_TYPE_186, tilePos + TILE_POS(1, -1), LAYER_TOP);
} else {
Entity* object;
SetMetaTileType(META_TILE_TYPE_181, metaTilePos, LAYER_TOP);
SetTileType(TILE_TYPE_181, tilePos, LAYER_TOP);
if (!AreaIsDungeon()) {
return;
}
@@ -134,41 +134,41 @@ void BombableWallManager_DestroyWall0(u32 metaTilePos, u32 layer) {
if (object == NULL) {
return;
}
object->x.HALF.HI = ((metaTilePos & 0x3f) << 4) + 8 + gRoomControls.origin_x;
object->y.HALF.HI = ((metaTilePos & 0xfc0) >> 2) - 0x10 + gRoomControls.origin_y;
object->x.HALF.HI = ((tilePos & 0x3f) << 4) + 8 + gRoomControls.origin_x;
object->y.HALF.HI = ((tilePos & 0xfc0) >> 2) - 0x10 + gRoomControls.origin_y;
object->collisionLayer = LAYER_TOP;
}
}
void BombableWallManager_DestroyWall1(u32 metaTilePos, u32 layer) {
void BombableWallManager_DestroyWall1(u32 tilePos, u32 layer) {
Entity* object;
SetMetaTileType(META_TILE_TYPE_241, metaTilePos + TILE_POS(0, -1), layer);
SetMetaTileType(META_TILE_TYPE_245, metaTilePos + TILE_POS(1, -1), layer);
SetMetaTileType(META_TILE_TYPE_246, metaTilePos + TILE_POS(1, 0), layer);
SetMetaTileType(META_TILE_TYPE_244, metaTilePos + TILE_POS(0, 1), layer);
SetMetaTileType(META_TILE_TYPE_247, metaTilePos + TILE_POS(1, 1), layer);
SetTileType(TILE_TYPE_241, tilePos + TILE_POS(0, -1), layer);
SetTileType(TILE_TYPE_245, tilePos + TILE_POS(1, -1), layer);
SetTileType(TILE_TYPE_246, tilePos + TILE_POS(1, 0), layer);
SetTileType(TILE_TYPE_244, tilePos + TILE_POS(0, 1), layer);
SetTileType(TILE_TYPE_247, tilePos + TILE_POS(1, 1), layer);
if (layer == LAYER_BOTTOM) {
if (AreaHasEnemies()) {
object = CreateObject(ARCHWAY, 0xe, 1);
if (object != NULL) {
object->x.HALF.HI = ((metaTilePos & 0x3f) << 4) + 0x18 + gRoomControls.origin_x;
object->y.HALF.HI = ((metaTilePos & 0xfc0) >> 2) + 8 + gRoomControls.origin_y;
object->x.HALF.HI = ((tilePos & 0x3f) << 4) + 0x18 + gRoomControls.origin_x;
object->y.HALF.HI = ((tilePos & 0xfc0) >> 2) + 8 + gRoomControls.origin_y;
}
SetMetaTileType(META_TILE_TYPE_242, metaTilePos, LAYER_BOTTOM);
SetTileType(TILE_TYPE_242, tilePos, LAYER_BOTTOM);
} else {
if (AreaIsDungeon()) {
SetMetaTileType(META_TILE_TYPE_242, metaTilePos, LAYER_BOTTOM);
SetTileType(TILE_TYPE_242, tilePos, LAYER_BOTTOM);
} else {
SetMetaTileType(META_TILE_TYPE_243, metaTilePos, LAYER_BOTTOM);
SetTileType(TILE_TYPE_243, tilePos, LAYER_BOTTOM);
}
}
SetMetaTileType(META_TILE_TYPE_248, metaTilePos + TILE_POS(1, -1), LAYER_TOP);
SetMetaTileType(META_TILE_TYPE_249, metaTilePos + 1, LAYER_TOP);
SetMetaTileType(META_TILE_TYPE_250, metaTilePos + TILE_POS(1, 1), LAYER_TOP);
SetTileType(TILE_TYPE_248, tilePos + TILE_POS(1, -1), LAYER_TOP);
SetTileType(TILE_TYPE_249, tilePos + 1, LAYER_TOP);
SetTileType(TILE_TYPE_250, tilePos + TILE_POS(1, 1), LAYER_TOP);
} else {
SetMetaTileType(META_TILE_TYPE_242, metaTilePos, LAYER_TOP);
SetTileType(TILE_TYPE_242, tilePos, LAYER_TOP);
if (!AreaIsDungeon()) {
return;
}
@@ -176,40 +176,40 @@ void BombableWallManager_DestroyWall1(u32 metaTilePos, u32 layer) {
if (object == NULL) {
return;
}
object->x.HALF.HI = ((metaTilePos & 0x3f) << 4) + 0x20 + gRoomControls.origin_x;
object->y.HALF.HI = ((metaTilePos & 0xfc0) >> 2) + 8 + gRoomControls.origin_y;
object->x.HALF.HI = ((tilePos & 0x3f) << 4) + 0x20 + gRoomControls.origin_x;
object->y.HALF.HI = ((tilePos & 0xfc0) >> 2) + 8 + gRoomControls.origin_y;
object->collisionLayer = LAYER_TOP;
}
}
void BombableWallManager_DestroyWall2(u32 metaTilePos, u32 layer) {
void BombableWallManager_DestroyWall2(u32 tilePos, u32 layer) {
Entity* object;
SetMetaTileType(META_TILE_TYPE_209, metaTilePos + TILE_POS(-1, 0), layer);
SetMetaTileType(META_TILE_TYPE_212, metaTilePos + TILE_POS(1, 0), layer);
SetMetaTileType(META_TILE_TYPE_213, metaTilePos + TILE_POS(-1, 1), layer);
SetMetaTileType(META_TILE_TYPE_214, metaTilePos + TILE_POS(0, 1), layer);
SetMetaTileType(META_TILE_TYPE_215, metaTilePos + TILE_POS(1, 1), layer);
SetTileType(TILE_TYPE_209, tilePos + TILE_POS(-1, 0), layer);
SetTileType(TILE_TYPE_212, tilePos + TILE_POS(1, 0), layer);
SetTileType(TILE_TYPE_213, tilePos + TILE_POS(-1, 1), layer);
SetTileType(TILE_TYPE_214, tilePos + TILE_POS(0, 1), layer);
SetTileType(TILE_TYPE_215, tilePos + TILE_POS(1, 1), layer);
if (layer == LAYER_BOTTOM) {
if (AreaHasEnemies()) {
object = CreateObject(ARCHWAY, 0xe, 2);
if (object != NULL) {
object->x.HALF.HI = ((metaTilePos & 0x3f) << 4) + 8 + gRoomControls.origin_x;
object->y.HALF.HI = ((metaTilePos & 0xfc0) >> 2) + 0x20 + gRoomControls.origin_y;
object->x.HALF.HI = ((tilePos & 0x3f) << 4) + 8 + gRoomControls.origin_x;
object->y.HALF.HI = ((tilePos & 0xfc0) >> 2) + 0x20 + gRoomControls.origin_y;
}
SetMetaTileType(META_TILE_TYPE_210, metaTilePos, LAYER_BOTTOM);
SetTileType(TILE_TYPE_210, tilePos, LAYER_BOTTOM);
} else {
if (AreaIsDungeon()) {
SetMetaTileType(META_TILE_TYPE_210, metaTilePos, LAYER_BOTTOM);
SetTileType(TILE_TYPE_210, tilePos, LAYER_BOTTOM);
} else {
SetMetaTileType(META_TILE_TYPE_211, metaTilePos, LAYER_BOTTOM);
SetTileType(TILE_TYPE_211, tilePos, LAYER_BOTTOM);
}
}
SetMetaTileType(META_TILE_TYPE_216, metaTilePos + TILE_POS(-1, 1), LAYER_TOP);
SetMetaTileType(META_TILE_TYPE_217, metaTilePos + TILE_POS(0, 1), LAYER_TOP);
SetMetaTileType(META_TILE_TYPE_218, metaTilePos + TILE_POS(1, 1), LAYER_TOP);
SetTileType(TILE_TYPE_216, tilePos + TILE_POS(-1, 1), LAYER_TOP);
SetTileType(TILE_TYPE_217, tilePos + TILE_POS(0, 1), LAYER_TOP);
SetTileType(TILE_TYPE_218, tilePos + TILE_POS(1, 1), LAYER_TOP);
} else {
SetMetaTileType(META_TILE_TYPE_210, metaTilePos, LAYER_TOP);
SetTileType(TILE_TYPE_210, tilePos, LAYER_TOP);
if (AreaIsDungeon() == 0) {
return;
}
@@ -217,40 +217,40 @@ void BombableWallManager_DestroyWall2(u32 metaTilePos, u32 layer) {
if (object == NULL) {
return;
}
object->x.HALF.HI = ((metaTilePos & 0x3f) << 4) + 8 + gRoomControls.origin_x;
object->y.HALF.HI = ((metaTilePos & 0xfc0) >> 2) + 0x20 + gRoomControls.origin_y;
object->x.HALF.HI = ((tilePos & 0x3f) << 4) + 8 + gRoomControls.origin_x;
object->y.HALF.HI = ((tilePos & 0xfc0) >> 2) + 0x20 + gRoomControls.origin_y;
object->collisionLayer = LAYER_TOP;
}
}
void BombableWallManager_DestroyWall3(u32 metaTilePos, u32 layer) {
void BombableWallManager_DestroyWall3(u32 tilePos, u32 layer) {
Entity* object;
SetMetaTileType(META_TILE_TYPE_225, metaTilePos + TILE_POS(-1, -1), layer);
SetMetaTileType(META_TILE_TYPE_228, metaTilePos + TILE_POS(0, -1), layer);
SetMetaTileType(META_TILE_TYPE_226, metaTilePos + TILE_POS(-1, 0), layer);
SetMetaTileType(META_TILE_TYPE_227, metaTilePos + TILE_POS(-1, 1), layer);
SetMetaTileType(META_TILE_TYPE_231, metaTilePos + TILE_POS(0, 1), layer);
SetTileType(TILE_TYPE_225, tilePos + TILE_POS(-1, -1), layer);
SetTileType(TILE_TYPE_228, tilePos + TILE_POS(0, -1), layer);
SetTileType(TILE_TYPE_226, tilePos + TILE_POS(-1, 0), layer);
SetTileType(TILE_TYPE_227, tilePos + TILE_POS(-1, 1), layer);
SetTileType(TILE_TYPE_231, tilePos + TILE_POS(0, 1), layer);
if (layer == LAYER_BOTTOM) {
if (AreaHasEnemies()) {
object = CreateObject(ARCHWAY, 0xe, 3);
if (object != NULL) {
object->x.HALF.HI = ((metaTilePos & 0x3f) << 4) + -0x10 + gRoomControls.origin_x;
object->y.HALF.HI = ((metaTilePos & 0xfc0) >> 2) + 8 + gRoomControls.origin_y;
object->x.HALF.HI = ((tilePos & 0x3f) << 4) + -0x10 + gRoomControls.origin_x;
object->y.HALF.HI = ((tilePos & 0xfc0) >> 2) + 8 + gRoomControls.origin_y;
}
SetMetaTileType(META_TILE_TYPE_229, metaTilePos, LAYER_BOTTOM);
SetTileType(TILE_TYPE_229, tilePos, LAYER_BOTTOM);
} else {
if (AreaIsDungeon()) {
SetMetaTileType(META_TILE_TYPE_229, metaTilePos, LAYER_BOTTOM);
SetTileType(TILE_TYPE_229, tilePos, LAYER_BOTTOM);
} else {
SetMetaTileType(META_TILE_TYPE_230, metaTilePos, LAYER_BOTTOM);
SetTileType(TILE_TYPE_230, tilePos, LAYER_BOTTOM);
}
}
SetMetaTileType(META_TILE_TYPE_232, metaTilePos + TILE_POS(-1, -1), LAYER_TOP);
SetMetaTileType(META_TILE_TYPE_233, metaTilePos + TILE_POS(-1, 0), LAYER_TOP);
SetMetaTileType(META_TILE_TYPE_234, metaTilePos + TILE_POS(-1, 1), LAYER_TOP);
SetTileType(TILE_TYPE_232, tilePos + TILE_POS(-1, -1), LAYER_TOP);
SetTileType(TILE_TYPE_233, tilePos + TILE_POS(-1, 0), LAYER_TOP);
SetTileType(TILE_TYPE_234, tilePos + TILE_POS(-1, 1), LAYER_TOP);
} else {
SetMetaTileType(META_TILE_TYPE_229, metaTilePos, LAYER_TOP);
SetTileType(TILE_TYPE_229, tilePos, LAYER_TOP);
if (!AreaIsDungeon()) {
return;
}
@@ -259,40 +259,40 @@ void BombableWallManager_DestroyWall3(u32 metaTilePos, u32 layer) {
if (object == NULL) {
return;
}
object->x.HALF.HI = ((metaTilePos & 0x3f) << 4) + -0x10 + gRoomControls.origin_x;
object->y.HALF.HI = ((metaTilePos & 0xfc0) >> 2) + 8 + gRoomControls.origin_y;
object->x.HALF.HI = ((tilePos & 0x3f) << 4) + -0x10 + gRoomControls.origin_x;
object->y.HALF.HI = ((tilePos & 0xfc0) >> 2) + 8 + gRoomControls.origin_y;
object->collisionLayer = LAYER_TOP;
}
}
void BombableWallManager_DestroyWall4(u32 metaTilePos, u32 layer) {
void BombableWallManager_DestroyWall4(u32 tilePos, u32 layer) {
Entity* object;
SetMetaTileType(META_TILE_TYPE_193, metaTilePos + TILE_POS(-1, -1), layer);
SetMetaTileType(META_TILE_TYPE_194, metaTilePos + TILE_POS(0, -1), layer);
SetMetaTileType(META_TILE_TYPE_195, metaTilePos + TILE_POS(1, -1), layer);
SetMetaTileType(META_TILE_TYPE_196, metaTilePos + TILE_POS(-1, 0), layer);
SetMetaTileType(META_TILE_TYPE_199, metaTilePos + TILE_POS(1, 0), layer);
SetTileType(TILE_TYPE_193, tilePos + TILE_POS(-1, -1), layer);
SetTileType(TILE_TYPE_194, tilePos + TILE_POS(0, -1), layer);
SetTileType(TILE_TYPE_195, tilePos + TILE_POS(1, -1), layer);
SetTileType(TILE_TYPE_196, tilePos + TILE_POS(-1, 0), layer);
SetTileType(TILE_TYPE_199, tilePos + TILE_POS(1, 0), layer);
if (layer == LAYER_BOTTOM) {
if (AreaHasEnemies()) {
object = CreateObject(ARCHWAY, 0xe, 0);
if (object != NULL) {
object->x.HALF.HI = ((metaTilePos & 0x3f) << 4) + 8 + gRoomControls.origin_x;
object->y.HALF.HI = ((metaTilePos & 0xfc0) >> 2) + -0x10 + gRoomControls.origin_y;
object->x.HALF.HI = ((tilePos & 0x3f) << 4) + 8 + gRoomControls.origin_x;
object->y.HALF.HI = ((tilePos & 0xfc0) >> 2) + -0x10 + gRoomControls.origin_y;
}
SetMetaTileType(META_TILE_TYPE_197, metaTilePos, LAYER_BOTTOM);
SetTileType(TILE_TYPE_197, tilePos, LAYER_BOTTOM);
} else {
if (AreaIsDungeon()) {
SetMetaTileType(META_TILE_TYPE_197, metaTilePos, LAYER_BOTTOM);
SetTileType(TILE_TYPE_197, tilePos, LAYER_BOTTOM);
} else {
SetMetaTileType(META_TILE_TYPE_198, metaTilePos, LAYER_BOTTOM);
SetTileType(TILE_TYPE_198, tilePos, LAYER_BOTTOM);
}
}
SetMetaTileType(META_TILE_TYPE_200, metaTilePos + TILE_POS(-1, -1), LAYER_TOP);
SetMetaTileType(META_TILE_TYPE_201, metaTilePos + TILE_POS(0, -1), LAYER_TOP);
SetMetaTileType(META_TILE_TYPE_202, metaTilePos + TILE_POS(1, -1), LAYER_TOP);
SetTileType(TILE_TYPE_200, tilePos + TILE_POS(-1, -1), LAYER_TOP);
SetTileType(TILE_TYPE_201, tilePos + TILE_POS(0, -1), LAYER_TOP);
SetTileType(TILE_TYPE_202, tilePos + TILE_POS(1, -1), LAYER_TOP);
} else {
SetMetaTileType(META_TILE_TYPE_197, metaTilePos, LAYER_TOP);
SetTileType(TILE_TYPE_197, tilePos, LAYER_TOP);
if (!AreaIsDungeon()) {
return;
}
@@ -301,8 +301,8 @@ void BombableWallManager_DestroyWall4(u32 metaTilePos, u32 layer) {
if (object == NULL) {
return;
}
object->x.HALF.HI = ((metaTilePos & 0x3f) << 4) + 8 + gRoomControls.origin_x;
object->y.HALF.HI = ((metaTilePos & 0xfc0) >> 2) + -0x10 + gRoomControls.origin_y;
object->x.HALF.HI = ((tilePos & 0x3f) << 4) + 8 + gRoomControls.origin_x;
object->y.HALF.HI = ((tilePos & 0xfc0) >> 2) + -0x10 + gRoomControls.origin_y;
object->collisionLayer = LAYER_TOP;
}
}
+1 -1
View File
@@ -29,7 +29,7 @@ void DestructibleTileObserveManager_Main(DestructibleTileObserveManager* this) {
void sub_0805CFF0(DestructibleTileObserveManager_unk* param_1) {
if (!CheckLocalFlag(param_1->flag)) {
u32 tileType = GetMetaTileType(param_1->tilePos, param_1->tileLayer);
u32 tileType = GetTileType(param_1->tilePos, param_1->tileLayer);
if (param_1->tileType == tileType) {
SetLocalFlag(param_1->flag);
}
+5 -5
View File
@@ -32,7 +32,7 @@ void DiggingCaveEntranceManager_Init(DiggingCaveEntranceManager* this) {
const DiggingCaveEntrance* entrance;
u8 room;
u8 area;
u16 tile = SPECIAL_META_TILE_128;
u16 tileIndex = SPECIAL_TILE_128;
UpdateIsDiggingCave();
if (gDiggingCaveEntranceTransition.isDiggingCave) {
if (gDiggingCaveEntranceTransition.entrance == NULL) {
@@ -51,12 +51,12 @@ void DiggingCaveEntranceManager_Init(DiggingCaveEntranceManager* this) {
}
room = gRoomControls.room;
entrance = diggingCaveEntrances[gRoomControls.area];
tile = SPECIAL_META_TILE_128;
tileIndex = SPECIAL_TILE_128;
for (entrance = GetDiggingCaveEntranceForRoom(entrance, room); entrance != 0;
entrance = GetDiggingCaveEntranceForRoom(entrance, room)) {
SetMetaTile(tile, entrance->sourceTilePosition + TILE_POS(-1, 1), LAYER_BOTTOM);
SetMetaTile(tile, entrance->sourceTilePosition + TILE_POS(0, 1), LAYER_BOTTOM);
SetMetaTile(tile, entrance->sourceTilePosition + TILE_POS(1, 1), LAYER_BOTTOM);
SetTile(tileIndex, entrance->sourceTilePosition + TILE_POS(-1, 1), LAYER_BOTTOM);
SetTile(tileIndex, entrance->sourceTilePosition + TILE_POS(0, 1), LAYER_BOTTOM);
SetTile(tileIndex, entrance->sourceTilePosition + TILE_POS(1, 1), LAYER_BOTTOM);
entrance++;
}
}
+7 -7
View File
@@ -14,20 +14,20 @@
void FlameManager_Main(FlameManager* this) {
if (super->action == 0) {
this->metaTilePos = TILE(this->metaTilePos, this->field_0x3a);
if (GetMetaTileType(this->metaTilePos, LAYER_TOP) == META_TILE_TYPE_117) {
this->tilePos = TILE(this->tilePos, this->field_0x3a);
if (GetTileType(this->tilePos, LAYER_TOP) == TILE_TYPE_117) {
super->action = 1;
SetMetaTile(SPECIAL_META_TILE_106, this->metaTilePos, LAYER_BOTTOM);
SetTile(SPECIAL_TILE_106, this->tilePos, LAYER_BOTTOM);
} else {
DeleteThisEntity();
}
}
if (GetMetaTileType(this->metaTilePos, LAYER_BOTTOM) == SPECIAL_META_TILE_107) {
sub_0807B7D8(META_TILE_TYPE_118, this->metaTilePos, LAYER_TOP);
if (GetTileType(this->tilePos, LAYER_BOTTOM) == SPECIAL_TILE_107) {
sub_0807B7D8(TILE_TYPE_118, this->tilePos, LAYER_TOP);
DeleteThisEntity();
}
if (GetMetaTileType(this->metaTilePos, LAYER_TOP) == META_TILE_TYPE_118) {
SetMetaTile(SPECIAL_META_TILE_107, this->metaTilePos, LAYER_BOTTOM);
if (GetTileType(this->tilePos, LAYER_TOP) == TILE_TYPE_118) {
SetTile(SPECIAL_TILE_107, this->tilePos, LAYER_BOTTOM);
DeleteThisEntity();
}
}
@@ -42,7 +42,7 @@ void sub_08057F20(HorizontalMinishPathBackgroundManager* this) {
tmp = tmp + (tmp >> 3) + ((0x400 - gRoomControls.width) / 2);
gScreen.bg3.xOffset = tmp & 0xF;
gScreen.bg3.yOffset = 0x30 - ((0x30 - (gRoomControls.scroll_y - gRoomControls.origin_y)) >> 2);
gScreen.bg3.tilemap = gBG3Buffer;
gScreen.bg3.subTileMap = gBG3Buffer;
sub_08058004(tmp, gUnk_02006F00, gBG3Buffer);
tmp = ((tmp >> 4) << 1);
if (this->unk_38 != tmp) {
@@ -53,7 +53,7 @@ void sub_08057F20(HorizontalMinishPathBackgroundManager* this) {
tmp = tmp + (tmp >> 2) + ((0x400 - gRoomControls.width) / 2);
gScreen.bg1.xOffset = tmp & 0xF;
gScreen.bg1.yOffset = 0x30 - ((0x30 - (gRoomControls.scroll_y - gRoomControls.origin_y)) >> 1);
gScreen.bg1.tilemap = gBG3Buffer + 0x400;
gScreen.bg1.subTileMap = gBG3Buffer + 0x400;
sub_08058004(tmp, gUnk_02006F00 + 0x2000, gBG3Buffer + 0x400);
tmp = ((tmp >> 4) << 1);
if (this->unk_3c != tmp) {
@@ -111,7 +111,7 @@ void sub_080580B0(u32 unk1) {
gScreen.bg3.xOffset = tmp & 0xF;
gScreen.bg3.yOffset = 0x30 - ((0x30 - (gRoomControls.scroll_y - gRoomControls.origin_y)) >> 1); //?
gScreen.bg3.control = 0x1D09;
gScreen.bg3.tilemap = gBG3Buffer;
gScreen.bg3.subTileMap = gBG3Buffer;
gScreen.bg3.updated = 1;
tmp = gRoomControls.scroll_x - gRoomControls.origin_x;
tmp = tmp + (tmp >> 2) + (0x400 - gRoomControls.width) / 2;
@@ -119,7 +119,7 @@ void sub_080580B0(u32 unk1) {
gScreen.bg1.xOffset = tmp & 0xF;
gScreen.bg1.yOffset = 0x30 - ((0x30 - (gRoomControls.scroll_y - gRoomControls.origin_y)) >> 1); //?
gScreen.bg1.control = 0x1E09;
gScreen.bg1.tilemap = gBG3Buffer + 0x400;
gScreen.bg1.subTileMap = gBG3Buffer + 0x400;
gScreen.bg1.updated = 1;
gScreen.controls.layerFXControl = 0x3C48;
gScreen.controls.alphaBlend = 0x609;
+9 -9
View File
@@ -114,32 +114,32 @@ void sub_08059B18(void) {
if (CheckGlobalFlag(TATEKAKE_HOUSE) != 0) {
for (loopVar = 0; loopVar < 4; ++loopVar) {
for (innerLoopVar = 0; innerLoopVar < 4; ++innerLoopVar) {
SetMetaTileByIndex(loopVar * 0x10 + META_TILE_TYPE_1195 + innerLoopVar,
SetTileByIndex(loopVar * 0x10 + TILE_TYPE_1195 + innerLoopVar,
COMMON(0x28 + 0x10 * innerLoopVar, loopVar * 0x10), 1);
}
}
for (loopVar = 0; loopVar < 3; ++loopVar) {
for (innerLoopVar = 0; innerLoopVar < 4; ++innerLoopVar) {
SetMetaTileByIndex(loopVar * 0x10 + META_TILE_TYPE_1088 + innerLoopVar,
SetTileByIndex(loopVar * 0x10 + TILE_TYPE_1088 + innerLoopVar,
COMMON(0x28 + 0x10 * innerLoopVar, loopVar * 0x10), 2);
}
}
SetMetaTileByIndex(META_TILE_TYPE_214, TILE_POS(2, 23), LAYER_TOP);
SetMetaTileByIndex(META_TILE_TYPE_215, TILE_POS(3, 23), LAYER_TOP);
SetTileByIndex(TILE_TYPE_214, TILE_POS(2, 23), LAYER_TOP);
SetTileByIndex(TILE_TYPE_215, TILE_POS(3, 23), LAYER_TOP);
LoadResourceAsync(&gUnk_086E8460, 0x6001800, 0x800);
} else {
if (CheckGlobalFlag(TATEKAKE_TOCHU) != 0) {
for (loopVar = 0; loopVar < 5; ++loopVar) {
for (innerLoopVar = 0; innerLoopVar < 4; ++innerLoopVar) {
SetMetaTileByIndex(loopVar * 0x10 + META_TILE_TYPE_1190 + innerLoopVar,
SetTileByIndex(loopVar * 0x10 + TILE_TYPE_1190 + innerLoopVar,
COMMON(0x28 + 0x10 * innerLoopVar, loopVar * 0x10), 1);
}
}
SetMetaTileByIndex(META_TILE_TYPE_1092, TILE_POS(2, 24), LAYER_TOP);
SetMetaTileByIndex(META_TILE_TYPE_1093, TILE_POS(5, 24), LAYER_TOP);
SetMetaTileByIndex(META_TILE_TYPE_1108, TILE_POS(2, 25), LAYER_TOP);
SetMetaTileByIndex(META_TILE_TYPE_1109, TILE_POS(5, 25), LAYER_TOP);
SetTileByIndex(TILE_TYPE_1092, TILE_POS(2, 24), LAYER_TOP);
SetTileByIndex(TILE_TYPE_1093, TILE_POS(5, 24), LAYER_TOP);
SetTileByIndex(TILE_TYPE_1108, TILE_POS(2, 25), LAYER_TOP);
SetTileByIndex(TILE_TYPE_1109, TILE_POS(5, 25), LAYER_TOP);
}
}
}
+9 -9
View File
@@ -18,7 +18,7 @@ void LightLevelSetManager_Type0(LightLevelSetManager*);
void LightLevelSetManager_Type1(LightLevelSetManager*);
void LightLevelSetManager_Type2(LightLevelSetManager*);
void LightLevelSetManager_Type3(LightLevelSetManager*);
void sub_0805BE70(LightLevelSetManager* this, u32 metaTileType);
void sub_0805BE70(LightLevelSetManager* this, u32 tileType);
void LightLevelSetManager_Main(Manager* this) {
static void (*const LightLevelSetManager_Types[])(LightLevelSetManager*) = {
@@ -50,7 +50,7 @@ void LightLevelSetManager_Type1(LightLevelSetManager* this) {
super->action = 1;
super->subtimer = 30;
if (CheckFlags(this->field_0x3e) != 0) {
sub_0805BE70(this, META_TILE_TYPE_117);
sub_0805BE70(this, TILE_TYPE_117);
super->action = 2;
}
break;
@@ -58,13 +58,13 @@ void LightLevelSetManager_Type1(LightLevelSetManager* this) {
if (CheckFlags(this->field_0x3e) != 0 && --super->subtimer == 0) {
super->subtimer = 30;
sub_0805BEC4(this);
sub_0805BE70(this, META_TILE_TYPE_118);
sub_0805BE70(this, TILE_TYPE_118);
}
break;
case 2:
if (CheckFlags(this->field_0x3e) == 0 && --super->subtimer == 0) {
super->subtimer = 30;
sub_0805BE70(this, META_TILE_TYPE_117);
sub_0805BE70(this, TILE_TYPE_117);
}
break;
}
@@ -79,7 +79,7 @@ void LightLevelSetManager_Type2(LightLevelSetManager* this) {
((s16)this->field_0x38 >> 4 & 0x3fU) | ((s32)((this->field_0x3a << 0x10) >> 0x14 & 0x3fU) << 6);
super->action = 1;
} else {
if (GetMetaTileType(this->field_0x20, super->type2) == META_TILE_TYPE_118) {
if (GetTileType(this->field_0x20, super->type2) == TILE_TYPE_118) {
SetFlag(this->field_0x3e);
ChangeLightLevel(super->timer);
DeleteThisEntity();
@@ -103,7 +103,7 @@ void LightLevelSetManager_Type3(LightLevelSetManager* this) {
break;
case 1:
if (GetMetaTileType(this->field_0x20, super->type2) != META_TILE_TYPE_118) {
if (GetTileType(this->field_0x20, super->type2) != TILE_TYPE_118) {
return;
}
SetFlag(this->field_0x3e);
@@ -131,14 +131,14 @@ void LightLevelSetManager_Type3(LightLevelSetManager* this) {
}
}
void sub_0805BE70(LightLevelSetManager* this, u32 metaTileType) {
SetMetaTileType(metaTileType,
void sub_0805BE70(LightLevelSetManager* this, u32 tileType) {
SetTileType(tileType,
((this->field_0x38 << 0x10) >> 0x14 & 0x3fU) | ((this->field_0x3a << 0x10) >> 0x14 & 0x3fU) << 6,
super->type2);
}
void sub_0805BE94(LightLevelSetManager* this) {
SetMetaTileType(META_TILE_TYPE_118,
SetTileType(TILE_TYPE_118,
((this->field_0x38 << 0x10) >> 0x14 & 0x3fU) | ((this->field_0x3a << 0x10) >> 0x14 & 0x3fU) << 6,
super->type2);
ChangeLightLevel(super->timer);
+3 -3
View File
@@ -215,9 +215,9 @@ void sub_08057450(LightRayManager* this) {
y >>= 2;
gScreen.bg3.yOffset = y & 0x3f;
gScreen.bg3.tilemap = &gBG3Buffer[(y / 0x40) << 8];
if (this->unk_34 != gScreen.bg3.tilemap) {
this->unk_34 = gScreen.bg3.tilemap;
gScreen.bg3.subTileMap = &gBG3Buffer[(y / 0x40) << 8];
if (this->unk_34 != gScreen.bg3.subTileMap) {
this->unk_34 = gScreen.bg3.subTileMap;
gScreen.bg3.updated = 1;
}
+2 -2
View File
@@ -32,9 +32,9 @@ void sub_0805CBD0(Manager29* this) {
super->action = 1;
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 = GetMetaTileType(this->unk_38, this->layer);
this->unk_3c = GetTileType(this->unk_38, this->layer);
mapLayer = GetLayerByIndex(this->layer);
this->unk_28 = (u16*)mapLayer->metatileTypes;
this->unk_28 = (u16*)mapLayer->tileTypes;
this->unk_2c = &mapLayer->mapData[(s16)this->unk_3a];
}
+1 -1
View File
@@ -87,7 +87,7 @@ void sub_08058324(u32 unk) {
sub_080582D0();
sub_080582A0(sub_08058244(unk), gUnk_02006F00, gBG3Buffer);
gScreen.bg1.control = 0x1D47;
gScreen.bg1.tilemap = gBG3Buffer;
gScreen.bg1.subTileMap = gBG3Buffer;
gScreen.bg1.updated = 1;
gScreen.lcd.displayControl |= 0x200;
}
+7 -7
View File
@@ -121,9 +121,9 @@ void MiscManager_Type0(MiscManager* this) {
void sub_08058F44(u32 x, u32 y, u32 flag) {
if (CheckRoomFlag(flag))
return;
if (sub_080B1A48(x, y, LAYER_BOTTOM) != META_TILE_TYPE_97)
if (sub_080B1A48(x, y, LAYER_BOTTOM) != TILE_TYPE_97)
return;
SetMetaTileType(META_TILE_TYPE_38, ((x >> 4) & 0x3F) | (((y >> 4) & 0x3F) << 6), LAYER_BOTTOM);
SetTileType(TILE_TYPE_38, ((x >> 4) & 0x3F) | (((y >> 4) & 0x3F) << 6), LAYER_BOTTOM);
sub_08058F84(x, y);
}
@@ -240,7 +240,7 @@ void MiscManager_Type5(MiscManager* this) {
DeleteThisEntity();
}
super->action = 1;
SetMetaTileType(META_TILE_TYPE_869, TILE_LOCAL(this->x, this->y), super->type2);
SetTileType(TILE_TYPE_869, TILE_LOCAL(this->x, this->y), super->type2);
break;
case 1:
if (CheckFlags(this->flags)) {
@@ -338,10 +338,10 @@ void sub_0805930C(MiscManager* this) {
tmp->collisionLayer = 1;
}
void SetDirtTile(u32 metaTilePos) {
SetMetaTileType(META_TILE_TYPE_29, metaTilePos, LAYER_BOTTOM);
SetMetaTileType(META_TILE_TYPE_0, metaTilePos, LAYER_TOP);
SetMetaTileType(META_TILE_TYPE_0, metaTilePos + TILE_POS(0, -1), LAYER_TOP);
void SetDirtTile(u32 tilePos) {
SetTileType(TILE_TYPE_29, tilePos, LAYER_BOTTOM);
SetTileType(TILE_TYPE_0, tilePos, LAYER_TOP);
SetTileType(TILE_TYPE_0, tilePos + TILE_POS(0, -1), LAYER_TOP);
}
void MiscManager_TypeA(MiscManager* this) {
+4 -4
View File
@@ -26,7 +26,7 @@ void RailIntersectionManager_Init(RailIntersectionManager* this) {
super->type2 = 1;
}
super->action = 1;
this->metaTilePos = (this->metaTilePos >> 4 & 0x3fU) | (((this->field_0x3a << 0x10) >> 0x14 & 0x3fU) << 6);
this->tilePos = (this->tilePos >> 4 & 0x3fU) | (((this->field_0x3a << 0x10) >> 0x14 & 0x3fU) << 6);
sub_0805B778(this);
}
@@ -45,7 +45,7 @@ void RailIntersectionManager_Action1(RailIntersectionManager* this) {
}
void sub_0805B778(RailIntersectionManager* this) {
static const u16 gUnk_08108C9C[] = { META_TILE_TYPE_856, META_TILE_TYPE_857, META_TILE_TYPE_854,
META_TILE_TYPE_858, META_TILE_TYPE_858, META_TILE_TYPE_855 };
SetMetaTileType(gUnk_08108C9C[super->type * 2 + super->type2], this->metaTilePos, this->layer);
static const u16 gUnk_08108C9C[] = { TILE_TYPE_856, TILE_TYPE_857, TILE_TYPE_854,
TILE_TYPE_858, TILE_TYPE_858, TILE_TYPE_855 };
SetTileType(gUnk_08108C9C[super->type * 2 + super->type2], this->tilePos, this->layer);
}
+2 -2
View File
@@ -480,7 +480,7 @@ void sub_0805A9CC(TempleOfDropletsManager* this) {
tmp1 = gRoomControls.scroll_y - this->unk_26 + this->unk_36;
gScreen.bg3.yOffset = tmp1 & 0x3F;
tmp3 = (&gBG3Buffer[((tmp1 / 0x40) << 8)]);
gScreen.bg3.tilemap = (u32*)tmp3;
gScreen.bg3.subTileMap = (u32*)tmp3;
gScreen.controls.window1VerticalDimensions = DISPLAY_HEIGHT;
if (this->unk_28 == tmp3)
return;
@@ -524,7 +524,7 @@ void sub_0805AAF0(u32 unk0) {
gScreen.controls.layerFXControl = 0x3E48;
gScreen.controls.alphaBlend = BLDALPHA_BLEND(8, 16);
gScreen.bg3.control = BGCNT_SCREENBASE(30) | BGCNT_CHARBASE(1);
gScreen.bg3.tilemap = &gBG3Buffer;
gScreen.bg3.subTileMap = &gBG3Buffer;
gScreen.bg3.xOffset = 0;
gScreen.bg3.yOffset = 0;
gScreen.bg3.updated = 1;
+4 -4
View File
@@ -26,14 +26,14 @@ void TileChangeObserveManager_Main(TileChangeObserveManager* this) {
}
void TileChangeObserveManager_Init(TileChangeObserveManager* this) {
u16* tile;
u16* tileIndex;
if (CheckFlags(this->flag) != 0) {
DeleteThisEntity();
} else {
super->action = 1;
tile = &GetLayerByIndex(this->field_0x3a)->mapData[this->tilePosition];
this->observedTile = tile;
this->initialTile = tile[0];
tileIndex = &GetLayerByIndex(this->field_0x3a)->mapData[this->tilePos];
this->observedTile = tileIndex;
this->initialTile = tileIndex[0];
}
}
+4 -4
View File
@@ -31,16 +31,16 @@ void TilePuzzleManager_Main(TilePuzzleManager* this) {
this->player_current_tile = COORD_TO_TILE((&gPlayerEntity.base));
if (this->player_current_tile != this->player_previous_tile) {
this->player_previous_tile = this->player_current_tile;
switch (GetMetaTileType(this->player_current_tile, super->type2)) {
case META_TILE_TYPE_791:
switch (GetTileType(this->player_current_tile, super->type2)) {
case TILE_TYPE_791:
// stepped on a red tile again
super->action = FAILED;
SoundReq(SFX_MENU_ERROR);
break;
case META_TILE_TYPE_792:
case TILE_TYPE_792:
// stepped on a blue tile
// turn the tile into a red tile
sub_0807B7D8(META_TILE_TYPE_791, this->player_current_tile, super->type2);
sub_0807B7D8(TILE_TYPE_791, this->player_current_tile, super->type2);
SoundReq(SFX_6B);
// decrease the number of remaining tiles and check if we're done
if (--super->timer == 0) {
@@ -30,17 +30,17 @@ void sub_0805754C(VerticalMinishPathBackgroundManager* this) {
bgOffset = (gRoomControls.scroll_y - gRoomControls.origin_y);
bgOffset += bgOffset >> 3;
gScreen.bg3.yOffset = bgOffset & 0x3f;
gScreen.bg3.tilemap = gMapDataTopSpecial + (bgOffset / 0x40) * 0x200;
if (this->field_0x38 != gScreen.bg3.tilemap) {
this->field_0x38 = gScreen.bg3.tilemap;
gScreen.bg3.subTileMap = gMapDataTopSpecial + (bgOffset / 0x40) * 0x200;
if (this->field_0x38 != gScreen.bg3.subTileMap) {
this->field_0x38 = gScreen.bg3.subTileMap;
gScreen.bg3.updated = 1;
}
bgOffset = (gRoomControls.scroll_y - gRoomControls.origin_y);
bgOffset += bgOffset >> 2;
gScreen.bg1.yOffset = bgOffset & 0x3f;
gScreen.bg1.tilemap = gMapDataTopSpecial + 0x2000 + (bgOffset / 0x40) * 0x200;
if (this->field_0x3c != gScreen.bg1.tilemap) {
this->field_0x3c = gScreen.bg1.tilemap;
gScreen.bg1.subTileMap = gMapDataTopSpecial + 0x2000 + (bgOffset / 0x40) * 0x200;
if (this->field_0x3c != gScreen.bg1.subTileMap) {
this->field_0x3c = gScreen.bg1.subTileMap;
gScreen.bg1.updated = 1;
}
}
@@ -57,7 +57,7 @@ void sub_080575C8(u32 param) {
bgOffset += bgOffset >> 3;
gScreen.bg3.yOffset = bgOffset & 0x3f;
gScreen.bg3.xOffset = 0;
gScreen.bg3.tilemap = &gMapDataTopSpecial[(bgOffset / 0x40) * 0x200];
gScreen.bg3.subTileMap = &gMapDataTopSpecial[(bgOffset / 0x40) * 0x200];
gScreen.bg3.control = BGCNT_SCREENBASE(29) | BGCNT_PRIORITY(1) | BGCNT_CHARBASE(2) | BGCNT_MOSAIC;
gScreen.bg3.updated = 1;
@@ -65,7 +65,7 @@ void sub_080575C8(u32 param) {
bgOffset += bgOffset >> 2;
gScreen.bg1.yOffset = bgOffset & 0x3f;
gScreen.bg1.xOffset = 0;
gScreen.bg1.tilemap = &gMapDataTopSpecial[0x2000 + (bgOffset / 0x40) * 0x200];
gScreen.bg1.subTileMap = &gMapDataTopSpecial[0x2000 + (bgOffset / 0x40) * 0x200];
gScreen.bg1.control = BGCNT_SCREENBASE(30) | BGCNT_PRIORITY(1) | BGCNT_CHARBASE(2) | BGCNT_MOSAIC;
gScreen.bg1.updated = 1;
gScreen.controls.layerFXControl =
+1 -1
View File
@@ -11,7 +11,7 @@
#include "tiles.h"
void WaterfallBottomManager_Main(WaterfallBottomManager* this) {
SetMetaTile(SPECIAL_META_TILE_20, TILE_POS(3, 23), LAYER_BOTTOM);
SetTile(SPECIAL_TILE_20, TILE_POS(3, 23), LAYER_BOTTOM);
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;
+1 -1
View File
@@ -2162,7 +2162,7 @@ bool32 ProcessMovement3(Entity* this) {
}
bool32 sub_080AF0C8(Entity* this) {
u32 tileType = GetMetaTileTypeByEntity(this);
u32 tileType = GetTileTypeByEntity(this);
switch (tileType) {
case 0x87:
if (((this->direction + 7) & (0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth |
+1 -1
View File
@@ -153,7 +153,7 @@ void sub_0806D0B0(Entity* this) {
sub_0806D164(this);
}
gScreen.bg1.control = 0x1d47;
gScreen.bg1.tilemap = &gMapDataTopSpecial;
gScreen.bg1.subTileMap = &gMapDataTopSpecial;
gScreen.bg1.updated = 1;
}
+8 -8
View File
@@ -80,20 +80,20 @@ void sub_08067418(CastorWildsStatueEntity* this) {
this->tilePos = COORD_TO_TILE(super);
if (super->type == 0) {
super->hitbox = (Hitbox*)&gUnk_08110E94;
SetMetaTile(SPECIAL_META_TILE_34, this->tilePos - 1, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, this->tilePos, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, this->tilePos + 0x3f, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, this->tilePos + 0x40, super->collisionLayer);
SetTile(SPECIAL_TILE_34, this->tilePos - 1, super->collisionLayer);
SetTile(SPECIAL_TILE_34, this->tilePos, super->collisionLayer);
SetTile(SPECIAL_TILE_34, this->tilePos + 0x3f, super->collisionLayer);
SetTile(SPECIAL_TILE_34, 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) {
SetMetaTile(SPECIAL_META_TILE_34, TILE_POS(1, 58), LAYER_BOTTOM);
SetMetaTile(SPECIAL_META_TILE_34, TILE_POS(2, 58), LAYER_BOTTOM);
SetMetaTile(SPECIAL_META_TILE_34, TILE_POS(3, 58), LAYER_BOTTOM);
SetMetaTile(SPECIAL_META_TILE_34, TILE_POS(3, 59), LAYER_BOTTOM);
SetTile(SPECIAL_TILE_34, TILE_POS(1, 58), LAYER_BOTTOM);
SetTile(SPECIAL_TILE_34, TILE_POS(2, 58), LAYER_BOTTOM);
SetTile(SPECIAL_TILE_34, TILE_POS(3, 58), LAYER_BOTTOM);
SetTile(SPECIAL_TILE_34, TILE_POS(3, 59), LAYER_BOTTOM);
}
}
InitScriptForNPC(super);
+6 -6
View File
@@ -37,12 +37,12 @@ void sub_0806DD90(Entity* this) {
InitializeAnimation(this, animIndex);
x = this->x.HALF.HI;
y = this->y.HALF.HI;
SetMetaTile(SPECIAL_META_TILE_114, TILE(x - 24, y - 16), this->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_114, TILE(x - 24, y), this->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_114, TILE(x - 24, y + 16), this->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_114, TILE(x + 24, y - 16), this->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_114, TILE(x + 24, y), this->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_114, TILE(x + 24, y + 16), this->collisionLayer);
SetTile(SPECIAL_TILE_114, TILE(x - 24, y - 16), this->collisionLayer);
SetTile(SPECIAL_TILE_114, TILE(x - 24, y), this->collisionLayer);
SetTile(SPECIAL_TILE_114, TILE(x - 24, y + 16), this->collisionLayer);
SetTile(SPECIAL_TILE_114, TILE(x + 24, y - 16), this->collisionLayer);
SetTile(SPECIAL_TILE_114, TILE(x + 24, y), this->collisionLayer);
SetTile(SPECIAL_TILE_114, TILE(x + 24, y + 16), this->collisionLayer);
}
void sub_0806DEC8(Entity* this) {
+4 -4
View File
@@ -106,10 +106,10 @@ void sub_0806BEC8(Entity* this, ScriptExecutionContext* context) {
}
void sub_0806BEFC(void) {
SetMetaTileType(META_TILE_TYPE_382, TILE_POS(14, 22), LAYER_BOTTOM);
SetMetaTileType(META_TILE_TYPE_383, TILE_POS(15, 22), LAYER_BOTTOM);
SetMetaTileType(META_TILE_TYPE_384, TILE_POS(14, 23), LAYER_BOTTOM);
SetMetaTileType(META_TILE_TYPE_385, TILE_POS(15, 23), LAYER_BOTTOM);
SetTileType(TILE_TYPE_382, TILE_POS(14, 22), LAYER_BOTTOM);
SetTileType(TILE_TYPE_383, TILE_POS(15, 22), LAYER_BOTTOM);
SetTileType(TILE_TYPE_384, TILE_POS(14, 23), LAYER_BOTTOM);
SetTileType(TILE_TYPE_385, TILE_POS(15, 23), LAYER_BOTTOM);
}
void sub_0806BF44(Entity* this, ScriptExecutionContext* context) {
+1 -1
View File
@@ -236,7 +236,7 @@ void sub_08069B44(DogEntity* this) {
super->action = 4;
}
if ((super->type == 2) && (CheckLocalFlag(MACHI_02_DOG) == 0)) {
SetMetaTile(SPECIAL_META_TILE_114, TILE(super->x.HALF.HI, super->y.HALF.HI - 8), super->collisionLayer);
SetTile(SPECIAL_TILE_114, TILE(super->x.HALF.HI, super->y.HALF.HI - 8), super->collisionLayer);
}
}
}
+6 -6
View File
@@ -541,12 +541,12 @@ void sub_080626E0(Entity* this, ScriptExecutionContext* context) {
}
void sub_08062788(Entity* this, ScriptExecutionContext* context) {
SetMetaTile(SPECIAL_META_TILE_114, TILE_POS(11, 24), LAYER_BOTTOM);
SetMetaTile(SPECIAL_META_TILE_114, TILE_POS(12, 24), LAYER_BOTTOM);
SetMetaTile(SPECIAL_META_TILE_114, TILE_POS(13, 24), LAYER_BOTTOM);
SetMetaTile(SPECIAL_META_TILE_114, TILE_POS(11, 25), LAYER_BOTTOM);
SetMetaTile(SPECIAL_META_TILE_114, TILE_POS(12, 25), LAYER_BOTTOM);
SetMetaTile(SPECIAL_META_TILE_114, TILE_POS(13, 25), LAYER_BOTTOM);
SetTile(SPECIAL_TILE_114, TILE_POS(11, 24), LAYER_BOTTOM);
SetTile(SPECIAL_TILE_114, TILE_POS(12, 24), LAYER_BOTTOM);
SetTile(SPECIAL_TILE_114, TILE_POS(13, 24), LAYER_BOTTOM);
SetTile(SPECIAL_TILE_114, TILE_POS(11, 25), LAYER_BOTTOM);
SetTile(SPECIAL_TILE_114, TILE_POS(12, 25), LAYER_BOTTOM);
SetTile(SPECIAL_TILE_114, TILE_POS(13, 25), LAYER_BOTTOM);
}
void sub_080627E8(Entity* this, ScriptExecutionContext* context) {
+4 -4
View File
@@ -198,18 +198,18 @@ void NPC4E_RestoreEquippedItems(NPC4EEntity* this) {
void sub_0806DC7C(void) {
const u16* tiles = gUnk_081141F4;
while (*tiles != 0) {
u32 metaTilePos = *tiles;
u32 tilePos = *tiles;
tiles = tiles + 1;
SetMetaTileType(SPECIAL_META_TILE_114, metaTilePos, LAYER_BOTTOM);
SetTileType(SPECIAL_TILE_114, tilePos, LAYER_BOTTOM);
}
}
void sub_0806DCA0(void) {
const u16* tiles = gUnk_081141F4;
while (*tiles != 0) {
u32 metaTilePos = *tiles;
u32 tilePos = *tiles;
tiles = tiles + 1;
RestorePrevTileEntity(metaTilePos, LAYER_BOTTOM);
RestorePrevTileEntity(tilePos, LAYER_BOTTOM);
}
}
+1 -1
View File
@@ -36,7 +36,7 @@ void sub_0806C224(void) {
void Simon_CreateChest(Entity* this) {
CreateObjectWithParent(this, SPECIAL_FX, FX_BIG_EXPLOSION2, 0);
SetMetaTileType(META_TILE_TYPE_115, COORD_TO_TILE(this), this->collisionLayer);
SetTileType(TILE_TYPE_115, COORD_TO_TILE(this), this->collisionLayer);
SoundReq(SFX_SECRET_BIG);
}
+1 -1
View File
@@ -810,7 +810,7 @@ void sub_0806B0E0(Entity* this, ScriptExecutionContext* context) {
static const u16 gUnk_08112C5C[2] = { TEXT_INDEX(TEXT_TOWN_MINISH2, 0x25), TEXT_INDEX(TEXT_TOWN_MINISH2, 0x26) };
int idx = 0;
// Checks if the dust is gone at these four meta tiles.
// Checks if the dust is gone at these four tiles.
if (GetVvvAtRoomCoords(56, 184, 1) == VVV_87 && GetVvvAtRoomCoords(72, 184, 1) == VVV_87 &&
GetVvvAtRoomCoords(56, 200, 1) == VVV_87 && GetVvvAtRoomCoords(72, 200, 1) == VVV_87) {
idx = 1;
+3 -3
View File
@@ -172,14 +172,14 @@ static const u16 gUnk_08110BE0[] = {
};
void sub_08066F94(void) {
u16 metaTilePos;
u16 tilePos;
const u16* puVar2;
puVar2 = gUnk_08110BE0;
while (*puVar2 != 0) {
metaTilePos = *puVar2;
tilePos = *puVar2;
puVar2++;
SetMetaTileType(SPECIAL_META_TILE_114, metaTilePos, LAYER_BOTTOM);
SetTileType(SPECIAL_TILE_114, tilePos, LAYER_BOTTOM);
}
}
+1 -1
View File
@@ -30,7 +30,7 @@ void AngryStatue(Entity* this) {
void AngryStatue_Init(Entity* this) {
this->action = 1;
this->hitbox = (Hitbox*)&gUnk_080FD178;
SetMetaTile(SPECIAL_META_TILE_34, COORD_TO_TILE(this), this->collisionLayer);
SetTile(SPECIAL_TILE_34, COORD_TO_TILE(this), this->collisionLayer);
InitializeAnimation(this, this->type);
}
+10 -10
View File
@@ -102,18 +102,18 @@ void BakerOven_Action2(BakerOvenEntity* this) {
}
void sub_0809CDF0(BakerOvenEntity* this) {
u32 metaTilePos;
u32 tilePos;
this->unk_80 = (((super->x.HALF.HI - gRoomControls.origin_x) >> 4) & 0x3f) |
(((super->y.HALF.HI - gRoomControls.origin_y) >> 4 & 0x3f) << 6);
metaTilePos = this->unk_80;
SetMetaTile(SPECIAL_META_TILE_46, metaTilePos + TILE_POS(-1, 0), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos + TILE_POS(0, 0), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos + TILE_POS(1, 0), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_38, metaTilePos + TILE_POS(-1, -1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_38, metaTilePos + TILE_POS(0, -1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_36, metaTilePos + TILE_POS(1, -1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_38, metaTilePos + TILE_POS(-1, -2), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_38, metaTilePos + TILE_POS(0, -2), super->collisionLayer);
tilePos = this->unk_80;
SetTile(SPECIAL_TILE_46, tilePos + TILE_POS(-1, 0), super->collisionLayer);
SetTile(SPECIAL_TILE_34, tilePos + TILE_POS(0, 0), super->collisionLayer);
SetTile(SPECIAL_TILE_34, tilePos + TILE_POS(1, 0), super->collisionLayer);
SetTile(SPECIAL_TILE_38, tilePos + TILE_POS(-1, -1), super->collisionLayer);
SetTile(SPECIAL_TILE_38, tilePos + TILE_POS(0, -1), super->collisionLayer);
SetTile(SPECIAL_TILE_36, tilePos + TILE_POS(1, -1), super->collisionLayer);
SetTile(SPECIAL_TILE_38, tilePos + TILE_POS(-1, -2), super->collisionLayer);
SetTile(SPECIAL_TILE_38, tilePos + TILE_POS(0, -2), super->collisionLayer);
}
+6 -6
View File
@@ -258,8 +258,8 @@ void Beanstalk_Action1Type7(BeanstalkEntity* this) {
this->tilePos = TILE(super->x.HALF.HI, this->unk_6c);
while (TRUE) {
this->tilePos = TILE(super->x.HALF.HI, this->unk_6c);
SetMetaTile(SPECIAL_META_TILE_23, this->tilePos, LAYER_TOP);
SetMetaTile(SPECIAL_META_TILE_23, this->tilePos, LAYER_BOTTOM);
SetTile(SPECIAL_TILE_23, this->tilePos, LAYER_TOP);
SetTile(SPECIAL_TILE_23, this->tilePos, LAYER_BOTTOM);
this->unk_6c += 0x10;
if (this->unk_6c >= gRoomControls.origin_y + gRoomControls.height)
break;
@@ -308,7 +308,7 @@ void Beanstalk_Action1Type8SubAction0(BeanstalkEntity* this) {
super->spriteOrientation.flipY = 2;
this->tilePos = COORD_TO_TILE(super);
SetMetaTile(SPECIAL_META_TILE_23, this->tilePos, LAYER_BOTTOM);
SetTile(SPECIAL_TILE_23, this->tilePos, LAYER_BOTTOM);
super->subAction = 1;
obj = CreateObjectWithParent(super, CHUCHU_BOSS_PARTICLE, 0, 0);
if (obj != NULL) {
@@ -339,13 +339,13 @@ void Beanstalk_Action1Type9(BeanstalkEntity* this) {
super->spriteRendering.b3 = gPlayerEntity.base.spriteRendering.b3;
if (gPlayerState.floor_type == SURFACE_LADDER) {
super->spritePriority.b0 = 0;
if (sub_080B1A0C(super, 0, -24) != SPECIAL_META_TILE_20) {
SetMetaTile(SPECIAL_META_TILE_20, COORD_TO_TILE_OFFSET(super, 0, 24), LAYER_BOTTOM);
if (sub_080B1A0C(super, 0, -24) != SPECIAL_TILE_20) {
SetTile(SPECIAL_TILE_20, COORD_TO_TILE_OFFSET(super, 0, 24), LAYER_BOTTOM);
}
} else {
super->spritePriority.b0 = 5;
if (this->unk_72 != sub_080B1A0C(super, 0, -24)) {
SetMetaTile(this->unk_72, COORD_TO_TILE_OFFSET(super, 0, 24), LAYER_BOTTOM);
SetTile(this->unk_72, COORD_TO_TILE_OFFSET(super, 0, 24), LAYER_BOTTOM);
}
}
}
+1 -1
View File
@@ -294,7 +294,7 @@ void BigBarrel_Type4(BigBarrelEntity* this) {
flame->collisionLayer = 2;
flame->spritePriority.b0 = 2;
}
SetMetaTileType(META_TILE_TYPE_118, COORD_TO_TILE(super), LAYER_TOP);
SetTileType(TILE_TYPE_118, COORD_TO_TILE(super), LAYER_TOP);
break;
case 2:
if (--super->timer) {
+76 -76
View File
@@ -129,127 +129,127 @@ void sub_08099910(BigIceBlockEntity* this) {
u32 uVar2;
s32 vvv;
u32 tileIndex;
u32 metaTilePos;
u32 tilePos;
metaTilePos = COORD_TO_TILE(super);
this->unk_6e = metaTilePos;
tilePos = COORD_TO_TILE(super);
this->unk_6e = tilePos;
uVar2 = (((super->x.HALF.HI & 8)) >> 0x3) + ((super->y.HALF.HI & 8) >> 2);
this->unk_6c = uVar2;
switch (uVar2) {
default:
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos - 0x41, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos - 0x40, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos - 1, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos, super->collisionLayer);
SetTile(SPECIAL_TILE_34, tilePos - 0x41, super->collisionLayer);
SetTile(SPECIAL_TILE_34, tilePos - 0x40, super->collisionLayer);
SetTile(SPECIAL_TILE_34, tilePos - 1, super->collisionLayer);
SetTile(SPECIAL_TILE_34, tilePos, super->collisionLayer);
break;
case 1:
vvv = GetVvvAtMetaTilePos(metaTilePos - 0x41, super->collisionLayer);
tileIndex = SPECIAL_META_TILE_36;
vvv = GetVvvAtTilePos(tilePos - 0x41, super->collisionLayer);
tileIndex = SPECIAL_TILE_36;
if (vvv == VVV_18) {
tileIndex = SPECIAL_META_TILE_121;
tileIndex = SPECIAL_TILE_121;
}
SetMetaTile(tileIndex, metaTilePos - 0x41, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos - 0x40, super->collisionLayer);
vvv = GetVvvAtMetaTilePos(metaTilePos - 0x3f, super->collisionLayer);
tileIndex = SPECIAL_META_TILE_37;
SetTile(tileIndex, tilePos - 0x41, super->collisionLayer);
SetTile(SPECIAL_TILE_34, tilePos - 0x40, super->collisionLayer);
vvv = GetVvvAtTilePos(tilePos - 0x3f, super->collisionLayer);
tileIndex = SPECIAL_TILE_37;
if (vvv == VVV_18) {
tileIndex = SPECIAL_META_TILE_123;
tileIndex = SPECIAL_TILE_123;
}
SetMetaTile(tileIndex, metaTilePos - 0x3f, super->collisionLayer);
vvv = GetVvvAtMetaTilePos(metaTilePos - 1, super->collisionLayer);
tileIndex = SPECIAL_META_TILE_36;
SetTile(tileIndex, tilePos - 0x3f, super->collisionLayer);
vvv = GetVvvAtTilePos(tilePos - 1, super->collisionLayer);
tileIndex = SPECIAL_TILE_36;
if (vvv == VVV_18) {
tileIndex = SPECIAL_META_TILE_121;
tileIndex = SPECIAL_TILE_121;
}
SetMetaTile(tileIndex, metaTilePos - 1, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos, super->collisionLayer);
vvv = GetVvvAtMetaTilePos(metaTilePos + 1, super->collisionLayer);
tileIndex = SPECIAL_META_TILE_37;
SetTile(tileIndex, tilePos - 1, super->collisionLayer);
SetTile(SPECIAL_TILE_34, tilePos, super->collisionLayer);
vvv = GetVvvAtTilePos(tilePos + 1, super->collisionLayer);
tileIndex = SPECIAL_TILE_37;
if (vvv == VVV_18) {
tileIndex = SPECIAL_META_TILE_123;
tileIndex = SPECIAL_TILE_123;
}
SetMetaTile(tileIndex, metaTilePos + 1, super->collisionLayer);
SetTile(tileIndex, tilePos + 1, super->collisionLayer);
return;
break;
case 2:
vvv = GetVvvAtMetaTilePos(metaTilePos - 0x41, super->collisionLayer);
tileIndex = SPECIAL_META_TILE_35;
vvv = GetVvvAtTilePos(tilePos - 0x41, super->collisionLayer);
tileIndex = SPECIAL_TILE_35;
if (vvv == VVV_18) {
tileIndex = SPECIAL_META_TILE_119;
tileIndex = SPECIAL_TILE_119;
}
SetMetaTile(tileIndex, metaTilePos - 0x41, super->collisionLayer);
vvv = GetVvvAtMetaTilePos(metaTilePos - 0x40, super->collisionLayer);
tileIndex = SPECIAL_META_TILE_35;
SetTile(tileIndex, tilePos - 0x41, super->collisionLayer);
vvv = GetVvvAtTilePos(tilePos - 0x40, super->collisionLayer);
tileIndex = SPECIAL_TILE_35;
if (vvv == VVV_18) {
tileIndex = SPECIAL_META_TILE_119;
tileIndex = SPECIAL_TILE_119;
}
SetMetaTile(tileIndex, metaTilePos - 0x40, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos - 1, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos, super->collisionLayer);
vvv = GetVvvAtMetaTilePos(metaTilePos + 0x3f, super->collisionLayer);
tileIndex = SPECIAL_META_TILE_38;
SetTile(tileIndex, tilePos - 0x40, super->collisionLayer);
SetTile(SPECIAL_TILE_34, tilePos - 1, super->collisionLayer);
SetTile(SPECIAL_TILE_34, tilePos, super->collisionLayer);
vvv = GetVvvAtTilePos(tilePos + 0x3f, super->collisionLayer);
tileIndex = SPECIAL_TILE_38;
if (vvv == VVV_18) {
tileIndex = SPECIAL_META_TILE_124;
tileIndex = SPECIAL_TILE_124;
}
SetMetaTile(tileIndex, metaTilePos + 0x3f, super->collisionLayer);
vvv = GetVvvAtMetaTilePos(metaTilePos + 0x40, super->collisionLayer);
tileIndex = SPECIAL_META_TILE_38;
SetTile(tileIndex, tilePos + 0x3f, super->collisionLayer);
vvv = GetVvvAtTilePos(tilePos + 0x40, super->collisionLayer);
tileIndex = SPECIAL_TILE_38;
if (vvv == VVV_18) {
tileIndex = SPECIAL_META_TILE_124;
tileIndex = SPECIAL_TILE_124;
}
SetMetaTile(tileIndex, metaTilePos + 0x40, super->collisionLayer);
SetTile(tileIndex, tilePos + 0x40, super->collisionLayer);
break;
case 3:
vvv = GetVvvAtMetaTilePos(metaTilePos - 0x41, super->collisionLayer);
tileIndex = SPECIAL_META_TILE_39;
vvv = GetVvvAtTilePos(tilePos - 0x41, super->collisionLayer);
tileIndex = SPECIAL_TILE_39;
if (vvv == VVV_18) {
tileIndex = SPECIAL_META_TILE_117;
tileIndex = SPECIAL_TILE_117;
}
SetMetaTile(tileIndex, metaTilePos - 0x41, super->collisionLayer);
vvv = GetVvvAtMetaTilePos(metaTilePos - 0x40, super->collisionLayer);
tileIndex = SPECIAL_META_TILE_35;
SetTile(tileIndex, tilePos - 0x41, super->collisionLayer);
vvv = GetVvvAtTilePos(tilePos - 0x40, super->collisionLayer);
tileIndex = SPECIAL_TILE_35;
if (vvv == VVV_18) {
tileIndex = SPECIAL_META_TILE_119;
tileIndex = SPECIAL_TILE_119;
}
SetMetaTile(tileIndex, metaTilePos - 0x40, super->collisionLayer);
vvv = GetVvvAtMetaTilePos(metaTilePos - 0x3f, super->collisionLayer);
tileIndex = SPECIAL_META_TILE_40;
SetTile(tileIndex, tilePos - 0x40, super->collisionLayer);
vvv = GetVvvAtTilePos(tilePos - 0x3f, super->collisionLayer);
tileIndex = SPECIAL_TILE_40;
if (vvv == VVV_18) {
tileIndex = SPECIAL_META_TILE_118;
tileIndex = SPECIAL_TILE_118;
}
SetMetaTile(tileIndex, metaTilePos - 0x3f, super->collisionLayer);
vvv = GetVvvAtMetaTilePos(metaTilePos - 1, super->collisionLayer);
tileIndex = SPECIAL_META_TILE_36;
SetTile(tileIndex, tilePos - 0x3f, super->collisionLayer);
vvv = GetVvvAtTilePos(tilePos - 1, super->collisionLayer);
tileIndex = SPECIAL_TILE_36;
if (vvv == VVV_18) {
tileIndex = SPECIAL_META_TILE_121;
tileIndex = SPECIAL_TILE_121;
}
SetMetaTile(tileIndex, metaTilePos - 1, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos, super->collisionLayer);
vvv = GetVvvAtMetaTilePos(metaTilePos + 1, super->collisionLayer);
tileIndex = SPECIAL_META_TILE_37;
SetTile(tileIndex, tilePos - 1, super->collisionLayer);
SetTile(SPECIAL_TILE_34, tilePos, super->collisionLayer);
vvv = GetVvvAtTilePos(tilePos + 1, super->collisionLayer);
tileIndex = SPECIAL_TILE_37;
if (vvv == VVV_18) {
tileIndex = SPECIAL_META_TILE_123;
tileIndex = SPECIAL_TILE_123;
}
SetMetaTile(tileIndex, metaTilePos + 1, super->collisionLayer);
vvv = GetVvvAtMetaTilePos(metaTilePos + 0x3f, super->collisionLayer);
tileIndex = SPECIAL_META_TILE_41;
SetTile(tileIndex, tilePos + 1, super->collisionLayer);
vvv = GetVvvAtTilePos(tilePos + 0x3f, super->collisionLayer);
tileIndex = SPECIAL_TILE_41;
if (vvv == VVV_18) {
tileIndex = SPECIAL_META_TILE_120;
tileIndex = SPECIAL_TILE_120;
}
SetMetaTile(tileIndex, metaTilePos + 0x3f, super->collisionLayer);
vvv = GetVvvAtMetaTilePos(metaTilePos + 0x40, super->collisionLayer);
tileIndex = SPECIAL_META_TILE_38;
SetTile(tileIndex, tilePos + 0x3f, super->collisionLayer);
vvv = GetVvvAtTilePos(tilePos + 0x40, super->collisionLayer);
tileIndex = SPECIAL_TILE_38;
if (vvv == VVV_18) {
tileIndex = SPECIAL_META_TILE_124;
tileIndex = SPECIAL_TILE_124;
}
SetMetaTile(tileIndex, metaTilePos + 0x40, super->collisionLayer);
vvv = GetVvvAtMetaTilePos(metaTilePos + 0x41, super->collisionLayer);
tileIndex = SPECIAL_META_TILE_42;
SetTile(tileIndex, tilePos + 0x40, super->collisionLayer);
vvv = GetVvvAtTilePos(tilePos + 0x41, super->collisionLayer);
tileIndex = SPECIAL_TILE_42;
if (vvv == VVV_18) {
tileIndex = SPECIAL_META_TILE_122;
tileIndex = SPECIAL_TILE_122;
}
SetMetaTile(tileIndex, metaTilePos + 0x41, super->collisionLayer);
SetTile(tileIndex, tilePos + 0x41, super->collisionLayer);
break;
}
}
+17 -17
View File
@@ -33,7 +33,7 @@ extern const u8 BigPushableLever_PushedOffsets[];
void BigPushableLever_SetIdle(BigPushableLeverEntity*);
bool32 BigPushableLever_ShouldStartPushing(BigPushableLeverEntity*);
void BigPushableLever_SetMetaTiles(BigPushableLeverEntity*);
void BigPushableLever_SetTiles(BigPushableLeverEntity*);
void BigPushableLever_CalculateSpriteOffsets(BigPushableLeverEntity*);
void BigPushableLever(BigPushableLeverEntity* this) {
@@ -48,8 +48,8 @@ void BigPushableLever_Init(BigPushableLeverEntity* this) {
void BigPushableLever_Idle(BigPushableLeverEntity* this) {
if (BigPushableLever_ShouldStartPushing(this)) {
super->action = PUSHING;
SetMetaTile(this->tileIndexUpper, this->tilePositionUpper, super->collisionLayer);
SetMetaTile(this->tileIndexLower, this->tilePositionLower, super->collisionLayer);
SetTile(this->tileIndexUpper, this->tilePositionUpper, super->collisionLayer);
SetTile(this->tileIndexLower, this->tilePositionLower, super->collisionLayer);
EnqueueSFX(SFX_132);
RequestPriorityDuration(super, 30);
if (PlayerCanBeMoved()) {
@@ -78,38 +78,38 @@ void BigPushableLever_Pushing(BigPushableLeverEntity* this) {
void BigPushableLever_SetIdle(BigPushableLeverEntity* this) {
super->action = IDLE;
this->timer = 60;
BigPushableLever_SetMetaTiles(this);
BigPushableLever_SetTiles(this);
}
void BigPushableLever_SetMetaTiles(BigPushableLeverEntity* this) {
void BigPushableLever_SetTiles(BigPushableLeverEntity* this) {
if (!CheckFlags(this->pushedFlag)) {
super->type2 = 0;
this->tilePositionUpper = COORD_TO_TILE_OFFSET(super, 0, 0x10);
this->tilePositionLower = this->tilePositionUpper - 0x40;
this->tileIndexUpper = GetMetaTileIndex(this->tilePositionUpper, super->collisionLayer);
this->tileIndexLower = GetMetaTileIndex(this->tilePositionLower, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_87, this->tilePositionUpper, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_88, this->tilePositionLower, super->collisionLayer);
this->tileIndexUpper = GetTileIndex(this->tilePositionUpper, super->collisionLayer);
this->tileIndexLower = GetTileIndex(this->tilePositionLower, super->collisionLayer);
SetTile(SPECIAL_TILE_87, this->tilePositionUpper, super->collisionLayer);
SetTile(SPECIAL_TILE_88, this->tilePositionLower, super->collisionLayer);
InitializeAnimation(super, 1);
} else {
super->type2 = 1;
this->tilePositionUpper = COORD_TO_TILE_OFFSET(super, 0x10, 0);
this->tilePositionLower = this->tilePositionUpper - 1;
this->tileIndexUpper = GetMetaTileIndex(this->tilePositionUpper, super->collisionLayer);
this->tileIndexLower = GetMetaTileIndex(this->tilePositionLower, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_85, this->tilePositionUpper, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_86, this->tilePositionLower, super->collisionLayer);
this->tileIndexUpper = GetTileIndex(this->tilePositionUpper, super->collisionLayer);
this->tileIndexLower = GetTileIndex(this->tilePositionLower, super->collisionLayer);
SetTile(SPECIAL_TILE_85, this->tilePositionUpper, super->collisionLayer);
SetTile(SPECIAL_TILE_86, this->tilePositionLower, super->collisionLayer);
InitializeAnimation(super, 0);
}
}
bool32 BigPushableLever_ShouldStartPushing(BigPushableLeverEntity* this) {
if (GetMetaTileIndex(this->tilePositionLower, super->collisionLayer) == SPECIAL_META_TILE_89) {
if (GetTileIndex(this->tilePositionLower, super->collisionLayer) == SPECIAL_TILE_89) {
if (--this->timer == 0) {
return TRUE;
}
BigPushableLever_CalculateSpriteOffsets(this);
SetMetaTile(gUnk_081236E8[super->type2], this->tilePositionLower, super->collisionLayer);
SetTile(gUnk_081236E8[super->type2], this->tilePositionLower, super->collisionLayer);
} else {
this->timer = 60;
super->spriteOffsetX = 0;
@@ -139,8 +139,8 @@ void (*const BigPushableLever_Actions[])(BigPushableLeverEntity*) = {
BigPushableLever_Pushing,
};
const u16 gUnk_081236E8[] = {
SPECIAL_META_TILE_88,
SPECIAL_META_TILE_86,
SPECIAL_TILE_88,
SPECIAL_TILE_86,
};
const u8 BigPushableLever_InitialOffsets[] = {
0, 0, 0, 0, 255, 0, 0, 0,
+38 -38
View File
@@ -26,7 +26,7 @@ void BlockPushed(BlockPushedEntity* this) {
void BlockPushed_Init(BlockPushedEntity* this) {
u16 tmp;
u32 metaTilePos;
u32 tilePos;
if (gRoomControls.area == AREA_MINISH_PATHS) {
UnloadGFXSlots(super);
@@ -40,50 +40,50 @@ void BlockPushed_Init(BlockPushedEntity* this) {
super->timer = 32;
super->speed = 0x80;
super->spritePriority.b0 = 6;
metaTilePos = COORD_TO_TILE(super);
tilePos = COORD_TO_TILE(super);
tmp = super->type * 8;
super->x.HALF.HI += tmp;
super->y.HALF.HI += tmp;
super->hitbox = (Hitbox*)gUnk_0811F64C[super->type];
this->unk_68 = GetMetaTileType(metaTilePos, super->collisionLayer);
this->unk_68 = GetTileType(tilePos, super->collisionLayer);
switch (super->type) {
case 0:
sub_080832D8(metaTilePos, this);
sub_080832D8(tilePos, this);
break;
case 1:
sub_080832D8(metaTilePos, this);
sub_080832D8(metaTilePos + 1, this);
sub_080832D8(metaTilePos + 0x40, this);
sub_080832D8(metaTilePos + 0x41, this);
sub_080832D8(tilePos, this);
sub_080832D8(tilePos + 1, this);
sub_080832D8(tilePos + 0x40, this);
sub_080832D8(tilePos + 0x41, this);
break;
case 2:
sub_080832D8(metaTilePos, this);
sub_080832D8(metaTilePos + 1, this);
sub_080832D8(metaTilePos + 2, this);
sub_080832D8(metaTilePos + 0x40, this);
sub_080832D8(metaTilePos + 0x41, this);
sub_080832D8(metaTilePos + 0x42, this);
sub_080832D8(metaTilePos + 0x80, this);
sub_080832D8(metaTilePos + 0x81, this);
sub_080832D8(metaTilePos + 0x82, this);
sub_080832D8(tilePos, this);
sub_080832D8(tilePos + 1, this);
sub_080832D8(tilePos + 2, this);
sub_080832D8(tilePos + 0x40, this);
sub_080832D8(tilePos + 0x41, this);
sub_080832D8(tilePos + 0x42, this);
sub_080832D8(tilePos + 0x80, this);
sub_080832D8(tilePos + 0x81, this);
sub_080832D8(tilePos + 0x82, this);
break;
default:
sub_080832D8(metaTilePos, this);
sub_080832D8(metaTilePos + 1, this);
sub_080832D8(metaTilePos + 2, this);
sub_080832D8(metaTilePos + 3, this);
sub_080832D8(metaTilePos + 0x40, this);
sub_080832D8(metaTilePos + 0x41, this);
sub_080832D8(metaTilePos + 0x42, this);
sub_080832D8(metaTilePos + 0x43, this);
sub_080832D8(metaTilePos + 0x80, this);
sub_080832D8(metaTilePos + 0x81, this);
sub_080832D8(metaTilePos + 0x82, this);
sub_080832D8(metaTilePos + 0x83, this);
sub_080832D8(metaTilePos + 0xc0, this);
sub_080832D8(metaTilePos + 0xc1, this);
sub_080832D8(metaTilePos + 0xc2, this);
sub_080832D8(metaTilePos + 0xc3, this);
sub_080832D8(tilePos, this);
sub_080832D8(tilePos + 1, this);
sub_080832D8(tilePos + 2, this);
sub_080832D8(tilePos + 3, this);
sub_080832D8(tilePos + 0x40, this);
sub_080832D8(tilePos + 0x41, this);
sub_080832D8(tilePos + 0x42, this);
sub_080832D8(tilePos + 0x43, this);
sub_080832D8(tilePos + 0x80, this);
sub_080832D8(tilePos + 0x81, this);
sub_080832D8(tilePos + 0x82, this);
sub_080832D8(tilePos + 0x83, this);
sub_080832D8(tilePos + 0xc0, this);
sub_080832D8(tilePos + 0xc1, this);
sub_080832D8(tilePos + 0xc2, this);
sub_080832D8(tilePos + 0xc3, this);
break;
}
EnqueueSFX(SFX_10F);
@@ -147,18 +147,18 @@ void sub_080830B8(BlockPushedEntity* this) {
DeleteEntity(super);
}
void sub_080832D8(u32 metaTilePos, BlockPushedEntity* this) {
void sub_080832D8(u32 tilePos, BlockPushedEntity* this) {
if (super->collisionLayer != 2) {
if ((super->direction & 8) != 0) {
sub_0807B7D8(META_TILE_TYPE_33, metaTilePos, super->collisionLayer);
sub_0807B7D8(TILE_TYPE_33, tilePos, super->collisionLayer);
} else {
sub_0807B7D8(META_TILE_TYPE_32, metaTilePos, super->collisionLayer);
sub_0807B7D8(TILE_TYPE_32, tilePos, super->collisionLayer);
}
} else {
if ((super->direction & 8) != 0) {
sub_0807B7D8(META_TILE_TYPE_47, metaTilePos, super->collisionLayer);
sub_0807B7D8(TILE_TYPE_47, tilePos, super->collisionLayer);
} else {
sub_0807B7D8(META_TILE_TYPE_46, metaTilePos, super->collisionLayer);
sub_0807B7D8(TILE_TYPE_46, tilePos, super->collisionLayer);
}
}
}
+4 -4
View File
@@ -18,7 +18,7 @@ typedef struct {
u16 y;
u16 unk7c;
u16 unk7e;
u16 tile;
u16 tilePos;
u8 width;
u8 height;
} BoardEntity;
@@ -49,12 +49,12 @@ void Board_Init(BoardEntity* this) {
this->height = size[1];
this->x = super->x.HALF.HI - (this->width >> 1);
this->y = super->y.HALF.HI - (this->height >> 1);
this->tile = COORD_TO_TILE(super);
this->tilePos = COORD_TO_TILE(super);
super->collisionLayer = 1;
UpdateSpriteForCollisionLayer(super);
super->spritePriority.b0 = 6;
if (super->type == 0) {
SetMetaTile(SPECIAL_META_TILE_116, this->tile + TILE_POS(0, -1), super->collisionLayer);
SetTile(SPECIAL_TILE_116, this->tilePos + TILE_POS(0, -1), super->collisionLayer);
}
sub_08098BE8(this);
}
@@ -67,7 +67,7 @@ void sub_08098BE8(BoardEntity* this) {
if ((gPlayerState.flags & PL_MINISH) && sub_08098C30(this, &gPlayerEntity.base) && PlayerCanBeMoved() &&
gPlayerEntity.base.z.HALF.HI == 0) {
gPlayerState.field_0x14 = 1;
sub_0807AAF8(&gPlayerEntity.base, this->tile);
sub_0807AAF8(&gPlayerEntity.base, this->tilePos);
}
}
+7 -7
View File
@@ -15,8 +15,8 @@
typedef struct {
Entity base;
u8 filler[0x8];
u16 metaTilePos;
u16 metaTileIndex;
u16 tilePos;
u16 tileIndex;
u8 collisionData;
u8 unk75;
u8 filler2[0x10];
@@ -59,7 +59,7 @@ void Bollard_Action1(BollardEntity* this) {
}
super->action = 2;
InitializeAnimation(super, 3);
SetMetaTile(this->metaTileIndex, this->metaTilePos, super->collisionLayer);
SetTile(this->tileIndex, this->tilePos, super->collisionLayer);
EnqueueSFX(SFX_1A5);
}
@@ -93,10 +93,10 @@ void Bollard_Action4(BollardEntity* this) {
void sub_0808B3AC(BollardEntity* this) {
super->spritePriority.b0 = 4;
this->metaTilePos = COORD_TO_TILE(super);
this->metaTileIndex = GetMetaTileIndex(this->metaTilePos, super->collisionLayer);
this->collisionData = GetCollisionDataAtMetaTilePos(this->metaTilePos, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_11, this->metaTilePos, super->collisionLayer);
this->tilePos = COORD_TO_TILE(super);
this->tileIndex = GetTileIndex(this->tilePos, super->collisionLayer);
this->collisionData = GetCollisionDataAtTilePos(this->tilePos, super->collisionLayer);
SetTile(SPECIAL_TILE_11, this->tilePos, super->collisionLayer);
}
void sub_0808B41C(BollardEntity* this) {
+18 -18
View File
@@ -175,31 +175,31 @@ void sub_0808C4BC(BossDoorEntity* this) {
void sub_0808C500(BossDoorEntity* this) {
if ((this->unk_76 == 0) || (this->unk_76 == 2)) {
this->unk_78 = GetMetaTileIndex(this->unk_74 - 1, super->collisionLayer);
this->unk_7a = GetMetaTileIndex(this->unk_74, super->collisionLayer);
this->unk_7c = GetMetaTileIndex(this->unk_74 + 1, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, this->unk_74 - 1, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, this->unk_74, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, this->unk_74 + 1, super->collisionLayer);
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(SPECIAL_TILE_34, this->unk_74 - 1, super->collisionLayer);
SetTile(SPECIAL_TILE_34, this->unk_74, super->collisionLayer);
SetTile(SPECIAL_TILE_34, this->unk_74 + 1, super->collisionLayer);
} else {
this->unk_78 = GetMetaTileIndex(this->unk_74 - 0x40, super->collisionLayer);
this->unk_7a = GetMetaTileIndex(this->unk_74, super->collisionLayer);
this->unk_7c = GetMetaTileIndex(this->unk_74 + 0x40, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, this->unk_74 - 0x40, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, this->unk_74, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, this->unk_74 + 0x40, super->collisionLayer);
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(SPECIAL_TILE_34, this->unk_74 - 0x40, super->collisionLayer);
SetTile(SPECIAL_TILE_34, this->unk_74, super->collisionLayer);
SetTile(SPECIAL_TILE_34, this->unk_74 + 0x40, super->collisionLayer);
}
}
void sub_0808C5D0(BossDoorEntity* this) {
if ((this->unk_76 == 0) || (this->unk_76 == 2)) {
SetMetaTile(this->unk_78, this->unk_74 - 1, super->collisionLayer);
SetMetaTile(this->unk_7a, this->unk_74, super->collisionLayer);
SetMetaTile(this->unk_7c, this->unk_74 + 1, super->collisionLayer);
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);
} else {
SetMetaTile(this->unk_78, this->unk_74 - 0x40, super->collisionLayer);
SetMetaTile(this->unk_7a, this->unk_74, super->collisionLayer);
SetMetaTile(this->unk_7c, this->unk_74 + 0x40, super->collisionLayer);
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);
}
}
+3 -3
View File
@@ -68,8 +68,8 @@ void Bush_Init(BushEntity* this) {
super->collisionMask = 4;
super->hitbox = (Hitbox*)&gUnk_081205B4;
this->unk_72 = 0;
this->unk_70 = GetMetaTileIndex(COORD_TO_TILE(super), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, COORD_TO_TILE(super), super->collisionLayer);
this->unk_70 = GetTileIndex(COORD_TO_TILE(super), super->collisionLayer);
SetTile(SPECIAL_TILE_34, COORD_TO_TILE(super), super->collisionLayer);
InitializeAnimation(super, gUnk_08120588[super->type].unk_0);
}
@@ -107,7 +107,7 @@ void Bush_Action2SubAction2(BushEntity* this) {
if (this->unk_72 == 0) {
this->unk_72 = 1;
super->spriteOffsetX = 0;
SetMetaTileByIndex(this->unk_70, COORD_TO_TILE(super), super->collisionLayer);
SetTileByIndex(this->unk_70, COORD_TO_TILE(super), super->collisionLayer);
}
if (((gPlayerState.gustJarState & 0xf) != 1) || ((super->contactFlags & 0x7f) != 0x13)) {
Bush_Action2SubAction5(this);
+34 -34
View File
@@ -13,7 +13,7 @@ typedef struct {
/*0x68*/ u8 unused1[8];
/*0x70*/ u16 unk_70;
/*0x72*/ u16 unk_72;
/*0x74*/ u16 metaTilePos;
/*0x74*/ u16 tilePos;
/*0x76*/ u8 unused2[14];
/*0x84*/ u16 unk_84;
/*0x86*/ u16 unk_86;
@@ -42,12 +42,12 @@ void Button_Init(ButtonEntity* this) {
if (this->unk_84 != 0) {
super->collisionLayer = this->unk_84;
}
this->metaTilePos = (((super->x.HALF.HI - gRoomControls.origin_x) >> 4) & 0x3F) |
this->tilePos = (((super->x.HALF.HI - gRoomControls.origin_x) >> 4) & 0x3F) |
((((super->y.HALF.HI - gRoomControls.origin_y) >> 4) & 0x3F) << 6);
this->unk_72 = GetMetaTileType(this->metaTilePos, super->collisionLayer);
this->unk_72 = GetTileType(this->tilePos, super->collisionLayer);
if (super->type == 0 && CheckFlags(this->unk_86)) {
super->action = 5;
SetMetaTileType(META_TILE_TYPE_122, this->metaTilePos, super->collisionLayer);
SetTileType(TILE_TYPE_122, this->tilePos, super->collisionLayer);
} else {
if (sub_08081E3C(this)) {
super->action = 2;
@@ -60,7 +60,7 @@ void Button_Init(ButtonEntity* this) {
void Button_Action1(ButtonEntity* this) {
if (sub_08081E3C(this)) {
super->action = 2;
this->unk_72 = GetMetaTileType(this->metaTilePos, super->collisionLayer);
this->unk_72 = GetTileType(this->tilePos, super->collisionLayer);
}
}
@@ -81,12 +81,12 @@ void Button_Action2(ButtonEntity* this) {
}
}
u32 sub_08081F7C(ButtonEntity*, u32 metaTileType);
u32 sub_08081F7C(ButtonEntity*, u32 tileType);
u32 sub_08081D28(ButtonEntity*);
void sub_08081E6C(ButtonEntity*);
void Button_Action3(ButtonEntity* this) {
if (!sub_08081F7C(this, META_TILE_TYPE_120))
if (!sub_08081F7C(this, TILE_TYPE_120))
return;
if (!sub_08081D28(this)) {
super->action = 4;
@@ -106,7 +106,7 @@ void Button_Action4(ButtonEntity* this) {
super->timer--;
if (super->subtimer != 0) {
super->subtimer = 0;
SetMetaTile(SPECIAL_META_TILE_53, this->metaTilePos, super->collisionLayer);
SetTile(SPECIAL_TILE_53, this->tilePos, super->collisionLayer);
}
if (sub_08081CB0(this)) {
super->action = 3;
@@ -115,13 +115,13 @@ void Button_Action4(ButtonEntity* this) {
} else {
super->action = 2;
ClearFlag(this->unk_86);
SetMetaTileType(META_TILE_TYPE_119, this->metaTilePos, super->collisionLayer);
SetTileType(TILE_TYPE_119, this->tilePos, super->collisionLayer);
SoundReq(SFX_BUTTON_PRESS);
}
}
void Button_Action5(ButtonEntity* this) {
if (sub_08081F7C(this, META_TILE_TYPE_122)) {
if (sub_08081F7C(this, TILE_TYPE_122)) {
sub_08081E6C(this);
}
}
@@ -132,14 +132,14 @@ bool32 sub_08081CB0(ButtonEntity* this) {
u16 tileType;
if (sub_08081D74(this)) {
this->unk_70 = -1;
if (GetMetaTileType(this->metaTilePos, super->collisionLayer) == SPECIAL_META_TILE_53) {
sub_0807B7D8(0x78, this->metaTilePos, super->collisionLayer);
if (GetTileType(this->tilePos, super->collisionLayer) == SPECIAL_TILE_53) {
sub_0807B7D8(0x78, this->tilePos, super->collisionLayer);
}
return TRUE;
} else {
tileType = GetMetaTileType(this->metaTilePos, super->collisionLayer);
if (tileType != 0x77 && tileType != 0x79 && tileType != SPECIAL_META_TILE_53) {
this->unk_70 = GetMetaTileIndex(this->metaTilePos, super->collisionLayer);
tileType = GetTileType(this->tilePos, super->collisionLayer);
if (tileType != 0x77 && tileType != 0x79 && tileType != SPECIAL_TILE_53) {
this->unk_70 = GetTileIndex(this->tilePos, super->collisionLayer);
return TRUE;
}
}
@@ -154,7 +154,7 @@ bool32 sub_08081D28(ButtonEntity* this) {
if (this->unk_70 == 0xFFFF) {
return FALSE;
}
if (GetMetaTileIndex(this->metaTilePos, super->collisionLayer) != this->unk_70) {
if (GetTileIndex(this->tilePos, super->collisionLayer) != this->unk_70) {
return FALSE;
}
}
@@ -166,7 +166,7 @@ u32 sub_08081E0C(Entity*);
Entity* sub_08081D74(ButtonEntity* this) {
Entity* ent;
if (GetCollisionDataAtMetaTilePos(this->metaTilePos, super->collisionLayer) == COLLISION_DATA_15) {
if (GetCollisionDataAtTilePos(this->tilePos, super->collisionLayer) == COLLISION_DATA_15) {
return NULL;
}
ent = 0;
@@ -204,7 +204,7 @@ u32 sub_08081E3C(ButtonEntity* this) {
};
const u16* tmp1;
s32 tmp2;
tmp2 = GetMetaTileType(this->metaTilePos, super->collisionLayer);
tmp2 = GetTileType(this->tilePos, super->collisionLayer);
tmp1 = gUnk_0811EE50;
do {
if (*tmp1 == tmp2)
@@ -220,34 +220,34 @@ extern u16 gMapDataTopSpecial[0x2000];
extern u16 gMapDataBottomSpecial[];
void sub_08081E6C(ButtonEntity* this) {
u32 metaTileType;
u32 tileType;
MapLayer* mapLayer;
u16* tmp2;
u16* tmp;
u16* tmp3;
u32 metaTilePos = this->metaTilePos;
u32 tilePos = this->tilePos;
u32 layer = super->collisionLayer;
u32 specialMetaTile = GetMetaTileType(metaTilePos, layer);
u32 specialTile = GetTileType(tilePos, layer);
if (specialMetaTile < 0x4000)
if (specialTile < 0x4000)
return;
mapLayer = GetLayerByIndex(layer);
metaTileType = (super->type == 0 ? META_TILE_TYPE_122 : META_TILE_TYPE_120);
tmp = mapLayer->metatiles;
tmp = tmp + (mapLayer->unkData2[metaTileType] << 2);
tileType = (super->type == 0 ? TILE_TYPE_122 : TILE_TYPE_120);
tmp = mapLayer->tiles;
tmp = tmp + (mapLayer->unkData2[tileType] << 2);
tmp2 = (layer == 2 ? gMapDataTopSpecial : gMapDataBottomSpecial);
tmp2 += (((0x3f & metaTilePos) << 1) + ((0xfc0 & metaTilePos) << 2));
tmp2 += (((0x3f & tilePos) << 1) + ((0xfc0 & tilePos) << 2));
if (sub_08081F00((u32*)tmp2, (u32*)tmp))
return;
SetMetaTileType(metaTileType, metaTilePos, layer);
SetMetaTile(specialMetaTile, metaTilePos, layer);
SetTileType(tileType, tilePos, layer);
SetTile(specialTile, tilePos, layer);
}
// Are the two tiles already set to the correct one
bool32 sub_08081F00(u32* screenblock, u32* metatileList) {
if (screenblock[0] != metatileList[0])
bool32 sub_08081F00(u32* screenblock, u32* tileList) {
if (screenblock[0] != tileList[0])
return FALSE;
if (screenblock[0x40] != metatileList[1])
if (screenblock[0x40] != tileList[1])
return FALSE;
return TRUE;
}
@@ -267,7 +267,7 @@ void sub_08081F24(Entity* this) {
}
}
bool32 sub_08081F7C(ButtonEntity* this, u32 metaTileType) {
bool32 sub_08081F7C(ButtonEntity* this, u32 tileType) {
u16 tmp;
if (super->timer == 0)
return TRUE;
@@ -277,11 +277,11 @@ bool32 sub_08081F7C(ButtonEntity* this, u32 metaTileType) {
} else {
if (super->timer == 6) {
SetFlag(this->unk_86);
SetMetaTileType(metaTileType, this->metaTilePos, super->collisionLayer);
SetTileType(tileType, this->tilePos, super->collisionLayer);
sub_08081F24(super);
SoundReq(SFX_BUTTON_PRESS);
if (this->unk_70 != 0xFFFF)
SetMetaTile(this->unk_70, this->metaTilePos, super->collisionLayer);
SetTile(this->unk_70, this->tilePos, super->collisionLayer);
return FALSE;
}
}
+25 -25
View File
@@ -13,7 +13,7 @@
typedef struct {
Entity base;
u8 filler[0x18];
u16 tile;
u16 tilePos;
} CabinFurnitureEntity;
void CabinFurniture_Init(CabinFurnitureEntity* this);
@@ -35,47 +35,47 @@ void CabinFurniture_Init(CabinFurnitureEntity* this) {
u32 uVar6;
u32 uVar7;
this->tile = COORD_TO_TILE(super);
this->tilePos = COORD_TO_TILE(super);
layer = super->collisionLayer;
UpdateSpriteForCollisionLayer(super);
switch (super->type) {
case 0:
super->action = 2;
super->spritePriority.b0 = 6;
uVar7 = this->tile;
uVar7 = this->tilePos;
uVar6 = uVar7 - 1;
SetMetaTile(SPECIAL_META_TILE_34, uVar6, layer);
SetMetaTile(SPECIAL_META_TILE_34, uVar7, layer);
SetMetaTile(SPECIAL_META_TILE_34, uVar7 + 1, layer);
SetMetaTile(SPECIAL_META_TILE_34, uVar7 + 0x3f, layer);
SetMetaTile(SPECIAL_META_TILE_34, uVar7 + 0x40, layer);
SetMetaTile(SPECIAL_META_TILE_34, uVar7 + 0x41, layer);
SetMetaTile(SPECIAL_META_TILE_61, uVar7 - 0x41, layer);
SetMetaTile(SPECIAL_META_TILE_61, uVar7 - 0x40, layer);
SetMetaTile(SPECIAL_META_TILE_38, uVar7 - 0x3f, layer);
SetMetaTile(SPECIAL_META_TILE_38, uVar7 - 0x81, layer);
SetMetaTile(SPECIAL_META_TILE_38, uVar7 - 0x80, layer);
SetTile(SPECIAL_TILE_34, uVar6, layer);
SetTile(SPECIAL_TILE_34, uVar7, layer);
SetTile(SPECIAL_TILE_34, uVar7 + 1, layer);
SetTile(SPECIAL_TILE_34, uVar7 + 0x3f, layer);
SetTile(SPECIAL_TILE_34, uVar7 + 0x40, layer);
SetTile(SPECIAL_TILE_34, uVar7 + 0x41, layer);
SetTile(SPECIAL_TILE_61, uVar7 - 0x41, layer);
SetTile(SPECIAL_TILE_61, uVar7 - 0x40, layer);
SetTile(SPECIAL_TILE_38, uVar7 - 0x3f, layer);
SetTile(SPECIAL_TILE_38, uVar7 - 0x81, layer);
SetTile(SPECIAL_TILE_38, uVar7 - 0x80, layer);
break;
case 1:
super->action = 1;
uVar6 = this->tile;
SetMetaTile(SPECIAL_META_TILE_34, uVar6, layer);
SetMetaTile(SPECIAL_META_TILE_34, uVar6 + 0x40, layer);
SetMetaTile(SPECIAL_META_TILE_37, uVar6 + 0x41, layer);
uVar6 = this->tilePos;
SetTile(SPECIAL_TILE_34, uVar6, layer);
SetTile(SPECIAL_TILE_34, uVar6 + 0x40, layer);
SetTile(SPECIAL_TILE_37, uVar6 + 0x41, layer);
if (CheckLocalFlag(0x4f) == 0) {
SetMetaTile(SPECIAL_META_TILE_47, uVar6 + 1, layer);
SetTile(SPECIAL_TILE_47, uVar6 + 1, layer);
} else {
SetMetaTile(SPECIAL_META_TILE_45, uVar6 + 1, layer);
SetTile(SPECIAL_TILE_45, uVar6 + 1, layer);
}
break;
case 2:
super->action = 1;
uVar7 = this->tile;
uVar7 = this->tilePos;
uVar6 = uVar7 - 0x41;
SetMetaTile(SPECIAL_META_TILE_34, uVar6, layer);
SetMetaTile(SPECIAL_META_TILE_34, uVar7 - 0x40, layer);
SetMetaTile(SPECIAL_META_TILE_34, uVar7 - 1, layer);
SetMetaTile(SPECIAL_META_TILE_34, uVar7, layer);
SetTile(SPECIAL_TILE_34, uVar6, layer);
SetTile(SPECIAL_TILE_34, uVar7 - 0x40, layer);
SetTile(SPECIAL_TILE_34, uVar7 - 1, layer);
SetTile(SPECIAL_TILE_34, uVar7, layer);
break;
}
}
+4 -4
View File
@@ -94,11 +94,11 @@ void CarlovObject_Type1Init(CarlovObjectEntity* this) {
this->unk_72 = super->y.HALF.HI;
super->spritePriority.b0 = 5;
this->unk_76 = COORD_TO_TILE(super);
this->unk_74 = GetMetaTileIndex(this->unk_76, super->collisionLayer);
this->unk_74 = GetTileIndex(this->unk_76, super->collisionLayer);
if (super->timer == 0) {
super->action = 1;
super->subtimer = 120;
SetMetaTile(SPECIAL_META_TILE_34, this->unk_76, super->collisionLayer);
SetTile(SPECIAL_TILE_34, this->unk_76, super->collisionLayer);
} else {
super->action = 3;
super->spriteSettings.draw = 0;
@@ -112,7 +112,7 @@ void CarlovObject_Type1Action1(CarlovObjectEntity* this) {
super->action = 2;
super->timer = 7;
super->direction = 0;
SetMetaTile(this->unk_74, this->unk_76, super->collisionLayer);
SetTile(this->unk_74, this->unk_76, super->collisionLayer);
EnqueueSFX(SFX_10B);
}
}
@@ -141,7 +141,7 @@ void CarlovObject_Type1Action4(CarlovObjectEntity* this) {
super->action = 5;
sub_08083814(super, 2);
EnqueueSFX(SFX_10B);
SetMetaTile(SPECIAL_META_TILE_34, this->unk_76, super->collisionLayer);
SetTile(SPECIAL_TILE_34, this->unk_76, super->collisionLayer);
}
}
+7 -7
View File
@@ -14,7 +14,7 @@
typedef struct {
/*0x00*/ Entity base;
/*0x68*/ u8 unk_68[8];
/*0x70*/ u16 tilePosition;
/*0x70*/ u16 tilePos;
/*0x72*/ u16 unk_72;
/*0x74*/ u8 unk_74[0x12];
/*0x86*/ u16 unk_86;
@@ -230,14 +230,14 @@ void ChestSpawner_Type2Action7(ChestSpawnerEntity* this) {
void ChestSpawner_Type0Init(ChestSpawnerEntity* this) {
super->action++;
this->tilePosition = COORD_TO_TILE(super);
this->tilePos = COORD_TO_TILE(super);
super->hitbox = (Hitbox*)&gUnk_0811F8A8;
if (GetMetaTileTypeByEntity(super) == META_TILE_TYPE_116) {
if (GetTileTypeByEntity(super) == TILE_TYPE_116) {
DeleteThisEntity();
}
if (CheckFlags(this->unk_86)) {
super->action = 3;
sub_0807B7D8(0x73, this->tilePosition, super->collisionLayer);
sub_0807B7D8(0x73, this->tilePos, super->collisionLayer);
if ((super->type & 1) == 0) {
DeleteThisEntity();
}
@@ -251,7 +251,7 @@ void ChestSpawner_Type0Action1(ChestSpawnerEntity* this) {
}
void ChestSpawner_Type0Action2(ChestSpawnerEntity* this) {
sub_0807B7D8(0x73, this->tilePosition, super->collisionLayer);
sub_0807B7D8(0x73, this->tilePos, super->collisionLayer);
switch (super->type) {
case 6:
case 7:
@@ -271,7 +271,7 @@ void ChestSpawner_Type0Action2(ChestSpawnerEntity* this) {
void ChestSpawner_Type0Action3(ChestSpawnerEntity* this) {
if ((super->type == 1) || (super->type == 7)) {
if (GetMetaTileTypeByEntity(super) == META_TILE_TYPE_116) {
if (GetTileTypeByEntity(super) == TILE_TYPE_116) {
DeleteEntity(super);
} else {
if (!CheckFlags(this->unk_86)) {
@@ -279,7 +279,7 @@ void ChestSpawner_Type0Action3(ChestSpawnerEntity* this) {
this->unk_72--;
} else {
super->action = 1;
RestorePrevTileEntity(this->tilePosition, super->collisionLayer);
RestorePrevTileEntity(this->tilePos, super->collisionLayer);
CreateDust(super);
}
}
+6 -6
View File
@@ -54,13 +54,13 @@ void CrenelBeanSprout_Init(CrenelBeanSproutEntity* this) {
if (CheckGlobalFlag(WATERBEAN_OUT)) {
if (CheckGlobalFlag(WATERBEAN_PUT) == 0) {
PositionRelative(&gPlayerEntity.base, super, 0, 0x10000);
SetMetaTile(SPECIAL_META_TILE_34, 0xdc, super->collisionLayer);
SetTile(SPECIAL_TILE_34, 0xdc, super->collisionLayer);
} else {
if (CheckLocalFlag(super->type2) == 0) {
InitializeAnimation(super, 10);
super->y.HALF.HI += 4;
super->action = 4;
SetMetaTile(SPECIAL_META_TILE_59, COORD_TO_TILE(super), super->collisionLayer);
SetTile(SPECIAL_TILE_59, 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;
SetMetaTile(SPECIAL_META_TILE_50, COORD_TO_TILE(super), super->collisionLayer);
SetTile(SPECIAL_TILE_50, COORD_TO_TILE(super), super->collisionLayer);
return;
} else {
super->type2 = 0;
@@ -232,8 +232,8 @@ void CrenelBeanSprout_Action3(CrenelBeanSproutEntity* this) {
}
void CrenelBeanSprout_Action4(CrenelBeanSproutEntity* this) {
static const u16 gUnk_0812319C[] = { SPECIAL_META_TILE_60, SPECIAL_META_TILE_51 };
if (gUnk_0812319C[super->type >> 1] == GetMetaTileTypeByEntity(super)) {
static const u16 gUnk_0812319C[] = { SPECIAL_TILE_60, SPECIAL_TILE_51 };
if (gUnk_0812319C[super->type >> 1] == GetTileTypeByEntity(super)) {
GetNextFrame(super);
gPlayerState.keepFacing |= 0x80;
gPlayerState.field_0xa |= 0x80;
@@ -329,5 +329,5 @@ void sub_08096A78(CrenelBeanSproutEntity* this) {
SnapToTile(super);
super->y.HALF.HI += 4;
super->action = 3;
SetMetaTile(SPECIAL_META_TILE_59, COORD_TO_TILE(super), super->collisionLayer);
SetTile(SPECIAL_TILE_59, COORD_TO_TILE(super), super->collisionLayer);
}
+5 -5
View File
@@ -367,11 +367,11 @@ void CuccoMinigame_TellObjective(void) {
}
void sub_080A1648(void) {
SetMetaTileType(SPECIAL_META_TILE_127, TILE_POS(54, 52), LAYER_BOTTOM);
SetMetaTileType(SPECIAL_META_TILE_127, TILE_POS(55, 52), LAYER_BOTTOM);
SetMetaTileType(SPECIAL_META_TILE_127, TILE_POS(56, 52), LAYER_BOTTOM);
SetMetaTileType(SPECIAL_META_TILE_126, TILE_POS(53, 53), LAYER_BOTTOM);
SetMetaTileType(SPECIAL_META_TILE_126, TILE_POS(53, 57), LAYER_BOTTOM);
SetTileType(SPECIAL_TILE_127, TILE_POS(54, 52), LAYER_BOTTOM);
SetTileType(SPECIAL_TILE_127, TILE_POS(55, 52), LAYER_BOTTOM);
SetTileType(SPECIAL_TILE_127, TILE_POS(56, 52), LAYER_BOTTOM);
SetTileType(SPECIAL_TILE_126, TILE_POS(53, 53), LAYER_BOTTOM);
SetTileType(SPECIAL_TILE_126, TILE_POS(53, 57), LAYER_BOTTOM);
}
void sub_080A169C(void) {
+36 -36
View File
@@ -11,7 +11,7 @@
typedef struct {
/*0x00*/ Entity base;
/*0x68*/ u8 unk_68[0x18];
/*0x80*/ u16 metaTilePos;
/*0x80*/ u16 tilePos;
/*0x82*/ u16 unk_82;
/*0x84*/ u8 unk_84;
/*0x85*/ u8 unk_85;
@@ -42,7 +42,7 @@ void DoubleBookshelf(DoubleBookshelfEntity* this) {
void DoubleBookshelf_Init(DoubleBookshelfEntity* this) {
DoubleBookshelfEntity* child;
super->frameIndex = super->type;
this->metaTilePos = COORD_TO_TILE(super);
this->tilePos = COORD_TO_TILE(super);
if (super->type != 0) {
super->action = 1;
if (this->unk_84 == 0) {
@@ -73,7 +73,7 @@ void DoubleBookshelf_Init(DoubleBookshelfEntity* this) {
}
void DoubleBookshelf_Action1(DoubleBookshelfEntity* this) {
GetMetaTileType(this->unk_82, super->collisionLayer);
GetTileType(this->unk_82, super->collisionLayer);
sub_0809B234(this);
}
@@ -81,7 +81,7 @@ void DoubleBookshelf_Action2(DoubleBookshelfEntity* this) {
LinearMoveUpdate(super);
if (--super->timer == 0) {
super->action = 1;
this->metaTilePos = COORD_TO_TILE(super);
this->tilePos = COORD_TO_TILE(super);
SetPlayerControl(CONTROL_ENABLED);
sub_0809B0B0(this);
EnqueueSFX(SFX_BUTTON_PRESS);
@@ -93,45 +93,45 @@ void DoubleBookshelf_Action3(DoubleBookshelfEntity* this) {
}
void sub_0809B0B0(DoubleBookshelfEntity* this) {
u32 tilePos = this->metaTilePos - 1;
u32 tilePos = this->tilePos - 1;
u32 layer = super->collisionLayer;
switch (super->subAction) {
case 0:
this->unk_84 = 0;
this->unk_82 = tilePos + 2;
SetMetaTile(SPECIAL_META_TILE_130, tilePos - 1, layer);
SetMetaTile(SPECIAL_META_TILE_34, tilePos, layer);
SetMetaTile(SPECIAL_META_TILE_34, tilePos + 1, layer);
SetMetaTile(SPECIAL_META_TILE_34, tilePos + 2, layer);
SetTile(SPECIAL_TILE_130, tilePos - 1, layer);
SetTile(SPECIAL_TILE_34, tilePos, layer);
SetTile(SPECIAL_TILE_34, tilePos + 1, layer);
SetTile(SPECIAL_TILE_34, tilePos + 2, layer);
break;
case 1:
this->unk_84 = 1;
this->unk_82 = tilePos;
SetMetaTile(SPECIAL_META_TILE_95, tilePos, layer);
SetMetaTile(SPECIAL_META_TILE_34, tilePos + 1, layer);
SetMetaTile(SPECIAL_META_TILE_34, tilePos + 2, layer);
SetMetaTile(SPECIAL_META_TILE_130, tilePos + 3, layer);
SetTile(SPECIAL_TILE_95, tilePos, layer);
SetTile(SPECIAL_TILE_34, tilePos + 1, layer);
SetTile(SPECIAL_TILE_34, tilePos + 2, layer);
SetTile(SPECIAL_TILE_130, tilePos + 3, layer);
break;
case 2:
this->unk_84 = 1;
this->unk_82 = tilePos;
SetMetaTile(SPECIAL_META_TILE_130, tilePos + 3, layer);
SetMetaTile(SPECIAL_META_TILE_34, tilePos + 2, layer);
SetMetaTile(SPECIAL_META_TILE_95, tilePos, layer);
SetTile(SPECIAL_TILE_130, tilePos + 3, layer);
SetTile(SPECIAL_TILE_34, tilePos + 2, layer);
SetTile(SPECIAL_TILE_95, tilePos, layer);
SetFlag(((DoubleBookshelfEntity*)super->parent)->unk_86);
break;
case 3:
this->unk_84 = 0;
this->unk_82 = tilePos + 2;
SetMetaTile(SPECIAL_META_TILE_130, tilePos - 1, layer);
SetMetaTile(SPECIAL_META_TILE_34, tilePos, layer);
SetMetaTile(SPECIAL_META_TILE_95, tilePos + 2, layer);
SetTile(SPECIAL_TILE_130, tilePos - 1, layer);
SetTile(SPECIAL_TILE_34, tilePos, layer);
SetTile(SPECIAL_TILE_95, tilePos + 2, layer);
ClearFlag(((DoubleBookshelfEntity*)super->parent)->unk_86);
break;
case 4:
SetMetaTile(SPECIAL_META_TILE_34, tilePos, layer);
SetMetaTile(SPECIAL_META_TILE_34, tilePos + 1, layer);
SetMetaTile(SPECIAL_META_TILE_34, tilePos + 2, layer);
SetTile(SPECIAL_TILE_34, tilePos, layer);
SetTile(SPECIAL_TILE_34, tilePos + 1, layer);
SetTile(SPECIAL_TILE_34, tilePos + 2, layer);
break;
}
}
@@ -158,7 +158,7 @@ void sub_0809B274(DoubleBookshelfEntity* this) {
case 1:
if (player->x.HALF.HI + 0x1c > super->x.HALF.HI) {
this->unk_84 = 2;
SetMetaTile(SPECIAL_META_TILE_34, this->metaTilePos + 2, LAYER_BOTTOM);
SetTile(SPECIAL_TILE_34, this->tilePos + 2, LAYER_BOTTOM);
sub_0809B358((DoubleBookshelfEntity*)super->child);
return;
}
@@ -173,7 +173,7 @@ void sub_0809B274(DoubleBookshelfEntity* this) {
return;
}
this->unk_84 = 1;
RestorePrevTileEntity(this->metaTilePos + 2, 1);
RestorePrevTileEntity(this->tilePos + 2, 1);
sub_0809B38C((DoubleBookshelfEntity*)super->child);
return;
}
@@ -181,34 +181,34 @@ void sub_0809B274(DoubleBookshelfEntity* this) {
void sub_0809B334(DoubleBookshelfEntity* this) {
s32 index;
u32 tilePos = this->metaTilePos - 0x81;
u32 tilePos = this->tilePos - 0x81;
for (index = 2; index >= 0; index--, tilePos++) {
SetMetaTile(SPECIAL_META_TILE_38, tilePos, LAYER_BOTTOM);
SetTile(SPECIAL_TILE_38, tilePos, LAYER_BOTTOM);
}
}
void sub_0809B358(DoubleBookshelfEntity* this) {
static const u16 gUnk_08123D68[] = { SPECIAL_META_TILE_34, SPECIAL_META_TILE_34, SPECIAL_META_TILE_116,
SPECIAL_META_TILE_38, SPECIAL_META_TILE_116, SPECIAL_META_TILE_116,
SPECIAL_META_TILE_38, SPECIAL_META_TILE_116, SPECIAL_META_TILE_34,
SPECIAL_META_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 metaTilePos = this->metaTilePos + TILE_POS(-2, -2);
u32 tilePos = this->tilePos + TILE_POS(-2, -2);
for (index = 4; index >= 0;) {
SetMetaTile(*array, metaTilePos, LAYER_BOTTOM);
SetTile(*array, tilePos, LAYER_BOTTOM);
index--;
metaTilePos++;
tilePos++;
array += 2;
}
}
void sub_0809B38C(DoubleBookshelfEntity* this) {
s32 index;
u32 metaTilePos = this->metaTilePos + TILE_POS(-2, -2);
u32 tilePos = this->tilePos + TILE_POS(-2, -2);
for (index = 4; index >= 0;) {
RestorePrevTileEntity(metaTilePos, 1);
RestorePrevTileEntity(tilePos, 1);
index--;
metaTilePos++;
tilePos++;
}
}
+3 -3
View File
@@ -306,9 +306,9 @@ void sub_08087F58(FigurineDeviceEntity* this) {
switch (super->type) {
case 0:
case 1:
SetMetaTile(SPECIAL_META_TILE_34, this->unk_78 - 1, LAYER_BOTTOM);
SetMetaTile(SPECIAL_META_TILE_34, this->unk_78, LAYER_BOTTOM);
SetMetaTile(SPECIAL_META_TILE_34, this->unk_78 + 1, LAYER_BOTTOM);
SetTile(SPECIAL_TILE_34, this->unk_78 - 1, LAYER_BOTTOM);
SetTile(SPECIAL_TILE_34, this->unk_78, LAYER_BOTTOM);
SetTile(SPECIAL_TILE_34, this->unk_78 + 1, LAYER_BOTTOM);
break;
}
}
+4 -4
View File
@@ -36,7 +36,7 @@ void Fireplace_Init(FireplaceEntity* this) {
DeleteThisEntity();
} else {
sub_0807B7D8(0x30b, TILE(super->x.HALF.HI, super->y.HALF.HI), 2);
SetMetaTile(SPECIAL_META_TILE_97, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
SetTile(SPECIAL_TILE_97, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
}
Fireplace_Action1(this);
}
@@ -50,14 +50,14 @@ void Fireplace_Action1(FireplaceEntity* this) {
}
void sub_0809B7C0(FireplaceEntity* this) {
u32 tileType = GetMetaTileTypeByEntity(super);
if (tileType != SPECIAL_META_TILE_97 && tileType != SPECIAL_META_TILE_98) {
u32 tileType = GetTileTypeByEntity(super);
if (tileType != SPECIAL_TILE_97 && tileType != SPECIAL_TILE_98) {
sub_0809B7DC(this);
}
}
void sub_0809B7DC(FireplaceEntity* this) {
sub_0807B7D8(0xc3 << 2, TILE(super->x.HALF.HI, super->y.HALF.HI), 2);
SetMetaTile(SPECIAL_META_TILE_98, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
SetTile(SPECIAL_TILE_98, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
super->timer = 1;
}
+27 -27
View File
@@ -114,33 +114,33 @@ void FrozenWaterElement_Action2(FrozenWaterElementEntity* this) {
void sub_0809C0A8(FrozenWaterElementEntity* this) {
u32 position = COORD_TO_TILE(super);
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-1, -1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(0, -1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(1, -1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-2, 0), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-1, 0), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(0, 0), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(1, 0), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(2, 0), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-2, 1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-1, 1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(0, 1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(1, 1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(2, 1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-1, 2), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(0, 2), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(1, 2), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-1, 5), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(0, 5), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(1, 5), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-1, 6), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(1, 6), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-3, 7), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-2, 7), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-1, 7), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(1, 7), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(2, 7), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(3, 7), super->collisionLayer);
SetTile(SPECIAL_TILE_34, position + TILE_POS(-1, -1), super->collisionLayer);
SetTile(SPECIAL_TILE_34, position + TILE_POS(0, -1), super->collisionLayer);
SetTile(SPECIAL_TILE_34, position + TILE_POS(1, -1), super->collisionLayer);
SetTile(SPECIAL_TILE_34, position + TILE_POS(-2, 0), super->collisionLayer);
SetTile(SPECIAL_TILE_34, position + TILE_POS(-1, 0), super->collisionLayer);
SetTile(SPECIAL_TILE_34, position + TILE_POS(0, 0), super->collisionLayer);
SetTile(SPECIAL_TILE_34, position + TILE_POS(1, 0), super->collisionLayer);
SetTile(SPECIAL_TILE_34, position + TILE_POS(2, 0), super->collisionLayer);
SetTile(SPECIAL_TILE_34, position + TILE_POS(-2, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_34, position + TILE_POS(-1, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_34, position + TILE_POS(0, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_34, position + TILE_POS(1, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_34, position + TILE_POS(2, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_34, position + TILE_POS(-1, 2), super->collisionLayer);
SetTile(SPECIAL_TILE_34, position + TILE_POS(0, 2), super->collisionLayer);
SetTile(SPECIAL_TILE_34, position + TILE_POS(1, 2), super->collisionLayer);
SetTile(SPECIAL_TILE_34, position + TILE_POS(-1, 5), super->collisionLayer);
SetTile(SPECIAL_TILE_34, position + TILE_POS(0, 5), super->collisionLayer);
SetTile(SPECIAL_TILE_34, position + TILE_POS(1, 5), super->collisionLayer);
SetTile(SPECIAL_TILE_34, position + TILE_POS(-1, 6), super->collisionLayer);
SetTile(SPECIAL_TILE_34, position + TILE_POS(1, 6), super->collisionLayer);
SetTile(SPECIAL_TILE_34, position + TILE_POS(-3, 7), super->collisionLayer);
SetTile(SPECIAL_TILE_34, position + TILE_POS(-2, 7), super->collisionLayer);
SetTile(SPECIAL_TILE_34, position + TILE_POS(-1, 7), super->collisionLayer);
SetTile(SPECIAL_TILE_34, position + TILE_POS(1, 7), super->collisionLayer);
SetTile(SPECIAL_TILE_34, position + TILE_POS(2, 7), super->collisionLayer);
SetTile(SPECIAL_TILE_34, position + TILE_POS(3, 7), super->collisionLayer);
}
void sub_0809C23C(FrozenWaterElementEntity* this) {
+70 -70
View File
@@ -216,14 +216,14 @@ static void FurnitureInit(FurnitureEntity* this) {
break;
case 0x40:
super->y.HALF.HI = (super->y.HALF.HI & ~0xF) | 4;
SetMetaTile(SPECIAL_META_TILE_23, this->tilePos - 128, LAYER_BOTTOM);
SetMetaTile(SPECIAL_META_TILE_23, this->tilePos - 64, LAYER_BOTTOM);
SetTile(SPECIAL_TILE_23, this->tilePos - 128, LAYER_BOTTOM);
SetTile(SPECIAL_TILE_23, this->tilePos - 64, LAYER_BOTTOM);
break;
case 0x80:
super->frameIndex = 0;
super->y.HALF.HI = (super->y.HALF.HI & ~0xF) | 6;
this->tilePos = COORD_TO_TILE(super);
SetMetaTile(SPECIAL_META_TILE_38, this->tilePos, super->collisionLayer);
SetTile(SPECIAL_TILE_38, this->tilePos, super->collisionLayer);
break;
case 0x200:
break;
@@ -259,9 +259,9 @@ static void FurnitureInit(FurnitureEntity* this) {
tilePos = this->tilePos - 129;
cnt = super->type != 26 ? 3 : 2;
for (i = 0; i < cnt; ++i, ++tilePos) {
SetMetaTile(SPECIAL_META_TILE_38, tilePos, LAYER_TOP);
SetMetaTile(SPECIAL_META_TILE_38, tilePos, LAYER_BOTTOM);
SetVvvAtMetaTilePos(VVV_0, tilePos + TILE_POS(0, 1), 1);
SetTile(SPECIAL_TILE_38, tilePos, LAYER_TOP);
SetTile(SPECIAL_TILE_38, tilePos, LAYER_BOTTOM);
SetVvvAtTilePos(VVV_0, tilePos + TILE_POS(0, 1), 1);
}
break;
}
@@ -286,22 +286,22 @@ static void FurnitureInit(FurnitureEntity* this) {
case STAIRCASE:
super->collisionLayer = 1;
super->spriteOrientation.flipY = 2;
SetMetaTile(SPECIAL_META_TILE_116, this->tilePos - 64, super->collisionLayer);
SetVvvAtMetaTilePos(VVV_63, this->tilePos - 64, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_23, this->tilePos, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_23, this->tilePos + 64, super->collisionLayer);
SetTile(SPECIAL_TILE_116, this->tilePos - 64, super->collisionLayer);
SetVvvAtTilePos(VVV_63, this->tilePos - 64, super->collisionLayer);
SetTile(SPECIAL_TILE_23, this->tilePos, super->collisionLayer);
SetTile(SPECIAL_TILE_23, this->tilePos + 64, super->collisionLayer);
break;
case MINISH_CHEESE:
if (super->type2 != 0)
super->spriteOffsetX = -4;
break;
case WOODEN_TABLE:
SetMetaTile(SPECIAL_META_TILE_35, this->tilePos - 65, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_35, this->tilePos - 64, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_35, this->tilePos - 63, super->collisionLayer);
SetTile(SPECIAL_TILE_35, this->tilePos - 65, super->collisionLayer);
SetTile(SPECIAL_TILE_35, this->tilePos - 64, super->collisionLayer);
SetTile(SPECIAL_TILE_35, this->tilePos - 63, super->collisionLayer);
break;
case LOW_BOOKSHELF:
SetMetaTile(SPECIAL_META_TILE_34, this->tilePos + 65, super->collisionLayer);
SetTile(SPECIAL_TILE_34, this->tilePos + 65, super->collisionLayer);
}
}
@@ -339,20 +339,20 @@ static void FurnitureUpdate(FurnitureEntity* this) {
case 0x80:
if (gPlayerEntity.base.y.HALF.HI < super->y.HALF.HI + 8) {
if (gPlayerState.floor_type != SURFACE_LADDER &&
GetMetaTileTypeByEntity(super) == SPECIAL_META_TILE_23) {
SetMetaTile(SPECIAL_META_TILE_38, this->tilePos, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_61, this->tilePos + TILE_POS(0, -1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_61, this->tilePos + TILE_POS(0, -2), super->collisionLayer);
GetTileTypeByEntity(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);
}
} else {
if (gPlayerEntity.base.collisionLayer & 2) {
gPlayerEntity.base.collisionLayer = 1;
UpdateSpriteForCollisionLayer(&gPlayerEntity.base);
}
if (GetMetaTileTypeByEntity(super) != SPECIAL_META_TILE_23) {
SetMetaTile(SPECIAL_META_TILE_23, this->tilePos, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_23, this->tilePos + TILE_POS(0, -1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_20, this->tilePos + TILE_POS(0, -2), super->collisionLayer);
if (GetTileTypeByEntity(super) != SPECIAL_TILE_23) {
SetTile(SPECIAL_TILE_23, this->tilePos, super->collisionLayer);
SetTile(SPECIAL_TILE_23, this->tilePos + TILE_POS(0, -1), super->collisionLayer);
SetTile(SPECIAL_TILE_20, this->tilePos + TILE_POS(0, -2), super->collisionLayer);
}
}
break;
@@ -377,103 +377,103 @@ static void sub_08090B6C(FurnitureEntity* this) {
num = 2;
}
for (i = -num; i <= num; ++i) {
SetMetaTile(SPECIAL_META_TILE_34, tilePos + i, layer);
SetTile(SPECIAL_TILE_34, tilePos + i, layer);
}
if (px & 8) {
sub_08090CDC(SPECIAL_META_TILE_36, tilePos - i, layer);
sub_08090CDC(SPECIAL_META_TILE_37, tilePos + i, layer);
sub_08090CDC(SPECIAL_TILE_36, tilePos - i, layer);
sub_08090CDC(SPECIAL_TILE_37, tilePos + i, layer);
} else {
SetMetaTile(SPECIAL_META_TILE_34, tilePos - i, layer);
SetTile(SPECIAL_TILE_34, tilePos - i, layer);
}
break;
case 1:
num = w2 / 8;
for (i = -num; i <= num; i++) {
SetMetaTile(SPECIAL_META_TILE_34, tilePos + i, layer);
SetTile(SPECIAL_TILE_34, tilePos + i, layer);
}
if (px & 8) {
sub_08090CDC(SPECIAL_META_TILE_36, tilePos - i, layer);
sub_08090CDC(SPECIAL_TILE_36, tilePos - i, layer);
if (i != 0) {
SetMetaTile(SPECIAL_META_TILE_34, tilePos + i, layer);
SetTile(SPECIAL_TILE_34, tilePos + i, layer);
}
} else {
if (i != 0) {
SetMetaTile(SPECIAL_META_TILE_34, tilePos - i, layer);
SetTile(SPECIAL_TILE_34, tilePos - i, layer);
}
sub_08090CDC(SPECIAL_META_TILE_37, tilePos + i, layer);
sub_08090CDC(SPECIAL_TILE_37, tilePos + i, layer);
}
break;
case 2:
num = w2 / 4;
for (i = -num; i < num; ++i) {
SetMetaTile(SPECIAL_META_TILE_34, tilePos + i, layer);
SetTile(SPECIAL_TILE_34, tilePos + i, layer);
}
if (px & 8) {
SetMetaTile(SPECIAL_META_TILE_34, tilePos + i, layer);
SetTile(SPECIAL_TILE_34, tilePos + i, layer);
} else {
sub_08090CDC(SPECIAL_META_TILE_36, tilePos - i - 1, layer);
sub_08090CDC(SPECIAL_META_TILE_37, tilePos + i, layer);
sub_08090CDC(SPECIAL_TILE_36, tilePos - i - 1, layer);
sub_08090CDC(SPECIAL_TILE_37, tilePos + i, layer);
}
break;
case 3:
num = w2 / 4;
for (i = -num; i <= num; ++i) {
SetMetaTile(SPECIAL_META_TILE_34, tilePos + i, layer);
SetTile(SPECIAL_TILE_34, tilePos + i, layer);
}
if (px & 8) {
sub_08090CDC(SPECIAL_META_TILE_37, tilePos + i, layer);
sub_08090CDC(SPECIAL_TILE_37, tilePos + i, layer);
} else {
sub_08090CDC(SPECIAL_META_TILE_36, tilePos - i, layer);
sub_08090CDC(SPECIAL_TILE_36, tilePos - i, layer);
}
break;
}
}
}
static void sub_08090CDC(u32 metaTileIndex, u32 metaTilePos, u32 layer) {
u16 cur = GetMetaTileIndex(metaTilePos, layer);
static void sub_08090CDC(u32 tileIndex, u32 tilePos, u32 layer) {
u16 cur = GetTileIndex(tilePos, layer);
u32 next = cur;
if ((cur & 0x4000) == 0) {
SetMetaTile(metaTileIndex, metaTilePos, layer);
SetTile(tileIndex, tilePos, layer);
} else {
switch (cur) {
case SPECIAL_META_TILE_37:
if (metaTileIndex == SPECIAL_META_TILE_36)
next = SPECIAL_META_TILE_34;
if (metaTileIndex == SPECIAL_META_TILE_44)
next = SPECIAL_META_TILE_34;
case SPECIAL_TILE_37:
if (tileIndex == SPECIAL_TILE_36)
next = SPECIAL_TILE_34;
if (tileIndex == SPECIAL_TILE_44)
next = SPECIAL_TILE_34;
break;
case SPECIAL_META_TILE_45:
if (metaTileIndex == SPECIAL_META_TILE_44)
next = SPECIAL_META_TILE_43;
if (metaTileIndex == SPECIAL_META_TILE_36)
next = SPECIAL_META_TILE_34;
case SPECIAL_TILE_45:
if (tileIndex == SPECIAL_TILE_44)
next = SPECIAL_TILE_43;
if (tileIndex == SPECIAL_TILE_36)
next = SPECIAL_TILE_34;
break;
case SPECIAL_META_TILE_36:
if (metaTileIndex == SPECIAL_META_TILE_37)
next = SPECIAL_META_TILE_34;
if (metaTileIndex == SPECIAL_META_TILE_45)
next = SPECIAL_META_TILE_34;
case SPECIAL_TILE_36:
if (tileIndex == SPECIAL_TILE_37)
next = SPECIAL_TILE_34;
if (tileIndex == SPECIAL_TILE_45)
next = SPECIAL_TILE_34;
break;
case SPECIAL_META_TILE_44:
if (metaTileIndex == SPECIAL_META_TILE_45)
next = SPECIAL_META_TILE_43;
if (metaTileIndex == SPECIAL_META_TILE_37)
next = SPECIAL_META_TILE_34;
case SPECIAL_TILE_44:
if (tileIndex == SPECIAL_TILE_45)
next = SPECIAL_TILE_43;
if (tileIndex == SPECIAL_TILE_37)
next = SPECIAL_TILE_34;
break;
case SPECIAL_META_TILE_34:
case SPECIAL_META_TILE_35:
case SPECIAL_META_TILE_38:
case SPECIAL_META_TILE_39:
case SPECIAL_META_TILE_40:
case SPECIAL_META_TILE_41:
case SPECIAL_META_TILE_42:
case SPECIAL_META_TILE_43:
case SPECIAL_TILE_34:
case SPECIAL_TILE_35:
case SPECIAL_TILE_38:
case SPECIAL_TILE_39:
case SPECIAL_TILE_40:
case SPECIAL_TILE_41:
case SPECIAL_TILE_42:
case SPECIAL_TILE_43:
default:
return;
}
SetMetaTile(next, metaTilePos, layer);
SetTile(next, tilePos, layer);
}
}
+10 -10
View File
@@ -15,8 +15,8 @@
typedef struct {
Entity base;
u8 filler[0x8];
u16 tile;
u16 tile2;
u16 tilePos;
u16 tilePos2;
u16 tileIndex;
u16 tileIndex2;
u8 filler2[0xe];
@@ -56,12 +56,12 @@ void GentariCurtain_Init(GentariCurtainEntity* this) {
super->spritePriority.b0 = 6;
super->x.HALF.HI += 2;
UpdateSpriteForCollisionLayer(super);
this->tile = COORD_TO_TILE_OFFSET(super, 0, 8);
this->tile2 = COORD_TO_TILE_OFFSET(super, 0, -8);
this->tileIndex = GetMetaTileIndex(this->tile, LAYER_BOTTOM);
this->tileIndex2 = GetMetaTileIndex(this->tile2, LAYER_BOTTOM);
SetMetaTile(SPECIAL_META_TILE_34, this->tile, LAYER_BOTTOM);
SetMetaTile(SPECIAL_META_TILE_34, this->tile2, LAYER_BOTTOM);
this->tilePos = COORD_TO_TILE_OFFSET(super, 0, 8);
this->tilePos2 = COORD_TO_TILE_OFFSET(super, 0, -8);
this->tileIndex = GetTileIndex(this->tilePos, LAYER_BOTTOM);
this->tileIndex2 = GetTileIndex(this->tilePos2, LAYER_BOTTOM);
SetTile(SPECIAL_TILE_34, this->tilePos, LAYER_BOTTOM);
SetTile(SPECIAL_TILE_34, this->tilePos2, LAYER_BOTTOM);
InitAnimationForceUpdate(super, 0);
} else {
super->action = 1;
@@ -81,8 +81,8 @@ void GentariCurtain_Action2(GentariCurtainEntity* this) {
UpdateAnimationSingleFrame(super);
if ((super->frame & ANIM_DONE) != 0) {
super->action = 3;
SetMetaTile(this->tileIndex, this->tile, LAYER_BOTTOM);
SetMetaTile(this->tileIndex2, this->tile2, LAYER_BOTTOM);
SetTile(this->tileIndex, this->tilePos, LAYER_BOTTOM);
SetTile(this->tileIndex2, this->tilePos2, LAYER_BOTTOM);
sub_08092214(this);
sub_0809223C(this);
InitAnimationForceUpdate(super, 1);
+13 -13
View File
@@ -52,36 +52,36 @@ void sub_0808E55C(GiantBookLadderEntity* this) {
case 2:
tilePos = this->unk74;
unaff_r9 = tilePos + TILE_POS(-1, -4);
SetMetaTile(SPECIAL_META_TILE_143, unaff_r9, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_143, tilePos + TILE_POS(0, -4), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_108, tilePos + TILE_POS(-2, -4), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_109, tilePos + TILE_POS(1, -4), super->collisionLayer);
SetTile(SPECIAL_TILE_143, unaff_r9, super->collisionLayer);
SetTile(SPECIAL_TILE_143, tilePos + TILE_POS(0, -4), super->collisionLayer);
SetTile(SPECIAL_TILE_108, tilePos + TILE_POS(-2, -4), super->collisionLayer);
SetTile(SPECIAL_TILE_109, tilePos + TILE_POS(1, -4), super->collisionLayer);
type = super->type;
uVar5 = 6;
if (type != 0) {
uVar5 = 4;
SetMetaTile(SPECIAL_META_TILE_114, tilePos + TILE_POS(-1, 1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_114, tilePos + TILE_POS(0, 1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_114, tilePos + TILE_POS(-1, 2), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_114, tilePos + TILE_POS(0, 2), super->collisionLayer);
SetTile(SPECIAL_TILE_114, tilePos + TILE_POS(-1, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_114, tilePos + TILE_POS(0, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_114, tilePos + TILE_POS(-1, 2), super->collisionLayer);
SetTile(SPECIAL_TILE_114, tilePos + TILE_POS(0, 2), super->collisionLayer);
}
break;
case 1:
tilePos = this->unk74;
unaff_r9 = tilePos - 1;
SetMetaTile(SPECIAL_META_TILE_142, unaff_r9, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_142, tilePos, super->collisionLayer);
SetTile(SPECIAL_TILE_142, unaff_r9, super->collisionLayer);
SetTile(SPECIAL_TILE_142, tilePos, super->collisionLayer);
uVar5 = 2;
break;
}
for (uVar4 = 0; uVar4 < uVar5; uVar4++) {
unaff_r9 += 0x40;
SetMetaTile(SPECIAL_META_TILE_142, unaff_r9, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_142, unaff_r9 + 1, super->collisionLayer);
SetTile(SPECIAL_TILE_142, unaff_r9, super->collisionLayer);
SetTile(SPECIAL_TILE_142, unaff_r9 + 1, super->collisionLayer);
}
}
u32 sub_0808E670(GiantBookLadderEntity* this) {
return GetMetaTileType(this->unk74 - 0x101, LAYER_BOTTOM);
return GetTileType(this->unk74 - 0x101, LAYER_BOTTOM);
}
+1 -1
View File
@@ -36,6 +36,6 @@ void sub_0808D618(Entity* this) {
((((this->y.HALF.HI - gRoomControls.origin_y) >> 4) & 0x3F) * 64);
for (i = 0; i < 13; i++) {
SetMetaTile(16500, tilePos + arr[i], LAYER_BOTTOM);
SetTile(16500, tilePos + arr[i], LAYER_BOTTOM);
}
}
+10 -10
View File
@@ -12,7 +12,7 @@
typedef struct {
Entity base;
u8 filler[0xC];
u16 metaTilePos;
u16 tilePos;
} GiantRock2Entity;
void GiantRock2_Init(GiantRock2Entity* this);
@@ -28,22 +28,22 @@ void GiantRock2(Entity* this) {
void GiantRock2_Init(GiantRock2Entity* this) {
u32 collisionLayer;
u16 metaTilePos;
u16 tilePos;
int index;
u32 tileIndex;
super->action = 1;
this->metaTilePos = COORD_TO_TILE(super);
this->tilePos = COORD_TO_TILE(super);
collisionLayer = super->collisionLayer;
super->spritePriority.b0 = 7;
metaTilePos = (this->metaTilePos - TILE_POS(0, 2));
tileIndex = SPECIAL_META_TILE_34;
tilePos = (this->tilePos - TILE_POS(0, 2));
tileIndex = SPECIAL_TILE_34;
for (index = 4; index > -1; index--) {
SetMetaTile(tileIndex, metaTilePos - 2, collisionLayer);
SetMetaTile(tileIndex, metaTilePos - 1, collisionLayer);
SetMetaTile(tileIndex, metaTilePos, collisionLayer);
SetMetaTile(tileIndex, metaTilePos + 1, collisionLayer);
metaTilePos += TILE_POS(0, 1);
SetTile(tileIndex, tilePos - 2, collisionLayer);
SetTile(tileIndex, tilePos - 1, collisionLayer);
SetTile(tileIndex, tilePos, collisionLayer);
SetTile(tileIndex, tilePos + 1, collisionLayer);
tilePos += TILE_POS(0, 1);
}
}
+54 -54
View File
@@ -11,7 +11,7 @@
typedef struct {
/*0x00*/ Entity base;
/*0x68*/ u8 unk_68[0xe];
/*0x76*/ u16 tilePosition;
/*0x76*/ u16 tilePos;
/*0x78*/ u16 unk_78;
/*0x7a*/ u16 unk_7a;
} GiantTwigEntity;
@@ -70,7 +70,7 @@ void GiantTwig(GiantTwigEntity* this) {
void GiantTwig_Type0Init(GiantTwigEntity* this) {
Entity* obj;
super->action = 1;
this->tilePosition = COORD_TO_TILE(super);
this->tilePos = COORD_TO_TILE(super);
switch (super->type) {
case 0:
super->frameIndex = 1;
@@ -116,7 +116,7 @@ void GiantTwig_Type1Init(GiantTwigEntity* this) {
super->action = 1;
super->frameIndex = (super->type2 & 1) + 3;
super->spritePriority.b0 = 7;
this->tilePosition = COORD_TO_TILE(super);
this->tilePos = COORD_TO_TILE(super);
sub_08093A1C(this);
}
@@ -128,7 +128,7 @@ void GiantTwig_Type2Init(GiantTwigEntity* this) {
super->frameIndex = (super->type2 & 1) + 5;
super->spriteRendering.b3 = 3;
super->spritePriority.b0 = 7;
this->tilePosition = COORD_TO_TILE(super);
this->tilePos = COORD_TO_TILE(super);
if ((super->type2 & 1) != 0) {
super->spriteOffsetX = 8;
}
@@ -141,7 +141,7 @@ void GiantTwig_Type2Idle(GiantTwigEntity* this) {
void sub_08093984(GiantTwigEntity* this) {
u32 index;
const s16* metaTileOffsets;
const s16* tileOffsets;
if (super->type2 != 0) {
static const s16 gUnk_081228F8[] = {
@@ -150,7 +150,7 @@ void sub_08093984(GiantTwigEntity* this) {
TILE_POS(-1, 0), TILE_POS(0, 0), TILE_POS(1, 0), TILE_POS(2, 0), TILE_POS(-1, 1),
TILE_POS(0, 1), TILE_POS(1, 1), TILE_POS(2, 1), TILE_POS(3, 1),
};
metaTileOffsets = gUnk_081228F8;
tileOffsets = gUnk_081228F8;
} else {
static const s16 gUnk_0812291E[] = {
TILE_POS(-1, -2), TILE_POS(0, -2), TILE_POS(1, -2), TILE_POS(2, -2), TILE_POS(-2, -1),
@@ -158,11 +158,11 @@ void sub_08093984(GiantTwigEntity* this) {
TILE_POS(-1, 0), TILE_POS(0, 0), TILE_POS(1, 0), TILE_POS(2, 0), TILE_POS(-3, 1),
TILE_POS(-2, 1), TILE_POS(-1, 1), TILE_POS(0, 1), TILE_POS(1, 1),
};
metaTileOffsets = gUnk_0812291E;
tileOffsets = gUnk_0812291E;
}
for (index = 0; index < 0x13; index++) {
SetMetaTile(SPECIAL_META_TILE_116, metaTileOffsets[index] + this->tilePosition, LAYER_BOTTOM);
SetTile(SPECIAL_TILE_116, tileOffsets[index] + this->tilePos, LAYER_BOTTOM);
}
}
@@ -170,7 +170,7 @@ void GiantTwig_Type3Init(GiantTwigEntity* this) {
super->action = 1;
super->frameIndex = (super->type2 & 3) + 7;
super->spritePriority.b0 = 7;
this->tilePosition = COORD_TO_TILE(super);
this->tilePos = COORD_TO_TILE(super);
sub_08093A1C(this);
ChangeObjPalette(super, 0x7a);
}
@@ -181,47 +181,47 @@ void GiantTwig_Type3Idle(GiantTwigEntity* this) {
void sub_08093A1C(GiantTwigEntity* this) {
switch (super->type) {
case 0:
SetMetaTile(SPECIAL_META_TILE_36, this->tilePosition + TILE_POS(-4, 1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, this->tilePosition + TILE_POS(-3, 1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, this->tilePosition + TILE_POS(-2, 1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_41, this->tilePosition + TILE_POS(-4, 2), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_38, this->tilePosition + TILE_POS(-3, 2), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_38, this->tilePosition + TILE_POS(-2, 2), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_61, this->tilePosition + TILE_POS(0, 1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_61, this->tilePosition + TILE_POS(0, 2), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_39, this->tilePosition + TILE_POS(1, 1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_35, this->tilePosition + TILE_POS(2, 1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_109, this->tilePosition + TILE_POS(3, 1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_41, this->tilePosition + TILE_POS(1, 2), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_38, this->tilePosition + TILE_POS(2, 2), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_38, this->tilePosition + TILE_POS(3, 2), super->collisionLayer);
SetTile(SPECIAL_TILE_36, this->tilePos + TILE_POS(-4, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_34, this->tilePos + TILE_POS(-3, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_34, this->tilePos + TILE_POS(-2, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_41, this->tilePos + TILE_POS(-4, 2), super->collisionLayer);
SetTile(SPECIAL_TILE_38, this->tilePos + TILE_POS(-3, 2), super->collisionLayer);
SetTile(SPECIAL_TILE_38, this->tilePos + TILE_POS(-2, 2), 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);
SetTile(SPECIAL_TILE_39, this->tilePos + TILE_POS(1, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_35, this->tilePos + TILE_POS(2, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_109, this->tilePos + TILE_POS(3, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_41, this->tilePos + TILE_POS(1, 2), super->collisionLayer);
SetTile(SPECIAL_TILE_38, this->tilePos + TILE_POS(2, 2), super->collisionLayer);
SetTile(SPECIAL_TILE_38, this->tilePos + TILE_POS(3, 2), super->collisionLayer);
break;
case 1:
if ((super->type2 & 1) != 0) {
SetMetaTile(SPECIAL_META_TILE_109, this->tilePosition + TILE_POS(-1, -2), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, this->tilePosition + TILE_POS(-1, -1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_41, this->tilePosition + TILE_POS(-2, 0), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_38, this->tilePosition + TILE_POS(-1, 0), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, this->tilePosition + TILE_POS(0, 0), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_109, this->tilePosition + TILE_POS(1, 0), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_110, this->tilePosition + TILE_POS(0, 1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, this->tilePosition + TILE_POS(1, 1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_109, this->tilePosition + TILE_POS(2, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_109, this->tilePos + TILE_POS(-1, -2), super->collisionLayer);
SetTile(SPECIAL_TILE_34, this->tilePos + TILE_POS(-1, -1), super->collisionLayer);
SetTile(SPECIAL_TILE_41, this->tilePos + TILE_POS(-2, 0), super->collisionLayer);
SetTile(SPECIAL_TILE_38, this->tilePos + TILE_POS(-1, 0), super->collisionLayer);
SetTile(SPECIAL_TILE_34, this->tilePos + TILE_POS(0, 0), super->collisionLayer);
SetTile(SPECIAL_TILE_109, this->tilePos + TILE_POS(1, 0), super->collisionLayer);
SetTile(SPECIAL_TILE_110, this->tilePos + TILE_POS(0, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_34, this->tilePos + TILE_POS(1, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_109, this->tilePos + TILE_POS(2, 1), super->collisionLayer);
} else {
SetMetaTile(SPECIAL_META_TILE_108, this->tilePosition + TILE_POS(1, -2), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, this->tilePosition + TILE_POS(1, -1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_108, this->tilePosition + TILE_POS(-1, 0), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, this->tilePosition + TILE_POS(0, 0), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_38, this->tilePosition + TILE_POS(1, 0), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_42, this->tilePosition + TILE_POS(2, 0), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_108, this->tilePosition + TILE_POS(-2, 1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, this->tilePosition + TILE_POS(-1, 1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_111, this->tilePosition + TILE_POS(0, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_108, this->tilePos + TILE_POS(1, -2), super->collisionLayer);
SetTile(SPECIAL_TILE_34, this->tilePos + TILE_POS(1, -1), super->collisionLayer);
SetTile(SPECIAL_TILE_108, this->tilePos + TILE_POS(-1, 0), super->collisionLayer);
SetTile(SPECIAL_TILE_34, this->tilePos + TILE_POS(0, 0), super->collisionLayer);
SetTile(SPECIAL_TILE_38, this->tilePos + TILE_POS(1, 0), super->collisionLayer);
SetTile(SPECIAL_TILE_42, this->tilePos + TILE_POS(2, 0), super->collisionLayer);
SetTile(SPECIAL_TILE_108, this->tilePos + TILE_POS(-2, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_34, this->tilePos + TILE_POS(-1, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_111, this->tilePos + TILE_POS(0, 1), super->collisionLayer);
return;
}
break;
case 3:
SetMetaTile(SPECIAL_META_TILE_34, this->tilePosition, super->collisionLayer);
SetTile(SPECIAL_TILE_34, this->tilePos, super->collisionLayer);
break;
}
}
@@ -230,12 +230,12 @@ void sub_08093C70(GiantTwigEntity* this) {
if (this->unk_78 != 0) {
if (gPlayerState.heldObject != 0) {
this->unk_78 = 0;
SetMetaTile(SPECIAL_META_TILE_34, this->tilePosition + TILE_POS(-1, 1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, this->tilePosition + TILE_POS(0, 1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, this->tilePosition + TILE_POS(1, 1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_38, this->tilePosition + TILE_POS(-1, 2), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_38, this->tilePosition + TILE_POS(0, 2), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_38, this->tilePosition + TILE_POS(1, 2), super->collisionLayer);
SetTile(SPECIAL_TILE_34, this->tilePos + TILE_POS(-1, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_34, this->tilePos + TILE_POS(0, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_34, this->tilePos + TILE_POS(1, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_38, this->tilePos + TILE_POS(-1, 2), super->collisionLayer);
SetTile(SPECIAL_TILE_38, this->tilePos + TILE_POS(0, 2), super->collisionLayer);
SetTile(SPECIAL_TILE_38, this->tilePos + TILE_POS(1, 2), super->collisionLayer);
}
} else {
@@ -243,12 +243,12 @@ void sub_08093C70(GiantTwigEntity* this) {
if (--this->unk_7a == 0) {
this->unk_78++;
this->unk_7a = 0x3c;
SetMetaTile(SPECIAL_META_TILE_61, this->tilePosition + TILE_POS(-1, 1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_61, this->tilePosition + TILE_POS(0, 1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_39, this->tilePosition + TILE_POS(1, 1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_61, this->tilePosition + TILE_POS(-1, 2), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_61, this->tilePosition + TILE_POS(0, 2), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_41, this->tilePosition + TILE_POS(1, 2), super->collisionLayer);
SetTile(SPECIAL_TILE_61, this->tilePos + TILE_POS(-1, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_61, this->tilePos + TILE_POS(0, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_39, this->tilePos + TILE_POS(1, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_61, this->tilePos + TILE_POS(-1, 2), super->collisionLayer);
SetTile(SPECIAL_TILE_61, this->tilePos + TILE_POS(0, 2), super->collisionLayer);
SetTile(SPECIAL_TILE_41, this->tilePos + TILE_POS(1, 2), super->collisionLayer);
}
}
}
+10 -10
View File
@@ -42,20 +42,20 @@ void HiddenLadderDown_Init(HiddenLadderDownEntity* this) {
if (CheckFlags(this->unk_86) != 0) {
super->action = 2;
super->spriteSettings.draw = TRUE;
SetMetaTileType(META_TILE_TYPE_418, *puVar3 + TILE_POS(-1, -1), super->collisionLayer);
SetMetaTileType(META_TILE_TYPE_419, *puVar3 + TILE_POS(0, -1), super->collisionLayer);
SetMetaTileType(META_TILE_TYPE_420, *puVar3 + TILE_POS(1, -1), super->collisionLayer);
SetMetaTileType(META_TILE_TYPE_421, *puVar3 + TILE_POS(-1, 0), super->collisionLayer);
SetMetaTileType(META_TILE_TYPE_422, *puVar3 + TILE_POS(0, 0), super->collisionLayer);
SetMetaTileType(META_TILE_TYPE_423, *puVar3 + TILE_POS(1, 0), super->collisionLayer);
SetMetaTileType(META_TILE_TYPE_424, *puVar3 + TILE_POS(-1, 1), super->collisionLayer);
SetMetaTileType(META_TILE_TYPE_425, *puVar3 + TILE_POS(0, 1), super->collisionLayer);
SetMetaTileType(META_TILE_TYPE_426, *puVar3 + TILE_POS(1, 1), super->collisionLayer);
SetTileType(TILE_TYPE_418, *puVar3 + TILE_POS(-1, -1), super->collisionLayer);
SetTileType(TILE_TYPE_419, *puVar3 + TILE_POS(0, -1), super->collisionLayer);
SetTileType(TILE_TYPE_420, *puVar3 + TILE_POS(1, -1), super->collisionLayer);
SetTileType(TILE_TYPE_421, *puVar3 + TILE_POS(-1, 0), super->collisionLayer);
SetTileType(TILE_TYPE_422, *puVar3 + TILE_POS(0, 0), super->collisionLayer);
SetTileType(TILE_TYPE_423, *puVar3 + TILE_POS(1, 0), super->collisionLayer);
SetTileType(TILE_TYPE_424, *puVar3 + TILE_POS(-1, 1), super->collisionLayer);
SetTileType(TILE_TYPE_425, *puVar3 + TILE_POS(0, 1), super->collisionLayer);
SetTileType(TILE_TYPE_426, *puVar3 + TILE_POS(1, 1), super->collisionLayer);
}
}
void HiddenLadderDown_Action1(HiddenLadderDownEntity* this) {
if (GetMetaTileType(this->unk_70, super->collisionLayer) == 0x1a6) {
if (GetTileType(this->unk_70, super->collisionLayer) == 0x1a6) {
super->action = 2;
super->spriteSettings.draw = TRUE;
SetFlag(this->unk_86);
+2 -2
View File
@@ -218,7 +218,7 @@ void sub_08081188(ItemOnGroundEntity* this) {
void sub_080811AC(ItemOnGroundEntity* this) {
super->action = 2;
super->spriteSettings.draw = 0;
this->unk_6e = GetMetaTileTypeByEntity(super);
this->unk_6e = GetTileTypeByEntity(super);
}
void sub_080811C8(ItemOnGroundEntity* this) {
@@ -285,7 +285,7 @@ void sub_080812A0(ItemOnGroundEntity* this) {
void sub_080812A8(ItemOnGroundEntity* this) {
if (GetCollisionDataAtEntity(super) != COLLISION_DATA_15 &&
this->unk_6e != GetMetaTileTypeByEntity(super)) {
this->unk_6e != GetTileTypeByEntity(super)) {
super->direction = 0;
super->speed = 0;
super->spriteSettings.draw = 1;
+12 -12
View File
@@ -68,32 +68,32 @@ void JailBars_Action3(JailBarsEntity* this) {
static void SetJailBarTiles(JailBarsEntity* this, u32 arg1) {
static const s16 gUnk_08124960[] = {
SPECIAL_META_TILE_35,
SPECIAL_TILE_35,
-0x3,
SPECIAL_META_TILE_35,
SPECIAL_TILE_35,
-0x2,
SPECIAL_META_TILE_35,
SPECIAL_TILE_35,
-0x1,
SPECIAL_META_TILE_35,
SPECIAL_TILE_35,
0x0,
SPECIAL_META_TILE_35,
SPECIAL_TILE_35,
0x1,
SPECIAL_META_TILE_35,
SPECIAL_TILE_35,
0x2,
-0x1,
};
static const s16 gUnk_0812497A[] = {
SPECIAL_META_TILE_35,
SPECIAL_TILE_35,
-0x3,
SPECIAL_META_TILE_35,
SPECIAL_TILE_35,
-0x2,
SPECIAL_META_TILE_136,
SPECIAL_TILE_136,
-0x1,
SPECIAL_META_TILE_135,
SPECIAL_TILE_135,
0x0,
SPECIAL_META_TILE_35,
SPECIAL_TILE_35,
0x1,
SPECIAL_META_TILE_35,
SPECIAL_TILE_35,
0x2,
-0x1,
};
+4 -4
View File
@@ -182,10 +182,10 @@ void sub_0808C13C(JarPortalEntity* this) {
void sub_0808C148(JarPortalEntity* this, bool32 setTiles) {
u32 tilePos = COORD_TO_TILE(super);
if (!setTiles) {
SetMetaTile(SPECIAL_META_TILE_146, tilePos + TILE_POS(-1, 0), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_147, tilePos + TILE_POS(0, 0), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_148, tilePos + TILE_POS(-1, 1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_149, tilePos + TILE_POS(0, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_146, tilePos + TILE_POS(-1, 0), super->collisionLayer);
SetTile(SPECIAL_TILE_147, tilePos + TILE_POS(0, 0), super->collisionLayer);
SetTile(SPECIAL_TILE_148, tilePos + TILE_POS(-1, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_149, tilePos + TILE_POS(0, 1), super->collisionLayer);
} else {
RestorePrevTileEntity(tilePos + TILE_POS(-1, 0), super->collisionLayer);
RestorePrevTileEntity(tilePos + 0, super->collisionLayer);
+7 -7
View File
@@ -38,7 +38,7 @@ void LadderUp(Entity* this) {
return;
}
this->y.HALF.HI = (this->y.HALF.HI & 0xfff0) + 0xc;
SetMetaTile(SPECIAL_META_TILE_35, COORD_TO_TILE(this), this->collisionLayer);
SetTile(SPECIAL_TILE_35, COORD_TO_TILE(this), this->collisionLayer);
break;
case 1:
if (GravityUpdate(this, Q_8_8(16.0)) == 0) {
@@ -67,17 +67,17 @@ void LadderUp(Entity* this) {
if (this->type2 == 0) {
if (gPlayerEntity.base.y.HALF.HI < this->y.HALF.HI) {
if (gPlayerState.floor_type != SURFACE_LADDER &&
(GetMetaTileTypeByEntity(this) == SPECIAL_META_TILE_23)) {
SetMetaTile(SPECIAL_META_TILE_35, COORD_TO_TILE(this), this->collisionLayer);
(GetTileTypeByEntity(this) == SPECIAL_TILE_23)) {
SetTile(SPECIAL_TILE_35, COORD_TO_TILE(this), this->collisionLayer);
RestorePrevTileEntity(COORD_TO_TILE_OFFSET(this, 0, 16), this->collisionLayer);
}
} else {
if (GetMetaTileTypeByEntity(this) != SPECIAL_META_TILE_23) {
SetMetaTile(SPECIAL_META_TILE_23, COORD_TO_TILE(this), this->collisionLayer);
if (GetTileTypeByEntity(this) != SPECIAL_TILE_23) {
SetTile(SPECIAL_TILE_23, COORD_TO_TILE(this), this->collisionLayer);
if (this->type == 0) {
SetMetaTile(SPECIAL_META_TILE_23, COORD_TO_TILE_OFFSET(this, 0, 16), this->collisionLayer);
SetTile(SPECIAL_TILE_23, COORD_TO_TILE_OFFSET(this, 0, 16), this->collisionLayer);
} else {
SetMetaTile(SPECIAL_META_TILE_20, COORD_TO_TILE_OFFSET(this, 0, 16), this->collisionLayer);
SetTile(SPECIAL_TILE_20, COORD_TO_TILE_OFFSET(this, 0, 16), this->collisionLayer);
}
}
}
+9 -9
View File
@@ -88,13 +88,13 @@ void LightDoor_Action4(LightDoorEntity* this) {
void sub_080850FC(LightDoorEntity* this) {
u32 tilePos = COORD_TO_TILE(super);
u32 layer = super->collisionLayer;
SetMetaTile(SPECIAL_META_TILE_61, tilePos + TILE_POS(-1, -1), layer);
SetMetaTile(SPECIAL_META_TILE_61, tilePos + TILE_POS(0, -1), layer);
SetMetaTile(SPECIAL_META_TILE_61, tilePos + TILE_POS(1, -1), layer);
SetMetaTile(SPECIAL_META_TILE_61, tilePos + TILE_POS(-1, 0), layer);
SetMetaTile(SPECIAL_META_TILE_61, tilePos + TILE_POS(0, 0), layer);
SetMetaTile(SPECIAL_META_TILE_61, tilePos + TILE_POS(1, 0), layer);
SetMetaTile(SPECIAL_META_TILE_61, tilePos + TILE_POS(-1, 1), layer);
SetMetaTile(SPECIAL_META_TILE_61, tilePos + TILE_POS(0, 1), layer);
SetMetaTile(SPECIAL_META_TILE_61, tilePos + TILE_POS(1, 1), layer);
SetTile(SPECIAL_TILE_61, tilePos + TILE_POS(-1, -1), layer);
SetTile(SPECIAL_TILE_61, tilePos + TILE_POS(0, -1), layer);
SetTile(SPECIAL_TILE_61, tilePos + TILE_POS(1, -1), layer);
SetTile(SPECIAL_TILE_61, tilePos + TILE_POS(-1, 0), layer);
SetTile(SPECIAL_TILE_61, tilePos + TILE_POS(0, 0), layer);
SetTile(SPECIAL_TILE_61, tilePos + TILE_POS(1, 0), layer);
SetTile(SPECIAL_TILE_61, tilePos + TILE_POS(-1, 1), layer);
SetTile(SPECIAL_TILE_61, tilePos + TILE_POS(0, 1), layer);
SetTile(SPECIAL_TILE_61, tilePos + TILE_POS(1, 1), layer);
}
+1 -1
View File
@@ -100,7 +100,7 @@ static void sub_0809EAD8(LightableSwitchEntity* this) {
UpdateRailMovement(super, (u16**)&super->child, &this->unk_74);
} else {
SetMetaTile(SPECIAL_META_TILE_80, COORD_TO_TILE(super), super->collisionLayer);
SetTile(SPECIAL_TILE_80, COORD_TO_TILE(super), super->collisionLayer);
}
}
+5 -5
View File
@@ -45,8 +45,8 @@ void LinkEmptyingBottle_Init(LinkEmptyingBottleEntity* this) {
gUnk_08122A18[gPlayerEntity.base.animationState | 1] << 0x10);
}
CopyPosition(super->child, super);
sub_08094980(this, SPECIAL_META_TILE_50, SPECIAL_META_TILE_51);
sub_08094980(this, SPECIAL_META_TILE_97, SPECIAL_META_TILE_34);
sub_08094980(this, SPECIAL_TILE_50, SPECIAL_TILE_51);
sub_08094980(this, SPECIAL_TILE_97, SPECIAL_TILE_34);
break;
case 1:
effect = CreateFx(super, FX_GREEN_SPLASH2, 0);
@@ -61,8 +61,8 @@ void LinkEmptyingBottle_Init(LinkEmptyingBottleEntity* this) {
super->timer = 0;
super->spritePriority.b0 = 0;
super->spriteRendering.b3 = 0;
sub_08094980(this, SPECIAL_META_TILE_59, SPECIAL_META_TILE_60);
sub_08094980(this, SPECIAL_META_TILE_97, SPECIAL_META_TILE_34);
sub_08094980(this, SPECIAL_TILE_59, SPECIAL_TILE_60);
sub_08094980(this, SPECIAL_TILE_97, SPECIAL_TILE_34);
return;
}
break;
@@ -119,7 +119,7 @@ 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)) {
SetMetaTile(replaceTileIndex, TILE(super->x.HALF.HI + xOffset, super->y.HALF.HI + yOffset),
SetTile(replaceTileIndex, TILE(super->x.HALF.HI + xOffset, super->y.HALF.HI + yOffset),
super->collisionLayer);
}
index += 2;

Some files were not shown because too many files have changed in this diff Show More