上画面の文字を行単位で変えられるように

BMS操作指示画面の文字とキーアサイン変更

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
This commit is contained in:
N2614 2012-02-03 07:39:01 +00:00
parent 0da5fedbb0
commit 82587cc013
14 changed files with 269 additions and 144 deletions

View File

@ -52,6 +52,7 @@
#include "Util.h" #include "Util.h"
#include "ResFont.h" #include "ResFont.h"
#include "HardwareStateManager.h" #include "HardwareStateManager.h"
#include "OperationMessage.h"
// バージョン表示用 // バージョン表示用
#include "version.h" #include "version.h"
@ -223,7 +224,7 @@ extern "C" void nnMain(void)
// 操作用メッセージ // 操作用メッセージ
// 進捗確認メッセージを兼ねる? // 進捗確認メッセージを兼ねる?
::std::vector<std::string> operationMessage; common::OperationMessage operationMessage;
ControlState(manager, operationMessage, nextStep, continueBackup, forceDelete); ControlState(manager, operationMessage, nextStep, continueBackup, forceDelete);

View File

@ -63,25 +63,25 @@ bool s_PlayedFailSound = false;
} // namespace <unnamed> } // namespace <unnamed>
void PutAliveMessage(::std::vector<std::string>& operationMessage, const char* str) void PutAliveMessage(common::OperationMessage& operationMessage, const char* str)
{ {
std::string message = std::string(str); std::string message = std::string(str);
static u8 i = 0; static u8 i = 0;
if (i < 0xff / 4) if (i < 0xff / 4)
{ {
operationMessage.push_back(message + std::string(" /")); operationMessage.Add((message + std::string(" /")).c_str());
} }
else if (i < 0xff * 2 / 4) 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) else if (i < 0xff * 3 / 4)
{ {
operationMessage.push_back(message + std::string(" \\")); operationMessage.Add((message + std::string(" \\")).c_str());
} }
else else
{ {
operationMessage.push_back(message + std::string(" -")); operationMessage.Add((message + std::string(" -")).c_str());
} }
i += 4; i += 4;
} }
@ -91,7 +91,7 @@ bool NeedsAcAdapter(common::HardwareStateManager& manager)
return manager.IsBatteryLower() && !manager.IsAdapterConnected(); return manager.IsBatteryLower() && !manager.IsAdapterConnected();
} }
void ControlState(common::HardwareStateManager& manager, ::std::vector<std::string>& operationMessage, bool& nextStep, void ControlState(common::HardwareStateManager& manager, common::OperationMessage& operationMessage, bool& nextStep,
bool& continueBackup, bool forceDelete) bool& continueBackup, bool forceDelete)
{ {
// 状態遷移Controller // 状態遷移Controller
@ -116,7 +116,7 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
s_SdWriteProetctAnnotation = true; s_SdWriteProetctAnnotation = true;
common::PlaySound(common::SOUND_ANNOTATION); common::PlaySound(common::SOUND_ANNOTATION);
} }
operationMessage.push_back(::std::string("Can*t Write SD Card!!\n")); operationMessage.Add("Can*t Write SD Card!!\n");
break; break;
} }
@ -142,32 +142,32 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
s_ExistAPSettingAnnotation = true; s_ExistAPSettingAnnotation = true;
common::PlaySound(common::SOUND_ANNOTATION); common::PlaySound(common::SOUND_ANNOTATION);
} }
operationMessage.push_back(::std::string("Accsess_Point_Setting does not exist!")); operationMessage.Add("Accsess_Point_Setting does not exist!");
} }
} }
else else
{ {
error = true; error = true;
operationMessage.push_back(::std::string("Insert SD Card!!")); operationMessage.Add("Insert SD Card!!");
} }
} }
else else
{ {
error = true; error = true;
operationMessage.push_back(::std::string("Can't Read SDCI!!")); operationMessage.Add("Can't Read SDCI!!");
} }
// ACアダプタが必要か // ACアダプタが必要か
if (NeedsAcAdapter(manager)) if (NeedsAcAdapter(manager))
{ {
error = true; error = true;
operationMessage.push_back(::std::string("Connect AC Adapter!!")); operationMessage.Add("Connect AC Adapter!!");
} }
// エラーが無ければ進行用メッセージ表示 // エラーが無ければ進行用メッセージ表示
if (!error) if (!error)
{ {
operationMessage.push_back(::std::string("Push A or START Button")); operationMessage.Add("Push A or START Button");
if (!s_PlayedStartCursor) if (!s_PlayedStartCursor)
{ {
common::PlaySound(common::SOUND_CURSOR); common::PlaySound(common::SOUND_CURSOR);
@ -330,7 +330,7 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
if (NeedsAcAdapter(manager)) if (NeedsAcAdapter(manager))
{ {
continueBackup = false; continueBackup = false;
operationMessage.push_back(::std::string("Connect AC Adapter!!")); operationMessage.Add("Connect AC Adapter!!");
} }
PutAliveMessage(operationMessage, "Exporting Nand Data"); PutAliveMessage(operationMessage, "Exporting Nand Data");
@ -387,7 +387,7 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
// 吸出し完了 // 吸出し完了
case DONE: case DONE:
{ {
operationMessage.push_back(::std::string("Backup Done. Pull Out SD Card.")); operationMessage.Add("Backup Done. Pull Out SD Card.");
if (!s_PlayedSdPullOutCursor) if (!s_PlayedSdPullOutCursor)
{ {
common::PlaySound(common::SOUND_CURSOR); common::PlaySound(common::SOUND_CURSOR);
@ -399,7 +399,7 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
// SDカード抜き完了 // SDカード抜き完了
case FINISHED: case FINISHED:
{ {
operationMessage.push_back(::std::string("Backup Succeeded!!\n")); operationMessage.Add("Backup Succeeded!!\n");
if (!s_PlayedFinishedSound) if (!s_PlayedFinishedSound)
{ {
common::PlaySound(common::SOUND_OK); common::PlaySound(common::SOUND_OK);
@ -411,7 +411,7 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
// 吸出し失敗 // 吸出し失敗
case FAIL: case FAIL:
{ {
operationMessage.push_back(::std::string("Backup Failed.")); operationMessage.Add("Backup Failed.");
if (!s_PlayedFailSound) if (!s_PlayedFailSound)
{ {
common::PlaySound(common::SOUND_NG); common::PlaySound(common::SOUND_NG);
@ -422,7 +422,7 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
case FAIL_CHECK: case FAIL_CHECK:
{ {
operationMessage.push_back(::std::string("Check Error.")); operationMessage.Add("Check Error.");
if (!s_PlayedFailSound) if (!s_PlayedFailSound)
{ {
common::PlaySound(common::SOUND_NG); common::PlaySound(common::SOUND_NG);

View File

@ -19,6 +19,7 @@
#include <vector> #include <vector>
#include <string> #include <string>
#include "HardwareStateManager.h" #include "HardwareStateManager.h"
#include "OperationMessage.h"
namespace ConsoleBackup namespace ConsoleBackup
{ {
@ -36,7 +37,7 @@ typedef enum BackupMode
//! @param[in] nextStep 次の状態に遷移してもよいかどうか //! @param[in] nextStep 次の状態に遷移してもよいかどうか
//! @param[in] continueBackup 処理を続けてもよいかどうか //! @param[in] continueBackup 処理を続けてもよいかどうか
//! @param[in] forceDelete チェックエラー発生時に削除を実行してもよいかどうか //! @param[in] forceDelete チェックエラー発生時に削除を実行してもよいかどうか
void ControlState(common::HardwareStateManager& manager, ::std::vector<std::string>& operationMessage, bool& nextStep, void ControlState(common::HardwareStateManager& manager, common::OperationMessage& operationMessage, bool& nextStep,
bool& continueBackup, bool forceDelete); bool& continueBackup, bool forceDelete);
// バックアップ処理中かどうか // バックアップ処理中かどうか

View File

@ -44,6 +44,7 @@ SOURCES[] =
../common/ResFont.cpp ../common/ResFont.cpp
../common/HardwareStateManager.cpp ../common/HardwareStateManager.cpp
../common/SaveDataMover.cpp ../common/SaveDataMover.cpp
../common/OperationMessage.cpp
include $(ROOT)/common/BuildSwitch.om include $(ROOT)/common/BuildSwitch.om

View File

@ -47,6 +47,7 @@
#include "Util.h" #include "Util.h"
#include "ResFont.h" #include "ResFont.h"
#include "HardwareStateManager.h" #include "HardwareStateManager.h"
#include "OperationMessage.h"
// バージョン表示用 // バージョン表示用
#include "version.h" #include "version.h"
@ -183,6 +184,7 @@ extern "C" void nnMain(void)
for(;;) for(;;)
{ {
bool nextStep = false; bool nextStep = false;
bool operateBmsDone = false;
s_PadReader.ReadLatest(&padStatus); s_PadReader.ReadLatest(&padStatus);
@ -192,6 +194,11 @@ extern "C" void nnMain(void)
{ {
nextStep = true; nextStep = true;
} }
// YボタンでBMS操作完了
if(padStatus.trigger & nn::hid::BUTTON_Y)
{
operateBmsDone = true;
}
// LまたはRボタンで上下画面フリップ // LまたはRボタンで上下画面フリップ
if(padStatus.trigger & nn::hid::BUTTON_R || if(padStatus.trigger & nn::hid::BUTTON_R ||
@ -236,9 +243,10 @@ extern "C" void nnMain(void)
// 操作用メッセージ // 操作用メッセージ
// 進捗確認メッセージを兼ねる? // 進捗確認メッセージを兼ねる?
::std::vector<std::string> operationMessage;
ControlState(manager, operationMessage, nextStep); common::OperationMessage operationMessage;
ControlState(manager, operationMessage, nextStep, operateBmsDone);
nn::util::FloatColor titleColor; nn::util::FloatColor titleColor;

View File

@ -88,8 +88,8 @@ bool s_ShopOperationExecuted[SHOP_OPERATION_NUM_MAX];
// ショップ処理を何回リトライしたか // ショップ処理を何回リトライしたか
u32 s_ShopOperationRetryCount[SHOP_OPERATION_NUM_MAX]; u32 s_ShopOperationRetryCount[SHOP_OPERATION_NUM_MAX];
void PutAliveMessage(::std::vector<std::string>& operationMessage, const char* str); void PutAliveMessage(common::OperationMessage& operationMessage, const char* str);
bool CheckAndReadAPSetting(::std::vector<std::string>& operationMessage); bool CheckAndReadAPSetting(common::OperationMessage& operationMessage);
bool NeedsAcAdater(common::HardwareStateManager& manager) bool NeedsAcAdater(common::HardwareStateManager& manager)
{ {
@ -215,23 +215,23 @@ RestoreState s_RestoreState = STARTUP;
// Restoreモード管理 // Restoreモード管理
RestoreMode s_RestoreMode = RESTORE_MODE_RESTORE; RestoreMode s_RestoreMode = RESTORE_MODE_RESTORE;
void CheckSdInserted(common::HardwareStateManager& manager, ::std::vector<std::string>& message, bool& goNextStep); void CheckSdInserted(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep);
void CheckAcAdapter(common::HardwareStateManager& manager, ::std::vector<std::string>& message, bool& goNextStep); void CheckAcAdapter(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep);
void CheckSdWritable(common::HardwareStateManager& manager, ::std::vector<std::string>& message, bool& goNextStep); void CheckSdWritable(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep);
void CheckApSetting(common::HardwareStateManager& manager, ::std::vector<std::string>& message, bool& goNextStep); void CheckApSetting(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep);
void CheckNupExecuted(common::HardwareStateManager& manager, ::std::vector<std::string>& message, bool& goNextStep); void CheckNupExecuted(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep);
void CheckDownloadIvs(common::HardwareStateManager& manager, ::std::vector<std::string>& message, bool& goNextStep); void CheckDownloadIvs(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep);
void CheckAccountDeleted(common::HardwareStateManager& manager, ::std::vector<std::string>& message, bool& goNextStep); void CheckAccountDeleted(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep);
void CheckAccountTransfered(common::HardwareStateManager& manager, ::std::vector<std::string>& message, bool& goNextStep); void CheckAccountTransfered(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep);
void CheckWriteFinished(common::HardwareStateManager& manager, ::std::vector<std::string>& message, bool& goNextStep); void CheckWriteFinished(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep);
void CheckReadIvs(common::HardwareStateManager& manager, ::std::vector<std::string>& message, bool& goNextStep); void CheckReadIvs(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep);
void CheckConsoleInitialized(common::HardwareStateManager& manager, ::std::vector<std::string>& message, bool& goNextStep); void CheckConsoleInitialized(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep);
void CheckExistsSerialNumber(common::HardwareStateManager& manager, ::std::vector<std::string>& message, bool& goNextStep); void CheckExistsSerialNumber(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep);
void CheckIvsinSd(common::HardwareStateManager& manager, ::std::vector<std::string>& message, bool& goNextStep); void CheckIvsinSd(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep);
void CheckRegioinSd(common::HardwareStateManager& manager, ::std::vector<std::string>& message, bool& goNextStep); void CheckRegioinSd(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep);
// SDカード挿入チェック // SDカード挿入チェック
void CheckSdInserted(common::HardwareStateManager& manager, ::std::vector<std::string>& message, bool& goNextStep) void CheckSdInserted(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep)
{ {
if (nn::fs::IsSdmcInserted()) if (nn::fs::IsSdmcInserted())
{ {
@ -239,18 +239,18 @@ void CheckSdInserted(common::HardwareStateManager& manager, ::std::vector<std::s
} }
else else
{ {
message.push_back(::std::string("Insert SD Card!!")); message.Add("Insert SD Card!!");
s_RestoreState = STARTUP; s_RestoreState = STARTUP;
} }
} }
// ACアダプタが必要かどうかチェック // ACアダプタが必要かどうかチェック
void CheckAcAdapter(common::HardwareStateManager& manager, ::std::vector<std::string>& message, bool& goNextStep) void CheckAcAdapter(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep)
{ {
// ACアダプタが必要か // ACアダプタが必要か
if (NeedsAcAdater(manager)) if (NeedsAcAdater(manager))
{ {
message.push_back(::std::string("Connect AC Adapter!!")); message.Add("Connect AC Adapter!!");
s_RestoreState = STARTUP; s_RestoreState = STARTUP;
} }
else else
@ -260,7 +260,7 @@ void CheckAcAdapter(common::HardwareStateManager& manager, ::std::vector<std::st
} }
// SDカード書き込みチェック // SDカード書き込みチェック
void CheckSdWritable(common::HardwareStateManager& manager, ::std::vector<std::string>& message, bool& goNextStep) void CheckSdWritable(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep)
{ {
// SDカードに書き込みできるか // SDカードに書き込みできるか
if (nn::fs::IsSdmcWritable()) if (nn::fs::IsSdmcWritable())
@ -270,14 +270,14 @@ void CheckSdWritable(common::HardwareStateManager& manager, ::std::vector<std::s
else else
{ {
PlayAnnotationSound(ANNOTATION_SD_WRITE_PROTECT); PlayAnnotationSound(ANNOTATION_SD_WRITE_PROTECT);
message.push_back(::std::string("Can't Write SD Card!!\n")); message.Add("Can't Write SD Card!!\n");
s_RestoreState = STARTUP; s_RestoreState = STARTUP;
} }
} }
// 設定ファイル書式チェック // 設定ファイル書式チェック
void CheckApSetting(common::HardwareStateManager& manager, ::std::vector<std::string>& message, bool& goNextStep) void CheckApSetting(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep)
{ {
NN_UNUSED_VAR(manager); NN_UNUSED_VAR(manager);
NN_UNUSED_VAR(goNextStep); NN_UNUSED_VAR(goNextStep);
@ -293,7 +293,7 @@ void CheckApSetting(common::HardwareStateManager& manager, ::std::vector<std::st
} }
// NUP済みかどうかチェック // NUP済みかどうかチェック
void CheckNupExecuted(common::HardwareStateManager& manager, ::std::vector<std::string>& message, bool& goNextStep) void CheckNupExecuted(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep)
{ {
if (common::ExistsUpdateCheckedFile()) if (common::ExistsUpdateCheckedFile())
{ {
@ -323,7 +323,7 @@ void CheckNupExecuted(common::HardwareStateManager& manager, ::std::vector<std::
else else
{ {
PlayAnnotationSound(ANNOTATION_WIFI_OFF); PlayAnnotationSound(ANNOTATION_WIFI_OFF);
message.push_back(::std::string("Wireless is Off\n")); message.Add("Wireless is Off\n");
s_RestoreState = STARTUP; s_RestoreState = STARTUP;
} }
} }
@ -331,7 +331,7 @@ void CheckNupExecuted(common::HardwareStateManager& manager, ::std::vector<std::
} }
// インフラからIVS取得済みかチェック // インフラからIVS取得済みかチェック
void CheckDownloadIvs(common::HardwareStateManager& manager, ::std::vector<std::string>& message, bool& goNextStep) void CheckDownloadIvs(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep)
{ {
NN_UNUSED_VAR(message); NN_UNUSED_VAR(message);
NN_UNUSED_VAR(goNextStep); NN_UNUSED_VAR(goNextStep);
@ -357,7 +357,7 @@ void CheckDownloadIvs(common::HardwareStateManager& manager, ::std::vector<std::
} }
// アカウント削除済みかチェック // アカウント削除済みかチェック
void CheckAccountDeleted(common::HardwareStateManager& manager, ::std::vector<std::string>& message, bool& goNextStep) void CheckAccountDeleted(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep)
{ {
// アカウント削除確認ファイルがあるか? // アカウント削除確認ファイルがあるか?
if (common::ExistsDeleteAccountChecked()) if (common::ExistsDeleteAccountChecked())
@ -387,7 +387,7 @@ void CheckAccountDeleted(common::HardwareStateManager& manager, ::std::vector<st
} }
// アカウント移行済みかチェック // アカウント移行済みかチェック
void CheckAccountTransfered(common::HardwareStateManager& manager, ::std::vector<std::string>& message, bool& goNextStep) void CheckAccountTransfered(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep)
{ {
// アカウント移行確認ファイルがあるか? // アカウント移行確認ファイルがあるか?
if (common::ExistsTransferAccountChecked()) if (common::ExistsTransferAccountChecked())
@ -401,7 +401,7 @@ void CheckAccountTransfered(common::HardwareStateManager& manager, ::std::vector
} }
// 書き込み完了かどうかチェック // 書き込み完了かどうかチェック
void CheckWriteFinished(common::HardwareStateManager& manager, ::std::vector<std::string>& message, bool& goNextStep) void CheckWriteFinished(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep)
{ {
NN_UNUSED_VAR(goNextStep); NN_UNUSED_VAR(goNextStep);
@ -418,7 +418,7 @@ void CheckWriteFinished(common::HardwareStateManager& manager, ::std::vector<std
else else
{ {
PlayAnnotationSound(ANNOTATION_WIFI_OFF); PlayAnnotationSound(ANNOTATION_WIFI_OFF);
message.push_back(::std::string("Wireless is Off\n")); message.Add("Wireless is Off\n");
} }
} }
} }
@ -429,7 +429,7 @@ void CheckWriteFinished(common::HardwareStateManager& manager, ::std::vector<std
} }
// IVSを読めるかどうかチェック // IVSを読めるかどうかチェック
void CheckReadIvs(common::HardwareStateManager& manager, ::std::vector<std::string>& message, bool& goNextStep) void CheckReadIvs(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep)
{ {
// IVSを読めるか // IVSを読めるか
if (manager.CanReadIvs()) if (manager.CanReadIvs())
@ -444,7 +444,7 @@ void CheckReadIvs(common::HardwareStateManager& manager, ::std::vector<std::stri
} }
// 本体初期化済みかどうかチェック // 本体初期化済みかどうかチェック
void CheckConsoleInitialized(common::HardwareStateManager& manager, ::std::vector<std::string>& message, bool& goNextStep) void CheckConsoleInitialized(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep)
{ {
// 本体初期化完了ファイルがあるか? // 本体初期化完了ファイルがあるか?
if (common::ExistsConsoleInitializedFile()) if (common::ExistsConsoleInitializedFile())
@ -458,7 +458,7 @@ void CheckConsoleInitialized(common::HardwareStateManager& manager, ::std::vecto
} }
// シリアルナンバーがあるかどうかチェック // シリアルナンバーがあるかどうかチェック
void CheckExistsSerialNumber(common::HardwareStateManager& manager, ::std::vector<std::string>& message, bool& goNextStep) void CheckExistsSerialNumber(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep)
{ {
NN_UNUSED_VAR(manager); NN_UNUSED_VAR(manager);
NN_UNUSED_VAR(message); NN_UNUSED_VAR(message);
@ -487,7 +487,7 @@ void CheckExistsSerialNumber(common::HardwareStateManager& manager, ::std::vecto
} }
// SDカードにIVSがあるかどうかチェック // SDカードにIVSがあるかどうかチェック
void CheckIvsinSd(common::HardwareStateManager& manager, ::std::vector<std::string>& message, bool& goNextStep) void CheckIvsinSd(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep)
{ {
NN_UNUSED_VAR(manager); NN_UNUSED_VAR(manager);
NN_UNUSED_VAR(message); NN_UNUSED_VAR(message);
@ -506,7 +506,7 @@ void CheckIvsinSd(common::HardwareStateManager& manager, ::std::vector<std::stri
} }
// SDカードにリージョンデータがあるかどうかチェック // SDカードにリージョンデータがあるかどうかチェック
void CheckRegioinSd(common::HardwareStateManager& manager, ::std::vector<std::string>& message, bool& goNextStep) void CheckRegioinSd(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep)
{ {
NN_UNUSED_VAR(message); NN_UNUSED_VAR(message);
NN_UNUSED_VAR(goNextStep); NN_UNUSED_VAR(goNextStep);
@ -553,7 +553,7 @@ void ShopOperationSuccess(ShopOperation op, const char* logMessage, RestoreState
void ShopOperationSingleTemplate( void ShopOperationSingleTemplate(
common::HardwareStateManager& manager, common::HardwareStateManager& manager,
std::vector<std::string>& message, common::OperationMessage& message,
ShopOperation op, ShopOperation op,
const char* aliveMessage, const char* aliveMessage,
const char* logMessage, const char* logMessage,
@ -564,7 +564,7 @@ void ShopOperationSingleTemplate(
// ACアダプタが必要か // ACアダプタが必要か
if (NeedsAcAdater(manager)) 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<std::string>& message, RestoreState nextState) void UpdateOperation(common::HardwareStateManager& manager, common::OperationMessage& message, RestoreState nextState)
{ {
// ACアダプタが必要か // ACアダプタが必要か
if (NeedsAcAdater(manager)) 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<std::s
} }
} }
bool CheckAndReadAPSetting(::std::vector<std::string>& operationMessage) bool CheckAndReadAPSetting(common::OperationMessage& operationMessage)
{ {
using namespace common; using namespace common;
if (!ExistsAPSetting()) if (!ExistsAPSetting())
{ {
PlayAnnotationSound(ANNOTATION_SETTING_NOT_FOUND); 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; return false;
} }
@ -739,12 +739,12 @@ bool CheckAndReadAPSetting(::std::vector<std::string>& operationMessage)
|| s_GetIvsOnlyMode && s_CheckSdOnlyMode || s_GetIvsOnlyMode && s_CheckSdOnlyMode
|| s_CheckSdOnlyMode && s_NupOnlyMode) || 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; s_ReadSettingIsSuccess = false;
} }
else if(s_NupOnlyMode && s_SkipNupMode) 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; s_ReadSettingIsSuccess = false;
} }
else else
@ -772,32 +772,32 @@ bool CheckAndReadAPSetting(::std::vector<std::string>& operationMessage)
if (!s_ReadSettingIsSuccess) if (!s_ReadSettingIsSuccess)
{ {
operationMessage.push_back(::std::string("Invalid Accsess_Point_Setting format!")); operationMessage.Add("Invalid Accsess_Point_Setting format!");
PlayAnnotationSound(ANNOTATION_INVALID_SETTING); PlayAnnotationSound(ANNOTATION_INVALID_SETTING);
} }
return s_ReadSettingIsSuccess; return s_ReadSettingIsSuccess;
} }
void PutAliveMessage(::std::vector<std::string>& operationMessage, const char* str) void PutAliveMessage(common::OperationMessage& operationMessage, const char* str)
{ {
std::string message = std::string(str); std::string message = std::string(str);
static u8 i = 0; static u8 i = 0;
if (i < 0xff / 4) if (i < 0xff / 4)
{ {
operationMessage.push_back(message + std::string(" /")); operationMessage.Add((message + std::string(" /")).c_str());
} }
else if (i < 0xff * 2 / 4) 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) else if (i < 0xff * 3 / 4)
{ {
operationMessage.push_back(message + std::string(" \\")); operationMessage.Add((message + std::string(" \\")).c_str());
} }
else else
{ {
operationMessage.push_back(message + std::string(" -")); operationMessage.Add((message + std::string(" -")).c_str());
} }
i += 4; i += 4;
} }
@ -820,7 +820,7 @@ nn::Result ExecSyncMcuRtc(common::HardwareStateManager& manager)
} // namespace <unnamed> } // namespace <unnamed>
void ControlState(common::HardwareStateManager& manager, ::std::vector<std::string>& operationMessage, bool& nextStep) void ControlState(common::HardwareStateManager& manager, common::OperationMessage& operationMessage, bool& nextStep, bool operateBmsDone)
{ {
using namespace common; using namespace common;
nn::Result result; nn::Result result;
@ -858,8 +858,8 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
case WAIT_START_UPDATE: case WAIT_START_UPDATE:
{ {
operationMessage.push_back(::std::string("Push A or START Button")); operationMessage.Add("Push A or START Button");
operationMessage.push_back(::std::string("Network Update Mode")); operationMessage.Add("Network Update Mode");
PlayCursorSound(WAIT_START_UPDATE); PlayCursorSound(WAIT_START_UPDATE);
if (nextStep) if (nextStep)
@ -880,15 +880,15 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
if (result.IsSuccess()) if (result.IsSuccess())
{ {
::std::string serialStr(reinterpret_cast<char*> (serial)); ::std::string serialStr(reinterpret_cast<char*> (serial));
operationMessage.push_back(::std::string("Serial Number in SD : ") + serialStr); operationMessage.Add((::std::string("Serial Number in SD : ") + serialStr).c_str());
} }
else else
{ {
s_RestoreState = FAIL; s_RestoreState = FAIL;
} }
operationMessage.push_back(::std::string("Push A or START Button")); operationMessage.Add("Push A or START Button");
operationMessage.push_back(::std::string("Import Data Mode")); operationMessage.Add("Import Data Mode");
PlayCursorSound(WAIT_START_IMPORT); PlayCursorSound(WAIT_START_IMPORT);
if (nextStep) if (nextStep)
@ -900,8 +900,8 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
case WAIT_START_SYNC_CLOCK: case WAIT_START_SYNC_CLOCK:
{ {
operationMessage.push_back(::std::string("Push A or START Button")); operationMessage.Add("Push A or START Button");
operationMessage.push_back(::std::string("DownLoad Twl Title and Clock Sync Mode")); operationMessage.Add("DownLoad Twl Title and Clock Sync Mode");
PlayCursorSound(WAIT_START_SYNC_CLOCK); PlayCursorSound(WAIT_START_SYNC_CLOCK);
if (nextStep) if (nextStep)
@ -956,9 +956,9 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
// シリアルナンバーがSDカードにないこと警告 // シリアルナンバーがSDカードにないこと警告
case SERIAL_IS_NOT_IN_SD: case SERIAL_IS_NOT_IN_SD:
{ {
operationMessage.push_back(::std::string("Serial Number Is Not In SD Card")); operationMessage.Add("Serial Number Is Not In SD Card");
operationMessage.push_back(::std::string("Push A or START Button")); operationMessage.Add("Push A or START Button");
operationMessage.push_back(::std::string("Import Data Mode")); operationMessage.Add("Import Data Mode");
PlayAnnotationSound(ANNOTATION_SERIAL_NUMBER_NOT_IN_SD); PlayAnnotationSound(ANNOTATION_SERIAL_NUMBER_NOT_IN_SD);
@ -979,8 +979,8 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
// アップデート完了 // アップデート完了
case UPDATE_DONE: case UPDATE_DONE:
{ {
operationMessage.push_back(::std::string("Network Update Done.")); operationMessage.Add("Network Update Done.");
operationMessage.push_back(::std::string("Press A or START Button to Reboot")); operationMessage.Add("Press A or START Button to Reboot");
PlayCursorSound(UPDATE_DONE); PlayCursorSound(UPDATE_DONE);
if (nextStep) if (nextStep)
@ -1000,8 +1000,8 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
case DOWNLOAD_IVS_DONE: case DOWNLOAD_IVS_DONE:
{ {
operationMessage.push_back(::std::string("Get SDCI Done.")); operationMessage.Add("Get SDCI Done.");
operationMessage.push_back(::std::string("Press A or START Button to Reboot")); operationMessage.Add("Press A or START Button to Reboot");
PlayCursorSound(DOWNLOAD_IVS_DONE); PlayCursorSound(DOWNLOAD_IVS_DONE);
if (nextStep) if (nextStep)
@ -1013,7 +1013,7 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
case CHECK_IVS: case CHECK_IVS:
{ {
operationMessage.push_back(::std::string("Insert User's SD Card")); operationMessage.Add("Insert User's SD Card");
} }
break; break;
@ -1048,15 +1048,15 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
case CHECK_SD_DIRECTORY_SUCCESS: case CHECK_SD_DIRECTORY_SUCCESS:
{ {
operationMessage.push_back(::std::string("Check User's SD Card Succeeded.")); operationMessage.Add("Check User's SD Card Succeeded.");
operationMessage.push_back(::std::string("Pull Out SD Card")); operationMessage.Add("Pull Out SD Card");
} }
break; break;
case CHECK_SD_DIRECTORY_FAIL: case CHECK_SD_DIRECTORY_FAIL:
{ {
operationMessage.push_back(::std::string("Check User's SD Card Failed.")); operationMessage.Add("Check User's SD Card Failed.");
operationMessage.push_back(::std::string("Pull Out SD Card")); operationMessage.Add("Pull Out SD Card");
} }
break; break;
@ -1064,11 +1064,11 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
{ {
if(s_SkipNupMode) if(s_SkipNupMode)
{ {
operationMessage.push_back(::std::string("After Operating BMS Account Transfer,")); operationMessage.Add("After Operating BMS Account Transfer,");
} }
operationMessage.push_back(::std::string("Push A or START Button")); operationMessage.Add("Push A or START Button");
operationMessage.push_back(::std::string("Transfer Account Mode")); operationMessage.Add("Transfer Account Mode");
PlayCursorSound(WAIT_START_TRANSFER_ACCOUNT); PlayCursorSound(WAIT_START_TRANSFER_ACCOUNT);
if (nextStep) if (nextStep)
@ -1088,8 +1088,8 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
case WAIT_START_DELETE_ACCOUNT: case WAIT_START_DELETE_ACCOUNT:
{ {
operationMessage.push_back(::std::string("Push A or START Button")); operationMessage.Add("Push A or START Button");
operationMessage.push_back(::std::string("Delete Account Mode")); operationMessage.Add("Delete Account Mode");
PlayCursorSound(WAIT_START_DELETE_ACCOUNT); PlayCursorSound(WAIT_START_DELETE_ACCOUNT);
if (nextStep) if (nextStep)
@ -1127,13 +1127,13 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
} }
else else
{ {
operationMessage.push_back(::std::string("Delete Account Done.")); operationMessage.Add("Delete Account Done.");
operationMessage.push_back(::std::string("Operate BMS.")); operationMessage.Add("Operate BMS.", nn::util::Color8(0, 255, 255, 255));
operationMessage.push_back(::std::string("")); operationMessage.Add("");
operationMessage.push_back(::std::string("Press A or START Button to Continue")); operationMessage.Add("Press Y Button to Continue");
PlayCursorSound(DELETE_ACCOUNT_DONE); PlayCursorSound(DELETE_ACCOUNT_DONE);
if (nextStep) if (operateBmsDone)
{ {
s_RestoreState = STARTUP; s_RestoreState = STARTUP;
} }
@ -1231,7 +1231,7 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
// ACアダプタが必要か // ACアダプタが必要か
if (NeedsAcAdater(manager)) if (NeedsAcAdater(manager))
{ {
operationMessage.push_back(::std::string("Connect AC Adapter!!")); operationMessage.Add("Connect AC Adapter!!");
} }
// データを読み込む // データを読み込む
@ -1300,7 +1300,7 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
// 書き込み後の処理 // 書き込み後の処理
case POST_RESTORE: case POST_RESTORE:
{ {
operationMessage.push_back(::std::string("Post Process...")); operationMessage.Add("Post Process...");
// SDカードのIVSファイルを書き込む // SDカードのIVSファイルを書き込む
if(ImportIvsData()) if(ImportIvsData())
@ -1320,8 +1320,8 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
// 書き込み完了 // 書き込み完了
case RESTORE_DONE: case RESTORE_DONE:
{ {
operationMessage.push_back(::std::string("Restore Done.")); operationMessage.Add("Restore Done.");
operationMessage.push_back(::std::string("Press A or START Button to Reboot")); operationMessage.Add("Press A or START Button to Reboot");
PlayCursorSound(RESTORE_DONE); PlayCursorSound(RESTORE_DONE);
if (nextStep) if (nextStep)
@ -1505,7 +1505,7 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
// すべて完了 // すべて完了
case WAIT_SD_EJECT: case WAIT_SD_EJECT:
{ {
operationMessage.push_back(::std::string("ALL Done. Pull Out SD Card.")); operationMessage.Add("ALL Done. Pull Out SD Card.");
// SDカード抜けのみで次の状態に遷移する // SDカード抜けのみで次の状態に遷移する
PlayCursorSound(WAIT_SD_EJECT); PlayCursorSound(WAIT_SD_EJECT);
@ -1515,7 +1515,7 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
// すべて完了 // すべて完了
case ALL_DONE: case ALL_DONE:
{ {
operationMessage.push_back(::std::string("Restore Succeeded!!")); operationMessage.Add("Restore Succeeded!!");
static bool init = true; static bool init = true;
if (init) if (init)
{ {
@ -1536,7 +1536,7 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
init = false; init = false;
} }
operationMessage.push_back(::std::string("Failed.")); operationMessage.Add("Failed.");
if (!s_PlayedFailSound) if (!s_PlayedFailSound)
{ {
PlaySound(SOUND_NG); PlaySound(SOUND_NG);
@ -1547,14 +1547,14 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
case NUP_ONLY_WAIT_SD_EJECT: case NUP_ONLY_WAIT_SD_EJECT:
{ {
operationMessage.push_back(::std::string("Update Done. Pull Out SD Card.")); operationMessage.Add("Update Done. Pull Out SD Card.");
PlayCursorSound(NUP_ONLY_WAIT_SD_EJECT); PlayCursorSound(NUP_ONLY_WAIT_SD_EJECT);
} }
break; break;
case DOWNLOAD_IVS_WAIT_NEXT: case DOWNLOAD_IVS_WAIT_NEXT:
{ {
operationMessage.push_back(::std::string("Press A or START Button to Continue.")); operationMessage.Add("Press A or START Button to Continue.");
if(nextStep) if(nextStep)
{ {
s_RestoreState = SYNC_TICKET; s_RestoreState = SYNC_TICKET;
@ -1565,7 +1565,7 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
case NUP_ONLY_WAIT_NEXT: case NUP_ONLY_WAIT_NEXT:
{ {
operationMessage.push_back(::std::string("Press A or START Button to Shutdown.")); operationMessage.Add("Press A or START Button to Shutdown.");
if (nextStep) if (nextStep)
{ {
@ -1589,7 +1589,7 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
case PREINSTALL_WAIT_SYNC_TICKET: case PREINSTALL_WAIT_SYNC_TICKET:
{ {
operationMessage.push_back(::std::string("Press A or START Button to Continue.")); operationMessage.Add("Press A or START Button to Continue.");
PlayCursorSound(PREINSTALL_WAIT_SYNC_TICKET); PlayCursorSound(PREINSTALL_WAIT_SYNC_TICKET);
if(nextStep) if(nextStep)
{ {
@ -1601,7 +1601,7 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
case PREINSTALL_WAIT_USER_SD_INSERT: case PREINSTALL_WAIT_USER_SD_INSERT:
{ {
PlayCursorSound(PREINSTALL_WAIT_USER_SD_INSERT); PlayCursorSound(PREINSTALL_WAIT_USER_SD_INSERT);
operationMessage.push_back(::std::string("Insert User's SD Card")); operationMessage.Add("Insert User's SD Card");
} }
break; break;
@ -1705,9 +1705,9 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
case PREINSTALL_CHECK_SD_FAIL: case PREINSTALL_CHECK_SD_FAIL:
{ {
PlayCursorSound(PREINSTALL_CHECK_SD_FAIL); PlayCursorSound(PREINSTALL_CHECK_SD_FAIL);
operationMessage.push_back(::std::string("Check User's SD Card Failed.")); operationMessage.Add("Check User's SD Card Failed.");
operationMessage.push_back(::std::string("Pull Out User's SD Card")); operationMessage.Add("Pull Out User's SD Card");
operationMessage.push_back(::std::string("and Insert Repairing SD Card")); operationMessage.Add("and Insert Repairing SD Card");
} }
break; break;
@ -1792,17 +1792,17 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
case PREINSTALL_DOWNLOAD_APP_NOT_ENOUGH_SPACE: case PREINSTALL_DOWNLOAD_APP_NOT_ENOUGH_SPACE:
{ {
PlayCursorSound(PREINSTALL_DOWNLOAD_APP_NOT_ENOUGH_SPACE); PlayCursorSound(PREINSTALL_DOWNLOAD_APP_NOT_ENOUGH_SPACE);
operationMessage.push_back(::std::string("Not enough space on User's SD Card")); operationMessage.Add("Not enough space on User's SD Card");
operationMessage.push_back(::std::string("Pull out User's SD Card")); operationMessage.Add("Pull out User's SD Card");
operationMessage.push_back(::std::string("and Insert Repairing SD Card")); operationMessage.Add("and Insert Repairing SD Card");
} }
break; break;
case PREINSTALL_WAIT_USER_SD_EJECT: case PREINSTALL_WAIT_USER_SD_EJECT:
{ {
PlayCursorSound(PREINSTALL_WAIT_USER_SD_EJECT); PlayCursorSound(PREINSTALL_WAIT_USER_SD_EJECT);
operationMessage.push_back(::std::string("Pull out User's SD Card")); operationMessage.Add("Pull out User's SD Card");
operationMessage.push_back(::std::string("and Insert Repairing SD Card")); operationMessage.Add("and Insert Repairing SD Card");
} }
break; break;

View File

@ -20,6 +20,7 @@
#include <vector> #include <vector>
#include <string> #include <string>
#include "HardwareStateManager.h" #include "HardwareStateManager.h"
#include "OperationMessage.h"
namespace ConsoleRestore namespace ConsoleRestore
{ {
@ -41,8 +42,8 @@ const u32 RETRY_MAX = 3;
// manager ハードウェア情報を取得するためのラッパ // manager ハードウェア情報を取得するためのラッパ
// operationMessage 操作情報として表示したい文字列 // operationMessage 操作情報として表示したい文字列
// nextStep 次の状態に遷移してもよいかどうか // nextStep 次の状態に遷移してもよいかどうか
// continueBackup 処理を続けてもよいかどうか // operateBmsDone BMS操作を完了したかどうか
void ControlState(common::HardwareStateManager& manager, ::std::vector<std::string>& operationMessage, bool& nextStep); void ControlState(common::HardwareStateManager& manager, common::OperationMessage& operationMessage, bool& nextStep, bool operateBmsDone);
// リストア処理中かどうか // リストア処理中かどうか
bool InProgress(); bool InProgress();

View File

@ -52,6 +52,7 @@ SOURCES[] =
../common/ResFont.cpp ../common/ResFont.cpp
../common/HardwareStateManager.cpp ../common/HardwareStateManager.cpp
../common/SaveDataMover.cpp ../common/SaveDataMover.cpp
../common/OperationMessage.cpp
include $(ROOT)/common/BuildSwitch.om include $(ROOT)/common/BuildSwitch.om

View File

@ -17,17 +17,18 @@ if $(and $(defined PROD_BUILD), $(defined TEST_BUILD))
echo Both PROD_BUILD and TEST_BUILD defined!! echo Both PROD_BUILD and TEST_BUILD defined!!
exit exit
if $(defined PROD_BUILD) if $(defined TARGET_PROGRAM)
CCFLAGS += -DUSE_PROD_KEY -DBUILD_FOR_PROD_BGS if $(defined PROD_BUILD)
TARGET_NAME = $(TARGET_PROGRAM) CCFLAGS += -DUSE_PROD_KEY -DBUILD_FOR_PROD_BGS
TARGET_PROGRAM = $(TARGET_PROGRAM)_prod TARGET_NAME = $(TARGET_PROGRAM)
export TARGET_PROGRAM = $(TARGET_PROGRAM)_prod
export
elseif $(defined TEST_BUILD) elseif $(defined TEST_BUILD)
CCFLAGS += -DUSE_PROD_KEY -DBUILD_FOR_TEST_BGS CCFLAGS += -DUSE_PROD_KEY -DBUILD_FOR_TEST_BGS
TARGET_NAME = $(TARGET_PROGRAM) TARGET_NAME = $(TARGET_PROGRAM)
TARGET_PROGRAM = $(TARGET_PROGRAM)_test TARGET_PROGRAM = $(TARGET_PROGRAM)_test
export export
else else
TARGET_NAME = $(TARGET_PROGRAM) TARGET_NAME = $(TARGET_PROGRAM)
export
export export

View File

@ -38,7 +38,7 @@ u64 s_FriendCode;
u8 s_BatteryRemain; u8 s_BatteryRemain;
std::string s_AdapterState; std::string s_AdapterState;
u8 s_Progress; u8 s_Progress;
::std::vector<std::string>* s_OperationMessage; OperationMessage* s_OperationMessage;
bool s_ReadFriendCode; bool s_ReadFriendCode;
} }
@ -64,6 +64,7 @@ u32 GetRenderTarget(u32 target, bool flip)
void SetTextWriterCore() void SetTextWriterCore()
{ {
GetTextWriter()->SetTextColor(nn::util::Color8(255, 255, 255, 255));
GetTextWriter()->Print("\n"); GetTextWriter()->Print("\n");
GetTextWriter()->Printf("System Ver. %d.%d.%d-%d\n", s_CupMajor, s_CupMinor, s_CupMicro, s_NupMajor); 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()->Printf("Progress %02d%%\n", s_Progress);
GetTextWriter()->Print("\n"); GetTextWriter()->Print("\n");
::std::vector<std::string>::iterator it; for (u32 i = 0; i < s_OperationMessage->GetSize(); i++)
for (it = s_OperationMessage->begin(); it != s_OperationMessage->end(); it++)
{ {
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 isProcessSucceeded,
bool isProcessWarning, bool isProcessWarning,
char8* macAddress, char8* macAddress,
::std::vector<std::string>& operationMessage, OperationMessage& operationMessage,
nn::cfg::CTR::CfgRegionCode region, nn::cfg::CTR::CfgRegionCode region,
u8* serialNo, u8* serialNo,
bool readFriendCode bool readFriendCode

View File

@ -29,6 +29,7 @@
#include <vector> #include <vector>
#include "common_Types.h" #include "common_Types.h"
#include "OperationMessage.h"
// 描画色の定義 // 描画色の定義
#define WHITE_COLOR 1.f, 1.f, 1.f, 1.f #define WHITE_COLOR 1.f, 1.f, 1.f, 1.f
@ -70,7 +71,7 @@ void DrawSystemState
bool isProcessSucceeded, bool isProcessSucceeded,
bool isProcessWarning, bool isProcessWarning,
char8* macAddress, char8* macAddress,
::std::vector<std::string>& operationMessage, OperationMessage& operationMessage,
nn::cfg::CTR::CfgRegionCode region, nn::cfg::CTR::CfgRegionCode region,
u8* s_SerialNo, u8* s_SerialNo,
bool readFriendCode bool readFriendCode

View File

@ -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 */

View File

@ -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 <string>
#include <vector>
#include <nn/util/util_Color.h>
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<ColorString> m_ColorString;
};
} /* namespace common */
#endif /* OPERATIONMESSAGE_H_ */

View File

@ -324,9 +324,6 @@ DrawAscii(
pDrawer->BuildTextCommand(&s_TextWriter); pDrawer->BuildTextCommand(&s_TextWriter);
// 文字の色は、文字列の描画コマンドを再作成しなくても変更できます。
s_TextWriter.SetTextColor(nn::util::Color8(s_Color, s_Color, s_Color, s_Color));
pDrawer->DrawBegin(); pDrawer->DrawBegin();
SetupTextCamera(pDrawer, width, height); SetupTextCamera(pDrawer, width, height);