From 3094de97236ebe6a19f2388ad7b3dbf8770ac002 Mon Sep 17 00:00:00 2001 From: James Benton Date: Tue, 16 Feb 2016 14:58:16 +0000 Subject: [PATCH] nn_act: Implement GetPersistentId{Ex} --- src/modules/nn_act/nn_act_core.cpp | 18 ++++++++++++++++++ src/modules/nn_act/nn_act_core.h | 6 ++++++ 2 files changed, 24 insertions(+) diff --git a/src/modules/nn_act/nn_act_core.cpp b/src/modules/nn_act/nn_act_core.cpp index a638e23c..0531b9a8 100644 --- a/src/modules/nn_act/nn_act_core.cpp +++ b/src/modules/nn_act/nn_act_core.cpp @@ -118,6 +118,22 @@ GetParentalControlSlotNoEx(uint8_t *parentSlot, uint8_t slot) return nn::Result::Success; } +uint32_t +GetPersistentId() +{ + return GetPersistentIdEx(gCurrentSlot); +} + +uint32_t +GetPersistentIdEx(uint8_t slot) +{ + if (slot == gCurrentSlot) { + return 1; + } else { + return 0; + } +} + uint32_t GetPrincipalId() { @@ -225,6 +241,8 @@ Module::registerCoreFunctions() RegisterKernelFunctionName("GetAccountIdEx__Q2_2nn3actFPcUc", nn::act::GetAccountIdEx); RegisterKernelFunctionName("GetParentalControlSlotNo__Q2_2nn3actFv", nn::act::GetParentalControlSlotNo); RegisterKernelFunctionName("GetParentalControlSlotNoEx__Q2_2nn3actFPUcUc", nn::act::GetParentalControlSlotNoEx); + RegisterKernelFunctionName("GetPersistentId__Q2_2nn3actFv", nn::act::GetPersistentId); + RegisterKernelFunctionName("GetPersistentIdEx__Q2_2nn3actFv", nn::act::GetPersistentIdEx); RegisterKernelFunctionName("GetPrincipalId__Q2_2nn3actFv", nn::act::GetPrincipalId); RegisterKernelFunctionName("GetPrincipalIdEx__Q2_2nn3actFPUiUc", nn::act::GetPrincipalIdEx); RegisterKernelFunctionName("GetSimpleAddressId__Q2_2nn3actFv", nn::act::GetSimpleAddressId); diff --git a/src/modules/nn_act/nn_act_core.h b/src/modules/nn_act/nn_act_core.h index 3ed62d1d..98e6fc87 100644 --- a/src/modules/nn_act/nn_act_core.h +++ b/src/modules/nn_act/nn_act_core.h @@ -62,6 +62,12 @@ GetParentalControlSlotNo(); nn::Result GetParentalControlSlotNoEx(uint8_t *parentSlot, uint8_t slot); +uint32_t +GetPersistentId(); + +uint32_t +GetPersistentIdEx(uint8_t slot); + uint32_t GetPrincipalId();