MMENがあるときのみ実行するように

git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@291 385bec56-5757-e545-9c3a-d8741f4650f1
This commit is contained in:
N2614 2011-05-31 00:53:00 +00:00
parent dff70c8bf8
commit 9605e06793
3 changed files with 27 additions and 8 deletions

View File

@ -32,7 +32,7 @@ LIBS += lib_demo \
libnn_ps
DESCRIPTOR = $(HORIZON_ROOT)/resources/specfiles/HomeMenuTest.desc
DESCRIPTOR = $(HORIZON_ROOT)/resources/specfiles/SelfCup.desc
TARGET_PROGRAM = CardCup

4
trunk/CardCup/Readme.txt Normal file
View File

@ -0,0 +1,4 @@
■ビルド環境
・SDK
Horizon 0.14.23 branch r33437 +
Horizon 2.3 branch r38091 SelfCup.descをコピー

View File

@ -24,6 +24,7 @@
#include <nn/fs/fs_FileSystemBase.h>
#include <nn/fs/CTR/MPCore/fs_FileSystemBasePrivate.h>
#include <nn/applet/CTR/applet_APIForSystem.h>
#include <nn/am.h>
#include <nn/cup.h>
@ -51,6 +52,9 @@ namespace
// NuiShellの初期化 (CUPに必須)
NN_UTIL_PANIC_IF_FAILED(nn::ns::CTR::InitializeForShell());
// amの初期化
nn::am::InitializeForSystemMenu();
// fsの初期化 (カード確認用)
nn::fs::Initialize();
@ -221,17 +225,28 @@ extern "C" void nnMain()
nn::Result result;
Initialize();
/******************** CUPの実行 *******************/
bool isHandledError = false;
result = UpdateSequence(&isHandledError);
if (isHandledError == false && result.IsFailure())
nn::am::ProgramInfo outInfos;
const nn::ProgramId MMEN_PROGRAM_ID = 0x0004003000008202;
result = nn::am::GetProgramInfos(&outInfos, nn::fs::MEDIA_TYPE_NAND, &MMEN_PROGRAM_ID, 1);
if (result.IsSuccess())
{
/******************** CUPの実行 *******************/
bool isHandledError = false;
result = UpdateSequence(&isHandledError);
if (isHandledError == false && result.IsFailure())
{
// それ以外の場合は、Resultを表示
s_scrollBuffer->AppendText(" - Unhandled Error: 0x%08x", result.GetPrintableBits());
s_scrollBuffer->AppendText("")->Render();
{
// それ以外の場合は、Resultを表示
s_scrollBuffer->AppendText(" - Unhandled Error: 0x%08x", result.GetPrintableBits());
s_scrollBuffer->AppendText("")->Render();
}
}
}
else if(result == nn::am::ResultNotFound())
{
s_scrollBuffer->AppendText("Cannot find Home Menu");
}
s_scrollBuffer->AppendText("")->Render();