Improve disc ID detection for old frame dumps.

Ran into this looking at issue #6379
This commit is contained in:
Henrik Rydgård 2023-12-30 22:06:52 +01:00
parent d2ebd36ab9
commit de0d82d020

View File

@ -234,7 +234,7 @@ bool DiscIDFromGEDumpPath(const Path &path, FileLoader *fileLoader, std::string
// Fall back to using the filename.
std::string filename = path.GetFilename();
// Could be more discerning, but hey..
if (filename.size() > 10 && filename[0] == 'U' && filename[9] == '_') {
if (filename.size() > 10 && (filename[0] == 'U' || filename[0] == 'N') && filename[9] == '_') {
*id = filename.substr(0, 9);
return true;
} else {
@ -290,7 +290,7 @@ bool CPU_Init(std::string *errorString, FileLoader *loadedFile) {
}
break;
case IdentifiedFileType::PPSSPP_GE_DUMP:
// Try to grab the disc ID from the filenameor GE dump.
// Try to grab the disc ID from the filename or GE dump.
if (DiscIDFromGEDumpPath(filename, loadedFile, &geDumpDiscID)) {
// Store in SFO, otherwise it'll generate a fake disc ID.
g_paramSFO.SetValue("DISC_ID", geDumpDiscID, 16);