From 28b8cb5bc632e5eb17fc7a6fd68cacdf1c4a76e9 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Wed, 26 May 2021 17:59:09 +1000 Subject: [PATCH] Settings: Fix mismatches between default and fallback values --- src/core/host_interface.cpp | 9 ++++++--- src/core/settings.cpp | 19 +++++-------------- src/core/settings.h | 27 +++++++++++++++++++-------- 3 files changed, 30 insertions(+), 25 deletions(-) diff --git a/src/core/host_interface.cpp b/src/core/host_interface.cpp index 4d6c416e7..1526927e1 100644 --- a/src/core/host_interface.cpp +++ b/src/core/host_interface.cpp @@ -498,6 +498,9 @@ void HostInterface::SetDefaultSettings(SettingsInterface& si) si.SetFloatValue("Main", "RunaheadFrameCount", 0); si.SetStringValue("CPU", "ExecutionMode", Settings::GetCPUExecutionModeName(Settings::DEFAULT_CPU_EXECUTION_MODE)); + si.SetIntValue("CPU", "OverclockNumerator", 1); + si.SetIntValue("CPU", "OverclockDenominator", 1); + si.SetBoolValue("CPU", "OverclockEnable", false); si.SetBoolValue("CPU", "RecompilerMemoryExceptions", false); si.SetBoolValue("CPU", "ICache", false); si.SetBoolValue("CPU", "FastmemMode", Settings::GetCPUFastmemModeName(Settings::DEFAULT_CPU_FASTMEM_MODE)); @@ -548,10 +551,10 @@ void HostInterface::SetDefaultSettings(SettingsInterface& si) si.SetBoolValue("Display", "ShowSpeed", false); si.SetBoolValue("Display", "ShowResolution", false); si.SetBoolValue("Display", "Fullscreen", false); - si.SetBoolValue("Display", "VSync", true); + si.SetBoolValue("Display", "VSync", Settings::DEFAULT_VSYNC_VALUE); si.SetBoolValue("Display", "DisplayAllFrames", false); si.SetStringValue("Display", "PostProcessChain", ""); - si.SetFloatValue("Display", "MaxFPS", 0.0f); + si.SetFloatValue("Display", "MaxFPS", Settings::DEFAULT_DISPLAY_MAX_FPS); si.SetBoolValue("CDROM", "ReadThread", true); si.SetBoolValue("CDROM", "RegionCheck", false); @@ -574,7 +577,7 @@ void HostInterface::SetDefaultSettings(SettingsInterface& si) si.SetStringValue("BIOS", "PathNTSCJ", ""); si.SetStringValue("BIOS", "PathPAL", ""); si.SetBoolValue("BIOS", "PatchTTYEnable", false); - si.SetBoolValue("BIOS", "PatchFastBoot", false); + si.SetBoolValue("BIOS", "PatchFastBoot", Settings::DEFAULT_FAST_BOOT_VALUE); si.SetStringValue("Controller1", "Type", Settings::GetControllerTypeName(Settings::DEFAULT_CONTROLLER_1_TYPE)); diff --git a/src/core/settings.cpp b/src/core/settings.cpp index 5edbf8ebe..90c9620fd 100644 --- a/src/core/settings.cpp +++ b/src/core/settings.cpp @@ -136,19 +136,10 @@ void Settings::UpdateOverclockActive() void Settings::Load(SettingsInterface& si) { - // Android doesn't create settings until they're first opened, so we have to override the defaults here. -#ifndef __ANDROID__ - static constexpr bool DEFAULT_VSYNC_VALUE = false; - static constexpr bool DEFAULT_FAST_BOOT_VALUE = false; - static constexpr float DEFAULT_DISPLAY_MAX_FPS = 0.0f; -#else - static constexpr bool DEFAULT_VSYNC_VALUE = true; - static constexpr bool DEFAULT_FAST_BOOT_VALUE = true; - static constexpr float DEFAULT_DISPLAY_MAX_FPS = 60.0f; -#endif - region = - ParseConsoleRegionName(si.GetStringValue("Console", "Region", "NTSC-U").c_str()).value_or(DEFAULT_CONSOLE_REGION); + ParseConsoleRegionName( + si.GetStringValue("Console", "Region", Settings::GetConsoleRegionName(Settings::DEFAULT_CONSOLE_REGION)).c_str()) + .value_or(DEFAULT_CONSOLE_REGION); enable_8mb_ram = si.GetBoolValue("Console", "Enable8MBRAM", false); emulation_speed = si.GetFloatValue("Main", "EmulationSpeed", 1.0f); @@ -195,7 +186,7 @@ void Settings::Load(SettingsInterface& si) gpu_use_thread = si.GetBoolValue("GPU", "UseThread", true); gpu_use_software_renderer_for_readbacks = si.GetBoolValue("GPU", "UseSoftwareRendererForReadbacks", false); gpu_threaded_presentation = si.GetBoolValue("GPU", "ThreadedPresentation", true); - gpu_true_color = si.GetBoolValue("GPU", "TrueColor", true); + gpu_true_color = si.GetBoolValue("GPU", "TrueColor", false); gpu_scaled_dithering = si.GetBoolValue("GPU", "ScaledDithering", false); gpu_texture_filter = ParseTextureFilterName( @@ -251,7 +242,7 @@ void Settings::Load(SettingsInterface& si) display_max_fps = si.GetFloatValue("Display", "MaxFPS", DEFAULT_DISPLAY_MAX_FPS); cdrom_read_thread = si.GetBoolValue("CDROM", "ReadThread", true); - cdrom_region_check = si.GetBoolValue("CDROM", "RegionCheck", true); + cdrom_region_check = si.GetBoolValue("CDROM", "RegionCheck", false); cdrom_load_image_to_ram = si.GetBoolValue("CDROM", "LoadImageToRAM", false); cdrom_mute_cd_audio = si.GetBoolValue("CDROM", "MuteCDAudio", false); cdrom_read_speedup = si.GetIntValue("CDROM", "ReadSpeedup", 1); diff --git a/src/core/settings.h b/src/core/settings.h index 74a5facba..2ecbe51fd 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -112,11 +112,11 @@ struct Settings bool gpu_threaded_presentation = true; bool gpu_use_debug_device = false; bool gpu_per_sample_shading = false; - bool gpu_true_color = true; + bool gpu_true_color = false; bool gpu_scaled_dithering = false; GPUTextureFilter gpu_texture_filter = GPUTextureFilter::Nearest; GPUDownsampleMode gpu_downsample_mode = GPUDownsampleMode::Disabled; - bool gpu_disable_interlacing = false; + bool gpu_disable_interlacing = true; bool gpu_force_ntsc_timings = false; bool gpu_widescreen_hack = false; bool gpu_pgxp_enable = false; @@ -140,19 +140,19 @@ struct Settings bool display_integer_scaling = false; bool display_stretch = false; bool display_post_processing = false; - bool display_show_osd_messages = false; + bool display_show_osd_messages = true; bool display_show_fps = false; bool display_show_vps = false; bool display_show_speed = false; bool display_show_resolution = false; bool display_all_frames = false; - bool video_sync_enabled = true; - float display_max_fps = 0.0f; + bool video_sync_enabled = DEFAULT_VSYNC_VALUE; + float display_max_fps = DEFAULT_DISPLAY_MAX_FPS; float gpu_pgxp_tolerance = -1.0f; float gpu_pgxp_depth_clear_threshold = 300.0f / 4096.0f; bool cdrom_read_thread = true; - bool cdrom_region_check = true; + bool cdrom_region_check = false; bool cdrom_load_image_to_ram = false; bool cdrom_mute_cd_audio = false; u32 cdrom_read_speedup = 1; @@ -346,7 +346,7 @@ struct Settings static const char* GetMultitapModeDisplayName(MultitapMode mode); // Default to D3D11 on Windows as it's more performant and at this point, less buggy. -#ifdef WIN32 +#ifdef _WIN32 static constexpr GPURenderer DEFAULT_GPU_RENDERER = GPURenderer::HardwareD3D11; #else static constexpr GPURenderer DEFAULT_GPU_RENDERER = GPURenderer::HardwareOpenGL; @@ -368,7 +368,7 @@ struct Settings static constexpr CPUFastmemMode DEFAULT_CPU_FASTMEM_MODE = CPUFastmemMode::Disabled; #endif -#ifndef ANDROID +#ifndef __ANDROID__ static constexpr AudioBackend DEFAULT_AUDIO_BACKEND = AudioBackend::Cubeb; #else static constexpr AudioBackend DEFAULT_AUDIO_BACKEND = AudioBackend::OpenSLES; @@ -390,6 +390,17 @@ struct Settings #else static constexpr bool DEFAULT_LOG_TO_CONSOLE = false; #endif + + // Android doesn't create settings until they're first opened, so we have to override the defaults here. +#ifndef __ANDROID__ + static constexpr bool DEFAULT_VSYNC_VALUE = false; + static constexpr bool DEFAULT_FAST_BOOT_VALUE = false; + static constexpr float DEFAULT_DISPLAY_MAX_FPS = 0.0f; +#else + static constexpr bool DEFAULT_VSYNC_VALUE = true; + static constexpr bool DEFAULT_FAST_BOOT_VALUE = true; + static constexpr float DEFAULT_DISPLAY_MAX_FPS = 60.0f; +#endif }; extern Settings g_settings;