From 0bd887d3c1e459a5e698ae026609c52f119e5fc9 Mon Sep 17 00:00:00 2001 From: aoki_ryoma Date: Fri, 4 Jul 2008 06:49:12 +0000 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E7=89=88=EF=BC=9A=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E3=83=AD=E3=82=B0=E5=87=BA=E5=8A=9B=E7=94=A8=E3=83=86?= =?UTF-8?q?=E3=82=B9=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@1786 b08762b0-b915-fc4b-9d8c-17b2551a87ff --- build/tests/ErrorLogTest/ARM9/Makefile | 46 +++ build/tests/ErrorLogTest/ARM9/main.rsf | 269 ++++++++++++++++++ .../ErrorLogTest/ARM9/src/ErrorLogTest.c | 101 +++++++ build/tests/ErrorLogTest/Makefile | 31 ++ build/tests/ErrorLogTest/banner/Makefile | 49 ++++ build/tests/ErrorLogTest/banner/banner_v3.bsf | Bin 0 -> 980 bytes .../ErrorLogTest/banner/icon/gameIcon.bmp | Bin 0 -> 630 bytes 7 files changed, 496 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_v3.bsf create mode 100644 build/tests/ErrorLogTest/banner/icon/gameIcon.bmp diff --git a/build/tests/ErrorLogTest/ARM9/Makefile b/build/tests/ErrorLogTest/ARM9/Makefile new file mode 100644 index 00000000..93bc80e7 --- /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..eec34fb9 --- /dev/null +++ b/build/tests/ErrorLogTest/ARM9/src/ErrorLogTest.c @@ -0,0 +1,101 @@ +/*---------------------------------------------------------------------------* + 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 + +// なぜかバッファサイズが256byteを超えると出力が欠けるようになる +// ダンプを見ると、OS_TPrintf()呼び出し時にもバッファにはちゃんと格納されている模様 +// 原因は現在調査中 +#define BUFSIZE 128 + +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]; + int numEntry = 0; + int totalSize = 0, nowSize = 0; + buf[BUFSIZE] = '\0'; + + FS_InitFile( &file ); + FS_OpenFileEx( &file, "nand:/sys/log/sysmenu.log", FS_FILEMODE_R ); + + while( ( nowSize = FS_ReadFile( &file, buf, BUFSIZE ) ) == BUFSIZE ) + { + char *p = buf; + + OS_TPrintf("%s",buf); + totalSize += nowSize; + + while( (p = STD_SearchChar(p, '#')) != NULL) + { + // '#'が出てきた回数だけエントリ数を増やす + numEntry++; + p++; + } + + } + + OS_TPrintf("%s\n",buf); + totalSize += nowSize; + + OS_TPrintf("num entry : %d\n", numEntry ); + OS_TPrintf("total Size : %d\n", totalSize); + } + + 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..737d6bcd --- /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_v3.bsf b/build/tests/ErrorLogTest/banner/banner_v3.bsf new file mode 100644 index 0000000000000000000000000000000000000000..8644921399440c435aab27e0fac04166dc047f85 GIT binary patch literal 980 zcmc(e&1%9x6ot>$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|u