diff --git a/build/debugsoft/AppJumpChecker/Makefile b/build/debugsoft/AppJumpChecker/Makefile index f45cd022..26612bce 100644 --- a/build/debugsoft/AppJumpChecker/Makefile +++ b/build/debugsoft/AppJumpChecker/Makefile @@ -12,8 +12,8 @@ # in whole or in part, without the prior written consent of Nintendo. # # $Date:: $ -# $Rev:$ -# $Author:$ +# $Rev$ +# $Author$ #---------------------------------------------------------------------------- override TARGET_PLATFORM = TWL override TARGET_CODEGEN = ARM @@ -22,7 +22,7 @@ override TWL_ARCHGEN = LIMITED TWL_NANDAPP = TRUE TARGET_BIN = appJumpChecker.tad -INCDIR = ./include +INCDIR = ./include $(ROOT)/build/libraries/os/common/include SRCDIR = ./src SRCS = main.c screen.c font.c common.c @@ -50,6 +50,7 @@ ROM_SPEC_PARAM = MakerCode=01 \ NANDAccess=TRUE \ Media=NAND \ Secure=TRUE \ + BannerFile=appjumpchecker.bnr \ PermitLandingNormalJump=TRUE \ WramMapping=MAP_TS_SCR diff --git a/build/debugsoft/AppJumpChecker/appjumpchecker.bnr b/build/debugsoft/AppJumpChecker/appjumpchecker.bnr new file mode 100644 index 00000000..de53082b Binary files /dev/null and b/build/debugsoft/AppJumpChecker/appjumpchecker.bnr differ diff --git a/build/debugsoft/AppJumpChecker/include/common.h b/build/debugsoft/AppJumpChecker/include/common.h index 8fb3a4cc..a0d79755 100644 --- a/build/debugsoft/AppJumpChecker/include/common.h +++ b/build/debugsoft/AppJumpChecker/include/common.h @@ -29,17 +29,9 @@ extern "C" { 定数定義 *---------------------------------------------------------------------------*/ -/* TitleID */ -#define CARDAPP_TITLEID (u64)(0x0003000034333041) // 430A -#define NANDAPP1_TITLEID (u64)(0x0003000434333141) // 431A -#define NANDAPP2_TITLEID (u64)(0x0003000434333241) // 432A - #define KEY_REPEAT_START 25 // キーリピート開始までのフレーム数 #define KEY_REPEAT_SPAN 10 // キーリピートの間隔フレーム数 -/* アプリ間パラメータ関連 */ -#define APPJUMP_STRING_LENGTH 24 // 引数一つ分として受け渡しされる文字列の長さ制限 - /*---------------------------------------------------------------------------* 構造体 定義 *---------------------------------------------------------------------------*/ @@ -53,14 +45,6 @@ typedef struct KeyInfo u16 rep; // 押し維持リピート入力 } KeyInfo; -// アプリ間でバイナリデータとして引き渡す構造体 -typedef struct AppParam -{ - u32 jumpCount; // アプリジャンプの実行回数 - u8 isAutoJump; // 一定間隔で自動的にアプリジャンプを実行するかどうかのフラグ - u8 rsv[3]; // 4バイトアラインメントのため -} AppParam; - /*---------------------------------------------------------------------------* Prototype *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/AppJumpChecker/src/main.c b/build/debugsoft/AppJumpChecker/src/main.c index dce82b0e..94da5db9 100644 --- a/build/debugsoft/AppJumpChecker/src/main.c +++ b/build/debugsoft/AppJumpChecker/src/main.c @@ -17,6 +17,7 @@ #include #include +#include "application_jump_private.h" #include "common.h" #include "screen.h" @@ -173,7 +174,18 @@ void TwlMain(void) // 内部関数を使用したアプリジャンプの実行 if (gKey.trg & PAD_BUTTON_B) { + LauncherBootFlags flag; + flag.bootType = LAUNCHER_BOOTTYPE_NAND; + flag.isValid = TRUE; + flag.isLogoSkip = TRUE; + flag.isInitialShortcutSkip = FALSE; + flag.isAppLoadCompleted = FALSE; + flag.isAppRelocate = FALSE; + flag.rsv = 0; + OS_SetLauncherParamAndResetHardware(dataList[gCurPos].id, &flag); + // 成功時はここ以降は実行されない + PrintErrMsg("Failed to App Jump(force)."); } // カードアプリへのアプリジャンプ試行 @@ -285,7 +297,7 @@ static BOOL GetDataStruct(DataStruct* list) static void DrawScene(DataStruct* list) { s32 i; - u8 init_code[5]; + u8 init_code[5], titleid_lo[5]; // 上画面 PutMainScreen( 0, 1, 0xff, " ------ App Jump Checker ------ "); @@ -295,12 +307,13 @@ static void DrawScene(DataStruct* list) PutMainScreen( 0, 5, 0xff, " ------------------------------ "); PutMainScreen( 0, 7, 0xff, " A : try App Jump (to NAND)" ); - PutMainScreen( 0, 8, 0xff, " Y : try App Jump (to CARD)" ); - PutMainScreen( 0, 10, 0xff, " UP ,DOWN ,LEFT ,RIGHT KEY :" ); - PutMainScreen( 0, 11, 0xff, " move * (cursor) "); - PutMainScreen( 0, 13, 0xff, " ------------------------------ "); + PutMainScreen( 0, 8, 0xfe, " B : try App Jump (force) " ); + PutMainScreen( 0, 9, 0xff, " Y : try App Jump (to CARD)" ); + PutMainScreen( 0, 11, 0xff, " UP ,DOWN ,LEFT ,RIGHT KEY :" ); + PutMainScreen( 0, 12, 0xff, " move * (cursor) "); + PutMainScreen( 0, 14, 0xff, " ------------------------------ "); - PutMainScreen( 0, 15, 0xf1, "%s", gErrBuf); + PutMainScreen( 0, 16, 0xf1, "%s", gErrBuf); // 下画面 PutSubScreen( 0, 0, 0xf4, " NAND ( max 36 )"); @@ -329,7 +342,7 @@ static void DrawScene(DataStruct* list) } // カードアプリチェック - PutSubScreen( 0, 2 + TITLE_NUM_CUL + 1, 0xf4, " CARD"); + PutSubScreen( 0, 2 + TITLE_NUM_CUL + 1, 0xf4, " CARD: Init. Code, TitleID_Lo"); { CARDRomHeader* rh; rh = (CARDRomHeader*)CARD_GetRomHeader(); @@ -339,32 +352,36 @@ static void DrawScene(DataStruct* list) // イニシャルコードの取得 if ( rh->product_id & 0x03 || rh->product_id & 0x02 ) // 刺さっているカードのロムが TWLアプリ { - ROM_Header_Short* rhs; - rhs = (ROM_Header_Short*)HW_TWL_CARD_ROM_HEADER_BUF; // CARD_GetRomHeader(); - -// rh = (CARDRomHeader*)HW_TWL_CARD_ROM_HEADER_BUF; + ROM_Header* rh2; + rh2 = (ROM_Header*)HW_TWL_CARD_ROM_HEADER_BUF; - // ROM ヘッダの拡張領域までイニシャルコードを見に行く - // 未マスタリング状態のロムでは、ROM ヘッダ(共通部)のイニシャルコードへ - // 設定が反映されない - ConvertTitleIdLo(init_code, rhs->titleID_Lo); -// ConvertGameCode(init_code, rh->game_code); + // ROM ヘッダの拡張領域まで TitleID_Lo を見に行く + // ROM ヘッダ(共通部)のイニシャルコードは基本的に製品版に入れられる +// ConvertTitleIdLo(titleid_lo, rh2->s.titleID_Lo); + MI_CpuCopy8( rh2->s.titleID_Lo, titleid_lo, 4 ); + titleid_lo[4] = 0x00; + MI_CpuCopy8( rh2->s.game_code, init_code, 4 ); } else // 刺さっているカードのロムが NTRアプリ { // 未マスタリング状態のロムでは、ROM ヘッダ(共通部)のイニシャルコードへ // 設定が反映されない + + // 特別に設定された NTRアプリなら TitleID_Lo が設定されている可能性があるので読み込んでみる + MI_CpuClear8( titleid_lo, 5 ); + MI_CpuCopy8( ((ROM_Header*)rh)->s.titleID_Lo, titleid_lo, 4 ); + titleid_lo[4] = 0x00; ConvertGameCode(init_code, rh->game_code); } // ノーマルジャンプを許可しているかどうかを取得 if ( rh->reserved_A[8] & 0x80 ) { - PutSubScreen( 0, 2 + TITLE_NUM_CUL + 2, 0xf2, " %s : o", init_code ); + PutSubScreen( 0, 2 + TITLE_NUM_CUL + 2, 0xf2, " %s, %s : o", init_code, titleid_lo ); } else { - PutSubScreen( 0, 2 + TITLE_NUM_CUL + 2, 0xff, " %s : -", init_code ); + PutSubScreen( 0, 2 + TITLE_NUM_CUL + 2, 0xff, " %s, %s : -", init_code, titleid_lo ); } } else @@ -390,8 +407,6 @@ static void ConvertTitleIdLo(u8* code, u8* titleid_lo) { tmp[i] = *titleid_lo; *code = tmp[i]; - -// *code = *titleid_lo; } // *code = tmp; diff --git a/debugsoft/AppJumpChecker/appJumpChecker.tad b/debugsoft/AppJumpChecker/appJumpChecker.tad index 0bd60ecf..1e972b4e 100644 Binary files a/debugsoft/AppJumpChecker/appJumpChecker.tad and b/debugsoft/AppJumpChecker/appJumpChecker.tad differ