diff options
| author | Pepe20129 <72659707+Pepe20129@users.noreply.github.com> | 2025-01-15 13:04:47 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-15 13:04:47 +0100 |
| commit | 7f31fd2e4ee0f2facafec4aaba5591fed52da9f5 (patch) | |
| tree | a27c54a9c8de4abea16192f93d2f18f43b6c47eb /soh/include | |
| parent | 0d80c4695f1ca275167821b42377741fc0828c58 (diff) | |
Organize ship specific save context additions (#4597)
* Basic restructure
* Undo most randomizerInf changes for now
* Small fixes
* Fix linux & mac builds?
* Fix remnants of randomizerInf changes
* Post-merge fix
* Post-merge fix
Diffstat (limited to 'soh/include')
| -rw-r--r-- | soh/include/z64save.h | 64 |
1 files changed, 41 insertions, 23 deletions
diff --git a/soh/include/z64save.h b/soh/include/z64save.h index 47a2d18c4..7138d0e0a 100644 --- a/soh/include/z64save.h +++ b/soh/include/z64save.h @@ -157,6 +157,42 @@ typedef struct { char hintText[200]; } HintLocationRando; +#pragma region SoH + +typedef struct ShipRandomizerSaveContextData { + u16 adultTradeItems; + u8 triforcePiecesCollected; +} ShipRandomizerSaveContextData; + +typedef struct ShipBossRushSaveContextData { + u32 isPaused; + u8 options[BR_OPTIONS_MAX]; +} ShipBossRushSaveContextData; + +typedef union ShipQuestSpecificSaveContextData { + ShipRandomizerSaveContextData randomizer; + ShipBossRushSaveContextData bossRush; +} ShipQuestSpecificSaveContextData; + +typedef struct ShipQuestSaveContextData { + u8 id; + ShipQuestSpecificSaveContextData data; +} ShipQuestSaveContextData; + +typedef struct ShipSaveContextData { + u16 pendingSale; + u16 pendingSaleMod; + u8 pendingIceTrapCount; + SohStats stats; + FaroresWindData backupFW; + ShipQuestSaveContextData quest; + u8 maskMemory; + //TODO: Move non-rando specific flags to a new sohInf and move the remaining randomizerInf to ShipRandomizerSaveContextData + u16 randomizerInf[(RAND_INF_MAX + 15) / 16]; +} ShipSaveContextData; + +#pragma endregion + typedef struct { /* 0x0000 */ s32 entranceIndex; // start of `save` substruct, originally called "memory" /* 0x0004 */ s32 linkAge; // 0: Adult; 1: Child (see enum `LinkAge`) @@ -270,25 +306,7 @@ typedef struct { /* 0x1420 */ s16 worldMapArea; /* 0x1422 */ s16 sunsSongState; // controls the effects of suns song /* 0x1424 */ s16 healthAccumulator; - // #region SOH [General] - // Upstream TODO: Move these to their own struct or name to more obviously specific to SoH - /* */ u16 pendingSale; - /* */ u16 pendingSaleMod; - /* */ uint8_t questId; - /* */ uint32_t isBossRushPaused; - /* */ uint8_t bossRushOptions[BR_OPTIONS_MAX]; - /* */ u8 pendingIceTrapCount; - /* */ SohStats sohStats; - /* */ FaroresWindData backupFW; - /* */ u8 maskMemory; - // #endregion - // #region SOH [Randomizer] - // Upstream TODO: Move these to their own struct or name to more obviously specific to Randomizer - /* */ u16 randomizerInf[(RAND_INF_MAX + 15) / 16]; - /* */ u8 mqDungeonCount; - /* */ u16 adultTradeItems; - /* */ u8 triforcePiecesCollected; - // #endregion + /* */ ShipSaveContextData ship; } SaveContext; // size = 0x1428 typedef enum { @@ -298,10 +316,10 @@ typedef enum { /* 03 */ QUEST_BOSSRUSH, } Quest; -#define IS_VANILLA (gSaveContext.questId == QUEST_NORMAL) -#define IS_MASTER_QUEST (gSaveContext.questId == QUEST_MASTER) -#define IS_RANDO (gSaveContext.questId == QUEST_RANDOMIZER) -#define IS_BOSS_RUSH (gSaveContext.questId == QUEST_BOSSRUSH) +#define IS_VANILLA (gSaveContext.ship.quest.id == QUEST_NORMAL) +#define IS_MASTER_QUEST (gSaveContext.ship.quest.id == QUEST_MASTER) +#define IS_RANDO (gSaveContext.ship.quest.id == QUEST_RANDOMIZER) +#define IS_BOSS_RUSH (gSaveContext.ship.quest.id == QUEST_BOSSRUSH) typedef enum { /* 0x00 */ BTN_ENABLED, |
