MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / FindBiosImage

Function FindBiosImage

pcsx2/ps2/BiosTools.cpp:258–282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256}
257
258static std::string FindBiosImage()
259{
260 Console.WriteLn("Searching for a BIOS image in '%s'...", EmuFolders::Bios.c_str());
261
262 FileSystem::FindResultsArray results;
263 if (!FileSystem::FindFiles(EmuFolders::Bios.c_str(), "*", FILESYSTEM_FIND_FILES, &results))
264 return std::string();
265
266 u32 version, region;
267 std::string description, zone;
268 for (const FILESYSTEM_FIND_DATA& fd : results)
269 {
270 if (fd.Size < MIN_BIOS_SIZE || fd.Size > MAX_BIOS_SIZE)
271 continue;
272
273 if (IsBIOS(fd.FileName.c_str(), version, description, region, zone))
274 {
275 Console.WriteLn("Using BIOS '%s' (%s %s)", fd.FileName.c_str(), description.c_str(), zone.c_str());
276 return std::move(fd.FileName);
277 }
278 }
279
280 Console.Error("Unable to auto locate a BIOS image");
281 return std::string();
282}
283
284bool IsBIOS(const char* filename, u32& version, std::string& description, u32& region, std::string& zone)
285{

Callers 2

IsBIOSAvailableFunction · 0.85
LoadBIOSFunction · 0.85

Calls 5

IsBIOSFunction · 0.85
stringClass · 0.50
WriteLnMethod · 0.45
c_strMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected