summaryrefslogtreecommitdiff
path: root/src/core/file_sys
diff options
context:
space:
mode:
authorGravatar Liam2023-12-17 20:46:41 -0500
committerGravatar Liam2023-12-22 21:52:49 -0500
commit31bf57a310f3b3417e96ec9e1cee6c1c817882d9 (patch)
treec5101e70584301cfc452641544cd31d4d4c6d105 /src/core/file_sys
parentk_server_session: remove scratch buffer usage in favor of direct copy (diff)
downloadyuzu-31bf57a310f3b3417e96ec9e1cee6c1c817882d9.tar.gz
yuzu-31bf57a310f3b3417e96ec9e1cee6c1c817882d9.tar.xz
yuzu-31bf57a310f3b3417e96ec9e1cee6c1c817882d9.zip
general: properly support multiple memory instances
Diffstat (limited to 'src/core/file_sys')
-rw-r--r--src/core/file_sys/program_metadata.cpp6
-rw-r--r--src/core/file_sys/program_metadata.h13
2 files changed, 16 insertions, 3 deletions
diff --git a/src/core/file_sys/program_metadata.cpp b/src/core/file_sys/program_metadata.cpp
index 763a44fee..539c7f7af 100644
--- a/src/core/file_sys/program_metadata.cpp
+++ b/src/core/file_sys/program_metadata.cpp
@@ -166,6 +166,10 @@ u32 ProgramMetadata::GetSystemResourceSize() const {
166 return npdm_header.system_resource_size; 166 return npdm_header.system_resource_size;
167} 167}
168 168
169PoolPartition ProgramMetadata::GetPoolPartition() const {
170 return acid_header.pool_partition;
171}
172
169const ProgramMetadata::KernelCapabilityDescriptors& ProgramMetadata::GetKernelCapabilities() const { 173const ProgramMetadata::KernelCapabilityDescriptors& ProgramMetadata::GetKernelCapabilities() const {
170 return aci_kernel_capabilities; 174 return aci_kernel_capabilities;
171} 175}
@@ -201,7 +205,7 @@ void ProgramMetadata::Print() const {
201 // Begin ACID printing (potential perms, signed) 205 // Begin ACID printing (potential perms, signed)
202 LOG_DEBUG(Service_FS, "Magic: {:.4}", acid_header.magic.data()); 206 LOG_DEBUG(Service_FS, "Magic: {:.4}", acid_header.magic.data());
203 LOG_DEBUG(Service_FS, "Flags: 0x{:02X}", acid_header.flags); 207 LOG_DEBUG(Service_FS, "Flags: 0x{:02X}", acid_header.flags);
204 LOG_DEBUG(Service_FS, " > Is Retail: {}", acid_header.is_retail ? "YES" : "NO"); 208 LOG_DEBUG(Service_FS, " > Is Retail: {}", acid_header.production_flag ? "YES" : "NO");
205 LOG_DEBUG(Service_FS, "Title ID Min: 0x{:016X}", acid_header.title_id_min); 209 LOG_DEBUG(Service_FS, "Title ID Min: 0x{:016X}", acid_header.title_id_min);
206 LOG_DEBUG(Service_FS, "Title ID Max: 0x{:016X}", acid_header.title_id_max); 210 LOG_DEBUG(Service_FS, "Title ID Max: 0x{:016X}", acid_header.title_id_max);
207 LOG_DEBUG(Service_FS, "Filesystem Access: 0x{:016X}\n", acid_file_access.permissions); 211 LOG_DEBUG(Service_FS, "Filesystem Access: 0x{:016X}\n", acid_file_access.permissions);
diff --git a/src/core/file_sys/program_metadata.h b/src/core/file_sys/program_metadata.h
index 76ee97d78..a53092b87 100644
--- a/src/core/file_sys/program_metadata.h
+++ b/src/core/file_sys/program_metadata.h
@@ -34,6 +34,13 @@ enum class ProgramFilePermission : u64 {
34 Everything = 1ULL << 63, 34 Everything = 1ULL << 63,
35}; 35};
36 36
37enum class PoolPartition : u32 {
38 Application = 0,
39 Applet = 1,
40 System = 2,
41 SystemNonSecure = 3,
42};
43
37/** 44/**
38 * Helper which implements an interface to parse Program Description Metadata (NPDM) 45 * Helper which implements an interface to parse Program Description Metadata (NPDM)
39 * Data can either be loaded from a file path or with data and an offset into it. 46 * Data can either be loaded from a file path or with data and an offset into it.
@@ -72,6 +79,7 @@ public:
72 u64 GetTitleID() const; 79 u64 GetTitleID() const;
73 u64 GetFilesystemPermissions() const; 80 u64 GetFilesystemPermissions() const;
74 u32 GetSystemResourceSize() const; 81 u32 GetSystemResourceSize() const;
82 PoolPartition GetPoolPartition() const;
75 const KernelCapabilityDescriptors& GetKernelCapabilities() const; 83 const KernelCapabilityDescriptors& GetKernelCapabilities() const;
76 const std::array<u8, 0x10>& GetName() const { 84 const std::array<u8, 0x10>& GetName() const {
77 return npdm_header.application_name; 85 return npdm_header.application_name;
@@ -116,8 +124,9 @@ private:
116 union { 124 union {
117 u32 flags; 125 u32 flags;
118 126
119 BitField<0, 1, u32> is_retail; 127 BitField<0, 1, u32> production_flag;
120 BitField<1, 31, u32> flags_unk; 128 BitField<1, 1, u32> unqualified_approval;
129 BitField<2, 4, PoolPartition> pool_partition;
121 }; 130 };
122 u64_le title_id_min; 131 u64_le title_id_min;
123 u64_le title_id_max; 132 u64_le title_id_max;