From 923442ed4c23c9db174f2bd8b219b5d29c1bc45d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 16 May 2023 17:51:27 +0200 Subject: [PATCH] Make the DJ Max workaround more aggressive about hiding stuff. May help #17463 --- Core/FileSystems/DirectoryFileSystem.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/Core/FileSystems/DirectoryFileSystem.cpp b/Core/FileSystems/DirectoryFileSystem.cpp index f6b5659243..4e700d4a3a 100644 --- a/Core/FileSystems/DirectoryFileSystem.cpp +++ b/Core/FileSystems/DirectoryFileSystem.cpp @@ -46,6 +46,7 @@ #include "Core/System.h" #include "Core/Replay.h" #include "Core/Reporting.h" +#include "Core/ELF/ParamSFO.h" #ifdef _WIN32 #include "Common/CommonWindows.h" @@ -830,9 +831,22 @@ std::vector DirectoryFileSystem::GetDirListing(const std::string &p } else { entry.name = file.name; } - if (hideISOFiles && (endsWithNoCase(entry.name, ".cso") || endsWithNoCase(entry.name, ".iso"))) { - // Workaround for DJ Max Portable, see compat.ini. - continue; + if (hideISOFiles) { + if (endsWithNoCase(entry.name, ".cso") || endsWithNoCase(entry.name, ".iso")) { + // Workaround for DJ Max Portable, see compat.ini. + continue; + } else if (file.isDirectory) { + if (endsWithNoCase(path, "SAVEDATA")) { + // Don't let it see savedata from other games, it can misinterpret stuff. + std::string gameID = g_paramSFO.GetDiscID(); + if (entry.name.size() > 2 && !startsWithNoCase(entry.name, gameID)) { + continue; + } + } else if (file.name == "GAME" || file.name == "TEXTURES" || file.name == "PPSSPP_STATE" || equalsNoCase(file.name, "Cheats")) { + // The game scans these folders on startup which can take time. Skip them. + continue; + } + } } if (file.name == "..") { entry.size = 4096;