From 196826e6aff9e6fcbaa40fd7cc2c63b9d58549ba Mon Sep 17 00:00:00 2001 From: kamikawa Date: Fri, 8 Feb 2008 08:56:10 +0000 Subject: [PATCH] =?UTF-8?q?NAND=E3=81=AE=E6=93=AC=E4=BC=BC=E3=83=95?= =?UTF-8?q?=E3=82=A9=E3=83=BC=E3=83=9E=E3=83=83=E3=83=88=E5=87=A6=E7=90=86?= =?UTF-8?q?=E3=81=AB=E5=AF=BE=E5=BF=9C=E3=80=82=E3=82=B7=E3=83=BC=E3=83=B3?= =?UTF-8?q?=E5=88=87=E3=82=8A=E6=9B=BF=E3=81=88=E3=81=AB=E3=83=95=E3=82=A7?= =?UTF-8?q?=E3=83=BC=E3=83=89=E5=8A=B9=E6=9E=9C=E3=82=92=E8=BF=BD=E5=8A=A0?= =?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@626 b08762b0-b915-fc4b-9d8c-17b2551a87ff --- .../NandInitializer/ARM9.TWL/ARM9-TS.lsf | 2 +- .../NandInitializer/ARM9.TWL/Makefile | 7 +- .../ARM9.TWL/include/process_eticket.h | 8 +- .../ARM9.TWL/include/process_fade.h | 59 ++++++++++ .../ARM9.TWL/include/sd_event.h | 45 ++++++++ .../NandInitializer/ARM9.TWL/src/main.c | 20 ++-- .../ARM9.TWL/src/process_auto.c | 12 +- .../ARM9.TWL/src/process_eticket.c | 33 ++---- .../ARM9.TWL/src/process_fade.c | 109 ++++++++++++++++++ .../ARM9.TWL/src/process_format.c | 79 ++++++++----- .../ARM9.TWL/src/process_hw_info.c | 33 ++---- .../ARM9.TWL/src/process_import.c | 31 +++-- .../ARM9.TWL/src/process_nandfirm.c | 20 ++-- .../ARM9.TWL/src/process_norfirm.c | 14 ++- .../ARM9.TWL/src/process_topmenu.c | 45 +++----- .../NandInitializer/ARM9.TWL/src/sd_event.c | 57 +++++++++ 16 files changed, 421 insertions(+), 153 deletions(-) create mode 100644 build/systemMenu_RED/NandInitializer/ARM9.TWL/include/process_fade.h create mode 100644 build/systemMenu_RED/NandInitializer/ARM9.TWL/include/sd_event.h create mode 100644 build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_fade.c create mode 100644 build/systemMenu_RED/NandInitializer/ARM9.TWL/src/sd_event.c diff --git a/build/systemMenu_RED/NandInitializer/ARM9.TWL/ARM9-TS.lsf b/build/systemMenu_RED/NandInitializer/ARM9.TWL/ARM9-TS.lsf index 55706a80..27b5d91f 100644 --- a/build/systemMenu_RED/NandInitializer/ARM9.TWL/ARM9-TS.lsf +++ b/build/systemMenu_RED/NandInitializer/ARM9.TWL/ARM9-TS.lsf @@ -23,7 +23,7 @@ Static $(TARGET_NAME) Address $(ADDRESS_STATIC) Object $(OBJS_STATIC) Library $(LLIBS) $(GLIBS) $(CW_LIBS) - StackSize 2048 2048 + StackSize 4096 4096 } Autoload ITCM diff --git a/build/systemMenu_RED/NandInitializer/ARM9.TWL/Makefile b/build/systemMenu_RED/NandInitializer/ARM9.TWL/Makefile index ad9efcb9..874c05de 100644 --- a/build/systemMenu_RED/NandInitializer/ARM9.TWL/Makefile +++ b/build/systemMenu_RED/NandInitializer/ARM9.TWL/Makefile @@ -58,7 +58,9 @@ SRCS = main.c \ process_import.c \ process_nandfirm.c \ process_norfirm.c \ - process_auto.c + process_auto.c \ + process_fade.c \ + sd_event.c LINCLUDES = ../common/include \ $(ROOT)/build/libraries/lcfg/ARM9.TWL/include @@ -86,7 +88,8 @@ endif LLIBRARIES += libes$(TWL_LIBSUFFIX).a \ libboc$(TWL_LIBSUFFIX).a \ libnam$(TWL_LIBSUFFIX).a \ - libacsign_enc$(TWL_LIBSUFFIX).a + libacsign_enc$(TWL_LIBSUFFIX).a \ + libnamut$(TWL_LIBSUFFIX).a #include $(TWLSDK_ROOT)/build/buildtools/commondefs diff --git a/build/systemMenu_RED/NandInitializer/ARM9.TWL/include/process_eticket.h b/build/systemMenu_RED/NandInitializer/ARM9.TWL/include/process_eticket.h index 2b24ce98..16b81232 100644 --- a/build/systemMenu_RED/NandInitializer/ARM9.TWL/include/process_eticket.h +++ b/build/systemMenu_RED/NandInitializer/ARM9.TWL/include/process_eticket.h @@ -11,8 +11,8 @@ in whole or in part, without the prior written consent of Nintendo. $Date:: $ - $Rev:$ - $Author:$ + $Rev$ + $Author$ *---------------------------------------------------------------------------*/ #ifndef PROCESS_ETICKET_H_ @@ -29,8 +29,8 @@ extern "C" { /*---------------------------------------------------------------------------* 定数定義 *---------------------------------------------------------------------------*/ -#define E_TICKET_FILE_PATH_IN_ROM "data/cert.sys" -#define E_TICKET_FILE_PATH_IN_NAND "F:sys/cert.sys" +#define E_TICKET_FILE_PATH_IN_ROM "rom:/data/cert.sys" +#define E_TICKET_FILE_PATH_IN_NAND "nand:sys/cert.sys" /*---------------------------------------------------------------------------* 関数定義 diff --git a/build/systemMenu_RED/NandInitializer/ARM9.TWL/include/process_fade.h b/build/systemMenu_RED/NandInitializer/ARM9.TWL/include/process_fade.h new file mode 100644 index 00000000..14643852 --- /dev/null +++ b/build/systemMenu_RED/NandInitializer/ARM9.TWL/include/process_fade.h @@ -0,0 +1,59 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - NandInitializer + File: process_fade.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_FADE_H_ +#define PROCESS_FADE_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/*===========================================================================*/ + +#include + +/*---------------------------------------------------------------------------* + 型定義 + *---------------------------------------------------------------------------*/ +typedef void* (*Process)(void); + +/*---------------------------------------------------------------------------* + マクロ定義 + *---------------------------------------------------------------------------*/ + +#define FADE_IN_RETURN(P) SetNextProcess(P);return fadeInProcess; +#define FADE_OUT_RETURN(P) SetNextProcess(P);return fadeOutProcess; + +/*---------------------------------------------------------------------------* + 関数定義 + *---------------------------------------------------------------------------*/ + +void* fadeInProcess(void); +void* fadeOutProcess(void); +void SetNextProcess(Process process); + +/*===========================================================================*/ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* PROCESS_FADE_H_ */ + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/systemMenu_RED/NandInitializer/ARM9.TWL/include/sd_event.h b/build/systemMenu_RED/NandInitializer/ARM9.TWL/include/sd_event.h new file mode 100644 index 00000000..84df85ae --- /dev/null +++ b/build/systemMenu_RED/NandInitializer/ARM9.TWL/include/sd_event.h @@ -0,0 +1,45 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - NandInitializer + File: sd_event.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 SD_EVENT_H_ +#define SD_EVENT_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/*===========================================================================*/ + +#include + +/*---------------------------------------------------------------------------* + 関数定義 + *---------------------------------------------------------------------------*/ + +void SDEvents(void *userdata, FSEvent event, void *arg); + +/*===========================================================================*/ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* SD_EVENT_H_ */ + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/main.c b/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/main.c index 2ee3f2c9..c38493f9 100644 --- a/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/main.c +++ b/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/main.c @@ -11,31 +11,31 @@ in whole or in part, without the prior written consent of Nintendo. $Date:: $ - $Rev:$ - $Author:$ + $Rev$ + $Author$ *---------------------------------------------------------------------------*/ #include #include +#include +#include +#include #include "kami_font.h" #include "process_format.h" #include "process_topmenu.h" #include "graphics.h" #include "keypad.h" #include "kami_pxi.h" -#include -#include -#include - +#include "sd_event.h" +#include "process_fade.h" extern void HWInfoWriterInit( void ); -typedef void* (*Process)(void); - /*---------------------------------------------------------------------------* 内部変数定義 *---------------------------------------------------------------------------*/ static Process sProcess; +static FSEventHook sSDHook; /*---------------------------------------------------------------------------* 内部関数定義 @@ -84,8 +84,10 @@ TwlMain() (void)OS_EnableIrq(); (void)GX_VBlankIntr(TRUE); - /* initialize file-system */ + // initialize file-system FS_Init(FS_DMA_NOT_USE); + // SDカードの挿抜イベント監視コールバック設定 + FS_RegisterEventHook("sdmc", &sSDHook, SDEvents, NULL); // SD起動などあらゆるマウント状態に対応する FATFS_UnmountDrive("F:"); diff --git a/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_auto.c b/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_auto.c index 6f21e0c7..7ed702d5 100644 --- a/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_auto.c +++ b/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_auto.c @@ -11,8 +11,8 @@ in whole or in part, without the prior written consent of Nintendo. $Date:: $ - $Rev:$ - $Author:$ + $Rev$ + $Author$ *---------------------------------------------------------------------------*/ #include @@ -25,6 +25,7 @@ #include "process_nandfirm.h" #include "process_norfirm.h" #include "process_auto.h" +#include "process_fade.h" #include "cursor.h" #include "keypad.h" @@ -183,10 +184,13 @@ void* AutoProcess2(void) kamiFontFillChar(18, bg_color, bg_color ); kamiFontFillChar(19, bg_color, BG_COLOR_TRANS ); + // カーソル消去 + SetCursorPos((u16)200, (u16)200); + // オートフラグクリア gAutoFlag = FALSE; - return AutoProcess3; + FADE_IN_RETURN( AutoProcess3 ); } /*---------------------------------------------------------------------------* @@ -203,7 +207,7 @@ void* AutoProcess3(void) { if (kamiPadIsTrigger(PAD_BUTTON_B)) { - return TopmenuProcess0; + FADE_OUT_RETURN( TopmenuProcess0 ); } return AutoProcess3; diff --git a/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_eticket.c b/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_eticket.c index 3cb484f4..158bbe69 100644 --- a/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_eticket.c +++ b/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_eticket.c @@ -11,8 +11,8 @@ in whole or in part, without the prior written consent of Nintendo. $Date:: $ - $Rev:$ - $Author:$ + $Rev$ + $Author$ *---------------------------------------------------------------------------*/ #include @@ -24,6 +24,7 @@ #include "process_topmenu.h" #include "process_eticket.h" #include "process_auto.h" +#include "process_fade.h" #include "cursor.h" #include "keypad.h" @@ -98,7 +99,10 @@ void* eTicketProcess0(void) kamiFontFillChar( 1, BG_COLOR_GRAY, BG_COLOR_GRAY ); kamiFontFillChar( 2, BG_COLOR_GRAY, BG_COLOR_TRANS ); - return eTicketProcess1; + // カーソル消去 + SetCursorPos((u16)200, (u16)200); + + FADE_IN_RETURN( eTicketProcess1 ); } /*---------------------------------------------------------------------------* @@ -141,7 +145,7 @@ void* eTicketProcess1(void) // トップメニューへ戻る else if (kamiPadIsTrigger(PAD_BUTTON_B)) { - return TopmenuProcess0; + FADE_OUT_RETURN( TopmenuProcess0 ); } return eTicketProcess1; @@ -175,34 +179,19 @@ void* eTicketProcess2(void) } break; case 1: - return TopmenuProcess0; + FADE_OUT_RETURN( TopmenuProcess0 ); } // Auto用 if (gAutoFlag) { - if (result) return AutoProcess1; - else return AutoProcess2; + if (result) { FADE_OUT_RETURN( AutoProcess1 ); } + else { FADE_OUT_RETURN( AutoProcess2); } } return eTicketProcess1; } -/*---------------------------------------------------------------------------* - Name: eTicket プロセス3 - - Description: - - Arguments: None. - - Returns: next sequence - *---------------------------------------------------------------------------*/ - -void* eTicketProcess3(void) -{ - return eTicketProcess3; -} - /*---------------------------------------------------------------------------* 処理関数定義 *---------------------------------------------------------------------------*/ diff --git a/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_fade.c b/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_fade.c new file mode 100644 index 00000000..1c9bcc42 --- /dev/null +++ b/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_fade.c @@ -0,0 +1,109 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - NandInitializer + File: process_fade.c + + 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:$ + *---------------------------------------------------------------------------*/ + +#include +#include "process_fade.h" + +/*---------------------------------------------------------------------------* + 型定義 + *---------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------* + 定数定義 + *---------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------* + 内部変数定義 + *---------------------------------------------------------------------------*/ + +static Process sNextProcess; +static int brightness = 16; + +/*---------------------------------------------------------------------------* + 内部関数宣言 + *---------------------------------------------------------------------------*/ + +static BOOL MakeETicketFile(void); + +/*---------------------------------------------------------------------------* + プロセス関数定義 + *---------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------* + Name: fadeInProcess プロセス + + Description: フェードインを行い完了後にsNextProcessに遷移します + + Arguments: None. + + Returns: next sequence + *---------------------------------------------------------------------------*/ +void* fadeInProcess(void) +{ + if (--brightness < 0) + { + brightness = 0; + return sNextProcess; + } + else + { + GXS_SetMasterBrightness(brightness); + return fadeInProcess; + } +} + +/*---------------------------------------------------------------------------* + Name: fadeOutProcess プロセス + + Description: フェードアウトを行い完了後にsNextProcessに遷移します + + Arguments: None. + + Returns: next sequence + *---------------------------------------------------------------------------*/ +void* fadeOutProcess(void) +{ + if (++brightness > 16) + { + brightness = 16; + return sNextProcess; + } + else + { + GXS_SetMasterBrightness(brightness); + return fadeOutProcess; + } +} + +/*---------------------------------------------------------------------------* + その他関数定義 + *---------------------------------------------------------------------------*/ +/*---------------------------------------------------------------------------* + Name: SetNextProcess + + Description: プロセスの遷移時にフェードを使いたい場合に使用します + + Arguments: processフェード完了後のプロセス + + Returns: None. + *---------------------------------------------------------------------------*/ + +void SetNextProcess(Process process) +{ + sNextProcess = process; +} + diff --git a/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_format.c b/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_format.c index c5ac956e..e0c24527 100644 --- a/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_format.c +++ b/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_format.c @@ -11,8 +11,8 @@ in whole or in part, without the prior written consent of Nintendo. $Date:: $ - $Rev:$ - $Author:$ + $Rev$ + $Author$ *---------------------------------------------------------------------------*/ #include @@ -24,9 +24,12 @@ #include "process_topmenu.h" #include "process_format.h" #include "process_auto.h" +#include "process_fade.h" #include "cursor.h" #include "keypad.h" +#include + /*---------------------------------------------------------------------------* 型定義 *---------------------------------------------------------------------------*/ @@ -35,10 +38,11 @@ 定数定義 *---------------------------------------------------------------------------*/ -#define NUM_OF_MENU_SELECT 4 +#define NUM_OF_MENU_SELECT 5 #define DOT_OF_MENU_SPACE 16 #define CURSOR_ORIGIN_X 32 #define CURSOR_ORIGIN_Y 56 +#define CHAR_OF_MENU_SPACE 2 /*---------------------------------------------------------------------------* 内部変数定義 @@ -81,14 +85,16 @@ void* FormatProcess0(void) // メニュー一覧 kamiFontPrintf(3, 6, FONT_COLOR_BLACK, "+-------------------+-----+"); - kamiFontPrintf(3, 7, FONT_COLOR_BLACK, "l QUICK FORMAT l l"); + kamiFontPrintf(3, 7, FONT_COLOR_BLACK, "l FORMAT l l"); kamiFontPrintf(3, 8, FONT_COLOR_BLACK, "+-------------------+-----+"); - kamiFontPrintf(3, 9, FONT_COLOR_BLACK, "l FULL FORMAT l l"); + kamiFontPrintf(3, 9, FONT_COLOR_BLACK, "l FORMAT l l"); kamiFontPrintf(3, 10, FONT_COLOR_BLACK, "+-------------------+-----+"); - kamiFontPrintf(3, 11, FONT_COLOR_BLACK, "l CHECK DISK l l"); + kamiFontPrintf(3, 11, FONT_COLOR_BLACK, "l FORMAT l l"); kamiFontPrintf(3, 12, FONT_COLOR_BLACK, "+-------------------+-----+"); - kamiFontPrintf(3, 13, FONT_COLOR_BLACK, "l RETURN l l"); + kamiFontPrintf(3, 13, FONT_COLOR_BLACK, "l CHECK DISK l l"); kamiFontPrintf(3, 14, FONT_COLOR_BLACK, "+-------------------+-----+"); + kamiFontPrintf(3, 15, FONT_COLOR_BLACK, "l RETURN l l"); + kamiFontPrintf(3, 16, FONT_COLOR_BLACK, "+-------------------+-----+"); // 背景全クリア for (i=0;i<24;i++) @@ -101,7 +107,10 @@ void* FormatProcess0(void) kamiFontFillChar( 1, BG_COLOR_BLUE, BG_COLOR_BLUE ); kamiFontFillChar( 2, BG_COLOR_BLUE, BG_COLOR_TRANS ); - return FormatProcess1; + // カーソル除外 + SetCursorPos((u16)200, (u16)200); + + FADE_IN_RETURN( FormatProcess1 ); } /*---------------------------------------------------------------------------* @@ -119,7 +128,7 @@ void* FormatProcess1(void) // オート実行用 if (gAutoFlag) { - sMenuSelectNo = 0; + sMenuSelectNo = 1; return FormatProcess2; } @@ -144,7 +153,7 @@ void* FormatProcess1(void) // トップメニューへ戻る else if (kamiPadIsTrigger(PAD_BUTTON_B)) { - return TopmenuProcess0; + FADE_OUT_RETURN( TopmenuProcess0 ); } return FormatProcess1; @@ -164,24 +173,38 @@ void* FormatProcess2(void) { if (sLock == FALSE) { + s16 y_pos = (s16)(7 + sMenuSelectNo * CHAR_OF_MENU_SPACE); + switch( sMenuSelectNo ) { case 0: - sLock = TRUE; - ExeFormatAsync(FORMAT_MODE_QUICK, FormatCallback); - kamiFontPrintf(24, 7, FONT_COLOR_BLACK, " "); - return FormatProcess3; +// NAMUT_DrawNandTree(); + if (NAMUT_Format()) + { + kamiFontPrintf(24, y_pos, FONT_COLOR_GREEN, " OK "); + } + else + { + kamiFontPrintf(24, y_pos, FONT_COLOR_RED, " NG "); + } +// NAMUT_DrawNandTree(); + return FormatProcess1; case 1: sLock = TRUE; - ExeFormatAsync(FORMAT_MODE_FULL, FormatCallback); - kamiFontPrintf(24, 9, FONT_COLOR_BLACK, " "); + ExeFormatAsync(FORMAT_MODE_QUICK, FormatCallback); + kamiFontPrintf(24, y_pos, FONT_COLOR_BLACK, " "); return FormatProcess3; case 2: + sLock = TRUE; + ExeFormatAsync(FORMAT_MODE_FULL, FormatCallback); + kamiFontPrintf(24, y_pos, FONT_COLOR_BLACK, " "); + return FormatProcess3; + case 3: { FATFSDiskInfo info; BOOL result = FALSE; - kamiFontPrintf(24, 11, FONT_COLOR_BLACK, " "); + kamiFontPrintf(24, y_pos, FONT_COLOR_BLACK, " "); kamiFontLoadScreenData(); FATFS_UnmountDrive("F:"); @@ -208,13 +231,13 @@ void* FormatProcess2(void) FATFS_UnmountDrive("G:"); FATFS_MountDrive("G", FATFS_MEDIA_TYPE_SD, 0); - if (result == TRUE) { kamiFontPrintf(24, 11, FONT_COLOR_GREEN, " OK "); } - else { kamiFontPrintf(24, 11, FONT_COLOR_RED, " NG "); } + if (result == TRUE) { kamiFontPrintf(24, y_pos, FONT_COLOR_GREEN, " OK "); } + else { kamiFontPrintf(24, y_pos, FONT_COLOR_RED, " NG "); } return FormatProcess1; } - case 3: - return TopmenuProcess0; + case 4: + FADE_OUT_RETURN( TopmenuProcess0 ); } } @@ -223,10 +246,7 @@ void* FormatProcess2(void) static void FormatCallback(KAMIResult result, void* /*arg*/) { - s16 y_pos; - - if ( sMenuSelectNo == 0 ) y_pos = 7; - else y_pos = 9; + s16 y_pos = (s16)(7 + sMenuSelectNo * CHAR_OF_MENU_SPACE); if ( result == KAMI_RESULT_SUCCESS_TRUE ) { @@ -266,8 +286,8 @@ void* FormatProcess3(void) // Auto用 if (gAutoFlag) { - if (sFormatResult == TRUE) return AutoProcess1; - else return AutoProcess2; + if (sFormatResult == TRUE) { FADE_OUT_RETURN( AutoProcess1 ); } + else { FADE_OUT_RETURN( AutoProcess2 ); } } return FormatProcess1; @@ -287,8 +307,3 @@ void* FormatProcess3(void) return FormatProcess3; } - -/*---------------------------------------------------------------------------* - 処理関数定義 - *---------------------------------------------------------------------------*/ - diff --git a/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_hw_info.c b/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_hw_info.c index 131786b8..7bc18c23 100644 --- a/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_hw_info.c +++ b/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_hw_info.c @@ -11,8 +11,8 @@ in whole or in part, without the prior written consent of Nintendo. $Date:: $ - $Rev:$ - $Author:$ + $Rev$ + $Author$ *---------------------------------------------------------------------------*/ #include @@ -25,6 +25,7 @@ #include "process_topmenu.h" #include "process_hw_info.h" #include "process_auto.h" +#include "process_fade.h" #include "cursor.h" #include "keypad.h" @@ -173,10 +174,13 @@ void* HWInfoProcess0(void) kamiFontFillChar( 1, BG_COLOR_PURPLE, BG_COLOR_PURPLE ); kamiFontFillChar( 2, BG_COLOR_PURPLE, BG_COLOR_TRANS ); + // カーソル除外 + SetCursorPos((u16)200, (u16)200); + // 前準備 HWInfoWriterInit(); - return HWInfoProcess1; + FADE_IN_RETURN( HWInfoProcess1 ); } /*---------------------------------------------------------------------------* @@ -219,7 +223,7 @@ void* HWInfoProcess1(void) // トップメニューへ戻る else if (kamiPadIsTrigger(PAD_BUTTON_B)) { - return TopmenuProcess0; + FADE_OUT_RETURN( TopmenuProcess0 ); } return HWInfoProcess1; @@ -256,7 +260,7 @@ void* HWInfoProcess2(void) result = DeleteHWInfoFile(); break; case 7: - return TopmenuProcess0; + FADE_OUT_RETURN( TopmenuProcess0 ); } // 全結果をクリア @@ -277,28 +281,13 @@ void* HWInfoProcess2(void) // Auto用 if (gAutoFlag) { - if (result) return AutoProcess1; - else return AutoProcess2; + if (result) { FADE_OUT_RETURN( AutoProcess1 ); } + else { FADE_OUT_RETURN( AutoProcess2 ); } } return HWInfoProcess1; } -/*---------------------------------------------------------------------------* - Name: HWInfo プロセス3 - - Description: - - Arguments: None. - - Returns: next sequence - *---------------------------------------------------------------------------*/ - -void* HWInfoProcess3(void) -{ - return HWInfoProcess3; -} - /*---------------------------------------------------------------------------* 処理関数定義 *---------------------------------------------------------------------------*/ diff --git a/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_import.c b/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_import.c index 962827d3..940d8847 100644 --- a/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_import.c +++ b/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_import.c @@ -11,8 +11,8 @@ in whole or in part, without the prior written consent of Nintendo. $Date:: $ - $Rev:$ - $Author:$ + $Rev$ + $Author$ *---------------------------------------------------------------------------*/ #include @@ -26,6 +26,7 @@ #include "process_import.h" #include "process_eticket.h" #include "process_auto.h" +#include "process_fade.h" #include "cursor.h" #include "keypad.h" @@ -229,7 +230,10 @@ void* ImportProcess0(void) // DumpTadInfo(); } - return ImportProcess1; + // カーソル消去 + SetCursorPos((u16)200, (u16)200); + + FADE_IN_RETURN( ImportProcess1 ); } /*---------------------------------------------------------------------------* @@ -272,7 +276,7 @@ void* ImportProcess1(void) // トップメニューへ戻る else if (kamiPadIsTrigger(PAD_BUTTON_B)) { - return TopmenuProcess0; + FADE_OUT_RETURN( TopmenuProcess0 ); } return ImportProcess1; @@ -299,9 +303,9 @@ void* ImportProcess2(void) return ImportAllNonexistentProcess0; break; case 2: - return ImportIndividuallyProcess0; + FADE_OUT_RETURN( ImportIndividuallyProcess0 ); case 3: - return TopmenuProcess0; + FADE_OUT_RETURN( TopmenuProcess0 ); } return ImportProcess1; @@ -355,7 +359,7 @@ void* ImportProcessReturn(void) if (kamiPadIsTrigger(PAD_BUTTON_B)) { break; } } - return TopmenuProcess0; + FADE_OUT_RETURN( TopmenuProcess0 ); } /*---------------------------------------------------------------------------* @@ -394,15 +398,15 @@ static void* ImportAllOverwriteProcess0(void) // Auto用 if (gAutoFlag) { - if (result && sFileNum > 0) return AutoProcess1; - else return AutoProcess2; + if (result && sFileNum > 0) { FADE_OUT_RETURN( AutoProcess1 ); } + else { FADE_OUT_RETURN( AutoProcess2 ); } } return ImportProcess1; } /*---------------------------------------------------------------------------* - 全ファイルインポートプロセス(既存ファイルは上書きしない) + 上書きインポートプロセス(既存ファイルは上書きしない) *---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------* @@ -482,7 +486,10 @@ static void* ImportIndividuallyProcess0(void) DumpTadInfo(); - return ImportIndividuallyProcess1; + // カーソル消去 + SetCursorPos((u16)200, (u16)200); + + FADE_IN_RETURN( ImportIndividuallyProcess1 ); } /*---------------------------------------------------------------------------* @@ -520,7 +527,7 @@ void* ImportIndividuallyProcess1(void) // ひとつ前のメニューへ戻る else if (kamiPadIsTrigger(PAD_BUTTON_B)) { - return ImportProcess0; + FADE_IN_RETURN( ImportProcess0 ); } return ImportIndividuallyProcess1; diff --git a/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_nandfirm.c b/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_nandfirm.c index 1f7acd38..0e0526fc 100644 --- a/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_nandfirm.c +++ b/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_nandfirm.c @@ -11,8 +11,8 @@ in whole or in part, without the prior written consent of Nintendo. $Date:: $ - $Rev:$ - $Author:$ + $Rev$ + $Author$ *---------------------------------------------------------------------------*/ #include @@ -26,6 +26,7 @@ #include "process_nandfirm.h" #include "process_import.h" #include "process_auto.h" +#include "process_fade.h" #include "cursor.h" #include "keypad.h" @@ -176,7 +177,10 @@ void* NandfirmProcess0(void) // 最後にリターンを追加 kamiFontPrintf((s16)3, (s16)(5+CHAR_OF_MENU_SPACE*sFileNum), FONT_COLOR_BLACK, "l RETURN l l"); - return NandfirmProcess1; + // カーソル消去 + SetCursorPos((u16)200, (u16)200); + + FADE_IN_RETURN( NandfirmProcess1 ); } /*---------------------------------------------------------------------------* @@ -219,7 +223,7 @@ void* NandfirmProcess1(void) // トップメニューへ戻る else if (kamiPadIsTrigger(PAD_BUTTON_B)) { - return TopmenuProcess0; + FADE_OUT_RETURN( TopmenuProcess0 ); } return NandfirmProcess1; @@ -245,8 +249,8 @@ void* NandfirmProcess2(void) } else { - if (gAutoFlag) { return AutoProcess2; } - else { return TopmenuProcess0; } + if (gAutoFlag) { FADE_OUT_RETURN( AutoProcess2 ); } + else { FADE_OUT_RETURN( TopmenuProcess0 ); } } // 今回の結果を表示 @@ -262,8 +266,8 @@ void* NandfirmProcess2(void) // Auto用 if (gAutoFlag) { - if (ret) return AutoProcess1; - else return AutoProcess2; + if (ret) { FADE_OUT_RETURN( AutoProcess1 ); } + else { FADE_OUT_RETURN( AutoProcess2 ); } } return NandfirmProcess1; diff --git a/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_norfirm.c b/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_norfirm.c index 70b5e2eb..93a020ce 100644 --- a/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_norfirm.c +++ b/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_norfirm.c @@ -11,8 +11,8 @@ in whole or in part, without the prior written consent of Nintendo. $Date:: $ - $Rev:$ - $Author:$ + $Rev$ + $Author$ *---------------------------------------------------------------------------*/ #include @@ -26,6 +26,7 @@ #include "process_topmenu.h" #include "process_import.h" #include "process_norfirm.h" +#include "process_fade.h" #include "cursor.h" #include "keypad.h" @@ -175,7 +176,10 @@ void* NorfirmProcess0(void) // 最後にリターンを追加 kamiFontPrintf((s16)3, (s16)(5+CHAR_OF_MENU_SPACE*sFileNum), FONT_COLOR_BLACK, "l RETURN l l"); - return NorfirmProcess1; + // カーソル消去 + SetCursorPos((u16)200, (u16)200); + + FADE_IN_RETURN( NorfirmProcess1 ); } /*---------------------------------------------------------------------------* @@ -211,7 +215,7 @@ void* NorfirmProcess1(void) // トップメニューへ戻る else if (kamiPadIsTrigger(PAD_BUTTON_B)) { - return TopmenuProcess0; + FADE_OUT_RETURN( TopmenuProcess0 ); } return NorfirmProcess1; @@ -238,7 +242,7 @@ void* NorfirmProcess2(void) else { // リターン - return TopmenuProcess0; + FADE_OUT_RETURN( TopmenuProcess0 ); } // 今回の結果を表示 diff --git a/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_topmenu.c b/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_topmenu.c index 6172b2c6..3639f8f9 100644 --- a/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_topmenu.c +++ b/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_topmenu.c @@ -11,8 +11,8 @@ in whole or in part, without the prior written consent of Nintendo. $Date:: $ - $Rev:$ - $Author:$ + $Rev$ + $Author$ *---------------------------------------------------------------------------*/ #include @@ -25,6 +25,7 @@ #include "process_nandfirm.h" #include "process_norfirm.h" #include "process_auto.h" +#include "process_fade.h" #include "cursor.h" #include "keypad.h" @@ -114,10 +115,10 @@ void* TopmenuProcess0(void) kamiFontFillChar(17, BG_COLOR_VIOLET, BG_COLOR_VIOLET ); kamiFontFillChar(18, BG_COLOR_VIOLET, BG_COLOR_TRANS ); - // カーソル配置 - SetCursorPos((u16)CURSOR_ORIGIN_X, (u16)(CURSOR_ORIGIN_Y + sMenuSelectNo * DOT_OF_MENU_SPACE)); + // カーソル消去 + SetCursorPos((u16)200, (u16)200); - return TopmenuProcess1; + FADE_IN_RETURN(TopmenuProcess1); } /*---------------------------------------------------------------------------* @@ -154,7 +155,7 @@ void* TopmenuProcess1(void) // L&R同時押しでオート実行! if (kamiPadIsPress(PAD_BUTTON_L) && kamiPadIsPress(PAD_BUTTON_R)) { - return AutoProcess0; + FADE_OUT_RETURN( AutoProcess0 ); } return TopmenuProcess1; @@ -175,42 +176,22 @@ void* TopmenuProcess2(void) switch ( sMenuSelectNo ) { case 0: - return FormatProcess0; + FADE_OUT_RETURN( FormatProcess0 ); case 1: - return HWInfoProcess0; - break; + FADE_OUT_RETURN( HWInfoProcess0 ); case 2: - return eTicketProcess0; - break; + FADE_OUT_RETURN( eTicketProcess0 ); case 3: - return ImportProcess0; - break; + FADE_OUT_RETURN( ImportProcess0 ); case 4: - return NandfirmProcess0; - break; + FADE_OUT_RETURN( NandfirmProcess0 ); case 5: - return NorfirmProcess0; - break; + FADE_OUT_RETURN( NorfirmProcess0 ); } return TopmenuProcess1; } -/*---------------------------------------------------------------------------* - Name: Top Menu プロセス3 - - Description: - - Arguments: None. - - Returns: next sequence - *---------------------------------------------------------------------------*/ - -void* TopmenuProcess3(void) -{ - return TopmenuProcess3; -} - /*---------------------------------------------------------------------------* 処理関数定義 *---------------------------------------------------------------------------*/ diff --git a/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/sd_event.c b/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/sd_event.c new file mode 100644 index 00000000..9bc99011 --- /dev/null +++ b/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/sd_event.c @@ -0,0 +1,57 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - NandInitializer + File: sd_event.c + + 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:$ + *---------------------------------------------------------------------------*/ + +#include +#include "kami_font.h" +#include +#include +#include "sd_event.h" + +/*---------------------------------------------------------------------------* + 内部変数定義 + *---------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------* + 内部関数定義 + *---------------------------------------------------------------------------*/ +static void VBlankIntr(void); + +/*---------------------------------------------------------------------------* + Name: SDEvents + + Description: SDカードの挿抜イベント監視コールバック + + Arguments: userdata : 任意のユーザ定義引数 + event : イベント種別 + arg : イベント固有の引数 + + Returns: None. + *---------------------------------------------------------------------------*/ +void SDEvents(void *userdata, FSEvent event, void *arg) +{ + (void)userdata; + (void)arg; + if (event == FS_EVENT_MEDIA_REMOVED) + { + OS_TPrintf("sdmc:removed!\n"); + } + else if (event == FS_EVENT_MEDIA_INSERTED) + { + OS_TPrintf("sdmc:inserted!\n"); + } +} +