yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::core::OracleProgressionState Struct Reference

Oracle of Secrets game progression state parsed from SRAM. More...

#include <oracle_progression.h>

Public Member Functions

int GetCrystalCount () const
 Count completed dungeons using popcount on crystal bitfield.
 
bool IsDungeonComplete (int dungeon_number) const
 Check if a specific dungeon is complete.
 
std::string GetGameStateName () const
 Get human-readable name for the current game state.
 

Static Public Member Functions

static OracleProgressionState ParseFromSRAM (const uint8_t *data, size_t len)
 Parse progression state from raw SRAM data.
 
static std::string GetDungeonName (int dungeon_number)
 Get the dungeon name for a dungeon number (1-7).
 
static uint8_t GetCrystalMask (int dungeon_number)
 Get the crystal bitmask for a dungeon number (1-7).
 

Public Attributes

uint8_t crystal_bitfield = 0
 
uint8_t game_state = 0
 
uint8_t oosprog = 0
 
uint8_t oosprog2 = 0
 
uint8_t side_quest = 0
 
uint8_t pendants = 0
 

Static Public Attributes

static constexpr uint16_t kCrystalOffset = 0x37A
 
static constexpr uint16_t kGameStateOffset = 0x3C5
 
static constexpr uint16_t kOosProgOffset = 0x3D6
 
static constexpr uint16_t kOosProg2Offset = 0x3C6
 
static constexpr uint16_t kSideQuestOffset = 0x3D7
 
static constexpr uint16_t kPendantOffset = 0x374
 
static constexpr uint8_t kCrystalD1 = 0x01
 
static constexpr uint8_t kCrystalD6 = 0x02
 
static constexpr uint8_t kCrystalD5 = 0x04
 
static constexpr uint8_t kCrystalD7 = 0x08
 
static constexpr uint8_t kCrystalD2 = 0x10
 
static constexpr uint8_t kCrystalD4 = 0x20
 
static constexpr uint8_t kCrystalD3 = 0x40
 

Detailed Description

Oracle of Secrets game progression state parsed from SRAM.

This struct represents the key SRAM variables that track game progress:

  • Crystal bitfield ($7EF37A) — non-sequential bit mapping for 7 dungeons
  • Game state ($7EF3C5) — main story phase
  • Story flags ($7EF3D6, $7EF3C6) — individual story events
  • Side quest progress ($7EF3D7) — optional content tracking
  • Pendants ($7EF374) — shrine completion tracking

Crystal bit mapping (intentionally non-sequential for non-linear design): D1 Mushroom Grotto = 0x01 D2 Tail Palace = 0x10 D6 Goron Mines = 0x02 D4 Zora Temple = 0x20 D5 Glacia Estate = 0x04 D3 Kalyxo Castle = 0x40 D7 Dragon Ship = 0x08

Definition at line 26 of file oracle_progression.h.

Member Function Documentation

◆ ParseFromSRAM()

OracleProgressionState yaze::core::OracleProgressionState::ParseFromSRAM ( const uint8_t * data,
size_t len )
static

Parse progression state from raw SRAM data.

Parameters
dataPointer to SRAM data starting at $7EF000.
lenLength of the data buffer.
Returns
Parsed state. Fields default to 0 if offset is out of range.

Definition at line 5 of file oracle_progression.cc.

References crystal_bitfield, game_state, kCrystalOffset, kGameStateOffset, kOosProg2Offset, kOosProgOffset, kPendantOffset, kSideQuestOffset, oosprog, oosprog2, pendants, and side_quest.

Referenced by yaze::core::LoadOracleProgressionFromSrmFile().

◆ GetCrystalCount()

int yaze::core::OracleProgressionState::GetCrystalCount ( ) const

Count completed dungeons using popcount on crystal bitfield.

Only counts the 7 valid crystal bits (D1-D7). Upper bit is unused.

Definition at line 24 of file oracle_progression.cc.

References crystal_bitfield.

Referenced by yaze::editor::ProgressionDashboardPanel::DrawCrystalTracker().

◆ IsDungeonComplete()

bool yaze::core::OracleProgressionState::IsDungeonComplete ( int dungeon_number) const

Check if a specific dungeon is complete.

Parameters
dungeon_number1-7 (D1-D7). Returns false for out-of-range.

Definition at line 35 of file oracle_progression.cc.

References crystal_bitfield, and GetCrystalMask().

Referenced by yaze::editor::ProgressionDashboardPanel::DrawDungeonGrid().

Here is the call graph for this function:

◆ GetGameStateName()

std::string yaze::core::OracleProgressionState::GetGameStateName ( ) const

Get human-readable name for the current game state.

Definition at line 40 of file oracle_progression.cc.

References game_state.

Referenced by yaze::editor::ProgressionDashboardPanel::DrawGameState().

◆ GetDungeonName()

std::string yaze::core::OracleProgressionState::GetDungeonName ( int dungeon_number)
static

Get the dungeon name for a dungeon number (1-7).

Definition at line 55 of file oracle_progression.cc.

◆ GetCrystalMask()

uint8_t yaze::core::OracleProgressionState::GetCrystalMask ( int dungeon_number)
static

Get the crystal bitmask for a dungeon number (1-7).

Returns 0 for out-of-range values.

Definition at line 76 of file oracle_progression.cc.

References kCrystalD1, kCrystalD2, kCrystalD3, kCrystalD4, kCrystalD5, kCrystalD6, and kCrystalD7.

Referenced by yaze::editor::ProgressionDashboardPanel::DrawCrystalTracker(), and IsDungeonComplete().

Member Data Documentation

◆ crystal_bitfield

◆ game_state

◆ oosprog

◆ oosprog2

◆ side_quest

◆ pendants

◆ kCrystalOffset

constexpr uint16_t yaze::core::OracleProgressionState::kCrystalOffset = 0x37A
staticconstexpr

◆ kGameStateOffset

constexpr uint16_t yaze::core::OracleProgressionState::kGameStateOffset = 0x3C5
staticconstexpr

◆ kOosProgOffset

constexpr uint16_t yaze::core::OracleProgressionState::kOosProgOffset = 0x3D6
staticconstexpr

◆ kOosProg2Offset

constexpr uint16_t yaze::core::OracleProgressionState::kOosProg2Offset = 0x3C6
staticconstexpr

◆ kSideQuestOffset

constexpr uint16_t yaze::core::OracleProgressionState::kSideQuestOffset = 0x3D7
staticconstexpr

◆ kPendantOffset

constexpr uint16_t yaze::core::OracleProgressionState::kPendantOffset = 0x374
staticconstexpr

◆ kCrystalD1

constexpr uint8_t yaze::core::OracleProgressionState::kCrystalD1 = 0x01
staticconstexpr

Definition at line 45 of file oracle_progression.h.

Referenced by GetCrystalMask().

◆ kCrystalD6

constexpr uint8_t yaze::core::OracleProgressionState::kCrystalD6 = 0x02
staticconstexpr

Definition at line 46 of file oracle_progression.h.

Referenced by GetCrystalMask().

◆ kCrystalD5

constexpr uint8_t yaze::core::OracleProgressionState::kCrystalD5 = 0x04
staticconstexpr

Definition at line 47 of file oracle_progression.h.

Referenced by GetCrystalMask().

◆ kCrystalD7

constexpr uint8_t yaze::core::OracleProgressionState::kCrystalD7 = 0x08
staticconstexpr

Definition at line 48 of file oracle_progression.h.

Referenced by GetCrystalMask().

◆ kCrystalD2

constexpr uint8_t yaze::core::OracleProgressionState::kCrystalD2 = 0x10
staticconstexpr

Definition at line 49 of file oracle_progression.h.

Referenced by GetCrystalMask().

◆ kCrystalD4

constexpr uint8_t yaze::core::OracleProgressionState::kCrystalD4 = 0x20
staticconstexpr

Definition at line 50 of file oracle_progression.h.

Referenced by GetCrystalMask().

◆ kCrystalD3

constexpr uint8_t yaze::core::OracleProgressionState::kCrystalD3 = 0x40
staticconstexpr

Definition at line 51 of file oracle_progression.h.

Referenced by GetCrystalMask().


The documentation for this struct was generated from the following files: