移行元本体でNUPしている時のみNUPするように

git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@79 385bec56-5757-e545-9c3a-d8741f4650f1
This commit is contained in:
N2614 2011-02-23 10:51:17 +00:00
parent 28bbf8c9d7
commit 581aa06236
3 changed files with 58 additions and 2 deletions

View File

@ -86,6 +86,10 @@ bool s_PlayedStartCursor = false;
bool s_PlayedRebootCursor = false;
// SD抜き出し前サウンドを鳴らしたかどうか
bool s_PlayedSdPullOutCursor = false;
// バージョンデータが無い警告サウンドを鳴らしたかどうか
bool s_ExistsVersionDataAnnotation = false;
// バージョンデータを読んだかどうか
bool s_ReadVersionDone = false;
// ネットワークアップデートを開始したかどうか
bool s_ExecuteFgNup = false;
@ -141,6 +145,31 @@ bool CheckAndReadAPSetting(::std::vector<std::string>& operationMessage)
return s_ReadSettingSuccess;
}
bool 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 false;
}
// バージョン情報ファイルを読み込む
if (!s_ReadVersionDone)
{
s_ReadVersionDone = true;
ReadVersionData();
}
return s_ReadSettingSuccess;
}
void PutAliveMessage(::std::vector<std::string>& operationMessage, const char* str)
{
std::string message = std::string(str);
@ -174,6 +203,21 @@ void ExecSyncMcuRtc()
}
}
// Zero NUP限定コード
bool NeedsNup()
{
if(AlreadyExecutedNup())
{
NN_LOG("Need NUP\n");
return common::ExistsUpdateCheckedFile();
}
else
{
NN_LOG("No need NUP\n");
return false;
}
}
void ControlState(::std::vector<std::string>& operationMessage, bool& nextStep, bool& continueRestore)
{
using namespace common;
@ -192,8 +236,10 @@ void ControlState(::std::vector<std::string>& operationMessage, bool& nextStep,
// SDカードが挿入されているか
if (nn::fs::IsSdmcInserted())
{
// SDカードにアップデート完了ファイルがあるか
if (ExistsUpdateCheckedFile())
CheckAndReadVersionData(operationMessage);
// NUPが必要か
if (!NeedsNup())
{
validApSetting = CheckAndReadAPSetting(operationMessage);
if (s_NupOnlyMode)
@ -810,6 +856,7 @@ void InitializeState()
s_PlayedRebootCursor = false;
s_PlayedSdPullOutCursor = false;
s_NupOnlyMode = false;
s_ReadVersionDone = false;
}
u32 GetProgress()

View File

@ -743,6 +743,12 @@ void ReadVersionData()
COMMON_LOGGER("Failed Allocate Heap!!\n");
}
}
bool AlreadyExecutedNup()
{
return s_SDVersionData.nup.majorVersion != 0;
}
void Cleanup()
{
nn::Result result;

View File

@ -88,6 +88,9 @@ void InitializeHardwareDependentSetting();
// SDカード上のバージョン情報を読みます
void ReadVersionData();
// 移行元本体がNUP済みかどうか
bool AlreadyExecutedNup();
}
#endif /* IMPORTER_H_ */