Text editor for modifying assembly code. More...
#include <assembly_editor.h>

Classes | |
| struct | Z3DisasmHookJump |
| struct | Z3DisasmSourceJump |
Public Member Functions | |
| AssemblyEditor (Rom *rom=nullptr) | |
| void | ChangeActiveFile (const std::string_view &filename) |
| absl::Status | JumpToSymbolDefinition (const std::string &symbol) |
| absl::Status | JumpToReference (const std::string &reference) |
| std::string | active_file_path () const |
| TextEditor::Coordinates | active_cursor_position () const |
| void | Initialize () override |
| absl::Status | Load () override |
| void | InlineUpdate () |
| void | UpdateCodeView () |
| absl::Status | Cut () override |
| absl::Status | Copy () override |
| absl::Status | Paste () override |
| absl::Status | Undo () override |
| absl::Status | Redo () override |
| absl::Status | Find () override |
| absl::Status | Update () override |
| absl::Status | Save () override |
| void | OpenFolder (const std::string &folder_path) |
| absl::Status | ValidateCurrentFile () |
| absl::Status | ApplyPatchToRom () |
| void | UpdateErrorMarkers (const core::AsarPatchResult &result) |
| void | ClearErrorMarkers () |
| void | SetRom (Rom *rom) |
| Rom * | rom () const |
| bool | is_asar_initialized () const |
| const std::map< std::string, core::AsarSymbol > & | symbols () const |
| core::AsarWrapper * | asar_wrapper () |
| const std::vector< core::AssemblyDiagnostic > & | last_diagnostics () const |
Public Member Functions inherited from yaze::editor::Editor | |
| Editor ()=default | |
| virtual | ~Editor ()=default |
| virtual void | SetDependencies (const EditorDependencies &deps) |
| virtual void | SetGameData (zelda3::GameData *game_data) |
| virtual std::string | GetUndoDescription () const |
| virtual std::string | GetRedoDescription () const |
| const UndoManager & | undo_manager () const |
| virtual absl::Status | Clear () |
| virtual void | ContributeStatus (StatusBar *) |
| EditorType | type () const |
| bool * | active () |
| void | set_active (bool active) |
| void | toggle_active () |
| virtual bool | IsRomLoaded () const |
| virtual std::string | GetRomStatus () const |
| Rom * | rom () const |
| zelda3::GameData * | game_data () const |
| EditorContext | context () const |
| bool | HasContext () const |
Friends | |
| struct | ::yaze::test::AssemblyEditorGuiTestAccess |
Additional Inherited Members | |
Protected Member Functions inherited from yaze::editor::Editor | |
| std::string | MakePanelTitle (const std::string &base_title) const |
| std::string | MakeWindowId (const std::string &base_id) const |
| template<typename T > | |
| absl::StatusOr< T > | SafeRomAccess (std::function< T()> accessor, const std::string &operation="") const |
Protected Attributes inherited from yaze::editor::Editor | |
| bool | active_ = false |
| EditorType | type_ |
| EditorDependencies | dependencies_ |
| UndoManager | undo_manager_ |
Text editor for modifying assembly code.
Definition at line 45 of file assembly_editor.h.
|
inlineexplicit |
Definition at line 47 of file assembly_editor.h.
References TextEditor::GetDarkPalette(), yaze::editor::kAssembly, TextEditor::SetPalette(), TextEditor::SetShowWhitespaces(), text_editor_, and yaze::editor::Editor::type_.

| void yaze::editor::AssemblyEditor::ChangeActiveFile | ( | const std::string_view & | filename | ) |
Definition at line 2172 of file assembly_editor.cc.
References TextEditor::GetDarkPalette(), yaze::util::GetFileName(), and yaze::util::LoadFile().
Referenced by JumpToReference(), and JumpToSymbolDefinition().

| absl::Status yaze::editor::AssemblyEditor::JumpToSymbolDefinition | ( | const std::string & | symbol | ) |
Definition at line 731 of file assembly_editor.cc.
References ChangeActiveFile(), yaze::project::YazeProject::code_folder, current_folder_, yaze::editor::Editor::dependencies_, yaze::project::YazeProject::GetAbsolutePath(), GetActiveEditor(), HasActiveFile(), yaze::editor::FolderItem::name, OpenFolder(), yaze::editor::EditorDependencies::project, symbol_jump_cache_, symbol_jump_negative_cache_, and symbol_jump_root_.
Referenced by JumpToReference().
| absl::Status yaze::editor::AssemblyEditor::JumpToReference | ( | const std::string & | reference | ) |
Definition at line 805 of file assembly_editor.cc.
References ChangeActiveFile(), yaze::project::YazeProject::code_folder, current_folder_, yaze::editor::Editor::dependencies_, yaze::project::YazeProject::GetAbsolutePath(), GetActiveEditor(), HasActiveFile(), JumpToSymbolDefinition(), yaze::editor::FolderItem::name, OpenFolder(), and yaze::editor::EditorDependencies::project.
Referenced by DrawBuildOutput(), and RunProjectGraphQueryInDrawer().
| std::string yaze::editor::AssemblyEditor::active_file_path | ( | ) | const |
Definition at line 891 of file assembly_editor.cc.
References active_file_id_, files_, and HasActiveFile().

| TextEditor::Coordinates yaze::editor::AssemblyEditor::active_cursor_position | ( | ) | const |
Definition at line 898 of file assembly_editor.cc.
References active_file_id_, HasActiveFile(), TextEditor::Coordinates::Invalid(), and open_files_.

|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 690 of file assembly_editor.cc.
References yaze::editor::Editor::dependencies_, DrawBuildOutput(), DrawCodeEditor(), DrawDisassemblyContent(), DrawFileBrowser(), DrawSymbolsContent(), DrawToolbarContent(), yaze::gui::GetAssemblyLanguageDef(), yaze::editor::WorkspaceWindowManager::RegisterWindowContent(), TextEditor::SetLanguageDefinition(), text_editor_, and yaze::editor::EditorDependencies::window_manager.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 726 of file assembly_editor.cc.
| void yaze::editor::AssemblyEditor::InlineUpdate | ( | ) |
Definition at line 2022 of file assembly_editor.cc.
References TextEditor::CanUndo(), TextEditor::GetCursorPosition(), TextEditor::GetLanguageDefinition(), TextEditor::GetTotalLines(), TextEditor::IsOverwrite(), TextEditor::LanguageDefinition::mName, and TextEditor::Render().
Referenced by yaze::editor::MusicAssemblyPanel::Draw().
| void yaze::editor::AssemblyEditor::UpdateCodeView | ( | ) |
Definition at line 2036 of file assembly_editor.cc.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 2212 of file assembly_editor.cc.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 2217 of file assembly_editor.cc.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 2222 of file assembly_editor.cc.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 2227 of file assembly_editor.cc.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 2232 of file assembly_editor.cc.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 81 of file assembly_editor.h.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 2001 of file assembly_editor.cc.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 2044 of file assembly_editor.cc.
| void yaze::editor::AssemblyEditor::OpenFolder | ( | const std::string & | folder_path | ) |
Definition at line 920 of file assembly_editor.cc.
References ClearSymbolJumpCache(), current_folder_, and symbol_jump_root_.
Referenced by DrawFileBrowser(), JumpToReference(), and JumpToSymbolDefinition().

| absl::Status yaze::editor::AssemblyEditor::ValidateCurrentFile | ( | ) |
Definition at line 2367 of file assembly_editor.cc.
Referenced by DrawBuildOutput().
| absl::Status yaze::editor::AssemblyEditor::ApplyPatchToRom | ( | ) |
Definition at line 2445 of file assembly_editor.cc.
Referenced by DrawBuildOutput().
| void yaze::editor::AssemblyEditor::UpdateErrorMarkers | ( | const core::AsarPatchResult & | result | ) |
Definition at line 2516 of file assembly_editor.cc.
References yaze::core::AsarPatchResult::errors, yaze::core::kError, yaze::core::AsarPatchResult::structured_diagnostics, and yaze::core::AsarPatchResult::warnings.
| void yaze::editor::AssemblyEditor::ClearErrorMarkers | ( | ) |
Definition at line 2561 of file assembly_editor.cc.
|
inline |
|
inline |
|
inline |
Definition at line 99 of file assembly_editor.h.
References asar_initialized_.
|
inline |
Definition at line 100 of file assembly_editor.h.
References symbols_.
|
inline |
Definition at line 103 of file assembly_editor.h.
References asar_.
|
inline |
Definition at line 107 of file assembly_editor.h.
References last_diagnostics_.
|
private |
Definition at line 906 of file assembly_editor.cc.
References active_file_id_, HasActiveFile(), open_files_, and text_editor_.
Referenced by DrawBuildOutput(), DrawCodeEditor(), JumpToReference(), and JumpToSymbolDefinition().

|
private |
Definition at line 913 of file assembly_editor.cc.
References active_file_id_, HasActiveFile(), open_files_, and text_editor_.

|
inlineprivate |
Definition at line 116 of file assembly_editor.h.
References active_file_id_, and open_files_.
Referenced by active_cursor_position(), active_file_path(), DrawBuildOutput(), GetActiveEditor(), GetActiveEditor(), JumpToReference(), and JumpToSymbolDefinition().
|
private |
Definition at line 937 of file assembly_editor.cc.
References TextEditor::CanUndo(), current_file_, DrawAssembleMenu(), DrawEditMenu(), DrawFileMenu(), DrawFileTabView(), GetActiveEditor(), TextEditor::GetCursorPosition(), TextEditor::GetLanguageDefinition(), TextEditor::GetTotalLines(), TextEditor::IsOverwrite(), TextEditor::LanguageDefinition::mName, and TextEditor::Render().
Referenced by Initialize().
|
private |
Definition at line 965 of file assembly_editor.cc.
References yaze::project::YazeProject::code_folder, current_folder_, yaze::editor::Editor::dependencies_, DrawCurrentFolder(), yaze::project::YazeProject::GetAbsolutePath(), ICON_MD_FOLDER_OPEN, yaze::editor::FolderItem::name, OpenFolder(), yaze::editor::EditorDependencies::project, and yaze::util::FileDialogWrapper::ShowOpenFolderDialog().
Referenced by Initialize().

|
private |
Definition at line 993 of file assembly_editor.cc.
References ICON_MD_SEARCH, and symbols_.
Referenced by Initialize().
|
private |
Definition at line 1030 of file assembly_editor.cc.
References ApplyPatchToRom(), yaze::editor::Editor::dependencies_, yaze::editor::DrawDiagnosticsPanel(), GetActiveEditor(), HasActiveFile(), ICON_MD_BUILD, ICON_MD_CHECK_CIRCLE, ICON_MD_ERROR, ICON_MD_WARNING, yaze::Rom::is_loaded(), JumpToReference(), yaze::editor::kError, yaze::editor::kSuccess, last_diagnostics_, last_errors_, last_warnings_, yaze::editor::DiagnosticsPanelCallbacks::on_diagnostic_activated, rom_, yaze::editor::ToastManager::Show(), yaze::editor::EditorDependencies::toast_manager, and ValidateCurrentFile().
Referenced by Initialize().
|
private |
Definition at line 1522 of file assembly_editor.cc.
References yaze::emu::debug::Disassembler65816::DisassembleRange(), ICON_MD_CANCEL, ICON_MD_REFRESH, yaze::emu::debug::Disassembler65816::SetSymbolResolver(), and yaze::SnesToPc().
Referenced by Initialize().

|
private |
Definition at line 1887 of file assembly_editor.cc.
References ICON_MD_BUILD, ICON_MD_CHECK_CIRCLE, ICON_MD_FILE_OPEN, ICON_MD_FOLDER_OPEN, and ICON_MD_SAVE.
Referenced by Initialize().
|
private |
Definition at line 2131 of file assembly_editor.cc.
References ICON_MD_FILE_OPEN, ICON_MD_SAVE, and yaze::util::FileDialogWrapper::ShowOpenFileDialog().
Referenced by DrawCodeEditor().

|
private |
Definition at line 2146 of file assembly_editor.cc.
References ICON_MD_CONTENT_COPY, ICON_MD_CONTENT_CUT, ICON_MD_CONTENT_PASTE, ICON_MD_REDO, ICON_MD_SEARCH, and ICON_MD_UNDO.
Referenced by DrawCodeEditor().
|
private |
Definition at line 2573 of file assembly_editor.cc.
References ICON_MD_BUILD, ICON_MD_CAMERA_ALT, ICON_MD_CHECK_CIRCLE, ICON_MD_FILE_UPLOAD, and ICON_MD_LIST.
Referenced by DrawCodeEditor().
|
private |
Definition at line 2075 of file assembly_editor.cc.
Referenced by DrawFileBrowser().
|
private |
Definition at line 1943 of file assembly_editor.cc.
References yaze::gui::BeginThemedTabBar(), yaze::gui::EndThemedTabBar(), and yaze::util::GetFileName().
Referenced by DrawCodeEditor().

|
private |
Definition at line 2061 of file assembly_editor.cc.
References yaze::gui::Toolset::AddAction(), yaze::gui::Toolset::Begin(), yaze::gui::Toolset::End(), ICON_MD_FOLDER_OPEN, and ICON_MD_SAVE.

|
private |
Definition at line 2699 of file assembly_editor.cc.
|
private |
Definition at line 928 of file assembly_editor.cc.
References symbol_jump_cache_, and symbol_jump_negative_cache_.
Referenced by OpenFolder().
|
private |
Definition at line 1504 of file assembly_editor.cc.
Referenced by RunProjectGraphQueryInDrawer().
|
private |
Definition at line 1436 of file assembly_editor.cc.
|
private |
Definition at line 1405 of file assembly_editor.cc.
|
private |
Definition at line 1356 of file assembly_editor.cc.
|
private |
Definition at line 1335 of file assembly_editor.cc.
|
private |
Definition at line 1247 of file assembly_editor.cc.
References yaze::editor::AssemblyEditor::Z3DisasmSourceJump::address, yaze::Json::contains(), yaze::editor::Editor::dependencies_, yaze::Json::empty(), yaze::editor::AssemblyEditor::Z3DisasmSourceJump::file, yaze::Json::is_array(), yaze::editor::AssemblyEditor::Z3DisasmSourceJump::line, yaze::editor::EditorDependencies::project, SelectedZ3DisasmBankIndex(), z3disasm_hook_jumps_, and z3disasm_source_jumps_.

|
private |
Definition at line 1203 of file assembly_editor.cc.
References asar_, yaze::editor::EditorDependencies::custom_data, yaze::editor::Editor::dependencies_, disasm_query_, JumpToReference(), yaze::editor::RightDrawerManager::kToolOutput, NavigateDisassemblyQuery(), yaze::editor::RightDrawerManager::ToolOutputActions::on_open_address, yaze::editor::RightDrawerManager::ToolOutputActions::on_open_lookup, yaze::editor::RightDrawerManager::ToolOutputActions::on_open_reference, yaze::editor::EditorDependencies::project, yaze::cli::resources::CommandHandler::Run(), RunProjectGraphQueryInDrawer(), yaze::cli::resources::CommandHandler::SetAsarWrapper(), yaze::cli::resources::CommandHandler::SetAssemblySymbolTable(), yaze::cli::resources::CommandHandler::SetProjectContext(), and symbols_.
Referenced by RunProjectGraphQueryInDrawer().
|
private |
Definition at line 1134 of file assembly_editor.cc.
|
private |
Definition at line 1152 of file assembly_editor.cc.
References yaze::editor::Editor::dependencies_, yaze::Rom::filename(), yaze::project::YazeProject::GetZ3dkArtifactPath(), yaze::Rom::is_loaded(), yaze::editor::EditorDependencies::project, rom_, and z3disasm_output_dir_.

|
private |
Definition at line 1167 of file assembly_editor.cc.
References yaze::editor::Editor::dependencies_, yaze::Rom::filename(), yaze::Rom::is_loaded(), yaze::editor::EditorDependencies::project, rom_, yaze::project::YazeProject::rom_filename, yaze::project::Z3dkSettings::rom_path, and yaze::project::YazeProject::z3dk_settings.

|
private |
Definition at line 1188 of file assembly_editor.cc.
References SelectedZ3DisasmBankIndex().

|
private |
Definition at line 1197 of file assembly_editor.cc.
|
private |
Definition at line 1180 of file assembly_editor.cc.
References z3disasm_selected_path_.
Referenced by BuildProjectGraphBankQuery(), and RefreshSelectedZ3DisassemblyMetadata().
|
private |
Definition at line 1122 of file assembly_editor.cc.
References disasm_query_, and symbols_.
|
friend |
Definition at line 112 of file assembly_editor.h.
|
private |
Definition at line 163 of file assembly_editor.h.
|
private |
Definition at line 164 of file assembly_editor.h.
|
private |
Definition at line 165 of file assembly_editor.h.
Referenced by active_cursor_position(), active_file_path(), GetActiveEditor(), GetActiveEditor(), and HasActiveFile().
|
private |
Definition at line 167 of file assembly_editor.h.
Referenced by active_file_path().
|
private |
Definition at line 168 of file assembly_editor.h.
Referenced by active_cursor_position(), GetActiveEditor(), GetActiveEditor(), and HasActiveFile().
|
private |
Definition at line 169 of file assembly_editor.h.
|
private |
Definition at line 171 of file assembly_editor.h.
Referenced by DrawCodeEditor().
|
private |
Definition at line 172 of file assembly_editor.h.
Referenced by DrawFileBrowser(), JumpToReference(), JumpToSymbolDefinition(), and OpenFolder().
|
private |
Definition at line 173 of file assembly_editor.h.
Referenced by AssemblyEditor(), GetActiveEditor(), GetActiveEditor(), and Initialize().
|
private |
Definition at line 175 of file assembly_editor.h.
Referenced by DrawBuildOutput(), ResolveZ3DisasmOutputDir(), ResolveZ3DisasmRomPath(), rom(), and SetRom().
|
private |
Definition at line 178 of file assembly_editor.h.
Referenced by asar_wrapper(), and RunProjectGraphQueryInDrawer().
|
private |
Definition at line 182 of file assembly_editor.h.
Referenced by is_asar_initialized().
|
private |
Definition at line 183 of file assembly_editor.h.
|
private |
Definition at line 196 of file assembly_editor.h.
Referenced by CurrentDisassemblyBank(), DrawSymbolsContent(), RunProjectGraphQueryInDrawer(), and symbols().
|
private |
Definition at line 197 of file assembly_editor.h.
Referenced by DrawBuildOutput().
|
private |
Definition at line 198 of file assembly_editor.h.
Referenced by DrawBuildOutput().
|
private |
Definition at line 199 of file assembly_editor.h.
Referenced by DrawBuildOutput(), and last_diagnostics().
|
private |
Definition at line 200 of file assembly_editor.h.
|
private |
Definition at line 201 of file assembly_editor.h.
|
private |
Definition at line 202 of file assembly_editor.h.
|
private |
Definition at line 203 of file assembly_editor.h.
|
private |
Definition at line 204 of file assembly_editor.h.
Referenced by ResolveZ3DisasmOutputDir().
|
private |
Definition at line 205 of file assembly_editor.h.
|
private |
Definition at line 206 of file assembly_editor.h.
|
private |
Definition at line 207 of file assembly_editor.h.
Referenced by SelectedZ3DisasmBankIndex().
|
private |
Definition at line 208 of file assembly_editor.h.
|
private |
Definition at line 209 of file assembly_editor.h.
Referenced by RefreshSelectedZ3DisassemblyMetadata().
|
private |
Definition at line 210 of file assembly_editor.h.
Referenced by RefreshSelectedZ3DisassemblyMetadata().
|
private |
Definition at line 211 of file assembly_editor.h.
|
private |
Definition at line 212 of file assembly_editor.h.
|
private |
Definition at line 213 of file assembly_editor.h.
Referenced by CurrentDisassemblyBank(), and RunProjectGraphQueryInDrawer().
|
private |
Definition at line 214 of file assembly_editor.h.
|
private |
Definition at line 215 of file assembly_editor.h.
|
private |
Definition at line 219 of file assembly_editor.h.
Referenced by JumpToSymbolDefinition(), and OpenFolder().
|
private |
Definition at line 220 of file assembly_editor.h.
Referenced by ClearSymbolJumpCache(), and JumpToSymbolDefinition().
|
private |
Definition at line 221 of file assembly_editor.h.
Referenced by ClearSymbolJumpCache(), and JumpToSymbolDefinition().