Plumb through a basic Ge debugger window (no real functionality yet)

This commit is contained in:
Henrik Rydgård 2024-12-01 23:04:42 +01:00
parent e94defbb15
commit 16c6855ef0
7 changed files with 34 additions and 0 deletions

View File

@ -13,6 +13,7 @@
#include <algorithm>
#include "ext/imgui/imgui.h"
#include "Common/Profiler/Profiler.h"
#include "Common/GraphicsContext.h"
@ -1975,3 +1976,14 @@ bool GPUCommon::DescribeCodePtr(const u8 *ptr, std::string &name) {
// which is owned by the drawengine.
return drawEngineCommon_->DescribeCodePtr(ptr, name);
}
void GPUCommon::DrawImGuiDebugger() {
// First, let's list any active display lists.
ImGui::Text("Next list ID: %d", nextListID);
for (auto index : dlQueue) {
const auto &list = dls[index];
ImGui::Text("List %d", list.id);
ImGui::Text("pc: %08x (start: %08x)", list.pc, list.startpc);
ImGui::Text("bbox: %d", (int)list.bboxResult);
}
}

View File

@ -131,6 +131,8 @@ public:
void SwitchToGe();
void DrawImGuiDebugger() override;
uint32_t SetAddrTranslation(uint32_t value) override;
uint32_t GetAddrTranslation() override;

View File

@ -221,6 +221,7 @@ public:
// Tells the GPU to update the gpuStats structure.
virtual void GetStats(char *buffer, size_t bufsize) = 0;
virtual void DrawImGuiDebugger() = 0;
// Invalidate any cached content sourced from the specified range.
// If size = -1, invalidate everything.

View File

@ -821,6 +821,7 @@ void ImDebugger::Frame(MIPSDebugInterface *mipsDebug, GPUDebugInterface *gpuDebu
ImGui::EndMenu();
}
if (ImGui::BeginMenu("Graphics")) {
ImGui::MenuItem("Ge Debugger", nullptr, &cfg_.geDebuggerOpen);
ImGui::MenuItem("Display Output", nullptr, &cfg_.displayOpen);
ImGui::MenuItem("Textures", nullptr, &cfg_.texturesOpen);
ImGui::MenuItem("Framebuffers", nullptr, &cfg_.framebuffersOpen);
@ -919,6 +920,10 @@ void ImDebugger::Frame(MIPSDebugInterface *mipsDebug, GPUDebugInterface *gpuDebu
if (cfg_.structViewerOpen) {
structViewer_.Draw(mipsDebug, &cfg_.structViewerOpen);
}
if (cfg_.geDebuggerOpen) {
DrawGeDebuggerWindow(cfg_);
}
}
void ImDisasmWindow::Draw(MIPSDebugInterface *mipsDebug, bool *open, CoreState coreState) {

View File

@ -78,6 +78,7 @@ struct ImConfig {
bool kernelObjectsOpen;
bool audioChannelsOpen;
bool debugStatsOpen;
bool geDebuggerOpen;
// HLE explorer settings
// bool filterByUsed = true;

View File

@ -68,3 +68,15 @@ void DrawDebugStatsWindow(ImConfig &cfg) {
ImGui::TextUnformatted(statbuf);
ImGui::End();
}
// Stub
void DrawGeDebuggerWindow(ImConfig &cfg) {
if (!ImGui::Begin("Debug Stats", &cfg.geDebuggerOpen)) {
ImGui::End();
return;
}
gpu->DrawImGuiDebugger();
ImGui::End();
}

View File

@ -11,6 +11,7 @@ void DrawFramebuffersWindow(ImConfig &cfg, FramebufferManagerCommon *framebuffer
void DrawTexturesWindow(ImConfig &cfg, TextureCacheCommon *textureCache);
void DrawDisplayWindow(ImConfig &cfg, FramebufferManagerCommon *framebufferManager);
void DrawDebugStatsWindow(ImConfig &cfg);
void DrawGeDebuggerWindow(ImConfig &cfg);
class ImGeDebugger {
public: