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

Modern C++ wrapper for Asar 65816 assembler integration. More...

#include <asar_wrapper.h>

Public Member Functions

 AsarWrapper ()
 
 ~AsarWrapper ()
 
 AsarWrapper (const AsarWrapper &)=delete
 
AsarWrapperoperator= (const AsarWrapper &)=delete
 
 AsarWrapper (AsarWrapper &&)=default
 
AsarWrapperoperator= (AsarWrapper &&)=default
 
absl::Status Initialize ()
 
void Shutdown ()
 
bool IsInitialized () const
 
std::string GetVersion () const
 
int GetApiVersion () const
 
absl::StatusOr< AsarPatchResultApplyPatch (const std::string &patch_path, std::vector< uint8_t > &rom_data, const std::vector< std::string > &include_paths={})
 
absl::StatusOr< AsarPatchResultApplyPatchFromString (const std::string &patch_content, std::vector< uint8_t > &rom_data, const std::string &base_path="")
 
absl::StatusOr< std::vector< AsarSymbol > > ExtractSymbols (const std::string &asm_path, const std::vector< std::string > &include_paths={})
 
std::map< std::string, AsarSymbolGetSymbolTable () const
 
std::optional< AsarSymbolFindSymbol (const std::string &name) const
 
std::vector< AsarSymbolGetSymbolsAtAddress (uint32_t address) const
 
void Reset ()
 
std::vector< std::string > GetLastErrors () const
 
std::vector< std::string > GetLastWarnings () const
 
absl::Status CreatePatch (const std::vector< uint8_t > &original_rom, const std::vector< uint8_t > &modified_rom, const std::string &patch_path)
 
absl::Status ValidateAssembly (const std::string &asm_path)
 

Private Member Functions

void ProcessErrors ()
 
void ProcessWarnings ()
 
void ExtractSymbolsFromLastOperation ()
 
AsarSymbol ConvertAsarSymbol (const void *asar_symbol_data) const
 

Private Attributes

bool initialized_
 
std::map< std::string, AsarSymbolsymbol_table_
 
std::vector< std::string > last_errors_
 
std::vector< std::string > last_warnings_
 

Detailed Description

Modern C++ wrapper for Asar 65816 assembler integration.

Provides a high-level interface for:

  • Patching ROMs with assembly code
  • Extracting symbol names and opcodes
  • Cross-platform compatibility (Windows, macOS, Linux)

Definition at line 48 of file asar_wrapper.h.

Constructor & Destructor Documentation

◆ AsarWrapper() [1/3]

yaze::core::AsarWrapper::AsarWrapper ( )

Definition at line 17 of file asar_wrapper.cc.

◆ ~AsarWrapper()

yaze::core::AsarWrapper::~AsarWrapper ( )

Definition at line 19 of file asar_wrapper.cc.

References initialized_, and Shutdown().

Here is the call graph for this function:

◆ AsarWrapper() [2/3]

yaze::core::AsarWrapper::AsarWrapper ( const AsarWrapper )
delete

◆ AsarWrapper() [3/3]

yaze::core::AsarWrapper::AsarWrapper ( AsarWrapper &&  )
default

Member Function Documentation

◆ operator=() [1/2]

AsarWrapper & yaze::core::AsarWrapper::operator= ( const AsarWrapper )
delete

◆ operator=() [2/2]

AsarWrapper & yaze::core::AsarWrapper::operator= ( AsarWrapper &&  )
default

◆ Initialize()

absl::Status yaze::core::AsarWrapper::Initialize ( )

Definition at line 25 of file asar_wrapper.cc.

References initialized_.

◆ Shutdown()

void yaze::core::AsarWrapper::Shutdown ( )

Definition at line 41 of file asar_wrapper.cc.

References initialized_.

Referenced by ~AsarWrapper().

◆ IsInitialized()

bool yaze::core::AsarWrapper::IsInitialized ( ) const
inline

Definition at line 61 of file asar_wrapper.h.

References initialized_.

◆ GetVersion()

std::string yaze::core::AsarWrapper::GetVersion ( ) const

Definition at line 48 of file asar_wrapper.cc.

References initialized_.

◆ GetApiVersion()

int yaze::core::AsarWrapper::GetApiVersion ( ) const

Definition at line 61 of file asar_wrapper.cc.

References initialized_.

◆ ApplyPatch()

absl::StatusOr< AsarPatchResult > yaze::core::AsarWrapper::ApplyPatch ( const std::string &  patch_path,
std::vector< uint8_t > &  rom_data,
const std::vector< std::string > &  include_paths = {} 
)

◆ ApplyPatchFromString()

absl::StatusOr< AsarPatchResult > yaze::core::AsarWrapper::ApplyPatchFromString ( const std::string &  patch_content,
std::vector< uint8_t > &  rom_data,
const std::string &  base_path = "" 
)

Definition at line 130 of file asar_wrapper.cc.

References ApplyPatch(), initialized_, and Reset().

Here is the call graph for this function:

◆ ExtractSymbols()

absl::StatusOr< std::vector< AsarSymbol > > yaze::core::AsarWrapper::ExtractSymbols ( const std::string &  asm_path,
const std::vector< std::string > &  include_paths = {} 
)

Definition at line 164 of file asar_wrapper.cc.

References ApplyPatch(), initialized_, and Reset().

Here is the call graph for this function:

◆ GetSymbolTable()

std::map< std::string, AsarSymbol > yaze::core::AsarWrapper::GetSymbolTable ( ) const

Definition at line 185 of file asar_wrapper.cc.

References symbol_table_.

◆ FindSymbol()

std::optional< AsarSymbol > yaze::core::AsarWrapper::FindSymbol ( const std::string &  name) const

Definition at line 189 of file asar_wrapper.cc.

References symbol_table_.

◆ GetSymbolsAtAddress()

std::vector< AsarSymbol > yaze::core::AsarWrapper::GetSymbolsAtAddress ( uint32_t  address) const

Definition at line 197 of file asar_wrapper.cc.

References symbol_table_.

◆ Reset()

void yaze::core::AsarWrapper::Reset ( )

◆ GetLastErrors()

std::vector< std::string > yaze::core::AsarWrapper::GetLastErrors ( ) const
inline

Definition at line 84 of file asar_wrapper.h.

References last_errors_.

◆ GetLastWarnings()

std::vector< std::string > yaze::core::AsarWrapper::GetLastWarnings ( ) const
inline

Definition at line 85 of file asar_wrapper.h.

References last_warnings_.

◆ CreatePatch()

absl::Status yaze::core::AsarWrapper::CreatePatch ( const std::vector< uint8_t > &  original_rom,
const std::vector< uint8_t > &  modified_rom,
const std::string &  patch_path 
)

Definition at line 216 of file asar_wrapper.cc.

◆ ValidateAssembly()

absl::Status yaze::core::AsarWrapper::ValidateAssembly ( const std::string &  asm_path)

Definition at line 231 of file asar_wrapper.cc.

References ApplyPatch().

Here is the call graph for this function:

◆ ProcessErrors()

void yaze::core::AsarWrapper::ProcessErrors ( )
private

Definition at line 249 of file asar_wrapper.cc.

References last_errors_.

Referenced by ApplyPatch().

◆ ProcessWarnings()

void yaze::core::AsarWrapper::ProcessWarnings ( )
private

Definition at line 260 of file asar_wrapper.cc.

References last_warnings_.

Referenced by ApplyPatch().

◆ ExtractSymbolsFromLastOperation()

void yaze::core::AsarWrapper::ExtractSymbolsFromLastOperation ( )
private

◆ ConvertAsarSymbol()

AsarSymbol yaze::core::AsarWrapper::ConvertAsarSymbol ( const void *  asar_symbol_data) const
private

Definition at line 291 of file asar_wrapper.cc.

Member Data Documentation

◆ initialized_

bool yaze::core::AsarWrapper::initialized_
private

◆ symbol_table_

std::map<std::string, AsarSymbol> yaze::core::AsarWrapper::symbol_table_
private

◆ last_errors_

std::vector<std::string> yaze::core::AsarWrapper::last_errors_
private

Definition at line 96 of file asar_wrapper.h.

Referenced by ApplyPatch(), GetLastErrors(), ProcessErrors(), and Reset().

◆ last_warnings_

std::vector<std::string> yaze::core::AsarWrapper::last_warnings_
private

Definition at line 97 of file asar_wrapper.h.

Referenced by ApplyPatch(), GetLastWarnings(), ProcessWarnings(), and Reset().


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