diff options
| author | Henny022p <info@henny022.de> | 2023-08-02 20:50:18 +0200 |
|---|---|---|
| committer | Henny022p <info@henny022.de> | 2023-08-02 20:50:18 +0200 |
| commit | bc2201598711ba1980789384e0c79c3593cd25f0 (patch) | |
| tree | 11d6e5add498a9927a59d985c66ddcc48e461cce /include | |
| parent | 064bc43e78760b8d55d6cd4653d2b926aaea4958 (diff) | |
SaveFile cleanup part 1
Diffstat (limited to 'include')
| -rw-r--r-- | include/global.h | 7 | ||||
| -rw-r--r-- | include/room.h | 13 | ||||
| -rw-r--r-- | include/save.h | 40 | ||||
| -rw-r--r-- | include/windcrest.h | 15 |
4 files changed, 53 insertions, 22 deletions
diff --git a/include/global.h b/include/global.h index 9b3557ce..423af161 100644 --- a/include/global.h +++ b/include/global.h @@ -145,4 +145,11 @@ union SplitHWord { /* forward decls */ struct Entity_; +/** + * bitset macros + */ + +#define BIT(bit) (1 << (bit)) +#define IS_BIT_SET(value, bit) ((value) & BIT(bit)) + #endif // GLOBAL_H diff --git a/include/room.h b/include/room.h index 57999ae2..eec4e46d 100644 --- a/include/room.h +++ b/include/room.h @@ -133,7 +133,7 @@ typedef struct { /* 0x04 */ s16 start_pos_x; /* 0x06 */ s16 start_pos_y; /* 0x08 */ u8 layer; - /* 0x09 */ u8 field_0x15; + /* 0x09 */ u8 filler9; /* 0x0a */ u8 dungeon_area; /* 0x0b */ u8 dungeon_room; /* 0x0c */ s16 dungeon_x; @@ -142,7 +142,7 @@ typedef struct { /* 0x12 */ u16 dungeon_map_y; /* 0x14 */ u16 overworld_map_x; /* 0x16 */ u16 overworld_map_y; - /* 0x18 */ u8 field_0x24[8]; + /* 0x18 */ u8 filler18[8]; } PlayerRoomStatus; static_assert(sizeof(PlayerRoomStatus) == 0x20); @@ -155,7 +155,14 @@ typedef struct { /* 0x0a */ u16 stairs_idx; // seems to be a tile type /* 0x0c */ PlayerRoomStatus player_status; /* 0x2c */ u8 entity_update_type; // differentiates entity priority on kinstone menu? - /* 0x2d */ u8 field_0x2c[0x8]; + /* 0x2d */ u8 field2d; + /* 0x2e */ u8 location; + /* 0x2f */ u8 field2f; + /* 0x30 */ u8 field30; + /* 0x31 */ u8 field31; + /* 0x32 */ u8 field32; + /* 0x33 */ u8 field33; + /* 0x34 */ u8 hint_heightEU; /* 0x35 */ u8 hint_height; /* 0x36 */ u16 hint_idx; /* 0x38 */ u8 field_0x38; diff --git a/include/save.h b/include/save.h index aa206fe5..ac3e7294 100644 --- a/include/save.h +++ b/include/save.h @@ -33,25 +33,27 @@ extern SaveResult HandleSave(u32 idx); * The contents of this structure are read from and written to EEPROM. */ typedef struct { - /*0x000*/ u8 invalid; /**< File is invalid. */ - /*0x001*/ u8 initialized; /**< File is initialized. */ - /*0x002*/ u8 msg_speed; /**< Message speed. */ - /*0x003*/ u8 brightness; /**< Brightness. */ - /*0x004*/ u8 filler4[0x2]; - /*0x006*/ u8 saw_staffroll; - /*0x007*/ u8 unk7; // TODO rolling barrel state? - /*0x008*/ u8 global_progress; /**< @see UpdateGlobalProgress */ - /*0x009*/ u8 field_0x9[0x17]; - /*0x020*/ u16 field_0x20; - /*0x022*/ u8 field_0x22[0x1e]; - /*0x040*/ u32 windcrests; /**< Windcrest flags. */ - /*0x044*/ u8 filler44[0xC]; - /*0x050*/ u32 unk50; - /*0x054*/ u8 filler54[0x8]; - /*0x05C*/ u32 unk5C; - /*0x060*/ u32 areaVisitFlags[8]; /**< Area visit flags. */ - /*0x080*/ char name[FILENAME_LENGTH]; /**< Save file name. */ - /*0x086*/ u8 filler86[0x2]; + /*0x000*/ u8 invalid; /**< File is invalid. */ + /*0x001*/ u8 initialized; /**< File is initialized. */ + /*0x002*/ u8 msg_speed; /**< Message speed. */ + /*0x003*/ u8 brightness; /**< Brightness. */ + /*0x004*/ u8 filler4[0x2]; /**< unused filler */ + /*0x006*/ u8 saw_staffroll; /**< beat the game and watched the credits */ + /*0x007*/ u8 dws_barrel_state; /**< state of the big barrel in DWS, 0 or 2 */ + /*0x008*/ u8 global_progress; /**< @see UpdateGlobalProgress */ + /*0x009*/ u8 available_figurines; /**< figurines available to get */ + /*0x00A*/ u8 fillerA[0x16]; /**< unused filler */ + /*0x020*/ u16 map_hints; /**< bitmask, used by subtask MapHint */ + /*0x022*/ u8 filler22[0x1e]; /**< unused filler */ + /*0x040*/ u32 windcrests; /**< upper 8 bit Windcrest flags @see WindcrestID + * lower bits used for other things */ + /*0x044*/ u8 filler44[0xC]; /**< unused filler */ + /*0x050*/ u32 enemies_killed; /**< number of enemies killed */ + /*0x054*/ u8 filler54[0x8]; /**< unused filler */ + /*0x05C*/ u32 items_bought; /**< number of items bought in stockwells shop */ + /*0x060*/ u32 areaVisitFlags[8]; /**< Area visit flags. */ + /*0x080*/ char name[FILENAME_LENGTH]; /**< Save file name. */ + /*0x086*/ u8 filler86[0x2]; /**< unused filler */ /*0x088*/ PlayerRoomStatus saved_status; /**< Player room status. */ /*0x0A8*/ Stats stats; /**< Player stats. */ /*0x0D0*/ u8 fillerD0[34]; diff --git a/include/windcrest.h b/include/windcrest.h new file mode 100644 index 00000000..2c81c1e4 --- /dev/null +++ b/include/windcrest.h @@ -0,0 +1,15 @@ +#ifndef SAVEFILE_WINDCREST_H +#define SAVEFILE_WINDCREST_H + +typedef enum WindcrestID { + WINDCREST_MT_CRENEL = 24, + WINDCREST_VEIL_FALLS, + WINDCREST_CLOUD_TOPS, + WINDCREST_HYRULE_TOWN, + WINDCREST_LAKE_HYLIA, + WINDCREST_CASTOR_WILDS, + WINDCREST_SOUTH_HYRULE_FIELD, + WINDCREST_MINISH_WOODS, +} WindcrestID; + +#endif // SAVEFILE_WINDCREST_H |
