From 0864af5948761bf3bf9229f2acc9c61de157feeb Mon Sep 17 00:00:00 2001 From: aoki_ryoma Date: Thu, 17 Jul 2008 09:02:33 +0000 Subject: [PATCH] =?UTF-8?q?=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=87=E3=83=BC?= =?UTF-8?q?=E3=82=BF=E3=81=AE=E3=83=AA=E3=82=BB=E3=83=83=E3=83=88=E3=81=A8?= =?UTF-8?q?=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=87=E3=83=BC=E3=82=BF=E3=83=95?= =?UTF-8?q?=E3=82=A1=E3=82=A4=E3=83=AB=E7=A0=B4=E5=A3=8A=E6=A9=9F=E8=83=BD?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= 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@1937 b08762b0-b915-fc4b-9d8c-17b2551a87ff --- build/libraries/Makefile | 2 +- .../ARM9/main_armadillo.rsf | 245 ++++++++++++++++++ .../ARM9/main_racoon.rsf | 245 ++++++++++++++++++ .../ARM9/src/control.c | 175 ++++++++++++- .../ARM9/src/drawFunc.c | 3 +- .../ARM9/src/drawFunc.h | 21 +- .../ARM9/src/strResource.c | 27 +- .../ARM9/src/strResource.h | 1 - .../ARM9/src/viewSystemInfo.h | 4 +- 9 files changed, 689 insertions(+), 34 deletions(-) create mode 100644 build/tests/DisplaySystemInformation/ARM9/main_armadillo.rsf create mode 100644 build/tests/DisplaySystemInformation/ARM9/main_racoon.rsf diff --git a/build/libraries/Makefile b/build/libraries/Makefile index f316ea53..36a963d0 100644 --- a/build/libraries/Makefile +++ b/build/libraries/Makefile @@ -23,7 +23,7 @@ include $(TWL_IPL_RED_ROOT)/build/buildtools/commondefs SUBDIRS_P = \ init \ - os \ +# os \ pxi \ fs \ mi \ diff --git a/build/tests/DisplaySystemInformation/ARM9/main_armadillo.rsf b/build/tests/DisplaySystemInformation/ARM9/main_armadillo.rsf new file mode 100644 index 00000000..df4af035 --- /dev/null +++ b/build/tests/DisplaySystemInformation/ARM9/main_armadillo.rsf @@ -0,0 +1,245 @@ +#---------------------------------------------------------------------------- +# 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 "YourAppName" + + # + # 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 MAP_TS_SCR + + # + # CardRegion: card region [Japan/America/Europe/Australia/China/Korea] + # + CardRegion Japan + + # + # CommonClientKey: launcher deliver common client Key [TRUE/FALSE] + # + #CommonClientKey FALSE + + # + # HwAESSlotB: launcher deliver HW AES slot B setting [TRUE/FALSE] + # + #HwAESSlotB FALSE + + # + # HwAESSlotC: launcher deliver HW AES slot C setting [TRUE/FALSE] + # + #HwAESSlotC FALSE + + # + # 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 + LockSCFG FALSE + + + ### + #### END +} + +AppendProperty +{ + # + # Publisher : "Nintendo" + # don't have to edit + Publisher Nintendo + + # + # Application type : [USER/SYSTEM] + # don't have to edit + AppType SYSTEM + + # + # launch title on the launcher : [TRUE/FALSE] + # don't have to edit + Launch TRUE + + # + # Boot allowed Media: [GameCard] + # + Media NAND + + # + # Data only title : [TRUE/FALSE] + # don't have to edit + #DataOnly FALSE + + # + # Secure title : [TRUE/FALSE] + # don't have to edit + Secure TRUE + + # + # 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 32K + + # + # Private save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M] + # + #PrivateSaveDataSize 16K + + # + # Enable SubBannerFile + #SubBannerFile TRUE + +} + +RomSpec +{ + Offset 0x00000000 + Segment ALL + HostRoot ../../../systemMenu_RED/data + Root /data + File NTR_IPL_font_m.NFTR + +} diff --git a/build/tests/DisplaySystemInformation/ARM9/main_racoon.rsf b/build/tests/DisplaySystemInformation/ARM9/main_racoon.rsf new file mode 100644 index 00000000..9f06a64c --- /dev/null +++ b/build/tests/DisplaySystemInformation/ARM9/main_racoon.rsf @@ -0,0 +1,245 @@ +#---------------------------------------------------------------------------- +# 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 "YourAppName" + + # + # 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 Japan + + # + # CommonClientKey: launcher deliver common client Key [TRUE/FALSE] + # + #CommonClientKey FALSE + + # + # HwAESSlotB: launcher deliver HW AES slot B setting [TRUE/FALSE] + # + #HwAESSlotB FALSE + + # + # HwAESSlotC: launcher deliver HW AES slot C setting [TRUE/FALSE] + # + #HwAESSlotC FALSE + + # + # 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 + LockSCFG FALSE + + + ### + #### END +} + +AppendProperty +{ + # + # Publisher : "Nintendo" + # don't have to edit + Publisher Nintendo + + # + # Application type : [USER/SYSTEM] + # don't have to edit + AppType SYSTEM + + # + # launch title on the launcher : [TRUE/FALSE] + # don't have to edit + Launch TRUE + + # + # Boot allowed Media: [GameCard] + # + Media NAND + + # + # Data only title : [TRUE/FALSE] + # don't have to edit + #DataOnly FALSE + + # + # Secure title : [TRUE/FALSE] + # don't have to edit + Secure TRUE + + # + # 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 32K + + # + # Private save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M] + # + #PrivateSaveDataSize 16K + + # + # Enable SubBannerFile + #SubBannerFile TRUE + +} + +RomSpec +{ + Offset 0x00000000 + Segment ALL + HostRoot ../../../systemMenu_RED/data + Root /data + File NTR_IPL_font_m.NFTR + +} diff --git a/build/tests/DisplaySystemInformation/ARM9/src/control.c b/build/tests/DisplaySystemInformation/ARM9/src/control.c index d2f2da0e..ae58eae6 100644 --- a/build/tests/DisplaySystemInformation/ARM9/src/control.c +++ b/build/tests/DisplaySystemInformation/ARM9/src/control.c @@ -16,13 +16,41 @@ *---------------------------------------------------------------------------*/ #include +#include #include "misc.h" #include "drawFunc.h" #include "control.h" #include "strResource.h" #include "viewSystemInfo.h" +#define SAVE_COUNT_MASK 0x7f // saveCountの値の範囲をマスクする。(0x00-0x7f) + + +// TSFヘッダ +typedef struct TSFHeader{ + union digest { + u8 sha1[ SVC_SHA1_DIGEST_SIZE ]; // SHA-1ダイジェスト + u8 rsa[ RSA_KEY_LENGTH ]; // RSA署名 + u8 dst[ RSA_KEY_LENGTH ]; // 転送用の最大サイズ要素 + }digest; + u8 version; // データver. + u8 saveCount; // セーブカウント(ミラーリングしないファイルは使用しない) + u8 rsv[2]; // 予約 + u32 bodyLength; // データ長 +}TSFHeader; // 134bytes + +static const char *s_TSDPath[] = { + (const char *)"nand:/shared1/TWLCFG0.dat", + (const char *)"nand:/shared1/TWLCFG1.dat", +}; + + static int selectLine[ROOTMENU_SIZE+1]; +void resetUserData( int idx ); +void breakUserData( int idx ); +static void TSDi_ClearSettingsDirect( LCFGTWLSettingsData *pTSD ); +static BOOL LCFGi_TSD_WriteSettingsDirectForRecovery( const LCFGTWLSettingsData *pSrcInfo, int index ); +BOOL LCFGi_TSF_WriteFile( char *pPath, TSFHeader *pHeader, const void *pSrcBody, u8 *pSaveCount ); ChangeCotnrolResult changeControl( int *menu, int *line, int *changeLine, int *changeMode ) { @@ -172,7 +200,7 @@ BOOL control( int *menu, int *line, int *changeLine, int *changeMode ) if( pad.trg & PAD_BUTTON_A ) { - if(*menu == MENU_ROOT) + if(*menu == MENU_ROOT && *line <= MENU_VERSION) { controlFlag = TRUE; @@ -183,6 +211,16 @@ BOOL control( int *menu, int *line, int *changeLine, int *changeMode ) *menu = *line; *line = selectLine[*menu]; } + else if( *menu == MENU_ROOT && *line == MENU_RESET_INFO ) + { + resetUserData(0); + resetUserData(1); + } + else if( *menu == MENU_ROOT && *line <= MENU_BREAK_DATA ) + { + breakUserData(0); + breakUserData(1); + } else if( gAllInfo[*menu][*line].changable ) { controlFlag = TRUE; @@ -243,4 +281,137 @@ int getMaxLine( int menu , int page ) if( menu == MENU_ROOT) return ROOTMENU_SIZE; return s_pageOffset[menu][page+1] - s_pageOffset[menu][page]; -} \ No newline at end of file +} + +void resetUserData( int idx ) +// idx(0 or 1)番目のユーザデータをリセットする +{ + u8 *dataBuf = (u8*) Alloc (LCFG_READ_TEMP); + + LCFG_ReadTWLSettings( (u8 (*)[ LCFG_READ_TEMP ])dataBuf ); + TSDi_ClearSettingsDirect( (LCFGTWLSettingsData *)(&dataBuf[ LCFG_TEMP_BUFFER_SIZE*idx ]) ); + LCFGi_TSD_WriteSettingsDirectForRecovery( (LCFGTWLSettingsData *)&dataBuf[ LCFG_TEMP_BUFFER_SIZE*idx ], idx ); +} + +void breakUserData( int idx ) +{ + // LCFG APIを使わずに、FSレベルでファイルを読んで、データを破壊してから書き戻す + FSFile file; + FSResult res; + u8 *fileBuf = (u8*) Alloc ( LCFG_TEMP_BUFFER_SIZE ); + + FS_InitFile( &file ); + + if( !FS_OpenFileEx( &file, s_TSDPath[idx], FS_FILEMODE_R | FS_FILEMODE_W ) ) + { + OS_TPrintf("OpenFile failed. result: %d path: %s\n", FS_GetArchiveResultCode(&file), s_TSDPath[idx]); + return; + } +/* + if( FS_ReadFile( &file, fileBuf, LCFG_TEMP_BUFFER_SIZE ) == -1 ) + { + OS_TPrintf("readFile failed. path: %s\n", s_TSDPath[idx]); + return; + } +*/ + // 適当にデータを壊す + MI_CpuFill8( fileBuf, 0xFF, LCFG_TEMP_BUFFER_SIZE ); + + // データの書き戻し + FS_SeekFileToBegin( &file ); + + if( FS_WriteFile( &file, fileBuf, LCFG_TEMP_BUFFER_SIZE ) == -1 ) + { + OS_TPrintf("writeFile failed. path: %s\n", s_TSDPath[idx]); + return; + } + + OS_TPrintf("Breaking UserData Succeeded. path: %s\n", s_TSDPath[idx]); +} + +// TWL設定データの直接クリア +static void TSDi_ClearSettingsDirect( LCFGTWLSettingsData *pTSD ) +{ + int i; + MI_CpuClearFast( pTSD, sizeof(LCFGTWLSettingsData) ); + // 初期値が"0"以外のもの + pTSD->owner.userColor = OS_FAVORITE_COLOR_MAGENTA; // 2008.06.23 UIG松島さんの要望により + pTSD->owner.birthday.month = 1; + pTSD->owner.birthday.day = 1; + pTSD->flags.isAvailableWireless = 1; + pTSD->launcherStatus.InstalledSoftBoxCount = 0; + pTSD->launcherStatus.freeSoftBoxCount = LCFG_TWL_FREE_SOFT_BOX_COUNT_MAX; + pTSD->agreeEulaVersion[ 0 ] = 1; + // 言語コードはHW情報の言語ビットマップから算出 + for( i = 0; i < LCFG_TWL_LANG_CODE_MAX; i++ ) { + if( OS_GetValidLanguageBitmap() & ( 0x0001 << i ) ) { // ValidLanguageBitmap情報は、ランチャーがMMEMにロードしたものを使用 + pTSD->language = (LCFGTWLLangCode)i; + break; + } + } +} + + + + +// 指定データの値をファイルに直接ライト(リカバリ用にs_indexTSDの変更をライト後に行う) +static BOOL LCFGi_TSD_WriteSettingsDirectForRecovery( const LCFGTWLSettingsData *pSrcInfo, int index ) +{ + u8 saveCount = 0; + // ヘッダの作成 + TSFHeader header; + MI_CpuClear8( &header, sizeof(TSFHeader) ); + header.version = LCFG_TWL_SETTINGS_DATA_VERSION; + header.bodyLength = sizeof(LCFGTWLSettingsData); + SVC_CalcSHA1( header.digest.sha1, pSrcInfo, sizeof(LCFGTWLSettingsData) ); + + // ファイルにライト + if( !LCFGi_TSF_WriteFile( (char *)s_TSDPath[ index ], + &header, + (const void *)pSrcInfo, + &saveCount ) ) { + return FALSE; + } + + return TRUE; +} + +// TWLファイルのライト +BOOL LCFGi_TSF_WriteFile( char *pPath, TSFHeader *pHeader, const void *pSrcBody, u8 *pSaveCount ) +{ + BOOL retval = FALSE; + FSFile file; + FS_InitFile( &file ); + + if( pSaveCount ) { + *pSaveCount = (u8)( ( *pSaveCount + 1 ) & SAVE_COUNT_MASK ); + pHeader->saveCount = *pSaveCount; + }else { + pHeader->saveCount = 0; + } + + OS_TPrintf( "Write > %s : %d\n", pPath, pHeader->saveCount ); + + // ファイルオープン + if( !FS_OpenFileEx( &file, pPath, FS_FILEMODE_R | FS_FILEMODE_W ) ) { // R|Wモードで開くと、既存ファイルを残したまま更新。 + OS_TPrintf( "Write : file open error. %s\n", pPath ); + return FALSE; + } + + // ライト + if( FS_WriteFile( &file, pHeader, sizeof(TSFHeader) ) < sizeof(TSFHeader) ) { + OS_TPrintf( "Write : file header write error. %s\n", pPath ); + goto END; + } + if( FS_WriteFile( &file, pSrcBody, (long)pHeader->bodyLength ) < pHeader->bodyLength ) { + OS_TPrintf( "Write : file body write error. %s\n", pPath ); + goto END; + } + + retval = TRUE; +END: + // ファイルクローズ + (void)FS_CloseFile( &file ); + + return retval; +} diff --git a/build/tests/DisplaySystemInformation/ARM9/src/drawFunc.c b/build/tests/DisplaySystemInformation/ARM9/src/drawFunc.c index 5b8b5f89..8c7a5bfc 100644 --- a/build/tests/DisplaySystemInformation/ARM9/src/drawFunc.c +++ b/build/tests/DisplaySystemInformation/ARM9/src/drawFunc.c @@ -99,7 +99,7 @@ void drawHeader( int menu, int line) if( menu != MENU_ROOT ) { - swprintf(buf, 256, L"Root > %s", s_strMenuName[menu] ); + swprintf(buf, 256, L"Root > %s", s_strRootMenu[menu] ); PutStringUTF16Sub( FOOTER_LEFT, FOOTER_UP + FOOTER_MENU * LINE_OFFSET, TXT_COLOR_BLUE, buf ); swprintf(buf, 256, L"%d / %d", line+1 , s_numMenu[menu] ); @@ -194,6 +194,7 @@ void printValue( int menu,int entryLine, int drawOffset, DispInfoEntry *entry ) if( menu == MENU_PARENTAL && entryLine == PARENTAL_PASSWORD ) { PrintfSJIS( VALUE_LEFT, VALUE_UP + LINE_OFFSET*drawOffset, TXT_COLOR_BLACK, "%04d", entry->iValue ); + return; } diff --git a/build/tests/DisplaySystemInformation/ARM9/src/drawFunc.h b/build/tests/DisplaySystemInformation/ARM9/src/drawFunc.h index e51c2040..e0cf3a14 100644 --- a/build/tests/DisplaySystemInformation/ARM9/src/drawFunc.h +++ b/build/tests/DisplaySystemInformation/ARM9/src/drawFunc.h @@ -31,7 +31,7 @@ extern "C" { #define DISP_NUM_LINES 11 // 一ページあたりの項目数 -#define ROOTMENU_SIZE 7 +#define ROOTMENU_SIZE 9 #define OWNERMENU_SIZE 6 #define PARENTALMENU_SIZE 12 #define NORMAL_HW_MENU_SIZE 4 @@ -42,14 +42,17 @@ extern "C" { // メニューID -#define MENU_ROOT 10 -#define MENU_OWNER 0 -#define MENU_PARENTAL 1 -#define MENU_NORMAL_HW 2 -#define MENU_SECURE_HW 3 -#define MENU_SCFG_ARM7 4 -#define MENU_SCFG_ARM9 5 -#define MENU_VERSION 6 +#define MENU_ROOT 10 +#define MENU_OWNER 0 +#define MENU_PARENTAL 1 +#define MENU_NORMAL_HW 2 +#define MENU_SECURE_HW 3 +#define MENU_SCFG_ARM7 4 +#define MENU_SCFG_ARM9 5 +#define MENU_VERSION 6 +#define MENU_RESET_INFO 7 +#define MENU_BREAK_DATA 8 + // 行番号 #define OWNER_LANGUAGE 0 diff --git a/build/tests/DisplaySystemInformation/ARM9/src/strResource.c b/build/tests/DisplaySystemInformation/ARM9/src/strResource.c index 8a1e484d..2d2d6350 100644 --- a/build/tests/DisplaySystemInformation/ARM9/src/strResource.c +++ b/build/tests/DisplaySystemInformation/ARM9/src/strResource.c @@ -66,26 +66,17 @@ const char *s_strSCFGViewMode[] = { }; const char *s_strRootMenu[] = { - "Owner", - "Parental control", - "Normal Hardware Info", - "Secure Hardware Info", - "SCFG Info (ARM7 side)", - "SCFG Info (ARM9 side)", - "Content Version" + "< Owner >", + "< Parental control >", + "< Normal Hardware Info >", + "< Secure Hardware Info >", + "< SCFG Info (ARM7 side) >", + "< SCFG Info (ARM9 side) >", + "< Content Version >", + "Reset HW Setting to Default", + "break HW Setting" }; -const char *s_strMenuName[] = { - "Owner", - "Parental control", - "Normal Hardware Info", - "Secure Hardware Info", - "SCFG Info (ARM7 side)", - "SCFG Info (ARM9 side)", - "Content Version" -}; - - const char *s_strOwnerMenu[] = { "Language", "Favorite color", diff --git a/build/tests/DisplaySystemInformation/ARM9/src/strResource.h b/build/tests/DisplaySystemInformation/ARM9/src/strResource.h index 8d3d54e9..eca806f0 100644 --- a/build/tests/DisplaySystemInformation/ARM9/src/strResource.h +++ b/build/tests/DisplaySystemInformation/ARM9/src/strResource.h @@ -23,7 +23,6 @@ extern const int s_pageOffset[ROOTMENU_SIZE][MAXPAGE]; extern const u8 s_numMenu[]; extern const char *s_strRootMenu[]; -extern const char *s_strMenuName[]; extern const char *s_strOwnerMenu[]; extern const char *s_strParentalMenu[]; extern const char *s_strNormalHWMenu[]; diff --git a/build/tests/DisplaySystemInformation/ARM9/src/viewSystemInfo.h b/build/tests/DisplaySystemInformation/ARM9/src/viewSystemInfo.h index 436af4ec..785a78ff 100644 --- a/build/tests/DisplaySystemInformation/ARM9/src/viewSystemInfo.h +++ b/build/tests/DisplaySystemInformation/ARM9/src/viewSystemInfo.h @@ -11,8 +11,8 @@ in whole or in part, without the prior written consent of Nintendo. $Date:: $ - $Rev$ - $Author$ + $Rev:$ + $Author:$ *---------------------------------------------------------------------------*/ #ifndef __LOAD_VIEW_INFO__