mirror of
https://github.com/rvtr/ctr_Repair.git
synced 2025-10-31 13:51:08 -04:00
ZeroNUP限定コードを削除。必ずNUPするように。
enumを適切な名前に変更 git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@206 385bec56-5757-e545-9c3a-d8741f4650f1
This commit is contained in:
parent
fb5e0ebbc3
commit
8dcb999097
@ -56,7 +56,7 @@ typedef enum RestoreState
|
|||||||
RESTORE_DONE, // 書き込み完了
|
RESTORE_DONE, // 書き込み完了
|
||||||
REBOOTING, // 再起動を行う
|
REBOOTING, // 再起動を行う
|
||||||
ERASE, // 削除処理を行う
|
ERASE, // 削除処理を行う
|
||||||
HISTORY_RECOVER, // プレイ履歴の書き戻しを行う
|
RESTORE_CAL, // cfgの一部をcal値で上書きする
|
||||||
TIME_ADJUST, // 時計あわせを行う
|
TIME_ADJUST, // 時計あわせを行う
|
||||||
WAIT_SD_EJECT, // SDカードぬき待ち
|
WAIT_SD_EJECT, // SDカードぬき待ち
|
||||||
ALL_DONE, // すべて完了
|
ALL_DONE, // すべて完了
|
||||||
@ -90,12 +90,6 @@ bool s_PlayedStartCursor = false;
|
|||||||
bool s_PlayedRebootCursor = false;
|
bool s_PlayedRebootCursor = false;
|
||||||
// SD抜き出し前サウンドを鳴らしたかどうか
|
// SD抜き出し前サウンドを鳴らしたかどうか
|
||||||
bool s_PlayedSdPullOutCursor = false;
|
bool s_PlayedSdPullOutCursor = false;
|
||||||
// バージョンデータが無い警告サウンドを鳴らしたかどうか
|
|
||||||
bool s_ExistsVersionDataAnnotation = false;
|
|
||||||
// バージョンデータを読んだかどうか
|
|
||||||
bool s_ReadVersionDone = false;
|
|
||||||
// バージョンデータを読んだ結果
|
|
||||||
nn::Result s_ReadVersionResult = nn::ResultSuccess();
|
|
||||||
// SDに書き込みできない警告サウンドを鳴らしたかどうか
|
// SDに書き込みできない警告サウンドを鳴らしたかどうか
|
||||||
bool s_SdWriteProetctAnnotation = false;
|
bool s_SdWriteProetctAnnotation = false;
|
||||||
// WiFiがOFFである警告サウンドを鳴らしたかどうか
|
// WiFiがOFFである警告サウンドを鳴らしたかどうか
|
||||||
@ -155,32 +149,6 @@ bool CheckAndReadAPSetting(::std::vector<std::string>& operationMessage)
|
|||||||
return s_ReadSettingSuccess;
|
return s_ReadSettingSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
nn::Result CheckAndReadVersionData(::std::vector<std::string>& operationMessage)
|
|
||||||
{
|
|
||||||
using namespace common;
|
|
||||||
|
|
||||||
if (!ExistsVersionData())
|
|
||||||
{
|
|
||||||
if(!s_ExistsVersionDataAnnotation)
|
|
||||||
{
|
|
||||||
s_ExistsVersionDataAnnotation = true;
|
|
||||||
common::PlaySound(common::SOUND_ANNOTATION);
|
|
||||||
}
|
|
||||||
operationMessage.push_back(::std::string("Version Data does not exist!"));
|
|
||||||
return nn::Result(nn::Result::LEVEL_PERMANENT, nn::Result::SUMMARY_NOT_FOUND, nn::Result::MODULE_COMMON,
|
|
||||||
nn::Result::DESCRIPTION_NOT_FOUND);
|
|
||||||
}
|
|
||||||
|
|
||||||
// バージョン情報ファイルを読み込む
|
|
||||||
if (!s_ReadVersionDone)
|
|
||||||
{
|
|
||||||
s_ReadVersionDone = true;
|
|
||||||
s_ReadVersionResult = ReadVersionData();
|
|
||||||
}
|
|
||||||
|
|
||||||
return s_ReadVersionResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PutAliveMessage(::std::vector<std::string>& operationMessage, const char* str)
|
void PutAliveMessage(::std::vector<std::string>& operationMessage, const char* str)
|
||||||
{
|
{
|
||||||
std::string message = std::string(str);
|
std::string message = std::string(str);
|
||||||
@ -220,19 +188,6 @@ nn::Result ExecSyncMcuRtc()
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Zero NUP限定コード
|
|
||||||
bool NeedsNup()
|
|
||||||
{
|
|
||||||
if(AlreadyExecutedNup() || s_NupOnlyMode)
|
|
||||||
{
|
|
||||||
return !common::ExistsUpdateCheckedFile();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ControlState(::std::vector<std::string>& operationMessage, bool& nextStep, bool& continueRestore)
|
void ControlState(::std::vector<std::string>& operationMessage, bool& nextStep, bool& continueRestore)
|
||||||
{
|
{
|
||||||
using namespace common;
|
using namespace common;
|
||||||
@ -264,14 +219,6 @@ void ControlState(::std::vector<std::string>& operationMessage, bool& nextStep,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = CheckAndReadVersionData(operationMessage);
|
|
||||||
if(result.IsFailure())
|
|
||||||
{
|
|
||||||
// バージョン情報の取得に失敗
|
|
||||||
error = true;
|
|
||||||
s_RestoreState = FAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
validApSetting = CheckAndReadAPSetting(operationMessage);
|
validApSetting = CheckAndReadAPSetting(operationMessage);
|
||||||
if (!validApSetting)
|
if (!validApSetting)
|
||||||
{
|
{
|
||||||
@ -279,8 +226,8 @@ void ControlState(::std::vector<std::string>& operationMessage, bool& nextStep,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// NUPが必要か?
|
// NUP済みかどうか
|
||||||
if (!NeedsNup())
|
if (ExistsUpdateCheckedFile())
|
||||||
{
|
{
|
||||||
if (s_NupOnlyMode)
|
if (s_NupOnlyMode)
|
||||||
{
|
{
|
||||||
@ -780,12 +727,12 @@ void ControlState(::std::vector<std::string>& operationMessage, bool& nextStep,
|
|||||||
case ERASE:
|
case ERASE:
|
||||||
{
|
{
|
||||||
Cleanup();
|
Cleanup();
|
||||||
s_RestoreState = HISTORY_RECOVER;
|
s_RestoreState = RESTORE_CAL;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// 削除処理
|
// 削除処理
|
||||||
case HISTORY_RECOVER:
|
case RESTORE_CAL:
|
||||||
{
|
{
|
||||||
static bool init = true;
|
static bool init = true;
|
||||||
if (init)
|
if (init)
|
||||||
@ -977,9 +924,7 @@ void InitializeState()
|
|||||||
s_PlayedRebootCursor = false;
|
s_PlayedRebootCursor = false;
|
||||||
s_PlayedSdPullOutCursor = false;
|
s_PlayedSdPullOutCursor = false;
|
||||||
s_NupOnlyMode = false;
|
s_NupOnlyMode = false;
|
||||||
s_ReadVersionDone = false;
|
|
||||||
s_SdWriteProetctAnnotation = false;
|
s_SdWriteProetctAnnotation = false;
|
||||||
s_ReadVersionResult = nn::ResultSuccess();
|
|
||||||
s_WifiStatusOffAnnotation = false;
|
s_WifiStatusOffAnnotation = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user