From b5bafa43b8d8bfd67030618203e05316345b9a05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 3 Sep 2026 08:10:05 -0600 Subject: [PATCH] Prefer upper case PSP/SHADERS and PSP/THEMES These two were lower case for legacy reasons, unlike every other directory, which actually matters on case sensitive file systems like the one iOS uses. An existing lower case directory is still used if there's no upper case one, so nobody has to move their files. Fixes #20527 Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01JvJR8oJNSCimCM9KXVLjfq --- Core/Util/PathUtil.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Core/Util/PathUtil.cpp b/Core/Util/PathUtil.cpp index 7a0b8eacfc..82cc4b0710 100644 --- a/Core/Util/PathUtil.cpp +++ b/Core/Util/PathUtil.cpp @@ -62,6 +62,22 @@ Path FindConfigFile(const Path &searchPath, std::string_view baseFilename, bool return filename; } +// The custom shader and theme directories are lower case for legacy reasons, which is confusing +// since every other directory is upper case - and on a case sensitive file system, like the one +// iOS uses, the case actually matters. So we prefer the upper case name now, but keep using a +// lower case directory that already exists, so nobody has to move their files. +static Path PreferUpperCaseDir(const Path &parent, const char *upperCase, const char *lowerCase) { + const Path upper = parent / upperCase; + if (File::Exists(upper)) { + return upper; + } + const Path lower = parent / lowerCase; + if (File::Exists(lower)) { + return lower; + } + return upper; +} + Path GetSysDirectory(PSPDirectories directoryType) { const Path &memStickDirectory = g_Config.memStickDirectory; Path pspDirectory; @@ -109,9 +125,9 @@ Path GetSysDirectory(PSPDirectories directoryType) { case DIRECTORY_AUDIO: return pspDirectory / "AUDIO"; case DIRECTORY_CUSTOM_SHADERS: - return pspDirectory / "shaders"; + return PreferUpperCaseDir(pspDirectory, "SHADERS", "shaders"); case DIRECTORY_CUSTOM_THEMES: - return pspDirectory / "themes"; + return PreferUpperCaseDir(pspDirectory, "THEMES", "themes"); case DIRECTORY_NAND: return pspDirectory / "NAND";