From cf9ab6ddcc93cd279aaf62897095ac5b8929bab9 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Thu, 21 Mar 2019 22:23:12 +0100 Subject: DiscExtractor: Make P prefix for partition names optional Also added constants for common partition types. --- Source/Core/DiscIO/DiscExtractor.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Source/Core/DiscIO/DiscExtractor.cpp') diff --git a/Source/Core/DiscIO/DiscExtractor.cpp b/Source/Core/DiscIO/DiscExtractor.cpp index c9a26f5bdb..34c55a1d73 100644 --- a/Source/Core/DiscIO/DiscExtractor.cpp +++ b/Source/Core/DiscIO/DiscExtractor.cpp @@ -19,15 +19,15 @@ 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"; default: const std::string type_as_game_id{static_cast((partition_type >> 24) & 0xFF), @@ -37,10 +37,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); } } -- cgit v1.2.3 From 84cbd5150f62bd5dd4a8d621fd0ccf7623ca4e2c Mon Sep 17 00:00:00 2001 From: JosJuice Date: Thu, 21 Mar 2019 23:04:56 +0100 Subject: Add a Verify tab to game properties --- Source/Core/DiscIO/DiscExtractor.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Source/Core/DiscIO/DiscExtractor.cpp') diff --git a/Source/Core/DiscIO/DiscExtractor.cpp b/Source/Core/DiscIO/DiscExtractor.cpp index 34c55a1d73..057a22378d 100644 --- a/Source/Core/DiscIO/DiscExtractor.cpp +++ b/Source/Core/DiscIO/DiscExtractor.cpp @@ -29,6 +29,11 @@ std::string NameForPartitionType(u32 partition_type, bool include_prefix) return "UPDATE"; 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((partition_type >> 24) & 0xFF), static_cast((partition_type >> 16) & 0xFF), -- cgit v1.2.3