IVSが正しいかどうかをユーザのSDカードに基づいてチェックするモードを分離

git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@276 385bec56-5757-e545-9c3a-d8741f4650f1
This commit is contained in:
N2614 2011-05-25 07:16:16 +00:00
parent 2b999ad5b5
commit 68297f1b94
5 changed files with 51 additions and 7 deletions

View File

@ -261,6 +261,12 @@ extern "C" void nnMain(void)
titleColor.g = 0.2f;
titleColor.b = 0.2f;
}
else if(GetRestoreMode() == RESTORE_MODE_CHECK_SD)
{
titleColor.r = 0.2f;
titleColor.g = 0.2f;
titleColor.b = 1.2f;
}
// 上画面表示
common::DrawSystemState("CTR Console Restore",
@ -302,6 +308,10 @@ extern "C" void nnMain(void)
{
s_RenderSystem.DrawText(0, lineBottom * spaceSize, "GET-IVS Mode");
}
else if (GetRestoreMode() == RESTORE_MODE_CHECK_SD)
{
s_RenderSystem.DrawText(0, lineBottom * spaceSize, "CHECK-SD Mode");
}
s_RenderSystem.SetColor(titleColor.r, titleColor.g, titleColor.b);
s_RenderSystem.FillRectangle(0, lineBottom * spaceSize, screenWidth, spaceSize);

View File

@ -48,6 +48,8 @@ bool s_ReadSettingIsSuccess = false;
bool s_NupOnlyMode = false;
// IVS取得専用モードかどうか
bool s_GetIvsOnlyMode = false;
// SDカード確認専用モード
bool s_CheckSdOnlyMode = false;
// APSettingの書式が無い警告サウンドを鳴らしたかどうか
bool s_ExistAPSettingAnnotation = false;
@ -216,7 +218,14 @@ void CheckApSetting(common::HardwareStateManager& manager, ::std::vector<std::st
{
if (CheckAndReadAPSetting(message))
{
CheckNupExecuted(manager, message, goNextStep);
if(s_CheckSdOnlyMode)
{
s_RestoreState = CHECK_IVS;
}
else
{
CheckNupExecuted(manager, message, goNextStep);
}
}
else
{
@ -671,12 +680,14 @@ bool CheckAndReadAPSetting(::std::vector<std::string>& operationMessage)
if (!s_ReadSettingDone)
{
s_ReadSettingDone = true;
s_ReadSettingIsSuccess = ReadSetting(&s_NupOnlyMode, &s_GetIvsOnlyMode);
s_ReadSettingIsSuccess = ReadSetting(&s_NupOnlyMode, &s_GetIvsOnlyMode, &s_CheckSdOnlyMode);
}
if(s_NupOnlyMode && s_GetIvsOnlyMode)
if (s_NupOnlyMode && s_GetIvsOnlyMode
|| s_GetIvsOnlyMode && s_CheckSdOnlyMode
|| s_CheckSdOnlyMode && s_NupOnlyMode)
{
operationMessage.push_back("Both NUP_ONLY and GET_IVS settings are described!!");
operationMessage.push_back("Only one special mode setting is valid!!");
s_ReadSettingIsSuccess = false;
}
else
@ -690,6 +701,11 @@ bool CheckAndReadAPSetting(::std::vector<std::string>& operationMessage)
{
s_RestoreMode = RESTORE_MODE_GET_IVS;
}
if(s_CheckSdOnlyMode)
{
s_RestoreMode = RESTORE_MODE_CHECK_SD;
}
}
if (!s_ReadSettingIsSuccess)
@ -1432,6 +1448,7 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
if (nextStep)
{
s_RestoreState = SHUTDOWN;
DeleteAllCheckFiles();
}
}
break;
@ -1543,6 +1560,7 @@ void InitializeState()
s_GetIvsOnlyMode = false;
s_SdWriteProetctAnnotation = false;
s_WifiStatusOffAnnotation = false;
s_CheckSdOnlyMode = false;
}
u32 GetProgress()

View File

@ -28,7 +28,9 @@ typedef enum RestoreMode
{
RESTORE_MODE_RESTORE,
RESTORE_MODE_NUP_ONLY,
RESTORE_MODE_GET_IVS
RESTORE_MODE_GET_IVS,
RESTORE_MODE_CHECK_SD
} RestoreMode;
// ネットワーク処理のリトライ回数の最大値

View File

@ -1015,7 +1015,7 @@ bool UpdateNetworkSetting(nn::ac::NetworkSetting& networkSetting)
return retval;
}
bool ReadSetting(bool* nupOnly, bool* getIvs)
bool ReadSetting(bool* nupOnly, bool* getIvs, bool* checkSd)
{
nn::Result result;
bool retval = true;
@ -1344,6 +1344,20 @@ bool ReadSetting(bool* nupOnly, bool* getIvs)
}
}
{
const wchar_t* const CHECK_SD_STR = L"CHECK_SD";
NN_NULL_ASSERT(checkSd);
if (configfileLoader.ReadAsChar(CHECK_SD_STR) != NULL)
{
s32 num = configfileLoader.ReadAsInteger(CHECK_SD_STR);
if (num == 1)
{
*checkSd = true;
COMMON_LOGGER("CHECK SD Mode.\n");
}
}
}
configfileLoader.Finalize();
// 書き込み完了しなければfalse

View File

@ -108,7 +108,7 @@ struct TimeZone
};
// ネットワーク設定ファイルを読み込む
bool ReadSetting(bool* nupOnly, bool* getIvs);
bool ReadSetting(bool* nupOnly, bool* getIvs, bool* checkSd);
// ネットワーク設定ファイルからNTPサーバの名前を取得する
// 先にReadSettingが成功している必要がある