From b89ff3d2123cb6860baea5fce06e63dce868a412 Mon Sep 17 00:00:00 2001 From: irisz64 Date: Tue, 16 Dec 2025 14:16:11 +0100 Subject: [PATCH] Register and disassembly view now separated in different tabs --- src/frontend/Debugger.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/frontend/Debugger.cpp b/src/frontend/Debugger.cpp index 15a6ee3a..8fd98885 100644 --- a/src/frontend/Debugger.cpp +++ b/src/frontend/Debugger.cpp @@ -67,7 +67,10 @@ void InstructionFunc(s64, Disassembler::DisassemblyResult& disasm) { } void Debugger::RegisterView() { - if(!ImGui::BeginTable("Registers", 4, ImGuiTableFlags_SizingStretchSame | ImGuiTableFlags_Resizable | ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersV | ImGuiTableFlags_ContextMenuInBody)) + if(!ImGui::BeginTabItem("Registers")) + return; + + if(!ImGui::BeginTable("##regs", 4, ImGuiTableFlags_SizingStretchSame | ImGuiTableFlags_Resizable | ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersV | ImGuiTableFlags_ContextMenuInBody)) return; ImGui::TableSetupColumn("Name"); @@ -140,6 +143,7 @@ void Debugger::RegisterView() { } ImGui::EndTable(); + ImGui::EndTabItem(); } bool Debugger::render() { @@ -178,10 +182,25 @@ bool Debugger::render() { core.ToggleBreakpoint(startAddr); } + if(!ImGui::BeginTabBar("##debuggerTabs")) { + ImGui::EndTabBar(); + ImGui::End(); + return false; + } + + RegisterView(); + + if(!ImGui::BeginTabItem("MIPS R4300i code view")) { + ImGui::EndTabBar(); + ImGui::End(); + return false; + } + constexpr auto disasmTableFlags = ImGuiTableFlags_SizingFixedSame | ImGuiTableFlags_Resizable | ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersV | ImGuiTableFlags_ContextMenuInBody; if(!ImGui::BeginTable("Disassembly", columns.size(), disasmTableFlags)) { + ImGui::EndTabBar(); ImGui::End(); return false; } @@ -222,7 +241,8 @@ bool Debugger::render() { ImGui::EndTable(); - RegisterView(); + ImGui::EndTabItem(); + ImGui::EndTabBar(); ImGui::End(); return true;