diff --git a/src/core/cdrom.cpp b/src/core/cdrom.cpp index 9eed0ff76..c01752586 100644 --- a/src/core/cdrom.cpp +++ b/src/core/cdrom.cpp @@ -1594,8 +1594,9 @@ void CDROM::DrawDebugWindow() { static const ImVec4 active_color{1.0f, 1.0f, 1.0f, 1.0f}; static const ImVec4 inactive_color{0.4f, 0.4f, 0.4f, 1.0f}; + const float framebuffer_scale = ImGui::GetIO().DisplayFramebufferScale.x; - ImGui::SetNextWindowSize(ImVec2(800, 500), ImGuiCond_FirstUseEver); + ImGui::SetNextWindowSize(ImVec2(800.0f * framebuffer_scale, 500.0f * framebuffer_scale), ImGuiCond_FirstUseEver); if (!ImGui::Begin("CDROM State", &m_system->GetSettings().debugging.show_cdrom_state)) { ImGui::End(); diff --git a/src/core/gpu.cpp b/src/core/gpu.cpp index d57de378f..7a1469dda 100644 --- a/src/core/gpu.cpp +++ b/src/core/gpu.cpp @@ -869,7 +869,9 @@ bool GPU::DumpVRAMToFile(const char* filename, u32 width, u32 height, u32 stride void GPU::DrawDebugStateWindow() { - ImGui::SetNextWindowSize(ImVec2(450, 550), ImGuiCond_FirstUseEver); + const float framebuffer_scale = ImGui::GetIO().DisplayFramebufferScale.x; + + ImGui::SetNextWindowSize(ImVec2(450.0f * framebuffer_scale, 550.0f * framebuffer_scale), ImGuiCond_FirstUseEver); if (!ImGui::Begin("GPU", &m_system->GetSettings().debugging.show_gpu_state)) { ImGui::End(); @@ -888,7 +890,7 @@ void GPU::DrawDebugStateWindow() const Stats& stats = m_last_stats; ImGui::Columns(2); - ImGui::SetColumnWidth(0, 200.0f); + ImGui::SetColumnWidth(0, 200.0f * framebuffer_scale); ImGui::TextUnformatted("Idle Frame: "); ImGui::NextColumn(); diff --git a/src/core/gpu_hw.cpp b/src/core/gpu_hw.cpp index 2e0ff9af9..c9a640d20 100644 --- a/src/core/gpu_hw.cpp +++ b/src/core/gpu_hw.cpp @@ -475,7 +475,7 @@ void GPU_HW::DrawRendererStats(bool is_idle_frame) const auto& stats = m_last_renderer_stats; ImGui::Columns(2); - ImGui::SetColumnWidth(0, 200.0f); + ImGui::SetColumnWidth(0, 200.0f * ImGui::GetIO().DisplayFramebufferScale.x); ImGui::TextUnformatted("Batches Drawn:"); ImGui::NextColumn(); diff --git a/src/core/mdec.cpp b/src/core/mdec.cpp index ad96dd5c4..1fc1be2c6 100644 --- a/src/core/mdec.cpp +++ b/src/core/mdec.cpp @@ -705,7 +705,9 @@ void MDEC::HandleSetScaleCommand() void MDEC::DrawDebugStateWindow() { - ImGui::SetNextWindowSize(ImVec2(300, 350), ImGuiCond_FirstUseEver); + const float framebuffer_scale = ImGui::GetIO().DisplayFramebufferScale.x; + + ImGui::SetNextWindowSize(ImVec2(300.0f * framebuffer_scale, 350.0f * framebuffer_scale), ImGuiCond_FirstUseEver); if (!ImGui::Begin("MDEC State", &m_system->GetSettings().debugging.show_mdec_state)) { ImGui::End(); diff --git a/src/core/spu.cpp b/src/core/spu.cpp index a6bc9275c..337679a5a 100644 --- a/src/core/spu.cpp +++ b/src/core/spu.cpp @@ -789,7 +789,8 @@ static constexpr ADSRTableEntries ComputeADSRTableEntries() { entries[decreasing][rate].ticks = 1; if (decreasing != 0) - entries[decreasing][rate].step = static_cast(static_cast(-8 + static_cast(rate & 3)) << (11 - (rate >> 2))); + entries[decreasing][rate].step = + static_cast(static_cast(-8 + static_cast(rate & 3)) << (11 - (rate >> 2))); else entries[decreasing][rate].step = (7 - static_cast(rate & 3)) << (11 - (rate >> 2)); } @@ -1146,8 +1147,9 @@ void SPU::DrawDebugStateWindow() { static const ImVec4 active_color{1.0f, 1.0f, 1.0f, 1.0f}; static const ImVec4 inactive_color{0.4f, 0.4f, 0.4f, 1.0f}; + const float framebuffer_scale = ImGui::GetIO().DisplayFramebufferScale.x; - ImGui::SetNextWindowSize(ImVec2(800, 600), ImGuiCond_FirstUseEver); + ImGui::SetNextWindowSize(ImVec2(800.0f * framebuffer_scale, 600.0f * framebuffer_scale), ImGuiCond_FirstUseEver); if (!ImGui::Begin("SPU State", &m_system->GetSettings().debugging.show_spu_state)) { ImGui::End(); @@ -1157,9 +1159,11 @@ void SPU::DrawDebugStateWindow() // status if (ImGui::CollapsingHeader("Status", ImGuiTreeNodeFlags_DefaultOpen)) { - static constexpr std::array offsets = {{100.0f, 200.0f, 300.0f, 420.0f, 500.0f, 600.0f}}; static constexpr std::array transfer_modes = { {"Transfer Stopped", "Manual Write", "DMA Write", "DMA Read"}}; + const std::array offsets = {{100.0f * framebuffer_scale, 200.0f * framebuffer_scale, + 300.0f * framebuffer_scale, 420.0f * framebuffer_scale, + 500.0f * framebuffer_scale, 600.0f * framebuffer_scale}}; ImGui::Text("Control: "); ImGui::SameLine(offsets[0]); diff --git a/src/core/timers.cpp b/src/core/timers.cpp index 58f9fc829..2b9bdf3ec 100644 --- a/src/core/timers.cpp +++ b/src/core/timers.cpp @@ -341,7 +341,9 @@ void Timers::DrawDebugStateWindow() {{"SysClk", "HBlank", "SysClk", "HBlank"}}, {{"SysClk", "DotClk", "SysClk/8", "SysClk/8"}}}}; - ImGui::SetNextWindowSize(ImVec2(800, 100), ImGuiCond_FirstUseEver); + const float framebuffer_scale = ImGui::GetIO().DisplayFramebufferScale.x; + + ImGui::SetNextWindowSize(ImVec2(800.0f * framebuffer_scale, 100.0f * framebuffer_scale), ImGuiCond_FirstUseEver); if (!ImGui::Begin("Timer State", &m_system->GetSettings().debugging.show_timers_state)) { ImGui::End(); @@ -349,16 +351,16 @@ void Timers::DrawDebugStateWindow() } ImGui::Columns(NUM_COLUMNS); - ImGui::SetColumnWidth(0, 20.0f); - ImGui::SetColumnWidth(1, 50.0f); - ImGui::SetColumnWidth(2, 50.0f); - ImGui::SetColumnWidth(3, 100.0f); - ImGui::SetColumnWidth(4, 80.0f); - ImGui::SetColumnWidth(5, 80.0f); - ImGui::SetColumnWidth(6, 80.0f); - ImGui::SetColumnWidth(7, 80.0f); - ImGui::SetColumnWidth(8, 80.0f); - ImGui::SetColumnWidth(9, 80.0f); + ImGui::SetColumnWidth(0, 20.0f * framebuffer_scale); + ImGui::SetColumnWidth(1, 50.0f * framebuffer_scale); + ImGui::SetColumnWidth(2, 50.0f * framebuffer_scale); + ImGui::SetColumnWidth(3, 100.0f * framebuffer_scale); + ImGui::SetColumnWidth(4, 80.0f * framebuffer_scale); + ImGui::SetColumnWidth(5, 80.0f * framebuffer_scale); + ImGui::SetColumnWidth(6, 80.0f * framebuffer_scale); + ImGui::SetColumnWidth(7, 80.0f * framebuffer_scale); + ImGui::SetColumnWidth(8, 80.0f * framebuffer_scale); + ImGui::SetColumnWidth(9, 80.0f * framebuffer_scale); for (const char* title : column_names) {