Panel for viewing Oracle of Secrets SRAM variables via Mesen2. More...
#include <sram_viewer_panel.h>

Public Member Functions | |
| SramViewerPanel () | |
| ~SramViewerPanel () | |
| void | SetProject (project::YazeProject *project) |
| void | Draw () |
Private Member Functions | |
| void | DrawConnectionHeader () |
| bool | IsConnected () const |
| void | Connect () |
| void | ConnectToPath (const std::string &socket_path) |
| void | Disconnect () |
| void | RefreshSocketList () |
| void | DrawVariableTable () |
| void | DrawGroupHeader (const char *label, uint32_t range_start, uint32_t range_end) |
| void | DrawVariableRow (const core::SramVariable &var) |
| void | DrawCrystalBitfield (uint8_t value, uint32_t address) |
| void | DrawGameStateDropdown (uint8_t value, uint32_t address) |
| void | RefreshValues () |
| void | LoadVariablesFromManifest () |
| void | PokeValue (uint32_t address, uint8_t value) |
Private Attributes | |
| std::shared_ptr< emu::mesen::MesenSocketClient > | client_ |
| project::YazeProject * | project_ = nullptr |
| std::vector< core::SramVariable > | variables_ |
| bool | variables_loaded_ = false |
| std::unordered_map< uint32_t, uint8_t > | current_values_ |
| std::unordered_map< uint32_t, uint8_t > | previous_values_ |
| std::unordered_map< uint32_t, float > | change_timestamps_ |
| bool | auto_refresh_ = true |
| float | refresh_interval_ = 0.2f |
| float | time_since_refresh_ = 0.0f |
| std::string | connection_error_ |
| std::vector< std::string > | socket_paths_ |
| int | selected_socket_index_ = -1 |
| char | socket_path_buffer_ [256] = {} |
| std::string | status_message_ |
| char | filter_text_ [128] = {} |
| bool | editing_active_ = false |
| uint32_t | editing_address_ = 0 |
| int | editing_value_ = 0 |
| bool | story_expanded_ = true |
| bool | dungeon_expanded_ = true |
| bool | items_expanded_ = true |
Panel for viewing Oracle of Secrets SRAM variables via Mesen2.
Reads SRAM variable definitions from the hack manifest and displays their live values from a running Mesen2 emulator. Supports auto-refresh, value editing (poke), bitfield expansion for key addresses (Crystals, GameState), and change highlighting.
Variable grouping:
Definition at line 33 of file sram_viewer_panel.h.
| yaze::editor::SramViewerPanel::SramViewerPanel | ( | ) |
Definition at line 69 of file sram_viewer_panel.cc.
References client_, yaze::emu::mesen::MesenClientRegistry::GetOrCreate(), RefreshSocketList(), selected_socket_index_, socket_path_buffer_, and socket_paths_.

|
default |
|
inline |
Definition at line 38 of file sram_viewer_panel.h.
References project_.
| void yaze::editor::SramViewerPanel::Draw | ( | ) |
Definition at line 192 of file sram_viewer_panel.cc.
References auto_refresh_, DrawConnectionHeader(), DrawVariableTable(), filter_text_, IsConnected(), LoadVariablesFromManifest(), yaze::editor::AgentUI::PopPanelStyle(), project_, yaze::editor::AgentUI::PushPanelStyle(), refresh_interval_, RefreshSocketList(), RefreshValues(), time_since_refresh_, variables_, and variables_loaded_.
|
private |
Definition at line 249 of file sram_viewer_panel.cc.
References auto_refresh_, Connect(), connection_error_, ConnectToPath(), Disconnect(), yaze::editor::AgentUI::GetTheme(), ICON_MD_AUTO_MODE, ICON_MD_CHECK_CIRCLE, ICON_MD_ERROR, ICON_MD_LINK, ICON_MD_LINK_OFF, ICON_MD_MEMORY, ICON_MD_REFRESH, IsConnected(), refresh_interval_, RefreshSocketList(), RefreshValues(), selected_socket_index_, socket_path_buffer_, socket_paths_, and status_message_.
Referenced by Draw().
|
private |
Definition at line 81 of file sram_viewer_panel.cc.
References client_.
Referenced by Draw(), DrawConnectionHeader(), PokeValue(), and RefreshValues().
|
private |
Definition at line 85 of file sram_viewer_panel.cc.
References client_, connection_error_, yaze::emu::mesen::MesenClientRegistry::GetOrCreate(), RefreshValues(), and yaze::emu::mesen::MesenClientRegistry::SetClient().
Referenced by DrawConnectionHeader().

|
private |
Definition at line 99 of file sram_viewer_panel.cc.
References client_, connection_error_, yaze::emu::mesen::MesenClientRegistry::GetOrCreate(), RefreshValues(), and yaze::emu::mesen::MesenClientRegistry::SetClient().
Referenced by DrawConnectionHeader().

|
private |
Definition at line 113 of file sram_viewer_panel.cc.
References client_.
Referenced by DrawConnectionHeader().
|
private |
Definition at line 119 of file sram_viewer_panel.cc.
References yaze::emu::mesen::MesenSocketClient::ListAvailableSockets(), selected_socket_index_, socket_path_buffer_, and socket_paths_.
Referenced by Draw(), DrawConnectionHeader(), and SramViewerPanel().

|
private |
Definition at line 345 of file sram_viewer_panel.cc.
References DrawVariableRow(), dungeon_expanded_, filter_text_, ICON_MD_AUTO_STORIES, ICON_MD_CASTLE, ICON_MD_INVENTORY_2, ICON_MD_MORE_HORIZ, items_expanded_, story_expanded_, and variables_.
Referenced by Draw().

|
private |
|
private |
Definition at line 455 of file sram_viewer_panel.cc.
References yaze::core::SramVariable::address, change_timestamps_, current_values_, DrawCrystalBitfield(), DrawGameStateDropdown(), editing_active_, editing_address_, editing_value_, yaze::editor::AgentUI::GetTheme(), ICON_MD_EDIT, yaze::core::SramVariable::name, and yaze::core::SramVariable::purpose.
Referenced by DrawVariableTable().

|
private |
Definition at line 536 of file sram_viewer_panel.cc.
References PokeValue().
Referenced by DrawVariableRow().

|
private |
Definition at line 562 of file sram_viewer_panel.cc.
References PokeValue().
Referenced by DrawVariableRow().

|
private |
Definition at line 152 of file sram_viewer_panel.cc.
References change_timestamps_, client_, current_values_, IsConnected(), previous_values_, and variables_.
Referenced by Connect(), ConnectToPath(), Draw(), and DrawConnectionHeader().

|
private |
Definition at line 135 of file sram_viewer_panel.cc.
References yaze::project::YazeProject::hack_manifest, yaze::core::HackManifest::loaded(), project_, yaze::core::HackManifest::sram_variables(), variables_, and variables_loaded_.
Referenced by Draw().

|
private |
Definition at line 177 of file sram_viewer_panel.cc.
References client_, current_values_, IsConnected(), and status_message_.
Referenced by DrawCrystalBitfield(), and DrawGameStateDropdown().

|
private |
Definition at line 67 of file sram_viewer_panel.h.
Referenced by Connect(), ConnectToPath(), Disconnect(), IsConnected(), PokeValue(), RefreshValues(), and SramViewerPanel().
|
private |
Definition at line 70 of file sram_viewer_panel.h.
Referenced by Draw(), LoadVariablesFromManifest(), and SetProject().
|
private |
Definition at line 73 of file sram_viewer_panel.h.
Referenced by Draw(), DrawVariableTable(), LoadVariablesFromManifest(), and RefreshValues().
|
private |
Definition at line 74 of file sram_viewer_panel.h.
Referenced by Draw(), and LoadVariablesFromManifest().
|
private |
Definition at line 77 of file sram_viewer_panel.h.
Referenced by DrawVariableRow(), PokeValue(), and RefreshValues().
|
private |
Definition at line 80 of file sram_viewer_panel.h.
Referenced by RefreshValues().
|
private |
Definition at line 83 of file sram_viewer_panel.h.
Referenced by DrawVariableRow(), and RefreshValues().
|
private |
Definition at line 86 of file sram_viewer_panel.h.
Referenced by Draw(), and DrawConnectionHeader().
|
private |
Definition at line 87 of file sram_viewer_panel.h.
Referenced by Draw(), and DrawConnectionHeader().
|
private |
Definition at line 88 of file sram_viewer_panel.h.
Referenced by Draw().
|
private |
Definition at line 89 of file sram_viewer_panel.h.
Referenced by Connect(), ConnectToPath(), and DrawConnectionHeader().
|
private |
Definition at line 90 of file sram_viewer_panel.h.
Referenced by DrawConnectionHeader(), RefreshSocketList(), and SramViewerPanel().
|
private |
Definition at line 91 of file sram_viewer_panel.h.
Referenced by DrawConnectionHeader(), RefreshSocketList(), and SramViewerPanel().
|
private |
Definition at line 92 of file sram_viewer_panel.h.
Referenced by DrawConnectionHeader(), RefreshSocketList(), and SramViewerPanel().
|
private |
Definition at line 93 of file sram_viewer_panel.h.
Referenced by DrawConnectionHeader(), and PokeValue().
|
private |
Definition at line 94 of file sram_viewer_panel.h.
Referenced by Draw(), and DrawVariableTable().
|
private |
Definition at line 97 of file sram_viewer_panel.h.
Referenced by DrawVariableRow().
|
private |
Definition at line 98 of file sram_viewer_panel.h.
Referenced by DrawVariableRow().
|
private |
Definition at line 99 of file sram_viewer_panel.h.
Referenced by DrawVariableRow().
|
private |
Definition at line 102 of file sram_viewer_panel.h.
Referenced by DrawVariableTable().
|
private |
Definition at line 103 of file sram_viewer_panel.h.
Referenced by DrawVariableTable().
|
private |
Definition at line 104 of file sram_viewer_panel.h.
Referenced by DrawVariableTable().