RTC生値を表示するように

git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@274 385bec56-5757-e545-9c3a-d8741f4650f1
This commit is contained in:
N2614 2011-05-25 00:27:34 +00:00
parent 6b939f7b9c
commit 2d9ad4127e
8 changed files with 38 additions and 6 deletions

View File

@ -251,7 +251,8 @@ extern "C" void nnMain(void)
s_HwUtility.GetMacAddress(),
operationMessage,
s_HwUtility.GetRegion(),
s_HwUtility.GetSerialNumber()
s_HwUtility.GetSerialNumber(),
s_HwUtility.GetRtcAll()
);
renderSystem.SwapBuffers();

View File

@ -282,7 +282,8 @@ extern "C" void nnMain(void)
s_HwUtility.GetMacAddress(),
operationMessage,
s_HwUtility.GetRegion(),
s_HwUtility.GetSerialNumber()
s_HwUtility.GetSerialNumber(),
s_HwUtility.GetRtcAll()
);
if (GetRestoreMode() != RESTORE_MODE_RESTORE)

View File

@ -38,6 +38,7 @@ u8 s_BatteryRemain;
std::string s_AdapterState;
u8 s_Progress;
::std::vector<std::string>* s_OperationMessage;
nn::mcu::CTR::RtcData s_Rtc;
}
@ -64,8 +65,15 @@ void SetTextWriterCore()
{
GetTextWriter()->Print("\n");
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));
if(nn::cfg::CTR::GetRegionCodeA3(s_Region) != NULL)
{
GetTextWriter()->Printf("System Ver. %d.%d.%d-%d%c\n", s_CupMajor, s_CupMinor, s_CupMicro, s_NupMajor,
nn::cfg::CTR::GetRegionCodeA3(s_Region)[0]);
}
else
{
GetTextWriter()->Printf("System Ver. %d.%d.%d-%d\n", s_CupMajor, s_CupMinor, s_CupMicro, s_NupMajor);
}
GetTextWriter()->Printf("Serial No. %s\n", s_SerialNo);
GetTextWriter()->Printf("Device ID %llu\n", s_DeviceId);
GetTextWriter()->Printf("MAC Address %s\n", s_MacAddress);
@ -73,6 +81,8 @@ void SetTextWriterCore()
/ 100000000ULL % 10000ULL), static_cast<u32> (s_FriendCode / 10000ULL % 10000ULL),
static_cast<u32> (s_FriendCode % 10000ULL));
GetTextWriter()->Printf("Raw RTC 20%02d/%02d/%02d %02d:%02d:%02d\n", s_Rtc.m_Year, s_Rtc.m_Month, s_Rtc.m_Day,
s_Rtc.m_Hour, s_Rtc.m_Minute, s_Rtc.m_Second);
GetTextWriter()->Printf("Battery %d%%\n", s_BatteryRemain);
GetTextWriter()->Printf("AC Adaper %s\n", s_AdapterState.c_str());
GetTextWriter()->Printf("Progress %02d%%\n", s_Progress);
@ -108,7 +118,8 @@ void DrawSystemState
char8* macAddress,
::std::vector<std::string>& operationMessage,
nn::cfg::CTR::CfgRegionCode region,
u8* serialNo
u8* serialNo,
nn::mcu::CTR::RtcData rtc
)
{
// パラメータ保存
@ -126,6 +137,7 @@ void DrawSystemState
std::memcpy(s_SerialNo, serialNo, sizeof(s_SerialNo));
s_SerialNo[nn::cfg::CTR::CFG_SECURE_INFO_SERIAL_NO_LEN] = '\0';
s_OperationMessage = &operationMessage;
s_Rtc = rtc;
// デフォルトで上画面に描画するもの

View File

@ -24,6 +24,7 @@
#include <nn/cfg/CTR/cfg_ApiInit.h>
#include <nn/cfg/CTR/cfg_ApiSys.h>
#include <nn/util/util_Color.h>
#include <nn/mcu.h>
#include <string>
#include <vector>
@ -71,7 +72,8 @@ void DrawSystemState
char8* macAddress,
::std::vector<std::string>& operationMessage,
nn::cfg::CTR::CfgRegionCode region,
u8* s_SerialNo
u8* serialNo,
nn::mcu::CTR::RtcData rtc
);
}

View File

@ -78,4 +78,9 @@ void HardwareStateManager::GetVersionData(common::VerDef* version)
return m_pUtil->GetVersionData(version);
}
nn::mcu::CTR::RtcData HardwareStateManager::GetRtcAll()
{
return m_pUtil->GetRtcAll();
}
}

View File

@ -40,6 +40,7 @@ public:
nn::Handle GetMcuHandle();
void GetSerialNumber(u8** serial, size_t* size);
void GetVersionData(common::VerDef* version);
nn::mcu::CTR::RtcData GetRtcAll();
private:
NN_PADDING4;

View File

@ -281,6 +281,13 @@ u32 Util::GetBatteryRemain()
return remain;
}
nn::mcu::CTR::RtcData Util::GetRtcAll()
{
nn::mcu::CTR::RtcData data;
mp_Mcu->GetRtcAll(&data);
return data;
}
u64 Util::GetInfraDeviceId()
{
bit64 infraDeviceId;

View File

@ -84,6 +84,9 @@ public:
// バッテリ残量を0100で返す
u32 GetBatteryRemain();
// RTC生値を返す
nn::mcu::CTR::RtcData GetRtcAll();
// 64bitインフラデバイスIDを返す
u64 GetInfraDeviceId();