NUP_ONLYモードの表示を強調

git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@64 385bec56-5757-e545-9c3a-d8741f4650f1
This commit is contained in:
N2614 2011-02-17 01:00:38 +00:00
parent 834f59c092
commit ddd2db472a
4 changed files with 52 additions and 13 deletions

View File

@ -365,9 +365,18 @@ extern "C" void nnMain(void)
nn::util::FloatColor titleColor; nn::util::FloatColor titleColor;
titleColor.r = 0.1f; if(GetRestoreMode() == RESTORE_MODE_RESTORE)
titleColor.g = 0.25f; {
titleColor.b = 0.1f; titleColor.r = 0.1f;
titleColor.g = 0.25f;
titleColor.b = 0.1f;
}
else if(GetRestoreMode() == RESTORE_MODE_NUP_ONLY)
{
titleColor.r = 0.35f;
titleColor.g = 0.35f;
titleColor.b = 0.f;
}
// 上画面表示 // 上画面表示
common::DrawSystemState("CTR Console Restore", common::DrawSystemState("CTR Console Restore",
@ -387,6 +396,19 @@ extern "C" void nnMain(void)
s_SerialNo s_SerialNo
); );
if (GetRestoreMode() == RESTORE_MODE_NUP_ONLY)
{
const u8 spaceSize = 10;
const u8 lineBottom = 23;
const u32 screenWidth = 400;
s_RenderSystem.SetColor(1.f, 1.f, 1.f);
s_RenderSystem.DrawText(0, lineBottom * spaceSize, "NUP-Only Mode");
s_RenderSystem.SetColor(titleColor.r, titleColor.g, titleColor.b);
s_RenderSystem.FillRectangle(0, lineBottom * spaceSize, screenWidth, spaceSize);
s_RenderSystem.SetColor(1.f, 1.f, 1.f);
}
s_RenderSystem.SwapBuffers(); s_RenderSystem.SwapBuffers();
// デフォルトで下画面に描画するもの // デフォルトで下画面に描画するもの

View File

@ -60,9 +60,10 @@ typedef enum RestoreState
FAIL // 失敗 FAIL // 失敗
} RestoreState; } RestoreState;
// Restore状態管理 // Restore状態管理
RestoreState s_RestoreState = STARTUP; RestoreState s_RestoreState = STARTUP;
// Restoreモード管理
RestoreMode s_RestoreMode = RESTORE_MODE_RESTORE;
// インターネット設定を読んだかどうか // インターネット設定を読んだかどうか
bool s_ReadSettingDone = false; bool s_ReadSettingDone = false;
@ -121,6 +122,11 @@ bool CheckAndReadAPSetting(::std::vector<std::string>& operationMessage)
s_ReadSettingSuccess = ReadSetting(&s_NupOnlyMode); s_ReadSettingSuccess = ReadSetting(&s_NupOnlyMode);
} }
if(s_NupOnlyMode)
{
s_RestoreMode = RESTORE_MODE_NUP_ONLY;
}
if (!s_ReadSettingSuccess) if (!s_ReadSettingSuccess)
{ {
operationMessage.push_back(::std::string("Invalid Accsess_Point_Setting format!")); operationMessage.push_back(::std::string("Invalid Accsess_Point_Setting format!"));
@ -764,7 +770,7 @@ void OnSdEjected()
{ {
s_RestoreState = ALL_DONE; s_RestoreState = ALL_DONE;
} }
else if(s_RestoreState == NUP_ONLY_WAIT_SD_EJECT) else if(s_RestoreState == NUP_ONLY_WAIT_SD_EJECT || s_RestoreState == NUP_ONLY_WAIT_NEXT)
{ {
s_RestoreState = NUP_ONLY_WAIT_NEXT; s_RestoreState = NUP_ONLY_WAIT_NEXT;
} }
@ -779,6 +785,7 @@ void OnSdEjected()
void InitializeState() void InitializeState()
{ {
s_RestoreState = STARTUP; s_RestoreState = STARTUP;
s_RestoreMode = RESTORE_MODE_RESTORE;
common::InitializeFileCheck(); common::InitializeFileCheck();
@ -818,4 +825,9 @@ u32 GetProgress()
} }
RestoreMode GetRestoreMode()
{
return s_RestoreMode;
}
} // namespace ConsoleRestore } // namespace ConsoleRestore

View File

@ -23,6 +23,12 @@
namespace ConsoleRestore namespace ConsoleRestore
{ {
typedef enum RestoreMode
{
RESTORE_MODE_RESTORE,
RESTORE_MODE_NUP_ONLY
} RestoreMode;
const u32 RETRY_MAX = 3; const u32 RETRY_MAX = 3;
void ControlState(::std::vector<std::string>& operationMessage, bool& nextStep, bool& continueRestore); void ControlState(::std::vector<std::string>& operationMessage, bool& nextStep, bool& continueRestore);
@ -33,6 +39,7 @@ u32 GetProgress();
void OnSdEjected(); void OnSdEjected();
void InitializeState(); void InitializeState();
RestoreMode GetRestoreMode();
} }

View File

@ -1133,16 +1133,14 @@ bool ReadSetting(bool* nupOnly)
} }
{ {
if (nupOnly != NULL) NN_NULL_ASSERT(nupOnly);
if (configfileLoader.ReadAsChar(L"NUP_ONLY") != NULL)
{ {
if (configfileLoader.ReadAsChar(L"NUP_ONLY") != NULL) s32 num = configfileLoader.ReadAsInteger(L"NUP_ONLY");
if (num == 1)
{ {
s32 num = configfileLoader.ReadAsInteger(L"NUP_ONLY"); *nupOnly = true;
if (num == 1) COMMON_LOGGER("NUP Only Mode.\n");
{
*nupOnly = true;
COMMON_LOGGER("NUP Only Mode.\n");
}
} }
} }
} }