summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authoroctorock <79596758+octorock@users.noreply.github.com>2022-03-05 11:43:58 +0100
committeroctorock <79596758+octorock@users.noreply.github.com>2022-03-05 19:09:49 +0100
commitd6bbbf2db6bd078a887138506bec5abcc36b3020 (patch)
treeed21da6d5dcf2db20e4022830903b5ba19443c87 /include
parentd18fed1fb9d52eb8c4be311d3c55bf4d29893d93 (diff)
Improve LayerStruct
Diffstat (limited to 'include')
-rw-r--r--include/entity.h1
-rw-r--r--include/fileselect.h2
-rw-r--r--include/functions.h2
-rw-r--r--include/main.h4
-rw-r--r--include/manager.h5
-rw-r--r--include/map.h16
6 files changed, 16 insertions, 14 deletions
diff --git a/include/entity.h b/include/entity.h
index 137cadc3..4b25be09 100644
--- a/include/entity.h
+++ b/include/entity.h
@@ -506,6 +506,7 @@ extern u8 gManagerCount;
/** @name Tile Macros */ /// @{
#define TILE(x, y) (((((x)-gRoomControls.origin_x) >> 4) & 0x3F) | ((((y)-gRoomControls.origin_y) >> 4) & 0x3F) << 6)
+#define TILE_POS(x, y) (x + (y << 6))
#define COORD_TO_TILE(entity) TILE((entity)->x.HALF.HI, (entity)->y.HALF.HI)
#define COORD_TO_TILE_OFFSET(entity, xOff, yOff) TILE((entity)->x.HALF.HI - (xOff), (entity)->y.HALF.HI - (yOff))
/// @}
diff --git a/include/fileselect.h b/include/fileselect.h
index f4fe832a..31d75ea5 100644
--- a/include/fileselect.h
+++ b/include/fileselect.h
@@ -53,7 +53,7 @@ typedef struct {
/*0x08*/ s8 saveStatus[3];
/*0x0b*/ SaveFile saves[3];
} struct_02019EE0;
-extern struct_02019EE0 gUnk_02019EE0;
+extern struct_02019EE0 gMapDataBottomSpecial;
// TODO size: 0x8000 from ClearTilemaps?
extern void sub_08056FEC(u32, struct_020227E8*);
diff --git a/include/functions.h b/include/functions.h
index b89a1a80..f3258d3f 100644
--- a/include/functions.h
+++ b/include/functions.h
@@ -214,7 +214,7 @@ extern void sub_0807ACCC(Entity*);
extern u32 sub_0807B014();
extern void sub_0807B0C8(void);
extern void sub_0807B7D8(u32, u32, u32);
-extern void sub_0807B9B8(s32, s32, s32);
+extern void sub_0807B9B8(u32, u32, u32);
extern void sub_0807BA8C(u32, u32);
extern void sub_0807BB68(s16*, u32, u32);
extern bool32 sub_0807BD14(Entity*, u32);
diff --git a/include/main.h b/include/main.h
index f7ab29c4..c5e0c0c5 100644
--- a/include/main.h
+++ b/include/main.h
@@ -82,8 +82,8 @@ typedef struct {
} UI;
static_assert(sizeof(UI) == 0x3b4);
-extern Main gMain; /**< Main instance. */
-extern UI gUnk_02032EC0; /**< UI instance. */
+extern Main gMain; /**< Main instance. */
+extern UI gUI; /**< UI instance. */
/**
* Program entry point.
diff --git a/include/manager.h b/include/manager.h
index 28a27922..4835a712 100644
--- a/include/manager.h
+++ b/include/manager.h
@@ -137,7 +137,7 @@ typedef struct {
u16 unk_06;
} DiggingCaveEntrance;
-extern struct {
+typedef struct {
DiggingCaveEntrance* unk_00;
u16 unk_04;
u16 unk_06;
@@ -145,7 +145,8 @@ extern struct {
u8 unk_09;
u8 unk_0a;
u8 unk_0b;
-} gUnk_03004030;
+} struct_03004030;
+extern struct_03004030 gUnk_03004030;
extern DiggingCaveEntrance* diggingCaveEntrances[];
diff --git a/include/map.h b/include/map.h
index 7c800a5a..52263a5b 100644
--- a/include/map.h
+++ b/include/map.h
@@ -4,14 +4,14 @@
#include "global.h"
typedef struct {
- u16* bgControlPtr; // Points to the BgSettings.control field for the bg belonging to this layer?
- u16 _4[0x1000]; // tilemap data? <-- gMapDataTop / gMapDataBottom
- u8 _2004[0x1000]; // more tilemap data? <-- gUnk_0200D654 / gUnk_02027EB4
- u8 _3004[0x1000]; // more tilemap data? <-- gUnk_0200E654 / gUnk_02028EB4
- u8 _4004[0x1000]; // gMetatileTypesTop, gMetatileTypesBottom
- s16 _5004[0x500]; // gUnk_02011654,gUnk_0202BEB4
- // Maybe even include here gMetatilesTop, gUnk_02016654 ?
- // gMetatilesBottom, gUnk_02030EB4
+ /*0x0000*/ u16* bgControlPtr; // Points to the BgSettings.control field for the bg belonging to this layer?
+ /*0x0004*/ u16 mapData[0x1000]; // tilemap data? <-- gMapDataTop / gMapDataBottom
+ /*0x2004*/ u8 collisionData[0x1000]; // more tilemap data? <-- gUnk_0200D654 / gUnk_02027EB4
+ /*0x3004*/ u16 mapDataClone[0x1000]; // more tilemap data? <-- gUnk_0200E654 / gUnk_02028EB4
+ /*0x5004*/ u16 metatileTypes[0x800]; // gMetatileTypesTop, gMetatileTypesBottom
+ /*0x6004*/ u16 unkData2[0x800]; // gUnk_02011654,gUnk_0202BEB4
+ /*0x7004*/ u16 metatiles[0x2000]; // gMetatilesTop, gMetatilesBottom
+ /*0xb004*/ u8 unkData3[0x1000]; // gUnk_02016654, gUnk_02030EB4
} LayerStruct;
extern LayerStruct gMapTop;