mirror of
https://github.com/rvtr/ctr_Repair.git
synced 2025-10-31 13:51:08 -04:00
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:
parent
2b999ad5b5
commit
68297f1b94
@ -261,6 +261,12 @@ extern "C" void nnMain(void)
|
|||||||
titleColor.g = 0.2f;
|
titleColor.g = 0.2f;
|
||||||
titleColor.b = 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",
|
common::DrawSystemState("CTR Console Restore",
|
||||||
@ -302,6 +308,10 @@ extern "C" void nnMain(void)
|
|||||||
{
|
{
|
||||||
s_RenderSystem.DrawText(0, lineBottom * spaceSize, "GET-IVS Mode");
|
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.SetColor(titleColor.r, titleColor.g, titleColor.b);
|
||||||
s_RenderSystem.FillRectangle(0, lineBottom * spaceSize, screenWidth, spaceSize);
|
s_RenderSystem.FillRectangle(0, lineBottom * spaceSize, screenWidth, spaceSize);
|
||||||
|
|||||||
@ -48,6 +48,8 @@ bool s_ReadSettingIsSuccess = false;
|
|||||||
bool s_NupOnlyMode = false;
|
bool s_NupOnlyMode = false;
|
||||||
// IVS取得専用モードかどうか
|
// IVS取得専用モードかどうか
|
||||||
bool s_GetIvsOnlyMode = false;
|
bool s_GetIvsOnlyMode = false;
|
||||||
|
// SDカード確認専用モード
|
||||||
|
bool s_CheckSdOnlyMode = false;
|
||||||
|
|
||||||
// APSettingの書式が無い警告サウンドを鳴らしたかどうか
|
// APSettingの書式が無い警告サウンドを鳴らしたかどうか
|
||||||
bool s_ExistAPSettingAnnotation = false;
|
bool s_ExistAPSettingAnnotation = false;
|
||||||
@ -215,9 +217,16 @@ void CheckSdWritable(common::HardwareStateManager& manager, ::std::vector<std::s
|
|||||||
void CheckApSetting(common::HardwareStateManager& manager, ::std::vector<std::string>& message, bool& goNextStep)
|
void CheckApSetting(common::HardwareStateManager& manager, ::std::vector<std::string>& message, bool& goNextStep)
|
||||||
{
|
{
|
||||||
if (CheckAndReadAPSetting(message))
|
if (CheckAndReadAPSetting(message))
|
||||||
|
{
|
||||||
|
if(s_CheckSdOnlyMode)
|
||||||
|
{
|
||||||
|
s_RestoreState = CHECK_IVS;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
CheckNupExecuted(manager, message, goNextStep);
|
CheckNupExecuted(manager, message, goNextStep);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
s_RestoreState = STARTUP;
|
s_RestoreState = STARTUP;
|
||||||
@ -671,12 +680,14 @@ bool CheckAndReadAPSetting(::std::vector<std::string>& operationMessage)
|
|||||||
if (!s_ReadSettingDone)
|
if (!s_ReadSettingDone)
|
||||||
{
|
{
|
||||||
s_ReadSettingDone = true;
|
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;
|
s_ReadSettingIsSuccess = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -690,6 +701,11 @@ bool CheckAndReadAPSetting(::std::vector<std::string>& operationMessage)
|
|||||||
{
|
{
|
||||||
s_RestoreMode = RESTORE_MODE_GET_IVS;
|
s_RestoreMode = RESTORE_MODE_GET_IVS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(s_CheckSdOnlyMode)
|
||||||
|
{
|
||||||
|
s_RestoreMode = RESTORE_MODE_CHECK_SD;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!s_ReadSettingIsSuccess)
|
if (!s_ReadSettingIsSuccess)
|
||||||
@ -1432,6 +1448,7 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
|
|||||||
if (nextStep)
|
if (nextStep)
|
||||||
{
|
{
|
||||||
s_RestoreState = SHUTDOWN;
|
s_RestoreState = SHUTDOWN;
|
||||||
|
DeleteAllCheckFiles();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1543,6 +1560,7 @@ void InitializeState()
|
|||||||
s_GetIvsOnlyMode = false;
|
s_GetIvsOnlyMode = false;
|
||||||
s_SdWriteProetctAnnotation = false;
|
s_SdWriteProetctAnnotation = false;
|
||||||
s_WifiStatusOffAnnotation = false;
|
s_WifiStatusOffAnnotation = false;
|
||||||
|
s_CheckSdOnlyMode = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 GetProgress()
|
u32 GetProgress()
|
||||||
|
|||||||
@ -28,7 +28,9 @@ typedef enum RestoreMode
|
|||||||
{
|
{
|
||||||
RESTORE_MODE_RESTORE,
|
RESTORE_MODE_RESTORE,
|
||||||
RESTORE_MODE_NUP_ONLY,
|
RESTORE_MODE_NUP_ONLY,
|
||||||
RESTORE_MODE_GET_IVS
|
RESTORE_MODE_GET_IVS,
|
||||||
|
RESTORE_MODE_CHECK_SD
|
||||||
|
|
||||||
} RestoreMode;
|
} RestoreMode;
|
||||||
|
|
||||||
// ネットワーク処理のリトライ回数の最大値
|
// ネットワーク処理のリトライ回数の最大値
|
||||||
|
|||||||
@ -1015,7 +1015,7 @@ bool UpdateNetworkSetting(nn::ac::NetworkSetting& networkSetting)
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ReadSetting(bool* nupOnly, bool* getIvs)
|
bool ReadSetting(bool* nupOnly, bool* getIvs, bool* checkSd)
|
||||||
{
|
{
|
||||||
nn::Result result;
|
nn::Result result;
|
||||||
bool retval = true;
|
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();
|
configfileLoader.Finalize();
|
||||||
|
|
||||||
// 書き込み完了しなければfalse
|
// 書き込み完了しなければfalse
|
||||||
|
|||||||
@ -108,7 +108,7 @@ struct TimeZone
|
|||||||
};
|
};
|
||||||
|
|
||||||
// ネットワーク設定ファイルを読み込む
|
// ネットワーク設定ファイルを読み込む
|
||||||
bool ReadSetting(bool* nupOnly, bool* getIvs);
|
bool ReadSetting(bool* nupOnly, bool* getIvs, bool* checkSd);
|
||||||
|
|
||||||
// ネットワーク設定ファイルからNTPサーバの名前を取得する
|
// ネットワーク設定ファイルからNTPサーバの名前を取得する
|
||||||
// 先にReadSettingが成功している必要がある
|
// 先にReadSettingが成功している必要がある
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user