From d16c9775a968cfc637990ecdb82856abb0cb79bd Mon Sep 17 00:00:00 2001 From: Taimoor Ahmad Date: Sat, 11 May 2019 23:24:17 -0400 Subject: [PATCH] Only show if DisplayTime is enabled in settings --- gfx.cpp | 5 +++-- gtk/src/gtk_config.cpp | 3 +++ gtk/src/gtk_preferences.cpp | 2 ++ snes9x.cpp | 5 +++++ snes9x.h | 1 + unix/snes9x.conf.default | 1 + 6 files changed, 15 insertions(+), 2 deletions(-) diff --git a/gfx.cpp b/gfx.cpp index 0d59930a..5e4a1636 100644 --- a/gfx.cpp +++ b/gfx.cpp @@ -2046,8 +2046,9 @@ static void DisplayWatchedAddresses (void) void S9xDisplayMessages (uint16 *screen, int ppl, int width, int height, int scale) { - DisplayTime(); - + if (Settings.DisplayTime) + DisplayTime(); + if (Settings.DisplayFrameRate) DisplayFrameRate(); diff --git a/gtk/src/gtk_config.cpp b/gtk/src/gtk_config.cpp index 90f8f5b8..20c943f7 100644 --- a/gtk/src/gtk_config.cpp +++ b/gtk/src/gtk_config.cpp @@ -165,6 +165,7 @@ int Snes9xConfig::load_defaults () Settings.AutoSaveDelay = 0; Settings.SkipFrames = 0; Settings.Transparency = true; + Settings.DisplayTime = false; Settings.DisplayFrameRate = false; Settings.SixteenBitSound = true; Settings.Stereo = true; @@ -341,6 +342,7 @@ int Snes9xConfig::save_config_file () #undef z #define z "Emulation::" outbool (cf, z"EmulateTransparency", Settings.Transparency); + outbool (cf, z"DisplayTime", Settings.DisplayTime); outbool (cf, z"DisplayFrameRate", Settings.DisplayFrameRate); outbool (cf, z"DisplayPressedKeys", Settings.DisplayPressedKeys); cf.SetInt (z"SpeedControlMethod", Settings.SkipFrames, "0: Time the frames to 50 or 60Hz, 1: Same, but skip frames if too slow, 2: Synchronize to the sound buffer, 3: Unlimited, except potentially by vsync"); @@ -570,6 +572,7 @@ int Snes9xConfig::load_config_file () #undef z #define z "Emulation::" inbool (z"EmulateTransparency", Settings.Transparency); + inbool (z"DisplayTime", Settings.DisplayTime); inbool (z"DisplayFrameRate", Settings.DisplayFrameRate); inbool (z"DisplayPressedKeys", Settings.DisplayPressedKeys); inint (z"SpeedControlMethod", Settings.SkipFrames); diff --git a/gtk/src/gtk_preferences.cpp b/gtk/src/gtk_preferences.cpp index 54f9aa0e..30565c74 100644 --- a/gtk/src/gtk_preferences.cpp +++ b/gtk/src/gtk_preferences.cpp @@ -607,6 +607,7 @@ void Snes9xPreferences::move_settings_to_dialog () { set_check ("full_screen_on_open", config->full_screen_on_open); + set_check ("show_time", Settings.DisplayTime); set_check ("show_frame_rate", Settings.DisplayFrameRate); set_check ("show_pressed_keys", Settings.DisplayPressedKeys); set_check ("change_display_resolution", config->change_display_resolution); @@ -823,6 +824,7 @@ Snes9xPreferences::get_settings_from_dialog () #endif config->full_screen_on_open = get_check ("full_screen_on_open"); + Settings.DisplayTime = get_check ("show_time"); Settings.DisplayFrameRate = get_check ("show_frame_rate"); Settings.DisplayPressedKeys = get_check ("show_pressed_keys"); config->scale_to_fit = get_check ("scale_to_fit"); diff --git a/snes9x.cpp b/snes9x.cpp index 95030e73..dc286aab 100644 --- a/snes9x.cpp +++ b/snes9x.cpp @@ -250,6 +250,7 @@ void S9xLoadConfigFiles (char **argv, int argc) Settings.SupportHiRes = conf.GetBool("Display::HiRes", true); Settings.Transparency = conf.GetBool("Display::Transparency", true); Settings.DisableGraphicWindows = !conf.GetBool("Display::GraphicWindows", true); + Settings.DisplayTime = conf.GetBool("Display::DisplayTime", false); Settings.DisplayFrameRate = conf.GetBool("Display::DisplayFrameRate", false); Settings.DisplayWatchedAddresses = conf.GetBool("Display::DisplayWatchedAddresses", false); Settings.DisplayPressedKeys = conf.GetBool("Display::DisplayInput", false); @@ -368,6 +369,7 @@ void S9xUsage (void) S9xMessage(S9X_INFO, S9X_USAGE, ""); // DISPLAY OPTIONS + S9xMessage(S9X_INFO, S9X_USAGE, "-displaytime Display the time"); S9xMessage(S9X_INFO, S9X_USAGE, "-displayframerate Display the frame rate counter"); S9xMessage(S9X_INFO, S9X_USAGE, "-displaykeypress Display input of all controllers and peripherals"); S9xMessage(S9X_INFO, S9X_USAGE, "-nohires (Not recommended) Disable support for hi-res and"); @@ -539,6 +541,9 @@ char * S9xParseArgs (char **argv, int argc) // DISPLAY OPTIONS + if (!strcasecmp(argv[i], "-displaytime")) + Settings.DisplayTime = TRUE; + else if (!strcasecmp(argv[i], "-displayframerate")) Settings.DisplayFrameRate = TRUE; else diff --git a/snes9x.h b/snes9x.h index c33d92fc..78064515 100644 --- a/snes9x.h +++ b/snes9x.h @@ -247,6 +247,7 @@ struct SSettings uint8 BG_Forced; bool8 DisableGraphicWindows; + bool8 DisplayTime; bool8 DisplayFrameRate; bool8 DisplayWatchedAddresses; bool8 DisplayPressedKeys; diff --git a/unix/snes9x.conf.default b/unix/snes9x.conf.default index 19393c7b..ce133f2d 100644 --- a/unix/snes9x.conf.default +++ b/unix/snes9x.conf.default @@ -28,6 +28,7 @@ Mute = FALSE HiRes = TRUE Transparency = TRUE GraphicWindows = TRUE +DisplayTime = FALSE DisplayFrameRate = FALSE DisplayWatchedAddresses = FALSE DisplayInput = FALSE