From bcfc548548399129633c30c20b938c2b69d829d2 Mon Sep 17 00:00:00 2001 From: aoki_ryoma Date: Thu, 3 Jul 2008 08:50:49 +0000 Subject: [PATCH] git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/branches/20080626_SDK500fc_plus5_branch@1764 b08762b0-b915-fc4b-9d8c-17b2551a87ff --- build/tests/ErrorLogTest/ARM9/Makefile | 46 +++ build/tests/ErrorLogTest/ARM9/main.rsf | 269 ++++++++++++++++++ .../ErrorLogTest/ARM9/src/ErrorLogTest.c | 81 ++++++ build/tests/ErrorLogTest/Makefile | 31 ++ build/tests/ErrorLogTest/banner/Makefile | 49 ++++ build/tests/ErrorLogTest/banner/banner.bnr | Bin 0 -> 9152 bytes build/tests/ErrorLogTest/banner/banner_v3.bsf | Bin 0 -> 980 bytes .../ErrorLogTest/banner/icon/gameIcon.bmp | Bin 0 -> 630 bytes .../ErrorLogTest/banner/icon/gameIcon.nbfc | Bin 0 -> 512 bytes .../ErrorLogTest/banner/icon/gameIcon.nbfp | Bin 0 -> 32 bytes .../ErrorLogTest/banner/icon/gameIcon.nbfs | Bin 0 -> 32 bytes 11 files changed, 476 insertions(+) create mode 100644 build/tests/ErrorLogTest/ARM9/Makefile create mode 100644 build/tests/ErrorLogTest/ARM9/main.rsf create mode 100644 build/tests/ErrorLogTest/ARM9/src/ErrorLogTest.c create mode 100644 build/tests/ErrorLogTest/Makefile create mode 100644 build/tests/ErrorLogTest/banner/Makefile create mode 100644 build/tests/ErrorLogTest/banner/banner.bnr create mode 100644 build/tests/ErrorLogTest/banner/banner_v3.bsf create mode 100644 build/tests/ErrorLogTest/banner/icon/gameIcon.bmp create mode 100644 build/tests/ErrorLogTest/banner/icon/gameIcon.nbfc create mode 100644 build/tests/ErrorLogTest/banner/icon/gameIcon.nbfp create mode 100644 build/tests/ErrorLogTest/banner/icon/gameIcon.nbfs diff --git a/build/tests/ErrorLogTest/ARM9/Makefile b/build/tests/ErrorLogTest/ARM9/Makefile new file mode 100644 index 00000000..47e7809e --- /dev/null +++ b/build/tests/ErrorLogTest/ARM9/Makefile @@ -0,0 +1,46 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - tests - ErrorLogTest +# File: Makefile +# +# 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:$ +#---------------------------------------------------------------------------- +SUBDIRS = $(TWL_IPL_RED_ROOT)/build/libraries_sysmenu/errorLog + +TARGET_FIRM = SYSTEMMENU +TARGET_PLATFORM = TWL +TWL_ARCHGEN = LIMITED + + + + +#---------------------------------------------------------------------------- + +TARGET_BIN = main.srl + +SRCS = ErrorLogTest.c + +LLIBRARIES += liberrorlog$(TWL_LIBSUFFIX).a + +ROM_SPEC = main.rsf + +include $(TWL_IPL_RED_ROOT)/build/buildtools/commondefs +MAKEROM = $(TWL_TOOLSDIR)/bin/makerom.TWL.secure.exe + +#---------------------------------------------------------------------------- + +do-build: $(TARGETS) + +include $(TWL_IPL_RED_ROOT)/build/buildtools/modulerules + +#===== End of Makefile ===== diff --git a/build/tests/ErrorLogTest/ARM9/main.rsf b/build/tests/ErrorLogTest/ARM9/main.rsf new file mode 100644 index 00000000..4b489540 --- /dev/null +++ b/build/tests/ErrorLogTest/ARM9/main.rsf @@ -0,0 +1,269 @@ +#---------------------------------------------------------------------------- +# 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 "MY APP NAME" + + # + # MAKER CODE: Your company ID# in 2 ascii words + # issued by NINTENDO + # + #MakerCode "00" + + # + # 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 ./etc/rom_header.template.sbin + + # + # BANNER FILE: generated from Banner Spec File + # + #BannerFile ./etc/myGameBanner.bnr + BannerFile $(TWLSDK_ROOT)/include/twl/specfiles/default.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 + + # + # SDCardAccess: sd card access control [TRUE/FALSE] + # + #SDCardAccess FALSE + + # + # NANDAccess: NAND access control [TRUE/FALSE] + # + #NANDAccess 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 + + # + # Disable debug [TRUE/FALSE] + # + DisableDebug FALSE + + # + # Agree EULA [TRUE/FALSE] + # + #AgreeEULA FALSE + + # + # Agree EULA version [0 - 255] + # + #AgreeEULAVersion 0 + + ### + #### END +} + +AppendProperty +{ + # + # Boot allowed Media: [GameCard] + # + Media NAND + + # + # GameCode for TitleID : Your GameCode in 4 ascii words + # + #GameCode ABCJ + + # + # 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 + + # + # Use Shared2 file index: [0-65535] + #Shared2FileIndex 0 + + # + # Use Shared2 file size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M] + #Shared2FileSize 0K + + # + # Game card power on: [TRUE/FALSE] + # + #GameCardOn FALSE + + Secure TRUE + AppType System +} + +RomSpec +{ + Offset 0x00000000 + Segment ALL + HostRoot ../../../systemMenu_RED/data + Root /data + File NTR_IPL_font_m.NFTR +} + +Rating +{ + # + # Permited age to play for each rating organization [0 - 31, ALWAYS, FREE] + # + # 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 / ALWAYS / FREE ] + + CERO FREE +# ESRB FREE +# USK FREE +# PEGI_GEN FREE +# PEGI_PRT FREE +# PEGI_BBFC FREE +# OFLC FREE +# GRB FREE +} diff --git a/build/tests/ErrorLogTest/ARM9/src/ErrorLogTest.c b/build/tests/ErrorLogTest/ARM9/src/ErrorLogTest.c new file mode 100644 index 00000000..59503b8e --- /dev/null +++ b/build/tests/ErrorLogTest/ARM9/src/ErrorLogTest.c @@ -0,0 +1,81 @@ +/*---------------------------------------------------------------------------* + Project: TwlIPL - ErrorLog + File: errorLog.h + + Copyright **** 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 + +#define BUFSIZE 512 + +void VBlankIntr(void); + + +void TwlMain( void ) +{ + + OS_Init(); + RTC_Init(); + + //---- interrupt setting + OS_SetIrqFunction(OS_IE_V_BLANK, VBlankIntr); + OS_EnableIrqMask(OS_IE_V_BLANK); + OS_EnableIrq(); + GX_VBlankIntr(TRUE); + + FS_Init( FS_DMA_NOT_USE ); + + { + int test = 0; + + for( test = 0; test < 10 ; test++ ) + { + // エラーログの書き込み + OS_TPrintf("test %d/10 ...\n", test+1 ); + EL_WriteErrorLog(test); + } + } + + // イリーガルなエラーコードは怒られる + EL_WriteErrorLog(99); + + OS_TPrintf( "*** log file data\n" ); + + { + // ログファイルの中身を出力 + FSFile file; + char buf[BUFSIZE+1]; + buf[BUFSIZE] = '\0'; + + FS_InitFile( &file ); + FS_OpenFileEx( &file, "nand:/sys/log/sysmenu.log", FS_FILEMODE_R ); + + while( FS_ReadFile( &file, buf, BUFSIZE ) == BUFSIZE ) + { + OS_TPrintf("%s",buf); + } + + OS_TPrintf("%s\n",buf); + } + + OS_TPrintf( "*** End of demo\n" ); + OS_Terminate(); +} + +void VBlankIntr(void) +{ + OS_SetIrqCheckFlag(OS_IE_V_BLANK); +} + diff --git a/build/tests/ErrorLogTest/Makefile b/build/tests/ErrorLogTest/Makefile new file mode 100644 index 00000000..913efa66 --- /dev/null +++ b/build/tests/ErrorLogTest/Makefile @@ -0,0 +1,31 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - tests - ErrorLogTest +# File: Makefile +# +# 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:$ +#---------------------------------------------------------------------------- +SUBDIRS = ARM9 banner + +#---------------------------------------------------------------------------- + +include $(TWL_IPL_RED_ROOT)/build/buildtools/commondefs + + +#---------------------------------------------------------------------------- + +do-build: $(TARGETS) + +include $(TWL_IPL_RED_ROOT)/build/buildtools/modulerules + +#===== End of Makefile ===== diff --git a/build/tests/ErrorLogTest/banner/Makefile b/build/tests/ErrorLogTest/banner/Makefile new file mode 100644 index 00000000..1f8aa1d4 --- /dev/null +++ b/build/tests/ErrorLogTest/banner/Makefile @@ -0,0 +1,49 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlIPL +# File: Makefile +# +# 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 $(TWL_IPL_RED_ROOT)/build/buildtools/commondefs + +ICON_DIR = ./icon + +BANNER_ICON = $(ICON_DIR)/gameIcon.bmp +BANNER_SPEC = banner_v3.bsf + +TARGETS = banner.bnr +INSTALL_DIR = ./ +INSTALL_TARGETS = $(TARGETS) + +BANNER_ICON_NAME = $(basename $(BANNER_ICON)) + +LDIRT_CLEAN = $(TARGETS) \ + $(BANNER_ICON_NAME).nbfs \ + $(BANNER_ICON_NAME).nbfc \ + $(BANNER_ICON_NAME).nbfp \ + $(TARGETS:.bnr=.srl) + +include $(TWL_IPL_RED_ROOT)/build/buildtools/modulerules + +#---------------------------------------------------------------------------- +# build +#---------------------------------------------------------------------------- +do-build: $(TARGETS) + +$(TARGETS): $(BANNER_SPEC) $(BANNER_ICON) + $(NTEXCONV) -no -bg -bgb -bgnc $(BANNER_ICON) >/dev/null && \ + $(MAKEBANNER) -N $(BANNER_ICON_NAME) $(BANNER_SPEC) $(TARGETS) + +# diff --git a/build/tests/ErrorLogTest/banner/banner.bnr b/build/tests/ErrorLogTest/banner/banner.bnr new file mode 100644 index 0000000000000000000000000000000000000000..b46fffb3ef773e57fdb7bcf80074cd2a255236a0 GIT binary patch literal 9152 zcmeI2F=!J}7=T~s(m}+F4z6CZILak~DmpapEK~<6ylWv+2-O#p##XBE0xfa9h!h8x z%itioykH?sjNofC8K;+KYPV|!G2n9N<{1BEl!DkrLjOlTUf%of{=4_xyE}N?ROH92 zt+!L>O`DuthQr~{APB-^-w%Di3+T}A0=gJ>^#H;{2nSkgrS+aFawx&EzuZ>pep|^= z9Cr1Ul2s+8#~EYL)UxWi(yO=-Ccf6wo-6E1N!T{c+4?TG#T;;(+o3KVgqpKZ4+21q z**j99I;sIOvtN^JUrPT2`A{I!4qmW{p39jUx~yWNYQz`%7OhPhXk8`tsVr zOnCFc?85x(g zy*Pfn{y6{f{>SGZKL5|+`)|Tu-+20H01co4G=K)sz-bJ?0uHVZo#FMN)65y%2MwSB nG=K)s02)98XaEhM0W^RHCeOfMz7LqZ0sY$$Lf>J)buA)v;j&`1MMRpm`!P`r#at7tJ*O*U4&8 zcsd#}gYmJ&uF*cv@%<~d9Tj*nTW6h)L5`9F~O}H@z=Nnwa)TNQ{GKzecX=Gj4 z-XI+e8CMltmwb({9JZG_BRAL$f89{eoD=-kWaa9SSrYL&vLUwZ9$!X$N1k;I-EYPy BkNE%q literal 0 HcmV?d00001 diff --git a/build/tests/ErrorLogTest/banner/icon/gameIcon.bmp b/build/tests/ErrorLogTest/banner/icon/gameIcon.bmp new file mode 100644 index 0000000000000000000000000000000000000000..8ec56f1cb8439577aae80658921dc540a9bd6dfc GIT binary patch literal 630 zcmY+BKX21O7{(8T#0Z(20Y@2-Jk^e}L}G|L2);9H_b8K_SR3yWp%k)n8x z6xGKF0m-*QrKtA_XgndB(ttlf?eO}K5IoYI{k!+^H$S@4l?RHVW-$&!|7)>S<N4|DcCXFFICQ-#Dv5}pLUv$dfI6>C}}5vSarZL=O)xUDx*;9z#c;IsZRpWV1j z(3aUYFw{f7{OP?tq8-x4IK4a-!1L8-;2y9XiEtV3Ud3_8>X|unimRB>w?z4=vCkdQ669r4qnJM+$a~AR7e)@Jw~cP7R$p(P#ii zt_zfjr+TB~DcKkgK|E6V1Lw(O1sptxSG=@f-kK4|$3MAm3uC@6jBaw=>WtB)(OPlF7`|FvDydZ=F>X0)-zzC-kqb&8qxP6n zafA*zt?lT(ww%>=>yg>JeKfUsoFLu5n`m~YwflwrLw+_H`h_0;D3H{HtGt{`F}Tjf z_PfYZ#(utdKkHxe*`MEhCJe8#UP^h7!Csd_idYwbwE<|m1I-zm#^j;g=m&+0J++h@ zwam-Gl~9ARP^aTeo{oF+X`i$OG45pvHz?4+M^t1nK zpiPp!I8I0$CFBDNqa+T)BnpFrO|cYf`LDs(Ids;7^EH-U;61hgfMYTCcX7-J7BB`K pMuA||LGb*M#MiivBZ{IRz!Ah)ObCgZyg4Hbf`i~c`0+c8TW`aF{s900 literal 0 HcmV?d00001 diff --git a/build/tests/ErrorLogTest/banner/icon/gameIcon.nbfp b/build/tests/ErrorLogTest/banner/icon/gameIcon.nbfp new file mode 100644 index 0000000000000000000000000000000000000000..6a74ff163cf0e3744b3562b646751c885ef1dbad GIT binary patch literal 32 ocmZRmN#f+)#~s_BMl*^cY^1#kd) literal 0 HcmV?d00001