From 3cdaa48922909be6e2da72a48fc9bb9c481ca06d Mon Sep 17 00:00:00 2001 From: Joel16 Date: Mon, 11 Nov 2024 16:24:13 +0000 Subject: [PATCH] nnid: Hide non functioning details for now --- source/gui.cpp | 11 ++++++----- source/nnid.cpp | 19 +++++++++++-------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/source/gui.cpp b/source/gui.cpp index 6a75d44..6531a0d 100755 --- a/source/gui.cpp +++ b/source/gui.cpp @@ -68,7 +68,7 @@ namespace GUI { ptmuInit(); cfguInit(); dspInit(); - socInit((u32*)memalign(0x1000, 0x10000), 0x10000); + socInit(static_cast(memalign(0x1000, 0x10000)), 0x10000); } void Exit(void) { @@ -214,10 +214,11 @@ namespace GUI { static void NNIDInfoPage(const NNIDInfo &info, bool &displayInfo) { GUI::DrawItemf(1, "Persistent ID:", "%u", displayInfo? info.persistentID : 0); GUI::DrawItemf(2, "Transferable ID Base:", "%llu", displayInfo? info.transferableIdBase : 0); - GUI::DrawItem(3, "Account ID:", info.accountId); - GUI::DrawItem(4, "Country:", displayInfo? info.countryName : ""); - GUI::DrawItemf(5, "Principal ID:", "%u", displayInfo? info.principalID : 0); - GUI::DrawItem(6, "NFS Password:", displayInfo? info.nfsPassword : ""); + GUI::DrawItemf(3, "Principal ID:", "%u", displayInfo? info.principalID : 0); + // The following are not functioning + // GUI::DrawItem(4, "Account ID:", info.accountId); + // GUI::DrawItem(5, "Country:", displayInfo? info.countryName : ""); + // GUI::DrawItem(6, "NFS Password:", displayInfo? info.nfsPassword : ""); } static void ConfigInfoPage(const ConfigInfo &info, bool &displayInfo) { diff --git a/source/nnid.cpp b/source/nnid.cpp index e02b152..1c885f9 100644 --- a/source/nnid.cpp +++ b/source/nnid.cpp @@ -7,7 +7,7 @@ namespace NNID { Result ret = 0; u32 persistentId; - if (R_FAILED(ret = ACTU::GetAccountDataBlock(0xFE, 0x5, 0x4, std::addressof(persistentId)))) { + if (R_FAILED(ret = ACTU::GetAccountDataBlock(0xFE, 0x5, sizeof(u32), std::addressof(persistentId)))) { return ret; } @@ -18,29 +18,31 @@ namespace NNID { Result ret = 0; u64 transferableIdBase; - if (R_FAILED(ret = ACTU::GetAccountDataBlock(0xFE, 0x6, 0x8, std::addressof(transferableIdBase)))) { + if (R_FAILED(ret = ACTU::GetAccountDataBlock(0xFE, 0x6, sizeof(u64), std::addressof(transferableIdBase)))) { return ret; } return transferableIdBase; } + // TODO: Fix/research const char *GetAccountId(void) { Result ret = 0; static char accountId[0x11]; - if (R_FAILED(ret = ACTU::GetAccountDataBlock(0xFE, 0x8, 0x11, accountId))) { + if (R_FAILED(ret = ACTU::GetAccountDataBlock(0xFE, 0x8, sizeof(accountId), accountId))) { return "unknown"; } return accountId; } - + + // TODO: Fix/research const char *GetCountryName(void) { Result ret = 0; static char countryName[0x3]; - if (R_FAILED(ret = ACTU::GetAccountDataBlock(0xFE, 0xB, 0x3, countryName))) { + if (R_FAILED(ret = ACTU::GetAccountDataBlock(0xFE, 0xB, sizeof(countryName), countryName))) { return "unknown"; } @@ -51,18 +53,19 @@ namespace NNID { Result ret = 0; u32 principalId; - if (R_FAILED(ret = ACTU::GetAccountDataBlock(0xFE, 0xC, 0x4, std::addressof(principalId)))) { + if (R_FAILED(ret = ACTU::GetAccountDataBlock(0xFE, 0xC, sizeof(u32), std::addressof(principalId)))) { return ret; } return principalId; } - + + // TODO: Fix/research const char *GetNfsPassword(void) { Result ret = 0; static char nfsPassword[0x11]; - if (R_FAILED(ret = ACTU::GetAccountDataBlock(0xFE, 0x1C, 0x11, nfsPassword))) { + if (R_FAILED(ret = ACTU::GetAccountDataBlock(0xFE, 0x1C, sizeof(nfsPassword), nfsPassword))) { return "unknown"; }