From a24e80d2e2f3639b0a4e8b1b19398b22b242b043 Mon Sep 17 00:00:00 2001 From: N2614 Date: Wed, 8 Feb 2012 06:19:26 +0000 Subject: [PATCH] =?UTF-8?q?[PreinstallListUp]=E9=9B=BB=E6=BA=90=E3=83=9C?= =?UTF-8?q?=E3=82=BF=E3=83=B3=E9=95=B7=E6=8A=BC=E3=81=97=E3=81=A7=E7=B5=82?= =?UTF-8?q?=E4=BA=86=E3=81=99=E3=82=8B=E3=82=88=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@625 385bec56-5757-e545-9c3a-d8741f4650f1 --- .../sources/tools/PreinstallListUp/main.cpp | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/trunk/ConsoleDataMigration/sources/tools/PreinstallListUp/main.cpp b/trunk/ConsoleDataMigration/sources/tools/PreinstallListUp/main.cpp index 70739c9..8fbb6a8 100644 --- a/trunk/ConsoleDataMigration/sources/tools/PreinstallListUp/main.cpp +++ b/trunk/ConsoleDataMigration/sources/tools/PreinstallListUp/main.cpp @@ -72,6 +72,7 @@ const u32 CONSOLE_MAX_LINE = 1000; const size_t THREAD_STACK_SIZE = 0x2000; nn::os::Thread s_Thread; nn::os::StackBuffer s_ThreadStack; +demo::RenderSystemDrawing s_RenderSystem; } @@ -117,6 +118,24 @@ void ThreadFunc() COMMON_LOGGER_RETURN_VOID_IF_FAILED(result); } +void FinalizeAll() +{ + common::Logger::GetLoggerInstance()->Finalize(); + // アンマウント + nn::fs::Unmount("nand:"); + nn::fs::Unmount("sdmc:"); + s_RenderSystem.Finalize(); + + nn::ps::Finalize(); + nn::cfg::CTR::system::Finalize(); + nn::cfg::CTR::init::Finalize(); + nn::hid::Finalize(); + nn::fs::Finalize(); + + nn::applet::PrepareToCloseApplication(); + nn::applet::CloseApplication(); +} + extern "C" void nninitSetupDaemons(void) { } @@ -152,7 +171,6 @@ extern "C" void nnMain(void) // RenderSystem の準備 common::HeapManager gxHeap(s_GxHeapSize); uptr heapForGx = reinterpret_cast(gxHeap.GetAddr()); - demo::RenderSystemDrawing s_RenderSystem; s_RenderSystem.Initialize(heapForGx, s_GxHeapSize); // ログ描画の初期化 @@ -201,6 +219,13 @@ extern "C" void nnMain(void) s_RenderSystem.SwapBuffers(); s_RenderSystem.WaitVsync(NN_GX_DISPLAY_BOTH); + + // 電源長押しで終了 + if ( nn::applet::IsExpectedToCloseApplication()) + { + FinalizeAll(); + } + } }