yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::emu::debug::SemanticIntrospectionEngine Class Reference

Engine for extracting semantic game state from SNES memory. More...

#include <semantic_introspection.h>

Collaboration diagram for yaze::emu::debug::SemanticIntrospectionEngine:

Public Member Functions

 SemanticIntrospectionEngine (Memory *memory)
 Construct a new Semantic Introspection Engine.
 
 ~SemanticIntrospectionEngine ()=default
 
absl::StatusOr< SemanticGameStateGetSemanticState ()
 Get the complete semantic game state.
 
absl::StatusOr< std::string > GetStateAsJson ()
 Get the semantic state as JSON string.
 
absl::StatusOr< PlayerStateGetPlayerState ()
 Get only the player state.
 
absl::StatusOr< std::vector< SpriteState > > GetSpriteStates ()
 Get all active sprite states.
 
absl::StatusOr< LocationContextGetLocationContext ()
 Get the current location context.
 
absl::StatusOr< GameModeStateGetGameModeState ()
 Get the current game mode state.
 

Private Member Functions

std::string GetGameModeName (uint8_t mode, uint8_t submodule)
 
std::string GetPlayerStateName (uint8_t state)
 
std::string GetPlayerDirectionName (uint8_t direction)
 
std::string GetSpriteTypeName (uint8_t type)
 
std::string GetSpriteStateName (uint8_t state)
 
std::string GetOverworldAreaName (uint8_t area)
 
std::string GetDungeonRoomName (uint16_t room)
 

Private Attributes

Memorymemory_
 

Detailed Description

Engine for extracting semantic game state from SNES memory.

This class provides high-level semantic interpretations of raw SNES RAM values, making it easier for AI agents to understand the game state without needing to know the specific memory addresses or value encodings.

Definition at line 127 of file semantic_introspection.h.

Constructor & Destructor Documentation

◆ SemanticIntrospectionEngine()

yaze::emu::debug::SemanticIntrospectionEngine::SemanticIntrospectionEngine ( Memory * memory)
explicit

Construct a new Semantic Introspection Engine.

Parameters
memoryPointer to the SNES memory interface

Definition at line 14 of file semantic_introspection.cc.

References memory_.

◆ ~SemanticIntrospectionEngine()

yaze::emu::debug::SemanticIntrospectionEngine::~SemanticIntrospectionEngine ( )
default

Member Function Documentation

◆ GetSemanticState()

◆ GetStateAsJson()

absl::StatusOr< std::string > yaze::emu::debug::SemanticIntrospectionEngine::GetStateAsJson ( )

Get the semantic state as JSON string.

Returns
JSON representation of the current game state

Definition at line 63 of file semantic_introspection.cc.

References GetSemanticState().

Here is the call graph for this function:

◆ GetPlayerState()

◆ GetSpriteStates()

◆ GetLocationContext()

◆ GetGameModeState()

absl::StatusOr< GameModeState > yaze::emu::debug::SemanticIntrospectionEngine::GetGameModeState ( )

◆ GetGameModeName()

std::string yaze::emu::debug::SemanticIntrospectionEngine::GetGameModeName ( uint8_t mode,
uint8_t submodule )
private

Definition at line 240 of file semantic_introspection.cc.

Referenced by GetGameModeState().

◆ GetPlayerStateName()

std::string yaze::emu::debug::SemanticIntrospectionEngine::GetPlayerStateName ( uint8_t state)
private

Definition at line 274 of file semantic_introspection.cc.

Referenced by GetPlayerState().

◆ GetPlayerDirectionName()

std::string yaze::emu::debug::SemanticIntrospectionEngine::GetPlayerDirectionName ( uint8_t direction)
private

Definition at line 304 of file semantic_introspection.cc.

Referenced by GetPlayerState().

◆ GetSpriteTypeName()

std::string yaze::emu::debug::SemanticIntrospectionEngine::GetSpriteTypeName ( uint8_t type)
private

Definition at line 314 of file semantic_introspection.cc.

Referenced by GetSpriteStates().

◆ GetSpriteStateName()

std::string yaze::emu::debug::SemanticIntrospectionEngine::GetSpriteStateName ( uint8_t state)
private

Definition at line 564 of file semantic_introspection.cc.

Referenced by GetSpriteStates().

◆ GetOverworldAreaName()

std::string yaze::emu::debug::SemanticIntrospectionEngine::GetOverworldAreaName ( uint8_t area)
private

Definition at line 583 of file semantic_introspection.cc.

Referenced by GetLocationContext().

◆ GetDungeonRoomName()

std::string yaze::emu::debug::SemanticIntrospectionEngine::GetDungeonRoomName ( uint16_t room)
private

Definition at line 659 of file semantic_introspection.cc.

Referenced by GetLocationContext().

Member Data Documentation

◆ memory_

Memory* yaze::emu::debug::SemanticIntrospectionEngine::memory_
private

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