From 1790a99be52772e4548e40f9f7e720f85794a2e1 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Fri, 11 Apr 2025 14:57:23 -0500 Subject: [PATCH] add a call stack view --- src/gui/csPlayer.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/gui/csPlayer.cpp b/src/gui/csPlayer.cpp index 78328d1db..18922b079 100644 --- a/src/gui/csPlayer.cpp +++ b/src/gui/csPlayer.cpp @@ -538,6 +538,35 @@ void FurnaceGUI::drawCSPlayer() { ImGui::SameLine(); ImGui::Text("%d",cs->getFastCmds()[i]); } + ImGui::Text("ticks: %u",cs->getCurTick()); + ImGui::EndTabItem(); + } + if (ImGui::BeginTabItem(_("Call Stack"))) { + ImGui::PushFont(patFont); + if (ImGui::BeginTable("CSCallStack",chans,ImGuiTableFlags_SizingFixedFit|ImGuiTableFlags_ScrollX)) { + char tempID[32]; + for (int i=0; igetChanState(i); + ImGui::TableNextColumn(); + ImGui::Text("%d (>>%d)",i,state->callStackPos); + } + ImGui::TableNextRow(); + for (int i=0; igetChanState(i); + ImGui::TableNextColumn(); + for (int j=0; jcallStackPos; j++) { + ImGui::Text("$%.4x",state->callStack[j]); + } + ImGui::Text("$%.4x",state->readPos); + } + ImGui::EndTable(); + } + ImGui::PopFont(); ImGui::EndTabItem(); } ImGui::EndTabBar();