From 696cfb48624c3b66019ef94b1678694455160eb0 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Thu, 26 May 2022 18:44:12 -0700 Subject: [PATCH] lr: update capacity constants to reflect 12.0.0 changes --- .../lr/lr_add_on_content_location_resolver_impl.hpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libstratosphere/source/lr/lr_add_on_content_location_resolver_impl.hpp b/libstratosphere/source/lr/lr_add_on_content_location_resolver_impl.hpp index 2b033f66..6f96ed72 100644 --- a/libstratosphere/source/lr/lr_add_on_content_location_resolver_impl.hpp +++ b/libstratosphere/source/lr/lr_add_on_content_location_resolver_impl.hpp @@ -25,8 +25,19 @@ namespace ams::lr { private: /* Storage for RegisteredData entries by data id. */ RegisteredStorages m_registered_storages; + private: + static ALWAYS_INLINE size_t GetStorageCapacity() { + const auto version = hos::GetVersion(); + if (version >= hos::Version_12_0_0) { + return 0x8; + } else if (version >= hos::Version_9_0_0) { + return 0x2; + } else { + return 0x800; + } + } public: - AddOnContentLocationResolverImpl() : m_registered_storages(hos::GetVersion() < hos::Version_9_0_0 ? 0x800 : 0x2) { /* ... */ } + AddOnContentLocationResolverImpl() : m_registered_storages(GetStorageCapacity()) { /* ... */ } /* Actual commands. */ Result ResolveAddOnContentPath(sf::Out out, ncm::DataId id);