[PreinstallListUp]電源ボタン長押しで終了するように

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
This commit is contained in:
N2614 2012-02-08 06:19:26 +00:00
parent 7a113a7fac
commit a24e80d2e2

View File

@ -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<THREAD_STACK_SIZE> 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<uptr>(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();
}
}
}