From 6bcf86e427df04cedd8c0b6453dd727d27ec348b Mon Sep 17 00:00:00 2001 From: kamikawa Date: Wed, 16 Apr 2008 06:39:39 +0000 Subject: [PATCH] =?UTF-8?q?=E5=90=8D=E7=A7=B0=E5=A4=89=E6=9B=B4=20NandAppD?= =?UTF-8?q?ebugCoordinator=20->=20ImportJump=20=E8=A1=A8=E7=A4=BA=E7=B3=BB?= =?UTF-8?q?=E3=82=92=E3=82=AB=E3=83=83=E3=82=B3=E3=82=88=E3=81=8F=E3=81=97?= =?UTF-8?q?=E3=81=BE=E3=81=97=E3=81=9F=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@1157 b08762b0-b915-fc4b-9d8c-17b2551a87ff --- .../ARM9.TWL/ARM9-TS.lsf | 2 +- .../ARM9.TWL/Makefile | 4 +- .../ARM9.TWL/include/graphics.h | 3 +- .../ARM9.TWL/include/import.h | 2 +- .../ARM9.TWL/include/kami_font.h | 2 +- .../ARM9.TWL/main.rsf | 2 +- .../ARM9.TWL/src/font_data.c | 5 +- .../ARM9.TWL/src/graphics.c | 43 ++++++++++++++- .../ARM9.TWL/src/import.c | 52 +++++++------------ .../ARM9.TWL/src/kami_font.c | 2 +- .../ARM9.TWL/src/main.c | 6 +-- .../Makefile | 2 +- 12 files changed, 75 insertions(+), 50 deletions(-) rename build/systemMenu_RED/{NandAppDebugCoordinator => ImportJump}/ARM9.TWL/ARM9-TS.lsf (94%) rename build/systemMenu_RED/{NandAppDebugCoordinator => ImportJump}/ARM9.TWL/Makefile (94%) rename build/systemMenu_RED/{NandAppDebugCoordinator => ImportJump}/ARM9.TWL/include/graphics.h (91%) rename build/systemMenu_RED/{NandAppDebugCoordinator => ImportJump}/ARM9.TWL/include/import.h (94%) rename build/systemMenu_RED/{NandAppDebugCoordinator => ImportJump}/ARM9.TWL/include/kami_font.h (95%) rename build/systemMenu_RED/{NandAppDebugCoordinator => ImportJump}/ARM9.TWL/main.rsf (94%) rename build/systemMenu_RED/{NandAppDebugCoordinator => ImportJump}/ARM9.TWL/src/font_data.c (97%) rename build/systemMenu_RED/{NandAppDebugCoordinator => ImportJump}/ARM9.TWL/src/graphics.c (79%) rename build/systemMenu_RED/{NandAppDebugCoordinator => ImportJump}/ARM9.TWL/src/import.c (87%) rename build/systemMenu_RED/{NandAppDebugCoordinator => ImportJump}/ARM9.TWL/src/kami_font.c (97%) rename build/systemMenu_RED/{NandAppDebugCoordinator => ImportJump}/ARM9.TWL/src/main.c (90%) rename build/systemMenu_RED/{NandAppDebugCoordinator => ImportJump}/Makefile (93%) diff --git a/build/systemMenu_RED/NandAppDebugCoordinator/ARM9.TWL/ARM9-TS.lsf b/build/systemMenu_RED/ImportJump/ARM9.TWL/ARM9-TS.lsf similarity index 94% rename from build/systemMenu_RED/NandAppDebugCoordinator/ARM9.TWL/ARM9-TS.lsf rename to build/systemMenu_RED/ImportJump/ARM9.TWL/ARM9-TS.lsf index bda4a9d2..d266cb78 100644 --- a/build/systemMenu_RED/NandAppDebugCoordinator/ARM9.TWL/ARM9-TS.lsf +++ b/build/systemMenu_RED/ImportJump/ARM9.TWL/ARM9-TS.lsf @@ -1,5 +1,5 @@ #---------------------------------------------------------------------------- -# Project: NandAppDebugCoordinator +# Project: ImportJump # File: ARM9-TS.lsf # # Copyright 2007 Nintendo. All rights reserved. diff --git a/build/systemMenu_RED/NandAppDebugCoordinator/ARM9.TWL/Makefile b/build/systemMenu_RED/ImportJump/ARM9.TWL/Makefile similarity index 94% rename from build/systemMenu_RED/NandAppDebugCoordinator/ARM9.TWL/Makefile rename to build/systemMenu_RED/ImportJump/ARM9.TWL/Makefile index 541e64c8..6a2e99ee 100644 --- a/build/systemMenu_RED/NandAppDebugCoordinator/ARM9.TWL/Makefile +++ b/build/systemMenu_RED/ImportJump/ARM9.TWL/Makefile @@ -1,6 +1,6 @@ #! make -f #---------------------------------------------------------------------------- -# Project: NandAppDebugCoordinator +# Project: ImportJump # File: Makefile # # Copyright 2007 Nintendo. All rights reserved. @@ -35,7 +35,7 @@ TWL_ARCHGEN = LIMITED TITLEID_LO = 0NIA #TARGET_TAD = -TARGET_BIN = NandAppImporter.srl +TARGET_BIN = ImportJump.srl LCFILE_SPEC = ARM9-TS.lsf ROM_SPEC = main.rsf diff --git a/build/systemMenu_RED/NandAppDebugCoordinator/ARM9.TWL/include/graphics.h b/build/systemMenu_RED/ImportJump/ARM9.TWL/include/graphics.h similarity index 91% rename from build/systemMenu_RED/NandAppDebugCoordinator/ARM9.TWL/include/graphics.h rename to build/systemMenu_RED/ImportJump/ARM9.TWL/include/graphics.h index 1ca18b55..69dd0c35 100644 --- a/build/systemMenu_RED/NandAppDebugCoordinator/ARM9.TWL/include/graphics.h +++ b/build/systemMenu_RED/ImportJump/ARM9.TWL/include/graphics.h @@ -1,5 +1,5 @@ /*---------------------------------------------------------------------------* - Project: NandAppDebugCoordinator + Project: ImportJump File: graphics.h Copyright 2008 Nintendo. All rights reserved. @@ -32,6 +32,7 @@ extern "C" { void InitGraphics(void); void DrawLine(s16 sx, s16 sy, s16 ex, s16 ey, GXRgb color); +void DrawQuad(s16 sx, s16 sy, s16 ex, s16 ey, GXRgb color); /*===========================================================================*/ diff --git a/build/systemMenu_RED/NandAppDebugCoordinator/ARM9.TWL/include/import.h b/build/systemMenu_RED/ImportJump/ARM9.TWL/include/import.h similarity index 94% rename from build/systemMenu_RED/NandAppDebugCoordinator/ARM9.TWL/include/import.h rename to build/systemMenu_RED/ImportJump/ARM9.TWL/include/import.h index bf4ad02c..b580f4f8 100644 --- a/build/systemMenu_RED/NandAppDebugCoordinator/ARM9.TWL/include/import.h +++ b/build/systemMenu_RED/ImportJump/ARM9.TWL/include/import.h @@ -1,5 +1,5 @@ /*---------------------------------------------------------------------------* - Project: NandAppDebugCoordinator + Project: ImportJump File: import.h Copyright 2008 Nintendo. All rights reserved. diff --git a/build/systemMenu_RED/NandAppDebugCoordinator/ARM9.TWL/include/kami_font.h b/build/systemMenu_RED/ImportJump/ARM9.TWL/include/kami_font.h similarity index 95% rename from build/systemMenu_RED/NandAppDebugCoordinator/ARM9.TWL/include/kami_font.h rename to build/systemMenu_RED/ImportJump/ARM9.TWL/include/kami_font.h index c6550d93..50e23822 100644 --- a/build/systemMenu_RED/NandAppDebugCoordinator/ARM9.TWL/include/kami_font.h +++ b/build/systemMenu_RED/ImportJump/ARM9.TWL/include/kami_font.h @@ -1,5 +1,5 @@ /*---------------------------------------------------------------------------* - Project: NandAppDebugCoordinator + Project: ImportJump File: kami_font.h Copyright 2008 Nintendo. All rights reserved. diff --git a/build/systemMenu_RED/NandAppDebugCoordinator/ARM9.TWL/main.rsf b/build/systemMenu_RED/ImportJump/ARM9.TWL/main.rsf similarity index 94% rename from build/systemMenu_RED/NandAppDebugCoordinator/ARM9.TWL/main.rsf rename to build/systemMenu_RED/ImportJump/ARM9.TWL/main.rsf index 037180be..53c36f5b 100644 --- a/build/systemMenu_RED/NandAppDebugCoordinator/ARM9.TWL/main.rsf +++ b/build/systemMenu_RED/ImportJump/ARM9.TWL/main.rsf @@ -1,5 +1,5 @@ #---------------------------------------------------------------------------- -# Project: NandAppDebugCoordinator +# Project: ImportJump # File: main.rsf # # Copyright 2007 Nintendo. All rights reserved. diff --git a/build/systemMenu_RED/NandAppDebugCoordinator/ARM9.TWL/src/font_data.c b/build/systemMenu_RED/ImportJump/ARM9.TWL/src/font_data.c similarity index 97% rename from build/systemMenu_RED/NandAppDebugCoordinator/ARM9.TWL/src/font_data.c rename to build/systemMenu_RED/ImportJump/ARM9.TWL/src/font_data.c index 7a88c6a7..8f414c57 100644 --- a/build/systemMenu_RED/NandAppDebugCoordinator/ARM9.TWL/src/font_data.c +++ b/build/systemMenu_RED/ImportJump/ARM9.TWL/src/font_data.c @@ -1,5 +1,5 @@ /*---------------------------------------------------------------------------* - Project: NandAppDebugCoordinator + Project: ImportJump File: font_data.c Copyright 2008 Nintendo. All rights reserved. @@ -89,7 +89,7 @@ const u16 PlttDataObj[16][16] = { // 上画面コンソール文字列パレット const u16 PlttDataMain[16][16] = { - {RGB555( 0, 0, 0), RGB555(31, 10, 0), RGB555(0, 0, 0), RGB555(0, 0, 0),}, // Orange + {RGB555(31, 31, 31), RGB555(31, 10, 0), RGB555(0, 0, 0), RGB555(0, 0, 0),}, // Orange {RGB555(31, 31, 31), RGB555(31, 0, 0), RGB555(31, 0, 0), RGB555(31, 0, 0),}, // Red {RGB555(31, 31, 31), RGB555(0, 31, 0), RGB555(0, 31, 0), RGB555(0, 31, 0),}, // Green {RGB555(31, 31, 31), RGB555(0, 0, 31), RGB555(0, 0, 31), RGB555(0, 0, 31),}, // Blue @@ -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( 5, 5, 5), RGB555( 5, 5, 5), RGB555( 5, 5, 5), RGB555(31, 31, 31),}, // Black }; // 下画面コンソール文字列パレット diff --git a/build/systemMenu_RED/NandAppDebugCoordinator/ARM9.TWL/src/graphics.c b/build/systemMenu_RED/ImportJump/ARM9.TWL/src/graphics.c similarity index 79% rename from build/systemMenu_RED/NandAppDebugCoordinator/ARM9.TWL/src/graphics.c rename to build/systemMenu_RED/ImportJump/ARM9.TWL/src/graphics.c index 73bbddb0..7a7a1b9d 100644 --- a/build/systemMenu_RED/NandAppDebugCoordinator/ARM9.TWL/src/graphics.c +++ b/build/systemMenu_RED/ImportJump/ARM9.TWL/src/graphics.c @@ -1,5 +1,5 @@ /*---------------------------------------------------------------------------* - Project: NandAppDebugCoordinator + Project: ImportJump File: praphics.c Copyright 2008 Nintendo. All rights reserved. @@ -66,7 +66,7 @@ InitGraphics(void) //---- 3D初期化 G3X_Init(); G3X_InitMtxStack(); - G2_SetBG0Priority(0); + G2_SetBG0Priority(3); G3X_AlphaTest(FALSE, 0); G3X_AntiAlias(TRUE); G3X_EdgeMarking(FALSE); @@ -158,3 +158,42 @@ DrawLine(s16 sx, s16 sy, s16 ex, s16 ey, GXRgb color) } G3_End(); } + +/*---------------------------------------------------------------------------* + Name: DrawQuad + + Description: 四角ポリゴンを描画 + + Arguments: sx - 描画する線の開始点のx座標 + sy - 描画する線の開始点のy座標 + ex - 描画する線の終点のx座標 + ey - 描画する線の終点のy座標 + color - 描画する線の色 + + Returns: None. + *---------------------------------------------------------------------------*/ +void +DrawQuad(s16 sx, s16 sy, s16 ex, s16 ey, GXRgb color) +{ + fx16 fsx = (fx16)(((sx - 128) * 0x1000) / 128); + fx16 fsy = (fx16)(((96 - sy) * 0x1000) / 96); + fx16 fex = (fx16)(((ex - 128) * 0x1000) / 128); + fx16 fey = (fx16)(((96 - ey) * 0x1000) / 96); + + G3_Begin(GX_BEGIN_QUADS); + { + G3_Color( color ); + G3_Vtx(fsx, fsy, 0); + + G3_Color( color ); + G3_Vtx(fex, fsy, 0); + + G3_Color( color ); + G3_Vtx(fex, fey, 0); + + G3_Color( color ); + G3_Vtx(fsx, fey, 1); + } + G3_End(); +} + diff --git a/build/systemMenu_RED/NandAppDebugCoordinator/ARM9.TWL/src/import.c b/build/systemMenu_RED/ImportJump/ARM9.TWL/src/import.c similarity index 87% rename from build/systemMenu_RED/NandAppDebugCoordinator/ARM9.TWL/src/import.c rename to build/systemMenu_RED/ImportJump/ARM9.TWL/src/import.c index 59e3cba9..09754081 100644 --- a/build/systemMenu_RED/NandAppDebugCoordinator/ARM9.TWL/src/import.c +++ b/build/systemMenu_RED/ImportJump/ARM9.TWL/src/import.c @@ -1,5 +1,5 @@ /*---------------------------------------------------------------------------* - Project: NandAppDebugCoordinator + Project: ImportJump File: process_import.c Copyright 2008 Nintendo. All rights reserved. @@ -25,6 +25,7 @@ #include "kami_font.h" #include "import.h" #include "TWLHWInfo_api.h" +#include "graphics.h" /*---------------------------------------------------------------------------* @@ -51,7 +52,6 @@ static vu8 sNowImport = FALSE; static void ProgressThread(void* arg); static void Destructor(void* arg); -void ProgressInit(void); void ProgressDraw(f32 ratio); static void UpdateNandBoxCount( void ); @@ -159,7 +159,8 @@ static void ProgressThread(void* /*arg*/) u32 totalSize = 0; u32 totalSizeBk = 0; - ProgressInit(); + kamiFontPrintfMain( 4, 9, 8, "Now Importing..."); + kamiFontLoadScreenData(); while (TRUE) { @@ -185,20 +186,6 @@ static void ProgressThread(void* /*arg*/) sNowImport = FALSE; } -/*---------------------------------------------------------------------------* - Name: ProgressInit - - Description: インポートの進捗を表示します - - Arguments: - - Returns: None. - *---------------------------------------------------------------------------*/ -void ProgressInit(void) -{ - sCurrentProgress = 0; -} - /*---------------------------------------------------------------------------* Name: ProgressDraw @@ -210,23 +197,24 @@ void ProgressInit(void) *---------------------------------------------------------------------------*/ void ProgressDraw(f32 ratio) { - char square[2] = { 0x01, 0x00 }; - u32 temp; - s32 i; + s16 x = (s16)(30 + (226 - 30)*ratio); - temp = (u32)(32 * ratio); - if (temp > sCurrentProgress) - { - s32 diff = (s32)(temp - sCurrentProgress); - for (i=0;i