From 8499ccb692eca0e0fafed8873f6b98aaef6fbb17 Mon Sep 17 00:00:00 2001 From: Andrea Odetti Date: Sat, 6 Mar 2021 18:00:31 +0000 Subject: [PATCH] Add info about g_nAppMode to settings. Signed-off-by: Andrea Odetti --- source/frontends/sdl/imgui/sdlsettings.cpp | 5 +++++ source/frontends/sdl/imgui/settingshelper.cpp | 15 +++++++++++++++ source/frontends/sdl/imgui/settingshelper.h | 1 + 3 files changed, 21 insertions(+) diff --git a/source/frontends/sdl/imgui/sdlsettings.cpp b/source/frontends/sdl/imgui/sdlsettings.cpp index 7c8ea98e..d164c208 100644 --- a/source/frontends/sdl/imgui/sdlsettings.cpp +++ b/source/frontends/sdl/imgui/sdlsettings.cpp @@ -98,6 +98,11 @@ namespace sa2 const eCpuType cpu = GetMainCpu(); ImGui::Selectable(getCPUName(cpu).c_str()); + ImGui::TableNextColumn(); + ImGui::Selectable("Mode"); + ImGui::TableNextColumn(); + ImGui::Selectable(getModeName(g_nAppMode).c_str()); + ImGui::EndTable(); } diff --git a/source/frontends/sdl/imgui/settingshelper.cpp b/source/frontends/sdl/imgui/settingshelper.cpp index d379493d..bb45b17d 100644 --- a/source/frontends/sdl/imgui/settingshelper.cpp +++ b/source/frontends/sdl/imgui/settingshelper.cpp @@ -46,6 +46,16 @@ namespace {CPU_65C02, "CPU_65C02"}, {CPU_Z80, "CPU_Z80"}, }; + + const std::map modes = + { + {MODE_LOGO, "MODE_LOGO"}, + {MODE_PAUSED, "MODE_PAUSED"}, + {MODE_RUNNING, "MODE_RUNNING"}, + {MODE_DEBUG, "MODE_DEBUG"}, + {MODE_STEPPING, "MODE_STEPPING"}, + {MODE_BENCHMARK, "MODE_BENCHMARCK"}, + }; } namespace sa2 @@ -66,4 +76,9 @@ namespace sa2 return cpuTypes.at(cpu); } + const std::string & getModeName(AppMode_e mode) + { + return modes.at(mode); + } + } diff --git a/source/frontends/sdl/imgui/settingshelper.h b/source/frontends/sdl/imgui/settingshelper.h index 3ca651d3..e5a13db7 100644 --- a/source/frontends/sdl/imgui/settingshelper.h +++ b/source/frontends/sdl/imgui/settingshelper.h @@ -12,5 +12,6 @@ namespace sa2 const std::string & getCardName(SS_CARDTYPE card); const std::string & getApple2Name(eApple2Type type); const std::string & getCPUName(eCpuType cpu); + const std::string & getModeName(AppMode_e mode); }