From 2185bbec735df8a61b4f894b908e980ac5360ed6 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sun, 17 May 2020 14:11:42 +1000 Subject: [PATCH] GPU: Display state in debug window --- src/core/gpu.cpp | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/core/gpu.cpp b/src/core/gpu.cpp index d0805fd80..b2277ae1f 100644 --- a/src/core/gpu.cpp +++ b/src/core/gpu.cpp @@ -1298,6 +1298,23 @@ void GPU::DrawDebugStateWindow() DrawRendererStats(is_idle_frame); + if (ImGui::CollapsingHeader("GPU", ImGuiTreeNodeFlags_DefaultOpen)) + { + static constexpr std::array state_strings = { + {"Idle", "Reading VRAM", "Writing VRAM", "Drawing Polyline"}}; + + ImGui::Text("State: %s", state_strings[static_cast(m_blitter_state)]); + ImGui::Text("Dither: %s", m_GPUSTAT.dither_enable ? "Enabled" : "Disabled"); + ImGui::Text("Draw To Displayed Field: %s", m_GPUSTAT.draw_to_displayed_field ? "Enabled" : "Disabled"); + ImGui::Text("Draw Set Mask Bit: %s", m_GPUSTAT.set_mask_while_drawing ? "Yes" : "No"); + ImGui::Text("Draw To Masked Pixels: %s", m_GPUSTAT.check_mask_before_draw ? "Yes" : "No"); + ImGui::Text("Reverse Flag: %s", m_GPUSTAT.reverse_flag ? "Yes" : "No"); + ImGui::Text("Texture Disable: %s", m_GPUSTAT.texture_disable ? "Yes" : "No"); + ImGui::Text("PAL Mode: %s", m_GPUSTAT.pal_mode ? "Yes" : "No"); + ImGui::Text("Interrupt Request: %s", m_GPUSTAT.interrupt_request ? "Yes" : "No"); + ImGui::Text("DMA Request: %s", m_GPUSTAT.dma_data_request ? "Yes" : "No"); + } + if (ImGui::CollapsingHeader("CRTC", ImGuiTreeNodeFlags_DefaultOpen)) { const auto& cs = m_crtc_state; @@ -1323,19 +1340,6 @@ void GPU::DrawDebugStateWindow() cs.display_height - cs.display_vram_height - cs.display_origin_top); } - if (ImGui::CollapsingHeader("GPU", ImGuiTreeNodeFlags_DefaultOpen)) - { - ImGui::Text("Dither: %s", m_GPUSTAT.dither_enable ? "Enabled" : "Disabled"); - ImGui::Text("Draw To Displayed Field: %s", m_GPUSTAT.draw_to_displayed_field ? "Enabled" : "Disabled"); - ImGui::Text("Draw Set Mask Bit: %s", m_GPUSTAT.set_mask_while_drawing ? "Yes" : "No"); - ImGui::Text("Draw To Masked Pixels: %s", m_GPUSTAT.check_mask_before_draw ? "Yes" : "No"); - ImGui::Text("Reverse Flag: %s", m_GPUSTAT.reverse_flag ? "Yes" : "No"); - ImGui::Text("Texture Disable: %s", m_GPUSTAT.texture_disable ? "Yes" : "No"); - ImGui::Text("PAL Mode: %s", m_GPUSTAT.pal_mode ? "Yes" : "No"); - ImGui::Text("Interrupt Request: %s", m_GPUSTAT.interrupt_request ? "Yes" : "No"); - ImGui::Text("DMA Request: %s", m_GPUSTAT.dma_data_request ? "Yes" : "No"); - } - ImGui::End(); }