yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
oracle_progression.h
Go to the documentation of this file.
1#ifndef YAZE_CORE_ORACLE_PROGRESSION_H
2#define YAZE_CORE_ORACLE_PROGRESSION_H
3
4#include <cstddef>
5#include <cstdint>
6#include <string>
7
8namespace yaze::core {
9
27 uint8_t crystal_bitfield = 0; // $7EF37A
28 uint8_t game_state = 0; // $7EF3C5
29 uint8_t oosprog = 0; // $7EF3D6
30 uint8_t oosprog2 = 0; // $7EF3C6
31 uint8_t side_quest = 0; // $7EF3D7
32 uint8_t pendants = 0; // $7EF374
33
34 // ─── SRAM offsets (relative to save file start at $7EF000) ────
35
36 static constexpr uint16_t kCrystalOffset = 0x37A;
37 static constexpr uint16_t kGameStateOffset = 0x3C5;
38 static constexpr uint16_t kOosProgOffset = 0x3D6;
39 static constexpr uint16_t kOosProg2Offset = 0x3C6;
40 static constexpr uint16_t kSideQuestOffset = 0x3D7;
41 static constexpr uint16_t kPendantOffset = 0x374;
42
43 // ─── Crystal bit constants ─────────────────────────────────────
44
45 static constexpr uint8_t kCrystalD1 = 0x01; // Mushroom Grotto
46 static constexpr uint8_t kCrystalD6 = 0x02; // Goron Mines
47 static constexpr uint8_t kCrystalD5 = 0x04; // Glacia Estate
48 static constexpr uint8_t kCrystalD7 = 0x08; // Dragon Ship
49 static constexpr uint8_t kCrystalD2 = 0x10; // Tail Palace
50 static constexpr uint8_t kCrystalD4 = 0x20; // Zora Temple
51 static constexpr uint8_t kCrystalD3 = 0x40; // Kalyxo Castle
52
53 // ─── Parsing ───────────────────────────────────────────────────
54
62 static OracleProgressionState ParseFromSRAM(const uint8_t* data, size_t len);
63
64 // ─── Queries ───────────────────────────────────────────────────
65
71 [[nodiscard]] int GetCrystalCount() const;
72
78 [[nodiscard]] bool IsDungeonComplete(int dungeon_number) const;
79
83 [[nodiscard]] std::string GetGameStateName() const;
84
88 [[nodiscard]] static std::string GetDungeonName(int dungeon_number);
89
95 [[nodiscard]] static uint8_t GetCrystalMask(int dungeon_number);
96};
97
98} // namespace yaze::core
99
100#endif // YAZE_CORE_ORACLE_PROGRESSION_H
Oracle of Secrets game progression state parsed from SRAM.
static constexpr uint8_t kCrystalD3
static constexpr uint8_t kCrystalD5
static constexpr uint16_t kSideQuestOffset
static uint8_t GetCrystalMask(int dungeon_number)
Get the crystal bitmask for a dungeon number (1-7).
static constexpr uint16_t kPendantOffset
static OracleProgressionState ParseFromSRAM(const uint8_t *data, size_t len)
Parse progression state from raw SRAM data.
static constexpr uint16_t kGameStateOffset
int GetCrystalCount() const
Count completed dungeons using popcount on crystal bitfield.
static constexpr uint8_t kCrystalD1
static constexpr uint16_t kOosProgOffset
bool IsDungeonComplete(int dungeon_number) const
Check if a specific dungeon is complete.
static constexpr uint8_t kCrystalD6
static constexpr uint8_t kCrystalD2
static std::string GetDungeonName(int dungeon_number)
Get the dungeon name for a dungeon number (1-7).
static constexpr uint16_t kOosProg2Offset
std::string GetGameStateName() const
Get human-readable name for the current game state.
static constexpr uint16_t kCrystalOffset
static constexpr uint8_t kCrystalD7
static constexpr uint8_t kCrystalD4