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 |
| bool | CanUndo () const override |
| bool | CanRedo () const 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 absl::Status | BeginSaveTransaction () |
| virtual void | RollbackSaveTransaction () |
| virtual void | CommitSaveTransaction () |
| virtual void | PrepareForSessionTeardown () |
| virtual std::string | GetUndoDescription () const |
| virtual std::string | GetRedoDescription () const |
| const UndoManager & | undo_manager () const |
| virtual absl::Status | Clear () |
| virtual bool | CanCut () const |
| virtual bool | CanCopy () const |
| virtual bool | CanPaste () const |
| virtual bool | CanFind () const |
| virtual void | ContributeStatus (StatusBar *) |
| virtual EditorContextSnapshot | BuildContextSnapshot () const |
| 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 |
| project::YazeProject * | project () const |
| core::VersionManager * | version_manager () 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 2166 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 732 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 806 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 892 of file assembly_editor.cc.
References active_file_id_, files_, and HasActiveFile().

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

|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 691 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 727 of file assembly_editor.cc.
| void yaze::editor::AssemblyEditor::InlineUpdate | ( | ) |
Definition at line 2016 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 2030 of file assembly_editor.cc.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 2206 of file assembly_editor.cc.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 2211 of file assembly_editor.cc.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 2216 of file assembly_editor.cc.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 2231 of file assembly_editor.cc.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 2236 of file assembly_editor.cc.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 81 of file assembly_editor.h.
|
overridevirtual |
Reimplemented from yaze::editor::Editor.
Definition at line 2221 of file assembly_editor.cc.
References TextEditor::CanUndo().

|
overridevirtual |
Reimplemented from yaze::editor::Editor.
Definition at line 2226 of file assembly_editor.cc.
References TextEditor::CanRedo().

|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 1995 of file assembly_editor.cc.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 2038 of file assembly_editor.cc.
| void yaze::editor::AssemblyEditor::OpenFolder | ( | const std::string & | folder_path | ) |
Definition at line 921 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 2371 of file assembly_editor.cc.
Referenced by DrawBuildOutput().
| absl::Status yaze::editor::AssemblyEditor::ApplyPatchToRom | ( | ) |
Definition at line 2449 of file assembly_editor.cc.
Referenced by DrawBuildOutput().
| void yaze::editor::AssemblyEditor::UpdateErrorMarkers | ( | const core::AsarPatchResult & | result | ) |
Definition at line 2520 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 2565 of file assembly_editor.cc.
|
inline |
|
inline |
|
inline |
Definition at line 102 of file assembly_editor.h.
References asar_initialized_.
|
inline |
Definition at line 103 of file assembly_editor.h.
References symbols_.
|
inline |
Definition at line 106 of file assembly_editor.h.
References asar_.
|
inline |
Definition at line 110 of file assembly_editor.h.
References last_diagnostics_.
|
private |
Definition at line 907 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 914 of file assembly_editor.cc.
References active_file_id_, HasActiveFile(), open_files_, and text_editor_.

|
inlineprivate |
Definition at line 119 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 938 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 966 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, yaze::util::FileDialogWrapper::ShowOpenFolderDialog(), and yaze::gui::ThemedButton().
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(), yaze::gui::GetErrorColor(), yaze::gui::GetWarningColor(), 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, yaze::gui::PrimaryButton(), rom_, yaze::editor::ToastManager::Show(), yaze::gui::ThemedButton(), yaze::editor::EditorDependencies::toast_manager, and ValidateCurrentFile().
Referenced by Initialize().
|
private |
Definition at line 1520 of file assembly_editor.cc.
References yaze::emu::debug::Disassembler65816::DisassembleRange(), yaze::gui::GetAccentColor(), ICON_MD_CANCEL, ICON_MD_REFRESH, yaze::gui::PrimaryButton(), yaze::emu::debug::Disassembler65816::SetSymbolResolver(), yaze::SnesToPc(), and yaze::gui::ThemedButton().
Referenced by Initialize().
|
private |
Definition at line 1886 of file assembly_editor.cc.
References ICON_MD_BUILD, ICON_MD_CHECK_CIRCLE, ICON_MD_FILE_OPEN, ICON_MD_FOLDER_OPEN, ICON_MD_SAVE, and yaze::gui::ThemedIconButton().
Referenced by Initialize().

|
private |
Definition at line 2125 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 2140 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 2577 of file assembly_editor.cc.
References ICON_MD_BUILD, ICON_MD_CAMERA_ALT, ICON_MD_CHECK_CIRCLE, ICON_MD_FILE_UPLOAD, ICON_MD_LIST, yaze::gui::PrimaryButton(), and yaze::gui::ThemedButton().
Referenced by DrawCodeEditor().

|
private |
Definition at line 2069 of file assembly_editor.cc.
Referenced by DrawFileBrowser().
|
private |
Definition at line 1937 of file assembly_editor.cc.
References yaze::gui::BeginThemedTabBar(), yaze::gui::EndThemedTabBar(), and yaze::util::GetFileName().
Referenced by DrawCodeEditor().

|
private |
Definition at line 2055 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 2703 of file assembly_editor.cc.
|
private |
Definition at line 929 of file assembly_editor.cc.
References symbol_jump_cache_, and symbol_jump_negative_cache_.
Referenced by OpenFolder().
|
private |
Definition at line 1502 of file assembly_editor.cc.
Referenced by RunProjectGraphQueryInDrawer().
|
private |
Definition at line 1434 of file assembly_editor.cc.
|
private |
Definition at line 1403 of file assembly_editor.cc.
|
private |
Definition at line 1354 of file assembly_editor.cc.
|
private |
Definition at line 1333 of file assembly_editor.cc.
|
private |
Definition at line 1245 of file assembly_editor.cc.
References yaze::editor::AssemblyEditor::Z3DisasmSourceJump::address, yaze::project::Z3dkSettings::artifact_paths, yaze::Json::contains(), yaze::editor::Editor::dependencies_, yaze::editor::AssemblyEditor::Z3DisasmSourceJump::file, yaze::project::YazeProject::GetZ3dkArtifactPath(), yaze::Json::is_array(), yaze::editor::AssemblyEditor::Z3DisasmSourceJump::line, yaze::editor::EditorDependencies::project, yaze::editor::Editor::project(), SelectedZ3DisasmBankIndex(), yaze::project::Z3dkArtifactPaths::sourcemap_json, z3disasm_hook_jumps_, z3disasm_source_jumps_, and yaze::project::YazeProject::z3dk_settings.
|
private |
Definition at line 1201 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 1132 of file assembly_editor.cc.
|
private |
Definition at line 1150 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 1165 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 1186 of file assembly_editor.cc.
References SelectedZ3DisasmBankIndex().

|
private |
Definition at line 1195 of file assembly_editor.cc.
|
private |
Definition at line 1178 of file assembly_editor.cc.
References z3disasm_selected_path_.
Referenced by BuildProjectGraphBankQuery(), and RefreshSelectedZ3DisassemblyMetadata().
|
private |
Definition at line 1120 of file assembly_editor.cc.
References disasm_query_, and symbols_.
|
friend |
Definition at line 115 of file assembly_editor.h.
|
private |
Definition at line 166 of file assembly_editor.h.
|
private |
Definition at line 167 of file assembly_editor.h.
|
private |
Definition at line 168 of file assembly_editor.h.
Referenced by active_cursor_position(), active_file_path(), GetActiveEditor(), GetActiveEditor(), and HasActiveFile().
|
private |
Definition at line 170 of file assembly_editor.h.
Referenced by active_file_path().
|
private |
Definition at line 171 of file assembly_editor.h.
Referenced by active_cursor_position(), GetActiveEditor(), GetActiveEditor(), and HasActiveFile().
|
private |
Definition at line 172 of file assembly_editor.h.
|
private |
Definition at line 174 of file assembly_editor.h.
Referenced by DrawCodeEditor().
|
private |
Definition at line 175 of file assembly_editor.h.
Referenced by DrawFileBrowser(), JumpToReference(), JumpToSymbolDefinition(), and OpenFolder().
|
private |
Definition at line 176 of file assembly_editor.h.
Referenced by AssemblyEditor(), GetActiveEditor(), GetActiveEditor(), and Initialize().
|
private |
Definition at line 178 of file assembly_editor.h.
Referenced by DrawBuildOutput(), ResolveZ3DisasmOutputDir(), ResolveZ3DisasmRomPath(), rom(), and SetRom().
|
private |
Definition at line 181 of file assembly_editor.h.
Referenced by asar_wrapper(), and RunProjectGraphQueryInDrawer().
|
private |
Definition at line 185 of file assembly_editor.h.
Referenced by is_asar_initialized().
|
private |
Definition at line 186 of file assembly_editor.h.
|
private |
Definition at line 199 of file assembly_editor.h.
Referenced by CurrentDisassemblyBank(), DrawSymbolsContent(), RunProjectGraphQueryInDrawer(), and symbols().
|
private |
Definition at line 200 of file assembly_editor.h.
Referenced by DrawBuildOutput().
|
private |
Definition at line 201 of file assembly_editor.h.
Referenced by DrawBuildOutput().
|
private |
Definition at line 202 of file assembly_editor.h.
Referenced by DrawBuildOutput(), and last_diagnostics().
|
private |
Definition at line 203 of file assembly_editor.h.
|
private |
Definition at line 204 of file assembly_editor.h.
|
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 ResolveZ3DisasmOutputDir().
|
private |
Definition at line 208 of file assembly_editor.h.
|
private |
Definition at line 209 of file assembly_editor.h.
|
private |
Definition at line 210 of file assembly_editor.h.
Referenced by SelectedZ3DisasmBankIndex().
|
private |
Definition at line 211 of file assembly_editor.h.
|
private |
Definition at line 212 of file assembly_editor.h.
Referenced by RefreshSelectedZ3DisassemblyMetadata().
|
private |
Definition at line 213 of file assembly_editor.h.
Referenced by RefreshSelectedZ3DisassemblyMetadata().
|
private |
Definition at line 214 of file assembly_editor.h.
|
private |
Definition at line 215 of file assembly_editor.h.
|
private |
Definition at line 216 of file assembly_editor.h.
Referenced by CurrentDisassemblyBank(), and RunProjectGraphQueryInDrawer().
|
private |
Definition at line 217 of file assembly_editor.h.
|
private |
Definition at line 218 of file assembly_editor.h.
|
private |
Definition at line 222 of file assembly_editor.h.
Referenced by JumpToSymbolDefinition(), and OpenFolder().
|
private |
Definition at line 223 of file assembly_editor.h.
Referenced by ClearSymbolJumpCache(), and JumpToSymbolDefinition().
|
private |
Definition at line 224 of file assembly_editor.h.
Referenced by ClearSymbolJumpCache(), and JumpToSymbolDefinition().