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={}) |
| absl::Status | LoadSymbolsFromFile (const std::string &symbol_path) |
| 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 | |
| absl::StatusOr< AsarPatchResult > | ApplyPatchWithBinary (const std::string &patch_path, std::vector< uint8_t > &rom_data, const std::vector< std::string > &include_paths) |
| absl::StatusOr< AsarPatchResult > | ApplyPatchWithLibrary (const std::string &patch_path, std::vector< uint8_t > &rom_data, const std::vector< std::string > &include_paths) |
| std::optional< std::string > | ResolveAsarBinary () const |
| void | ProcessErrors () |
| void | ProcessWarnings () |
| void | ExtractSymbolsFromLastOperation () |
| AsarSymbol | ConvertAsarSymbol (const void *asar_symbol_data) const |
Private Attributes | |
| bool | initialized_ |
| bool | library_enabled_ |
| 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 23 of file asar_wrapper.cc.
| yaze::core::AsarWrapper::~AsarWrapper | ( | ) |
Definition at line 25 of file asar_wrapper.cc.
References initialized_, and Shutdown().

|
delete |
|
default |
|
delete |
|
default |
| absl::Status yaze::core::AsarWrapper::Initialize | ( | ) |
Definition at line 31 of file asar_wrapper.cc.
References initialized_, and library_enabled_.
Referenced by yaze::core::PatchManager::ApplyEnabledPatches(), yaze::editor::AssemblyEditor::ApplyPatchToRom(), yaze::cli::anonymous_namespace{overworld_doctor_commands.cc}::ApplyTailExpansion(), yaze::cli::handlers::ProjectBuildCommandHandler::Execute(), and yaze::editor::AssemblyEditor::ValidateCurrentFile().
| void yaze::core::AsarWrapper::Shutdown | ( | ) |
Definition at line 56 of file asar_wrapper.cc.
References initialized_, and library_enabled_.
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 64 of file asar_wrapper.cc.
References initialized_, and library_enabled_.
| int yaze::core::AsarWrapper::GetApiVersion | ( | ) | const |
Definition at line 85 of file asar_wrapper.cc.
References initialized_, and library_enabled_.
| absl::Status 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 95 of file asar_wrapper.cc.
References ApplyPatchWithBinary(), ApplyPatchWithLibrary(), initialized_, last_errors_, library_enabled_, and Reset().
Referenced by yaze::core::PatchManager::ApplyEnabledPatches(), ApplyPatchFromString(), yaze::editor::AssemblyEditor::ApplyPatchToRom(), yaze::cli::anonymous_namespace{overworld_doctor_commands.cc}::ApplyTailExpansion(), yaze::cli::handlers::ProjectBuildCommandHandler::Execute(), 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 121 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 154 of file asar_wrapper.cc.
References ApplyPatch(), initialized_, library_enabled_, and Reset().

| absl::Status yaze::core::AsarWrapper::LoadSymbolsFromFile | ( | const std::string & | symbol_path | ) |
Definition at line 478 of file asar_wrapper.cc.
References yaze::core::AsarSymbol::address, yaze::core::AsarSymbol::name, and symbol_table_.
Referenced by yaze::editor::AssemblyEditor::DrawAssembleMenu().
| std::map< std::string, AsarSymbol > yaze::core::AsarWrapper::GetSymbolTable | ( | ) | const |
Definition at line 182 of file asar_wrapper.cc.
References symbol_table_.
Referenced by yaze::editor::AssemblyEditor::ApplyPatchToRom(), yaze::editor::AssemblyEditor::DrawAssembleMenu(), and yaze::cli::agent::tools::ProjectGraphTool::GetSymbolTable().
| std::optional< AsarSymbol > yaze::core::AsarWrapper::FindSymbol | ( | const std::string & | name | ) | const |
Definition at line 186 of file asar_wrapper.cc.
References symbol_table_.
| std::vector< AsarSymbol > yaze::core::AsarWrapper::GetSymbolsAtAddress | ( | uint32_t | address | ) | const |
Definition at line 194 of file asar_wrapper.cc.
References symbol_table_.
| void yaze::core::AsarWrapper::Reset | ( | ) |
Definition at line 204 of file asar_wrapper.cc.
References initialized_, last_errors_, last_warnings_, library_enabled_, and symbol_table_.
Referenced by ApplyPatch(), ApplyPatchFromString(), and ExtractSymbols().
|
inline |
Definition at line 86 of file asar_wrapper.h.
References last_errors_.
|
inline |
Definition at line 87 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 215 of file asar_wrapper.cc.
| absl::Status yaze::core::AsarWrapper::ValidateAssembly | ( | const std::string & | asm_path | ) |
Definition at line 227 of file asar_wrapper.cc.
References ApplyPatch(), and library_enabled_.
Referenced by yaze::editor::AssemblyEditor::ValidateCurrentFile().

|
private |
Definition at line 346 of file asar_wrapper.cc.
References yaze::core::AsarPatchResult::crc32, last_errors_, last_warnings_, ResolveAsarBinary(), yaze::core::AsarPatchResult::rom_size, and yaze::core::AsarPatchResult::success.
Referenced by ApplyPatch().

|
private |
Definition at line 282 of file asar_wrapper.cc.
References yaze::core::AsarPatchResult::crc32, yaze::core::AsarPatchResult::errors, ExtractSymbolsFromLastOperation(), initialized_, last_errors_, last_warnings_, library_enabled_, ProcessErrors(), ProcessWarnings(), yaze::core::AsarPatchResult::rom_size, yaze::core::AsarPatchResult::success, symbol_table_, yaze::core::AsarPatchResult::symbols, and yaze::core::AsarPatchResult::warnings.
Referenced by ApplyPatch().

|
private |
Definition at line 454 of file asar_wrapper.cc.
Referenced by ApplyPatchWithBinary().
|
private |
Definition at line 256 of file asar_wrapper.cc.
References last_errors_.
Referenced by ApplyPatchWithLibrary().
|
private |
Definition at line 269 of file asar_wrapper.cc.
References last_warnings_.
Referenced by ApplyPatchWithLibrary().
|
private |
Definition at line 527 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 ApplyPatchWithLibrary().
|
private |
Definition at line 549 of file asar_wrapper.cc.
|
private |
Definition at line 106 of file asar_wrapper.h.
Referenced by ApplyPatch(), ApplyPatchFromString(), ApplyPatchWithLibrary(), ExtractSymbols(), GetApiVersion(), GetVersion(), Initialize(), IsInitialized(), Reset(), Shutdown(), and ~AsarWrapper().
|
private |
Definition at line 107 of file asar_wrapper.h.
Referenced by ApplyPatch(), ApplyPatchWithLibrary(), ExtractSymbols(), GetApiVersion(), GetVersion(), Initialize(), Reset(), Shutdown(), and ValidateAssembly().
|
private |
Definition at line 108 of file asar_wrapper.h.
Referenced by ApplyPatchWithLibrary(), ExtractSymbolsFromLastOperation(), FindSymbol(), GetSymbolsAtAddress(), GetSymbolTable(), LoadSymbolsFromFile(), and Reset().
|
private |
Definition at line 109 of file asar_wrapper.h.
Referenced by ApplyPatch(), ApplyPatchWithBinary(), ApplyPatchWithLibrary(), GetLastErrors(), ProcessErrors(), and Reset().
|
private |
Definition at line 110 of file asar_wrapper.h.
Referenced by ApplyPatchWithBinary(), ApplyPatchWithLibrary(), GetLastWarnings(), ProcessWarnings(), and Reset().