diff --git a/build/debugsoft/ApplicationJump/Card-anotherID/Makefile b/build/debugsoft/ApplicationJump/Card-anotherID/Makefile new file mode 100644 index 00000000..547f36bc --- /dev/null +++ b/build/debugsoft/ApplicationJump/Card-anotherID/Makefile @@ -0,0 +1,49 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - tests - appjumpTest - Card +# 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$ +#---------------------------------------------------------------------------- + +TARGET_PLATFORM := TWL + +TARGET_BIN = appjumpTestForCard_AID.srl +INCDIR = ../include +SRCDIR = ./src ../src +SRCS = main.c screen.c font.c common.c + +ROM_SPEC = appjumptest_card.rsf + + + +#---------------------------------------------------------------------------- + +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +# インストール指定 +ifneq ($(TWL_IPL_RED_ROOT),) +INSTALL_DIR = $(TWL_IPL_RED_ROOT)/debugsoft/ApplicationJumpTest +INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN) +endif + + +do-build: $(TARGETS) + +#---------------------------------------------------------------------------- + +LIBSYSCALL = ./461A/libsyscall.a + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +#===== End of Makefile ===== diff --git a/build/debugsoft/ApplicationJump/Card-anotherID/appjumptest_card.rsf b/build/debugsoft/ApplicationJump/Card-anotherID/appjumptest_card.rsf new file mode 100644 index 00000000..4fc03e73 --- /dev/null +++ b/build/debugsoft/ApplicationJump/Card-anotherID/appjumptest_card.rsf @@ -0,0 +1,243 @@ +#---------------------------------------------------------------------------- +# 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 "AppJmpTestC" + + # + # 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 ./461A/rom_header_430a.template.sbin + + # + # BANNER FILE: generated from Banner Spec File + # + BannerFile $(TWLSDK_ROOT)/include/twl/specfiles/default.bnr + + # + # Permit LandingNormalJump: for TWL "ApplicationJump" function [TRUE/FALSE] + # + PermitLandingNormalJump TRUE + + # + # 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 + + # + # 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 GameCard + + # + # GameCode for TitleID : Your GameCode in 4 ascii words + # + GameCode 461A + + # + # 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/ApplicationJump/Card-anotherID/banner/banner.bnr b/build/debugsoft/ApplicationJump/Card-anotherID/banner/banner.bnr new file mode 100644 index 00000000..0b405167 Binary files /dev/null and b/build/debugsoft/ApplicationJump/Card-anotherID/banner/banner.bnr differ diff --git a/build/debugsoft/ApplicationJump/Card-anotherID/src/main.c b/build/debugsoft/ApplicationJump/Card-anotherID/src/main.c new file mode 100644 index 00000000..a75fe7d5 --- /dev/null +++ b/build/debugsoft/ApplicationJump/Card-anotherID/src/main.c @@ -0,0 +1,313 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - tests - appjumpTest - Card + 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$ + *---------------------------------------------------------------------------*/ +#include "common.h" +#include "screen.h" + +/*---------------------------------------------------------------------------* + 変数 定義 + *---------------------------------------------------------------------------*/ +// キー入力 +static KeyInfo gKey; + +// アプリ間パラメータ +static AppParam gAppParam; +// アプリ間パラメータとして文字列をセットするかどうか +static BOOL gIsSetDelArg = TRUE; +// アプリ間パラメータとして引き渡された文字列を格納するバッファ(6つまで) +static char gStrAppParam[6][APPJUMP_STRING_LENGTH + 1] ATTRIBUTE_ALIGN(32); +// アプリ間パラメータとして引き渡された文字列の個数 +static int gArgc; + +/*---------------------------------------------------------------------------* + Prototype + *---------------------------------------------------------------------------*/ +static void AddDeliverArg(OSDeliverArgInfo *argInfo, BOOL isReturn); + +/*---------------------------------------------------------------------------*/ + +void TwlMain(void) +{ + OSDeliverArgInfo argInfo; + + int result; + int argSize =sizeof(u32); + + InitCommon(); + InitScreen(); + + GX_DispOn(); + GXS_DispOn(); + + ClearScreen(); + + // キー入力情報取得の空呼び出し(IPL での A ボタン押下対策) + ReadKey(&gKey); + + OS_InitDeliverArgInfo(&argInfo, sizeof(AppParam)); + OS_DecodeDeliverArg(); + + /* アプリ間パラメータ(バイナリデータの取得) */ + if ( OS_DELIVER_ARG_SUCCESS != (result = OS_GetBinaryFromDeliverArg( &gAppParam, &argSize, sizeof(AppParam))) ) + { + PutMainScreen(1, 16, 0xf1, "ERROR!: READ_ERROR (%d)", result); + + OS_WaitVBlankIntr(); + OS_Terminate(); + } + + /* アプリ間パラメータ(文字列)の取得 */ + if ((gArgc = OS_GetDeliverArgc()) > 0) + { + int i; + + OS_TPrintf("argc = %d\n", gArgc); + + for (i=0; i < gArgc && i < 6; i++) + { + STD_StrLCpy(gStrAppParam[i], (const char*)OS_GetDeliverArgv(i + 1), APPJUMP_STRING_LENGTH); + gStrAppParam[i][APPJUMP_STRING_LENGTH] = '\0'; + } + } + + while(TRUE) + { + int i; + + // 自動テスト中に、ユーザのキー入力による終了指示を受け付けるためにウエイトを入れる + if (gAppParam.isAutoJump == 1) + { + OSTick tick = OS_GetTick(); + + PutMainScreen(1, 9, 0xf8, "executing auto app jump..."); + PutMainScreen(1, 11, 0xff, "wait 2 seconds..."); + PutMainScreen(1, 13, 0xff, "START: quit auto app jump"); + do { + ReadKey(&gKey); + + if (gKey.trg & PAD_BUTTON_START) + { + break; + } + + OS_WaitVBlankIntr(); + } while (OS_TicksToSeconds(OS_GetTick() - tick) < 2); + } + else + { + // キー入力情報取得 + ReadKey(&gKey); + } + + // 画面クリア + ClearScreen(); + + // メイン画面描画 + PutMainScreen(0, 2, 0xf4, " ****** This APP is CARD ****** "); + PutMainScreen(0, 5, 0xff, " APP JUMP : %u times ", gAppParam.jumpCount); + PutMainScreen(0, 7, 0xff, " DELIVERED PARAM (recent 6 app)"); + + for (i=0; i 0) + { + int i; + + OS_TPrintf("argc = %d\n", gArgc); + + for (i=0; i < gArgc && i < 6; i++) + { + STD_StrLCpy(gStrAppParam[i], (const char*)OS_GetDeliverArgv(i + 1), APPJUMP_STRING_LENGTH); + gStrAppParam[i][APPJUMP_STRING_LENGTH] = '\0'; + } + } + + while(TRUE) + { + int i; + + // 自動テスト中に、ユーザのキー入力による終了指示を受け付けるためにウエイトを入れる + if (gAppParam.isAutoJump == 1) + { + OSTick tick = OS_GetTick(); + + PutMainScreen(1, 9, 0xf8, "executing auto app jump..."); + PutMainScreen(1, 11, 0xff, "wait 2 seconds..."); + PutMainScreen(1, 13, 0xff, "START: quit auto app jump"); + do { + ReadKey(&gKey); + + if (gKey.trg & PAD_BUTTON_START) + { + break; + } + + OS_WaitVBlankIntr(); + } while (OS_TicksToSeconds(OS_GetTick() - tick) < 2); + } + else + { + // キー入力情報取得 + ReadKey(&gKey); + } + + // 画面クリア + ClearScreen(); + + // メイン画面描画 + PutMainScreen(0, 2, 0xf4, " ****** This APP is CARD ****** "); + PutMainScreen(0, 5, 0xff, " APP JUMP : %u times ", gAppParam.jumpCount); + PutMainScreen(0, 7, 0xff, " DELIVERED PARAM (recent 6 app)"); + + for (i=0; i= JUMPTYPE_NUM ) + { + gJumpTypeForB = JUMPTYPE_RETURN; + } } if (gKey.trg & PAD_BUTTON_START) @@ -212,13 +235,21 @@ void TwlMain(void) if (gKey.trg & PAD_BUTTON_B) { AddDeliverArg(&argInfo, TRUE); - // ジャンプ元のアプリへ戻る - if ( !OS_ReturnToPrevApplication() ) - { - OS_TPrintf("Failed to Return Jump.\n"); - PutMainScreen(1, 16, 0xf1, "ERROR!: Failed to Return Jump."); + switch (gJumpTypeForB) + { + case JUMPTYPE_RETURN: + if ( !OS_ReturnToPrevApplication() ) + { + OS_TPrintf("Failed to Return Jump.\n"); + PutMainScreen(1, 16, 0xf1, "ERROR!: Failed to Return Jump."); + } + break; + case JUMPTYPE_ANOTHER_CARD: + break; + case JUMPTYPE_SYSMENU: + OS_JumpToSystemMenu(); + break; } - break; } if (gKey.trg & PAD_BUTTON_L || gKey.trg & PAD_BUTTON_R) diff --git a/build/debugsoft/ApplicationJump/Makefile b/build/debugsoft/ApplicationJump/Makefile index 1e2c595d..23016da0 100644 --- a/build/debugsoft/ApplicationJump/Makefile +++ b/build/debugsoft/ApplicationJump/Makefile @@ -12,8 +12,8 @@ # in whole or in part, without the prior written consent of Nintendo. # # $Date:: $ -# $Rev:$ -# $Author:$ +# $Rev$ +# $Author$ #---------------------------------------------------------------------------- TARGET_PLATFORM = TWL @@ -23,7 +23,9 @@ include $(TWLSDK_ROOT)/build/buildtools/commondefs SUBDIRS = Card \ Nand-1 \ - Nand-2 + Nand-2 +# Card-fail \ +# Card-anotherID #---------------------------------------------------------------------------- diff --git a/build/debugsoft/ApplicationJump/Nand-1/src/_main.c b/build/debugsoft/ApplicationJump/Nand-1/src/_main.c deleted file mode 100644 index 263ec5ee..00000000 --- a/build/debugsoft/ApplicationJump/Nand-1/src/_main.c +++ /dev/null @@ -1,305 +0,0 @@ -/*---------------------------------------------------------------------------* - Project: TwlSDK - arg-1 - File: main.c - - Copyright 2007 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$ - *---------------------------------------------------------------------------*/ - -#include -#include -#include - -#include - -#include "screen.h" - -/*---------------------------------------------------------------------------* - 定数 定義 - *---------------------------------------------------------------------------*/ -#define KEY_REPEAT_START 25 // キーリピート開始までのフレーム数 -#define KEY_REPEAT_SPAN 10 // キーリピートの間隔フレーム数 - -//ジャンプ先 -const char destinationName[21][32] ={ - "PAGE_1", - "??????", - "PAGE_2", - "PAGE_3", - "PAGE_4", - "APP_MANAGER", - "WIRELESS", - "BRIGHTNESS", - "USER INFO", - "DATE", - "TIME", - "ALARM", - "TP_CALIBRATION", - "LANGUAGE", - "PARENTAL_CONTROL", - "NETWORK SETTING", - "NETWORK EURA", - "NETWORK OPTION", - "COUNTRY", - "SYSTEM UPDATE", - "SYSTEM INITIALIZE", - }; -/*---------------------------------------------------------------------------* - 構造体 定義 - *---------------------------------------------------------------------------*/ - -// キー入力情報 -typedef struct KeyInfo -{ - u16 cnt; // 未加工入力値 - u16 trg; // 押しトリガ入力 - u16 up; // 離しトリガ入力 - u16 rep; // 押し維持リピート入力 -} KeyInfo; - -// キー入力 -static KeyInfo gKey; - -/*---------------------------------------------------------------------------* - Prototype - *---------------------------------------------------------------------------*/ - -static void VBlankIntr(void); -static void InitInterrupts(void); -static void InitHeap(void); - -static void ReadKey(KeyInfo* pKey); - -/*---------------------------------------------------------------------------*/ - -void TwlMain(void) -{ - u8 argNum = 0; - - OS_Init(); - OS_InitTick(); - OS_InitAlarm(); - GX_Init(); - GX_DispOff(); - GXS_DispOff(); - - InitHeap(); - InitScreen(); - InitInterrupts(); - - GX_DispOn(); - GXS_DispOn(); - - ClearScreen(); - - // キー入力情報取得の空呼び出し(IPL での A ボタン押下対策) - ReadKey(&gKey); - - while(TRUE) - { - // キー入力情報取得 - ReadKey(&gKey); - - // メイン画面クリア - ClearScreen(); - - PutSubScreen(0, 0, 0xff, "SETTING JUMP DEMO"); - PutSubScreen(0, 15, 0xff, "UP/DOWN: SELECT DESTINATION"); - PutSubScreen(0, 16, 0xff, " A: JUMP TO DESTINATION"); - PutSubScreen(0, 17, 0xff, " Y: JUMP TO EULA"); - PutSubScreen(0, 18, 0xff, " X: JUMP TO APP MANAGER"); - PutSubScreen(0, 19, 0xff, " B: JUMP TO NET SETTING"); - PutSubScreen(0, 20, 0xff, " R: JUMP TO UPDATE"); - - PutSubScreen(0, 2, 0xff, "DESTINATION: %s", destinationName[argNum]); - - if (gKey.trg & PAD_KEY_DOWN) - { - if (argNum < 20) argNum++; - } - else if (gKey.trg & PAD_KEY_UP) - { - if (argNum > 0) argNum--; - } - - if (gKey.trg & PAD_BUTTON_A) - { - if( OSi_JumpToMachineSetting( argNum ) == FALSE ) - { - OS_Panic("Failed to Jump."); - } - break; - } - if (gKey.trg & PAD_BUTTON_Y) - { - if( OSi_JumpToEulaDirect() == FALSE ) - { - OS_Panic("Failed to Jump."); - } - break; - } - if (gKey.trg & PAD_BUTTON_X) - { - if( OSi_JumpToApplicationManagerDirect() == FALSE ) - { - OS_Panic("Failed to Jump."); - } - break; - } - if (gKey.trg & PAD_BUTTON_B) - { - if( OSi_JumpToNetworkSettngDirect() == FALSE ) - { - OS_Panic("Failed to Jump."); - } - break; - } - if (gKey.trg & PAD_BUTTON_R) - { - if( OSi_JumpToSystemUpdateDirect() == FALSE ) - { - OS_Panic("Failed to Jump."); - } - break; - } - - // Vブランク待ち ( スレッド対応 ) - OS_WaitVBlankIntr(); - } - - OS_Terminate(); -} - -/*---------------------------------------------------------------------------* - Name: VBlankIntr - - Description: Vブランク割込みハンドラ。 - - Arguments: None. - - Returns: None. - *---------------------------------------------------------------------------*/ -static void VBlankIntr(void) -{ - // テキスト表示を更新 - UpdateScreen(); - - // IRQ チェックフラグをセット - OS_SetIrqCheckFlag(OS_IE_V_BLANK); -} - -/*---------------------------------------------------------------------------* - Name: InitInterrupts - - Description: 割り込み設定を初期化する。 - V ブランク割り込みを許可し、割り込みハンドラを設定する。 - - Arguments: None. - - Returns: None. - *---------------------------------------------------------------------------*/ -static void InitInterrupts(void) -{ - // V ブランク割り込み設定 - OS_SetIrqFunction(OS_IE_V_BLANK, VBlankIntr); - (void)OS_EnableIrqMask(OS_IE_V_BLANK); - (void)GX_VBlankIntr(TRUE); - - // 割り込み許可 - (void)OS_EnableIrq(); - (void)OS_EnableInterrupts(); -} - -/*---------------------------------------------------------------------------* - Name: InitHeap - - Description: メインメモリ上のアリーナにてメモリ割当てシステムを初期化する。 - - Arguments: None. - - Returns: None. - *---------------------------------------------------------------------------*/ -static void InitHeap(void) -{ - void* tempLo; - OSHeapHandle hh; - - // メインメモリ上のアリーナにヒープをひとつ作成 - tempLo = OS_InitAlloc(OS_ARENA_MAIN, OS_GetMainArenaLo(), OS_GetMainArenaHi(), 1); - OS_SetArenaLo(OS_ARENA_MAIN, tempLo); - hh = OS_CreateHeap(OS_ARENA_MAIN, OS_GetMainArenaLo(), OS_GetMainArenaHi()); - if (hh < 0) - { - // ヒープ作成に失敗した場合は異常終了 - OS_Panic("ARM9: Fail to create heap...\n"); - } - (void)OS_SetCurrentHeap(OS_ARENA_MAIN, hh); -} - -/*---------------------------------------------------------------------------* - Name: ReadKey - - Description: キー入力情報を取得し、入力情報構造体を編集する。 - 押しトリガ、離しトリガ、押し継続リピートトリガ を検出する。 - - Arguments: pKey - 編集するキー入力情報構造体を指定する。 - - Returns: None. - *---------------------------------------------------------------------------*/ -static void ReadKey(KeyInfo* pKey) -{ - static u16 repeat_count[12]; - int i; - u16 r; - - r = PAD_Read(); - pKey->trg = 0x0000; - pKey->up = 0x0000; - pKey->rep = 0x0000; - - for (i = 0; i < 12; i++) - { - if (r & (0x0001 << i)) - { - if (!(pKey->cnt & (0x0001 << i))) - { - pKey->trg |= (0x0001 << i); // 押しトリガ - repeat_count[i] = 1; - } - else - { - if (repeat_count[i] > KEY_REPEAT_START) - { - pKey->rep |= (0x0001 << i); // 押し継続リピート - repeat_count[i] = (u16) (KEY_REPEAT_START - KEY_REPEAT_SPAN); - } - else - { - repeat_count[i]++; - } - } - } - else - { - if (pKey->cnt & (0x0001 << i)) - { - pKey->up |= (0x0001 << i); // 離しトリガ - } - } - } - - pKey->cnt = r; // 未加工キー入力 -} - -/*---------------------------------------------------------------------------* - End of file - *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/ApplicationJump/Nand-1/src/main.c b/build/debugsoft/ApplicationJump/Nand-1/src/main.c index 2589e333..f047a9be 100644 --- a/build/debugsoft/ApplicationJump/Nand-1/src/main.c +++ b/build/debugsoft/ApplicationJump/Nand-1/src/main.c @@ -23,6 +23,8 @@ // キー入力 static KeyInfo gKey; +// B ボタンジャンプ先の切りかえフラグ +static u8 gJumpTypeForB = JUMPTYPE_RETURN; // アプリ間パラメータ static AppParam gAppParam; // アプリ間パラメータとして文字列をセットするかどうか @@ -153,20 +155,43 @@ void TwlMain(void) PutSubScreen(0, 4, 0xff, " AUTO JUMP TEST: OFF"); } - PutSubScreen(0, 14, 0xf5, " ------------------------------- "); - PutSubScreen(0, 16, 0xff, " A: JUMP TO CARD APP"); - PutSubScreen(0, 17, 0xff, " Y: JUMP TO NAND-2 APP"); - PutSubScreen(0, 18, 0xff, " X: JUMP TO SELF"); - PutSubScreen(0, 19, 0xff, " B: RETURN JUMP"); + PutSubScreen(0, 13, 0xf5, " ------------------------------- "); + PutSubScreen(0, 15, 0xff, " A: JUMP TO CARD APP"); + PutSubScreen(0, 16, 0xff, " Y: JUMP TO NAND-2 APP"); + PutSubScreen(0, 17, 0xff, " X: JUMP TO SELF"); + + switch (gJumpTypeForB) + { + case JUMPTYPE_RETURN: + PutSubScreen(0, 18, 0xff, " B: RETURN JUMP"); + break; + case JUMPTYPE_ANOTHER_CARD: + PutSubScreen(0, 18, 0xfe, " B: JUMP TO CARD APP"); + break; + case JUMPTYPE_SYSMENU: + PutSubScreen(0, 18, 0xff, " B: JUMP TO SYSMENU)"; + break; + } + PutSubScreen(0, 20, 0xff, " UP DOWN: SWITCH JUMP TYPE (B) "); PutSubScreen(0, 21, 0xff, " L R: SWITCH DELIVER ARG ON/OFF"); PutSubScreen(0, 22, 0xff, " STR: SWITCH AUTO TEST ON/OFF"); if (gKey.trg & PAD_KEY_DOWN) { + if ( gJumpTypeForB == JUMPTYPE_RETURN ) + { + gJumpTypeForB = JUMPTYPE_NUM - 1; + } + else + gJumpTypeForB--; } else if (gKey.trg & PAD_KEY_UP) { + if ( ++gJumpTypeForB >= JUMPTYPE_NUM ) + { + gJumpTypeForB = JUMPTYPE_RETURN; + } } if (gKey.trg & PAD_BUTTON_START) @@ -186,6 +211,7 @@ void TwlMain(void) } break; } + if (gKey.trg & PAD_BUTTON_Y) { AddDeliverArg(&argInfo, FALSE); @@ -212,12 +238,27 @@ void TwlMain(void) if (gKey.trg & PAD_BUTTON_B) { AddDeliverArg(&argInfo, TRUE); - if ( !OS_ReturnToPrevApplication() ) - { - OS_TPrintf("Failed to Return Jump.\n"); - PutMainScreen(1, 16, 0xf1, "ERROR!: Failed to Return Jump."); - } - break; + + switch (gJumpTypeForB) + { + case JUMPTYPE_RETURN: + if ( !OS_ReturnToPrevApplication() ) + { + OS_TPrintf("Failed to Return Jump.\n"); + PutMainScreen(1, 16, 0xf1, "ERROR!: Failed to Return Jump."); + } + break; + case JUMPTYPE_ANOTHER_CARD: + if ( !OS_DoApplicationJump(CARDAPP_ANO_TITLEID, OS_APP_JUMP_NORMAL) ) + { + OS_TPrintf("Failed to Jump.\n"); + PutMainScreen(1, 16, 0xf1, "ERROR!: Failed to Jump."); + } + break; + case JUMPTYPE_SYSMENU: + OS_JumpToSystemMenu(); + break; + } } if (gKey.trg & PAD_BUTTON_L || gKey.trg & PAD_BUTTON_R) diff --git a/build/debugsoft/ApplicationJump/Nand-2/src/main.c b/build/debugsoft/ApplicationJump/Nand-2/src/main.c index 268926e3..03a6fd5e 100644 --- a/build/debugsoft/ApplicationJump/Nand-2/src/main.c +++ b/build/debugsoft/ApplicationJump/Nand-2/src/main.c @@ -20,9 +20,13 @@ /*---------------------------------------------------------------------------* 変数 定義 *---------------------------------------------------------------------------*/ + // キー入力 static KeyInfo gKey; + +// B ボタンジャンプ先の切りかえフラグ +static u8 gJumpTypeForB = JUMPTYPE_RETURN; // アプリ間パラメータ static AppParam gAppParam; // アプリ間パラメータとして文字列をセットするかどうか @@ -157,16 +161,39 @@ void TwlMain(void) PutSubScreen(0, 16, 0xff, " A: JUMP TO CARD APP"); PutSubScreen(0, 17, 0xff, " Y: JUMP TO NAND-1 APP"); PutSubScreen(0, 18, 0xff, " X: JUMP TO SELF"); - PutSubScreen(0, 19, 0xff, " B: RETURN JUMP"); + + switch (gJumpTypeForB) + { + case JUMPTYPE_RETURN: + PutSubScreen(0, 18, 0xff, " B: RETURN JUMP"); + break; + case JUMPTYPE_ANOTHER_CARD: + PutSubScreen(0, 18, 0xfe, " B: JUMP TO CARD APP"); + break; + case JUMPTYPE_SYSMENU: + PutSubScreen(0, 18, 0xff, " B: JUMP TO SYSMENU)"; + break; + } + PutSubScreen(0, 20, 0xff, " UP DOWN: SWITCH JUMP TYPE (B) "); PutSubScreen(0, 21, 0xff, " L R: SWITCH DELIVER ARG ON/OFF"); PutSubScreen(0, 22, 0xff, " STR: SWITCH AUTO TEST ON/OFF"); if (gKey.trg & PAD_KEY_DOWN) { + if ( gJumpTypeForB == JUMPTYPE_RETURN ) + { + gJumpTypeForB = JUMPTYPE_NUM - 1; + } + else + gJumpTypeForB--; } else if (gKey.trg & PAD_KEY_UP) { + if ( ++gJumpTypeForB >= JUMPTYPE_NUM ) + { + gJumpTypeForB = JUMPTYPE_RETURN; + } } if (gKey.trg & PAD_BUTTON_START) @@ -186,6 +213,7 @@ void TwlMain(void) } break; } + if (gKey.trg & PAD_BUTTON_Y) { AddDeliverArg(&argInfo, FALSE); @@ -212,12 +240,26 @@ void TwlMain(void) if (gKey.trg & PAD_BUTTON_B) { AddDeliverArg(&argInfo, TRUE); - if ( !OS_ReturnToPrevApplication() ) - { - OS_TPrintf("Failed to Return Jump.\n"); - PutMainScreen(1, 16, 0xf1, "ERROR!: Failed to Return Jump."); - } - break; + switch (gJumpTypeForB) + { + case JUMPTYPE_RETURN: + if ( !OS_ReturnToPrevApplication() ) + { + OS_TPrintf("Failed to Return Jump.\n"); + PutMainScreen(1, 16, 0xf1, "ERROR!: Failed to Return Jump."); + } + break; + case JUMPTYPE_ANOTHER_CARD: + if ( !OS_DoApplicationJump(CARDAPP_ANO_TITLEID, OS_APP_JUMP_NORMAL) ) + { + OS_TPrintf("Failed to Jump.\n"); + PutMainScreen(1, 16, 0xf1, "ERROR!: Failed to Jump."); + } + break; + case JUMPTYPE_SYSMENU: + OS_JumpToSystemMenu(); + break; + } } if (gKey.trg & PAD_BUTTON_L || gKey.trg & PAD_BUTTON_R) diff --git a/build/debugsoft/ApplicationJump/ReadMe.txt b/build/debugsoft/ApplicationJump/ReadMe.txt index 8e254106..762908f5 100644 --- a/build/debugsoft/ApplicationJump/ReadMe.txt +++ b/build/debugsoft/ApplicationJump/ReadMe.txt @@ -4,11 +4,19 @@ appjumpTest ======================================================== <概要> =============================================== -2種類のNAND アプリと 1種類のカードアプリで構成されます。 +2種類のNAND アプリと 3種類のカードアプリで構成されます。 各アプリ間で、アプリジャンプの機能を一通り試すことができます。 アプリ間でのパラメータの受け渡し、ジャンプ元へのリターンも可能です。 +3種類のカードアプリについて + +| イニシャルコード | 被ノーマルジャンプ | +| 430A |  許可 | +| 460A | 不許可 | +| 461A |  許可 | +--------------------------------------------- + <使い方> ============================================= 2種類のNAND アプリを TWL にインポートした状態で、カードアプリを起動してください。 @@ -21,6 +29,19 @@ L/R START ボタンを押すと、現在起動中のアプリ自身へのアプリジャンプを自動で繰り返すモードに入ります。 中断するには、起動後上画面にメッセージが出ている間(約2秒間)に START ボタンを押してください。 +(2008/08/30 追記) +異常系チェックのために、カードアプリを2種追加しました。 + +・ひとつめ(460A)について + 被ノーマルジャンプを許可していない TWL カードアプリです。 + NAND アプリからこのアプリにジャンプしようとすると、必ずエラーが返るはずです。 + +・ふたつめ(461A)について + 被ノーマルジャンプは許可していますが、最初のカードアプリとは TitleID が別物の TWL カードアプリです。 + 最初に、もう一方のノーマルジャンプを許可しているカードアプリ[430A]をスロットに挿入した状態で + テストを開始します。そこから NAND アプリにジャンプした後、カードを[461A] に差し替えます。 + そして、NAND アプリからカードアプリへノーマルジャンプを実行した際に、ジャンプできるかどうかをチェックします。 + <画面の見方> ========================================== ・上画面について @@ -52,4 +73,5 @@ nishimoto_takashi@nintendo.co.jp <更新履歴>============================================ +2008/08/30 カードアプリ2種追加について加筆修正 2008/07/31 新規追加 diff --git a/build/debugsoft/ApplicationJump/include/common.h b/build/debugsoft/ApplicationJump/include/common.h index 8fb3a4cc..3636a922 100644 --- a/build/debugsoft/ApplicationJump/include/common.h +++ b/build/debugsoft/ApplicationJump/include/common.h @@ -31,6 +31,8 @@ extern "C" { /* TitleID */ #define CARDAPP_TITLEID (u64)(0x0003000034333041) // 430A +#define CARDAPP_ANO_TITLEID (u64)(0x0003000034363041) // 460A + #define NANDAPP1_TITLEID (u64)(0x0003000434333141) // 431A #define NANDAPP2_TITLEID (u64)(0x0003000434333241) // 432A @@ -44,6 +46,15 @@ extern "C" { 構造体 定義 *---------------------------------------------------------------------------*/ +typedef enum JumpTypeForB +{ + JUMPTYPE_RETURN = 0, + JUMPTYPE_ANOTHER_CARD, + JUMPTYPE_SYSMENU, + + JUMPTYPE_NUM +} JumpTypeForB; + // キー入力情報 typedef struct KeyInfo { diff --git a/debugsoft/ApplicationJumpTest/ReadMe_AppJump.txt b/debugsoft/ApplicationJumpTest/ReadMe_AppJump.txt index 8e254106..762908f5 100644 --- a/debugsoft/ApplicationJumpTest/ReadMe_AppJump.txt +++ b/debugsoft/ApplicationJumpTest/ReadMe_AppJump.txt @@ -4,11 +4,19 @@ appjumpTest ======================================================== <概要> =============================================== -2種類のNAND アプリと 1種類のカードアプリで構成されます。 +2種類のNAND アプリと 3種類のカードアプリで構成されます。 各アプリ間で、アプリジャンプの機能を一通り試すことができます。 アプリ間でのパラメータの受け渡し、ジャンプ元へのリターンも可能です。 +3種類のカードアプリについて + +| イニシャルコード | 被ノーマルジャンプ | +| 430A |  許可 | +| 460A | 不許可 | +| 461A |  許可 | +--------------------------------------------- + <使い方> ============================================= 2種類のNAND アプリを TWL にインポートした状態で、カードアプリを起動してください。 @@ -21,6 +29,19 @@ L/R START ボタンを押すと、現在起動中のアプリ自身へのアプリジャンプを自動で繰り返すモードに入ります。 中断するには、起動後上画面にメッセージが出ている間(約2秒間)に START ボタンを押してください。 +(2008/08/30 追記) +異常系チェックのために、カードアプリを2種追加しました。 + +・ひとつめ(460A)について + 被ノーマルジャンプを許可していない TWL カードアプリです。 + NAND アプリからこのアプリにジャンプしようとすると、必ずエラーが返るはずです。 + +・ふたつめ(461A)について + 被ノーマルジャンプは許可していますが、最初のカードアプリとは TitleID が別物の TWL カードアプリです。 + 最初に、もう一方のノーマルジャンプを許可しているカードアプリ[430A]をスロットに挿入した状態で + テストを開始します。そこから NAND アプリにジャンプした後、カードを[461A] に差し替えます。 + そして、NAND アプリからカードアプリへノーマルジャンプを実行した際に、ジャンプできるかどうかをチェックします。 + <画面の見方> ========================================== ・上画面について @@ -52,4 +73,5 @@ nishimoto_takashi@nintendo.co.jp <更新履歴>============================================ +2008/08/30 カードアプリ2種追加について加筆修正 2008/07/31 新規追加 diff --git a/debugsoft/ApplicationJumpTest/appjumpTestForCard.srl b/debugsoft/ApplicationJumpTest/appjumpTestForCard.srl new file mode 100644 index 00000000..2e08c623 Binary files /dev/null and b/debugsoft/ApplicationJumpTest/appjumpTestForCard.srl differ diff --git a/debugsoft/ApplicationJumpTest/appjumpTestForNand1.nand.srl b/debugsoft/ApplicationJumpTest/appjumpTestForNand1.nand.srl new file mode 100644 index 00000000..2e4ce130 Binary files /dev/null and b/debugsoft/ApplicationJumpTest/appjumpTestForNand1.nand.srl differ diff --git a/debugsoft/ApplicationJumpTest/appjumpTestForNand1.tad b/debugsoft/ApplicationJumpTest/appjumpTestForNand1.tad new file mode 100644 index 00000000..6137a892 Binary files /dev/null and b/debugsoft/ApplicationJumpTest/appjumpTestForNand1.tad differ diff --git a/debugsoft/ApplicationJumpTest/appjumpTestForNand2.nand.srl b/debugsoft/ApplicationJumpTest/appjumpTestForNand2.nand.srl new file mode 100644 index 00000000..2bd2844f Binary files /dev/null and b/debugsoft/ApplicationJumpTest/appjumpTestForNand2.nand.srl differ diff --git a/debugsoft/ApplicationJumpTest/appjumpTestForNand2.tad b/debugsoft/ApplicationJumpTest/appjumpTestForNand2.tad new file mode 100644 index 00000000..30de03f3 Binary files /dev/null and b/debugsoft/ApplicationJumpTest/appjumpTestForNand2.tad differ