Skip to content

Commit

Permalink
Fix debug windows sizes and positions
Browse files Browse the repository at this point in the history
  • Loading branch information
drhelius committed Sep 4, 2024
1 parent 69f2564 commit aad874b
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion platforms/shared/desktop/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion platforms/shared/desktop/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 7 additions & 7 deletions platforms/shared/desktop/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
}
6 changes: 3 additions & 3 deletions platforms/shared/desktop/gui_debug_disassembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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)
{
Expand Down
6 changes: 3 additions & 3 deletions platforms/shared/desktop/gui_debug_huc6260.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions platforms/shared/desktop/gui_debug_huc6270.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion platforms/shared/desktop/gui_debug_huc6280.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions platforms/shared/desktop/gui_debug_memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion platforms/shared/desktop/gui_debug_psg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions platforms/shared/desktop/gui_debug_trace_logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit aad874b

Please sign in to comment.