mirror of
https://github.com/rvtr/ctr_Repair.git
synced 2025-10-31 13:51:08 -04:00
NUP禁止モードの追加
FAILしたら初期状態からやり直すように git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@72 385bec56-5757-e545-9c3a-d8741f4650f1
This commit is contained in:
parent
968c16800a
commit
00fc32c49e
@ -71,6 +71,8 @@ bool s_ReadSettingDone = false;
|
|||||||
bool s_ReadSettingSuccess = false;
|
bool s_ReadSettingSuccess = false;
|
||||||
// NUP専用モードかどうか
|
// NUP専用モードかどうか
|
||||||
bool s_NupOnlyMode = false;
|
bool s_NupOnlyMode = false;
|
||||||
|
// NUP禁止モードかどうか
|
||||||
|
bool s_NeverNup = false;
|
||||||
|
|
||||||
// APSettingの書式が無い警告サウンドを鳴らしたかどうか
|
// APSettingの書式が無い警告サウンドを鳴らしたかどうか
|
||||||
bool s_ExistAPSettingAnnotation = false;
|
bool s_ExistAPSettingAnnotation = false;
|
||||||
@ -119,7 +121,7 @@ bool CheckAndReadAPSetting(::std::vector<std::string>& operationMessage)
|
|||||||
if (!s_ReadSettingDone)
|
if (!s_ReadSettingDone)
|
||||||
{
|
{
|
||||||
s_ReadSettingDone = true;
|
s_ReadSettingDone = true;
|
||||||
s_ReadSettingSuccess = ReadSetting(&s_NupOnlyMode);
|
s_ReadSettingSuccess = ReadSetting(&s_NupOnlyMode, &s_NeverNup);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(s_NupOnlyMode)
|
if(s_NupOnlyMode)
|
||||||
@ -192,10 +194,12 @@ void ControlState(::std::vector<std::string>& operationMessage, bool& nextStep,
|
|||||||
// SDカードが挿入されているか?
|
// SDカードが挿入されているか?
|
||||||
if (nn::fs::IsSdmcInserted())
|
if (nn::fs::IsSdmcInserted())
|
||||||
{
|
{
|
||||||
// SDカードにアップデート完了ファイルがあるか?
|
validApSetting = CheckAndReadAPSetting(operationMessage);
|
||||||
if (ExistsUpdateCheckedFile())
|
|
||||||
|
// NUP禁止モードか、SDカードにアップデート完了ファイルがあるか?
|
||||||
|
if (s_NeverNup || ExistsUpdateCheckedFile())
|
||||||
{
|
{
|
||||||
validApSetting = CheckAndReadAPSetting(operationMessage);
|
// NUP専用モードなら終了処理に移る
|
||||||
if (s_NupOnlyMode)
|
if (s_NupOnlyMode)
|
||||||
{
|
{
|
||||||
s_RestoreState = NUP_ONLY_WAIT_SD_EJECT;
|
s_RestoreState = NUP_ONLY_WAIT_SD_EJECT;
|
||||||
@ -292,7 +296,7 @@ void ControlState(::std::vector<std::string>& operationMessage, bool& nextStep,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (CheckAndReadAPSetting(operationMessage))
|
if (validApSetting)
|
||||||
{
|
{
|
||||||
// ネットワークアップデートを行う
|
// ネットワークアップデートを行う
|
||||||
needsUpdate = true;
|
needsUpdate = true;
|
||||||
@ -704,6 +708,14 @@ void ControlState(::std::vector<std::string>& operationMessage, bool& nextStep,
|
|||||||
// 書き込み失敗
|
// 書き込み失敗
|
||||||
case FAIL:
|
case FAIL:
|
||||||
{
|
{
|
||||||
|
static bool init = true;
|
||||||
|
if(init)
|
||||||
|
{
|
||||||
|
// 状態初期化
|
||||||
|
DeleteAllCheckFiles();
|
||||||
|
init = false;
|
||||||
|
}
|
||||||
|
|
||||||
operationMessage.push_back(::std::string("Failed."));
|
operationMessage.push_back(::std::string("Failed."));
|
||||||
if (!s_PlayedFailSound)
|
if (!s_PlayedFailSound)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -835,7 +835,7 @@ bool UpdateNetworkSetting(nn::ac::NetworkSetting& networkSetting)
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ReadSetting(bool* nupOnly)
|
bool ReadSetting(bool* nupOnly, bool* neverNup)
|
||||||
{
|
{
|
||||||
nn::Result result;
|
nn::Result result;
|
||||||
bool retval = true;
|
bool retval = true;
|
||||||
@ -1136,6 +1136,25 @@ bool ReadSetting(bool* nupOnly)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
NN_NULL_ASSERT(neverNup);
|
||||||
|
if (configfileLoader.ReadAsChar(L"NEVER_NUP") != NULL)
|
||||||
|
{
|
||||||
|
s32 num = configfileLoader.ReadAsInteger(L"NEVER_NUP");
|
||||||
|
if (num == 1)
|
||||||
|
{
|
||||||
|
*neverNup = true;
|
||||||
|
COMMON_LOGGER("NEVER_NUP Mode.\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NEVER_NUPがNUP専用モードよりも優先
|
||||||
|
if(!(*neverNup))
|
||||||
{
|
{
|
||||||
NN_NULL_ASSERT(nupOnly);
|
NN_NULL_ASSERT(nupOnly);
|
||||||
if (configfileLoader.ReadAsChar(L"NUP_ONLY") != NULL)
|
if (configfileLoader.ReadAsChar(L"NUP_ONLY") != NULL)
|
||||||
@ -1149,6 +1168,7 @@ bool ReadSetting(bool* nupOnly)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
configfileLoader.Finalize();
|
configfileLoader.Finalize();
|
||||||
|
|
||||||
// 書き込み完了しなければfalse
|
// 書き込み完了しなければfalse
|
||||||
|
|||||||
@ -60,7 +60,7 @@ struct TimeZone
|
|||||||
NN_PADDING3;
|
NN_PADDING3;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool ReadSetting(bool* nupOnly);
|
bool ReadSetting(bool* nupOnly, bool* neverNup);
|
||||||
char* GetNtpServerName();
|
char* GetNtpServerName();
|
||||||
TimeZone GetTimeZone();
|
TimeZone GetTimeZone();
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user