diff --git a/Core/FileSystems/DirectoryFileSystem.cpp b/Core/FileSystems/DirectoryFileSystem.cpp index 3b90f5d9bb..9c39ece529 100644 --- a/Core/FileSystems/DirectoryFileSystem.cpp +++ b/Core/FileSystems/DirectoryFileSystem.cpp @@ -830,7 +830,7 @@ std::vector DirectoryFileSystem::GetDirListing(const std::string &p entry.name = file.name; } if (hideISOFiles) { - if (endsWithNoCase(entry.name, ".cso") || endsWithNoCase(entry.name, ".iso")) { + if (endsWithNoCase(entry.name, ".cso") || endsWithNoCase(entry.name, ".iso") || endsWithNoCase(entry.name, ".chd")) { // chd not really necessary, but let's hide them too. // Workaround for DJ Max Portable, see compat.ini. continue; } else if (file.isDirectory) { diff --git a/Core/Loaders.cpp b/Core/Loaders.cpp index b304af72bd..f15a071397 100644 --- a/Core/Loaders.cpp +++ b/Core/Loaders.cpp @@ -92,9 +92,7 @@ IdentifiedFileType Identify_File(FileLoader *fileLoader, std::string *errorStrin // maybe it also just happened to have that size, let's assume it's a PSP ISO and error out later if it's not. } return IdentifiedFileType::PSP_ISO; - } else if (extension == ".cso") { - return IdentifiedFileType::PSP_ISO; - } else if (extension == ".chd") { + } else if (extension == ".cso" || extension == ".chd") { return IdentifiedFileType::PSP_ISO; } else if (extension == ".ppst") { return IdentifiedFileType::PPSSPP_SAVESTATE; @@ -170,6 +168,11 @@ IdentifiedFileType Identify_File(FileLoader *fileLoader, std::string *errorStrin // CISO are not used for many other kinds of ISO so let's just guess it's a PSP one and let it // fail later... return IdentifiedFileType::PSP_ISO; + } else if (!memcmp(&_id, "MCom", 4)) { + size_t readSize = fileLoader->ReadAt(4, 4, 1, &_id); + if (!memcmp(&_id, "prHD", 4)) { + return IdentifiedFileType::PSP_ISO; // CHD file + } } if (id == 'FLE\x7F') { diff --git a/Core/Util/GameManager.cpp b/Core/Util/GameManager.cpp index 7e01533a40..ebbcb74b60 100644 --- a/Core/Util/GameManager.cpp +++ b/Core/Util/GameManager.cpp @@ -244,7 +244,7 @@ ZipFileContents DetectZipFileContents(struct zip *z, ZipFileInfo *info) { } else { INFO_LOG(HLE, "Wrong number of slashes (%i) in '%s'", slashCount, fn); } - } else if (endsWith(zippedName, ".iso") || endsWith(zippedName, ".cso")) { + } else if (endsWith(zippedName, ".iso") || endsWith(zippedName, ".cso") || endsWith(zippedName, ".chd")) { int slashCount = 0; int slashLocation = -1; countSlashes(zippedName, &slashLocation, &slashCount); @@ -304,7 +304,7 @@ bool GameManager::InstallGame(const Path &url, const Path &fileName, bool delete std::string extension = url.GetFileExtension(); // Examine the URL to guess out what we're installing. - if (extension == ".cso" || extension == ".iso") { + if (extension == ".cso" || extension == ".iso" || extension == ".chd") { // It's a raw ISO or CSO file. We just copy it to the destination. std::string shortFilename = url.GetFilename(); bool success = InstallRawISO(fileName, shortFilename, deleteAfter); diff --git a/UWP/PPSSPP_UWPMain.cpp b/UWP/PPSSPP_UWPMain.cpp index 5a2d210961..f90e96ae50 100644 --- a/UWP/PPSSPP_UWPMain.cpp +++ b/UWP/PPSSPP_UWPMain.cpp @@ -502,7 +502,7 @@ bool System_MakeRequest(SystemRequestType type, int requestId, const std::string std::vector supportedExtensions = {}; switch ((BrowseFileType)param3) { case BrowseFileType::BOOTABLE: - supportedExtensions = { ".cso", ".bin", ".iso", ".elf", ".pbp", ".zip" }; + supportedExtensions = { ".cso", ".iso", ".chd", ".elf", ".pbp", ".zip", ".prx", ".bin" }; // should .bin even be here? break; case BrowseFileType::INI: supportedExtensions = { ".ini" };