Modern C++ wrapper for Asar 65816 assembler integration. More...
#include <asar_wrapper.h>
Public Member Functions | |
| AsarWrapper () | |
| ~AsarWrapper () | |
| AsarWrapper (const AsarWrapper &)=delete | |
| AsarWrapper & | operator= (const AsarWrapper &)=delete |
| AsarWrapper (AsarWrapper &&)=default | |
| AsarWrapper & | operator= (AsarWrapper &&)=default |
| absl::Status | Initialize () |
| void | Shutdown () |
| bool | IsInitialized () const |
| std::string | GetVersion () const |
| int | GetApiVersion () const |
| absl::StatusOr< AsarPatchResult > | ApplyPatch (const std::string &patch_path, std::vector< uint8_t > &rom_data, const std::vector< std::string > &include_paths={}) |
| absl::StatusOr< AsarPatchResult > | ApplyPatchFromString (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, AsarSymbol > | GetSymbolTable () const |
| std::optional< AsarSymbol > | FindSymbol (const std::string &name) const |
| std::vector< AsarSymbol > | GetSymbolsAtAddress (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, AsarSymbol > | symbol_table_ |
| std::vector< std::string > | last_errors_ |
| std::vector< std::string > | last_warnings_ |
Modern C++ wrapper for Asar 65816 assembler integration.
Provides a high-level interface for:
Definition at line 48 of file asar_wrapper.h.
| yaze::core::AsarWrapper::AsarWrapper | ( | ) |
Definition at line 17 of file asar_wrapper.cc.
| yaze::core::AsarWrapper::~AsarWrapper | ( | ) |
Definition at line 19 of file asar_wrapper.cc.
References initialized_, and Shutdown().

|
delete |
|
default |
|
delete |
|
default |
| absl::Status yaze::core::AsarWrapper::Initialize | ( | ) |
Definition at line 25 of file asar_wrapper.cc.
References initialized_.
| void yaze::core::AsarWrapper::Shutdown | ( | ) |
Definition at line 41 of file asar_wrapper.cc.
References initialized_.
Referenced by ~AsarWrapper().
|
inline |
Definition at line 61 of file asar_wrapper.h.
References initialized_.
| std::string yaze::core::AsarWrapper::GetVersion | ( | ) | const |
Definition at line 48 of file asar_wrapper.cc.
References initialized_.
| int yaze::core::AsarWrapper::GetApiVersion | ( | ) | const |
Definition at line 61 of file asar_wrapper.cc.
References initialized_.
| 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 = {} |
||
| ) |
Definition at line 68 of file asar_wrapper.cc.
References yaze::core::AsarPatchResult::crc32, yaze::core::AsarPatchResult::errors, ExtractSymbolsFromLastOperation(), initialized_, last_errors_, last_warnings_, ProcessErrors(), ProcessWarnings(), Reset(), yaze::core::AsarPatchResult::rom_size, yaze::core::AsarPatchResult::success, symbol_table_, yaze::core::AsarPatchResult::symbols, and yaze::core::AsarPatchResult::warnings.
Referenced by ApplyPatchFromString(), ExtractSymbols(), and ValidateAssembly().

| 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().

| 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().

| std::map< std::string, AsarSymbol > yaze::core::AsarWrapper::GetSymbolTable | ( | ) | const |
Definition at line 185 of file asar_wrapper.cc.
References symbol_table_.
| std::optional< AsarSymbol > yaze::core::AsarWrapper::FindSymbol | ( | const std::string & | name | ) | const |
Definition at line 189 of file asar_wrapper.cc.
References symbol_table_.
| std::vector< AsarSymbol > yaze::core::AsarWrapper::GetSymbolsAtAddress | ( | uint32_t | address | ) | const |
Definition at line 197 of file asar_wrapper.cc.
References symbol_table_.
| void yaze::core::AsarWrapper::Reset | ( | ) |
Definition at line 207 of file asar_wrapper.cc.
References initialized_, last_errors_, last_warnings_, and symbol_table_.
Referenced by ApplyPatch(), ApplyPatchFromString(), and ExtractSymbols().
|
inline |
Definition at line 84 of file asar_wrapper.h.
References last_errors_.
|
inline |
Definition at line 85 of file asar_wrapper.h.
References last_warnings_.
| 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.
| absl::Status yaze::core::AsarWrapper::ValidateAssembly | ( | const std::string & | asm_path | ) |
Definition at line 231 of file asar_wrapper.cc.
References ApplyPatch().

|
private |
Definition at line 249 of file asar_wrapper.cc.
References last_errors_.
Referenced by ApplyPatch().
|
private |
Definition at line 260 of file asar_wrapper.cc.
References last_warnings_.
Referenced by ApplyPatch().
|
private |
Definition at line 271 of file asar_wrapper.cc.
References yaze::core::AsarSymbol::address, yaze::core::AsarSymbol::comment, yaze::core::AsarSymbol::file, yaze::core::AsarSymbol::line, yaze::core::AsarSymbol::name, yaze::core::AsarSymbol::opcode, and symbol_table_.
Referenced by ApplyPatch().
|
private |
Definition at line 291 of file asar_wrapper.cc.
|
private |
Definition at line 94 of file asar_wrapper.h.
Referenced by ApplyPatch(), ApplyPatchFromString(), ExtractSymbols(), GetApiVersion(), GetVersion(), Initialize(), IsInitialized(), Reset(), Shutdown(), and ~AsarWrapper().
|
private |
Definition at line 95 of file asar_wrapper.h.
Referenced by ApplyPatch(), ExtractSymbolsFromLastOperation(), FindSymbol(), GetSymbolsAtAddress(), GetSymbolTable(), and Reset().
|
private |
Definition at line 96 of file asar_wrapper.h.
Referenced by ApplyPatch(), GetLastErrors(), ProcessErrors(), and Reset().
|
private |
Definition at line 97 of file asar_wrapper.h.
Referenced by ApplyPatch(), GetLastWarnings(), ProcessWarnings(), and Reset().