summaryrefslogtreecommitdiff
path: root/src/manager
diff options
context:
space:
mode:
authoroctorock <79596758+octorock@users.noreply.github.com>2023-06-10 15:12:51 +0200
committeroctorock <79596758+octorock@users.noreply.github.com>2023-06-10 15:12:51 +0200
commit551cb7209393d06e302a5bda489c341f38efd1f3 (patch)
tree5e35657ef65d6cd14963cd1efc051251d1a433ce /src/manager
parent99c0d42297567b54510056caff059fc374513458 (diff)
Extract some map data definitions
Diffstat (limited to 'src/manager')
-rw-r--r--src/manager/diggingCaveEntranceManager.c99
-rw-r--r--src/manager/holeManager.c4
-rw-r--r--src/manager/hyruleTownTilesetManager.c10
-rw-r--r--src/manager/manager29.c126
-rw-r--r--src/manager/miscManager.c40
-rw-r--r--src/manager/rollingBarrelManager.c5
-rw-r--r--src/manager/templeOfDropletsManager.c4
-rw-r--r--src/manager/weatherChangeManager.c54
8 files changed, 176 insertions, 166 deletions
diff --git a/src/manager/diggingCaveEntranceManager.c b/src/manager/diggingCaveEntranceManager.c
index d020dd5f..8df2d747 100644
--- a/src/manager/diggingCaveEntranceManager.c
+++ b/src/manager/diggingCaveEntranceManager.c
@@ -141,85 +141,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
};
diff --git a/src/manager/holeManager.c b/src/manager/holeManager.c
index 3b1d17cf..563eee3b 100644
--- a/src/manager/holeManager.c
+++ b/src/manager/holeManager.c
@@ -37,14 +37,14 @@ typedef struct struct_08108764 {
u16 unk_06;
u16 unk_08;
u16 unk_0a;
- } * unk_0c;
+ }* unk_0c;
struct {
u8 unk_00;
u8 unk_01;
u8 unk_02[2];
u16 unk_04;
u16 unk_06;
- } * unk_10;
+ }* unk_10;
} struct_08108764;
extern struct_08108764 gUnk_08108764[];
diff --git a/src/manager/hyruleTownTilesetManager.c b/src/manager/hyruleTownTilesetManager.c
index fc0a9378..172b18c0 100644
--- a/src/manager/hyruleTownTilesetManager.c
+++ b/src/manager/hyruleTownTilesetManager.c
@@ -113,15 +113,15 @@ void sub_08059B18(void) {
if (CheckGlobalFlag(TATEKAKE_HOUSE) != 0) {
for (loopVar = 0; loopVar < 4; ++loopVar) {
for (innerLoopVar = 0; innerLoopVar < 4; ++innerLoopVar) {
- SetMetaTileByIndex(loopVar * 0x10 + 0x4ab + innerLoopVar, COMMON(0x28 + 0x10 * innerLoopVar, loopVar * 0x10),
- 1);
+ SetMetaTileByIndex(loopVar * 0x10 + 0x4ab + innerLoopVar,
+ COMMON(0x28 + 0x10 * innerLoopVar, loopVar * 0x10), 1);
}
}
for (loopVar = 0; loopVar < 3; ++loopVar) {
for (innerLoopVar = 0; innerLoopVar < 4; ++innerLoopVar) {
- SetMetaTileByIndex(loopVar * 0x10 + 0x440 + innerLoopVar, COMMON(0x28 + 0x10 * innerLoopVar, loopVar * 0x10),
- 2);
+ SetMetaTileByIndex(loopVar * 0x10 + 0x440 + innerLoopVar,
+ COMMON(0x28 + 0x10 * innerLoopVar, loopVar * 0x10), 2);
}
}
SetMetaTileByIndex(0xd6, 0x5c2, 2);
@@ -132,7 +132,7 @@ void sub_08059B18(void) {
for (loopVar = 0; loopVar < 5; ++loopVar) {
for (innerLoopVar = 0; innerLoopVar < 4; ++innerLoopVar) {
SetMetaTileByIndex(loopVar * 0x10 + 0x4a6 + innerLoopVar,
- COMMON(0x28 + 0x10 * innerLoopVar, loopVar * 0x10), 1);
+ COMMON(0x28 + 0x10 * innerLoopVar, loopVar * 0x10), 1);
}
}
SetMetaTileByIndex(0x444, 0x602, 2);
diff --git a/src/manager/manager29.c b/src/manager/manager29.c
index 02ed52ba..0b12fe46 100644
--- a/src/manager/manager29.c
+++ b/src/manager/manager29.c
@@ -32,8 +32,8 @@ 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 = GetTileType(this->unk_38, this->unk_34);
- layer = GetLayerByIndex(this->unk_34);
+ this->unk_3c = GetTileType(this->unk_38, this->layer);
+ layer = GetLayerByIndex(this->layer);
this->unk_28 = (u16*)layer->metatileTypes;
this->unk_2c = &layer->mapData[(s16)this->unk_3a];
}
@@ -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;
}
}
diff --git a/src/manager/miscManager.c b/src/manager/miscManager.c
index c0c47a89..86662f3b 100644
--- a/src/manager/miscManager.c
+++ b/src/manager/miscManager.c
@@ -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(0x365, 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,8 +333,8 @@ 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;
}
@@ -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.animationState == 0 &&
(gPlayerState.playerInput.heldInput & PLAYER_INPUT_ANY_DIRECTION) == PLAYER_INPUT_UP) {
- return EntityWithinDistance(&gPlayerEntity, this->unk_38, this->unk_3a + 0xC, 6);
+ return EntityWithinDistance(&gPlayerEntity, 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();
}
diff --git a/src/manager/rollingBarrelManager.c b/src/manager/rollingBarrelManager.c
index 3b1d6d41..0a1cab7e 100644
--- a/src/manager/rollingBarrelManager.c
+++ b/src/manager/rollingBarrelManager.c
@@ -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;
diff --git a/src/manager/templeOfDropletsManager.c b/src/manager/templeOfDropletsManager.c
index b1b97aba..16021808 100644
--- a/src/manager/templeOfDropletsManager.c
+++ b/src/manager/templeOfDropletsManager.c
@@ -488,7 +488,9 @@ void sub_0805A9CC(TempleOfDropletsManager* this) {
gScreen.bg3.updated = 1;
}
-extern struct { u8 unk_00[0x20]; } gUnk_085A97A0[];
+extern struct {
+ u8 unk_00[0x20];
+} gUnk_085A97A0[];
void sub_0805AA58(TempleOfDropletsManager* this) {
if (--super->timer == 0) {
diff --git a/src/manager/weatherChangeManager.c b/src/manager/weatherChangeManager.c
index f1988de4..baf2f940 100644
--- a/src/manager/weatherChangeManager.c
+++ b/src/manager/weatherChangeManager.c
@@ -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.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);
}
}