From 82587cc0133c0daa647b864872bda7778ca9dafb Mon Sep 17 00:00:00 2001 From: N2614 Date: Fri, 3 Feb 2012 07:39:01 +0000 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E7=94=BB=E9=9D=A2=E3=81=AE=E6=96=87?= =?UTF-8?q?=E5=AD=97=E3=82=92=E8=A1=8C=E5=8D=98=E4=BD=8D=E3=81=A7=E5=A4=89?= =?UTF-8?q?=E3=81=88=E3=82=89=E3=82=8C=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=20BMS=E6=93=8D=E4=BD=9C=E6=8C=87=E7=A4=BA=E7=94=BB=E9=9D=A2?= =?UTF-8?q?=E3=81=AE=E6=96=87=E5=AD=97=E3=81=A8=E3=82=AD=E3=83=BC=E3=82=A2?= =?UTF-8?q?=E3=82=B5=E3=82=A4=E3=83=B3=E5=A4=89=E6=9B=B4?= 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@620 385bec56-5757-e545-9c3a-d8741f4650f1 --- .../sources/ConsoleBackup/ConsoleBackup.cpp | 3 +- .../sources/ConsoleBackup/Controller.cpp | 34 +-- .../sources/ConsoleBackup/Controller.h | 3 +- .../sources/ConsoleBackup/OMakefile | 1 + .../sources/ConsoleRestore/ConsoleRestore.cpp | 12 +- .../sources/ConsoleRestore/Controller.cpp | 198 +++++++++--------- .../sources/ConsoleRestore/Controller.h | 5 +- .../sources/ConsoleRestore/OMakefile | 1 + .../sources/common/BuildSwitch.om | 27 +-- .../sources/common/DrawSystemState.cpp | 11 +- .../sources/common/DrawSystemState.h | 3 +- .../sources/common/OperationMessage.cpp | 61 ++++++ .../sources/common/OperationMessage.h | 51 +++++ .../sources/common/ResFont.cpp | 3 - 14 files changed, 269 insertions(+), 144 deletions(-) create mode 100644 trunk/ConsoleDataMigration/sources/common/OperationMessage.cpp create mode 100644 trunk/ConsoleDataMigration/sources/common/OperationMessage.h diff --git a/trunk/ConsoleDataMigration/sources/ConsoleBackup/ConsoleBackup.cpp b/trunk/ConsoleDataMigration/sources/ConsoleBackup/ConsoleBackup.cpp index c24bf23..a88b5fa 100644 --- a/trunk/ConsoleDataMigration/sources/ConsoleBackup/ConsoleBackup.cpp +++ b/trunk/ConsoleDataMigration/sources/ConsoleBackup/ConsoleBackup.cpp @@ -52,6 +52,7 @@ #include "Util.h" #include "ResFont.h" #include "HardwareStateManager.h" +#include "OperationMessage.h" // バージョン表示用 #include "version.h" @@ -223,7 +224,7 @@ extern "C" void nnMain(void) // 操作用メッセージ // 進捗確認メッセージを兼ねる? - ::std::vector operationMessage; + common::OperationMessage operationMessage; ControlState(manager, operationMessage, nextStep, continueBackup, forceDelete); diff --git a/trunk/ConsoleDataMigration/sources/ConsoleBackup/Controller.cpp b/trunk/ConsoleDataMigration/sources/ConsoleBackup/Controller.cpp index 754156c..e9630aa 100644 --- a/trunk/ConsoleDataMigration/sources/ConsoleBackup/Controller.cpp +++ b/trunk/ConsoleDataMigration/sources/ConsoleBackup/Controller.cpp @@ -63,25 +63,25 @@ bool s_PlayedFailSound = false; } // namespace -void PutAliveMessage(::std::vector& operationMessage, const char* str) +void PutAliveMessage(common::OperationMessage& operationMessage, const char* str) { std::string message = std::string(str); static u8 i = 0; if (i < 0xff / 4) { - operationMessage.push_back(message + std::string(" /")); + operationMessage.Add((message + std::string(" /")).c_str()); } else if (i < 0xff * 2 / 4) { - operationMessage.push_back(message + std::string(" |")); + operationMessage.Add((message + std::string(" |")).c_str()); } else if (i < 0xff * 3 / 4) { - operationMessage.push_back(message + std::string(" \\")); + operationMessage.Add((message + std::string(" \\")).c_str()); } else { - operationMessage.push_back(message + std::string(" -")); + operationMessage.Add((message + std::string(" -")).c_str()); } i += 4; } @@ -91,7 +91,7 @@ bool NeedsAcAdapter(common::HardwareStateManager& manager) return manager.IsBatteryLower() && !manager.IsAdapterConnected(); } -void ControlState(common::HardwareStateManager& manager, ::std::vector& operationMessage, bool& nextStep, +void ControlState(common::HardwareStateManager& manager, common::OperationMessage& operationMessage, bool& nextStep, bool& continueBackup, bool forceDelete) { // 状態遷移Controller @@ -116,7 +116,7 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector #include #include "HardwareStateManager.h" +#include "OperationMessage.h" namespace ConsoleBackup { @@ -36,7 +37,7 @@ typedef enum BackupMode //! @param[in] nextStep 次の状態に遷移してもよいかどうか //! @param[in] continueBackup 処理を続けてもよいかどうか //! @param[in] forceDelete チェックエラー発生時に削除を実行してもよいかどうか -void ControlState(common::HardwareStateManager& manager, ::std::vector& operationMessage, bool& nextStep, +void ControlState(common::HardwareStateManager& manager, common::OperationMessage& operationMessage, bool& nextStep, bool& continueBackup, bool forceDelete); // バックアップ処理中かどうか diff --git a/trunk/ConsoleDataMigration/sources/ConsoleBackup/OMakefile b/trunk/ConsoleDataMigration/sources/ConsoleBackup/OMakefile index be46389..8f01daf 100644 --- a/trunk/ConsoleDataMigration/sources/ConsoleBackup/OMakefile +++ b/trunk/ConsoleDataMigration/sources/ConsoleBackup/OMakefile @@ -44,6 +44,7 @@ SOURCES[] = ../common/ResFont.cpp ../common/HardwareStateManager.cpp ../common/SaveDataMover.cpp + ../common/OperationMessage.cpp include $(ROOT)/common/BuildSwitch.om diff --git a/trunk/ConsoleDataMigration/sources/ConsoleRestore/ConsoleRestore.cpp b/trunk/ConsoleDataMigration/sources/ConsoleRestore/ConsoleRestore.cpp index 2447c7a..46c858a 100644 --- a/trunk/ConsoleDataMigration/sources/ConsoleRestore/ConsoleRestore.cpp +++ b/trunk/ConsoleDataMigration/sources/ConsoleRestore/ConsoleRestore.cpp @@ -47,6 +47,7 @@ #include "Util.h" #include "ResFont.h" #include "HardwareStateManager.h" +#include "OperationMessage.h" // バージョン表示用 #include "version.h" @@ -183,6 +184,7 @@ extern "C" void nnMain(void) for(;;) { bool nextStep = false; + bool operateBmsDone = false; s_PadReader.ReadLatest(&padStatus); @@ -192,6 +194,11 @@ extern "C" void nnMain(void) { nextStep = true; } + // YボタンでBMS操作完了 + if(padStatus.trigger & nn::hid::BUTTON_Y) + { + operateBmsDone = true; + } // LまたはRボタンで上下画面フリップ if(padStatus.trigger & nn::hid::BUTTON_R || @@ -236,9 +243,10 @@ extern "C" void nnMain(void) // 操作用メッセージ // 進捗確認メッセージを兼ねる? - ::std::vector operationMessage; - ControlState(manager, operationMessage, nextStep); + common::OperationMessage operationMessage; + + ControlState(manager, operationMessage, nextStep, operateBmsDone); nn::util::FloatColor titleColor; diff --git a/trunk/ConsoleDataMigration/sources/ConsoleRestore/Controller.cpp b/trunk/ConsoleDataMigration/sources/ConsoleRestore/Controller.cpp index 7b82c5b..fee61e8 100644 --- a/trunk/ConsoleDataMigration/sources/ConsoleRestore/Controller.cpp +++ b/trunk/ConsoleDataMigration/sources/ConsoleRestore/Controller.cpp @@ -88,8 +88,8 @@ bool s_ShopOperationExecuted[SHOP_OPERATION_NUM_MAX]; // ショップ処理を何回リトライしたか u32 s_ShopOperationRetryCount[SHOP_OPERATION_NUM_MAX]; -void PutAliveMessage(::std::vector& operationMessage, const char* str); -bool CheckAndReadAPSetting(::std::vector& operationMessage); +void PutAliveMessage(common::OperationMessage& operationMessage, const char* str); +bool CheckAndReadAPSetting(common::OperationMessage& operationMessage); bool NeedsAcAdater(common::HardwareStateManager& manager) { @@ -215,23 +215,23 @@ RestoreState s_RestoreState = STARTUP; // Restoreモード管理 RestoreMode s_RestoreMode = RESTORE_MODE_RESTORE; -void CheckSdInserted(common::HardwareStateManager& manager, ::std::vector& message, bool& goNextStep); -void CheckAcAdapter(common::HardwareStateManager& manager, ::std::vector& message, bool& goNextStep); -void CheckSdWritable(common::HardwareStateManager& manager, ::std::vector& message, bool& goNextStep); -void CheckApSetting(common::HardwareStateManager& manager, ::std::vector& message, bool& goNextStep); -void CheckNupExecuted(common::HardwareStateManager& manager, ::std::vector& message, bool& goNextStep); -void CheckDownloadIvs(common::HardwareStateManager& manager, ::std::vector& message, bool& goNextStep); -void CheckAccountDeleted(common::HardwareStateManager& manager, ::std::vector& message, bool& goNextStep); -void CheckAccountTransfered(common::HardwareStateManager& manager, ::std::vector& message, bool& goNextStep); -void CheckWriteFinished(common::HardwareStateManager& manager, ::std::vector& message, bool& goNextStep); -void CheckReadIvs(common::HardwareStateManager& manager, ::std::vector& message, bool& goNextStep); -void CheckConsoleInitialized(common::HardwareStateManager& manager, ::std::vector& message, bool& goNextStep); -void CheckExistsSerialNumber(common::HardwareStateManager& manager, ::std::vector& message, bool& goNextStep); -void CheckIvsinSd(common::HardwareStateManager& manager, ::std::vector& message, bool& goNextStep); -void CheckRegioinSd(common::HardwareStateManager& manager, ::std::vector& message, bool& goNextStep); +void CheckSdInserted(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep); +void CheckAcAdapter(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep); +void CheckSdWritable(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep); +void CheckApSetting(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep); +void CheckNupExecuted(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep); +void CheckDownloadIvs(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep); +void CheckAccountDeleted(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep); +void CheckAccountTransfered(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep); +void CheckWriteFinished(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep); +void CheckReadIvs(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep); +void CheckConsoleInitialized(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep); +void CheckExistsSerialNumber(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep); +void CheckIvsinSd(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep); +void CheckRegioinSd(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep); // SDカード挿入チェック -void CheckSdInserted(common::HardwareStateManager& manager, ::std::vector& message, bool& goNextStep) +void CheckSdInserted(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep) { if (nn::fs::IsSdmcInserted()) { @@ -239,18 +239,18 @@ void CheckSdInserted(common::HardwareStateManager& manager, ::std::vector& message, bool& goNextStep) +void CheckAcAdapter(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep) { // ACアダプタが必要か? if (NeedsAcAdater(manager)) { - message.push_back(::std::string("Connect AC Adapter!!")); + message.Add("Connect AC Adapter!!"); s_RestoreState = STARTUP; } else @@ -260,7 +260,7 @@ void CheckAcAdapter(common::HardwareStateManager& manager, ::std::vector& message, bool& goNextStep) +void CheckSdWritable(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep) { // SDカードに書き込みできるか? if (nn::fs::IsSdmcWritable()) @@ -270,14 +270,14 @@ void CheckSdWritable(common::HardwareStateManager& manager, ::std::vector& message, bool& goNextStep) +void CheckApSetting(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep) { NN_UNUSED_VAR(manager); NN_UNUSED_VAR(goNextStep); @@ -293,7 +293,7 @@ void CheckApSetting(common::HardwareStateManager& manager, ::std::vector& message, bool& goNextStep) +void CheckNupExecuted(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep) { if (common::ExistsUpdateCheckedFile()) { @@ -323,7 +323,7 @@ void CheckNupExecuted(common::HardwareStateManager& manager, ::std::vector& message, bool& goNextStep) +void CheckDownloadIvs(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep) { NN_UNUSED_VAR(message); NN_UNUSED_VAR(goNextStep); @@ -357,7 +357,7 @@ void CheckDownloadIvs(common::HardwareStateManager& manager, ::std::vector& message, bool& goNextStep) +void CheckAccountDeleted(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep) { // アカウント削除確認ファイルがあるか? if (common::ExistsDeleteAccountChecked()) @@ -387,7 +387,7 @@ void CheckAccountDeleted(common::HardwareStateManager& manager, ::std::vector& message, bool& goNextStep) +void CheckAccountTransfered(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep) { // アカウント移行確認ファイルがあるか? if (common::ExistsTransferAccountChecked()) @@ -401,7 +401,7 @@ void CheckAccountTransfered(common::HardwareStateManager& manager, ::std::vector } // 書き込み完了かどうかチェック -void CheckWriteFinished(common::HardwareStateManager& manager, ::std::vector& message, bool& goNextStep) +void CheckWriteFinished(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep) { NN_UNUSED_VAR(goNextStep); @@ -418,7 +418,7 @@ void CheckWriteFinished(common::HardwareStateManager& manager, ::std::vector& message, bool& goNextStep) +void CheckReadIvs(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep) { // IVSを読めるか? if (manager.CanReadIvs()) @@ -444,7 +444,7 @@ void CheckReadIvs(common::HardwareStateManager& manager, ::std::vector& message, bool& goNextStep) +void CheckConsoleInitialized(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep) { // 本体初期化完了ファイルがあるか? if (common::ExistsConsoleInitializedFile()) @@ -458,7 +458,7 @@ void CheckConsoleInitialized(common::HardwareStateManager& manager, ::std::vecto } // シリアルナンバーがあるかどうかチェック -void CheckExistsSerialNumber(common::HardwareStateManager& manager, ::std::vector& message, bool& goNextStep) +void CheckExistsSerialNumber(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep) { NN_UNUSED_VAR(manager); NN_UNUSED_VAR(message); @@ -487,7 +487,7 @@ void CheckExistsSerialNumber(common::HardwareStateManager& manager, ::std::vecto } // SDカードにIVSがあるかどうかチェック -void CheckIvsinSd(common::HardwareStateManager& manager, ::std::vector& message, bool& goNextStep) +void CheckIvsinSd(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep) { NN_UNUSED_VAR(manager); NN_UNUSED_VAR(message); @@ -506,7 +506,7 @@ void CheckIvsinSd(common::HardwareStateManager& manager, ::std::vector& message, bool& goNextStep) +void CheckRegioinSd(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep) { NN_UNUSED_VAR(message); NN_UNUSED_VAR(goNextStep); @@ -553,7 +553,7 @@ void ShopOperationSuccess(ShopOperation op, const char* logMessage, RestoreState void ShopOperationSingleTemplate( common::HardwareStateManager& manager, - std::vector& message, + common::OperationMessage& message, ShopOperation op, const char* aliveMessage, const char* logMessage, @@ -564,7 +564,7 @@ void ShopOperationSingleTemplate( // ACアダプタが必要か? if (NeedsAcAdater(manager)) { - message.push_back(::std::string("Connect AC Adapter!!")); + message.Add("Connect AC Adapter!!"); } // アップデートを行う @@ -646,12 +646,12 @@ void ShopOperationSingleTemplate( } } -void UpdateOperation(common::HardwareStateManager& manager, ::std::vector& message, RestoreState nextState) +void UpdateOperation(common::HardwareStateManager& manager, common::OperationMessage& message, RestoreState nextState) { // ACアダプタが必要か? if (NeedsAcAdater(manager)) { - message.push_back(::std::string("Connect AC Adapter!!")); + message.Add("Connect AC Adapter!!"); } // アップデートを行う @@ -717,14 +717,14 @@ void UpdateOperation(common::HardwareStateManager& manager, ::std::vector& operationMessage) +bool CheckAndReadAPSetting(common::OperationMessage& operationMessage) { using namespace common; if (!ExistsAPSetting()) { PlayAnnotationSound(ANNOTATION_SETTING_NOT_FOUND); - operationMessage.push_back(::std::string("Accsess_Point_Setting does not exist!")); + operationMessage.Add("Accsess_Point_Setting does not exist!"); return false; } @@ -739,12 +739,12 @@ bool CheckAndReadAPSetting(::std::vector& operationMessage) || s_GetIvsOnlyMode && s_CheckSdOnlyMode || s_CheckSdOnlyMode && s_NupOnlyMode) { - operationMessage.push_back("Only one special mode setting is valid!!"); + operationMessage.Add("Only one special mode setting is valid!!"); s_ReadSettingIsSuccess = false; } else if(s_NupOnlyMode && s_SkipNupMode) { - operationMessage.push_back("Both NUP_ONLY and SKIP_NUP are described!!"); + operationMessage.Add("Both NUP_ONLY and SKIP_NUP are described!!"); s_ReadSettingIsSuccess = false; } else @@ -772,32 +772,32 @@ bool CheckAndReadAPSetting(::std::vector& operationMessage) if (!s_ReadSettingIsSuccess) { - operationMessage.push_back(::std::string("Invalid Accsess_Point_Setting format!")); + operationMessage.Add("Invalid Accsess_Point_Setting format!"); PlayAnnotationSound(ANNOTATION_INVALID_SETTING); } return s_ReadSettingIsSuccess; } -void PutAliveMessage(::std::vector& operationMessage, const char* str) +void PutAliveMessage(common::OperationMessage& operationMessage, const char* str) { std::string message = std::string(str); static u8 i = 0; if (i < 0xff / 4) { - operationMessage.push_back(message + std::string(" /")); + operationMessage.Add((message + std::string(" /")).c_str()); } else if (i < 0xff * 2 / 4) { - operationMessage.push_back(message + std::string(" |")); + operationMessage.Add((message + std::string(" |")).c_str()); } else if (i < 0xff * 3 / 4) { - operationMessage.push_back(message + std::string(" \\")); + operationMessage.Add((message + std::string(" \\")).c_str()); } else { - operationMessage.push_back(message + std::string(" -")); + operationMessage.Add((message + std::string(" -")).c_str()); } i += 4; } @@ -820,7 +820,7 @@ nn::Result ExecSyncMcuRtc(common::HardwareStateManager& manager) } // namespace -void ControlState(common::HardwareStateManager& manager, ::std::vector& operationMessage, bool& nextStep) +void ControlState(common::HardwareStateManager& manager, common::OperationMessage& operationMessage, bool& nextStep, bool operateBmsDone) { using namespace common; nn::Result result; @@ -858,8 +858,8 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector (serial)); - operationMessage.push_back(::std::string("Serial Number in SD : ") + serialStr); + operationMessage.Add((::std::string("Serial Number in SD : ") + serialStr).c_str()); } else { s_RestoreState = FAIL; } - operationMessage.push_back(::std::string("Push A or START Button")); - operationMessage.push_back(::std::string("Import Data Mode")); + operationMessage.Add("Push A or START Button"); + operationMessage.Add("Import Data Mode"); PlayCursorSound(WAIT_START_IMPORT); if (nextStep) @@ -900,8 +900,8 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector #include #include "HardwareStateManager.h" +#include "OperationMessage.h" namespace ConsoleRestore { @@ -41,8 +42,8 @@ const u32 RETRY_MAX = 3; // manager ハードウェア情報を取得するためのラッパ // operationMessage 操作情報として表示したい文字列 // nextStep 次の状態に遷移してもよいかどうか -// continueBackup 処理を続けてもよいかどうか -void ControlState(common::HardwareStateManager& manager, ::std::vector& operationMessage, bool& nextStep); +// operateBmsDone BMS操作を完了したかどうか +void ControlState(common::HardwareStateManager& manager, common::OperationMessage& operationMessage, bool& nextStep, bool operateBmsDone); // リストア処理中かどうか bool InProgress(); diff --git a/trunk/ConsoleDataMigration/sources/ConsoleRestore/OMakefile b/trunk/ConsoleDataMigration/sources/ConsoleRestore/OMakefile index c042acb..1c3d87f 100644 --- a/trunk/ConsoleDataMigration/sources/ConsoleRestore/OMakefile +++ b/trunk/ConsoleDataMigration/sources/ConsoleRestore/OMakefile @@ -52,6 +52,7 @@ SOURCES[] = ../common/ResFont.cpp ../common/HardwareStateManager.cpp ../common/SaveDataMover.cpp + ../common/OperationMessage.cpp include $(ROOT)/common/BuildSwitch.om diff --git a/trunk/ConsoleDataMigration/sources/common/BuildSwitch.om b/trunk/ConsoleDataMigration/sources/common/BuildSwitch.om index 72c587d..bb554a0 100644 --- a/trunk/ConsoleDataMigration/sources/common/BuildSwitch.om +++ b/trunk/ConsoleDataMigration/sources/common/BuildSwitch.om @@ -17,17 +17,18 @@ if $(and $(defined PROD_BUILD), $(defined TEST_BUILD)) echo Both PROD_BUILD and TEST_BUILD defined!! exit -if $(defined PROD_BUILD) - CCFLAGS += -DUSE_PROD_KEY -DBUILD_FOR_PROD_BGS - TARGET_NAME = $(TARGET_PROGRAM) - TARGET_PROGRAM = $(TARGET_PROGRAM)_prod - export - -elseif $(defined TEST_BUILD) - CCFLAGS += -DUSE_PROD_KEY -DBUILD_FOR_TEST_BGS - TARGET_NAME = $(TARGET_PROGRAM) - TARGET_PROGRAM = $(TARGET_PROGRAM)_test - export -else - TARGET_NAME = $(TARGET_PROGRAM) +if $(defined TARGET_PROGRAM) + if $(defined PROD_BUILD) + CCFLAGS += -DUSE_PROD_KEY -DBUILD_FOR_PROD_BGS + TARGET_NAME = $(TARGET_PROGRAM) + TARGET_PROGRAM = $(TARGET_PROGRAM)_prod + export + elseif $(defined TEST_BUILD) + CCFLAGS += -DUSE_PROD_KEY -DBUILD_FOR_TEST_BGS + TARGET_NAME = $(TARGET_PROGRAM) + TARGET_PROGRAM = $(TARGET_PROGRAM)_test + export + else + TARGET_NAME = $(TARGET_PROGRAM) + export export \ No newline at end of file diff --git a/trunk/ConsoleDataMigration/sources/common/DrawSystemState.cpp b/trunk/ConsoleDataMigration/sources/common/DrawSystemState.cpp index 7416b39..4a33e0b 100644 --- a/trunk/ConsoleDataMigration/sources/common/DrawSystemState.cpp +++ b/trunk/ConsoleDataMigration/sources/common/DrawSystemState.cpp @@ -38,7 +38,7 @@ u64 s_FriendCode; u8 s_BatteryRemain; std::string s_AdapterState; u8 s_Progress; -::std::vector* s_OperationMessage; +OperationMessage* s_OperationMessage; bool s_ReadFriendCode; } @@ -64,6 +64,7 @@ u32 GetRenderTarget(u32 target, bool flip) void SetTextWriterCore() { + GetTextWriter()->SetTextColor(nn::util::Color8(255, 255, 255, 255)); GetTextWriter()->Print("\n"); GetTextWriter()->Printf("System Ver. %d.%d.%d-%d\n", s_CupMajor, s_CupMinor, s_CupMicro, s_NupMajor); @@ -83,10 +84,10 @@ void SetTextWriterCore() GetTextWriter()->Printf("Progress %02d%%\n", s_Progress); GetTextWriter()->Print("\n"); - ::std::vector::iterator it; - for (it = s_OperationMessage->begin(); it != s_OperationMessage->end(); it++) + for (u32 i = 0; i < s_OperationMessage->GetSize(); i++) { - GetTextWriter()->Printf("%s\n", it->c_str()); + GetTextWriter()->SetTextColor(s_OperationMessage->At(i).color); + GetTextWriter()->Printf("%s\n", s_OperationMessage->At(i).str.c_str()); } @@ -111,7 +112,7 @@ void DrawSystemState bool isProcessSucceeded, bool isProcessWarning, char8* macAddress, - ::std::vector& operationMessage, + OperationMessage& operationMessage, nn::cfg::CTR::CfgRegionCode region, u8* serialNo, bool readFriendCode diff --git a/trunk/ConsoleDataMigration/sources/common/DrawSystemState.h b/trunk/ConsoleDataMigration/sources/common/DrawSystemState.h index 2809491..1e9ef21 100644 --- a/trunk/ConsoleDataMigration/sources/common/DrawSystemState.h +++ b/trunk/ConsoleDataMigration/sources/common/DrawSystemState.h @@ -29,6 +29,7 @@ #include #include "common_Types.h" +#include "OperationMessage.h" // 描画色の定義 #define WHITE_COLOR 1.f, 1.f, 1.f, 1.f @@ -70,7 +71,7 @@ void DrawSystemState bool isProcessSucceeded, bool isProcessWarning, char8* macAddress, - ::std::vector& operationMessage, + OperationMessage& operationMessage, nn::cfg::CTR::CfgRegionCode region, u8* s_SerialNo, bool readFriendCode diff --git a/trunk/ConsoleDataMigration/sources/common/OperationMessage.cpp b/trunk/ConsoleDataMigration/sources/common/OperationMessage.cpp new file mode 100644 index 0000000..e16d1fa --- /dev/null +++ b/trunk/ConsoleDataMigration/sources/common/OperationMessage.cpp @@ -0,0 +1,61 @@ +/*---------------------------------------------------------------------------* + Project: Horizon + File: OperationMessage.cpp + + Copyright 2009-2011 Nintendo. All rights reserved. + + These coded instructions, statements, and computer programs contain + proprietary information of Nintendo of America Inc. and/or Nintendo + Company Ltd., and are protected by Federal copyright law. They may + not be disclosed to third parties or copied or duplicated in any form, + in whole or in part, without the prior written consent of Nintendo. + + $Rev$ + *---------------------------------------------------------------------------*/ + +#include "OperationMessage.h" + +namespace common +{ + +OperationMessage::OperationMessage() +{ + // TODO 自動生成されたコンストラクター・スタブ + +} + +OperationMessage::~OperationMessage() +{ + // TODO Auto-generated destructor stub +} + +void OperationMessage::Add(const char *message) +{ + ColorString cs; + cs.str = std::string(message); + m_ColorString.push_back(cs); +} + + +void OperationMessage::Add(const char *message, nn::util::Color8 color) +{ + ColorString cs; + cs.str = std::string(message); + cs.color = color; + m_ColorString.push_back(cs); +} + + +size_t OperationMessage::GetSize() +{ + return m_ColorString.size(); +} + + +ColorString OperationMessage::At(size_t index) +{ + return m_ColorString.at(index); +} + + +} /* namespace common */ diff --git a/trunk/ConsoleDataMigration/sources/common/OperationMessage.h b/trunk/ConsoleDataMigration/sources/common/OperationMessage.h new file mode 100644 index 0000000..3b87403 --- /dev/null +++ b/trunk/ConsoleDataMigration/sources/common/OperationMessage.h @@ -0,0 +1,51 @@ +/*---------------------------------------------------------------------------* + Project: Horizon + File: OperationMessage.h + + Copyright 2009-2011 Nintendo. All rights reserved. + + These coded instructions, statements, and computer programs contain + proprietary information of Nintendo of America Inc. and/or Nintendo + Company Ltd., and are protected by Federal copyright law. They may + not be disclosed to third parties or copied or duplicated in any form, + in whole or in part, without the prior written consent of Nintendo. + + $Rev$ + *---------------------------------------------------------------------------*/ + +#ifndef OPERATIONMESSAGE_H_ +#define OPERATIONMESSAGE_H_ + +#include +#include +#include + +namespace common +{ + +struct ColorString +{ + std::string str; + nn::util::Color8 color; +}; + +class OperationMessage +{ +public: + OperationMessage(); + virtual ~OperationMessage(); + + void Add(const char* message); + void Add(const char* message, nn::util::Color8 color); + + size_t GetSize(); + ColorString At(size_t index); + +private: + std::vector m_ColorString; + + +}; + +} /* namespace common */ +#endif /* OPERATIONMESSAGE_H_ */ diff --git a/trunk/ConsoleDataMigration/sources/common/ResFont.cpp b/trunk/ConsoleDataMigration/sources/common/ResFont.cpp index a9a8a79..d02c7f3 100644 --- a/trunk/ConsoleDataMigration/sources/common/ResFont.cpp +++ b/trunk/ConsoleDataMigration/sources/common/ResFont.cpp @@ -324,9 +324,6 @@ DrawAscii( pDrawer->BuildTextCommand(&s_TextWriter); - // 文字の色は、文字列の描画コマンドを再作成しなくても変更できます。 - s_TextWriter.SetTextColor(nn::util::Color8(s_Color, s_Color, s_Color, s_Color)); - pDrawer->DrawBegin(); SetupTextCamera(pDrawer, width, height);