mirror of
https://github.com/rvtr/TwlIPL.git
synced 2025-10-31 06:01:12 -04:00
TmpJump テスト に機能追加
nishimoto @ PSEG1 git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@2320 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
parent
3e7f49072b
commit
1d4228305f
58
build/debugsoft/TMPJump/AppforFailedTmpJump/Makefile
Normal file
58
build/debugsoft/TMPJump/AppforFailedTmpJump/Makefile
Normal file
@ -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 =====
|
||||||
103
build/debugsoft/TMPJump/AppforFailedTmpJump/main_458a.rsf
Normal file
103
build/debugsoft/TMPJump/AppforFailedTmpJump/main_458a.rsf
Normal file
@ -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)
|
||||||
|
}
|
||||||
248
build/debugsoft/TMPJump/AppforFailedTmpJump/main_459a.rsf
Normal file
248
build/debugsoft/TMPJump/AppforFailedTmpJump/main_459a.rsf
Normal file
@ -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
|
||||||
|
}
|
||||||
@ -11,8 +11,8 @@
|
|||||||
in whole or in part, without the prior written consent of Nintendo.
|
in whole or in part, without the prior written consent of Nintendo.
|
||||||
|
|
||||||
$Date:: $
|
$Date:: $
|
||||||
$Rev$
|
$Rev:$
|
||||||
$Author$
|
$Author:$
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifdef SDK_TWL
|
#ifdef SDK_TWL
|
||||||
@ -24,12 +24,17 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
|
|
||||||
|
#define DMA_NO_FS 1
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
•Ï<EFBFBD>” ’è‹`
|
•Ï<EFBFBD>” ’è‹`
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
// ƒL<C692>[“ü—Í
|
// ƒL<C692>[“ü—Í
|
||||||
static KeyInfo gKey;
|
static KeyInfo gKey;
|
||||||
|
|
||||||
|
static const char gRomPath[32] = "rom:/dummy.srl";
|
||||||
|
static u64 gTargetId = 0x0003000434333441;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
Prototype
|
Prototype
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
@ -45,6 +50,8 @@ void NitroMain(void)
|
|||||||
InitCommon();
|
InitCommon();
|
||||||
InitScreen();
|
InitScreen();
|
||||||
|
|
||||||
|
FS_Init(DMA_NO_FS);
|
||||||
|
|
||||||
GX_DispOn();
|
GX_DispOn();
|
||||||
GXS_DispOn();
|
GXS_DispOn();
|
||||||
|
|
||||||
@ -57,6 +64,52 @@ void NitroMain(void)
|
|||||||
{
|
{
|
||||||
ReadKey(&gKey);
|
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)
|
if (gKey.trg & PAD_BUTTON_B)
|
||||||
{
|
{
|
||||||
#ifdef SDK_TWL
|
#ifdef SDK_TWL
|
||||||
@ -82,6 +135,7 @@ static void DrawMainScene(void)
|
|||||||
{
|
{
|
||||||
PutMainScreen(1, 1, 0xf2, "Application on tmp dir");
|
PutMainScreen(1, 1, 0xf2, "Application on tmp dir");
|
||||||
#ifdef SDK_TWL
|
#ifdef SDK_TWL
|
||||||
|
PutMainScreen(1, 18, 0xff, "A : try TMP jump");
|
||||||
PutMainScreen(1, 20, 0xff, "B : Return to Main App");
|
PutMainScreen(1, 20, 0xff, "B : Return to Main App");
|
||||||
#else
|
#else
|
||||||
PutMainScreen(1, 20, 0xf8, "Can not return to Main (OK)");
|
PutMainScreen(1, 20, 0xf8, "Can not return to Main (OK)");
|
||||||
@ -20,11 +20,16 @@
|
|||||||
override TARGET_CODEGEN = ARM
|
override TARGET_CODEGEN = ARM
|
||||||
TWL_ARCHGEN = ALL
|
TWL_ARCHGEN = ALL
|
||||||
|
|
||||||
|
TWL_NANDAPP = TRUE
|
||||||
|
|
||||||
TARGET_BIN = TestApp$(TEST_ARCH).srl
|
TARGET_BIN = TestApp$(TEST_ARCH).srl
|
||||||
|
|
||||||
INCDIR = ../include
|
INCDIR = ../include
|
||||||
SRCDIR = ./ ../src
|
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
|
include $(TWLSDK_ROOT)/build/buildtools/commondefs
|
||||||
|
|||||||
162
build/debugsoft/TMPJump/AppforTmpJump/main_2.c
Normal file
162
build/debugsoft/TMPJump/AppforTmpJump/main_2.c
Normal file
@ -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 <twl.h>
|
||||||
|
#else
|
||||||
|
#include <nitro.h>
|
||||||
|
#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);
|
||||||
|
}
|
||||||
|
|
||||||
@ -171,7 +171,7 @@ AppendProperty
|
|||||||
#
|
#
|
||||||
# Boot allowed Media: [GameCard]
|
# Boot allowed Media: [GameCard]
|
||||||
#
|
#
|
||||||
Media GameCard
|
Media NAND
|
||||||
|
|
||||||
#
|
#
|
||||||
# GameCode for TitleID : Your GameCode in 4 ascii words
|
# GameCode for TitleID : Your GameCode in 4 ascii words
|
||||||
|
|||||||
@ -171,7 +171,7 @@ AppendProperty
|
|||||||
#
|
#
|
||||||
# Boot allowed Media: [GameCard]
|
# Boot allowed Media: [GameCard]
|
||||||
#
|
#
|
||||||
Media GameCard
|
Media NAND
|
||||||
|
|
||||||
#
|
#
|
||||||
# GameCode for TitleID : Your GameCode in 4 ascii words
|
# GameCode for TitleID : Your GameCode in 4 ascii words
|
||||||
|
|||||||
@ -68,7 +68,9 @@ SRCS = main.c common.c screen.c font.c
|
|||||||
MAKEROM_ROMROOT = ./data
|
MAKEROM_ROMROOT = ./data
|
||||||
MAKEROM_ROMFILES = TestApp.srl \
|
MAKEROM_ROMFILES = TestApp.srl \
|
||||||
TestApp_HYBRID.srl \
|
TestApp_HYBRID.srl \
|
||||||
TestApp_LIMITED.srl
|
TestApp_LIMITED.srl \
|
||||||
|
Test_NITROfail.srl \
|
||||||
|
Test_TWLfail.srl
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
include $(TWLSDK_ROOT)/build/buildtools/commondefs
|
include $(TWLSDK_ROOT)/build/buildtools/commondefs
|
||||||
|
|||||||
@ -4,29 +4,52 @@ tmpjumpTest
|
|||||||
========================================================
|
========================================================
|
||||||
|
|
||||||
<概要> ===============================================
|
<概要> ===============================================
|
||||||
このテストでは、以下の5つのアプリを使用します。
|
このテストでは、以下の 7つのアプリを使用します。
|
||||||
|
|
||||||
---------------------------------------------------------
|
---------------------------------------------------------
|
||||||
address | GameCode | Media |
|
address | GameCode | Media |
|
||||||
--------------------------------+-----------+-----------+
|
--------------------------------+-----------+-----------+
|
||||||
data/TestApp.srl | 433A | GameCard |
|
data/TestApp.srl | 433A | GameCard |
|
||||||
data/TestApp_HYBRID.srl | 434A | GameCard |
|
data/TestApp_HYBRID.srl | 434A | GameCard |
|
||||||
data/TestApp_LIMITED.srl | 435A | GameCard |
|
data/TestApp_LIMITED.srl | 435A | GameCard | tmp 格納用 ROM
|
||||||
bin/.../tmpjumpTest.srl | 436A | GameCard |
|
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 |
|
bin/.../tmpjumpTest.nand.tad | 437A | NAND |
|
||||||
---------------------------------------------------------
|
---------------------------------------------------------
|
||||||
|
|
||||||
|
上の 5つのアプリは、下 2つのアプリに埋め込まれています。
|
||||||
|
|
||||||
<使い方> =============================================
|
<使い方> =============================================
|
||||||
|
|
||||||
まず、フラッシュカードに書き込んだ 436A または インポートした 437A を起動します。
|
まず、「フラッシュカードに書き込んだ 436A」または「インポートした 437A」を起動します。
|
||||||
|
|
||||||
436A, 437A では、選択したアプリを NAND の /tmp 以下へコピーし、TMPジャンプを実行します。
|
436A, 437A では、選択したアプリを NAND の /tmp 以下へコピーし、TMPジャンプを実行します。
|
||||||
TMP ジャンプ先のアプリからは、NITRO モードでビルドされている 433A を除く全てのアプリは
|
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
|
nishimoto_takashi@nintendo.co.jp
|
||||||
|
|
||||||
<更新履歴>============================================
|
<更新履歴>============================================
|
||||||
2008/08/12 新規追加
|
2008/08/28 仕様追加に伴う加筆修正
|
||||||
|
2008/08/12 新規追加
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
build/debugsoft/TMPJump/data/Test_NITROfail.srl
Normal file
BIN
build/debugsoft/TMPJump/data/Test_NITROfail.srl
Normal file
Binary file not shown.
BIN
build/debugsoft/TMPJump/data/Test_TWLfail.srl
Normal file
BIN
build/debugsoft/TMPJump/data/Test_TWLfail.srl
Normal file
Binary file not shown.
BIN
build/debugsoft/TMPJump/data/dummy.srl
Normal file
BIN
build/debugsoft/TMPJump/data/dummy.srl
Normal file
Binary file not shown.
@ -23,6 +23,7 @@
|
|||||||
定数 定義
|
定数 定義
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
#define DMA_NO_FS 1
|
#define DMA_NO_FS 1
|
||||||
|
#define APP_NUM 5 // TMP ジャンプ先ロム数
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
変数 定義
|
変数 定義
|
||||||
@ -34,17 +35,20 @@ static KeyInfo gKey;
|
|||||||
static u8 gSrlNumber = 0;
|
static u8 gSrlNumber = 0;
|
||||||
|
|
||||||
// 各 srl の TitleID
|
// 各 srl の TitleID
|
||||||
static u64 gRomTitleIDList[3] =
|
static u64 gRomTitleIDList[APP_NUM] =
|
||||||
{
|
{
|
||||||
0x0003000434333361, // NTR GameCode 433A
|
0x0003000434333341, // NTR GameCode 433A
|
||||||
0x0003000434333461, // TWL-HYB GameCode 434A
|
0x0003000434333441, // TWL-HYB GameCode 434A
|
||||||
0x0003000434333561 // TWL-LTD GameCode 435A
|
0x0003000434333541, // TWL-LTD GameCode 435A
|
||||||
|
0x0003000434353841, // NTR (don't permit TMP jump) GameCode 458A
|
||||||
|
0x0003000434353941 // TWL (don't permit TMP jump) GameCode 459A
|
||||||
};
|
};
|
||||||
|
|
||||||
// 各 srl の場所
|
// 各 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 );
|
OS_DoApplicationJump( gRomTitleIDList[gSrlNumber], OS_APP_JUMP_TMP );
|
||||||
|
// 失敗時にはエラーを下画面に出力して終了
|
||||||
|
PutSubScreen(1, 10, 0xf1, "ERROR: TMP Jump failed!");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gKey.trg & PAD_BUTTON_B)
|
if (gKey.trg & PAD_BUTTON_B)
|
||||||
{
|
{
|
||||||
// TMP ジャンプを実行する
|
// リターンジャンプを試みる
|
||||||
// OS_DoApplicationJump( gRomTitleIDList[gSrlNumber], OS_APP_JUMP_TMP );
|
if(!OS_ReturnToPrevApplication())
|
||||||
// 失敗時にはメッセージを表示(成功時は以降が実行されることはない)
|
{
|
||||||
// OS_TPrintf("TMP jump failed.\n");
|
// 失敗時にはメッセージを表示
|
||||||
|
PutSubScreen(1, 10, 0xf1, "ERROR: Return Jump failed!");
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 方向キー上下で、OS_TMP_APP_PATH へコピーする srl を選択
|
// 方向キー上下で、OS_TMP_APP_PATH へコピーする srl を選択
|
||||||
if (gKey.trg & PAD_KEY_DOWN)
|
if (gKey.trg & PAD_KEY_DOWN)
|
||||||
{
|
{
|
||||||
gSrlNumber++;
|
gSrlNumber++;
|
||||||
if (gSrlNumber > 2)
|
if (gSrlNumber > APP_NUM - 1)
|
||||||
gSrlNumber = 0;
|
gSrlNumber = 0;
|
||||||
}
|
}
|
||||||
else if (gKey.trg & PAD_KEY_UP)
|
else if (gKey.trg & PAD_KEY_UP)
|
||||||
{
|
{
|
||||||
if (gSrlNumber == 0)
|
if (gSrlNumber == 0)
|
||||||
gSrlNumber = 2;
|
gSrlNumber = APP_NUM -1;
|
||||||
else
|
else
|
||||||
gSrlNumber--;
|
gSrlNumber--;
|
||||||
}
|
}
|
||||||
@ -150,12 +159,17 @@ void TwlMain(void)
|
|||||||
static void DrawMainScene(void)
|
static void DrawMainScene(void)
|
||||||
{
|
{
|
||||||
PutMainScreen(1, 1, 0xf2, "Application (Main)");
|
PutMainScreen(1, 1, 0xf2, "Application (Main)");
|
||||||
PutMainScreen(3, 16, 0xff, "Tmp jump to NITRO rom");
|
PutMainScreen(2, 4, 0xff, "B BUTTON: try return jump");
|
||||||
PutMainScreen(3, 18, 0xff, "Tmp jump to TWL-HYB rom");
|
|
||||||
PutMainScreen(3, 20, 0xff, "Tmp jump to TWL-LTD rom");
|
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, "*");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user