diff --git a/build/debugsoft/TMPJump/AppforFailedTmpJump/Makefile b/build/debugsoft/TMPJump/AppforFailedTmpJump/Makefile new file mode 100644 index 00000000..1d9fbeaa --- /dev/null +++ b/build/debugsoft/TMPJump/AppforFailedTmpJump/Makefile @@ -0,0 +1,58 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - tests - tmpjumpTest - AppforFailedTmpJump +# File: Makefile +# + +# Copyright 2008 Nintendo. All rights reserved. +# +# These coded instructions, statements, and computer programs contain +# proprietary information of Nintendo of America Inc. and/or Nintendo +# Company Ltd., and are protected by Federal copyright law. They may +# not be disclosed to third parties or copied or duplicated in any form, +# in whole or in part, without the prior written consent of Nintendo. +# +# $Date:: $ +# $Rev:$ +# $Author:$ +#---------------------------------------------------------------------------- + +override TARGET_CODEGEN = ARM +TWL_ARCHGEN = LIMITED + +TWL_NANDAPP = TRUE + +TARGET_BIN = Test_$(TARGET_PLATFORM)fail.srl + +INCDIR = ../include +SRCDIR = ../src +SRCS = common.c font.c screen.c main_f.c + +MAKEROM_ROMROOT = ../data +MAKEROM_ROMFILES = dummy.srl + +#---------------------------------------------------------------------------- +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +ifeq ($(TARGET_PLATFORM),TWL) +ROM_SPEC = main_459a.rsf +# LIBSYSCALL = ../459A/libsyscall.a + +endif + +ifeq ($(TARGET_PLATFORM),NITRO) +ROM_SPEC = main_458a.rsf +# LIBSYSCALL = ../458A/libsyscall.a + +endif + +INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN) +INSTALL_DIR = ../data + +#---------------------------------------------------------------------------- + +do-build: $(TARGETS) + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +#===== End of Makefile ===== diff --git a/build/debugsoft/TMPJump/AppforFailedTmpJump/main_458a.rsf b/build/debugsoft/TMPJump/AppforFailedTmpJump/main_458a.rsf new file mode 100644 index 00000000..fb130ad4 --- /dev/null +++ b/build/debugsoft/TMPJump/AppforFailedTmpJump/main_458a.rsf @@ -0,0 +1,103 @@ +#---------------------------------------------------------------------------- +# Project: TwlSDK - include +# File: ROM-TS.rsf +# +# Copyright 2007 Nintendo. All rights reserved. +# +# These coded insructions, statements, and computer programs contain +# proprietary information of Nintendo of America Inc. and/or Nintendo +# Company Ltd., and are protected by Federal copyright law. They may +# not be disclosed to third parties or copied or duplicated in any form, +# in whole or in part, without the prior written consent of Nintendo. +# +# $Date:: $ +# $Rev:$ +# $Author:$ +#---------------------------------------------------------------------------- +# +# Nitro ROM SPEC FILE +# + +Arm9 +{ + Static "$(MAKEROM_ARM9:r).sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.sbin$(COMPSUFFIX9)" + Elf "$(MAKEROM_ARM9:r).nef" +} + +Arm7 +{ + Static "$(MAKEROM_ARM7:r).sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7:r)_defs.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7:r)_table.sbin$(COMPSUFFIX7)" + Elf "$(MAKEROM_ARM7:r).nef" +} + +Property +{ + ### + ### Settings for FinalROM + ### + #### BEGIN + # + # TITLE NAME: Your product name within 12bytes + # + TitleName TJmpTest_NF + + # + # MAKER CODE: Your company ID# in 2 ascii words + # issued by NINTENDO + # + MakerCode 01 + + # + # REMASTER VERSION: Mastering version + # + RomVersion 0 + + # + # ROM SPEED TYPE: [MROM/1TROM/UNDEFINED] + # + RomSpeedType $(MAKEROM_ROMSPEED) + + # + # ROM SIZE: in bit [64M/128M/256M/512M/1G/2G] + # + #RomSize 128M + #RomSize 256M + + # + # ROM PADDING: TRUE if finalrom + # + #RomFootPadding TRUE + + # + # ROM HEADER TEMPLATE: Provided to every product by NINTENDO + # +# RomHeaderTemplate ../458A/rom_header_458a.template.sbin + + # + # BANNER FILE: generated from Banner Spec File + # + BannerFile "../banner/banner.bnr" + + # + # Permit TmpJump: for TWL "ApplicationJump" function + # + PermitTmpJump FALSE + + ### + ### + ### + #### END +} + +RomSpec +{ + Offset 0x00000000 + Segment ALL + HostRoot $(MAKEROM_ROMROOT) + Root / + File $(MAKEROM_ROMFILES) +} diff --git a/build/debugsoft/TMPJump/AppforFailedTmpJump/main_459a.rsf b/build/debugsoft/TMPJump/AppforFailedTmpJump/main_459a.rsf new file mode 100644 index 00000000..5d4cf652 --- /dev/null +++ b/build/debugsoft/TMPJump/AppforFailedTmpJump/main_459a.rsf @@ -0,0 +1,248 @@ +#---------------------------------------------------------------------------- +# Project: TwlSDK - include +# File: ROM-TS.rsf +# +# Copyright 2007 Nintendo. All rights reserved. +# +# These coded insructions, statements, and computer programs contain +# proprietary information of Nintendo of America Inc. and/or Nintendo +# Company Ltd., and are protected by Federal copyright law. They may +# not be disclosed to third parties or copied or duplicated in any form, +# in whole or in part, without the prior written consent of Nintendo. +# +# $Date:: $ +# $Rev:$ +# $Author:$ +#---------------------------------------------------------------------------- +# +# TWL ROM SPEC FILE +# + +Arm9 +{ + Static "$(MAKEROM_ARM9:r).TWL.FLX.sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.FLX.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.FLX.sbin$(COMPSUFFIX9)" + Elf "$(MAKEROM_ARM9:r).tef" +} + +Arm7 +{ + Static "$(MAKEROM_ARM7_BASE:r).TWL.FLX.sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.FLX.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.FLX.sbin$(COMPSUFFIX7)" + Elf "$(MAKEROM_ARM7_BASE:r).tef" +} + +Arm9.Ltd +{ + Static "$(MAKEROM_ARM9:r).TWL.LTD.sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.LTD.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.LTD.sbin$(COMPSUFFIX9)" +} + +Arm7.Ltd +{ + Static "$(MAKEROM_ARM7_BASE:r).TWL.LTD.sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.LTD.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.LTD.sbin$(COMPSUFFIX7)" +} + +Property +{ + ### + ### Settings for FinalROM + ### + #### BEGIN + # + # TITLE NAME: Your product name within 12bytes + # + TitleName TmpJmpTest_L + + # + # MAKER CODE: Your company ID# in 2 ascii words + # issued by NINTENDO + # + MakerCode 01 + + # + # REMASTER VERSION: Mastering version + # + RomVersion 0 + + # + # ROM SPEED TYPE: [MROM/1TROM/UNDEFINED] + # + RomSpeedType $(MAKEROM_ROMSPEED) + + # + # ROM SIZE: in bit [64M/128M/256M/512M/1G/2G/4G] + # + #RomSize 256M + + # + # ROM PADDING: TRUE if finalrom + # + #RomFootPadding TRUE + + # + # ROM HEADER TEMPLATE: Provided to every product by NINTENDO + # +# RomHeaderTemplate ../459A/rom_header_435a.template.sbin + + # + # BANNER FILE: generated from Banner Spec File + # + BannerFile "../banner/banner.bnr" + + # + # Permit LandingNormalJump: for TWL "ApplicationJump" function [TRUE/FALSE] + # + #PermitLandingNormalJump FALSE + + # + # Permit LandingTmpJump: for TWL "ApplicationJump" function [TRUE/FALSE] + # + PermitLandingTmpJump FALSE + + ### + ### Setting for TWL + ### + + # + # ROM HEADER Ltd: Provided to every product by NINTENDO + # + RomHeaderLtd $(TWLSDK_ROOT)/tools/bin/rom_header.LTD.sbin + + # + # Digest parameters: + # + DigestParam 1024 32 + + # + # WRAM mapping: [MAP_BB_HYB/MAP_BB_LTD/MAP_TS_HYB/MAP_TS_LTD + # MAP2_BB_HYB/MAP2_BB_LTD/MAP2_TS_HYB/MAP2_TS_LTD] + # don't have to edit + # + WramMapping $(MAKEROM_WRAM_MAPPING) + + # + # CardRegion: card region [Japan/America/Europe/Australia/China/Korea] + # + CardRegion ALL + + # + # NANDAccess: NAND access control [TRUE/FALSE] + # + NANDAccess TRUE + + # + # Codec mode: + # don't have to edit + # + CodecMode $(MAKEROM_CODEC_MODE) + + # + # Disp WiFiConnection Icon for Launcher [TRUE/FALSE] + # + #WiFiConnectionIcon FALSE + + # + # Disp DSWireless Icon for Launcher [TRUE/FALSE] + # + #DSWirelessIcon FALSE + + # + # Agree EULA [TRUE/FALSE] + # + #AgreeEULA FALSE + + # + # Agree EULA version [1 - 255] + # + #AgreeEULAVersion 1 + + ### + #### END +} + +AppendProperty +{ + # + # Boot allowed Media: [GameCard] + # + Media NAND + + # + # GameCode for TitleID : Your GameCode in 4 ascii words + # + GameCode 459A + + # + # Public save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M] + # + #PublicSaveDataSize 0K + + # + # Private save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M] + # + #PrivateSaveDataSize 0K + + # + # Enable SubBannerFile + #SubBannerFile TRUE + + # + # Game card power on: [TRUE/FALSE] + # + #GameCardOn FALSE + + # + # Game card transferd to nitro mode: [TRUE/FALSE] + # + #GameCardNitroMode FALSE +} + +RomSpec +{ + Offset 0x00000000 + Segment ALL + HostRoot $(MAKEROM_ROMROOT) + Root / + File $(MAKEROM_ROMFILES) +} + +Rating +{ + # + # Permited age to play for each rating organization + # + # Supported organization + # - CERO (OGN0) : for Japan + # - ESRB (OGN1) : for North America + # - BBFC (OGN2) : obsolete organization + # - USK (OGN3) : for German + # - PEGI_GEN (OGN4) : for Europe + # - PEGI_FINLAND (OGN5) : obsolete organization + # - PEGI_PRT (OGN6) : for Portugal + # - PEGI_BBFC (OGN7) : for UK + # - OFLC (OGN8) : for Australia and NewZealand + # - GRB (OGN9) : for Korea + # - OGN10 : reserved + # - OGN11 : reserved + # - OGN12 : reserved + # - OGN13 : reserved + # - OGN14 : reserved + # - OGN15 : reserved + # + # Available age [ 0 - 31 / PENDING / FREE ] + + CERO FREE +# ESRB FREE +# USK FREE +# PEGI_GEN FREE +# PEGI_PRT FREE +# PEGI_BBFC FREE +# OFLC FREE +# GRB FREE +} diff --git a/build/debugsoft/TMPJump/AppforTmpJump/main.c b/build/debugsoft/TMPJump/AppforFailedTmpJump/main_f.c similarity index 61% rename from build/debugsoft/TMPJump/AppforTmpJump/main.c rename to build/debugsoft/TMPJump/AppforFailedTmpJump/main_f.c index a236888c..334c4500 100644 --- a/build/debugsoft/TMPJump/AppforTmpJump/main.c +++ b/build/debugsoft/TMPJump/AppforFailedTmpJump/main_f.c @@ -11,8 +11,8 @@ in whole or in part, without the prior written consent of Nintendo. $Date:: $ - $Rev$ - $Author$ + $Rev:$ + $Author:$ *---------------------------------------------------------------------------*/ #ifdef SDK_TWL @@ -24,12 +24,17 @@ #include "common.h" #include "screen.h" +#define DMA_NO_FS 1 + /*---------------------------------------------------------------------------* 変数 定義 *---------------------------------------------------------------------------*/ // キー入力 static KeyInfo gKey; +static const char gRomPath[32] = "rom:/dummy.srl"; +static u64 gTargetId = 0x0003000434333441; + /*---------------------------------------------------------------------------* Prototype *---------------------------------------------------------------------------*/ @@ -45,6 +50,8 @@ void NitroMain(void) InitCommon(); InitScreen(); + FS_Init(DMA_NO_FS); + GX_DispOn(); GXS_DispOn(); @@ -57,6 +64,52 @@ void NitroMain(void) { ReadKey(&gKey); + if (gKey.trg & PAD_BUTTON_A) + { +#ifdef SDK_TWL + BOOL success = TRUE; + FSFile src, dest; + void *buf; + s32 len = 0; + + // srl を NAND 上の OS_TMP_APP_PATH へコピー + FS_DeleteFile(OS_TMP_APP_PATH); + FS_CreateFile(OS_TMP_APP_PATH, FS_PERMIT_R | FS_PERMIT_W); + FS_InitFile( &src ); + FS_InitFile( &dest ); + if ( !FS_OpenFileEx( &src, gRomPath, FS_FILEMODE_R ) ) success = FALSE; + len = (s32)FS_GetFileLength( &src ); + + buf = OS_AllocFromMain((u32)len); + if (buf == NULL) + { + success = FALSE; + break; + } + + if ( -1 == FS_ReadFile( &src, buf, len ) ) + { + success = FALSE; + break; + } + + if ( !FS_CloseFile( &src ) ) success = FALSE; + + if ( !FS_OpenFileEx( &dest, OS_TMP_APP_PATH, FS_FILEMODE_W ) ) success = FALSE; + if ( -1 == FS_WriteFile( &dest, buf, len ) ) success = FALSE; + if ( !FS_CloseFile( &dest ) ) success = FALSE; + + if ( !success ) break; + + // TMP ジャンプを試みる + if ( !OS_DoApplicationJump( gTargetId, OS_APP_JUMP_TMP) ) + { + PutSubScreen(1, 10, 0xf1, "ERROR!: Failed to TMP jump"); + } + break; +#endif + } + if (gKey.trg & PAD_BUTTON_B) { #ifdef SDK_TWL @@ -82,6 +135,7 @@ static void DrawMainScene(void) { PutMainScreen(1, 1, 0xf2, "Application on tmp dir"); #ifdef SDK_TWL + PutMainScreen(1, 18, 0xff, "A : try TMP jump"); PutMainScreen(1, 20, 0xff, "B : Return to Main App"); #else PutMainScreen(1, 20, 0xf8, "Can not return to Main (OK)"); diff --git a/build/debugsoft/TMPJump/AppforTmpJump/Makefile b/build/debugsoft/TMPJump/AppforTmpJump/Makefile index 08f139b7..402d7daf 100644 --- a/build/debugsoft/TMPJump/AppforTmpJump/Makefile +++ b/build/debugsoft/TMPJump/AppforTmpJump/Makefile @@ -20,11 +20,16 @@ override TARGET_CODEGEN = ARM TWL_ARCHGEN = ALL +TWL_NANDAPP = TRUE + TARGET_BIN = TestApp$(TEST_ARCH).srl INCDIR = ../include SRCDIR = ./ ../src -SRCS = common.c font.c screen.c main.c +SRCS = common.c font.c screen.c main_2.c + +MAKEROM_ROMROOT = ../data +MAKEROM_ROMFILES = dummy.srl #---------------------------------------------------------------------------- include $(TWLSDK_ROOT)/build/buildtools/commondefs diff --git a/build/debugsoft/TMPJump/AppforTmpJump/main_2.c b/build/debugsoft/TMPJump/AppforTmpJump/main_2.c new file mode 100644 index 00000000..334c4500 --- /dev/null +++ b/build/debugsoft/TMPJump/AppforTmpJump/main_2.c @@ -0,0 +1,162 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - tests - tmpjumpTest - AppforTmpJump + File: main.c + + Copyright 2008 Nintendo. All rights reserved. + + These coded instructions, statements, and computer programs contain + proprietary information of Nintendo of America Inc. and/or Nintendo + Company Ltd., and are protected by Federal copyright law. They may + not be disclosed to third parties or copied or duplicated in any form, + in whole or in part, without the prior written consent of Nintendo. + + $Date:: $ + $Rev:$ + $Author:$ + *---------------------------------------------------------------------------*/ + +#ifdef SDK_TWL +#include +#else +#include +#endif + +#include "common.h" +#include "screen.h" + +#define DMA_NO_FS 1 + +/*---------------------------------------------------------------------------* + 変数 定義 + *---------------------------------------------------------------------------*/ +// キー入力 +static KeyInfo gKey; + +static const char gRomPath[32] = "rom:/dummy.srl"; +static u64 gTargetId = 0x0003000434333441; + +/*---------------------------------------------------------------------------* + Prototype + *---------------------------------------------------------------------------*/ +static void DrawMainScene(void); +void VBlankIntr(void); + +#ifdef SDK_TWL +void TwlMain(void) +#else +void NitroMain(void) +#endif +{ + InitCommon(); + InitScreen(); + + FS_Init(DMA_NO_FS); + + GX_DispOn(); + GXS_DispOn(); + + ClearScreen(); + + // 一度空読み + ReadKey(&gKey); + + while(TRUE) + { + ReadKey(&gKey); + + if (gKey.trg & PAD_BUTTON_A) + { +#ifdef SDK_TWL + BOOL success = TRUE; + FSFile src, dest; + void *buf; + s32 len = 0; + + // srl を NAND 上の OS_TMP_APP_PATH へコピー + FS_DeleteFile(OS_TMP_APP_PATH); + FS_CreateFile(OS_TMP_APP_PATH, FS_PERMIT_R | FS_PERMIT_W); + FS_InitFile( &src ); + FS_InitFile( &dest ); + if ( !FS_OpenFileEx( &src, gRomPath, FS_FILEMODE_R ) ) success = FALSE; + len = (s32)FS_GetFileLength( &src ); + + buf = OS_AllocFromMain((u32)len); + if (buf == NULL) + { + success = FALSE; + break; + } + + if ( -1 == FS_ReadFile( &src, buf, len ) ) + { + success = FALSE; + break; + } + + if ( !FS_CloseFile( &src ) ) success = FALSE; + + if ( !FS_OpenFileEx( &dest, OS_TMP_APP_PATH, FS_FILEMODE_W ) ) success = FALSE; + if ( -1 == FS_WriteFile( &dest, buf, len ) ) success = FALSE; + if ( !FS_CloseFile( &dest ) ) success = FALSE; + + if ( !success ) break; + + // TMP ジャンプを試みる + if ( !OS_DoApplicationJump( gTargetId, OS_APP_JUMP_TMP) ) + { + PutSubScreen(1, 10, 0xf1, "ERROR!: Failed to TMP jump"); + } + break; +#endif + } + + if (gKey.trg & PAD_BUTTON_B) + { +#ifdef SDK_TWL + // メインアプリへ戻る + if ( !OS_ReturnToPrevApplication() ) + { + PutSubScreen(1, 10, 0xf1, "ERROR!: Failed to return jump"); + } + break; +#endif + } + + DrawMainScene(); + + OS_WaitVBlankIntr(); + } + + OS_WaitVBlankIntr(); + OS_Terminate(); +} + +static void DrawMainScene(void) +{ + PutMainScreen(1, 1, 0xf2, "Application on tmp dir"); +#ifdef SDK_TWL + PutMainScreen(1, 18, 0xff, "A : try TMP jump"); + PutMainScreen(1, 20, 0xff, "B : Return to Main App"); +#else + PutMainScreen(1, 20, 0xf8, "Can not return to Main (OK)"); +#endif +} + +/*---------------------------------------------------------------------------* + Name: VBlankIntr + + Description: Vブランク割込みハンドラ。 + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +void VBlankIntr(void) +{ + // テキスト表示を更新 + UpdateScreen(); + + // IRQ チェックフラグをセット + OS_SetIrqCheckFlag(OS_IE_V_BLANK); +} + diff --git a/build/debugsoft/TMPJump/AppforTmpJump/main_434a.rsf b/build/debugsoft/TMPJump/AppforTmpJump/main_434a.rsf index e6a3b9f2..70118126 100644 --- a/build/debugsoft/TMPJump/AppforTmpJump/main_434a.rsf +++ b/build/debugsoft/TMPJump/AppforTmpJump/main_434a.rsf @@ -171,7 +171,7 @@ AppendProperty # # Boot allowed Media: [GameCard] # - Media GameCard + Media NAND # # GameCode for TitleID : Your GameCode in 4 ascii words diff --git a/build/debugsoft/TMPJump/AppforTmpJump/main_435a.rsf b/build/debugsoft/TMPJump/AppforTmpJump/main_435a.rsf index 2ff23136..bc264e1e 100644 --- a/build/debugsoft/TMPJump/AppforTmpJump/main_435a.rsf +++ b/build/debugsoft/TMPJump/AppforTmpJump/main_435a.rsf @@ -171,7 +171,7 @@ AppendProperty # # Boot allowed Media: [GameCard] # - Media GameCard + Media NAND # # GameCode for TitleID : Your GameCode in 4 ascii words diff --git a/build/debugsoft/TMPJump/Makefile b/build/debugsoft/TMPJump/Makefile index 0a1dff04..36ff14fe 100644 --- a/build/debugsoft/TMPJump/Makefile +++ b/build/debugsoft/TMPJump/Makefile @@ -68,7 +68,9 @@ SRCS = main.c common.c screen.c font.c MAKEROM_ROMROOT = ./data MAKEROM_ROMFILES = TestApp.srl \ TestApp_HYBRID.srl \ - TestApp_LIMITED.srl + TestApp_LIMITED.srl \ + Test_NITROfail.srl \ + Test_TWLfail.srl #---------------------------------------------------------------------------- include $(TWLSDK_ROOT)/build/buildtools/commondefs diff --git a/build/debugsoft/TMPJump/ReadMe.txt b/build/debugsoft/TMPJump/ReadMe.txt index 61965e8b..b233c4d1 100644 --- a/build/debugsoft/TMPJump/ReadMe.txt +++ b/build/debugsoft/TMPJump/ReadMe.txt @@ -4,29 +4,52 @@ tmpjumpTest ======================================================== <概要> =============================================== -このテストでは、以下の5つのアプリを使用します。 +このテストでは、以下の 7つのアプリを使用します。 --------------------------------------------------------- address | GameCode | Media | --------------------------------+-----------+-----------+ data/TestApp.srl | 433A | GameCard | data/TestApp_HYBRID.srl | 434A | GameCard | -data/TestApp_LIMITED.srl | 435A | GameCard | -bin/.../tmpjumpTest.srl | 436A | GameCard | +data/TestApp_LIMITED.srl | 435A | GameCard | tmp 格納用 ROM +data/TestApp_NTR_fail.srl | 458A | GameCard | +data/TestApp_TWL_fail.srl | 459A | GameCard | +--------------------------------------------------------- +bin/.../tmpjumpTest.srl | 436A | GameCard | 起動用 ROM bin/.../tmpjumpTest.nand.tad | 437A | NAND | --------------------------------------------------------- +上の 5つのアプリは、下 2つのアプリに埋め込まれています。 + <使い方> ============================================= -まず、フラッシュカードに書き込んだ 436A または インポートした 437A を起動します。 +まず、「フラッシュカードに書き込んだ 436A」または「インポートした 437A」を起動します。 436A, 437A では、選択したアプリを NAND の /tmp 以下へコピーし、TMPジャンプを実行します。 TMP ジャンプ先のアプリからは、NITRO モードでビルドされている 433A を除く全てのアプリは ジャンプ元のアプリへ戻ってくることができます。 + + +(08/08/28 追加)アプリ2点追加、機能追加2点 +TMP ジャンプ先となるアプリとして、458A、459A の 2つを追加しました。 +これら 2つのアプリは「TMP ジャンプ不許可」のアプリなので、TMP ジャンプを実行すると +「必ず失敗」する仕様になっています。 + +TMP ジャンプ先のアプリから、さらに TMP ジャンプが実行できるようにしました。 +仕様では、「必ず失敗」するようになっています。 + +起動用 ROM で、リターンジャンプが可能になりました。 +一度 TMP ジャンプで飛んだあと、リターンジャンプによって起動用 ROM に戻り、 +再度リターンジャンプを実行すると、戻り先が設定されていないために +「必ず失敗」するはずです。 + + ======================================================== なにか問題がありましたら、環境制作部 西本まで。 nishimoto_takashi@nintendo.co.jp <更新履歴>============================================ -2008/08/12 新規追加 \ No newline at end of file +2008/08/28 仕様追加に伴う加筆修正 +2008/08/12 新規追加 + diff --git a/build/debugsoft/TMPJump/data/TestApp.srl b/build/debugsoft/TMPJump/data/TestApp.srl index fe8eccd5..82e726d0 100644 Binary files a/build/debugsoft/TMPJump/data/TestApp.srl and b/build/debugsoft/TMPJump/data/TestApp.srl differ diff --git a/build/debugsoft/TMPJump/data/TestApp_HYBRID.srl b/build/debugsoft/TMPJump/data/TestApp_HYBRID.srl index 88b02b86..4a677ebc 100644 Binary files a/build/debugsoft/TMPJump/data/TestApp_HYBRID.srl and b/build/debugsoft/TMPJump/data/TestApp_HYBRID.srl differ diff --git a/build/debugsoft/TMPJump/data/TestApp_LIMITED.srl b/build/debugsoft/TMPJump/data/TestApp_LIMITED.srl index d5a1a94d..3121a156 100644 Binary files a/build/debugsoft/TMPJump/data/TestApp_LIMITED.srl and b/build/debugsoft/TMPJump/data/TestApp_LIMITED.srl differ diff --git a/build/debugsoft/TMPJump/data/Test_NITROfail.srl b/build/debugsoft/TMPJump/data/Test_NITROfail.srl new file mode 100644 index 00000000..e4ffff09 Binary files /dev/null and b/build/debugsoft/TMPJump/data/Test_NITROfail.srl differ diff --git a/build/debugsoft/TMPJump/data/Test_TWLfail.srl b/build/debugsoft/TMPJump/data/Test_TWLfail.srl new file mode 100644 index 00000000..649140d1 Binary files /dev/null and b/build/debugsoft/TMPJump/data/Test_TWLfail.srl differ diff --git a/build/debugsoft/TMPJump/data/dummy.srl b/build/debugsoft/TMPJump/data/dummy.srl new file mode 100644 index 00000000..54a62709 Binary files /dev/null and b/build/debugsoft/TMPJump/data/dummy.srl differ diff --git a/build/debugsoft/TMPJump/src/main.c b/build/debugsoft/TMPJump/src/main.c index 903c2967..62d38f7b 100644 --- a/build/debugsoft/TMPJump/src/main.c +++ b/build/debugsoft/TMPJump/src/main.c @@ -23,6 +23,7 @@ 定数 定義 *---------------------------------------------------------------------------*/ #define DMA_NO_FS 1 +#define APP_NUM 5 // TMP ジャンプ先ロム数 /*---------------------------------------------------------------------------* 変数 定義 @@ -34,17 +35,20 @@ static KeyInfo gKey; static u8 gSrlNumber = 0; // 各 srl の TitleID -static u64 gRomTitleIDList[3] = +static u64 gRomTitleIDList[APP_NUM] = { - 0x0003000434333361, // NTR GameCode 433A - 0x0003000434333461, // TWL-HYB GameCode 434A - 0x0003000434333561 // TWL-LTD GameCode 435A + 0x0003000434333341, // NTR GameCode 433A + 0x0003000434333441, // TWL-HYB GameCode 434A + 0x0003000434333541, // TWL-LTD GameCode 435A + 0x0003000434353841, // NTR (don't permit TMP jump) GameCode 458A + 0x0003000434353941 // TWL (don't permit TMP jump) GameCode 459A }; // 各 srl の場所 -static const char gRomPath[3][32] = +static const char gRomPath[APP_NUM][32] = { - "rom:/TestApp.srl", "rom:/TestApp_HYBRID.srl", "rom:/TestApp_LIMITED.srl" + "rom:/TestApp.srl", "rom:/TestApp_HYBRID.srl", "rom:/TestApp_LIMITED.srl", + "rom:/Test_NITROfail.srl", "rom:/Test_TWLfail.srl" }; /*---------------------------------------------------------------------------* @@ -110,28 +114,33 @@ void TwlMain(void) // アプリジャンプ OS_DoApplicationJump( gRomTitleIDList[gSrlNumber], OS_APP_JUMP_TMP ); + // 失敗時にはエラーを下画面に出力して終了 + PutSubScreen(1, 10, 0xf1, "ERROR: TMP Jump failed!"); break; } if (gKey.trg & PAD_BUTTON_B) { - // TMP ジャンプを実行する -// OS_DoApplicationJump( gRomTitleIDList[gSrlNumber], OS_APP_JUMP_TMP ); - // 失敗時にはメッセージを表示(成功時は以降が実行されることはない) -// OS_TPrintf("TMP jump failed.\n"); + // リターンジャンプを試みる + if(!OS_ReturnToPrevApplication()) + { + // 失敗時にはメッセージを表示 + PutSubScreen(1, 10, 0xf1, "ERROR: Return Jump failed!"); + break; + } } // 方向キー上下で、OS_TMP_APP_PATH へコピーする srl を選択 if (gKey.trg & PAD_KEY_DOWN) { gSrlNumber++; - if (gSrlNumber > 2) + if (gSrlNumber > APP_NUM - 1) gSrlNumber = 0; } else if (gKey.trg & PAD_KEY_UP) { if (gSrlNumber == 0) - gSrlNumber = 2; + gSrlNumber = APP_NUM -1; else gSrlNumber--; } @@ -150,12 +159,17 @@ void TwlMain(void) static void DrawMainScene(void) { PutMainScreen(1, 1, 0xf2, "Application (Main)"); - PutMainScreen(3, 16, 0xff, "Tmp jump to NITRO rom"); - PutMainScreen(3, 18, 0xff, "Tmp jump to TWL-HYB rom"); - PutMainScreen(3, 20, 0xff, "Tmp jump to TWL-LTD rom"); + PutMainScreen(2, 4, 0xff, "B BUTTON: try return jump"); + + PutMainScreen(3, 12, 0xff, "Tmp jump to NITRO rom"); + PutMainScreen(3, 14, 0xff, "Tmp jump to TWL-HYB rom"); + PutMainScreen(3, 16, 0xff, "Tmp jump to TWL-LTD rom"); + + PutMainScreen(3, 18, 0xfe, "Tmp jump to NITRO x rom"); + PutMainScreen(3, 20, 0xfe, "Tmp jump to TWL x rom"); // 選択中を示すカーソル描画 - PutMainScreen(1, gSrlNumber * 2 + 16, 0xf4, "*"); + PutMainScreen(1, gSrlNumber * 2 + 12, 0xf4, "*"); } /*---------------------------------------------------------------------------*