mirror of
https://github.com/rvtr/ctr_Repair.git
synced 2025-10-31 13:51:08 -04:00
SDカード挿入時点でライトプロテクトのチェックをするよう変更
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@92 385bec56-5757-e545-9c3a-d8741f4650f1
This commit is contained in:
parent
9b2fa4fac3
commit
47a5a71ef6
@ -43,6 +43,8 @@ typedef enum BackupState
|
||||
|
||||
// APSettingの書式が無い警告サウンドを鳴らしたかどうか
|
||||
bool s_ExistAPSettingAnnotation = false;
|
||||
// SDに書き込みできない警告サウンドを鳴らしたかどうか
|
||||
bool s_SdWriteProetctAnnotation = false;
|
||||
|
||||
BackupState s_BackupState = STARTUP;
|
||||
bool s_PlayedStartCursor = false;
|
||||
@ -73,29 +75,30 @@ void ControlState(::std::vector<std::string>& operationMessage, bool& nextStep,
|
||||
// SDカードが挿入されているか?
|
||||
if (nn::fs::IsSdmcInserted())
|
||||
{
|
||||
// SDカードに書き込みできるか?
|
||||
if (!nn::fs::IsSdmcWritable())
|
||||
{
|
||||
if (!s_SdWriteProetctAnnotation)
|
||||
{
|
||||
s_SdWriteProetctAnnotation = true;
|
||||
common::PlaySound(common::SOUND_ANNOTATION);
|
||||
}
|
||||
operationMessage.push_back(::std::string("Can*t Write SD Card!!\n"));
|
||||
break;
|
||||
}
|
||||
|
||||
// 無線設定ファイルがあるか?
|
||||
if (common::ExistsAPSetting())
|
||||
{
|
||||
// 書き込み中に抜かないように
|
||||
if (nextStep)
|
||||
{
|
||||
// SDカードに書き込みできるか?
|
||||
if (nn::fs::IsSdmcWritable())
|
||||
// シリアルナンバーを読み取れるか?
|
||||
if (!CanReadSerialNumber())
|
||||
{
|
||||
// シリアルナンバーを読み取れるか?
|
||||
if (!CanReadSerialNumber())
|
||||
{
|
||||
common::PlaySound(common::SOUND_ANNOTATION);
|
||||
COMMON_LOGGER("Can't Read Serial Number\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
error = true;
|
||||
common::PlaySound(common::SOUND_ANNOTATION);
|
||||
COMMON_LOGGER("Can't Write SD Card!!\n");
|
||||
COMMON_LOGGER("Can't Read Serial Number\n");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -304,6 +307,7 @@ void InitializeState()
|
||||
s_ExistAPSettingAnnotation = false;
|
||||
s_PlayedStartCursor = false;
|
||||
s_PlayedSdPullOutCursor = false;
|
||||
s_SdWriteProetctAnnotation = false;
|
||||
}
|
||||
|
||||
} // namespace ConsoleBackup
|
||||
|
||||
@ -90,6 +90,8 @@ bool s_PlayedSdPullOutCursor = false;
|
||||
bool s_ExistsVersionDataAnnotation = false;
|
||||
// バージョンデータを読んだかどうか
|
||||
bool s_ReadVersionDone = false;
|
||||
// SDに書き込みできない警告サウンドを鳴らしたかどうか
|
||||
bool s_SdWriteProetctAnnotation = false;
|
||||
|
||||
// ネットワークアップデートを開始したかどうか
|
||||
bool s_ExecuteFgNup = false;
|
||||
@ -234,6 +236,18 @@ void ControlState(::std::vector<std::string>& operationMessage, bool& nextStep,
|
||||
// SDカードが挿入されているか?
|
||||
if (nn::fs::IsSdmcInserted())
|
||||
{
|
||||
// SDカードに書き込みできるか?
|
||||
if (!nn::fs::IsSdmcWritable())
|
||||
{
|
||||
if (!s_SdWriteProetctAnnotation)
|
||||
{
|
||||
s_SdWriteProetctAnnotation = true;
|
||||
PlaySound(SOUND_ANNOTATION);
|
||||
}
|
||||
operationMessage.push_back(::std::string("Can*t Write SD Card!!\n"));
|
||||
break;
|
||||
}
|
||||
|
||||
CheckAndReadVersionData(operationMessage);
|
||||
validApSetting = CheckAndReadAPSetting(operationMessage);
|
||||
if (!validApSetting)
|
||||
@ -277,13 +291,6 @@ void ControlState(::std::vector<std::string>& operationMessage, bool& nextStep,
|
||||
operationMessage.push_back(::std::string("Serial Number in SD : ") + serial);
|
||||
}
|
||||
|
||||
// SDカードに書き込みできるか?
|
||||
if (nextStep && !nn::fs::IsSdmcWritable())
|
||||
{
|
||||
error = true;
|
||||
PlaySound(SOUND_ANNOTATION);
|
||||
COMMON_LOGGER("Can't Write SD Card!!\n");
|
||||
}
|
||||
|
||||
// SDカードにリージョンデータがあるか?
|
||||
if (ExistsRegionData())
|
||||
@ -881,6 +888,7 @@ void InitializeState()
|
||||
s_PlayedSdPullOutCursor = false;
|
||||
s_NupOnlyMode = false;
|
||||
s_ReadVersionDone = false;
|
||||
s_SdWriteProetctAnnotation = false;
|
||||
}
|
||||
|
||||
u32 GetProgress()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user