From 4ed13b1a7f82e8accb9bb4b6c9374a014fbadeba Mon Sep 17 00:00:00 2001 From: kamikawa Date: Thu, 24 Apr 2008 04:16:08 +0000 Subject: [PATCH] =?UTF-8?q?=E3=82=B7=E3=82=B9=E3=83=86=E3=83=A0=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E3=83=AD=E3=82=B0=E3=81=AB=E3=81=9F=E3=81=84=E3=81=97?= =?UTF-8?q?=E3=81=A6=E6=97=A5=E4=BB=98=E3=82=92=E6=9B=B8=E3=81=8D=E8=BE=BC?= =?UTF-8?q?=E3=82=80=E3=82=88=E3=81=86=E3=81=AB=E5=A4=89=E6=9B=B4=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@1251 b08762b0-b915-fc4b-9d8c-17b2551a87ff --- .../SystemUpdater/ARM9.TWL/src/main.c | 51 ++++++++++++++----- 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/build/systemMenu_RED/SystemUpdater/ARM9.TWL/src/main.c b/build/systemMenu_RED/SystemUpdater/ARM9.TWL/src/main.c index 44d141f5..d860b9ac 100644 --- a/build/systemMenu_RED/SystemUpdater/ARM9.TWL/src/main.c +++ b/build/systemMenu_RED/SystemUpdater/ARM9.TWL/src/main.c @@ -58,7 +58,7 @@ static void VBlankIntr(void); static void InitAllocation(void); static BOOL IgnoreRemoval(void); static void DrawWaitButtonA(void); -static void DrawAlready(void); +static void DrawAlready(char* date); /*---------------------------------------------------------------------------* Name: TwlMain @@ -131,8 +131,13 @@ TwlMain() FS_InitFile( &file ); if (FS_OpenFileEx(&file, "nand:/sys/log/updater.log", FS_FILEMODE_R) == TRUE) { + char date[sizeof(__DATE__)]; + if (FS_ReadFile(&file, date, sizeof(__DATE__)) != sizeof(__DATE__)) + { + OS_Warning("Failure! FS_ReadFile"); + } FS_CloseFile(&file); - DrawAlready(); + DrawAlready(date); } } @@ -228,13 +233,30 @@ TwlMain() } // 調査に不便なので一時的に削除 -/* - // 更新ログを残して再実行を防ぐ + + // 更新ログを作成して再実行を防ぐ if (result) { - (void)FS_CreateFileAuto("nand:/sys/log/updater.log", FS_PERMIT_R | FS_PERMIT_W); + if (FS_CreateFileAuto("nand:/sys/log/updater.log", FS_PERMIT_R | FS_PERMIT_W)) + { + FSFile file; + FS_InitFile( &file ); + if (FS_OpenFileEx(&file, "nand:/sys/log/updater.log", FS_FILEMODE_W)) + { + char date[sizeof(__DATE__)]; + if (STD_CopyLString( date, __DATE__, sizeof(__DATE__) ) != (sizeof(__DATE__)-1)) + { + OS_Warning("Failure! STD_CopyLString\n"); + } + if (FS_WriteFile(&file, (void*)date, sizeof(__DATE__) ) == -1) + { + OS_Warning("Failure : FS_WriteFile\n"); + } + FS_CloseFile(&file); + } + } } -*/ + // 結果表示 while(1) { @@ -293,7 +315,8 @@ static void InitAllocation(void) *---------------------------------------------------------------------------*/ static void DrawWaitButtonA(void) { - kamiFontPrintfMain( 5, 3, 8, "--- System Updater ---"); + kamiFontPrintfMain( 5, 3, 8, " System Updater "); + kamiFontPrintfMain( 5, 5, 8, " --- %s ---", __DATE__); kamiFontPrintfMain( 5, 8, 3, ""); kamiFontPrintfMain( 3, 10, 1, "--------------------------"); @@ -307,7 +330,7 @@ static void DrawWaitButtonA(void) G3_Identity(); G3_PolygonAttr(GX_LIGHTMASK_NONE, GX_POLYGONMODE_DECAL, GX_CULL_NONE, 0, 31, 0); - DrawQuad( 10, 50, 246, 120, GX_RGB(28, 28, 28)); + DrawQuad( 10, 54, 246, 120, GX_RGB(28, 28, 28)); G3_SwapBuffers(GX_SORTMODE_AUTO, GX_BUFFERMODE_W); @@ -334,12 +357,12 @@ static void DrawWaitButtonA(void) Returns: None. *---------------------------------------------------------------------------*/ -static void DrawAlready(void) +static void DrawAlready(char* date) { - kamiFontPrintfMain( 8, 8, 3, ""); - kamiFontPrintfMain( 3, 10, 1, "--------------------------"); - kamiFontPrintfMain( 3, 11, 1, "This machine has already"); - kamiFontPrintfMain( 3, 12, 1, "been updated."); + kamiFontPrintfMain( 3, 8, 1, "--------------------------"); + kamiFontPrintfMain( 3, 9, 1, "This machine has already"); + kamiFontPrintfMain( 3, 10, 1, "been updated."); + kamiFontPrintfMain( 3, 12, 1, "version: %s", date); kamiFontPrintfMain( 3, 13, 1, "--------------------------"); while(1) @@ -348,7 +371,7 @@ static void DrawAlready(void) G3_Identity(); G3_PolygonAttr(GX_LIGHTMASK_NONE, GX_POLYGONMODE_DECAL, GX_CULL_NONE, 0, 31, 0); - DrawQuad( 10, 50, 246, 120, GX_RGB(28, 28, 28)); + DrawQuad( 10, 50, 246, 128, GX_RGB(28, 28, 28)); G3_SwapBuffers(GX_SORTMODE_AUTO, GX_BUFFERMODE_W);