mirror of
https://github.com/rvtr/ctr_Repair.git
synced 2025-10-31 13:51:08 -04:00
ROMFSが含まれていなかったのを修正
エラー発生時にエラーアプレットを呼ぶ 描画の同期が取れない?のでとりあえず1秒待ってからエラー表示 git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@467 385bec56-5757-e545-9c3a-d8741f4650f1
This commit is contained in:
parent
c54cac0ceb
commit
120532553a
@ -23,3 +23,6 @@ SystemControlInfo:
|
||||
- cecd
|
||||
- boss
|
||||
- ndm
|
||||
Rom:
|
||||
# ROM に含めるファイルシステムのルートパスを指定します。
|
||||
HostRoot: "$(ROMFS_ROOT)"
|
||||
|
||||
@ -49,7 +49,7 @@ void DrawThreadMain();
|
||||
namespace
|
||||
{
|
||||
|
||||
const size_t DRAWER_STACK_SIZE = 0x1000;
|
||||
const size_t DRAWER_STACK_SIZE = 0x4000;
|
||||
nn::os::Thread s_DrawerThread;
|
||||
nn::os::StackBuffer<DRAWER_STACK_SIZE> s_DrawerThreadStack;
|
||||
|
||||
@ -59,6 +59,11 @@ bool s_IsExpectedToFinalize = false;
|
||||
// 終了処理が完了したかどうか
|
||||
bool s_IsPreparedToFinalize = false;
|
||||
|
||||
// エラーコード表示が必要かどうか
|
||||
bool s_NeedShowErrorCode = false;
|
||||
// エラーコード
|
||||
s32 s_ErrorCode;
|
||||
|
||||
enum LayoutType
|
||||
{
|
||||
LAYOUT_UPPER_LOGO,
|
||||
@ -440,24 +445,8 @@ void RestoreGraphics()
|
||||
|
||||
void NotifyFailed(s32 error)
|
||||
{
|
||||
nn::applet::AppletWakeupState wstate;
|
||||
nn::erreula::Parameter ere_param; // エラーEULAの設定構造体
|
||||
|
||||
// 設定構造体初期化
|
||||
nn::erreula::InitializeConfig(&ere_param.config);
|
||||
|
||||
ere_param.config.errorType = nn::erreula::ERROR_TYPE_ERROR_CODE;
|
||||
ere_param.config.errorCode = error;
|
||||
ere_param.config.upperScreenFlag = nn::erreula::UPPER_SCREEN_NORMAL;
|
||||
ere_param.config.homeButton = true;
|
||||
ere_param.config.softwareReset = false;
|
||||
ere_param.config.appJump = false;
|
||||
|
||||
nn::erreula::CancelPreloadErrEulaApplet();
|
||||
nn::erreula::StartErrEulaApplet(&wstate, &ere_param);
|
||||
|
||||
// GPU レジスタ設定の復帰
|
||||
RestoreGraphics();
|
||||
s_ErrorCode = error;
|
||||
s_NeedShowErrorCode = true;
|
||||
}
|
||||
|
||||
void NotifyFinished()
|
||||
@ -465,6 +454,27 @@ void NotifyFinished()
|
||||
s_IsExpectedToFinalize = true;
|
||||
}
|
||||
|
||||
void ShowError()
|
||||
{
|
||||
NN_LOG("Show Error\n");
|
||||
nn::applet::AppletWakeupState wstate;
|
||||
nn::erreula::Parameter ere_param; // エラーEULAの設定構造体
|
||||
|
||||
// 設定構造体初期化
|
||||
nn::erreula::InitializeConfig(&ere_param.config);
|
||||
|
||||
ere_param.config.errorType = nn::erreula::ERROR_TYPE_ERROR_CODE;
|
||||
ere_param.config.errorCode = s_ErrorCode;
|
||||
ere_param.config.upperScreenFlag = nn::erreula::UPPER_SCREEN_NORMAL;
|
||||
ere_param.config.homeButton = true;
|
||||
ere_param.config.softwareReset = false;
|
||||
ere_param.config.appJump = false;
|
||||
|
||||
nn::erreula::StartErrEulaApplet(&wstate, &ere_param);
|
||||
|
||||
// GPU レジスタ設定の復帰
|
||||
RestoreGraphics();
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
@brief サンプルのメイン関数です。
|
||||
@ -558,9 +568,7 @@ DrawThreadMain()
|
||||
pUpperLayoutAnim = &layoutAnim[upperLayoutAnimIndex.layoutType];
|
||||
pLowerLayoutAnim = &layoutAnim[lowerLayoutAnimIndex.layoutType];
|
||||
|
||||
const s32 KEEP_FRAME_INTERVAL = 180;
|
||||
s32 keepFrame = KEEP_FRAME_INTERVAL;
|
||||
|
||||
nn::os::Tick startTick = nn::os::Tick::GetSystemCurrent();
|
||||
while (mainloop)
|
||||
{
|
||||
padReader.ReadLatest(&padStatus);
|
||||
@ -632,29 +640,16 @@ DrawThreadMain()
|
||||
{
|
||||
if (drawState < DRAW_STATE_FADE_OUT)
|
||||
{
|
||||
if (!(drawState == DRAW_STATE_LOGO_DRAW && --keepFrame > 0))
|
||||
// 次のアニメーションへ遷移
|
||||
GetNextLayoutAnimationIndex(upperLayoutAnimIndex, drawState, demoApp.DISPLAY0);
|
||||
GetNextLayoutAnimationIndex(lowerLayoutAnimIndex, drawState, demoApp.DISPLAY1);
|
||||
pUpperLayoutAnim = &layoutAnim[upperLayoutAnimIndex.layoutType];
|
||||
pLowerLayoutAnim = &layoutAnim[lowerLayoutAnimIndex.layoutType];
|
||||
|
||||
// 終了処理を依頼されたときのみロゴフェードアウト移行に進む
|
||||
if (drawState < DRAW_STATE_LOGO_DRAW || s_IsExpectedToFinalize)
|
||||
{
|
||||
// 次のアニメーションへ遷移
|
||||
GetNextLayoutAnimationIndex(upperLayoutAnimIndex, drawState, demoApp.DISPLAY0);
|
||||
GetNextLayoutAnimationIndex(lowerLayoutAnimIndex, drawState, demoApp.DISPLAY1);
|
||||
pUpperLayoutAnim = &layoutAnim[upperLayoutAnimIndex.layoutType];
|
||||
pLowerLayoutAnim = &layoutAnim[lowerLayoutAnimIndex.layoutType];
|
||||
|
||||
// 終了処理を依頼されたときのみロゴフェードアウト移行に進む
|
||||
if(drawState < DRAW_STATE_LOGO_DRAW || s_IsExpectedToFinalize)
|
||||
{
|
||||
drawState++;
|
||||
}
|
||||
|
||||
if(drawState == DRAW_STATE_LOGO_FADE_IN)
|
||||
{
|
||||
animFrame = 11.f;
|
||||
}
|
||||
else
|
||||
{
|
||||
animFrame = 0;
|
||||
}
|
||||
|
||||
drawState++;
|
||||
NN_LOG("State = %d\n", drawState);
|
||||
NN_LOG(
|
||||
"Upper: layout: %d, anim: %d\n", upperLayoutAnimIndex.layoutType, upperLayoutAnimIndex.animIndex);
|
||||
@ -662,6 +657,14 @@ DrawThreadMain()
|
||||
"Lower: layout: %d, anim: %d\n\n", lowerLayoutAnimIndex.layoutType, lowerLayoutAnimIndex.animIndex);
|
||||
}
|
||||
|
||||
if (drawState == DRAW_STATE_LOGO_FADE_IN)
|
||||
{
|
||||
animFrame = 11.f;
|
||||
}
|
||||
else
|
||||
{
|
||||
animFrame = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -672,7 +675,16 @@ DrawThreadMain()
|
||||
|
||||
pUpperLayoutAnim->pAnimTrans[upperLayoutAnimIndex.animIndex]->SetFrame(animFrame);
|
||||
pLowerLayoutAnim->pAnimTrans[lowerLayoutAnimIndex.animIndex]->SetFrame(animFrame);
|
||||
|
||||
demoApp.SwapBuffer(demoApp.DISPLAY_BOTH);
|
||||
|
||||
if(s_NeedShowErrorCode && DRAW_STATE_LOGO_DRAW <= drawState)
|
||||
{
|
||||
if((nn::os::Tick::GetSystemCurrent() - startTick).ToTimeSpan().GetSeconds() > 1)
|
||||
{
|
||||
ShowError();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
delete pResAccessor;
|
||||
|
||||
@ -194,8 +194,6 @@ extern "C" void nnMain()
|
||||
// TODO:HOMEメニューが無いエラーをエラーアプレットで表示する
|
||||
}
|
||||
|
||||
NotifyFinished();
|
||||
|
||||
nn::os::Tick before = nn::os::Tick::GetSystemCurrent();
|
||||
const u8 SHUTDOWN_WAIT_SECONDS = 2;
|
||||
for(;;)
|
||||
@ -207,6 +205,7 @@ extern "C" void nnMain()
|
||||
nn::os::Tick current = nn::os::Tick::GetSystemCurrent();
|
||||
if ((current - before).ToTimeSpan().GetSeconds() > SHUTDOWN_WAIT_SECONDS)
|
||||
{
|
||||
NotifyFinished();
|
||||
break;
|
||||
}
|
||||
|
||||
@ -222,6 +221,7 @@ extern "C" void nnMain()
|
||||
nn::applet::PrepareToCloseApplication();
|
||||
nn::applet::CloseApplication();
|
||||
}
|
||||
nn::os::Thread::Sleep(nn::fnd::TimeSpan::FromMilliSeconds(16));
|
||||
}
|
||||
|
||||
FinalizeDrawerThread();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user