From 6d0250124a445c9fbd34b99f89594cc7fb9739dd Mon Sep 17 00:00:00 2001 From: Adubbz Date: Sat, 21 Mar 2020 23:25:30 +1100 Subject: [PATCH] ncm client: finish implementing GetContentMetaInfoList --- .../include/stratosphere/ncm/ncm_content_meta.hpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/libraries/libstratosphere/include/stratosphere/ncm/ncm_content_meta.hpp b/libraries/libstratosphere/include/stratosphere/ncm/ncm_content_meta.hpp index 58299cba6..9c8c848b8 100644 --- a/libraries/libstratosphere/include/stratosphere/ncm/ncm_content_meta.hpp +++ b/libraries/libstratosphere/include/stratosphere/ncm/ncm_content_meta.hpp @@ -424,8 +424,16 @@ namespace ams::ncm { return reinterpret_cast(this->GetFirmwareVariationInfoAddress(i)); } - void GetContentMetaInfoList() const { - /* TODO */ + void GetContentMetaInfoList(Span *out_list, size_t i) const { + size_t preceding_content_meta_count = 0; + + /* Count the number of preceding content metas. */ + for (size_t j = 0; j < i; j++) { + preceding_content_meta_count += GetFirmwareVariationInfo(j)->content_meta_count; + } + + /* Output the list. */ + *out_list = Span(reinterpret_cast(GetContentMetaInfoAddress(preceding_content_meta_count)), GetFirmwareVariationInfo(i)->content_meta_count); } };