diff --git a/trunk/ConsoleDataMigration/sources/ConsoleRestore/Controller.cpp b/trunk/ConsoleDataMigration/sources/ConsoleRestore/Controller.cpp index fda7da1..1679df9 100644 --- a/trunk/ConsoleDataMigration/sources/ConsoleRestore/Controller.cpp +++ b/trunk/ConsoleDataMigration/sources/ConsoleRestore/Controller.cpp @@ -1589,6 +1589,10 @@ u32 GetProgress() { return GetUpdateProgress(); } + else if(s_RestoreState == DOWNLOAD_TWL) + { + return GetTitleDownloadProgress(); + } else { return 0; diff --git a/trunk/ConsoleDataMigration/sources/ConsoleRestore/Shop.cpp b/trunk/ConsoleDataMigration/sources/ConsoleRestore/Shop.cpp index 32f208b..6364bda 100644 --- a/trunk/ConsoleDataMigration/sources/ConsoleRestore/Shop.cpp +++ b/trunk/ConsoleDataMigration/sources/ConsoleRestore/Shop.cpp @@ -34,11 +34,12 @@ do { \ if (result.IsFailure()) \ { \ ECCustomerSupportCode csc; \ - nn::nim::Shop::GetCustomerSupportCode(&csc); \ - COMMON_LOGGER("CSCode: %d\n", csc); \ + nn::nim::Shop::GetCustomerSupportCode(&csc); \ + COMMON_LOGGER("CSCode: %d\n", csc); \ + COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result); \ nn::dbg::PrintResult(result); \ - s_ShopResult = result; \ - return; \ + s_ShopResult = result; \ + return; \ } \ } while(0) namespace diff --git a/trunk/ConsoleDataMigration/sources/ConsoleRestore/TitleDownloader.cpp b/trunk/ConsoleDataMigration/sources/ConsoleRestore/TitleDownloader.cpp index cf89456..d48a07a 100644 --- a/trunk/ConsoleDataMigration/sources/ConsoleRestore/TitleDownloader.cpp +++ b/trunk/ConsoleDataMigration/sources/ConsoleRestore/TitleDownloader.cpp @@ -34,6 +34,7 @@ bit8 s_buffer1[400 * 1024]; const size_t TITLE_DOWNLOADER_STACK_SIZE = 0x1000; nn::os::Thread s_TitleDownloaderThread; nn::os::StackBuffer s_TitleDownloaderThreadStack; +u64 s_Progress; nn::fs::MediaType GetMediaType(const ES_NAMESPACE::ESTitleId titleId) { @@ -117,6 +118,7 @@ void TitleDownloaderThreadFunc() { TitleDownloader TwlTitleDownloader; + s_Progress = 0; TwlTitleDownloader.Start(); } @@ -135,6 +137,10 @@ bool DownloadTitleSucceeded() return TitleDownloader::m_Result.IsSuccess() && GetShopOperationSingleResult().IsSuccess(); } +u32 GetTitleDownloadProgress() +{ + return s_Progress; +} TitleDownloader::TitleDownloader() : m_TwlTiteNum(0) @@ -190,6 +196,7 @@ void TitleDownloader::Start() for(u8 i = 0; i < m_TwlTiteNum; i++) { + s_Progress = i * 100 / m_TwlTiteNum; StartShopOperationSingle(SHOP_OPERATION_CONNECT_WITHOUT_CLOSE); WaitShopOperationAndFinalize(); diff --git a/trunk/ConsoleDataMigration/sources/ConsoleRestore/TitleDownloader.h b/trunk/ConsoleDataMigration/sources/ConsoleRestore/TitleDownloader.h index 043ef6b..6e6449e 100644 --- a/trunk/ConsoleDataMigration/sources/ConsoleRestore/TitleDownloader.h +++ b/trunk/ConsoleDataMigration/sources/ConsoleRestore/TitleDownloader.h @@ -30,6 +30,9 @@ bool DownloadTitleFinished(); // タイトルのダウンロードスレッドが成功したかどうか bool DownloadTitleSucceeded(); +// タイトルダウンロードの進捗を取得する +u32 GetTitleDownloadProgress(); + // ショップからタイトルをダウンロードするためのクラス class TitleDownloader { diff --git a/trunk/ConsoleDataMigration/sources/ConsoleRestore/Updater.cpp b/trunk/ConsoleDataMigration/sources/ConsoleRestore/Updater.cpp index 2da6a7f..c6d8a25 100644 --- a/trunk/ConsoleDataMigration/sources/ConsoleRestore/Updater.cpp +++ b/trunk/ConsoleDataMigration/sources/ConsoleRestore/Updater.cpp @@ -41,6 +41,7 @@ do { \ NN_UTIL_PANIC_IF_FAILED( \ nn::nim::Updater::GetCustomerSupportCode(&csc)); \ COMMON_LOGGER("CSCode: %d\n", csc); \ + COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result); \ nn::dbg::PrintResult(result); \ s_Result = result; \ goto LABEL_FINALIZE; \