From d27eb69e9e9dfd5efcb4c686fb48de9d8be3d17b Mon Sep 17 00:00:00 2001 From: DarthMew Date: Thu, 2 Mar 2023 00:20:51 +0100 Subject: [PATCH] Change memcard 2 option description & remove some unused options --- src/core/gpu_hw_d3d11.cpp | 2 +- src/core/gpu_hw_d3d12.cpp | 2 +- src/core/host_interface.cpp | 8 ++--- src/core/pad.cpp | 43 +++++------------------- src/core/settings.cpp | 2 -- src/core/settings.h | 2 -- src/libretro/libretro_core_options.h | 9 ++--- src/libretro/libretro_host_interface.cpp | 4 +-- 8 files changed, 20 insertions(+), 52 deletions(-) diff --git a/src/core/gpu_hw_d3d11.cpp b/src/core/gpu_hw_d3d11.cpp index 335ceb33..3dcba100 100644 --- a/src/core/gpu_hw_d3d11.cpp +++ b/src/core/gpu_hw_d3d11.cpp @@ -499,7 +499,7 @@ bool GPU_HW_D3D11::CompileShaders() { D3D11::ShaderCache shader_cache; shader_cache.Open(g_host_interface->GetShaderCacheBasePath(), m_device->GetFeatureLevel(), SHADER_CACHE_VERSION, - g_settings.gpu_use_debug_device); + false); GPU_HW_ShaderGen shadergen(m_host_display->GetRenderAPI(), m_resolution_scale, m_multisamples, m_per_sample_shading, m_true_color, m_scaled_dithering, m_texture_filtering, m_using_uv_limits, diff --git a/src/core/gpu_hw_d3d12.cpp b/src/core/gpu_hw_d3d12.cpp index af4133e2..58e54522 100644 --- a/src/core/gpu_hw_d3d12.cpp +++ b/src/core/gpu_hw_d3d12.cpp @@ -407,7 +407,7 @@ bool GPU_HW_D3D12::CompilePipelines() { D3D12::ShaderCache shader_cache; shader_cache.Open(g_host_interface->GetShaderCacheBasePath(), g_d3d12_context->GetFeatureLevel(), - g_settings.gpu_use_debug_device); + false); GPU_HW_ShaderGen shadergen(m_host_display->GetRenderAPI(), m_resolution_scale, m_multisamples, m_per_sample_shading, m_true_color, m_scaled_dithering, m_texture_filtering, m_using_uv_limits, diff --git a/src/core/host_interface.cpp b/src/core/host_interface.cpp index 7ad76656..b97dc656 100644 --- a/src/core/host_interface.cpp +++ b/src/core/host_interface.cpp @@ -315,12 +315,10 @@ void HostInterface::FixIncompatibleSettings(bool display_osd_messages) void HostInterface::CheckForSettingsChanges(const Settings& old_settings) { - if (System::IsValid() && (g_settings.gpu_renderer != old_settings.gpu_renderer || - g_settings.gpu_use_debug_device != old_settings.gpu_use_debug_device)) + if (System::IsValid() && (g_settings.gpu_renderer != old_settings.gpu_renderer)) { - AddFormattedOSDMessage(5.0f, TranslateString("OSDMessage", "Switching to %s%s GPU renderer."), - Settings::GetRendererName(g_settings.gpu_renderer), - g_settings.gpu_use_debug_device ? " (debug)" : ""); + AddFormattedOSDMessage(5.0f, TranslateString("OSDMessage", "Switching to %s GPU renderer."), + Settings::GetRendererName(g_settings.gpu_renderer)); RecreateSystem(); } diff --git a/src/core/pad.cpp b/src/core/pad.cpp index 33cd2d77..a564a0af 100644 --- a/src/core/pad.cpp +++ b/src/core/pad.cpp @@ -91,7 +91,7 @@ bool Pad::DoStateMemcard(StateWrapper& sw, u32 i) sw.Do(&card_present_in_state); - if (card_present_in_state && !m_memory_cards[i] && g_settings.load_devices_from_save_states) + if (card_present_in_state && !m_memory_cards[i]) { g_host_interface->AddFormattedOSDMessage( 20.0f, @@ -106,16 +106,6 @@ bool Pad::DoStateMemcard(StateWrapper& sw, u32 i) if (card_present_in_state) { - if (sw.IsReading() && !g_settings.load_devices_from_save_states) - { - // load memcard into a temporary: If the card datas match, take the one from the savestate - // since it has other useful non-data state information. Otherwise take the user's card - // and perform a re-plugging. - - card_from_state = std::make_unique(); - card_ptr = card_from_state.get(); - } - if (!sw.DoMarker("MemoryCard") || !card_ptr->DoState(sw)) return false; } @@ -162,24 +152,12 @@ bool Pad::DoStateMemcard(StateWrapper& sw, u32 i) if (!card_present_in_state && m_memory_cards[i]) { - if (g_settings.load_devices_from_save_states) - { - g_host_interface->AddFormattedOSDMessage( - 20.0f, - g_host_interface->TranslateString("OSDMessage", - "Memory card %u present in system but not in save state. Removing card."), - i + 1u); - m_memory_cards[i].reset(); - } - else - { - g_host_interface->AddFormattedOSDMessage( - 20.0f, - g_host_interface->TranslateString("OSDMessage", - "Memory card %u present in system but not in save state. Replugging card."), - i + 1u); - m_memory_cards[i]->Reset(); - } + g_host_interface->AddFormattedOSDMessage( + 20.0f, + g_host_interface->TranslateString("OSDMessage", + "Memory card %u present in system but not in save state. Removing card."), + i + 1u); + m_memory_cards[i].reset(); } return true; @@ -191,8 +169,6 @@ bool Pad::DoState(StateWrapper& sw) { if ((sw.GetVersion() < 50) && (i >= 2)) { - // loading from old savestate which only had max 2 controllers. - // honoring load_devices_from_save_states in this case seems debatable, but might as well... if (m_controllers[i]) { m_controllers[i]->Reset(); @@ -200,10 +176,7 @@ bool Pad::DoState(StateWrapper& sw) if (m_memory_cards[i]) { - if (g_settings.load_devices_from_save_states) - m_memory_cards[i].reset(); - else - m_memory_cards[i]->Reset(); + m_memory_cards[i].reset(); } // ... and make sure to skip trying to read controller_type / card_present flags which don't exist in old states. diff --git a/src/core/settings.cpp b/src/core/settings.cpp index 6a24e83b..72fdbc24 100644 --- a/src/core/settings.cpp +++ b/src/core/settings.cpp @@ -140,7 +140,6 @@ void Settings::Load(SettingsInterface& si) .value_or(DEFAULT_CONSOLE_REGION); enable_8mb_ram = si.GetBoolValue("Console", "Enable8MBRAM", false); - load_devices_from_save_states = si.GetBoolValue("Main", "LoadDevicesFromSaveStates", true); apply_game_settings = si.GetBoolValue("Main", "ApplyGameSettings", true); disable_all_enhancements = si.GetBoolValue("Main", "DisableAllEnhancements", false); rewind_enable = si.GetBoolValue("Main", "RewindEnable", false); @@ -168,7 +167,6 @@ void Settings::Load(SettingsInterface& si) .value_or(DEFAULT_GPU_RENDERER); gpu_resolution_scale = static_cast(si.GetIntValue("GPU", "ResolutionScale", 1)); gpu_multisamples = static_cast(si.GetIntValue("GPU", "Multisamples", 1)); - gpu_use_debug_device = si.GetBoolValue("GPU", "UseDebugDevice", false); gpu_per_sample_shading = si.GetBoolValue("GPU", "PerSampleShading", false); gpu_use_thread = si.GetBoolValue("GPU", "UseThread", true); gpu_use_software_renderer_for_readbacks = si.GetBoolValue("GPU", "UseSoftwareRendererForReadbacks", false); diff --git a/src/core/settings.h b/src/core/settings.h index 453a204b..58f34f55 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -69,7 +69,6 @@ struct Settings CPUFastmemMode cpu_fastmem_mode = CPUFastmemMode::Disabled; bool cpu_fastmem_rewrite = false; - bool load_devices_from_save_states = true; bool apply_game_settings = true; bool disable_all_enhancements = false; @@ -83,7 +82,6 @@ struct Settings u32 gpu_multisamples = 1; bool gpu_use_thread = true; bool gpu_use_software_renderer_for_readbacks = false; - bool gpu_use_debug_device = false; bool gpu_per_sample_shading = false; bool gpu_true_color = false; bool gpu_scaled_dithering = false; diff --git a/src/libretro/libretro_core_options.h b/src/libretro/libretro_core_options.h index 55a057ce..7e6a1144 100644 --- a/src/libretro/libretro_core_options.h +++ b/src/libretro/libretro_core_options.h @@ -184,7 +184,7 @@ struct retro_core_option_v2_definition option_defs_us[] = { }, { "swanstation_CDROM_LoadImagePatches", - "Apply Image Patches", + "Apply Image Patches (Restart)", NULL, "Automatically applies patches to disc images when they are present in the same directory. Currently only PPF " "patches are supported with this option. Requires the core to be restarted to apply.", @@ -368,7 +368,7 @@ struct retro_core_option_v2_definition option_defs_us[] = { }, { "swanstation_GPU_UseSoftwareRendererForReadbacks", - "Use Software Renderer For Readbacks", + "Use Software Renderer For Readbacks (Restart)", NULL, "Runs the software renderer in parallel for VRAM readbacks. On some systems, this may " "result in greater performance when using graphical enhancements with the hardware renderer. " @@ -1272,7 +1272,7 @@ struct retro_core_option_v2_definition option_defs_us[] = { }, { "swanstation_MemoryCards_Card1Type", - "Memory Card 1 Type", + "Memory Card 1 Type (Restart)", NULL, "Sets the type of memory card for Slot 1. Restart the core when switching formats. " "'Shared Between All Games' and both 'Separate Card Per Game' options may be used for legacy purposes, " @@ -1286,13 +1286,14 @@ struct retro_core_option_v2_definition option_defs_us[] = { { "Shared", "Shared Between All Games" }, { "PerGame", "Separate Card Per Game (Game Code)" }, { "PerGameTitle", "Separate Card Per Game (Game Title)" }, + { "None", "No Memory Card" }, { NULL, NULL }, }, "Libretro" }, { "swanstation_MemoryCards_Card2Type", - "Second Memory Card Type", + "Memory Card 2 Type", NULL, "Sets the type of memory card for Slot 2.", NULL, diff --git a/src/libretro/libretro_host_interface.cpp b/src/libretro/libretro_host_interface.cpp index e15cda02..eeac466d 100644 --- a/src/libretro/libretro_host_interface.cpp +++ b/src/libretro/libretro_host_interface.cpp @@ -1709,8 +1709,8 @@ void LibretroHostInterface::SwitchToHardwareRenderer() Log_ErrorPrintf("Unhandled renderer '%s'", Settings::GetRendererName(renderer.value())); return; } - if (!display || !display->CreateRenderDevice(wi, {}, g_settings.gpu_use_debug_device, false) || - !display->InitializeRenderDevice(GetShaderCacheBasePath(), g_settings.gpu_use_debug_device, false)) + if (!display || !display->CreateRenderDevice(wi, {}, false, false) || + !display->InitializeRenderDevice(GetShaderCacheBasePath(), false, false)) { Log_ErrorPrintf("Failed to create hardware host display"); return;