ロゴ表示が完了してからエラー表示アプレットを呼ぶように

git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@468 385bec56-5757-e545-9c3a-d8741f4650f1
This commit is contained in:
N2614 2011-11-01 01:31:51 +00:00
parent 120532553a
commit 33771ff869
3 changed files with 12 additions and 17 deletions

View File

@ -56,9 +56,6 @@ nn::os::StackBuffer<DRAWER_STACK_SIZE> s_DrawerThreadStack;
// 終了処理をしても良いかどうか // 終了処理をしても良いかどうか
bool s_IsExpectedToFinalize = false; bool s_IsExpectedToFinalize = false;
// 終了処理が完了したかどうか
bool s_IsPreparedToFinalize = false;
// エラーコード表示が必要かどうか // エラーコード表示が必要かどうか
bool s_NeedShowErrorCode = false; bool s_NeedShowErrorCode = false;
// エラーコード // エラーコード
@ -425,13 +422,12 @@ void StartDrawerThread()
s_DrawerThread.Start(DrawThreadMain, s_DrawerThreadStack); s_DrawerThread.Start(DrawThreadMain, s_DrawerThreadStack);
} }
bool IsDrawerThreadFinished()
{
return s_IsPreparedToFinalize;
}
void FinalizeDrawerThread() void FinalizeDrawerThread()
{ {
if(s_DrawerThread.IsAlive())
{
nn::os::Thread::Sleep(nn::fnd::TimeSpan::FromMilliSeconds(0));
}
s_DrawerThread.Join(); s_DrawerThread.Join();
s_DrawerThread.Finalize(); s_DrawerThread.Finalize();
} }
@ -452,6 +448,7 @@ void NotifyFailed(s32 error)
void NotifyFinished() void NotifyFinished()
{ {
s_IsExpectedToFinalize = true; s_IsExpectedToFinalize = true;
s_NeedShowErrorCode = false;
} }
void ShowError() void ShowError()
@ -568,7 +565,8 @@ DrawThreadMain()
pUpperLayoutAnim = &layoutAnim[upperLayoutAnimIndex.layoutType]; pUpperLayoutAnim = &layoutAnim[upperLayoutAnimIndex.layoutType];
pLowerLayoutAnim = &layoutAnim[lowerLayoutAnimIndex.layoutType]; pLowerLayoutAnim = &layoutAnim[lowerLayoutAnimIndex.layoutType];
nn::os::Tick startTick = nn::os::Tick::GetSystemCurrent(); // ロゴ表示中の待ちフレーム数をカウント
u32 waitCounter = 0;
while (mainloop) while (mainloop)
{ {
padReader.ReadLatest(&padStatus); padReader.ReadLatest(&padStatus);
@ -598,6 +596,7 @@ DrawThreadMain()
{ {
const nw::ut::FloatColor white(1.0f, 1.0f, 1.0f, 1.0f); const nw::ut::FloatColor white(1.0f, 1.0f, 1.0f, 1.0f);
demoApp.GetFrameBufferObject().ClearBuffer(white, clearDepth); demoApp.GetFrameBufferObject().ClearBuffer(white, clearDepth);
waitCounter++;
} }
else else
{ {
@ -678,18 +677,15 @@ DrawThreadMain()
demoApp.SwapBuffer(demoApp.DISPLAY_BOTH); demoApp.SwapBuffer(demoApp.DISPLAY_BOTH);
if(s_NeedShowErrorCode && DRAW_STATE_LOGO_DRAW <= drawState) // ロゴが表示されてからエラー表示を行う
if(s_NeedShowErrorCode && DRAW_STATE_LOGO_DRAW == drawState && 1 < waitCounter)
{ {
if((nn::os::Tick::GetSystemCurrent() - startTick).ToTimeSpan().GetSeconds() > 1) ShowError();
{
ShowError();
}
} }
} }
delete pResAccessor; delete pResAccessor;
demoApp.GetDeviceAllocator().Free(fileLayout.Buffer()); demoApp.GetDeviceAllocator().Free(fileLayout.Buffer());
s_IsPreparedToFinalize = true;
} }

View File

@ -17,7 +17,6 @@
#define DRAWER_H_ #define DRAWER_H_
void StartDrawerThread(); void StartDrawerThread();
bool IsDrawerThreadFinished();
void FinalizeDrawerThread(); void FinalizeDrawerThread();
void NotifyFailed(s32 error); void NotifyFailed(s32 error);
void NotifyFinished(); void NotifyFinished();

View File

@ -201,7 +201,7 @@ extern "C" void nnMain()
// 画面描画 // 画面描画
if (result.IsSuccess() || result == nn::cup::CTR::ResultUpdateNotRequired()) if (result.IsSuccess() || result == nn::cup::CTR::ResultUpdateNotRequired())
{ {
// TODO:成功したので終了処理に入る // 成功したので終了処理に入る
nn::os::Tick current = nn::os::Tick::GetSystemCurrent(); nn::os::Tick current = nn::os::Tick::GetSystemCurrent();
if ((current - before).ToTimeSpan().GetSeconds() > SHUTDOWN_WAIT_SECONDS) if ((current - before).ToTimeSpan().GetSeconds() > SHUTDOWN_WAIT_SECONDS)
{ {