mirror of
https://github.com/zeldaret/tmc
synced 2026-08-27 08:27:43 -04:00
Merge branch 'zeldaret:master' into master
This commit is contained in:
+140
-141
@@ -11,21 +11,20 @@
|
||||
#include "game.h"
|
||||
#include "object.h"
|
||||
#include "sound.h"
|
||||
#include "tiles.h"
|
||||
|
||||
u32 sub_0805BFC4(u32, u32);
|
||||
void sub_0805C02C(BombableWallManager*);
|
||||
|
||||
extern u32 sub_080B1AE0(u16, u8);
|
||||
u32 BombableWallManager_GetBombableType(u32 tilePos, u32 layer);
|
||||
void BombableWallManager_DestroyWall(BombableWallManager*);
|
||||
|
||||
u32 getArchwayType(void);
|
||||
void BombableWallManager_Init(BombableWallManager*);
|
||||
void BombableWallManager_Action1(BombableWallManager*);
|
||||
void BombableWallManager_Action2(BombableWallManager*);
|
||||
void sub_0805C050(u32, u32);
|
||||
void sub_0805C178(u32, u32);
|
||||
void sub_0805C294(u32, u32);
|
||||
void sub_0805C3B4(u32, u32);
|
||||
void sub_0805C4E0(u32, u32);
|
||||
void BombableWallManager_DestroyWall0(u32, u32);
|
||||
void BombableWallManager_DestroyWall1(u32, u32);
|
||||
void BombableWallManager_DestroyWall2(u32, u32);
|
||||
void BombableWallManager_DestroyWall3(u32, u32);
|
||||
void BombableWallManager_DestroyWall4(u32, u32);
|
||||
|
||||
void BombableWallManager_Main(BombableWallManager* this) {
|
||||
static void (*const BombableWallManager_Actions[])(BombableWallManager*) = {
|
||||
@@ -38,20 +37,20 @@ void BombableWallManager_Main(BombableWallManager* this) {
|
||||
|
||||
void BombableWallManager_Init(BombableWallManager* this) {
|
||||
super->action = 1;
|
||||
this->tile = (this->x >> 4 & 0x3fU) | (((this->y << 0x10) >> 0x14 & 0x3fU) << 6);
|
||||
super->type = sub_0805BFC4(this->tile, this->field_0x35);
|
||||
if (CheckLocalFlag(this->field_0x3e) != 0) {
|
||||
sub_0805C02C(this);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
void BombableWallManager_Action1(BombableWallManager* this) {
|
||||
if (sub_080B1AE0(this->tile, this->field_0x35) != 0x2e) {
|
||||
if (GetActTileAtTilePos(this->tilePos, this->layer) != ACT_TILE_46) {
|
||||
super->action = 2;
|
||||
super->timer = 90;
|
||||
sub_0805C02C(this);
|
||||
SetLocalFlag(this->field_0x3e);
|
||||
BombableWallManager_DestroyWall(this);
|
||||
SetLocalFlag(this->flag);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,155 +61,155 @@ void BombableWallManager_Action2(BombableWallManager* this) {
|
||||
}
|
||||
}
|
||||
|
||||
u32 sub_0805BFC4(u32 pos, u32 layer) {
|
||||
u32 tileType = GetTileType(pos, layer);
|
||||
u32 BombableWallManager_GetBombableType(u32 tilePos, u32 layer) {
|
||||
u32 tileType = GetTileTypeAtTilePos(tilePos, layer);
|
||||
|
||||
switch (tileType) {
|
||||
case 0xec:
|
||||
case TILE_TYPE_236:
|
||||
return 1;
|
||||
case 0xbf:
|
||||
case TILE_TYPE_191:
|
||||
return 4;
|
||||
case 0xaf:
|
||||
case TILE_TYPE_175:
|
||||
return 0;
|
||||
case 0xcc:
|
||||
case TILE_TYPE_204:
|
||||
return 2;
|
||||
case 0xdf:
|
||||
case TILE_TYPE_223:
|
||||
return 3;
|
||||
case 0xff:
|
||||
case TILE_TYPE_255:
|
||||
return 0;
|
||||
case 0x115:
|
||||
case TILE_TYPE_277:
|
||||
return 1;
|
||||
case 0x108:
|
||||
case TILE_TYPE_264:
|
||||
return 2;
|
||||
case 0x110:
|
||||
case TILE_TYPE_272:
|
||||
return 3;
|
||||
case 0x105:
|
||||
case TILE_TYPE_261:
|
||||
return 4;
|
||||
}
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
void sub_0805C02C(BombableWallManager* this) {
|
||||
void BombableWallManager_DestroyWall(BombableWallManager* this) {
|
||||
static void (*const gUnk_08108CE8[])(u32, u32) = {
|
||||
sub_0805C050, sub_0805C178, sub_0805C294, sub_0805C3B4, sub_0805C4E0,
|
||||
BombableWallManager_DestroyWall0, BombableWallManager_DestroyWall1, BombableWallManager_DestroyWall2,
|
||||
BombableWallManager_DestroyWall3, BombableWallManager_DestroyWall4,
|
||||
};
|
||||
if (super->type != 0xff) {
|
||||
gUnk_08108CE8[super->type](this->tile, this->field_0x35);
|
||||
gUnk_08108CE8[super->type](this->tilePos, this->layer);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805C050(u32 pos, u32 layer) {
|
||||
SetTileType(0xb1, pos - 0x41, layer);
|
||||
SetTileType(0xb2, pos - 0x40, layer);
|
||||
SetTileType(0xb3, pos - 0x3f, layer);
|
||||
SetTileType(0xb4, pos - 1, layer);
|
||||
SetTileType(0xb7, pos + 1, layer);
|
||||
if (layer == 1) {
|
||||
if (AreaHasEnemies() != 0) {
|
||||
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 = ((pos & 0x3f) << 4) + 8 + gRoomControls.origin_x;
|
||||
object->y.HALF.HI = ((pos & 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;
|
||||
}
|
||||
SetTileType(0xb5, pos, 1);
|
||||
SetTileType(TILE_TYPE_181, tilePos, LAYER_BOTTOM);
|
||||
} else {
|
||||
if (AreaIsDungeon() != 0) {
|
||||
SetTileType(0xb5, pos, 1);
|
||||
if (AreaIsDungeon()) {
|
||||
SetTileType(TILE_TYPE_181, tilePos, LAYER_BOTTOM);
|
||||
} else {
|
||||
SetTileType(0xb6, pos, 1);
|
||||
SetTileType(TILE_TYPE_182, tilePos, LAYER_BOTTOM);
|
||||
}
|
||||
}
|
||||
|
||||
SetTileType(0xb8, pos - 0x41, 2);
|
||||
SetTileType(0xb9, pos - 0x40, 2);
|
||||
SetTileType(0xba, pos - 0x3f, 2);
|
||||
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;
|
||||
SetTileType(0xb5, pos, 2);
|
||||
if (AreaIsDungeon() == 0) {
|
||||
SetTileType(TILE_TYPE_181, tilePos, LAYER_TOP);
|
||||
if (!AreaIsDungeon()) {
|
||||
return;
|
||||
}
|
||||
object = CreateObject(ARCHWAY, getArchwayType(), 6);
|
||||
if (object == NULL) {
|
||||
return;
|
||||
}
|
||||
object->x.HALF.HI = ((pos & 0x3f) << 4) + 8 + gRoomControls.origin_x;
|
||||
object->y.HALF.HI = ((pos & 0xfc0) >> 2) - 0x10 + gRoomControls.origin_y;
|
||||
object->collisionLayer = 2;
|
||||
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 sub_0805C178(u32 pos, u32 layer) {
|
||||
void BombableWallManager_DestroyWall1(u32 tilePos, u32 layer) {
|
||||
Entity* object;
|
||||
|
||||
SetTileType(0xf1, pos - 0x40, layer);
|
||||
SetTileType(0xf5, pos - 0x3f, layer);
|
||||
SetTileType(0xf6, pos + 1, layer);
|
||||
SetTileType(0xf4, pos + 0x40, layer);
|
||||
SetTileType(0xf7, pos + 0x41, layer);
|
||||
if (layer == 1) {
|
||||
|
||||
if (AreaHasEnemies() != 0) {
|
||||
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 = ((pos & 0x3f) << 4) + 0x18 + gRoomControls.origin_x;
|
||||
object->y.HALF.HI = ((pos & 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;
|
||||
}
|
||||
SetTileType(0xf2, pos, 1);
|
||||
SetTileType(TILE_TYPE_242, tilePos, LAYER_BOTTOM);
|
||||
} else {
|
||||
if (AreaIsDungeon() != 0) {
|
||||
SetTileType(0xf2, pos, 1);
|
||||
if (AreaIsDungeon()) {
|
||||
SetTileType(TILE_TYPE_242, tilePos, LAYER_BOTTOM);
|
||||
} else {
|
||||
SetTileType(0xf3, pos, 1);
|
||||
SetTileType(TILE_TYPE_243, tilePos, LAYER_BOTTOM);
|
||||
}
|
||||
}
|
||||
SetTileType(0xf8, pos - 0x3f, 2);
|
||||
SetTileType(0xf9, pos + 1, 2);
|
||||
SetTileType(0xfa, pos + 0x41, 2);
|
||||
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 {
|
||||
SetTileType(0xf2, pos, 2);
|
||||
if (AreaIsDungeon() == 0) {
|
||||
SetTileType(TILE_TYPE_242, tilePos, LAYER_TOP);
|
||||
if (!AreaIsDungeon()) {
|
||||
return;
|
||||
}
|
||||
object = CreateObject(ARCHWAY, getArchwayType(), 7);
|
||||
if (object == NULL) {
|
||||
return;
|
||||
}
|
||||
object->x.HALF.HI = ((pos & 0x3f) << 4) + 0x20 + gRoomControls.origin_x;
|
||||
object->y.HALF.HI = ((pos & 0xfc0) >> 2) + 8 + gRoomControls.origin_y;
|
||||
object->collisionLayer = 2;
|
||||
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 sub_0805C294(u32 pos, u32 layer) {
|
||||
void BombableWallManager_DestroyWall2(u32 tilePos, u32 layer) {
|
||||
Entity* object;
|
||||
|
||||
SetTileType(0xd1, pos - 1, layer);
|
||||
SetTileType(0xd4, pos + 1, layer);
|
||||
SetTileType(0xd5, pos + 0x3f, layer);
|
||||
SetTileType(0xd6, pos + 0x40, layer);
|
||||
SetTileType(0xd7, pos + 0x41, layer);
|
||||
if (layer == 1) {
|
||||
if (AreaHasEnemies() != 0) {
|
||||
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 = ((pos & 0x3f) << 4) + 8 + gRoomControls.origin_x;
|
||||
object->y.HALF.HI = ((pos & 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;
|
||||
}
|
||||
SetTileType(0xd2, pos, 1);
|
||||
SetTileType(TILE_TYPE_210, tilePos, LAYER_BOTTOM);
|
||||
} else {
|
||||
if (AreaIsDungeon() != 0) {
|
||||
SetTileType(0xd2, pos, 1);
|
||||
if (AreaIsDungeon()) {
|
||||
SetTileType(TILE_TYPE_210, tilePos, LAYER_BOTTOM);
|
||||
} else {
|
||||
SetTileType(0xd3, pos, 1);
|
||||
SetTileType(TILE_TYPE_211, tilePos, LAYER_BOTTOM);
|
||||
}
|
||||
}
|
||||
SetTileType(0xd8, pos + 0x3f, 2);
|
||||
SetTileType(0xd9, pos + 0x40, 2);
|
||||
SetTileType(0xda, pos + 0x41, 2);
|
||||
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 {
|
||||
SetTileType(0xd2, pos, 2);
|
||||
SetTileType(TILE_TYPE_210, tilePos, LAYER_TOP);
|
||||
if (AreaIsDungeon() == 0) {
|
||||
return;
|
||||
}
|
||||
@@ -218,41 +217,41 @@ void sub_0805C294(u32 pos, u32 layer) {
|
||||
if (object == NULL) {
|
||||
return;
|
||||
}
|
||||
object->x.HALF.HI = ((pos & 0x3f) << 4) + 8 + gRoomControls.origin_x;
|
||||
object->y.HALF.HI = ((pos & 0xfc0) >> 2) + 0x20 + gRoomControls.origin_y;
|
||||
object->collisionLayer = 2;
|
||||
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 sub_0805C3B4(u32 pos, u32 layer) {
|
||||
void BombableWallManager_DestroyWall3(u32 tilePos, u32 layer) {
|
||||
Entity* object;
|
||||
|
||||
SetTileType(0xe1, pos - 0x41, layer);
|
||||
SetTileType(0xe4, pos - 0x40, layer);
|
||||
SetTileType(0xe2, pos - 1, layer);
|
||||
SetTileType(0xe3, pos + 0x3f, layer);
|
||||
SetTileType(0xe7, pos + 0x40, layer);
|
||||
if (layer == 1) {
|
||||
if (AreaHasEnemies() != 0) {
|
||||
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 = ((pos & 0x3f) << 4) + -0x10 + gRoomControls.origin_x;
|
||||
object->y.HALF.HI = ((pos & 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;
|
||||
}
|
||||
SetTileType(0xe5, pos, 1);
|
||||
SetTileType(TILE_TYPE_229, tilePos, LAYER_BOTTOM);
|
||||
} else {
|
||||
if (AreaIsDungeon() != 0) {
|
||||
SetTileType(0xe5, pos, 1);
|
||||
if (AreaIsDungeon()) {
|
||||
SetTileType(TILE_TYPE_229, tilePos, LAYER_BOTTOM);
|
||||
} else {
|
||||
SetTileType(0xe6, pos, 1);
|
||||
SetTileType(TILE_TYPE_230, tilePos, LAYER_BOTTOM);
|
||||
}
|
||||
}
|
||||
SetTileType(0xe8, pos - 0x41, 2);
|
||||
SetTileType(0xe9, pos - 1, 2);
|
||||
SetTileType(0xea, pos + 0x3f, 2);
|
||||
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 {
|
||||
SetTileType(0xe5, pos, 2);
|
||||
if (AreaIsDungeon() == 0) {
|
||||
SetTileType(TILE_TYPE_229, tilePos, LAYER_TOP);
|
||||
if (!AreaIsDungeon()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -260,41 +259,41 @@ void sub_0805C3B4(u32 pos, u32 layer) {
|
||||
if (object == NULL) {
|
||||
return;
|
||||
}
|
||||
object->x.HALF.HI = ((pos & 0x3f) << 4) + -0x10 + gRoomControls.origin_x;
|
||||
object->y.HALF.HI = ((pos & 0xfc0) >> 2) + 8 + gRoomControls.origin_y;
|
||||
object->collisionLayer = 2;
|
||||
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 sub_0805C4E0(u32 pos, u32 layer) {
|
||||
void BombableWallManager_DestroyWall4(u32 tilePos, u32 layer) {
|
||||
Entity* object;
|
||||
|
||||
SetTileType(0xc1, pos - 0x41, layer);
|
||||
SetTileType(0xc2, pos - 0x40, layer);
|
||||
SetTileType(0xc3, pos - 0x3f, layer);
|
||||
SetTileType(0xc4, pos - 1, layer);
|
||||
SetTileType(0xc7, pos + 1, layer);
|
||||
if (layer == 1) {
|
||||
if (AreaHasEnemies() != 0) {
|
||||
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 = ((pos & 0x3f) << 4) + 8 + gRoomControls.origin_x;
|
||||
object->y.HALF.HI = ((pos & 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;
|
||||
}
|
||||
SetTileType(0xc5, pos, 1);
|
||||
SetTileType(TILE_TYPE_197, tilePos, LAYER_BOTTOM);
|
||||
} else {
|
||||
if (AreaIsDungeon() != 0) {
|
||||
SetTileType(0xc5, pos, 1);
|
||||
if (AreaIsDungeon()) {
|
||||
SetTileType(TILE_TYPE_197, tilePos, LAYER_BOTTOM);
|
||||
} else {
|
||||
SetTileType(0xc6, pos, 1);
|
||||
SetTileType(TILE_TYPE_198, tilePos, LAYER_BOTTOM);
|
||||
}
|
||||
}
|
||||
SetTileType(0xc8, pos - 0x41, 2);
|
||||
SetTileType(0xc9, pos - 0x40, 2);
|
||||
SetTileType(0xca, pos - 0x3f, 2);
|
||||
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 {
|
||||
SetTileType(0xc5, pos, 2);
|
||||
if (AreaIsDungeon() == 0) {
|
||||
SetTileType(TILE_TYPE_197, tilePos, LAYER_TOP);
|
||||
if (!AreaIsDungeon()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -302,9 +301,9 @@ void sub_0805C4E0(u32 pos, u32 layer) {
|
||||
if (object == NULL) {
|
||||
return;
|
||||
}
|
||||
object->x.HALF.HI = ((pos & 0x3f) << 4) + 8 + gRoomControls.origin_x;
|
||||
object->y.HALF.HI = ((pos & 0xfc0) >> 2) + -0x10 + gRoomControls.origin_y;
|
||||
object->collisionLayer = 2;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ void DestructibleTileObserveManager_Main(DestructibleTileObserveManager* this) {
|
||||
|
||||
void sub_0805CFF0(DestructibleTileObserveManager_unk* param_1) {
|
||||
if (!CheckLocalFlag(param_1->flag)) {
|
||||
u32 tileType = GetTileType(param_1->tilePos, param_1->tileLayer);
|
||||
u32 tileType = GetTileTypeAtTilePos(param_1->tilePos, param_1->tileLayer);
|
||||
if (param_1->tileType == tileType) {
|
||||
SetLocalFlag(param_1->flag);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "player.h"
|
||||
#include "room.h"
|
||||
#include "scroll.h"
|
||||
#include "tiles.h"
|
||||
|
||||
void DiggingCaveEntranceManager_Main(DiggingCaveEntranceManager*);
|
||||
void DiggingCaveEntranceManager_Init(DiggingCaveEntranceManager*);
|
||||
@@ -31,7 +32,7 @@ void DiggingCaveEntranceManager_Init(DiggingCaveEntranceManager* this) {
|
||||
const DiggingCaveEntrance* entrance;
|
||||
u8 room;
|
||||
u8 area;
|
||||
u16 tile = 0x81 << 7;
|
||||
u16 tileIndex = SPECIAL_TILE_128;
|
||||
UpdateIsDiggingCave();
|
||||
if (gDiggingCaveEntranceTransition.isDiggingCave) {
|
||||
if (gDiggingCaveEntranceTransition.entrance == NULL) {
|
||||
@@ -50,12 +51,12 @@ void DiggingCaveEntranceManager_Init(DiggingCaveEntranceManager* this) {
|
||||
}
|
||||
room = gRoomControls.room;
|
||||
entrance = diggingCaveEntrances[gRoomControls.area];
|
||||
tile = 0x81 << 7; // 0x4080
|
||||
tileIndex = SPECIAL_TILE_128;
|
||||
for (entrance = GetDiggingCaveEntranceForRoom(entrance, room); entrance != 0;
|
||||
entrance = GetDiggingCaveEntranceForRoom(entrance, room)) {
|
||||
SetBottomTile(tile, entrance->sourceTilePosition + TILE_POS(-1, 1), 1);
|
||||
SetBottomTile(tile, entrance->sourceTilePosition + TILE_POS(0, 1), 1);
|
||||
SetBottomTile(tile, entrance->sourceTilePosition + TILE_POS(1, 1), 1);
|
||||
SetTile(tileIndex, entrance->sourceTilePos + TILE_POS(-1, 1), LAYER_BOTTOM);
|
||||
SetTile(tileIndex, entrance->sourceTilePos + TILE_POS(0, 1), LAYER_BOTTOM);
|
||||
SetTile(tileIndex, entrance->sourceTilePos + TILE_POS(1, 1), LAYER_BOTTOM);
|
||||
entrance++;
|
||||
}
|
||||
}
|
||||
@@ -79,8 +80,8 @@ bool32 DiggingCaveEntranceManager_CheckEnterEntrance(DiggingCaveEntranceManager*
|
||||
if (gDiggingCaveEntranceTransition.isDiggingCave) {
|
||||
offsetX = gPlayerEntity.base.x.HALF.HI - gRoomControls.origin_x;
|
||||
offsetY = gPlayerEntity.base.y.HALF.HI - gRoomControls.origin_y;
|
||||
offsetX2 = (entr->sourceTilePosition & TILE_POS_X_COMPONENT) * 16 + 8;
|
||||
offsetY2 = ((entr->sourceTilePosition & TILE_POS_Y_COMPONENT) >> 6) * 16 + 0x18;
|
||||
offsetX2 = (entr->sourceTilePos & TILE_POS_X_COMPONENT) * 16 + 8;
|
||||
offsetY2 = ((entr->sourceTilePos & TILE_POS_Y_COMPONENT) >> 6) * 16 + 0x18;
|
||||
tmp = offsetX - offsetX2;
|
||||
if (tmp + 0x18 > 0x30 || offsetY - offsetY2 + 8 > 0x10U)
|
||||
return FALSE;
|
||||
@@ -89,9 +90,9 @@ bool32 DiggingCaveEntranceManager_CheckEnterEntrance(DiggingCaveEntranceManager*
|
||||
DiggingCaveEntranceManager_EnterEntrance(this, entr);
|
||||
return TRUE;
|
||||
} else {
|
||||
if (COORD_TO_TILE(&gPlayerEntity.base) != entr->sourceTilePosition)
|
||||
if (COORD_TO_TILE(&gPlayerEntity.base) != entr->sourceTilePos)
|
||||
return FALSE;
|
||||
offsetY2 = gRoomControls.origin_y + ((entr->sourceTilePosition >> 6) << 4) + 6;
|
||||
offsetY2 = gRoomControls.origin_y + ((entr->sourceTilePos >> 6) << 4) + 6;
|
||||
if (gPlayerEntity.base.y.HALF.HI >= offsetY2)
|
||||
return FALSE;
|
||||
DiggingCaveEntranceManager_EnterEntrance(this, entr);
|
||||
@@ -109,10 +110,10 @@ void DiggingCaveEntranceManager_EnterEntrance(DiggingCaveEntranceManager* this,
|
||||
gRoomControls.area = entr->targetArea;
|
||||
gRoomControls.room = entr->targetRoom;
|
||||
gDiggingCaveEntranceTransition.entrance = entr;
|
||||
gDiggingCaveEntranceTransition.offsetX = gPlayerEntity.base.x.HALF.HI - gRoomControls.origin_x -
|
||||
((entr->sourceTilePosition & TILE_POS_X_COMPONENT) * 16);
|
||||
gDiggingCaveEntranceTransition.offsetY = gPlayerEntity.base.y.HALF.HI - gRoomControls.origin_y -
|
||||
((entr->sourceTilePosition & TILE_POS_Y_COMPONENT) >> 2);
|
||||
gDiggingCaveEntranceTransition.offsetX =
|
||||
gPlayerEntity.base.x.HALF.HI - gRoomControls.origin_x - ((entr->sourceTilePos & TILE_POS_X_COMPONENT) * 16);
|
||||
gDiggingCaveEntranceTransition.offsetY =
|
||||
gPlayerEntity.base.y.HALF.HI - gRoomControls.origin_y - ((entr->sourceTilePos & TILE_POS_Y_COMPONENT) >> 2);
|
||||
|
||||
#ifndef EU
|
||||
isDiggingCave = gDiggingCaveEntranceTransition.isDiggingCave;
|
||||
@@ -129,7 +130,7 @@ void DiggingCaveEntranceManager_EnterEntrance(DiggingCaveEntranceManager* this,
|
||||
}
|
||||
|
||||
const DiggingCaveEntrance* GetDiggingCaveEntranceForRoom(const DiggingCaveEntrance* entr, int room) {
|
||||
for (; entr->sourceTilePosition != 0xffff; entr++) {
|
||||
for (; entr->sourceTilePos != 0xffff; entr++) {
|
||||
if (entr->sourceRoom == room)
|
||||
return entr;
|
||||
}
|
||||
@@ -141,85 +142,94 @@ const DiggingCaveEntrance* GetDiggingCaveEntranceForRoom(const DiggingCaveEntran
|
||||
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesEmpty[] = { END_OF_LIST };
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesMinishWoods[] = {
|
||||
{ TILE_POS(37, 19), ROOM_MINISH_WOODS_MAIN, 0x0, AREA_LAKE_WOODS_CAVE, ROOM_LAKE_WOODS_CAVE_MAIN,
|
||||
{ TILE_POS(37, 19), ROOM_MINISH_WOODS_MAIN, CAVE_LAKE_WOODS_ENTER, AREA_LAKE_WOODS_CAVE, ROOM_LAKE_WOODS_CAVE_MAIN,
|
||||
TILE_POS(37, 51) },
|
||||
{ TILE_POS(31, 15), ROOM_MINISH_WOODS_MAIN, 0x0, AREA_LAKE_WOODS_CAVE, ROOM_LAKE_WOODS_CAVE_MAIN,
|
||||
{ TILE_POS(31, 15), ROOM_MINISH_WOODS_MAIN, CAVE_LAKE_WOODS_ENTER, AREA_LAKE_WOODS_CAVE, ROOM_LAKE_WOODS_CAVE_MAIN,
|
||||
TILE_POS(31, 47) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesHyruleField[] = {
|
||||
{ TILE_POS(3, 11), ROOM_HYRULE_FIELD_EASTERN_HILLLS_NORTH, 0x4, AREA_DIG_CAVES, ROOM_DIG_CAVES_EASTERN_HILLS,
|
||||
TILE_POS(3, 11) },
|
||||
{ TILE_POS(35, 5), ROOM_HYRULE_FIELD_LON_LON_RANCH, 0x10, AREA_HYLIA_DIG_CAVES, ROOM_HYLIA_DIG_CAVES_1,
|
||||
TILE_POS(8, 17) },
|
||||
{ TILE_POS(5, 14), ROOM_HYRULE_FIELD_TRILBY_HIGHLANDS, 0xa, AREA_DIG_CAVES, ROOM_DIG_CAVES_TRILBY_HIGHLANDS,
|
||||
TILE_POS(5, 14) },
|
||||
{ TILE_POS(16, 14), ROOM_HYRULE_FIELD_TRILBY_HIGHLANDS, 0xa, AREA_DIG_CAVES, ROOM_DIG_CAVES_TRILBY_HIGHLANDS,
|
||||
TILE_POS(16, 14) },
|
||||
{ TILE_POS(3, 11), ROOM_HYRULE_FIELD_EASTERN_HILLS_NORTH, CAVE_EASTERN_HILL_ENTER, AREA_DIG_CAVES,
|
||||
ROOM_DIG_CAVES_EASTERN_HILLS, TILE_POS(3, 11) },
|
||||
{ TILE_POS(35, 5), ROOM_HYRULE_FIELD_LON_LON_RANCH, CAVE_LON_LON_RANCH_ENTER, AREA_HYLIA_DIG_CAVES,
|
||||
ROOM_HYLIA_DIG_CAVES_1, TILE_POS(8, 17) },
|
||||
{ TILE_POS(5, 14), ROOM_HYRULE_FIELD_TRILBY_HIGHLANDS, CAVE_TRILBY_HIGHLANDS_ENTER, AREA_DIG_CAVES,
|
||||
ROOM_DIG_CAVES_TRILBY_HIGHLANDS, TILE_POS(5, 14) },
|
||||
{ TILE_POS(16, 14), ROOM_HYRULE_FIELD_TRILBY_HIGHLANDS, CAVE_TRILBY_HIGHLANDS_ENTER, AREA_DIG_CAVES,
|
||||
ROOM_DIG_CAVES_TRILBY_HIGHLANDS, TILE_POS(16, 14) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesHyruleTown[] = { { TILE_POS(45, 24), ROOM_HYRULE_TOWN_MAIN, 0x2,
|
||||
AREA_HYRULE_DIG_CAVES,
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesHyruleTown[] = { { TILE_POS(45, 24), ROOM_HYRULE_TOWN_MAIN,
|
||||
CAVE_HYRULE_TOWN_ENTER, AREA_HYRULE_DIG_CAVES,
|
||||
ROOM_HYRULE_DIG_CAVES_TOWN, TILE_POS(45, 40) },
|
||||
END_OF_LIST };
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesMtCrenel[] = {
|
||||
{ TILE_POS(3, 5), ROOM_MT_CRENEL_WALL_CLIMB, 0x6, AREA_CRENEL_DIG_CAVE, ROOM_CRENEL_DIG_CAVE_0, TILE_POS(3, 25) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesMtCrenel[] = { { TILE_POS(3, 5), ROOM_MT_CRENEL_WALL_CLIMB,
|
||||
CAVE_CRENEL_ENTER, AREA_CRENEL_DIG_CAVE,
|
||||
ROOM_CRENEL_DIG_CAVE_0, TILE_POS(3, 25) },
|
||||
END_OF_LIST };
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesVeilFalls[] = {
|
||||
{ TILE_POS(26, 37), ROOM_VEIL_FALLS_MAIN, 0x8, AREA_VEIL_FALLS_DIG_CAVE, ROOM_VEIL_FALLS_DIG_CAVE_0,
|
||||
TILE_POS(26, 37) },
|
||||
{ TILE_POS(14, 39), ROOM_VEIL_FALLS_MAIN, 0x8, AREA_VEIL_FALLS_DIG_CAVE, ROOM_VEIL_FALLS_DIG_CAVE_0,
|
||||
TILE_POS(14, 39) },
|
||||
{ TILE_POS(26, 37), ROOM_VEIL_FALLS_MAIN, CAVE_VEIL_FALLS_ENTER, AREA_VEIL_FALLS_DIG_CAVE,
|
||||
ROOM_VEIL_FALLS_DIG_CAVE_0, TILE_POS(26, 37) },
|
||||
{ TILE_POS(14, 39), ROOM_VEIL_FALLS_MAIN, CAVE_VEIL_FALLS_ENTER, AREA_VEIL_FALLS_DIG_CAVE,
|
||||
ROOM_VEIL_FALLS_DIG_CAVE_0, TILE_POS(14, 39) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesCastorWilds[] = {
|
||||
{ TILE_POS(48, 25), ROOM_CASTOR_WILDS_MAIN, 0xc, AREA_CASTOR_WILDS_DIG_CAVE, ROOM_CASTOR_WILDS_DIG_CAVE_0,
|
||||
TILE_POS(48, 25) },
|
||||
{ TILE_POS(48, 25), ROOM_CASTOR_WILDS_MAIN, CAVE_CASTOR_WILDS_ENTER, AREA_CASTOR_WILDS_DIG_CAVE,
|
||||
ROOM_CASTOR_WILDS_DIG_CAVE_0, TILE_POS(48, 25) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesLakeHylia[] = {
|
||||
{ TILE_POS(30, 5), ROOM_LAKE_HYLIA_MAIN, 0xe, AREA_HYLIA_DIG_CAVES, ROOM_HYLIA_DIG_CAVES_1, TILE_POS(46, 17) },
|
||||
{ TILE_POS(30, 30), ROOM_LAKE_HYLIA_MAIN, 0x12, AREA_HYLIA_DIG_CAVES, ROOM_HYLIA_DIG_CAVES_0, TILE_POS(8, 9) },
|
||||
{ TILE_POS(30, 5), ROOM_LAKE_HYLIA_MAIN, CAVE_LAKE_HYLIA_NORTH_ENTER, AREA_HYLIA_DIG_CAVES, ROOM_HYLIA_DIG_CAVES_1,
|
||||
TILE_POS(46, 17) },
|
||||
{ TILE_POS(30, 30), ROOM_LAKE_HYLIA_MAIN, CAVE_LAKE_HYLIA_CENTER_ENTER, AREA_HYLIA_DIG_CAVES,
|
||||
ROOM_HYLIA_DIG_CAVES_0, TILE_POS(8, 9) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesLakeWoodsCave[] = {
|
||||
{ TILE_POS(37, 51), ROOM_LAKE_WOODS_CAVE_MAIN, 0x1, AREA_MINISH_WOODS, ROOM_MINISH_WOODS_MAIN, TILE_POS(37, 19) },
|
||||
{ TILE_POS(31, 47), ROOM_LAKE_WOODS_CAVE_MAIN, 0x1, AREA_MINISH_WOODS, ROOM_MINISH_WOODS_MAIN, TILE_POS(31, 15) },
|
||||
{ TILE_POS(37, 51), ROOM_LAKE_WOODS_CAVE_MAIN, CAVE_LAKE_WOODS_LEAVE, AREA_MINISH_WOODS, ROOM_MINISH_WOODS_MAIN,
|
||||
TILE_POS(37, 19) },
|
||||
{ TILE_POS(31, 47), ROOM_LAKE_WOODS_CAVE_MAIN, CAVE_LAKE_WOODS_LEAVE, AREA_MINISH_WOODS, ROOM_MINISH_WOODS_MAIN,
|
||||
TILE_POS(31, 15) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesHyruleDigCaves[] = {
|
||||
{ TILE_POS(45, 40), ROOM_HYRULE_DIG_CAVES_TOWN, 0x3, AREA_HYRULE_TOWN, ROOM_HYRULE_TOWN_MAIN, TILE_POS(45, 24) },
|
||||
{ TILE_POS(45, 40), ROOM_HYRULE_DIG_CAVES_TOWN, CAVE_HYRULE_TOWN_LEAVE, AREA_HYRULE_TOWN, ROOM_HYRULE_TOWN_MAIN,
|
||||
TILE_POS(45, 24) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesAreaDigCaves[] = {
|
||||
{ TILE_POS(3, 11), ROOM_DIG_CAVES_EASTERN_HILLS, 0x5, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_EASTERN_HILLLS_NORTH,
|
||||
TILE_POS(3, 11) },
|
||||
{ TILE_POS(5, 14), ROOM_DIG_CAVES_TRILBY_HIGHLANDS, 0xb, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_TRILBY_HIGHLANDS,
|
||||
TILE_POS(5, 14) },
|
||||
{ TILE_POS(16, 14), ROOM_DIG_CAVES_TRILBY_HIGHLANDS, 0xb, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_TRILBY_HIGHLANDS,
|
||||
TILE_POS(16, 14) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesCrenelDigCave[] = {
|
||||
{ TILE_POS(3, 25), ROOM_CRENEL_DIG_CAVE_0, 0x7, AREA_MT_CRENEL, ROOM_MT_CRENEL_WALL_CLIMB, TILE_POS(3, 5) },
|
||||
{ TILE_POS(3, 11), ROOM_DIG_CAVES_EASTERN_HILLS, CAVE_EASTERN_HILL_LEAVE, AREA_HYRULE_FIELD,
|
||||
ROOM_HYRULE_FIELD_EASTERN_HILLS_NORTH, TILE_POS(3, 11) },
|
||||
{ TILE_POS(5, 14), ROOM_DIG_CAVES_TRILBY_HIGHLANDS, CAVE_TRILBY_HIGHLANDS_LEAVE, AREA_HYRULE_FIELD,
|
||||
ROOM_HYRULE_FIELD_TRILBY_HIGHLANDS, TILE_POS(5, 14) },
|
||||
{ TILE_POS(16, 14), ROOM_DIG_CAVES_TRILBY_HIGHLANDS, CAVE_TRILBY_HIGHLANDS_LEAVE, AREA_HYRULE_FIELD,
|
||||
ROOM_HYRULE_FIELD_TRILBY_HIGHLANDS, TILE_POS(16, 14) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesCrenelDigCave[] = { { TILE_POS(3, 25), ROOM_CRENEL_DIG_CAVE_0,
|
||||
CAVE_CRENEL_LEAVE, AREA_MT_CRENEL,
|
||||
ROOM_MT_CRENEL_WALL_CLIMB, TILE_POS(3, 5) },
|
||||
END_OF_LIST };
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesVeilFallsDigCave[] = {
|
||||
{ TILE_POS(26, 37), ROOM_VEIL_FALLS_DIG_CAVE_0, 0x9, AREA_VEIL_FALLS, ROOM_VEIL_FALLS_MAIN, TILE_POS(26, 37) },
|
||||
{ TILE_POS(14, 39), ROOM_VEIL_FALLS_DIG_CAVE_0, 0x9, AREA_VEIL_FALLS, ROOM_VEIL_FALLS_MAIN, TILE_POS(14, 39) },
|
||||
{ TILE_POS(26, 37), ROOM_VEIL_FALLS_DIG_CAVE_0, CAVE_VEIL_FALLS_LEAVE, AREA_VEIL_FALLS, ROOM_VEIL_FALLS_MAIN,
|
||||
TILE_POS(26, 37) },
|
||||
{ TILE_POS(14, 39), ROOM_VEIL_FALLS_DIG_CAVE_0, CAVE_VEIL_FALLS_LEAVE, AREA_VEIL_FALLS, ROOM_VEIL_FALLS_MAIN,
|
||||
TILE_POS(14, 39) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesCastorWildsDigCave[] = {
|
||||
{ TILE_POS(48, 25), ROOM_CASTOR_WILDS_DIG_CAVE_0, 0xd, AREA_CASTOR_WILDS, ROOM_CASTOR_WILDS_MAIN,
|
||||
TILE_POS(48, 25) },
|
||||
{ TILE_POS(48, 25), ROOM_CASTOR_WILDS_DIG_CAVE_0, CAVE_CASTOR_WILDS_LEAVE, AREA_CASTOR_WILDS,
|
||||
ROOM_CASTOR_WILDS_MAIN, TILE_POS(48, 25) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesHyliaDigCaves[] = {
|
||||
{ TILE_POS(46, 17), ROOM_HYLIA_DIG_CAVES_1, 0xf, AREA_LAKE_HYLIA, ROOM_LAKE_HYLIA_MAIN, TILE_POS(30, 5) },
|
||||
{ TILE_POS(8, 17), ROOM_HYLIA_DIG_CAVES_1, 0x11, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_LON_LON_RANCH,
|
||||
TILE_POS(35, 5) },
|
||||
{ TILE_POS(8, 9), ROOM_HYLIA_DIG_CAVES_0, 0x13, AREA_LAKE_HYLIA, ROOM_LAKE_HYLIA_MAIN, TILE_POS(30, 30) },
|
||||
{ TILE_POS(46, 17), ROOM_HYLIA_DIG_CAVES_1, CAVE_LAKE_HYLIA_NORTH_LEAVE, AREA_LAKE_HYLIA, ROOM_LAKE_HYLIA_MAIN,
|
||||
TILE_POS(30, 5) },
|
||||
{ TILE_POS(8, 17), ROOM_HYLIA_DIG_CAVES_1, CAVE_LON_LON_RANCH_LEAVE, AREA_HYRULE_FIELD,
|
||||
ROOM_HYRULE_FIELD_LON_LON_RANCH, TILE_POS(35, 5) },
|
||||
{ TILE_POS(8, 9), ROOM_HYLIA_DIG_CAVES_0, CAVE_LAKE_HYLIA_CENTER_LEAVE, AREA_LAKE_HYLIA, ROOM_LAKE_HYLIA_MAIN,
|
||||
TILE_POS(30, 30) },
|
||||
END_OF_LIST
|
||||
};
|
||||
|
||||
|
||||
@@ -10,23 +10,24 @@
|
||||
#include "asm.h"
|
||||
#include "functions.h"
|
||||
#include "room.h"
|
||||
#include "tiles.h"
|
||||
|
||||
void FlameManager_Main(FlameManager* this) {
|
||||
if (super->action == 0) {
|
||||
this->field_0x38 = TILE(this->field_0x38, this->field_0x3a);
|
||||
if (GetTileType(this->field_0x38, 2) == 0x75) {
|
||||
this->x = TILE(this->x, this->y);
|
||||
if (GetTileTypeAtTilePos(this->x, LAYER_TOP) == TILE_TYPE_117) {
|
||||
super->action = 1;
|
||||
SetBottomTile(0x406a, this->field_0x38, 1);
|
||||
SetTile(SPECIAL_TILE_106, this->x, LAYER_BOTTOM);
|
||||
} else {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
if (GetTileType(this->field_0x38, 1) == 0x406b) {
|
||||
sub_0807B7D8(0x76, this->field_0x38, 2);
|
||||
if (GetTileTypeAtTilePos(this->x, LAYER_BOTTOM) == SPECIAL_TILE_107) {
|
||||
sub_0807B7D8(TILE_TYPE_118, this->x, LAYER_TOP);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
if (GetTileType(this->field_0x38, 2) == 0x76) {
|
||||
SetBottomTile(0x406b, this->field_0x38, 1);
|
||||
if (GetTileTypeAtTilePos(this->x, LAYER_TOP) == TILE_TYPE_118) {
|
||||
SetTile(SPECIAL_TILE_107, this->x, LAYER_BOTTOM);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
|
||||
extern void (*const HoleManager_Actions[])(HoleManager*);
|
||||
|
||||
extern u8 gGlobalGfxAndPalettes[];
|
||||
|
||||
void HoleManager_Main(HoleManager* this) {
|
||||
HoleManager_Actions[super->action](this);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
/**
|
||||
* @file hyruleTownTilesetManager.c
|
||||
* @file hyruleTownTileSetManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Swap tileset data in hyrule town depending on the position.
|
||||
* @brief Swap tileSet data in hyrule town depending on the position.
|
||||
*/
|
||||
#include "manager/hyruleTownTilesetManager.h"
|
||||
#include "manager/hyruleTownTileSetManager.h"
|
||||
#include "area.h"
|
||||
#include "asm.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "main.h"
|
||||
#include "room.h"
|
||||
#include "tiles.h"
|
||||
|
||||
void sub_08059A58(HyruleTownTilesetManager*);
|
||||
void sub_08059A2C(HyruleTownTilesetManager*);
|
||||
void sub_08059A58(HyruleTownTileSetManager*);
|
||||
void sub_08059A2C(HyruleTownTileSetManager*);
|
||||
|
||||
static const u16 gUnk_08108398[] = { 0x0, 0x0, 0x0, 0x3f0, 0x200, 0x1, 0x0, 0x280, 0x3f0, 0x140, 0xff };
|
||||
static const u16 gUnk_081083AE[] = { 0x2, 0x0, 0x0, 0x180, 0x3c0, 0x3, 0x280, 0x0, 0x170, 0x3c0, 0xff };
|
||||
@@ -24,7 +25,7 @@ static const u16 gUnk_081083F2[] = { 0x5, 0x0, 0x1b0, 0x190, 0x140, 0x4, 0x0, 0x
|
||||
void sub_08059CC0(u32, u32);
|
||||
void sub_08059B18(void);
|
||||
|
||||
bool32 sub_08059C8C(HyruleTownTilesetManager*, u32, u8*, const u16*);
|
||||
bool32 sub_08059C8C(HyruleTownTileSetManager*, u32, u8*, const u16*);
|
||||
|
||||
extern u32 gUnk_086E8460;
|
||||
|
||||
@@ -59,7 +60,7 @@ static const Unknown gUnk_08108468[] = {
|
||||
};
|
||||
extern const u8 gGlobalGfxAndPalettes[];
|
||||
|
||||
void HyruleTownTilesetManager_Main(HyruleTownTilesetManager* this) {
|
||||
void HyruleTownTileSetManager_Main(HyruleTownTileSetManager* this) {
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
this->field_0x22 = 0xff;
|
||||
@@ -71,7 +72,7 @@ void HyruleTownTilesetManager_Main(HyruleTownTilesetManager* this) {
|
||||
sub_08059A58(this);
|
||||
}
|
||||
|
||||
void sub_08059A2C(HyruleTownTilesetManager* this) {
|
||||
void sub_08059A2C(HyruleTownTileSetManager* this) {
|
||||
gRoomVars.graphicsGroups[2] = 0xff;
|
||||
gRoomVars.graphicsGroups[1] = 0xff;
|
||||
gRoomVars.graphicsGroups[0] = 0xff;
|
||||
@@ -81,7 +82,7 @@ void sub_08059A2C(HyruleTownTilesetManager* this) {
|
||||
sub_08059A58(this);
|
||||
}
|
||||
|
||||
void sub_08059A58(HyruleTownTilesetManager* this) {
|
||||
void sub_08059A58(HyruleTownTileSetManager* this) {
|
||||
if (gRoomControls.area != AREA_FESTIVAL_TOWN) {
|
||||
if (sub_08059C8C(this, 0, &this->field_0x20, gUnk_08108398) != 0) {
|
||||
sub_08059CC0(0, (u32)this->field_0x20);
|
||||
@@ -113,37 +114,37 @@ void sub_08059B18(void) {
|
||||
if (CheckGlobalFlag(TATEKAKE_HOUSE) != 0) {
|
||||
for (loopVar = 0; loopVar < 4; ++loopVar) {
|
||||
for (innerLoopVar = 0; innerLoopVar < 4; ++innerLoopVar) {
|
||||
sub_0807B9B8(loopVar * 0x10 + 0x4ab + innerLoopVar, COMMON(0x28 + 0x10 * innerLoopVar, loopVar * 0x10),
|
||||
1);
|
||||
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) {
|
||||
sub_0807B9B8(loopVar * 0x10 + 0x440 + innerLoopVar, COMMON(0x28 + 0x10 * innerLoopVar, loopVar * 0x10),
|
||||
2);
|
||||
SetTileByIndex(loopVar * 0x10 + TILE_TYPE_1088 + innerLoopVar,
|
||||
COMMON(0x28 + 0x10 * innerLoopVar, loopVar * 0x10), 2);
|
||||
}
|
||||
}
|
||||
sub_0807B9B8(0xd6, 0x5c2, 2);
|
||||
sub_0807B9B8(0xd7, 0x5c3, 2);
|
||||
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) {
|
||||
sub_0807B9B8(loopVar * 0x10 + 0x4a6 + innerLoopVar,
|
||||
COMMON(0x28 + 0x10 * innerLoopVar, loopVar * 0x10), 1);
|
||||
SetTileByIndex(loopVar * 0x10 + TILE_TYPE_1190 + innerLoopVar,
|
||||
COMMON(0x28 + 0x10 * innerLoopVar, loopVar * 0x10), 1);
|
||||
}
|
||||
}
|
||||
sub_0807B9B8(0x444, 0x602, 2);
|
||||
sub_0807B9B8(0x445, 0x605, 2);
|
||||
sub_0807B9B8(0x454, 0x642, 2);
|
||||
sub_0807B9B8(0x455, 0x645, 2);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool32 sub_08059C8C(HyruleTownTilesetManager* this, u32 param_2, u8* param_3, const u16* param_4) {
|
||||
bool32 sub_08059C8C(HyruleTownTileSetManager* this, u32 param_2, u8* param_3, const u16* param_4) {
|
||||
bool32 bVar2;
|
||||
|
||||
*param_3 = CheckRegionsOnScreen(param_4);
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "game.h"
|
||||
#include "object.h"
|
||||
#include "room.h"
|
||||
#include "tiles.h"
|
||||
|
||||
void sub_0805BE94(LightLevelSetManager*);
|
||||
void sub_0805BEC4(LightLevelSetManager*);
|
||||
@@ -17,7 +18,7 @@ void LightLevelSetManager_Type0(LightLevelSetManager*);
|
||||
void LightLevelSetManager_Type1(LightLevelSetManager*);
|
||||
void LightLevelSetManager_Type2(LightLevelSetManager*);
|
||||
void LightLevelSetManager_Type3(LightLevelSetManager*);
|
||||
void sub_0805BE70(LightLevelSetManager*, u32);
|
||||
void sub_0805BE70(LightLevelSetManager* this, u32 tileType);
|
||||
|
||||
void LightLevelSetManager_Main(Manager* this) {
|
||||
static void (*const LightLevelSetManager_Types[])(LightLevelSetManager*) = {
|
||||
@@ -49,7 +50,7 @@ void LightLevelSetManager_Type1(LightLevelSetManager* this) {
|
||||
super->action = 1;
|
||||
super->subtimer = 30;
|
||||
if (CheckFlags(this->field_0x3e) != 0) {
|
||||
sub_0805BE70(this, 0x75);
|
||||
sub_0805BE70(this, TILE_TYPE_117);
|
||||
super->action = 2;
|
||||
}
|
||||
break;
|
||||
@@ -57,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, 0x76);
|
||||
sub_0805BE70(this, TILE_TYPE_118);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (CheckFlags(this->field_0x3e) == 0 && --super->subtimer == 0) {
|
||||
super->subtimer = 30;
|
||||
sub_0805BE70(this, 0x75);
|
||||
sub_0805BE70(this, TILE_TYPE_117);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -78,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 (GetTileType(this->field_0x20, super->type2) == 0x76) {
|
||||
if (GetTileTypeAtTilePos(this->field_0x20, super->type2) == TILE_TYPE_118) {
|
||||
SetFlag(this->field_0x3e);
|
||||
ChangeLightLevel(super->timer);
|
||||
DeleteThisEntity();
|
||||
@@ -102,7 +103,7 @@ void LightLevelSetManager_Type3(LightLevelSetManager* this) {
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if (GetTileType(this->field_0x20, super->type2) != 0x76) {
|
||||
if (GetTileTypeAtTilePos(this->field_0x20, super->type2) != TILE_TYPE_118) {
|
||||
return;
|
||||
}
|
||||
SetFlag(this->field_0x3e);
|
||||
@@ -130,14 +131,15 @@ void LightLevelSetManager_Type3(LightLevelSetManager* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805BE70(LightLevelSetManager* this, u32 param_2) {
|
||||
SetTileType(param_2,
|
||||
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) {
|
||||
SetTileType(0x76, ((this->field_0x38 << 0x10) >> 0x14 & 0x3fU) | ((this->field_0x3a << 0x10) >> 0x14 & 0x3fU) << 6,
|
||||
SetTileType(TILE_TYPE_118,
|
||||
((this->field_0x38 << 0x10) >> 0x14 & 0x3fU) | ((this->field_0x3a << 0x10) >> 0x14 & 0x3fU) << 6,
|
||||
super->type2);
|
||||
ChangeLightLevel(super->timer);
|
||||
DeleteThisEntity();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
+66
-66
@@ -27,15 +27,15 @@ void Manager29_Main(Manager29* this) {
|
||||
}
|
||||
|
||||
void sub_0805CBD0(Manager29* this) {
|
||||
LayerStruct* layer;
|
||||
MapLayer* mapLayer;
|
||||
|
||||
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 = GetTileType(this->unk_38, this->unk_34);
|
||||
layer = GetTileBuffer(this->unk_34);
|
||||
this->unk_28 = (u16*)layer->metatileTypes;
|
||||
this->unk_2c = &layer->mapData[(s16)this->unk_3a];
|
||||
this->unk_3c = GetTileTypeAtTilePos(this->unk_38, this->layer);
|
||||
mapLayer = GetLayerByIndex(this->layer);
|
||||
this->unk_28 = (u16*)mapLayer->tileTypes;
|
||||
this->unk_2c = &mapLayer->mapData[(s16)this->unk_3a];
|
||||
}
|
||||
|
||||
void sub_0805CC3C(Manager29* this) {
|
||||
@@ -46,7 +46,7 @@ void sub_0805CC3C(Manager29* this) {
|
||||
iVar3 = this->unk_38;
|
||||
iVar2 = (short)this->unk_3a;
|
||||
|
||||
if (this->unk_34 == 1) {
|
||||
if (this->layer == 1) {
|
||||
uVar4 = 0x321;
|
||||
} else {
|
||||
uVar4 = 0x322;
|
||||
@@ -54,74 +54,74 @@ void sub_0805CC3C(Manager29* this) {
|
||||
|
||||
switch (super->type) {
|
||||
default:
|
||||
sub_0807B7D8(uVar4, iVar3, this->unk_34);
|
||||
sub_0807B7D8(0x365, iVar2, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3, this->layer);
|
||||
sub_0807B7D8(0x365, iVar2, this->layer);
|
||||
break;
|
||||
case 1:
|
||||
sub_0807B7D8(uVar4, iVar3, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 1, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x40, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x41, this->unk_34);
|
||||
sub_0807B7D8(this->unk_3c, iVar2, this->unk_34);
|
||||
sub_0807B7D8(0x36f, iVar2 + 1, this->unk_34);
|
||||
sub_0807B7D8(0x370, iVar2 + 0x40, this->unk_34);
|
||||
sub_0807B7D8(0x371, iVar2 + 0x41, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 1, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x40, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x41, this->layer);
|
||||
sub_0807B7D8(this->unk_3c, iVar2, this->layer);
|
||||
sub_0807B7D8(0x36f, iVar2 + 1, this->layer);
|
||||
sub_0807B7D8(0x370, iVar2 + 0x40, this->layer);
|
||||
sub_0807B7D8(0x371, iVar2 + 0x41, this->layer);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
sub_0807B7D8(uVar4, iVar3, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 1, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 2, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x40, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x41, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x42, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x80, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x81, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x82, this->unk_34);
|
||||
sub_0807B7D8(this->unk_3c, iVar2, this->unk_34);
|
||||
sub_0807B7D8(0x372, iVar2 + 1, this->unk_34);
|
||||
sub_0807B7D8(0x36f, iVar2 + 2, this->unk_34);
|
||||
sub_0807B7D8(0x374, iVar2 + 0x40, this->unk_34);
|
||||
sub_0807B7D8(0x376, iVar2 + 0x41, this->unk_34);
|
||||
sub_0807B7D8(0x375, iVar2 + 0x42, this->unk_34);
|
||||
sub_0807B7D8(0x370, iVar2 + 0x80, this->unk_34);
|
||||
sub_0807B7D8(0x373, iVar2 + 0x81, this->unk_34);
|
||||
sub_0807B7D8(0x371, iVar2 + 0x82, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 1, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 2, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x40, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x41, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x42, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x80, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x81, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x82, this->layer);
|
||||
sub_0807B7D8(this->unk_3c, iVar2, this->layer);
|
||||
sub_0807B7D8(0x372, iVar2 + 1, this->layer);
|
||||
sub_0807B7D8(0x36f, iVar2 + 2, this->layer);
|
||||
sub_0807B7D8(0x374, iVar2 + 0x40, this->layer);
|
||||
sub_0807B7D8(0x376, iVar2 + 0x41, this->layer);
|
||||
sub_0807B7D8(0x375, iVar2 + 0x42, this->layer);
|
||||
sub_0807B7D8(0x370, iVar2 + 0x80, this->layer);
|
||||
sub_0807B7D8(0x373, iVar2 + 0x81, this->layer);
|
||||
sub_0807B7D8(0x371, iVar2 + 0x82, this->layer);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
sub_0807B7D8(uVar4, iVar3, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 1, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 2, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 3, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x40, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x41, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x42, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x43, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x80, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x81, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x82, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x83, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0xc0, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0xc1, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0xc2, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0xc3, this->unk_34);
|
||||
sub_0807B7D8(this->unk_3c, iVar2, this->unk_34);
|
||||
sub_0807B7D8(0x372, iVar2 + 1, this->unk_34);
|
||||
sub_0807B7D8(0x372, iVar2 + 2, this->unk_34);
|
||||
sub_0807B7D8(0x36f, iVar2 + 3, this->unk_34);
|
||||
sub_0807B7D8(0x374, iVar2 + 0x40, this->unk_34);
|
||||
sub_0807B7D8(0x376, iVar2 + 0x41, this->unk_34);
|
||||
sub_0807B7D8(0x376, iVar2 + 0x42, this->unk_34);
|
||||
sub_0807B7D8(0x375, iVar2 + 0x43, this->unk_34);
|
||||
sub_0807B7D8(0x374, iVar2 + 0x80, this->unk_34);
|
||||
sub_0807B7D8(0x376, iVar2 + 0x81, this->unk_34);
|
||||
sub_0807B7D8(0x376, iVar2 + 0x82, this->unk_34);
|
||||
sub_0807B7D8(0x375, iVar2 + 0x83, this->unk_34);
|
||||
sub_0807B7D8(0x370, iVar2 + 0xc0, this->unk_34);
|
||||
sub_0807B7D8(0x373, iVar2 + 0xc1, this->unk_34);
|
||||
sub_0807B7D8(0x373, iVar2 + 0xc2, this->unk_34);
|
||||
sub_0807B7D8(0x371, iVar2 + 0xc3, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 1, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 2, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 3, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x40, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x41, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x42, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x43, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x80, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x81, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x82, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x83, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0xc0, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0xc1, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0xc2, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0xc3, this->layer);
|
||||
sub_0807B7D8(this->unk_3c, iVar2, this->layer);
|
||||
sub_0807B7D8(0x372, iVar2 + 1, this->layer);
|
||||
sub_0807B7D8(0x372, iVar2 + 2, this->layer);
|
||||
sub_0807B7D8(0x36f, iVar2 + 3, this->layer);
|
||||
sub_0807B7D8(0x374, iVar2 + 0x40, this->layer);
|
||||
sub_0807B7D8(0x376, iVar2 + 0x41, this->layer);
|
||||
sub_0807B7D8(0x376, iVar2 + 0x42, this->layer);
|
||||
sub_0807B7D8(0x375, iVar2 + 0x43, this->layer);
|
||||
sub_0807B7D8(0x374, iVar2 + 0x80, this->layer);
|
||||
sub_0807B7D8(0x376, iVar2 + 0x81, this->layer);
|
||||
sub_0807B7D8(0x376, iVar2 + 0x82, this->layer);
|
||||
sub_0807B7D8(0x375, iVar2 + 0x83, this->layer);
|
||||
sub_0807B7D8(0x370, iVar2 + 0xc0, this->layer);
|
||||
sub_0807B7D8(0x373, iVar2 + 0xc1, this->layer);
|
||||
sub_0807B7D8(0x373, iVar2 + 0xc2, this->layer);
|
||||
sub_0807B7D8(0x371, iVar2 + 0xc3, this->layer);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,8 +13,7 @@
|
||||
#include "player.h"
|
||||
#include "room.h"
|
||||
#include "sound.h"
|
||||
|
||||
extern u32 sub_080B1AC8(u16, u16, u8);
|
||||
#include "tiles.h"
|
||||
|
||||
bool32 PortalReadyForMinish(void);
|
||||
|
||||
@@ -43,7 +42,7 @@ void MinishPortalManager_Main(MinishPortalManager* this) {
|
||||
gArea.portal_mode = 3;
|
||||
}
|
||||
}
|
||||
if (sub_080B1AC8(this->unk_38, this->unk_3a, super->timer) == 0x3d) {
|
||||
if (GetActTileAtRoomCoords(this->unk_38, this->unk_3a, super->timer) == ACT_TILE_61) {
|
||||
CreateMagicSparkles(this->unk_38 + gRoomControls.origin_x, this->unk_3a + gRoomControls.origin_y,
|
||||
super->timer);
|
||||
if (super->subtimer == 0) {
|
||||
|
||||
@@ -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
@@ -1,17 +1,17 @@
|
||||
/**
|
||||
* @file minishVillageTilesetManager.c
|
||||
* @file minishVillageTileSetManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Swap tileset data in minish village depending on the position
|
||||
* @brief Swap tileSet data in minish village depending on the position
|
||||
*/
|
||||
#include "manager/minishVillageTilesetManager.h"
|
||||
#include "manager/minishVillageTileSetManager.h"
|
||||
#include "asm.h"
|
||||
#include "common.h"
|
||||
#include "functions.h"
|
||||
#include "main.h"
|
||||
|
||||
void sub_08057E30(void*);
|
||||
bool32 sub_08057E40(MinishVillageTilesetManager*);
|
||||
bool32 sub_08057E40(MinishVillageTileSetManager*);
|
||||
void sub_08057E7C(u32);
|
||||
|
||||
extern const u8 gGlobalGfxAndPalettes[];
|
||||
@@ -54,7 +54,7 @@ const u32 gUnk_081080A4[0x50] = {
|
||||
const u8 gUnk_081081E4[] = { 0x16, 0x17, 0x17, 0x18, 0x18 };
|
||||
|
||||
#ifdef EU
|
||||
void MinishVillageTilesetManager_Main(MinishVillageTilesetManager* this) {
|
||||
void MinishVillageTileSetManager_Main(MinishVillageTileSetManager* this) {
|
||||
u32 tmp;
|
||||
const u32* tmp2;
|
||||
s32 tmp3;
|
||||
@@ -103,7 +103,7 @@ void MinishVillageTilesetManager_Main(MinishVillageTilesetManager* this) {
|
||||
}
|
||||
}
|
||||
#else
|
||||
void MinishVillageTilesetManager_Main(MinishVillageTilesetManager* this) {
|
||||
void MinishVillageTileSetManager_Main(MinishVillageTileSetManager* this) {
|
||||
u32 tmp;
|
||||
const u32* tmp2;
|
||||
if (super->action == 0) {
|
||||
@@ -156,7 +156,7 @@ void sub_08057E30(void* this) {
|
||||
sub_08057E7C(gRoomVars.graphicsGroups[0]);
|
||||
}
|
||||
|
||||
bool32 sub_08057E40(MinishVillageTilesetManager* this) {
|
||||
bool32 sub_08057E40(MinishVillageTileSetManager* this) {
|
||||
u32 tmp = CheckRegionsOnScreen(gUnk_08108050);
|
||||
if (tmp != 0xFF) {
|
||||
gRoomVars.graphicsGroups[0] = tmp;
|
||||
+26
-26
@@ -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, 1) != 0x61)
|
||||
if (GetTileTypeAtRoomCoords(x, y, LAYER_BOTTOM) != TILE_TYPE_97)
|
||||
return;
|
||||
SetTileType(0x26, ((x >> 4) & 0x3F) | (((y >> 4) & 0x3F) << 6), 1);
|
||||
SetTileType(TILE_TYPE_38, ((x >> 4) & 0x3F) | (((y >> 4) & 0x3F) << 6), LAYER_BOTTOM);
|
||||
sub_08058F84(x, y);
|
||||
}
|
||||
|
||||
@@ -179,13 +179,13 @@ void MiscManager_Type1(MiscManager* this) {
|
||||
}
|
||||
|
||||
void sub_08059064(MiscManager* this) {
|
||||
Entity* tmp;
|
||||
tmp = CreateObject(GROUND_ITEM, ITEM_SMALL_KEY, 0);
|
||||
if (!tmp)
|
||||
Entity* key;
|
||||
key = CreateObject(GROUND_ITEM, ITEM_SMALL_KEY, 0);
|
||||
if (!key)
|
||||
return;
|
||||
tmp->timer = 2;
|
||||
tmp->x.HALF.HI = this->unk_38 + gRoomControls.origin_x;
|
||||
tmp->y.HALF.HI = this->unk_3a + gRoomControls.origin_y;
|
||||
key->timer = 2;
|
||||
key->x.HALF.HI = this->x + gRoomControls.origin_x;
|
||||
key->y.HALF.HI = this->y + gRoomControls.origin_y;
|
||||
}
|
||||
|
||||
void MiscManager_Type3(MiscManager* this) {
|
||||
@@ -229,8 +229,8 @@ void MiscManager_Type5(MiscManager* this) {
|
||||
switch (super->action) {
|
||||
default:
|
||||
if (!--super->timer) {
|
||||
CreateDustAt(this->unk_38, this->unk_3a, super->type2);
|
||||
RestorePrevTileEntity(((this->unk_38 >> 4) & 0x3f) | ((this->unk_3a >> 4) & 0x3f) << 6, super->type2);
|
||||
CreateDustAt(this->x, this->y, super->type2);
|
||||
RestorePrevTileEntity(TILE_LOCAL(this->x, this->y), super->type2);
|
||||
SoundReq(SFX_TASK_COMPLETE);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
@@ -240,7 +240,7 @@ void MiscManager_Type5(MiscManager* this) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
super->action = 1;
|
||||
SetTileType(0x365, ((this->unk_38 >> 4) & 0x3f) | ((this->unk_3a >> 4) & 0x3f) << 6, super->type2);
|
||||
SetTileType(TILE_TYPE_869, TILE_LOCAL(this->x, this->y), super->type2);
|
||||
break;
|
||||
case 1:
|
||||
if (CheckFlags(this->flags)) {
|
||||
@@ -256,18 +256,18 @@ void MiscManager_Type6(MiscManager* this) {
|
||||
super->action = 1;
|
||||
super->type2 = CheckFlags(this->flags);
|
||||
if (super->type2) {
|
||||
gRoomVars.lightLevel = this->unk_3a;
|
||||
gRoomVars.lightLevel = this->y;
|
||||
} else {
|
||||
gRoomVars.lightLevel = this->unk_38;
|
||||
gRoomVars.lightLevel = this->x;
|
||||
}
|
||||
} else {
|
||||
u32 tmp = CheckFlags(this->flags);
|
||||
if (super->type2 != tmp) {
|
||||
super->type2 = tmp;
|
||||
if (tmp) {
|
||||
gRoomVars.lightLevel = this->unk_3a;
|
||||
gRoomVars.lightLevel = this->y;
|
||||
} else {
|
||||
gRoomVars.lightLevel = this->unk_38;
|
||||
gRoomVars.lightLevel = this->x;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -321,7 +321,7 @@ void MiscManager_Type9(MiscManager* this) {
|
||||
}
|
||||
|
||||
void sub_080592EC(MiscManager* this) {
|
||||
SetDirtTile(((this->unk_38 >> 4) & 0x3F) | (((this->unk_3a >> 4) & 0x3F) << 6));
|
||||
SetDirtTile(TILE_LOCAL(this->x, this->y));
|
||||
}
|
||||
|
||||
void sub_0805930C(MiscManager* this) {
|
||||
@@ -333,15 +333,15 @@ void sub_0805930C(MiscManager* this) {
|
||||
#endif
|
||||
if (!tmp)
|
||||
return;
|
||||
tmp->x.HALF.HI = this->unk_38 + gRoomControls.origin_x;
|
||||
tmp->y.HALF.HI = this->unk_3a + gRoomControls.origin_y;
|
||||
tmp->x.HALF.HI = this->x + gRoomControls.origin_x;
|
||||
tmp->y.HALF.HI = this->y + gRoomControls.origin_y;
|
||||
tmp->collisionLayer = 1;
|
||||
}
|
||||
|
||||
void SetDirtTile(u32 tile) {
|
||||
SetTileType(CUT_GRASS, tile, 1);
|
||||
SetTileType(0, tile, 2);
|
||||
SetTileType(0, tile - 0x40, 2);
|
||||
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) {
|
||||
@@ -355,7 +355,7 @@ void MiscManager_TypeA(MiscManager* this) {
|
||||
void MiscManager_TypeB(MiscManager* this) {
|
||||
if (sub_080593CC(this)) {
|
||||
if (++super->timer >= 8) {
|
||||
sub_080806BC(this->unk_38 - gRoomControls.origin_x, this->unk_3a - gRoomControls.origin_y, 0xFF, 0xA);
|
||||
sub_080806BC(this->x - gRoomControls.origin_x, this->y - gRoomControls.origin_y, 0xFF, 0xA);
|
||||
}
|
||||
} else {
|
||||
super->timer = 0;
|
||||
@@ -365,7 +365,7 @@ void MiscManager_TypeB(MiscManager* this) {
|
||||
bool32 sub_080593CC(MiscManager* this) {
|
||||
if (!(gPlayerState.flags & PL_MINISH) && gPlayerState.swim_state != 0 && gPlayerEntity.base.animationState == 0 &&
|
||||
(gPlayerState.playerInput.heldInput & INPUT_ANY_DIRECTION) == INPUT_UP) {
|
||||
return EntityWithinDistance(&gPlayerEntity.base, this->unk_38, this->unk_3a + 0xC, 6);
|
||||
return EntityWithinDistance(&gPlayerEntity.base, this->x, this->y + 12, 6);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
@@ -381,8 +381,8 @@ void MiscManager_TypeC(MiscManager* this) {
|
||||
if (!tmp)
|
||||
return;
|
||||
tmp->collisionLayer = 2;
|
||||
tmp->x.HALF.HI = this->unk_38 + gRoomControls.origin_x;
|
||||
tmp->y.HALF.HI = this->unk_3a + gRoomControls.origin_y;
|
||||
tmp->x.HALF.HI = this->x + gRoomControls.origin_x;
|
||||
tmp->y.HALF.HI = this->y + gRoomControls.origin_y;
|
||||
EnqueueSFX(SFX_1B0);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "manager/railIntersectionManager.h"
|
||||
#include "flags.h"
|
||||
#include "room.h"
|
||||
#include "tiles.h"
|
||||
|
||||
void sub_0805B778(RailIntersectionManager*);
|
||||
void RailIntersectionManager_Init(RailIntersectionManager*);
|
||||
@@ -25,7 +26,7 @@ void RailIntersectionManager_Init(RailIntersectionManager* this) {
|
||||
super->type2 = 1;
|
||||
}
|
||||
super->action = 1;
|
||||
this->field_0x38 = (this->field_0x38 >> 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);
|
||||
}
|
||||
|
||||
@@ -44,6 +45,7 @@ void RailIntersectionManager_Action1(RailIntersectionManager* this) {
|
||||
}
|
||||
|
||||
void sub_0805B778(RailIntersectionManager* this) {
|
||||
static const u16 gUnk_08108C9C[] = { 0x358, 0x359, 0x356, 0x35a, 0x35a, 0x357 };
|
||||
SetTileType(gUnk_08108C9C[super->type * 2 + super->type2], this->field_0x38, this->field_0x36);
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
extern struct BgAffineDstData gUnk_02017AA0[];
|
||||
extern struct BgAffineDstData gUnk_02017BA0[];
|
||||
extern u8 gUnk_02017700[];
|
||||
extern u8 gUpdateVisibleTiles;
|
||||
extern u32 gUsedPalettes;
|
||||
|
||||
@@ -261,8 +260,8 @@ void sub_08058D34(void) {
|
||||
u16 tmp;
|
||||
u32 tmp2;
|
||||
LoadPaletteGroup(0x28);
|
||||
MemCopy(gUnk_02017700, gUnk_02017700 + 0x240, 0x20);
|
||||
gUsedPalettes |= 0x200000;
|
||||
MemCopy(gPaletteBuffer + 3 * 16, gPaletteBuffer + 21 * 16, 16 * 2);
|
||||
gUsedPalettes |= 1 << 21;
|
||||
LoadGfxGroup(0x16);
|
||||
tmp = gScreen.lcd.displayControl;
|
||||
tmp2 = 0;
|
||||
|
||||
@@ -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;
|
||||
@@ -522,7 +522,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;
|
||||
|
||||
@@ -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 = &GetTileBuffer(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];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "sound.h"
|
||||
#include "tiles.h"
|
||||
|
||||
enum { INIT, IN_PROGRESS, FAILED, SUCCEEDED };
|
||||
|
||||
@@ -30,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 (GetTileType(this->player_current_tile, super->type2)) {
|
||||
case 0x317:
|
||||
switch (GetTileTypeAtTilePos(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 0x318:
|
||||
case TILE_TYPE_792:
|
||||
// stepped on a blue tile
|
||||
// turn the tile into a red tile
|
||||
sub_0807B7D8(0x317, 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 =
|
||||
|
||||
@@ -8,9 +8,10 @@
|
||||
#include "asm.h"
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "tiles.h"
|
||||
|
||||
void WaterfallBottomManager_Main(WaterfallBottomManager* this) {
|
||||
SetBottomTile(0x4014, 0x5c3, 1);
|
||||
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;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "common.h"
|
||||
#include "fileselect.h"
|
||||
#include "functions.h"
|
||||
#include "main.h"
|
||||
#include "room.h"
|
||||
#include "screen.h"
|
||||
#include "sound.h"
|
||||
@@ -21,16 +22,13 @@ void sub_080596E0(WeatherChangeManager*);
|
||||
u32 sub_08059844(void);
|
||||
u32 sub_0805986C(void);
|
||||
void sub_08059894(const u16*, const u16*, u32);
|
||||
u32 sub_080598F8(u32, u32, u32);
|
||||
void sub_08059960(const u16*, const u16*, u16*, u8);
|
||||
u32 MixColors(u32, u32, u32);
|
||||
void MixPalettes(const u16*, const u16*, u16*, u8);
|
||||
|
||||
const u8 gUnk_08108390[6] = {
|
||||
0x0F, 0x1E, 0x2D, 0x3C, 0x01, 0x01,
|
||||
};
|
||||
|
||||
extern u16 gUnk_020176E0[];
|
||||
extern u8 gUnk_02017700[];
|
||||
|
||||
extern const u16 gPalette_549[];
|
||||
|
||||
void WeatherChangeManager_Main(WeatherChangeManager* this) {
|
||||
@@ -160,54 +158,56 @@ u32 sub_0805986C(void) {
|
||||
return gPlayerEntity.base.x.HALF.HI - gRoomControls.origin_x > 0x200;
|
||||
}
|
||||
|
||||
void sub_08059894(const u16* unk1, const u16* unk2, u32 unk3) {
|
||||
void sub_08059894(const u16* palette1, const u16* palette2, u32 factor) {
|
||||
const u16* tmp1;
|
||||
const u16* tmp2;
|
||||
u16* tmp3;
|
||||
u32 tmp4;
|
||||
u32 i;
|
||||
tmp1 = unk1;
|
||||
tmp2 = unk2;
|
||||
tmp3 = gUnk_020176E0;
|
||||
tmp1 = palette1;
|
||||
tmp2 = palette2;
|
||||
tmp3 = gPaletteBuffer + 2 * 16;
|
||||
for (i = 0; i < 13; i++) {
|
||||
sub_08059960(tmp1, tmp2, tmp3, unk3);
|
||||
MixPalettes(tmp1, tmp2, tmp3, factor);
|
||||
tmp1 += 0x10;
|
||||
tmp2 += 0x10;
|
||||
tmp3 += 0x10;
|
||||
}
|
||||
MemCopy(gUnk_02017700, gUnk_02017700 + 0x240, 0x20);
|
||||
gUsedPalettes |= 0x207ffc;
|
||||
MemCopy(gPaletteBuffer + 3 * 16, gPaletteBuffer + 21 * 16, 16 * 2);
|
||||
// Use palettes 2 to 14 and 21.
|
||||
gUsedPalettes |= 1 << 2 | 1 << 3 | 1 << 4 | 1 << 5 | 1 << 6 | 1 << 7 | 1 << 8 | 1 << 9 | 1 << 10 | 1 << 11 |
|
||||
1 << 12 | 1 << 13 | 1 << 14 | 1 << 21;
|
||||
}
|
||||
|
||||
u32 sub_080598F8(u32 unk1, u32 unk2, u32 unk3) {
|
||||
u32 MixColors(u32 color1, u32 color2, u32 factor) {
|
||||
u32 tmp1, tmp2, tmp3;
|
||||
u32 tmp4, tmp5, tmp6;
|
||||
|
||||
tmp1 = (unk1 & 0x1F) << 8;
|
||||
tmp1 = (tmp1 * unk3) >> 5;
|
||||
tmp4 = (unk2 & 0x1F) << 8;
|
||||
tmp4 = (tmp4 * (0x20 - unk3)) >> 5;
|
||||
tmp1 = (color1 & 0x1F) << 8;
|
||||
tmp1 = (tmp1 * factor) >> 5;
|
||||
tmp4 = (color2 & 0x1F) << 8;
|
||||
tmp4 = (tmp4 * (0x20 - factor)) >> 5;
|
||||
tmp1 = (tmp1 + tmp4) >> 8;
|
||||
|
||||
tmp2 = (unk1 & 0x3E0) << 3;
|
||||
tmp2 = (tmp2 * unk3) >> 5;
|
||||
tmp5 = (unk2 & 0x3E0) << 3;
|
||||
tmp5 = (tmp5 * (0x20 - unk3)) >> 5;
|
||||
tmp2 = (color1 & 0x3E0) << 3;
|
||||
tmp2 = (tmp2 * factor) >> 5;
|
||||
tmp5 = (color2 & 0x3E0) << 3;
|
||||
tmp5 = (tmp5 * (0x20 - factor)) >> 5;
|
||||
tmp2 = (tmp2 + tmp5) >> 8;
|
||||
|
||||
tmp3 = (unk1 & 0x7C00) >> 2;
|
||||
tmp3 = (tmp3 * unk3) >> 5;
|
||||
tmp6 = (unk2 & 0x7C00) >> 2;
|
||||
tmp6 = (tmp6 * (0x20 - unk3)) >> 5;
|
||||
tmp3 = (color1 & 0x7C00) >> 2;
|
||||
tmp3 = (tmp3 * factor) >> 5;
|
||||
tmp6 = (color2 & 0x7C00) >> 2;
|
||||
tmp6 = (tmp6 * (0x20 - factor)) >> 5;
|
||||
tmp3 = (tmp3 + tmp6) >> 8;
|
||||
|
||||
return tmp1 | (tmp2 << 5) | (tmp3 << 10);
|
||||
}
|
||||
|
||||
void sub_08059960(const u16* unk1, const u16* unk2, u16* unk3, u8 unk4) {
|
||||
void MixPalettes(const u16* srcPalette1, const u16* srcPalette2, u16* destPalette, u8 factor) {
|
||||
u32 i;
|
||||
for (i = 0; i < 0x10; i++) {
|
||||
*unk3++ = sub_080598F8(*unk1++, *unk2++, unk4);
|
||||
*destPalette++ = MixColors(*srcPalette1++, *srcPalette2++, factor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user