diff --git a/src/core/host_interface.cpp b/src/core/host_interface.cpp index d0f25fe4..3de820f2 100644 --- a/src/core/host_interface.cpp +++ b/src/core/host_interface.cpp @@ -275,7 +275,7 @@ std::optional> HostInterface::GetBIOSImage(ConsoleRegion region) if (bios_name.empty()) { - // auto-detect + //auto-detect return FindBIOSImageInDirectory(region, bios_dir.c_str()); } @@ -284,10 +284,7 @@ std::optional> HostInterface::GetBIOSImage(ConsoleRegion region) StringUtil::StdStringFromFormat("%s" FS_OSPATH_SEPARATOR_STR "%s", bios_dir.c_str(), bios_name.c_str()).c_str()); if (!image.has_value()) { - g_host_interface->ReportFormattedError( - g_host_interface->TranslateString("HostInterface", "Failed to load configured BIOS file '%s'"), - bios_name.c_str()); - return std::nullopt; + return FindBIOSImageInDirectory(region, bios_dir.c_str()); } BIOS::Hash found_hash = BIOS::GetHash(*image); @@ -356,7 +353,7 @@ std::optional> HostInterface::FindBIOSImageInDirectory(ConsoleRe if (!fallback_info) { - Log_WarningPrintf("Using unknown BIOS '%s'. This may crash.", fallback_path.c_str()); + return std::nullopt; } else { diff --git a/src/duckstation-libretro/libretro_core_options.h b/src/duckstation-libretro/libretro_core_options.h index 0b17d50e..9f7d3b45 100644 --- a/src/duckstation-libretro/libretro_core_options.h +++ b/src/duckstation-libretro/libretro_core_options.h @@ -346,20 +346,6 @@ struct retro_core_option_v2_definition option_defs_us[] = { "OpenGL" #endif }, - { - "duckstation_GPU.UseThread", - "Threaded Rendering (Software)", - NULL, - "Uses a second thread for drawing graphics. Currently only available for the software renderer.", - NULL, - "enhancement", - { - { "true", "Enabled" }, - { "false", "Disabled" }, - { NULL, NULL }, - }, - "true" - }, { "duckstation_GPU.ResolutionScale", "Internal Resolution Scale", @@ -389,6 +375,20 @@ struct retro_core_option_v2_definition option_defs_us[] = { }, "1" }, + { + "duckstation_GPU.UseThread", + "Threaded Rendering (Software)", + NULL, + "Uses a second thread for drawing graphics. Currently only available for the software renderer.", + NULL, + "enhancement", + { + { "true", "Enabled" }, + { "false", "Disabled" }, + { NULL, NULL }, + }, + "true" + }, { "duckstation_GPU.UseSoftwareRendererForReadbacks", "Use Software Renderer For Readbacks", @@ -1507,6 +1507,51 @@ struct retro_core_option_v2_definition option_defs_us[] = { }, "false" }, + { + "duckstation_BIOS.PathNTSCJ", + "NTSC-J BIOS (Restart)", + NULL, + "Select which standard BIOS to use for NTSC-J", + NULL, + "advanced", + { + { "psxonpsp660.bin", "POPS BIOS" }, + { "scph5500.bin", "SCPH5500 BIOS" }, + { "ps1_rom.bin", "PS3 BIOS" }, + { NULL, NULL }, + }, + "psxonpsp660.bin" + }, + { + "duckstation_BIOS.PathNTSCU", + "NTSC-U BIOS (Restart)", + NULL, + "Select which standard BIOS to use for NTSC-U", + NULL, + "advanced", + { + { "psxonpsp660.bin", "POPS BIOS" }, + { "scph5501.bin", "SCPH5501 BIOS" }, + { "ps1_rom.bin", "PS3 BIOS" }, + { NULL, NULL }, + }, + "psxonpsp660.bin" + }, + { + "duckstation_BIOS.PathPAL", + "PAL BIOS (Restart)", + NULL, + "Select which standard BIOS to use for PAL", + NULL, + "advanced", + { + { "psxonpsp660.bin", "POPS BIOS" }, + { "scph5502.bin", "SCPH5502 BIOS" }, + { "ps1_rom.bin", "PS3 BIOS" }, + { NULL, NULL }, + }, + "psxonpsp660.bin" + }, { NULL, NULL, NULL, NULL, NULL, NULL, {{0}}, NULL }, }; diff --git a/src/duckstation-libretro/libretro_host_interface.cpp b/src/duckstation-libretro/libretro_host_interface.cpp index 133e84ac..4f553b10 100644 --- a/src/duckstation-libretro/libretro_host_interface.cpp +++ b/src/duckstation-libretro/libretro_host_interface.cpp @@ -432,6 +432,58 @@ bool LibretroHostInterface::retro_load_game(const struct retro_game_info* game) } } + switch (System::GetRegion()) + { + case ConsoleRegion::NTSC_J: + { + struct retro_core_option_display option_display; + option_display.visible = false; + option_display.key = "duckstation_BIOS.PathNTSCU"; + g_retro_environment_callback(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display); + option_display.key = "duckstation_BIOS.PathPAL"; + g_retro_environment_callback(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display); + + break; + } + + case ConsoleRegion::NTSC_U: + { + struct retro_core_option_display option_display; + option_display.visible = false; + option_display.key = "duckstation_BIOS.PathNTSCJ"; + g_retro_environment_callback(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display); + option_display.key = "duckstation_BIOS.PathPAL"; + g_retro_environment_callback(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display); + + break; + } + + case ConsoleRegion::PAL: + { + struct retro_core_option_display option_display; + option_display.visible = false; + option_display.key = "duckstation_BIOS.PathNTSCU"; + g_retro_environment_callback(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display); + option_display.key = "duckstation_BIOS.PathNTSCJ"; + g_retro_environment_callback(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display); + + break; + } + } + + struct retro_core_option_display option_display; + option_display.visible = false; + if (g_settings.gpu_renderer == GPURenderer::Software) + { + option_display.key = "duckstation_GPU.UseSoftwareRendererForReadbacks"; + g_retro_environment_callback(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display); + } + else + { + option_display.key = "duckstation_GPU.UseThread"; + g_retro_environment_callback(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display); + } + return true; }