From 3eaa0b3f59de7a4081ffff4da94f92bce0f4f610 Mon Sep 17 00:00:00 2001 From: N2614 Date: Thu, 10 Feb 2011 10:57:27 +0000 Subject: [PATCH] =?UTF-8?q?=E7=89=B9=E6=AE=8A=E3=82=AD=E3=83=BC=E5=85=A5?= =?UTF-8?q?=E5=8A=9B=E3=81=AB=E3=82=88=E3=82=8A=E6=9C=AC=E4=BD=93=E5=88=9D?= =?UTF-8?q?=E6=9C=9F=E5=8C=96=E5=BE=8C=E3=82=B7=E3=83=A3=E3=83=83=E3=83=88?= =?UTF-8?q?=E3=83=80=E3=82=A6=E3=83=B3=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@47 385bec56-5757-e545-9c3a-d8741f4650f1 --- .../ConsoleRestore/ConsoleRestore.cpp | 11 +++++++- .../ConsoleRestore/Controller.cpp | 28 +++++++++++++++++-- .../ConsoleRestore/Controller.h | 2 +- 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/trunk/ConsoleDataMigration/ConsoleRestore/ConsoleRestore.cpp b/trunk/ConsoleDataMigration/ConsoleRestore/ConsoleRestore.cpp index b05ca65..ca6227f 100644 --- a/trunk/ConsoleDataMigration/ConsoleRestore/ConsoleRestore.cpp +++ b/trunk/ConsoleDataMigration/ConsoleRestore/ConsoleRestore.cpp @@ -304,6 +304,8 @@ extern "C" void nnMain(void) for(;;) { bool nextStep = false; + bool specialKey = false; + s_PadReader.ReadLatest(&padStatus); // AまたはSTARTボタンで進行 @@ -342,6 +344,13 @@ extern "C" void nnMain(void) common::Logger::GetLoggerInstance()->ScrollToEnd(); } + // 特殊入力 + if(padStatus.hold & nn::hid::BUTTON_R && + padStatus.hold & nn::hid::BUTTON_L && + padStatus.hold & nn::hid::BUTTON_B) + { + specialKey = true; + } // 情報更新 // バッテリ @@ -361,7 +370,7 @@ extern "C" void nnMain(void) // 進捗確認メッセージを兼ねる? ::std::vector operationMessage; - ControlState(operationMessage, nextStep, continueRestore); + ControlState(operationMessage, nextStep, continueRestore, specialKey); nn::util::FloatColor titleColor; diff --git a/trunk/ConsoleDataMigration/ConsoleRestore/Controller.cpp b/trunk/ConsoleDataMigration/ConsoleRestore/Controller.cpp index 2a8acae..1965f23 100644 --- a/trunk/ConsoleDataMigration/ConsoleRestore/Controller.cpp +++ b/trunk/ConsoleDataMigration/ConsoleRestore/Controller.cpp @@ -18,6 +18,8 @@ #include #include #include +#include +#include #include "Controller.h" #include "FileChecker.h" @@ -52,6 +54,7 @@ typedef enum RestoreState TIME_ADJUST, // 時計あわせを行う WAIT_SD_EJECT, // SDカードぬき待ち ALL_DONE, // すべて完了 + SHUTDOWN, // シャットダウン中 FAIL // 失敗 } RestoreState; @@ -161,7 +164,7 @@ void ExecSyncMcuRtc() } } -void ControlState(::std::vector& operationMessage, bool& nextStep, bool& continueRestore) +void ControlState(::std::vector& operationMessage, bool& nextStep, bool& continueRestore, bool specialKey) { using namespace common; @@ -313,7 +316,12 @@ void ControlState(::std::vector& operationMessage, bool& nextStep, } } - if (nextStep && !error) + if(specialKey) + { + s_RestoreState = SHUTDOWN; + } + + if (nextStep && !error && !specialKey) { if (needsUpdate) { @@ -353,7 +361,12 @@ void ControlState(::std::vector& operationMessage, bool& nextStep, PlaySound(SOUND_ANNOTATION); } - if (nextStep) + if(specialKey) + { + s_RestoreState = SHUTDOWN; + } + + if (nextStep && !specialKey) { s_RestoreState = RESTORE_TWL_SOUND; } @@ -682,6 +695,15 @@ void ControlState(::std::vector& operationMessage, bool& nextStep, } break; + case SHUTDOWN: + { + // 本体初期化を行う + InitializeFileSystem(); + + // シャットダウンする + nn::ptm::CTR::ShutdownAsync(0, nn::fnd::TimeSpan::FromSeconds(0)); + } + } } diff --git a/trunk/ConsoleDataMigration/ConsoleRestore/Controller.h b/trunk/ConsoleDataMigration/ConsoleRestore/Controller.h index 281b31a..e4f37e0 100644 --- a/trunk/ConsoleDataMigration/ConsoleRestore/Controller.h +++ b/trunk/ConsoleDataMigration/ConsoleRestore/Controller.h @@ -25,7 +25,7 @@ namespace ConsoleRestore const u32 RETRY_MAX = 3; -void ControlState(::std::vector& operationMessage, bool& nextStep, bool& continueRestore); +void ControlState(::std::vector& operationMessage, bool& nextStep, bool& continueRestore, bool specialKey); bool InProgress(); bool IsRestoreSucceeded(); bool IsRestoreFailed();