From bbd5ae3603fc585e86894be2f40d8eafe73af5c6 Mon Sep 17 00:00:00 2001 From: kamikawa Date: Wed, 23 Apr 2008 10:38:27 +0000 Subject: [PATCH] =?UTF-8?q?SystemUpdater:=20A=E3=83=9C=E3=82=BF=E3=83=B3?= =?UTF-8?q?=E6=8A=BC=E3=81=97=E3=82=92=E8=A6=81=E6=B1=82=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E5=A4=89=E6=9B=B4=20nand:/sys/log/u?= =?UTF-8?q?pdater.log=20=E3=82=92=E7=94=9F=E6=88=90=E3=81=97=E3=80=81?= =?UTF-8?q?=E5=86=8D=E6=9B=B4=E6=96=B0=E3=82=92=E6=8A=91=E5=88=B6=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E5=A4=89=E6=9B=B4=EF=BC=88?= =?UTF-8?q?=E3=83=87=E3=83=90=E3=83=83=E3=82=B0=E3=81=AB=E4=B8=8D=E4=BE=BF?= =?UTF-8?q?=E3=81=AA=E3=81=AE=E3=81=A7=E7=8F=BE=E5=9C=A8=E3=82=B3=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=82=A2=E3=82=A6=E3=83=88=EF=BC=89?= 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@1245 b08762b0-b915-fc4b-9d8c-17b2551a87ff --- .../ARM9.TWL/src/font_data.c | 1 + .../SystemUpdater/ARM9.TWL/Makefile | 3 +- .../SystemUpdater/ARM9.TWL/src/main.c | 99 ++++++++++++++++++- 3 files changed, 101 insertions(+), 2 deletions(-) diff --git a/build/systemMenu_RED/NandInitializerRed/ARM9.TWL/src/font_data.c b/build/systemMenu_RED/NandInitializerRed/ARM9.TWL/src/font_data.c index 765c8a27..392ac11f 100644 --- a/build/systemMenu_RED/NandInitializerRed/ARM9.TWL/src/font_data.c +++ b/build/systemMenu_RED/NandInitializerRed/ARM9.TWL/src/font_data.c @@ -97,6 +97,7 @@ const u16 PlttDataMain[16][16] = { {RGB555(31, 31, 31), RGB555(0, 31, 31), RGB555(0, 31, 31), RGB555(0, 31, 31),}, // Cyan {RGB555(31, 31, 31), RGB555(31, 0, 31), RGB555(31, 0, 31), RGB555(31, 0, 31),}, // Purple {RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555(31, 31, 31),}, // White + {RGB555( 0, 0, 0), RGB555(0, 0, 0), RGB555(0, 0, 0), RGB555(0, 0, 0),}, // Black }; // 下画面コンソール文字列パレット diff --git a/build/systemMenu_RED/SystemUpdater/ARM9.TWL/Makefile b/build/systemMenu_RED/SystemUpdater/ARM9.TWL/Makefile index 66ddfd1f..bdde54a0 100644 --- a/build/systemMenu_RED/SystemUpdater/ARM9.TWL/Makefile +++ b/build/systemMenu_RED/SystemUpdater/ARM9.TWL/Makefile @@ -47,7 +47,8 @@ SRCS = main.c \ hwi.c \ kami_pxi.c \ kami_write_nandfirm.c \ - hw_info.c + hw_info.c \ + keypad.c SRCS += $(ROOT)/build/tests/debugger/fio/src/fs_archive_hostio.c diff --git a/build/systemMenu_RED/SystemUpdater/ARM9.TWL/src/main.c b/build/systemMenu_RED/SystemUpdater/ARM9.TWL/src/main.c index c50eb617..24e80975 100644 --- a/build/systemMenu_RED/SystemUpdater/ARM9.TWL/src/main.c +++ b/build/systemMenu_RED/SystemUpdater/ARM9.TWL/src/main.c @@ -27,6 +27,7 @@ #include "hw_info.h" #include "graphics.h" #include "hwi.h" +#include "keypad.h" /*---------------------------------------------------------------------------* 内部定数定義 @@ -53,7 +54,8 @@ static NAMTitleId titleId; static void VBlankIntr(void); static void InitAllocation(void); static BOOL IgnoreRemoval(void); -extern void FS_MountHostIO(const char *basepath); +static void DrawWaitButtonA(void); +static void DrawAlready(void); /*---------------------------------------------------------------------------* Name: TwlMain @@ -118,6 +120,20 @@ TwlMain() (void)FS_LoadTable(p_table, need_size); } + // ログが存在するならシステム更新済みと判定 + { + FSFile file; + FS_InitFile( &file ); + if (FS_OpenFileEx(&file, "nand:/sys/log/updater.log", FS_FILEMODE_R) == TRUE) + { + FS_CloseFile(&file); + DrawAlready(); + } + } + + // Aボタン待ち + DrawWaitButtonA(); + // HWInfo関連の前準備 switch (HWI_Init( OS_AllocFromMain, OS_FreeToMain )) { @@ -171,6 +187,14 @@ TwlMain() } kamiFontLoadScreenData(); + // 調査に不便なので一時的に削除 +/* + // 更新ログを残して再実行を防ぐ + if (result) + { + (void)FS_CreateFileAuto("nand:/sys/log/updater.log", FS_PERMIT_R | FS_PERMIT_W); + } +*/ // 結果表示 while(1) { @@ -216,3 +240,76 @@ static void InitAllocation(void) OS_Panic("ARM9: Fail to create heap...\n"); hh = OS_SetCurrentHeap(OS_ARENA_MAIN, hh); } + +/*---------------------------------------------------------------------------* + Name: DrawWaitButtonA + + Description: Aボタン待ちを表示します + + Arguments: + + Returns: None. + *---------------------------------------------------------------------------*/ +static void DrawWaitButtonA(void) +{ + kamiFontPrintfMain( 5, 3, 8, "--- System Updater ---"); + + kamiFontPrintfMain( 5, 8, 3, ""); + kamiFontPrintfMain( 3, 10, 1, "--------------------------"); + kamiFontPrintfMain( 3, 11, 1, "Do not turn off power"); + kamiFontPrintfMain( 3, 12, 1, "while update is processing"); + kamiFontPrintfMain( 3, 13, 1, "--------------------------"); + kamiFontLoadScreenData(); + + while(1) + { + G3X_Reset(); + 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)); + + G3_SwapBuffers(GX_SORTMODE_AUTO, GX_BUFFERMODE_W); + + kamiPadRead(); + if (kamiPadIsTrigger(PAD_BUTTON_A)) + { + kamiFontClearMain(); + break; + } + OS_WaitVBlankIntr(); + } +} + +/*---------------------------------------------------------------------------* + Name: DrawAlready + + Description: Alreadyを表示します + + Arguments: + + Returns: None. + *---------------------------------------------------------------------------*/ +static void DrawAlready(void) +{ + kamiFontPrintfMain( 8, 8, 3, ""); + kamiFontPrintfMain( 3, 10, 1, "--------------------------"); + kamiFontPrintfMain( 3, 11, 1, "This machine has already"); + kamiFontPrintfMain( 3, 12, 1, "been updated."); + kamiFontPrintfMain( 3, 13, 1, "--------------------------"); + kamiFontLoadScreenData(); + + while(1) + { + G3X_Reset(); + 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)); + + G3_SwapBuffers(GX_SORTMODE_AUTO, GX_BUFFERMODE_W); + + OS_WaitVBlankIntr(); + } +} +