mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-17 23:55:45 -04:00
libretro: Fix breakage with new BIOS detection
This commit is contained in:
@ -199,6 +199,11 @@ void HostInterface::AddFormattedOSDMessage(float duration, const char* format, .
|
||||
AddOSDMessage(std::move(message), duration);
|
||||
}
|
||||
|
||||
std::string HostInterface::GetBIOSDirectory() const
|
||||
{
|
||||
return GetUserDirectoryRelativePath("bios");
|
||||
}
|
||||
|
||||
std::optional<std::vector<u8>> HostInterface::GetBIOSImage(ConsoleRegion region)
|
||||
{
|
||||
const std::string* bios_path;
|
||||
@ -221,12 +226,13 @@ std::optional<std::vector<u8>> HostInterface::GetBIOSImage(ConsoleRegion region)
|
||||
if (bios_path->empty())
|
||||
{
|
||||
// auto-detect
|
||||
return FindBIOSImageInDirectory(region, GetUserDirectoryRelativePath("bios").c_str());
|
||||
return FindBIOSImageInDirectory(region, GetBIOSDirectory().c_str());
|
||||
}
|
||||
|
||||
// try the configured path
|
||||
std::optional<BIOS::Image> image = BIOS::LoadImageFromFile(
|
||||
GetUserDirectoryRelativePath("bios" FS_OSPATH_SEPARATOR_STR "%s", bios_path->c_str()).c_str());
|
||||
StringUtil::StdStringFromFormat("%s" FS_OSPATH_SEPARATOR_STR "%s", GetBIOSDirectory().c_str(), bios_path->c_str())
|
||||
.c_str());
|
||||
if (!image.has_value())
|
||||
{
|
||||
g_host_interface->ReportFormattedError(
|
||||
|
@ -118,6 +118,9 @@ public:
|
||||
virtual TinyString TranslateString(const char* context, const char* str) const;
|
||||
virtual std::string TranslateStdString(const char* context, const char* str) const;
|
||||
|
||||
/// Returns the path to the directory to search for BIOS images.
|
||||
virtual std::string GetBIOSDirectory() const;
|
||||
|
||||
/// Loads the BIOS image for the specified region.
|
||||
std::optional<std::vector<u8>> GetBIOSImage(ConsoleRegion region);
|
||||
|
||||
|
Reference in New Issue
Block a user