From d71aa59ecd4712c5da00c2ca89acf5b1bf5edd54 Mon Sep 17 00:00:00 2001 From: aoki_ryoma Date: Fri, 18 Jul 2008 13:51:00 +0000 Subject: [PATCH] =?UTF-8?q?VersionInfo=E3=81=AE=E6=8F=8F=E7=94=BB=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E3=81=AE=E4=BF=AE=E6=AD=A3=E3=80=82=20Makefile?= =?UTF-8?q?=E3=81=A7secure,=20normal=20with=20SCFG,=20normal=20without=20S?= =?UTF-8?q?CFG=E3=81=AE=E4=B8=89=E3=81=A4=E3=82=92=E4=BD=9C=E6=88=90?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F?= =?UTF-8?q?=E3=80=82?= 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@1947 b08762b0-b915-fc4b-9d8c-17b2551a87ff --- .../ARM7_racoon/Makefile | 2 - .../ARM7_racoon/racoon.lcf.template | 7 + .../ARM7_racoon/racoon.lsf | 23 ++- .../DisplaySystemInformation/ARM9/Makefile | 4 +- .../ARM9/src/control.c | 5 +- .../ARM9/src/drawFunc.c | 69 +++++--- .../DisplaySystemInformation/ARM9/src/main.c | 2 +- .../ARM9/src/strResource.c | 15 +- .../ARM9/src/strResource.h | 21 ++- .../ARM9/src/viewSystemInfo.c | 159 ++++++++++++++++-- 10 files changed, 236 insertions(+), 71 deletions(-) diff --git a/build/tests/DisplaySystemInformation/ARM7_racoon/Makefile b/build/tests/DisplaySystemInformation/ARM7_racoon/Makefile index fe4c0802..8c504b23 100644 --- a/build/tests/DisplaySystemInformation/ARM7_racoon/Makefile +++ b/build/tests/DisplaySystemInformation/ARM7_racoon/Makefile @@ -45,8 +45,6 @@ include $(TWLSDK_ROOT)/build/buildtools/commondefs DISP_INFO = $(call eupath,$(TWL_IPL_RED_ROOT)/build/tests/DisplaySystemInformation) -#MACRO_FLAGS += -DSDK_ARM7COMP_LTD - ifeq ($(TWL_PLATFORM),BB) MAKELCF_FLAGS += -DADDRESS_LTDWRAM='0x037e0000' else diff --git a/build/tests/DisplaySystemInformation/ARM7_racoon/racoon.lcf.template b/build/tests/DisplaySystemInformation/ARM7_racoon/racoon.lcf.template index 58bcf2a1..90b672ea 100644 --- a/build/tests/DisplaySystemInformation/ARM7_racoon/racoon.lcf.template +++ b/build/tests/DisplaySystemInformation/ARM7_racoon/racoon.lcf.template @@ -45,6 +45,7 @@ MEMORY check.LTDMAIN (RWX) : ORIGIN = 0x02f88000, LENGTH = 0x74000 > ltdmain.check + check.RSVWRAM (RWX) : ORIGIN = 0x03040000, LENGTH = 0x08000 > rsvwram.check } KEEP_SECTION @@ -925,4 +926,10 @@ SECTIONS } > check.LTDMAIN + .check.RSVWRAM: + { + . = SDK_LTDAUTOLOAD.RSVWRAM.BSS_END; + + } > check.RSVWRAM + } diff --git a/build/tests/DisplaySystemInformation/ARM7_racoon/racoon.lsf b/build/tests/DisplaySystemInformation/ARM7_racoon/racoon.lsf index f15f1c31..4a239534 100644 --- a/build/tests/DisplaySystemInformation/ARM7_racoon/racoon.lsf +++ b/build/tests/DisplaySystemInformation/ARM7_racoon/racoon.lsf @@ -132,6 +132,17 @@ Autoload WRAM Object OBJECT( WaitLoop_BbpAccess , libwl_sp$(LIBSUFFIX).a ) (.text) Object OBJECT( WaitLoop_RfAccess , libwl_sp$(LIBSUFFIX).a ) (.text) + +} + +#-------- +Ltdautoload RSVWRAM +{ + Address 0x03040000 + Object * (.rsvwram) + Library libathdrv_sp$(LIBSUFFIX).a (.bss) + Library libathdrv_sp$(LIBSUFFIX).a (.data) + ##### # Sub-routines in TWL WIRELESS Driver , that should be on WRAM. Object OBJECT( HTCSendPktCompletionHandler, libathdrv_sp$(LIBSUFFIX).a ) (.text) @@ -187,18 +198,6 @@ Autoload WRAM Object OBJECT( bmiBufferSend, libathdrv_sp$(LIBSUFFIX).a ) (.text) Object OBJECT( BMIWriteMemory, libathdrv_sp$(LIBSUFFIX).a ) (.text) - Object OBJECT( wpa_sm_rx_eapol , libwpa_sp$(LIBSUFFIX).a ) (.text) - - -} - -#-------- -Ltdautoload RSVWRAM -{ - Address 0x03040000 - Object * (.rsvwram) - Library libathdrv_sp$(LIBSUFFIX).a (.bss) - Library libathdrv_sp$(LIBSUFFIX).a (.data) # FATFS core symbols Object OBJECT(FATFSi_lfi2text, libfatfs_sp$(LIBSUFFIX).a) (.text) # 360 BYTEs diff --git a/build/tests/DisplaySystemInformation/ARM9/Makefile b/build/tests/DisplaySystemInformation/ARM9/Makefile index 3019e69c..8af79702 100644 --- a/build/tests/DisplaySystemInformation/ARM9/Makefile +++ b/build/tests/DisplaySystemInformation/ARM9/Makefile @@ -17,8 +17,8 @@ #---------------------------------------------------------------------------- SUBDIRS = -SUBMAKES = Makefile.racoon_SCFG Makefile.racoon_noSCFG Makefile.armadillo - +#SUBMAKES = Makefile.racoon_SCFG Makefile.racoon_noSCFG Makefile.armadillo +SUBMAKES = Makefile.armadillo include $(TWL_IPL_RED_ROOT)/build/tests/RelocateChecker/buildtools/commondefs #---------------------------------------------------------------------------- diff --git a/build/tests/DisplaySystemInformation/ARM9/src/control.c b/build/tests/DisplaySystemInformation/ARM9/src/control.c index 0e52072e..06a66d33 100644 --- a/build/tests/DisplaySystemInformation/ARM9/src/control.c +++ b/build/tests/DisplaySystemInformation/ARM9/src/control.c @@ -215,6 +215,7 @@ BOOL control( int *menu, int *line, int *changeLine, int *changeMode ) case MENU_SECURE_HW: case MENU_SCFG_ARM7: case MENU_SCFG_ARM9: + case MENU_SYSMENU: case MENU_VERSION: // 今の画面の選択位置を記録 selectLine[ROOTMENU_SIZE] = *line; @@ -234,10 +235,6 @@ BOOL control( int *menu, int *line, int *changeLine, int *changeMode ) breakUserData(1); break; - case MENU_RESET : - // リセット実行 - OS_ResetSystem( 0 ); - break; } } else if( gAllInfo[*menu][*line].changable ) diff --git a/build/tests/DisplaySystemInformation/ARM9/src/drawFunc.c b/build/tests/DisplaySystemInformation/ARM9/src/drawFunc.c index 59721ba9..9a9bee6b 100644 --- a/build/tests/DisplaySystemInformation/ARM9/src/drawFunc.c +++ b/build/tests/DisplaySystemInformation/ARM9/src/drawFunc.c @@ -85,7 +85,7 @@ void printBinary16( int x, int y, u16 value, int selected, int selectSize ); void printBinary32( int x, int y, u32 value, int selected, int selectSize ); void drawRegister( int menu, int selected ); void drawChangeMode( DispInfoEntry *Entry, int changeLine ); -void drawVersion( int startIdx, int selected ); +void drawVersion( int idx, int drawLine ,int selected ); void printUniqueID( int drawLineOffset, char *uniqueId ); int getPageNum( int valueIdx, const int* pageOffset ); int countMenuLine( int menu ); @@ -206,7 +206,20 @@ void printValue( int menu,int entryLine, int drawOffset, DispInfoEntry *entry ) return; } + if( menu == MENU_SYSMENU && entryLine == SYSMENU_VERSION_NUM ) + { + PrintfSJIS( VALUE_LEFT, VALUE_UP + LINE_OFFSET*drawOffset, + txtColor, "%d.%d", entry->iValue >> 16, entry->iValue & 0xFFFF ); + return; + } + if( ( menu == MENU_SYSMENU && entryLine == SYSMENU_TIMESTAMP )|| + ( menu == MENU_VERSION && entryLine == VERSION_FONT )) + { + PrintfSJIS( VALUE_LEFT, VALUE_UP + LINE_OFFSET*drawOffset, txtColor, "%08lx", entry->iValue ); + return; + } + // 通常の値の描画 if( entry->isAligned ) { @@ -427,20 +440,10 @@ void drawChangeMode( DispInfoEntry *entry, int changeLine ) } -void drawVersion( int startIdx, int selected ) +void drawVersion( int idx, int drawLine ,int selected ) { - int drawLine = 0; int kindColor = TXT_COLOR_BLACK; - /* - - for( drawLine = 0; - if( idx < 2 ) - { - printKindName( MENU_VERSION, idx, drawLine, selected ); - printValue( MENU_VERSION, idx, drawLine, &gAllInfo[MENU_VERSION][idx] ); - return; - } - + if( idx == selected) { // 選択項目はいろかえる @@ -450,10 +453,24 @@ void drawVersion( int startIdx, int selected ) // 項目名 - PrintfSJIS( KIND_LEFT, KIND_UP + LINE_OFFSET*drawLine , kindColor, "%d", gContentsTitle[idx - 2] ); + // gContentsTitle[i]は頭4バイトがイニシャルコードのビッグエンディアン記述、 + // お尻4バイトがアプリのフラグ + { + u64 id = gContentsTitle[idx]; + char buf[4] = {0}; + int i; + + for(i = 3; 0<=i; i-- ) + { + buf[i] = id & 0xFF ; + id >>= 8; + } + + PrintfSJIS( KIND_LEFT, KIND_UP + LINE_OFFSET*drawLine , kindColor, "%s", buf ); + } + // 値 - PrintfSJIS( VALUE_LEFT, VALUE_UP + LINE_OFFSET*drawLine , TXT_COLOR_BLACK, "%u",gContentsVersion[idx - 2] ); - */ + PrintfSJIS( VALUE_LEFT, VALUE_UP + LINE_OFFSET*drawLine , TXT_COLOR_BLACK, "%x", gContentsVersion[idx] ); } @@ -497,15 +514,15 @@ void drawMenu( int menu, int line, int changeLine, BOOL isChangeMode ) calibrateDrawIdx( menu, line ); } - // 項目数可変なVersion infoだけ別枠で描画する - if( menu == MENU_VERSION ) - { - drawVersion( gDrawIdx[menu], line ); - return; - } - for( i = gDrawIdx[menu] ; i < s_numMenu[menu] && lineNum < DISP_NUM_LINES ; i++ ) { + // 可変長項目なバージョン情報だけ特例処理 + if( menu == MENU_VERSION && VERSION_OTHER <= i ) + { + drawVersion( i - VERSION_OTHER, lineNum++, line - VERSION_OTHER ); + continue; + } + // 項目名の描画 printKindName( menu, i, lineNum, line ); @@ -558,13 +575,15 @@ void calibrateDrawIdx( int menu, int idx ) // まずは自分と下2項目の行数を探索 for( i = 0; i <= 2 && i + idx < s_numMenu[menu] ; i++ ) { - lines += gAllInfo[menu][i + idx].numLines; + lines += menu == MENU_VERSION && VERSION_OTHER <= i+idx ? + 1 : gAllInfo[menu][i + idx].numLines; } // 自分より上方向へ探索 for( i = 1; 0 <= idx - i && lines < DISP_NUM_LINES ; i++) { - lines += gAllInfo[menu][idx - i].numLines; + lines += menu == MENU_VERSION && VERSION_OTHER <= i+idx ? + 1 : gAllInfo[menu][idx - i].numLines; } // ループが一回余計に回る diff --git a/build/tests/DisplaySystemInformation/ARM9/src/main.c b/build/tests/DisplaySystemInformation/ARM9/src/main.c index 5ee1f97c..8b185d35 100644 --- a/build/tests/DisplaySystemInformation/ARM9/src/main.c +++ b/build/tests/DisplaySystemInformation/ARM9/src/main.c @@ -83,7 +83,7 @@ void TwlMain( void ) OS_TPrintf("Allocator Initialize...\n"); InitAllocator(); -#ifdef COMP_ARMADILLO +#ifdef SEA_ENABLE OS_TPrintf("NAM Initialize...\n"); NAM_Init( Alloc, Free ); #endif diff --git a/build/tests/DisplaySystemInformation/ARM9/src/strResource.c b/build/tests/DisplaySystemInformation/ARM9/src/strResource.c index 4617c4aa..1914272a 100644 --- a/build/tests/DisplaySystemInformation/ARM9/src/strResource.c +++ b/build/tests/DisplaySystemInformation/ARM9/src/strResource.c @@ -27,6 +27,7 @@ int s_numMenu[] = { SECURE_HW_MENU_SIZE, SCFG_ARM7_MENU_SIZE, SCFG_ARM9_MENU_SIZE, + SYSMENU_MENU_SIZE, VERSIONMENU_SIZE, 0, 0, @@ -64,6 +65,7 @@ const char *s_strRootMenu[] = { "<Secure Hardware Info>", "<SCFG Info (ARM7 side)>", "<SCFG Info (ARM9 side)>", + "<About Sysmenu>", "<Content Version>", "Reset HW Setting to Default", "break HW Setting" @@ -215,10 +217,17 @@ const char *s_strSCFGArm7Menu[] = { "Option App for" }; +const char *s_strSystemMenu[] = { + "Version (numeric)", + "Version (string)", + "EULA URL", + "NUP Hostname", + "Timestamp" +}; + const char *s_strVersionMenu[] = { - "Shared Font", "Wireless Firm", - "Whitelist" + "Font(Timestamp)" }; const char **s_strMetaMenu[] = { @@ -229,10 +238,10 @@ const char **s_strMetaMenu[] = { s_strSecureHWMenu, s_strSCFGArm7Menu, s_strSCFGArm9Menu, + s_strSystemMenu, s_strVersionMenu, NULL, NULL, - NULL, s_strRootMenu }; diff --git a/build/tests/DisplaySystemInformation/ARM9/src/strResource.h b/build/tests/DisplaySystemInformation/ARM9/src/strResource.h index a8ac594e..3cbfaf4e 100644 --- a/build/tests/DisplaySystemInformation/ARM9/src/strResource.h +++ b/build/tests/DisplaySystemInformation/ARM9/src/strResource.h @@ -27,10 +27,11 @@ #define MENU_SECURE_HW 4 #define MENU_SCFG_ARM7 5 #define MENU_SCFG_ARM9 6 -#define MENU_VERSION 7 -#define MENU_RESET_INFO 8 -#define MENU_BREAK_DATA 9 -#define MENU_RESET 10 +#define MENU_SYSMENU 7 +#define MENU_VERSION 8 +#define MENU_RESET_INFO 9 +#define MENU_BREAK_DATA 10 + // 行番号 #define OWNER_LANGUAGE 0 @@ -151,12 +152,18 @@ #define SCFG_ARM7_SHARED_OFFSET 47 +#define SYSMENU_VERSION_NUM 0 +#define SYSMENU_VERSION_STR 1 +#define SYSMENU_EULA_URL 2 +#define SYSMENU_NUP_HOST 3 +#define SYSMENU_TIMESTAMP 4 + #define VERSION_WIRELESS 0 #define VERSION_FONT 1 #define VERSION_OTHER 2 // 各メニューサイズ -#define ROOTMENU_SIZE 10 +#define ROOTMENU_SIZE 11 #define OWNERMENU_SIZE 6 #define PARENTALMENU_SIZE 12 #define OTHERMENU_SIZE 11 @@ -164,7 +171,8 @@ #define SECURE_HW_MENU_SIZE 6 #define SCFG_ARM7_MENU_SIZE 47 #define SCFG_ARM9_MENU_SIZE 24 -#define VERSIONMENU_SIZE 3 +#define SYSMENU_MENU_SIZE 5 +#define VERSIONMENU_SIZE 2 extern int s_numMenu[]; @@ -175,6 +183,7 @@ extern const char *s_strNormalHWMenu[]; extern const char *s_strSecureHWMenu[]; extern const char *s_strSCFGARM7Menu[]; extern const char *s_strSCFGARM9Menu[]; +extern const char *s_strSystemMenu[]; extern const char *s_strVersionMenu[]; extern const char **s_strMetaMenu[]; extern const char *s_strARM7RegisterName[]; diff --git a/build/tests/DisplaySystemInformation/ARM9/src/viewSystemInfo.c b/build/tests/DisplaySystemInformation/ARM9/src/viewSystemInfo.c index 90b1bff5..323ad1c3 100644 --- a/build/tests/DisplaySystemInformation/ARM9/src/viewSystemInfo.c +++ b/build/tests/DisplaySystemInformation/ARM9/src/viewSystemInfo.c @@ -19,15 +19,33 @@ #include #include #include +#include #include "misc.h" #include "viewSystemInfo.h" #include "strResource.h" #include "control.h" #include "myIoreg_SCFG.h" + + #define DISPINFO_BUFSIZE 64 #define WL_TITLEID 0x0003000F484E4341 +#define FS_VERSION_FILE "verdata:/version.bin" +#define FS_EULA_URL_FILE "verdata:/eula_url.bin" +#define FS_NUP_HOSTNAME_FILE "verdata:/nup_host.bin" +#define FS_TIMESTAMP_FILE "verdata:/time_stamp.bin" +#define TWL_SYSMENU_VER_STR_LEN 28 // システムメニューバージョン文字列MAX bytes +#define TWL_EULA_URL_LEN 128 +#define TWL_NUP_HOSTNAME_LEN 64 + + +typedef struct SystemMenuVersion { + u16 major; + u16 minor; + u16 str[ TWL_SYSMENU_VER_STR_LEN / sizeof(u16) ]; +}SystemMenuVersion; + /* function prototype ----------------------------- */ void getAllInfo( void ); void initInfo( void ); @@ -41,6 +59,7 @@ void getSecureHWInfo( void ); void getSCFGARM9Info( void ); void getSCFGARM7InfoReg( void ); void getSCFGARM7InfoShared( void ); +void getSysmenuInfo( void ); void getVersions( void ); void getWirelessVersion( void ); void getContentsVersion( void ); @@ -107,7 +126,6 @@ void displayInfoMain( void ) // 何か操作があったときはキャンバスクリアして描画しなおし NNS_G2dCharCanvasClear( &gCanvas, TXT_COLOR_WHITE ); NNS_G2dCharCanvasClear( &gCanvasSub, TXT_COLOR_WHITE ); - // 情報一覧を描画する drawMenu( menu, line, changeLine, isChangeMode); @@ -131,10 +149,13 @@ void initInfo( void ) infoAlloc( gAllInfo[MENU_SECURE_HW], SECURE_HW_TITLEID_LO, DISPINFO_BUFSIZE, TRUE ); infoAlloc( gAllInfo[MENU_SCFG_ARM7], SCFG_ARM7_MI_CC, DISPINFO_BUFSIZE , TRUE ); infoAlloc( gAllInfo[MENU_SCFG_ARM7], SCFG_ARM7_MI_CA, DISPINFO_BUFSIZE , TRUE ); + infoAlloc( gAllInfo[MENU_SYSMENU], SYSMENU_EULA_URL, TWL_EULA_URL_LEN + 1, FALSE ); + infoAlloc( gAllInfo[MENU_SYSMENU], SYSMENU_NUP_HOST, TWL_NUP_HOSTNAME_LEN + 1, FALSE ); infoAlloc( gAllInfo[MENU_OWNER], OWNER_NICKNAME, OS_OWNERINFO_NICKNAME_MAX + 1 , FALSE ); infoAlloc( gAllInfo[MENU_OWNER], OWNER_COMMENT, OS_OWNERINFO_COMMENT_MAX + 1 , FALSE ); infoAlloc( gAllInfo[MENU_PARENTAL], PARENTAL_ANSWER, OS_TWL_PCTL_SECRET_ANSWER_LENGTH_MAX + 1 , FALSE ); + infoAlloc( gAllInfo[MENU_SYSMENU], SYSMENU_VERSION_STR, TWL_SYSMENU_VER_STR_LEN + 1, FALSE ); OS_TPrintf( "information alloc succeeded\n" ); } @@ -175,16 +196,9 @@ void getAllInfo( void ) getSCFGARM7InfoReg(); getSCFGARM7InfoShared(); getSCFGARM9Info(); - -#ifdef COMP_ARMADILLO + getSysmenuInfo(); getVersions(); -#endif - - /* - if( fuseRomAccessable ) - { - - }*/ + printAllInfo(); OS_TPrintf("reflesh information finished\n"); @@ -238,12 +252,22 @@ void displayInfoInit( void ) void printAllInfo ( void ) { int loop1, loop2; + OS_TPrintf(" size version: %d\n", s_numMenu[MENU_VERSION]); for(loop1=0; loop1 < ROOTMENU_SIZE; loop1++ ) { for(loop2=0; loop2 < s_numMenu[loop1]; loop2++ ) { - DispInfoEntry *entry = &gAllInfo[loop1][loop2]; + DispInfoEntry *entry; + + if( loop1 == MENU_VERSION && loop2 >= MENU_OTHER ) + { + int idx = loop2 - MENU_OTHER; + OS_TPrintf("%d %d : %x %x\n", loop1, loop2, gContentsTitle[idx], gContentsVersion[idx] ); + continue; + } + + entry = &gAllInfo[loop1][loop2]; if( entry->isNumData ) { @@ -743,7 +767,7 @@ void getSCFGARM7InfoReg( void ) // SECフラグはTRUE = 切り離し(アクセス不可), FALSE = 接続(アクセス可) value = ( gArm7SCFGReg[DISP_REG_A9ROM_OFFSET - 0x4000] & DISP_REG_SCFG_A9ROM_SEC_MASK ) || 0 ; gAllInfo[MENU_SCFG_ARM7][SCFG_ARM7_ROM_ARM9_SEC].iValue = value; - gAllInfo[MENU_SCFG_ARM7][SCFG_ARM7_ROM_ARM9_SEC].str.sjis = s_strAccess[ !value ]; + gAllInfo[MENU_SCFG_ARM7][SCFG_ARM7_ROM_ARM9_SEC].str.sjis = s_strJoint[ !value ]; value = ( gArm7SCFGReg[DISP_REG_A9ROM_OFFSET - 0x4000] & DISP_REG_SCFG_A9ROM_RSEL_MASK ) || 0 ; gAllInfo[MENU_SCFG_ARM7][SCFG_ARM7_ROM_ARM9_RSEL].iValue = value; @@ -752,7 +776,7 @@ void getSCFGARM7InfoReg( void ) // SECフラグはTRUE = 切り離し(アクセス不可), FALSE = 接続(アクセス可) value = ( gArm7SCFGReg[DISP_REG_A7ROM_OFFSET - 0x4000] & DISP_REG_SCFG_A7ROM_SEC_MASK ) || 0 ; gAllInfo[MENU_SCFG_ARM7][SCFG_ARM7_ROM_ARM7_SEC].iValue = value; - gAllInfo[MENU_SCFG_ARM7][SCFG_ARM7_ROM_ARM7_SEC].str.sjis = s_strAccess[ !value ]; + gAllInfo[MENU_SCFG_ARM7][SCFG_ARM7_ROM_ARM7_SEC].str.sjis = s_strJoint[ !value ]; value = ( gArm7SCFGReg[DISP_REG_A7ROM_OFFSET - 0x4000] & DISP_REG_SCFG_A7ROM_RSEL_MASK ) || 0 ; gAllInfo[MENU_SCFG_ARM7][SCFG_ARM7_ROM_ARM7_RSEL].iValue = value; @@ -1193,11 +1217,106 @@ void getSCFGARM7InfoShared( void ) } +void getSysmenuInfo( void ) +{ + u8 *pBuffer = (u8*) Alloc (NA_VERSION_DATA_WORK_SIZE); + + if( !NA_LoadVersionDataArchive( pBuffer, NA_VERSION_DATA_WORK_SIZE ) ) { + return ; + } + + // バージョンの読み出し + { + FSFile file; + SystemMenuVersion bufVersion; + s32 len; + + FS_InitFile(&file); + + if (!FS_OpenFileEx(&file, FS_VERSION_FILE, FS_FILEMODE_R)) + { + return ; + } + + len = FS_ReadFile(&file, &bufVersion, sizeof(SystemMenuVersion)); + FS_CloseFile(&file); + + gAllInfo[MENU_SYSMENU][SYSMENU_VERSION_NUM].iValue = (int)( bufVersion.major << 16 | bufVersion.minor ); + gAllInfo[MENU_SYSMENU][SYSMENU_VERSION_NUM].isNumData = TRUE; + + wcsncpy( gAllInfo[MENU_SYSMENU][SYSMENU_VERSION_STR].str.utf, bufVersion.str, TWL_SYSMENU_VER_STR_LEN ); + gAllInfo[MENU_SYSMENU][SYSMENU_VERSION_STR].isSjis = FALSE; + + } + + // EULA URLの読み出し + { + FSFile file; + s32 len; + + FS_InitFile(&file); + + if (!FS_OpenFileEx(&file, FS_EULA_URL_FILE, FS_FILEMODE_R)) { + return; + } + + len = FS_ReadFile(&file, gAllInfo[MENU_SYSMENU][SYSMENU_EULA_URL].str.sjis , TWL_EULA_URL_LEN) ; + FS_CloseFile(&file); + + } + + // NUP HOST NAME の読み出し + { + FSFile file; + s32 len; + + FS_InitFile(&file); + + if (!FS_OpenFileEx(&file, FS_NUP_HOSTNAME_FILE, FS_FILEMODE_R)) { + return; + } + + len = FS_ReadFile(&file, gAllInfo[MENU_SYSMENU][SYSMENU_NUP_HOST].str.sjis, TWL_NUP_HOSTNAME_LEN); + FS_CloseFile(&file); + + } + + // タイムスタンプ の読み出し + { + FSFile file; + s32 len; + + FS_InitFile(&file); + + if (!FS_OpenFileEx(&file, FS_TIMESTAMP_FILE, FS_FILEMODE_R)) { + return ; + } + + len = FS_ReadFile(&file, &gAllInfo[MENU_SYSMENU][SYSMENU_TIMESTAMP].iValue, sizeof(u32) ); + FS_CloseFile(&file); + + gAllInfo[MENU_SYSMENU][SYSMENU_TIMESTAMP].isNumData = TRUE; + } + + // SystemMenuVersionのアンマウント + if( !NA_UnloadVersionDataArchive() ) { + return; + } + + Free(pBuffer); + +} + void getVersions( void ) { + +#ifdef SEA_ENABLE getWirelessVersion(); - getSharedFontVersion(); getContentsVersion(); +#endif + + getSharedFontVersion(); + } void getWirelessVersion( void ) @@ -1220,11 +1339,15 @@ void getWirelessVersion( void ) gAllInfo[MENU_VERSION][VERSION_WIRELESS].iValue = filebuf[0] *100 + filebuf[1]; gAllInfo[MENU_VERSION][VERSION_WIRELESS].isNumData = TRUE; + } void getSharedFontVersion( void ) { - u32 time = OS_GetSharedFontTimestamp(); + u32 time; + + OS_InitSharedFont(); + time = OS_GetSharedFontTimestamp(); OS_TPrintf("SharedFont Time Stamp %08lx\n", time ); gAllInfo[MENU_VERSION][VERSION_FONT].iValue = (int) time; gAllInfo[MENU_VERSION][VERSION_FONT].isNumData = TRUE; @@ -1237,12 +1360,15 @@ void getContentsVersion( void ) int i; gNumContents = NAM_GetNumTitles(); + OS_TPrintf(" numContents: %d\n", gNumContents); if( gContentsTitle == NULL ) { // 初回処理の時はバッファを確保 gContentsTitle = (NAMTitleId*) Alloc( sizeof(NAMTitleId) * gNumContents ); gContentsVersion = (u16*) Alloc( sizeof(u16) * (u32)gNumContents); + SDK_ASSERT( gContentsTitle ); + SDK_ASSERT( gContentsVersion ); } NAM_GetTitleList( gContentsTitle, (u32)gNumContents); @@ -1251,10 +1377,11 @@ void getContentsVersion( void ) for( i=0; i