From aad874b179a3e74c98fb355f9b3abb490633642e Mon Sep 17 00:00:00 2001 From: Ignacio Sanchez Gines <863613+drhelius@users.noreply.github.com> Date: Wed, 4 Sep 2024 17:24:48 +0200 Subject: [PATCH] Fix debug windows sizes and positions --- platforms/shared/desktop/config.cpp | 2 +- platforms/shared/desktop/config.h | 2 +- platforms/shared/desktop/gui.cpp | 14 +++++++------- .../shared/desktop/gui_debug_disassembler.cpp | 6 +++--- platforms/shared/desktop/gui_debug_huc6260.cpp | 6 +++--- platforms/shared/desktop/gui_debug_huc6270.cpp | 4 ++-- platforms/shared/desktop/gui_debug_huc6280.cpp | 2 +- platforms/shared/desktop/gui_debug_memory.cpp | 4 ++-- platforms/shared/desktop/gui_debug_psg.cpp | 2 +- .../shared/desktop/gui_debug_trace_logger.cpp | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/platforms/shared/desktop/config.cpp b/platforms/shared/desktop/config.cpp index 97f3573..d3a0158 100644 --- a/platforms/shared/desktop/config.cpp +++ b/platforms/shared/desktop/config.cpp @@ -106,7 +106,7 @@ void config_read(void) config_debug.debug = read_bool("Debug", "Debug", false); config_debug.show_disassembler = read_bool("Debug", "Disassembler", true); config_debug.show_screen = read_bool("Debug", "Screen", true); - config_debug.show_memory = read_bool("Debug", "Memory", true); + config_debug.show_memory = read_bool("Debug", "Memory", false); config_debug.show_processor = read_bool("Debug", "Processor", true); config_debug.show_huc6260_info = read_bool("Debug", "HuC6260Info", false); config_debug.show_huc6260_palettes = read_bool("Debug", "HuC6260Palettes", false); diff --git a/platforms/shared/desktop/config.h b/platforms/shared/desktop/config.h index 78fed4a..486f6b0 100644 --- a/platforms/shared/desktop/config.h +++ b/platforms/shared/desktop/config.h @@ -107,7 +107,7 @@ struct config_Debug bool show_screen = true; bool show_disassembler = true; bool show_processor = true; - bool show_memory = true; + bool show_memory = false; bool show_huc6260_info = false; bool show_huc6260_palettes = false; bool show_huc6270_registers = false; diff --git a/platforms/shared/desktop/gui.cpp b/platforms/shared/desktop/gui.cpp index 65f443c..2bb9e11 100644 --- a/platforms/shared/desktop/gui.cpp +++ b/platforms/shared/desktop/gui.cpp @@ -49,7 +49,7 @@ static void main_window(void); static void push_recent_rom(std::string path); static void show_status_message(void); static void set_style(void); -static ImVec4 Lerp(const ImVec4& a, const ImVec4& b, float t); +static ImVec4 lerp(const ImVec4& a, const ImVec4& b, float t); void gui_init(void) { @@ -357,7 +357,7 @@ static void main_window(void) { flags |= ImGuiWindowFlags_AlwaysAutoResize; - ImGui::SetNextWindowPos(ImVec2(625, 31), ImGuiCond_FirstUseEver); + ImGui::SetNextWindowPos(ImVec2(616, 26), ImGuiCond_FirstUseEver); ImGui::Begin("Output###debug_output", &config_debug.show_screen, flags); gui_main_window_hovered = ImGui::IsWindowHovered(); @@ -542,15 +542,15 @@ static void set_style(void) style.Colors[ImGuiCol_DockingPreview] = style.Colors[ImGuiCol_HeaderActive] * ImVec4(1.0f, 1.0f, 1.0f, 0.7f); style.Colors[ImGuiCol_DockingEmptyBg] = ImVec4(0.20f, 0.20f, 0.20f, 1.00f); style.Colors[ImGuiCol_TabHovered] = style.Colors[ImGuiCol_HeaderHovered]; - //style.Colors[ImGuiCol_Tab] = Lerp(style.Colors[ImGuiCol_Header], style.Colors[ImGuiCol_TitleBgActive], 0.80f); - style.Colors[ImGuiCol_TabSelected] = Lerp(style.Colors[ImGuiCol_HeaderActive], style.Colors[ImGuiCol_TitleBgActive], 0.60f); + //style.Colors[ImGuiCol_Tab] = lerp(style.Colors[ImGuiCol_Header], style.Colors[ImGuiCol_TitleBgActive], 0.80f); + style.Colors[ImGuiCol_TabSelected] = lerp(style.Colors[ImGuiCol_HeaderActive], style.Colors[ImGuiCol_TitleBgActive], 0.60f); style.Colors[ImGuiCol_TabSelectedOverline] = style.Colors[ImGuiCol_HeaderActive]; - style.Colors[ImGuiCol_TabDimmed] = Lerp(style.Colors[ImGuiCol_Tab], style.Colors[ImGuiCol_TitleBg], 0.80f); - style.Colors[ImGuiCol_TabDimmedSelected] = Lerp(style.Colors[ImGuiCol_TabSelected], style.Colors[ImGuiCol_TitleBg], 0.40f); + style.Colors[ImGuiCol_TabDimmed] = lerp(style.Colors[ImGuiCol_Tab], style.Colors[ImGuiCol_TitleBg], 0.80f); + style.Colors[ImGuiCol_TabDimmedSelected] = lerp(style.Colors[ImGuiCol_TabSelected], style.Colors[ImGuiCol_TitleBg], 0.40f); style.Colors[ImGuiCol_TabDimmedSelectedOverline] = ImVec4(0.50f, 0.50f, 0.50f, 1.00f); } -static ImVec4 Lerp(const ImVec4& a, const ImVec4& b, float t) +static ImVec4 lerp(const ImVec4& a, const ImVec4& b, float t) { return ImVec4(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t, a.z + (b.z - a.z) * t, a.w + (b.w - a.w) * t); } diff --git a/platforms/shared/desktop/gui_debug_disassembler.cpp b/platforms/shared/desktop/gui_debug_disassembler.cpp index ea43cd4..f9dcf01 100644 --- a/platforms/shared/desktop/gui_debug_disassembler.cpp +++ b/platforms/shared/desktop/gui_debug_disassembler.cpp @@ -232,8 +232,8 @@ void gui_debug_go_back(void) void gui_debug_window_disassembler(void) { ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 8.0f); - ImGui::SetNextWindowPos(ImVec2(159, 31), ImGuiCond_FirstUseEver); - ImGui::SetNextWindowSize(ImVec2(463, 553), ImGuiCond_FirstUseEver); + ImGui::SetNextWindowPos(ImVec2(155, 26), ImGuiCond_FirstUseEver); + ImGui::SetNextWindowSize(ImVec2(458, 553), ImGuiCond_FirstUseEver); ImGui::Begin("Disassembler", &config_debug.show_disassembler, ImGuiWindowFlags_MenuBar); @@ -545,7 +545,7 @@ static void draw_disassembly(void) ImGui::PushFont(gui_default_font); ImGui::PushStyleColor(ImGuiCol_HeaderHovered, mid_gray); - bool window_visible = ImGui::BeginChild("##dis", ImVec2(ImGui::GetContentRegionAvail().x, 0), true, 0); + bool window_visible = ImGui::BeginChild("##dis", ImVec2(ImGui::GetContentRegionAvail().x, 0), true, ImGuiWindowFlags_HorizontalScrollbar); if (window_visible) { diff --git a/platforms/shared/desktop/gui_debug_huc6260.cpp b/platforms/shared/desktop/gui_debug_huc6260.cpp index 4a79175..5eb547a 100644 --- a/platforms/shared/desktop/gui_debug_huc6260.cpp +++ b/platforms/shared/desktop/gui_debug_huc6260.cpp @@ -34,7 +34,7 @@ void gui_debug_window_huc6260_info(void) { ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 8.0f); ImGui::SetNextWindowPos(ImVec2(75, 228), ImGuiCond_FirstUseEver); - ImGui::SetNextWindowSize(ImVec2(280, 170), ImGuiCond_FirstUseEver); + ImGui::SetNextWindowSize(ImVec2(280, 174), ImGuiCond_FirstUseEver); ImGui::Begin("HuC6260 Info", &config_debug.show_huc6260_info); ImGui::PushFont(gui_default_font); @@ -94,7 +94,7 @@ void gui_debug_window_huc6260_palettes(void) { if (ImGui::BeginTabItem("Background", NULL, ImGuiTabItemFlags_None)) { - ImGui::BeginChild("background_palettes", ImVec2(0, 0.0f), ImGuiChildFlags_None); + ImGui::BeginChild("background_palettes", ImVec2(0, 0.0f), ImGuiChildFlags_None, ImGuiWindowFlags_HorizontalScrollbar); ImGui::PushFont(gui_default_font); ImGui::NewLine(); @@ -144,7 +144,7 @@ void gui_debug_window_huc6260_palettes(void) if (ImGui::BeginTabItem("Sprites", NULL, ImGuiTabItemFlags_None)) { - ImGui::BeginChild("sprite_palettes", ImVec2(0, 0.0f), ImGuiChildFlags_None); + ImGui::BeginChild("sprite_palettes", ImVec2(0, 0.0f), ImGuiChildFlags_None, ImGuiWindowFlags_HorizontalScrollbar); ImGui::PushFont(gui_default_font); ImGui::NewLine(); diff --git a/platforms/shared/desktop/gui_debug_huc6270.cpp b/platforms/shared/desktop/gui_debug_huc6270.cpp index 333b348..cc6151e 100644 --- a/platforms/shared/desktop/gui_debug_huc6270.cpp +++ b/platforms/shared/desktop/gui_debug_huc6270.cpp @@ -371,8 +371,8 @@ void gui_debug_window_huc6270_sprites(void) float scale = 4.0f; ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 8.0f); - ImGui::SetNextWindowPos(ImVec2(79, 120), ImGuiCond_FirstUseEver); - ImGui::SetNextWindowSize(ImVec2(547, 394), ImGuiCond_FirstUseEver); + ImGui::SetNextWindowPos(ImVec2(78, 56), ImGuiCond_FirstUseEver); + ImGui::SetNextWindowSize(ImVec2(546, 500), ImGuiCond_FirstUseEver); ImGui::Begin("HuC6270 Sprites", &config_debug.show_huc6270_sprites); ImGui::PushFont(gui_default_font); diff --git a/platforms/shared/desktop/gui_debug_huc6280.cpp b/platforms/shared/desktop/gui_debug_huc6280.cpp index 8fe846e..b35ba27 100644 --- a/platforms/shared/desktop/gui_debug_huc6280.cpp +++ b/platforms/shared/desktop/gui_debug_huc6280.cpp @@ -31,7 +31,7 @@ void gui_debug_window_huc6280(void) { ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 8.0f); - ImGui::SetNextWindowPos(ImVec2(6, 31), ImGuiCond_FirstUseEver); + ImGui::SetNextWindowPos(ImVec2(3, 26), ImGuiCond_FirstUseEver); ImGui::Begin("HuC6280", &config_debug.show_processor, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoResize); diff --git a/platforms/shared/desktop/gui_debug_memory.cpp b/platforms/shared/desktop/gui_debug_memory.cpp index e08f4a2..9a2efa6 100644 --- a/platforms/shared/desktop/gui_debug_memory.cpp +++ b/platforms/shared/desktop/gui_debug_memory.cpp @@ -43,8 +43,8 @@ void gui_debug_window_memory(void) } ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 8.0f); - ImGui::SetNextWindowPos(ImVec2(625, 321), ImGuiCond_FirstUseEver); - ImGui::SetNextWindowSize(ImVec2(343, 262), ImGuiCond_FirstUseEver); + ImGui::SetNextWindowPos(ImVec2(60, 60), ImGuiCond_FirstUseEver); + ImGui::SetNextWindowSize(ImVec2(670, 330), ImGuiCond_FirstUseEver); ImGui::Begin("Memory Editor", &config_debug.show_memory, ImGuiWindowFlags_MenuBar); diff --git a/platforms/shared/desktop/gui_debug_psg.cpp b/platforms/shared/desktop/gui_debug_psg.cpp index 4fdf8ff..d08b87e 100644 --- a/platforms/shared/desktop/gui_debug_psg.cpp +++ b/platforms/shared/desktop/gui_debug_psg.cpp @@ -59,7 +59,7 @@ void gui_debug_window_psg(void) ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 8.0f); ImGui::SetNextWindowPos(ImVec2(180, 45), ImGuiCond_FirstUseEver); - ImGui::SetNextWindowSize(ImVec2(438, 482), ImGuiCond_FirstUseEver); + ImGui::SetNextWindowSize(ImVec2(444, 400), ImGuiCond_FirstUseEver); ImGui::Begin("PSG", &config_debug.show_psg); GeargrafxCore* core = emu_get_core(); diff --git a/platforms/shared/desktop/gui_debug_trace_logger.cpp b/platforms/shared/desktop/gui_debug_trace_logger.cpp index a77cd58..718d766 100644 --- a/platforms/shared/desktop/gui_debug_trace_logger.cpp +++ b/platforms/shared/desktop/gui_debug_trace_logger.cpp @@ -39,8 +39,8 @@ static const int k_line_count[] = { 1000, 5000, 10000, 50000, 100000, 500000, 10 void gui_debug_window_trace_logger(void) { ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 8.0f); - ImGui::SetNextWindowPos(ImVec2(625, 321), ImGuiCond_FirstUseEver); - ImGui::SetNextWindowSize(ImVec2(343, 262), ImGuiCond_FirstUseEver); + ImGui::SetNextWindowPos(ImVec2(340, 168), ImGuiCond_FirstUseEver); + ImGui::SetNextWindowSize(ImVec2(342, 262), ImGuiCond_FirstUseEver); ImGui::Begin("Trace Logger", &config_debug.show_trace_logger, ImGuiWindowFlags_MenuBar); @@ -74,7 +74,7 @@ void gui_debug_window_trace_logger(void) gui_debug_trace_logger_clear(); } - if (ImGui::BeginChild("##logger", ImVec2(ImGui::GetContentRegionAvail().x, 0), true, 0)) + if (ImGui::BeginChild("##logger", ImVec2(ImGui::GetContentRegionAvail().x, 0), true, ImGuiWindowFlags_HorizontalScrollbar)) { ImGui::PushFont(gui_default_font);