From a434ba6f8d3279cb0d049d00efb068214af9cf0a Mon Sep 17 00:00:00 2001 From: kamikawa Date: Fri, 4 Apr 2008 05:13:52 +0000 Subject: [PATCH] =?UTF-8?q?Revision1057=20=E3=81=A7=E3=83=AF=E3=82=A4?= =?UTF-8?q?=E3=83=A4=E3=83=AC=E3=82=B9=E5=BC=B7=E5=88=B6Disable=E3=83=95?= =?UTF-8?q?=E3=83=A9=E3=82=B0=E3=81=AE=E8=AA=AD=E3=81=BF=E6=9B=B8=E3=81=8D?= =?UTF-8?q?=E3=81=AB=E5=AF=BE=E5=BF=9C=E3=81=95=E3=81=9B=E3=81=BE=E3=81=97?= =?UTF-8?q?=E3=81=9F=E3=81=8C=E3=80=81=E4=B8=80=E8=88=AC=E9=96=8B=E7=99=BA?= =?UTF-8?q?=E8=80=85=E3=81=AB=E3=81=AF=E7=84=A1=E7=94=A8=E3=81=AA=E6=A9=9F?= =?UTF-8?q?=E8=83=BD=E3=81=A7=E3=81=82=E3=82=8B=E3=81=9F=E3=82=81=E3=83=87?= =?UTF-8?q?=E3=83=95=E3=82=A9=E3=83=AB=E3=83=88=E3=81=A7=E3=81=AF=E4=BD=BF?= =?UTF-8?q?=E3=81=88=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB=E3=81=97?= =?UTF-8?q?=E3=81=BE=E3=81=97=E3=81=9F=E3=80=82=20Makefile=20=E3=81=AB?= =?UTF-8?q?=E3=81=A6=E3=80=80=E5=A4=89=E6=95=B0=E5=AE=9A=E7=BE=A9=E3=82=92?= =?UTF-8?q?=E6=9C=89=E5=8A=B9=E3=81=AB=E3=81=99=E3=82=8B=E3=81=93=E3=81=A8?= =?UTF-8?q?=E3=81=AB=E3=82=88=E3=82=8A=E3=80=81=E3=83=AF=E3=82=A4=E3=83=A4?= =?UTF-8?q?=E3=83=AC=E3=82=B9=E5=BC=B7=E5=88=B6Disable=E3=83=95=E3=83=A9?= =?UTF-8?q?=E3=82=B0=E3=81=AE=E8=AA=AD=E3=81=BF=E6=9B=B8=E3=81=8D=E3=81=AB?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=E3=81=97=E3=81=9F=20NandInitializer=20?= =?UTF-8?q?=E3=82=92=E4=BD=9C=E3=82=8B=E3=81=93=E3=81=A8=E3=81=8C=E3=81=A7?= =?UTF-8?q?=E3=81=8D=E3=81=BE=E3=81=99=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@1065 b08762b0-b915-fc4b-9d8c-17b2551a87ff --- .../NandInitializer/ARM9.TWL/Makefile | 6 +- .../ARM9.TWL/include/kami_font.h | 21 +- .../include/process_wireless_setting.h | 53 +++++ .../ARM9.TWL/src/font_data.c | 4 +- .../ARM9.TWL/src/process_hw_info.c | 48 +--- .../ARM9.TWL/src/process_topmenu.c | 112 +++++----- .../ARM9.TWL/src/process_wireless_setting.c | 211 ++++++++++++++++++ 7 files changed, 346 insertions(+), 109 deletions(-) create mode 100644 build/systemMenu_RED/NandInitializerRed/ARM9.TWL/include/process_wireless_setting.h create mode 100644 build/systemMenu_RED/NandInitializerRed/ARM9.TWL/src/process_wireless_setting.c diff --git a/build/systemMenu_RED/NandInitializer/ARM9.TWL/Makefile b/build/systemMenu_RED/NandInitializer/ARM9.TWL/Makefile index f66b1c97..d67290db 100644 --- a/build/systemMenu_RED/NandInitializer/ARM9.TWL/Makefile +++ b/build/systemMenu_RED/NandInitializer/ARM9.TWL/Makefile @@ -18,7 +18,6 @@ SUBDIRS = - #---------------------------------------------------------------------------- #============================================================================ @@ -29,6 +28,10 @@ SUBDIRS = # NandInitializerRedから一部の機能を削除するために定義を追加します。 MACRO_FLAGS += -DNAND_INITIALIZER_LIMITED_MODE #============================================================================ +#============================================================================ +# ワイヤレスの強制Disableフラグを設定可能にする場合定義します。(要:Make Clean) +#MACRO_FLAGS += -DUSE_WIRELESS_FORCE_DISABLE_SETTING +#============================================================================ TARGET_FIRM = SYSTEMMENU TARGET_PLATFORM = TWL @@ -56,6 +59,7 @@ SRCS = main.c \ process_format.c \ process_topmenu.c \ process_hw_info.c \ + process_wireless_setting.c \ process_fade.c \ sd_event.c \ hwi.c diff --git a/build/systemMenu_RED/NandInitializerRed/ARM9.TWL/include/kami_font.h b/build/systemMenu_RED/NandInitializerRed/ARM9.TWL/include/kami_font.h index fe510ad3..e8bba22d 100644 --- a/build/systemMenu_RED/NandInitializerRed/ARM9.TWL/include/kami_font.h +++ b/build/systemMenu_RED/NandInitializerRed/ARM9.TWL/include/kami_font.h @@ -66,16 +66,17 @@ void kamiFontPrintfConsoleEx(u8 color, const char *text, ...); #define FONT_COLOR_PURPLE 6 // 下画面背景用パレット -#define BG_COLOR_TRANS 0 -#define BG_COLOR_WHITE 1 -#define BG_COLOR_BLACK 2 -#define BG_COLOR_GRAY 3 -#define BG_COLOR_PURPLE 4 -#define BG_COLOR_PINK 5 -#define BG_COLOR_BLUE 6 -#define BG_COLOR_GREEN 7 -#define BG_COLOR_VIOLET 8 -#define BG_COLOR_RED 9 +#define BG_COLOR_TRANS 0 +#define BG_COLOR_WHITE 1 +#define BG_COLOR_BLACK 2 +#define BG_COLOR_GRAY 3 +#define BG_COLOR_PURPLE 4 +#define BG_COLOR_PINK 5 +#define BG_COLOR_BLUE 6 +#define BG_COLOR_GREEN 7 +#define BG_COLOR_VIOLET 8 +#define BG_COLOR_RED 9 +#define BG_COLOR_YELLOW 10 #define BG_COLOR_NONE 0xff diff --git a/build/systemMenu_RED/NandInitializerRed/ARM9.TWL/include/process_wireless_setting.h b/build/systemMenu_RED/NandInitializerRed/ARM9.TWL/include/process_wireless_setting.h new file mode 100644 index 00000000..a3f9f8d8 --- /dev/null +++ b/build/systemMenu_RED/NandInitializerRed/ARM9.TWL/include/process_wireless_setting.h @@ -0,0 +1,53 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - NandInitializer + File: process_wireless_setting.h + + Copyright 2008 Nintendo. All rights reserved. + + These coded instructions, 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$ + *---------------------------------------------------------------------------*/ + +#ifndef PROCESS_WIRELESS_SETTING_H_ +#define PROCESS_WIRELESS_SETTING_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/*===========================================================================*/ + +#include + +/*---------------------------------------------------------------------------* + 型定義 + *---------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------* + 関数定義 + *---------------------------------------------------------------------------*/ + +void* WirelessSettingProcess0(void); +void* WirelessSettingProcess1(void); +void* WirelessSettingProcess2(void); +void* WirelessSettingProcess3(void); +void* WirelessSettingProcess4(void); + +/*===========================================================================*/ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* PROCESS_WIRELESS_SETTING_H_ */ + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ 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 e9732d7a..765c8a27 100644 --- a/build/systemMenu_RED/NandInitializerRed/ARM9.TWL/src/font_data.c +++ b/build/systemMenu_RED/NandInitializerRed/ARM9.TWL/src/font_data.c @@ -118,8 +118,8 @@ const u16 PlttDataSub[16][16] = { {RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555(31, 31, 31),}, // White // 背景カラーはこの16番パレット - // 白 黒 灰 むらさき ピンク みずいろ 緑 青紫 赤 - {RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555( 0, 0, 0), RGB555(20, 20, 20), RGB555(31, 15, 31), RGB555(31, 20, 20), RGB555(20, 29, 31), RGB555(20, 31, 20), RGB555(21, 21, 31), RGB555(31, 0, 0), RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555(31, 31, 31), } // White + // 白 黒 灰 むらさき ピンク みずいろ 緑 青紫 赤 黄 + {RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555( 0, 0, 0), RGB555(20, 20, 20), RGB555(31, 15, 31), RGB555(31, 20, 20), RGB555(20, 29, 31), RGB555(20, 31, 20), RGB555(21, 21, 31), RGB555(31, 0, 0), RGB555(31, 31, 10), RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555(31, 31, 31), } // White }; /*---------------------- キャラクタデータ -------------------------*/ diff --git a/build/systemMenu_RED/NandInitializerRed/ARM9.TWL/src/process_hw_info.c b/build/systemMenu_RED/NandInitializerRed/ARM9.TWL/src/process_hw_info.c index edbccc09..3d5abae8 100644 --- a/build/systemMenu_RED/NandInitializerRed/ARM9.TWL/src/process_hw_info.c +++ b/build/systemMenu_RED/NandInitializerRed/ARM9.TWL/src/process_hw_info.c @@ -46,8 +46,6 @@ enum { MENU_REGION_AUSTRALIA, MENU_REGION_CHINA, MENU_REGION_KOREA, - MENU_WIRELESS_ENABLE, - MENU_WIRELESS_FORCE_OFF, MENU_RETURN, NUM_OF_MENU_SELECT }; @@ -56,7 +54,6 @@ enum { 定数定義 *---------------------------------------------------------------------------*/ -#define NUM_OF_MENU_REGION 6 #define DOT_OF_MENU_SPACE 16 #define CHAR_OF_MENU_SPACE 2 #define MENU_TOP_LINE 5 @@ -69,10 +66,6 @@ enum { static s8 sMenuSelectNo; -static u8 *s_pPrivKeyBuffer = NULL; -static LCFGReadResult (*s_pReadSecureInfoFunc)( void ); -static BOOL s_isReadTSD; - /*---------------------------------------------------------------------------* 内部関数宣言 *---------------------------------------------------------------------------*/ @@ -125,21 +118,12 @@ void* HWInfoProcess0(void) kamiFontPrintf(3, 14, FONT_COLOR_BLACK, "+--------------------+----+"); kamiFontPrintf(3, 15, FONT_COLOR_BLACK, "l REGION KOREA l l"); kamiFontPrintf(3, 16, FONT_COLOR_BLACK, "+--------------------+----+"); - kamiFontPrintf(3, 17, FONT_COLOR_BLACK, "l l l"); + kamiFontPrintf(3, 17, FONT_COLOR_BLACK, "l RETURN l l"); kamiFontPrintf(3, 18, FONT_COLOR_BLACK, "+--------------------+----+"); - kamiFontPrintf(3, 19, FONT_COLOR_BLACK, "l l l"); - kamiFontPrintf(5, 17, FONT_COLOR_CYAN, " Wireless Enable "); - kamiFontPrintf(5, 19, FONT_COLOR_CYAN, " Wireless Force Off"); - kamiFontPrintf(3, 20, FONT_COLOR_BLACK, "+--------------------+----+"); - kamiFontPrintf(3, 21, FONT_COLOR_BLACK, "l RETURN l l"); - kamiFontPrintf(3, 22, FONT_COLOR_BLACK, "+--------------------+----+"); // 現在のリージョンに"now"と表示 kamiFontPrintf(26, (s16)(MENU_TOP_LINE+LCFG_THW_GetRegion()*CHAR_OF_MENU_SPACE), FONT_COLOR_BLACK, "now"); - // 現在の無線強制OFF状態に"now"と表示 - kamiFontPrintf(26, (s16)(MENU_TOP_LINE+(NUM_OF_MENU_REGION + LCFG_THW_IsForceDisableWireless())*CHAR_OF_MENU_SPACE), FONT_COLOR_BLACK, "now"); - // 背景全クリア for (i=0;i<24;i++) { @@ -232,7 +216,7 @@ void* HWInfoProcess2(void) result = WriteHWInfoFile( (u8)sMenuSelectNo, LCFG_THW_IsForceDisableWireless() ); // 全リージョンの結果をクリア - for (i=0;i", __DATE__); - // メニュー一覧 - kamiFontPrintf(3, 7, FONT_COLOR_BLACK, " FORMAT NAND "); - kamiFontPrintf(3, 9, FONT_COLOR_BLACK, " WRITE HARDWARE INFO "); -#ifndef NAND_INITIALIZER_LIMITED_MODE - kamiFontPrintf(3, 11, FONT_COLOR_BLACK, " WRITE ETICKET SIGN "); - kamiFontPrintf(3, 13, FONT_COLOR_BLACK, " INPORT TAD FROM SD "); - kamiFontPrintf(3, 15, FONT_COLOR_BLACK, " INPORT NANDFIRM FROM SD"); - kamiFontPrintf(3, 17, FONT_COLOR_BLACK, " INPORT NORFIRM FROM SD"); -#endif - // 背景全クリア for (i=0;i<24;i++) { kamiFontFillChar( i, BG_COLOR_TRANS, BG_COLOR_TRANS ); } - // 背景設定 - kamiFontFillChar( 6, BG_COLOR_TRANS, BG_COLOR_BLUE ); - kamiFontFillChar( 7, BG_COLOR_BLUE, BG_COLOR_BLUE ); - kamiFontFillChar( 8, BG_COLOR_BLUE, BG_COLOR_TRANS ); - - kamiFontFillChar( 8, BG_COLOR_NONE, BG_COLOR_PURPLE ); - kamiFontFillChar( 9, BG_COLOR_PURPLE, BG_COLOR_PURPLE ); - kamiFontFillChar(10, BG_COLOR_PURPLE, BG_COLOR_TRANS ); -#ifndef NAND_INITIALIZER_LIMITED_MODE - kamiFontFillChar(10, BG_COLOR_NONE, BG_COLOR_GRAY ); - kamiFontFillChar(11, BG_COLOR_GRAY, BG_COLOR_GRAY ); - kamiFontFillChar(12, BG_COLOR_GRAY, BG_COLOR_TRANS ); - - kamiFontFillChar(12, BG_COLOR_NONE, BG_COLOR_PINK ); - kamiFontFillChar(13, BG_COLOR_PINK, BG_COLOR_PINK ); - kamiFontFillChar(14, BG_COLOR_PINK, BG_COLOR_TRANS ); - - kamiFontFillChar(14, BG_COLOR_NONE, BG_COLOR_GREEN ); - kamiFontFillChar(15, BG_COLOR_GREEN, BG_COLOR_GREEN ); - kamiFontFillChar(16, BG_COLOR_GREEN, BG_COLOR_TRANS ); - - kamiFontFillChar(16, BG_COLOR_NONE, BG_COLOR_VIOLET ); - kamiFontFillChar(17, BG_COLOR_VIOLET, BG_COLOR_VIOLET ); - kamiFontFillChar(18, BG_COLOR_VIOLET, BG_COLOR_TRANS ); -#endif + for (i=0;i +#include +#include "kami_font.h" +#include "process_topmenu.h" +#include "process_hw_info.h" +#include "process_wireless_setting.h" +#include "process_fade.h" +#include "cursor.h" +#include "keypad.h" +#include "hwi.h" + +/*---------------------------------------------------------------------------* + 型定義 + *---------------------------------------------------------------------------*/ + +enum { + MENU_WIRELESS_ENABLE, + MENU_WIRELESS_FORCE_OFF, + MENU_RETURN, + NUM_OF_MENU_SELECT +}; + +/*---------------------------------------------------------------------------* + 定数定義 + *---------------------------------------------------------------------------*/ + +#define DOT_OF_MENU_SPACE 16 +#define CHAR_OF_MENU_SPACE 2 +#define MENU_TOP_LINE 5 +#define CURSOR_ORIGIN_X 32 +#define CURSOR_ORIGIN_Y 40 + +/*---------------------------------------------------------------------------* + 内部変数定義 + *---------------------------------------------------------------------------*/ + +static s8 sMenuSelectNo; + +/*---------------------------------------------------------------------------* + 内部関数宣言 + *---------------------------------------------------------------------------*/ + +static BOOL WriteHWNormalInfoFile( void ); +static BOOL WriteHWSecureInfoFile( u8 region ); + +const LCFGTWLHWNormalInfo *LCFG_THW_GetDefaultNormalInfo( void ); +const LCFGTWLHWSecureInfo *LCFG_THW_GetDefaultSecureInfo( void ); +const LCFGTWLHWNormalInfo *LCFG_THW_GetNormalInfo( void ); +const LCFGTWLHWSecureInfo *LCFG_THW_GetSecureInfo( void ); + +/*---------------------------------------------------------------------------* + プロセス関数定義 + *---------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------* + Name: WirelessSetting プロセス0 + + Description: + + Arguments: None. + + Returns: next sequence + *---------------------------------------------------------------------------*/ + +void* WirelessSettingProcess0(void) +{ + int i; + + // 文字列全クリア + kamiFontClear(); + + // バージョン表示 + kamiFontPrintf(2, 1, FONT_COLOR_BLACK, "Wireless Setting "); + kamiFontPrintf(0, 2, FONT_COLOR_BLACK, "--------------------------------"); + + // メニュー一覧 + kamiFontPrintf(3, 4, FONT_COLOR_BLACK, "+--------------------+----+"); + kamiFontPrintf(3, 5, FONT_COLOR_BLACK, "l Wireless Enable l l"); + kamiFontPrintf(3, 6, FONT_COLOR_BLACK, "+--------------------+----+"); + kamiFontPrintf(3, 7, FONT_COLOR_BLACK, "l Wireless Force Offl l"); + kamiFontPrintf(3, 8, FONT_COLOR_BLACK, "+--------------------+----+"); + kamiFontPrintf(3, 9, FONT_COLOR_BLACK, "l RETURN l l"); + kamiFontPrintf(3, 10, FONT_COLOR_BLACK, "+--------------------+----+"); + + // 現在の無線強制OFF状態に"now"と表示 + kamiFontPrintf(26, (s16)(MENU_TOP_LINE+LCFG_THW_IsForceDisableWireless()*CHAR_OF_MENU_SPACE), FONT_COLOR_BLACK, "now"); + + // 背景全クリア + for (i=0;i<24;i++) + { + kamiFontFillChar( i, BG_COLOR_TRANS, BG_COLOR_TRANS ); + } + + // 背景上部 + kamiFontFillChar( 0, BG_COLOR_YELLOW, BG_COLOR_YELLOW ); + kamiFontFillChar( 1, BG_COLOR_YELLOW, BG_COLOR_YELLOW ); + kamiFontFillChar( 2, BG_COLOR_YELLOW, BG_COLOR_TRANS ); + + // カーソル除外 + SetCursorPos((u16)200, (u16)200); + + FADE_IN_RETURN( WirelessSettingProcess1 ); +} + +/*---------------------------------------------------------------------------* + Name: WirelessSetting プロセス1 + + Description: + + Arguments: None. + + Returns: next sequence + *---------------------------------------------------------------------------*/ + +void* WirelessSettingProcess1(void) +{ + // 選択メニューの変更 + if ( kamiPadIsRepeatTrigger(PAD_KEY_UP) ) + { + if (--sMenuSelectNo < 0) sMenuSelectNo = NUM_OF_MENU_SELECT -1; + } + else if ( kamiPadIsRepeatTrigger(PAD_KEY_DOWN) ) + { + if (++sMenuSelectNo >= NUM_OF_MENU_SELECT) sMenuSelectNo = 0; + } + + // カーソル配置 + SetCursorPos((u16)CURSOR_ORIGIN_X, (u16)(CURSOR_ORIGIN_Y + sMenuSelectNo * DOT_OF_MENU_SPACE)); + + // 決定 + if (kamiPadIsTrigger(PAD_BUTTON_A)) + { + return WirelessSettingProcess2; + } + // トップメニューへ戻る + else if (kamiPadIsTrigger(PAD_BUTTON_B)) + { + FADE_OUT_RETURN( TopmenuProcess0 ); + } + + return WirelessSettingProcess1; +} + +/*---------------------------------------------------------------------------* + Name: WirelessSetting プロセス2 + + Description: + + Arguments: None. + + Returns: next sequence + *---------------------------------------------------------------------------*/ + +void* WirelessSettingProcess2(void) +{ + BOOL result; + + switch( sMenuSelectNo ) + { + case MENU_WIRELESS_ENABLE: + result = WriteHWInfoFile( LCFG_THW_GetRegion(), FALSE ); + if ( result == TRUE ) + { + kamiFontPrintf(26, (s16)(MENU_TOP_LINE+MENU_WIRELESS_ENABLE*CHAR_OF_MENU_SPACE), FONT_COLOR_GREEN, "OK "); + kamiFontPrintf(26, (s16)(MENU_TOP_LINE+MENU_WIRELESS_FORCE_OFF*CHAR_OF_MENU_SPACE), FONT_COLOR_GREEN, " "); + } + else + { + kamiFontPrintf(26, (s16)(MENU_TOP_LINE+MENU_WIRELESS_ENABLE*CHAR_OF_MENU_SPACE), FONT_COLOR_GREEN, "NG "); + kamiFontPrintf(26, (s16)(MENU_TOP_LINE+MENU_WIRELESS_FORCE_OFF*CHAR_OF_MENU_SPACE), FONT_COLOR_GREEN, " "); + } + break; + + case MENU_WIRELESS_FORCE_OFF: + result = WriteHWInfoFile( LCFG_THW_GetRegion(), TRUE ); + if ( result == TRUE ) + { + kamiFontPrintf(26, (s16)(MENU_TOP_LINE+MENU_WIRELESS_ENABLE*CHAR_OF_MENU_SPACE), FONT_COLOR_GREEN, " "); + kamiFontPrintf(26, (s16)(MENU_TOP_LINE+MENU_WIRELESS_FORCE_OFF*CHAR_OF_MENU_SPACE), FONT_COLOR_GREEN, "OK "); + } + else + { + kamiFontPrintf(26, (s16)(MENU_TOP_LINE+MENU_WIRELESS_ENABLE*CHAR_OF_MENU_SPACE), FONT_COLOR_GREEN, " "); + kamiFontPrintf(26, (s16)(MENU_TOP_LINE+MENU_WIRELESS_FORCE_OFF*CHAR_OF_MENU_SPACE), FONT_COLOR_GREEN, "NG "); + } + break; + + case MENU_RETURN: + FADE_OUT_RETURN( TopmenuProcess0 ); + break; + } + + return WirelessSettingProcess1; +}