diff options
Diffstat (limited to 'Source/Core/DiscIO/DiscExtractor.cpp')
| -rw-r--r-- | Source/Core/DiscIO/DiscExtractor.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/Source/Core/DiscIO/DiscExtractor.cpp b/Source/Core/DiscIO/DiscExtractor.cpp index c9a26f5bdb..057a22378d 100644 --- a/Source/Core/DiscIO/DiscExtractor.cpp +++ b/Source/Core/DiscIO/DiscExtractor.cpp @@ -19,16 +19,21 @@ namespace DiscIO { -std::string DirectoryNameForPartitionType(u32 partition_type) +std::string NameForPartitionType(u32 partition_type, bool include_prefix) { switch (partition_type) { - case 0: + case PARTITION_DATA: return "DATA"; - case 1: + case PARTITION_UPDATE: return "UPDATE"; - case 2: + case PARTITION_CHANNEL: return "CHANNEL"; + case PARTITION_INSTALL: + // wit doesn't recognize the name "INSTALL", so we can't use it when naming partition folders + if (!include_prefix) + return "INSTALL"; + // [[fallthrough]] default: const std::string type_as_game_id{static_cast<char>((partition_type >> 24) & 0xFF), static_cast<char>((partition_type >> 16) & 0xFF), @@ -37,10 +42,10 @@ std::string DirectoryNameForPartitionType(u32 partition_type) if (std::all_of(type_as_game_id.cbegin(), type_as_game_id.cend(), [](char c) { return std::isalnum(c, std::locale::classic()); })) { - return "P-" + type_as_game_id; + return include_prefix ? "P-" + type_as_game_id : type_as_game_id; } - return StringFromFormat("P%u", partition_type); + return StringFromFormat(include_prefix ? "P%u" : "%u", partition_type); } } |
