From 6636bc75ba782abd90254c2c9e989376857643a0 Mon Sep 17 00:00:00 2001 From: N2614 Date: Thu, 8 Mar 2012 00:46:39 +0000 Subject: [PATCH] =?UTF-8?q?=E3=83=87=E3=83=90=E3=82=A4=E3=82=B9ID=E3=82=92?= =?UTF-8?q?4=E6=96=87=E5=AD=97=E3=81=94=E3=81=A8=E3=81=AB=E7=A9=BA?= =?UTF-8?q?=E7=99=BD=E3=81=A7=E5=8C=BA=E5=88=87=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@659 385bec56-5757-e545-9c3a-d8741f4650f1 --- .../sources/common/DrawSystemState.cpp | 10 +++++++--- .../ConsoleDataMigration/sources/common/Util.cpp | 16 ++++++++++++++++ trunk/ConsoleDataMigration/sources/common/Util.h | 3 +++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/trunk/ConsoleDataMigration/sources/common/DrawSystemState.cpp b/trunk/ConsoleDataMigration/sources/common/DrawSystemState.cpp index 4a33e0b..d5a012f 100644 --- a/trunk/ConsoleDataMigration/sources/common/DrawSystemState.cpp +++ b/trunk/ConsoleDataMigration/sources/common/DrawSystemState.cpp @@ -16,6 +16,7 @@ #include "DrawSystemState.h" #include "ResFont.h" #include "version.h" +#include "Util.h" #include @@ -32,7 +33,7 @@ u8 s_CupMicro; u8 s_NupMajor; nn::cfg::CTR::CfgRegionCode s_Region; u8 s_SerialNo[nn::cfg::CTR::CFG_SECURE_INFO_SERIAL_NO_LEN + 1]; -bit64 s_DeviceId; +char s_DeviceIdStr[30]; char8 s_MacAddress[nn::nwm::Mac::MAC_STRING_SIZE]; u64 s_FriendCode; u8 s_BatteryRemain; @@ -70,7 +71,7 @@ void SetTextWriterCore() GetTextWriter()->Printf("System Ver. %d.%d.%d-%d\n", s_CupMajor, s_CupMinor, s_CupMicro, s_NupMajor); GetTextWriter()->Printf("System Region %s\n", nn::cfg::CTR::GetRegionCodeA3(s_Region)); GetTextWriter()->Printf("Serial No. %s\n", s_SerialNo); - GetTextWriter()->Printf("Device ID %llu\n", s_DeviceId); + GetTextWriter()->Printf("Device ID %s\n", s_DeviceIdStr); GetTextWriter()->Printf("MAC Address %s\n", s_MacAddress); if (s_ReadFriendCode) { @@ -126,7 +127,10 @@ void DrawSystemState s_CupMicro = cupMicroVersion; s_NupMajor = nupVersion; s_BatteryRemain = batteryRemain; - s_DeviceId = deviceId; + nn::nstd::TSNPrintf(s_DeviceIdStr, sizeof(s_DeviceIdStr), "%llu", deviceId); + std::string deviceIdString(s_DeviceIdStr); + Util::SplitDeviceidWithSpace(deviceIdString); + std::memcpy(s_DeviceIdStr, deviceIdString.c_str(), deviceIdString.size()); s_FriendCode = friendCode; s_Progress = progress; std::memcpy(s_MacAddress, macAddress, sizeof(s_MacAddress)); diff --git a/trunk/ConsoleDataMigration/sources/common/Util.cpp b/trunk/ConsoleDataMigration/sources/common/Util.cpp index 15b8196..18ecfcf 100644 --- a/trunk/ConsoleDataMigration/sources/common/Util.cpp +++ b/trunk/ConsoleDataMigration/sources/common/Util.cpp @@ -370,6 +370,22 @@ bool Util::HasReadFriendCode() return m_HasReadFriendCode; } +void Util::SplitDeviceidWithSpace(std::string& deviceIdStr) +{ + std::string tmp = deviceIdStr; + deviceIdStr.clear(); + u32 i = 0; + do + { + deviceIdStr.append(tmp.substr(i, 1)); + i++; + if( i % 4 == 0) + { + deviceIdStr.push_back(' '); + } + }while( i < tmp.size()); +} + nn::Result PrintNetworkSetting() { nn::Result result; diff --git a/trunk/ConsoleDataMigration/sources/common/Util.h b/trunk/ConsoleDataMigration/sources/common/Util.h index a14e174..7c67fa7 100644 --- a/trunk/ConsoleDataMigration/sources/common/Util.h +++ b/trunk/ConsoleDataMigration/sources/common/Util.h @@ -111,6 +111,9 @@ public: // フレンドコードを取得済みかどうか bool HasReadFriendCode(); + // デバイスIDを4文字ごとに空白で区切る + static void SplitDeviceidWithSpace(std::string& deviceIdStr); + private: void Initialize(); void Finalize();