aboutsummaryrefslogtreecommitdiff
path: root/src/core/file_sys
diff options
context:
space:
mode:
authorlizzie <lizzie@eden-emu.dev>2026-08-04 01:50:54 +0200
committercrueter <crueter@eden-emu.dev>2026-08-04 01:50:54 +0200
commit8fe1e6efa2fe21abc9e8e1f83ecbc5a78389e37b (patch)
treed09c3210519fda784e30d2754baf21dd4db8324d /src/core/file_sys
parentee197e622216e85753512ed79e9242442a312544 (diff)
[core/file_sys] implement IApplicationFunctions::GetPseudoDeviceId; common PatchManager::GetNACP for base|updates (#4159)
a bit of refactoring so there's less code duplication... probably a good idea to make it a lambda anyways maybe this is why QLauncher didn't have proper DLCs and updates? either way "GetPseudoDeviceId" is now implemented (still stubbed) with a proper hash instead of just 0 Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4159 Reviewed-by: Maufeat <sahyno1996@gmail.com> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Diffstat (limited to 'src/core/file_sys')
-rw-r--r--src/core/file_sys/control_metadata.h33
-rw-r--r--src/core/file_sys/patch_manager.cpp10
-rw-r--r--src/core/file_sys/patch_manager.h3
3 files changed, 29 insertions, 17 deletions
diff --git a/src/core/file_sys/control_metadata.h b/src/core/file_sys/control_metadata.h
index 7b90ba235d..670e8f7389 100644
--- a/src/core/file_sys/control_metadata.h
+++ b/src/core/file_sys/control_metadata.h
@@ -274,23 +274,22 @@ public:
explicit NACP(VirtualFile file);
~NACP();
- const LanguageEntry& GetLanguageEntry() const;
- std::string GetApplicationName() const;
- std::string GetDeveloperName() const;
- u64 GetTitleId() const;
- u64 GetDLCBaseTitleId() const;
- std::string GetVersionString() const;
- u64 GetDefaultNormalSaveSize() const;
- u64 GetDefaultJournalSaveSize() const;
- u32 GetSupportedLanguages() const;
- std::vector<std::string> GetApplicationNames() const;
- std::vector<u8> GetRawBytes() const;
- bool GetUserAccountSwitchLock() const;
- u64 GetDeviceSaveDataSize() const;
- u32 GetParentalControlFlag() const;
- const std::array<u8, 0x20>& GetRatingAge() const;
-
-private:
+ [[nodiscard]] const LanguageEntry& GetLanguageEntry() const;
+ [[nodiscard]] std::string GetApplicationName() const;
+ [[nodiscard]] std::string GetDeveloperName() const;
+ [[nodiscard]] u64 GetTitleId() const;
+ [[nodiscard]] u64 GetDLCBaseTitleId() const;
+ [[nodiscard]] std::string GetVersionString() const;
+ [[nodiscard]] u64 GetDefaultNormalSaveSize() const;
+ [[nodiscard]] u64 GetDefaultJournalSaveSize() const;
+ [[nodiscard]] u32 GetSupportedLanguages() const;
+ [[nodiscard]] std::vector<std::string> GetApplicationNames() const;
+ [[nodiscard]] std::vector<u8> GetRawBytes() const;
+ [[nodiscard]] bool GetUserAccountSwitchLock() const;
+ [[nodiscard]] u64 GetDeviceSaveDataSize() const;
+ [[nodiscard]] u32 GetParentalControlFlag() const;
+ [[nodiscard]] const std::array<u8, 0x20>& GetRatingAge() const;
+
RawNACP raw{};
std::vector<LanguageEntry> language_entries;
};
diff --git a/src/core/file_sys/patch_manager.cpp b/src/core/file_sys/patch_manager.cpp
index 80372ec94e..6ae4679054 100644
--- a/src/core/file_sys/patch_manager.cpp
+++ b/src/core/file_sys/patch_manager.cpp
@@ -1156,4 +1156,14 @@ PatchManager::Metadata PatchManager::ParseControlNCA(const NCA& nca) const {
return {std::move(nacp), icon_file};
}
+
+[[nodiscard]] PatchManager::Metadata PatchManager::GetMetadataFromBaseOrUpdate(Core::System& system, u64 application_id) noexcept {
+ const FileSys::PatchManager pm{application_id, system.GetFileSystemController(), system.GetContentProvider()};
+ auto metadata = pm.GetControlMetadata();
+ if (metadata.first != nullptr)
+ return metadata;
+ const FileSys::PatchManager pm_update{FileSys::GetUpdateTitleID(application_id), system.GetFileSystemController(), system.GetContentProvider()};
+ return pm_update.GetControlMetadata();
+}
+
} // namespace FileSys
diff --git a/src/core/file_sys/patch_manager.h b/src/core/file_sys/patch_manager.h
index 755d924fd4..5d71dbcf20 100644
--- a/src/core/file_sys/patch_manager.h
+++ b/src/core/file_sys/patch_manager.h
@@ -105,6 +105,9 @@ public:
// Version of GetControlMetadata that takes an arbitrary NCA
[[nodiscard]] Metadata ParseControlNCA(const NCA& nca) const;
+ /// @brief Gets NACP metadata (accounting for any patches or updates)
+ [[nodiscard]] static PatchManager::Metadata GetMetadataFromBaseOrUpdate(Core::System& system, u64 application_id) noexcept;
+
private:
[[nodiscard]] std::vector<VirtualFile> CollectPatches(const std::vector<VirtualDir>& patch_dirs,
const std::string& build_id) const;