summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authortheo3 <arisstephenson2@gmail.com>2022-01-03 23:58:02 -0800
committertheo3 <arisstephenson2@gmail.com>2022-01-03 23:58:02 -0800
commit52db70bb9d63a801f76b2fe6b359bd402a2c5b2a (patch)
treea38de84a806c50f765d0370a2668a695038eb894 /include
parentf26b2e286a7f462947b395da259e185fc8ecfa7f (diff)
naming work
Diffstat (limited to 'include')
-rw-r--r--include/asm.h2
-rw-r--r--include/color.h2
-rw-r--r--include/entity.h8
-rw-r--r--include/fileselect.h (renamed from include/fileScreen.h)2
-rw-r--r--include/functions.h8
-rw-r--r--include/game.h22
-rw-r--r--include/main.h20
-rw-r--r--include/manager.h6
-rw-r--r--include/message.h2
-rw-r--r--include/player.h2
-rw-r--r--include/room.h175
-rw-r--r--include/save.h19
-rw-r--r--include/structures.h31
13 files changed, 156 insertions, 143 deletions
diff --git a/include/asm.h b/include/asm.h
index 5fe8a9e0..fed7a35b 100644
--- a/include/asm.h
+++ b/include/asm.h
@@ -9,7 +9,7 @@ extern u32 GetTileTypeByEntity(struct Entity_*);
extern u32 GetTileTypeByPos(s32 x, s32 y, u32 layer);
extern u32 GetTileType(u32 pos, u32 layer);
extern void SetTile(u32 index, u32 position, u32 layer);
-extern void sub_08000108(void);
+extern void UpdateScrollVram(void);
extern u32 sub_080002D0(struct Entity_*);
extern void LoadResourceAsync(const void*, u32, u32);
extern void sub_08001242(struct Entity_*);
diff --git a/include/color.h b/include/color.h
index 14ab24a9..9ff53264 100644
--- a/include/color.h
+++ b/include/color.h
@@ -10,7 +10,7 @@ typedef struct {
} Palette;
extern Palette gPaletteList[];
-void sub_0801CFA8(u32 a1);
+void ResetPaletteTable(u32 a1);
void sub_0801D000(u32 a1);
void LoadObjPalette(struct Entity_*, u32);
void UnloadOBJPalette(struct Entity_* entity);
diff --git a/include/entity.h b/include/entity.h
index e3fca5d4..898661f8 100644
--- a/include/entity.h
+++ b/include/entity.h
@@ -164,8 +164,8 @@ extern LinkedList gEntityLists[9];
enum {
ENT_DID_INIT = 0x1,
ENT_SCRIPTED = 0x2,
- ENT_ASLEEP = 0x10,
- ENT_20 = 0x20,
+ ENT_DELETED = 0x10,
+ ENT_PERSIST = 0x20,
ENT_COLLIDE = 0x80,
};
@@ -173,8 +173,8 @@ enum {
#define COLLISION_ON(entity) ((entity)->flags |= ENT_COLLIDE)
#define TILE(x, y) \
- (((((x) - gRoomControls.roomOriginX) >> 4) & 0x3F) | \
- ((((y) - gRoomControls.roomOriginY) >> 4) & 0x3F) << 6)
+ (((((x) - gRoomControls.origin_x) >> 4) & 0x3F) | \
+ ((((y) - gRoomControls.origin_y) >> 4) & 0x3F) << 6)
#define COORD_TO_TILE(entity) \
TILE((entity)->x.HALF.HI, (entity)->y.HALF.HI)
diff --git a/include/fileScreen.h b/include/fileselect.h
index 86f4e8d0..d2a2f52e 100644
--- a/include/fileScreen.h
+++ b/include/fileselect.h
@@ -63,7 +63,7 @@ extern struct_02019EE0 gUnk_02019EE0;
extern void sub_08056FEC(u32, struct_020227E8*);
extern void sub_0805F46C(u32, void*);
extern void RecoverUI(u32 bottomPt, u32 topPt);
-extern void sub_08080668(void);
+extern void ClearTilemaps(void);
extern void sub_0805194C(u32);
extern struct_02036540* sub_0805F2C8(void);
extern void sub_0805F7DC(u32, struct_02036540*);
diff --git a/include/functions.h b/include/functions.h
index 0a6c0ca9..a3716730 100644
--- a/include/functions.h
+++ b/include/functions.h
@@ -61,8 +61,8 @@ extern void sub_08077F50(ItemBehavior* beh, u32 arg1);
extern void sub_0807AA80(Entity*);
extern s32 sub_0807887C(Entity*, u32, u32);
extern s32 sub_08078904();
-extern void sub_080AD9B0(void);
-extern void sub_080AD918(void);
+extern void DrawEntities(void);
+extern void CopyOAM(void);
extern void sub_0801E104(void);
extern void sub_080A57F4(void);
extern void sub_08030118(u32);
@@ -105,7 +105,7 @@ extern void sub_0801E1B8(u32, u32);
extern void sub_080A3B74(void);
extern void sub_080A4054(void);
extern void sub_0801C1D4(void);
-extern void sub_0801C208(void);
+extern void DrawOAMCmd(void);
extern void sub_080A4D34(void);
extern u32 sub_080A4494(void);
extern void sub_080A4528(void);
@@ -152,7 +152,7 @@ extern void sub_0807B7D8(u32, u32, u32);
extern void sub_0800451C(Entity*);
extern u32 sub_080002F0(u32, u32, u32);
extern u32 sub_080040D8(Entity*, u8*, s32, s32);
-extern void sub_08053320();
+extern void LoadGfxGroups();
extern void SetColor(u32, u32);
extern u32 sub_0805F8F8(u32);
extern void sub_08002724(void*, u8*);
diff --git a/include/game.h b/include/game.h
index 8fb5253f..5155376b 100644
--- a/include/game.h
+++ b/include/game.h
@@ -4,6 +4,24 @@
#include "global.h"
#include "area.h"
+enum {
+ GAMETASK_TRANSITION,
+ GAMETASK_INIT,
+ GAMETASK_MAIN,
+ GAMETASK_EXIT,
+};
+
+enum {
+ GAMEMAIN_INITROOM,
+ GAMEMAIN_CHANGEROOM,
+ GAMEMAIN_UPDATE,
+ GAMEMAIN_CHANGEAREA,
+ GAMEMAIN_MINISHPORTAL,
+ GAMEMAIN_BARRELUPDATE,
+ GAMEMAIN_RESERVED,
+ GAMEMAIN_SUBTASK,
+};
+
void ChangeLightLevel(s32);
void SetPopupState(u32 type, u32 choice_idx);
@@ -39,7 +57,7 @@ void DisplayEzloMessage(void);
void sub_08052CA4(u32 area, u32 room, u32 x, u32 y);
void sub_08052CD0(u32 area, u32 room, u32 x, u32 y);
-void sub_08052CFC(void);
+void InitRoom(void);
/**
* @brief Get bank offset for area
@@ -50,7 +68,7 @@ RoomResInfo* GetCurrentRoomInfo(void);
void sub_08052EA0(void);
void sub_08052FD8(u32 room, u32 area);
void sub_08053250(void);
-void sub_08053320(void);
+void LoadGfxGroups(void);
void sub_080533CC(void);
void sub_08053494(void);
void sub_080534AC(void);
diff --git a/include/main.h b/include/main.h
index 0e830bab..988b4233 100644
--- a/include/main.h
+++ b/include/main.h
@@ -25,12 +25,12 @@ typedef enum {
#endif
enum {
- SCREEN_INTRO,
- SCREEN_CHOOSE_FILE,
- SCREEN_GAMEPLAY,
- SCREEN_GAME_OVER,
- SCREEN_CREDITS,
- SCREEN_DEBUG_TEXT,
+ TASK_TITLE,
+ TASK_FILE_SELECT,
+ TASK_GAME,
+ TASK_GAMEOVER,
+ TASK_STAFFROLL,
+ TASK_DEBUG,
};
enum {
@@ -41,9 +41,9 @@ enum {
typedef struct {
vu8 interruptFlag;
u8 sleepStatus;
- u8 screen;
- u8 funcIndex;
- u8 transition;
+ u8 task;
+ u8 state;
+ u8 substate;
u8 field_0x5;
u8 muteAudio;
u8 field_0x7;
@@ -75,7 +75,7 @@ extern UI gUnk_02032EC0;
/**
* @brief Begin a subroutine.
*/
-void InitScreen(u32 screen);
+void SetTask(u32 screen);
void InitDMA(void);
diff --git a/include/manager.h b/include/manager.h
index 44852146..28a27922 100644
--- a/include/manager.h
+++ b/include/manager.h
@@ -130,10 +130,10 @@ typedef struct Manager11 {
typedef struct {
u16 unk_00;
- u8 source_roomID;
+ u8 source_room;
u8 unk_03;
- u8 target_areaID;
- u8 target_roomID;
+ u8 target_area;
+ u8 target_room;
u16 unk_06;
} DiggingCaveEntrance;
diff --git a/include/message.h b/include/message.h
index 19d33ee4..c8d3e7b9 100644
--- a/include/message.h
+++ b/include/message.h
@@ -39,7 +39,7 @@ typedef struct {
Message message;
Token curToken;
WStruct _50;
- char playerName[10];
+ char player_name[10];
u8 _66[0x10];
u8 _76;
u8 _77[0x11];
diff --git a/include/player.h b/include/player.h
index 36fd7303..bf9e151e 100644
--- a/include/player.h
+++ b/include/player.h
@@ -280,7 +280,7 @@ extern u16 gWalletSizes[];
extern PlayerState gPlayerState;
extern Entity gPlayerEntity;
-u32 sub_080705AC(void);
+u32 CheckPlayerActivity(void);
void SetPlayerControl(PlayerControlMode mode);
void ResetPlayer(void);
void ResetPlayerVelocity(void);
diff --git a/include/room.h b/include/room.h
index bb09730f..074cc8d5 100644
--- a/include/room.h
+++ b/include/room.h
@@ -4,13 +4,6 @@
#include "global.h"
#include "entity.h"
-/*
-typedef struct {
- u8 areaID;
- u8 roomID;
-} RoomID;
-*/
-
enum RoomTransition {
TRANSITION_DEFAULT,
TRANSITION_CUT,
@@ -24,25 +17,30 @@ enum RoomTransition {
TRANSITION_CUT_FAST,
};
+enum RoomReloadType {
+ RELOAD_ALL = 1,
+ RELOAD_ENTITIES = 2,
+};
+
typedef struct {
- /*0x00*/ u16 unk2;
+ /*0x00*/ u16 reload_flags;
/*0x02*/ u8 unk3;
/*0x03*/ u8 unk4;
- /*0x04*/ u8 areaID;
- /*0x05*/ u8 roomID;
- /*0x06*/ u16 roomOriginX;
- /*0x08*/ u16 roomOriginY;
- /*0x0A*/ s16 roomScrollX;
- /*0x0C*/ s16 roomScrollY;
+ /*0x04*/ u8 area;
+ /*0x05*/ u8 room;
+ /*0x06*/ u16 origin_x;
+ /*0x08*/ u16 origin_y;
+ /*0x0A*/ s16 scroll_x;
+ /*0x0C*/ s16 scroll_y;
/*0x0E*/ u8 unk5;
/*0x0F*/ u8 scroll_flags; // 0x2 = ??, 0x4 = camera scrolling
- /*0x10*/ u8 unk_10;
+ /*0x10*/ u8 scroll_direction;
/*0x11*/ s8 oam_offset_x;
/*0x12*/ s8 oam_offset_y;
/*0x13*/ u8 unk13;
- /*0x14*/ u8 screenShakeMagnitude;
+ /*0x14*/ u8 shake_magnitude;
/*0x15*/ u8 unk7;
- /*0x16*/ u16 screenShakeTime;
+ /*0x16*/ u16 shake_duration;
/*0x18*/ u16 filler2[3];
/*0x1E*/ u16 width;
/*0x20*/ u16 height;
@@ -52,33 +50,33 @@ typedef struct {
/*0x26*/ u8 filler26[2];
/*0x28*/ union SplitWord bg3OffsetX;
/*0x2C*/ union SplitWord bg3OffsetY;
- /*0x30*/ Entity* cameraTarget;
+ /*0x30*/ Entity* camera_target;
} RoomControls;
extern RoomControls gRoomControls;
typedef struct {
- u8 field_0x0;
- u8 filler_0x1;
- u8 field_0x2;
- u8 field_0x3;
- u8 field_0x4;
- u8 filler1[1];
- u8 shopItemType;
- u8 shopItemType2;
- u8 field_0x8;
- u8 field_0x9;
- u8 unk2;
- u8 filler2;
- s16 lightLevel;
- u8 filler3[2];
- u8 unk_10[4];
- u32 flags;
- u32 unk3;
- u8 filler4[48];
- u8 filler5[28];
- u32 animFlags;
- void* field_0x6c[8];
- void* field_0x8c[16];
+ /* 0x00 */ u8 field_0x0;
+ /* 0x01 */ u8 filler_0x1;
+ /* 0x02 */ u8 field_0x2;
+ /* 0x03 */ u8 field_0x3;
+ /* 0x04 */ u8 field_0x4;
+ /* 0x05 */ u8 filler1[1];
+ /* 0x06 */ u8 shopItemType;
+ /* 0x07 */ u8 shopItemType2;
+ /* 0x08 */ u8 field_0x8;
+ /* 0x09 */ u8 field_0x9;
+ /* 0x0a */ u8 unk2;
+ /* 0x0b */ u8 filler2;
+ /* 0x0c */ s16 lightLevel;
+ /* 0x0e */ u8 filler3[2];
+ /* 0x10 */ u8 unk_10[4];
+ /* 0x14 */ u32 flags;
+ /* 0x18 */ u32 unk3;
+ /* 0x1c */ u8 filler4[48];
+ /* 0x4c */ u8 filler5[28];
+ /* 0x68 */ u32 animFlags;
+ /* 0x6c */ void* field_0x6c[8];
+ /* 0x8c */ void* field_0x8c[16];
} RoomVars;
static_assert(sizeof(RoomVars) == 0xCC);
extern RoomVars gRoomVars;
@@ -112,54 +110,55 @@ typedef struct {
// Status of the player's positioning within the scene.
typedef struct {
- u8 area_next;
- u8 room_next;
- u8 start_anim;
- u8 spawn_type;
- s16 start_pos_x;
- s16 start_pos_y;
- u8 layer;
- u8 field_0x15;
- u8 dungeon_area;
- u8 dungeon_room;
- s16 dungeon_x;
- s16 dungeon_y;
- u16 dungeon_map_x;
- u16 dungeon_map_y;
- s16 overworld_map_x;
- s16 overworld_map_y;
- u8 field_0x24[0x8];
-} PlayerWorldStatus;
-static_assert(sizeof(PlayerWorldStatus) == 0x20);
+ /* 0x00 */ u8 area_next;
+ /* 0x01 */ u8 room_next;
+ /* 0x02 */ u8 start_anim;
+ /* 0x03 */ u8 spawn_type;
+ /* 0x04 */ s16 start_pos_x;
+ /* 0x06 */ s16 start_pos_y;
+ /* 0x08 */ u8 layer;
+ /* 0x09 */ u8 field_0x15;
+ /* 0x0a */ u8 dungeon_area;
+ /* 0x0b */ u8 dungeon_room;
+ /* 0x0c */ s16 dungeon_x;
+ /* 0x0e */ s16 dungeon_y;
+ /* 0x10 */ u16 dungeon_map_x;
+ /* 0x12 */ u16 dungeon_map_y;
+ /* 0x14 */ s16 overworld_map_x;
+ /* 0x16 */ s16 overworld_map_y;
+ /* 0x18 */ u8 field_0x24[0x8];
+} PlayerRoomStatus;
+static_assert(sizeof(PlayerRoomStatus) == 0x20);
typedef struct {
- s32 frameCount; // regular frame count? does anything reset it?
- u8 field_0x4[0x2];
- u16 field_0x6;
- bool8 transitioningOut;
- u8 transitionType; // transition when changing areas
- u16 stairs_idx; // seems to be a tile type
- PlayerWorldStatus player_status;
- u8 field_0x2c[0x9];
- u8 hint_height;
- u16 hint_idx;
- u8 field_0x38;
- u8 field_0x39;
- u8 field_0x3a;
- u8 field_0x3b;
- u8 field_0x3c;
- u8 field_0x3d;
- u16 field_0x3e;
- u16 hurtType;
- u16 field_0x42;
- u16 field_0x44;
- u16 field_0x46;
- u16 field_0x48;
- u16 field_0x4a;
- struct_030010EC minecart_data[4];
- struct_0300110C armos_data;
-} ScreenTransition;
-extern ScreenTransition gScreenTransition;
+ /* 0x00 */ s32 frameCount; // regular frame count? does anything reset it?
+ /* 0x04 */ u8 field_0x4[0x2];
+ /* 0x06 */ u16 field_0x6;
+ /* 0x08 */ bool8 transitioningOut;
+ /* 0x09 */ u8 type; // transition when changing areas
+ /* 0x0a */ u16 stairs_idx; // seems to be a tile type
+ /* 0x0c */ PlayerRoomStatus player_status;
+ /* 0x2c */ u8 field_0x2c[0x9];
+ /* 0x35 */ u8 hint_height;
+ /* 0x36 */ u16 hint_idx;
+ /* 0x38 */ u8 field_0x38;
+ /* 0x39 */ u8 field_0x39;
+ /* 0x3a */ u8 field_0x3a;
+ /* 0x3b */ u8 field_0x3b;
+ /* 0x3c */ u8 field_0x3c;
+ /* 0x3d */ u8 field_0x3d;
+ /* 0x3e */ u16 field_0x3e;
+ /* 0x40 */ u16 hurtType;
+ /* 0x42 */ u16 field_0x42;
+ /* 0x44 */ u16 field_0x44;
+ /* 0x46 */ u16 field_0x46;
+ /* 0x48 */ u16 field_0x48;
+ /* 0x4a */ u16 field_0x4a;
+ /* 0x4c */ struct_030010EC minecart_data[4];
+ /* 0x6c */ struct_0300110C armos_data;
+} RoomTransition;
+static_assert(sizeof(RoomTransition) == 0xB0);
+extern RoomTransition gRoomTransition;
typedef struct {
u8 type;
@@ -186,13 +185,13 @@ typedef enum {
DESTRUCTIBLE_TILE,
GRASS_DROP_CHANGER,
LOCATION_CHANGER,
- TILE_ENTITY_D
+ TILE_ENTITY_D,
} TileEntityType;
extern void SetTileType(u32, u32, u32);
extern void InitScreenShake(u32 time, u32 magnitude);
-void sub_0804AFF4(void);
+void CallRoomProp5And7(void);
void LoadRoom(void);
void SetCurrentRoomPropertyList(u32 area, u32 room);
extern void* GetCurrentRoomProperty(u32);
diff --git a/include/save.h b/include/save.h
index 9dbba7ff..2e8015e1 100644
--- a/include/save.h
+++ b/include/save.h
@@ -23,10 +23,10 @@ typedef enum {
extern SaveResult HandleSave(u32 arg0);
typedef struct {
- /*0x000*/ u8 unk_00;
- /*0x000*/ u8 unk_01;
- /*0x002*/ u8 messageSpeed;
- /*0x003*/ u8 brightnessPref;
+ /*0x000*/ u8 invalid;
+ /*0x000*/ u8 initialized;
+ /*0x002*/ u8 msg_speed;
+ /*0x003*/ u8 brightness;
/*0x004*/ u8 filler4[0x2];
/*0x006*/ u8 unk6;
/*0x007*/ u8 unk7;
@@ -37,9 +37,9 @@ typedef struct {
/*0x050*/ u32 unk50;
/*0x054*/ u8 filler54[0xC];
/*0x060*/ u32 areaVisitFlags[8];
- /*0x080*/ u8 playerName[FILENAME_LENGTH];
+ /*0x080*/ char name[FILENAME_LENGTH];
/*0x086*/ u8 filler86[0x2];
- /*0x088*/ PlayerWorldStatus saved_status;
+ /*0x088*/ PlayerRoomStatus saved_status;
/*0x0A8*/ Stats stats;
/*0x0D0*/ u8 fillerD0[0x48];
/*0x118*/ u8 unk118[0x13];
@@ -51,7 +51,8 @@ typedef struct {
/*0x25C*/ u8 flags[0x200];
/*0x45C*/ u8 unk45C[0x10];
/*0x46C*/ u8 unk46C[0x20];
- /*0x48C*/ u32 unk48C[8];
+ /*0x48C*/ u32 unk48C[7];
+ /*0x4A8*/ u32 demo_timer;
/*0x4AC*/ u8 filler4ac[0x8];
} SaveFile;
@@ -59,9 +60,9 @@ extern SaveFile gSave;
u32 InitSaveData(void);
-u32 Write_02000000(struct_02000000*);
+u32 Write_02000000(SaveHeader*);
s32 ReadSaveFile(u32, SaveFile*);
-u32 Read_02000000(struct_02000000*);
+u32 Read_02000000(SaveHeader*);
void SetFileStatusDeleted(u32 index);
extern const char gUnk_0811E470[];
diff --git a/include/structures.h b/include/structures.h
index 1f368dcd..c6c8f80b 100644
--- a/include/structures.h
+++ b/include/structures.h
@@ -8,15 +8,15 @@
typedef struct {
int signature;
u8 saveFileId;
- u8 messageSpeed;
- u8 brightnessPref;
- u8 gameLanguage;
+ u8 msg_speed;
+ u8 brightness;
+ u8 language;
u8 name[6];
- u8 _e;
+ u8 invalid;
u8 _f;
-} struct_02000000;
-#define gSaveHeader ((struct_02000000*)(0x2000000))
-// extern struct_02000000 gSaveHeader;
+} SaveHeader;
+#define gSaveHeader ((SaveHeader*)(0x2000000))
+// extern SaveHeader gSaveHeader;
typedef struct {
u8 unk_00;
@@ -39,13 +39,13 @@ static_assert(sizeof(struct_02000010) == 0x20);
extern struct_02000010 gUnk_02000010;
typedef struct {
- u16 transitionType;
+ u16 type;
u8 field_0x2[4];
s16 playerXPos;
s16 playerYPos;
u8 field_0xa;
- u8 areaID;
- u8 roomID;
+ u8 area;
+ u8 room;
u8 playerLayer;
u8 field_0xe;
u8 playerState;
@@ -164,13 +164,8 @@ typedef struct {
u16 _6;
u8 _0[0x18];
struct OamData oam[0x80];
- OAMObj unk[0x100];
- u8 fill[10];
- u8 _426;
- u8 _427;
- u8 _428[6];
- u8 _42e;
-} OAMSettings;
-extern OAMSettings gUnk_03000000;
+ OAMObj unk[0xA0]; /* todo: affine */
+} OAMControls;
+extern OAMControls gOAMControls;
#endif