mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 21:39:52 +00:00
Merge pull request #18924 from hrydgard/chd-detection-fixes
Fix a bunch of cases where we forgot to check for CHD files
This commit is contained in:
commit
0b4dfb8d20
@ -830,7 +830,7 @@ std::vector<PSPFileInfo> DirectoryFileSystem::GetDirListing(const std::string &p
|
|||||||
entry.name = file.name;
|
entry.name = file.name;
|
||||||
}
|
}
|
||||||
if (hideISOFiles) {
|
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.
|
// Workaround for DJ Max Portable, see compat.ini.
|
||||||
continue;
|
continue;
|
||||||
} else if (file.isDirectory) {
|
} else if (file.isDirectory) {
|
||||||
|
@ -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.
|
// 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;
|
return IdentifiedFileType::PSP_ISO;
|
||||||
} else if (extension == ".cso") {
|
} else if (extension == ".cso" || extension == ".chd") {
|
||||||
return IdentifiedFileType::PSP_ISO;
|
|
||||||
} else if (extension == ".chd") {
|
|
||||||
return IdentifiedFileType::PSP_ISO;
|
return IdentifiedFileType::PSP_ISO;
|
||||||
} else if (extension == ".ppst") {
|
} else if (extension == ".ppst") {
|
||||||
return IdentifiedFileType::PPSSPP_SAVESTATE;
|
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
|
// 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...
|
// fail later...
|
||||||
return IdentifiedFileType::PSP_ISO;
|
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') {
|
if (id == 'FLE\x7F') {
|
||||||
|
@ -244,7 +244,7 @@ ZipFileContents DetectZipFileContents(struct zip *z, ZipFileInfo *info) {
|
|||||||
} else {
|
} else {
|
||||||
INFO_LOG(HLE, "Wrong number of slashes (%i) in '%s'", slashCount, fn);
|
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 slashCount = 0;
|
||||||
int slashLocation = -1;
|
int slashLocation = -1;
|
||||||
countSlashes(zippedName, &slashLocation, &slashCount);
|
countSlashes(zippedName, &slashLocation, &slashCount);
|
||||||
@ -304,7 +304,7 @@ bool GameManager::InstallGame(const Path &url, const Path &fileName, bool delete
|
|||||||
|
|
||||||
std::string extension = url.GetFileExtension();
|
std::string extension = url.GetFileExtension();
|
||||||
// Examine the URL to guess out what we're installing.
|
// 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.
|
// It's a raw ISO or CSO file. We just copy it to the destination.
|
||||||
std::string shortFilename = url.GetFilename();
|
std::string shortFilename = url.GetFilename();
|
||||||
bool success = InstallRawISO(fileName, shortFilename, deleteAfter);
|
bool success = InstallRawISO(fileName, shortFilename, deleteAfter);
|
||||||
|
@ -502,7 +502,7 @@ bool System_MakeRequest(SystemRequestType type, int requestId, const std::string
|
|||||||
std::vector<std::string> supportedExtensions = {};
|
std::vector<std::string> supportedExtensions = {};
|
||||||
switch ((BrowseFileType)param3) {
|
switch ((BrowseFileType)param3) {
|
||||||
case BrowseFileType::BOOTABLE:
|
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;
|
break;
|
||||||
case BrowseFileType::INI:
|
case BrowseFileType::INI:
|
||||||
supportedExtensions = { ".ini" };
|
supportedExtensions = { ".ini" };
|
||||||
|
Loading…
Reference in New Issue
Block a user