diff --git a/Core/Loaders.cpp b/Core/Loaders.cpp index 6b60f0b387..ce788947f3 100644 --- a/Core/Loaders.cpp +++ b/Core/Loaders.cpp @@ -29,6 +29,7 @@ #include "Core/FileLoaders/ZipFileLoader.h" #include "Core/FileSystems/MetaFileSystem.h" #include "Core/FileSystems/BlockDevices.h" +#include "Core/FileSystems/ISOFileSystem.h" #include "Core/PSPLoaders.h" #include "Core/MemMap.h" #include "Core/Loaders.h" @@ -138,14 +139,18 @@ IdentifiedFileType Identify_File(FileLoader *fileLoader, std::string *errorStrin bd->ReadBlock(16, (u8 *)block16); PVD *pvd = (PVD *)(block16); if (!memcmp(pvd->identifier, "CD001", 5)) { - // It's a PSP ISO file. + // It's a valid DVD-style ISO file. Let's see which type. if (!memcmp(pvd->systemId, "PSP GAME", 8)) { + // Yes, a proper PSP game, let's get it going. return IdentifiedFileType::PSP_ISO; + } else if (!memcmp(pvd->systemId, "UMD VIDEO", 9) || !memcmp(pvd->systemId, "UMD AUDIO", 9)) { + // UMD AUDIO exists technically, but in reality, not really? Let's map it to VIDEO since we support neither. + return IdentifiedFileType::PSP_UMD_VIDEO_ISO; } else if (!memcmp(pvd->systemId, "PS3", 3)) { return IdentifiedFileType::PS3_ISO; } else if (!memcmp(pvd->systemId, "PLAYSTATION", 11)) { *errorString = "PSX or PS2 ISO"; - // Just do a size heuristic here. + // Just do a size heuristic here to differentiate. There are better ways but slower. if (bd->GetUncompressedSize() > 800LL * 1024LL * 1024LL) { return IdentifiedFileType::PS2_ISO; } diff --git a/Core/Loaders.h b/Core/Loaders.h index 1e6e87bc7f..bf064a9ddb 100644 --- a/Core/Loaders.h +++ b/Core/Loaders.h @@ -44,6 +44,7 @@ enum class IdentifiedFileType { PSX_ISO, PS2_ISO, PS3_ISO, + PSP_UMD_VIDEO_ISO, UNKNOWN_BIN, UNKNOWN_ELF, diff --git a/Core/System.cpp b/Core/System.cpp index 16f3e37f25..4b2d2562f5 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -235,6 +235,7 @@ static void GetBootError(IdentifiedFileType type, std::string *errorString) { case IdentifiedFileType::PPSSPP_SAVESTATE: *errorString = "This is a saved state, not a game."; break; // Actually, we could make it load it... case IdentifiedFileType::PSP_SAVEDATA_DIRECTORY: *errorString = "This is save data, not a game."; break; case IdentifiedFileType::PSP_PS1_PBP: *errorString = "PS1 EBOOTs are not supported by PPSSPP."; break; + case IdentifiedFileType::PSP_UMD_VIDEO_ISO: *errorString = "UMD Video ISOs are not supported by PPSSPP."; break; case IdentifiedFileType::UNKNOWN_BIN: case IdentifiedFileType::UNKNOWN_ELF: case IdentifiedFileType::UNKNOWN_ISO: @@ -327,6 +328,13 @@ static bool CPU_Init(FileLoader *fileLoader, IdentifiedFileType type, std::strin gameTitle = g_CoreParameter.fileToStart.GetFilename(); } break; + case IdentifiedFileType::PSP_UMD_VIDEO_ISO: + { + ERROR_LOG(Log::Loader, "PPSSPP doesn't support UMD Video."); + auto er = GetI18NCategory(I18NCat::ERRORS); + *errorString = er->T("PPSSPP doesn't support UMD Video."); + return false; + } default: { // Trying to boot other things lands us here. We need to return a sensible error string. diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index f6079b7592..a2170c0a34 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -1454,9 +1454,9 @@ void EmuScreen::update() { if (errorMessage_.size()) { auto err = GetI18NCategory(I18NCat::ERRORS); auto di = GetI18NCategory(I18NCat::DIALOG); - std::string errLoadingFile = gamePath_.ToVisualString() + "\n"; + std::string errLoadingFile = gamePath_.ToVisualString() + "\n\n"; errLoadingFile.append(err->T("Error loading file", "Could not load game")); - errLoadingFile.append(" "); + errLoadingFile.append("\n"); errLoadingFile.append(err->T(errorMessage_.c_str())); screenManager()->push(new PromptScreen(gamePath_, errLoadingFile, di->T("OK"), "")); diff --git a/UI/GameInfoCache.cpp b/UI/GameInfoCache.cpp index b2d6f9d76e..fafb99c924 100644 --- a/UI/GameInfoCache.cpp +++ b/UI/GameInfoCache.cpp @@ -114,6 +114,7 @@ bool GameInfo::Delete() { case IdentifiedFileType::PSP_ISO_NP: { // Just delete the one file (TODO: handle two-disk games as well somehow). + // Also remove from recent files. Path fileToRemove = filePath_; INFO_LOG(Log::System, "Deleting file %s", fileToRemove.c_str()); MoveFileToTrashOrDelete(fileToRemove); @@ -152,6 +153,7 @@ bool GameInfo::Delete() { case IdentifiedFileType::ARCHIVE_ZIP: case IdentifiedFileType::ARCHIVE_7Z: case IdentifiedFileType::UNKNOWN: + case IdentifiedFileType::PSP_UMD_VIDEO_ISO: case IdentifiedFileType::PPSSPP_GE_DUMP: { const Path &fileToRemove = filePath_; @@ -559,6 +561,7 @@ public: switch (info_->fileType) { case IdentifiedFileType::PSP_PBP: case IdentifiedFileType::PSP_PBP_DIRECTORY: + case IdentifiedFileType::PSP_UMD_VIDEO_ISO: { auto pbpLoader = info_->GetFileLoader(); if (info_->fileType == IdentifiedFileType::PSP_PBP_DIRECTORY) { diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index 72cdafd0b5..49ae911e28 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -291,6 +291,7 @@ void GameButton::Draw(UIContext &dc) { case IdentifiedFileType::PSP_PS1_PBP: imageIcon = ImageID("I_PSX_ISO"); break; case IdentifiedFileType::PS2_ISO: imageIcon = ImageID("I_PS2_ISO"); break; case IdentifiedFileType::PS3_ISO: imageIcon = ImageID("I_PS3_ISO"); break; + case IdentifiedFileType::PSP_UMD_VIDEO_ISO: imageIcon = ImageID("I_UMD_VIDEO_ISO"); break; case IdentifiedFileType::UNKNOWN_ISO: imageIcon = ImageID("I_UNKNOWN_ISO"); break; case IdentifiedFileType::PPSSPP_SAVESTATE: case IdentifiedFileType::ERROR_IDENTIFYING: diff --git a/UI/UIAtlas.cpp b/UI/UIAtlas.cpp index e1b4358255..2bbee969a6 100644 --- a/UI/UIAtlas.cpp +++ b/UI/UIAtlas.cpp @@ -176,6 +176,7 @@ static const ImageMeta imageIDs[] = { {"I_PS2_ISO", false}, {"I_PS3_ISO", false}, {"I_UNKNOWN_ISO", false}, + {"I_UMD_VIDEO_ISO", false}, }; static std::string PNGNameFromID(std::string_view id) { diff --git a/assets/ui_images/images.svg b/assets/ui_images/images.svg index 8e2dab24fd..1ae85cadf1 100644 --- a/assets/ui_images/images.svg +++ b/assets/ui_images/images.svg @@ -26,7 +26,7 @@ inkscape:document-units="px" inkscape:zoom="5.656855" inkscape:cx="359.29859" - inkscape:cy="582.03719" + inkscape:cy="610.32146" inkscape:window-width="3840" inkscape:window-height="2071" inkscape:window-x="-9" @@ -4484,7 +4484,33 @@ id="tspan133" style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:'Trebuchet MS';-inkscape-font-specification:'Trebuchet MS Bold';fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1.23523" x="120.78555" - y="183.62108">PS3PS3PS3