From 87337e3d4c776234179a1b255470d81d27a04a28 Mon Sep 17 00:00:00 2001 From: kamikawa Date: Mon, 17 Mar 2008 10:46:09 +0000 Subject: [PATCH] =?UTF-8?q?NandFormatter=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=E3=80=82=E5=AE=9F=E6=85=8B=E3=81=A8=E3=81=97=E3=81=A6=E3=81=AF?= =?UTF-8?q?NandInitializer=E3=81=AE=E6=A9=9F=E8=83=BD=E5=88=B6=E9=99=90?= =?UTF-8?q?=E7=89=88=E3=81=AE=E3=82=88=E3=81=86=E3=81=AA=E3=82=82=E3=81=AE?= =?UTF-8?q?=E3=81=A7=20=E3=82=BD=E3=83=BC=E3=82=B9=E3=83=95=E3=82=A1?= =?UTF-8?q?=E3=82=A4=E3=83=AB=E3=81=AFNandInitializer=E3=81=AE=E3=82=82?= =?UTF-8?q?=E3=81=AE=E3=82=92=E5=8F=82=E7=85=A7=E3=81=97=E3=81=A6=E3=81=84?= =?UTF-8?q?=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@892 b08762b0-b915-fc4b-9d8c-17b2551a87ff --- .../NandFormatter/ARM7.TWL/Makefile | 90 ++++++++++++++ .../NandFormatter/ARM9.TWL/Makefile | 110 ++++++++++++++++++ build/systemMenu_RED/NandFormatter/Makefile | 34 ++++++ .../NandFormatter/banner/Makefile | 49 ++++++++ .../NandFormatter/banner/banner_v3.bsf | Bin 0 -> 852 bytes .../NandFormatter/banner/icon/gameIcon.bmp | Bin 0 -> 592 bytes .../NandInitializer/ARM7.TWL/src/formatter.c | 103 ++++++++-------- .../NandInitializer/ARM7.TWL/src/main.c | 37 ++++++ .../NandInitializer/ARM9.TWL/Makefile | 7 +- .../NandInitializer/ARM9.TWL/main.rsf | 2 +- .../NandInitializer/ARM9.TWL/src/main.c | 54 +-------- .../ARM9.TWL/src/process_format.c | 100 ++++++++++------ .../ARM9.TWL/src/process_hw_info.c | 12 +- .../ARM9.TWL/src/process_topmenu.c | 18 ++- 14 files changed, 470 insertions(+), 146 deletions(-) create mode 100644 build/systemMenu_RED/NandFormatter/ARM7.TWL/Makefile create mode 100644 build/systemMenu_RED/NandFormatter/ARM9.TWL/Makefile create mode 100644 build/systemMenu_RED/NandFormatter/Makefile create mode 100644 build/systemMenu_RED/NandFormatter/banner/Makefile create mode 100644 build/systemMenu_RED/NandFormatter/banner/banner_v3.bsf create mode 100644 build/systemMenu_RED/NandFormatter/banner/icon/gameIcon.bmp diff --git a/build/systemMenu_RED/NandFormatter/ARM7.TWL/Makefile b/build/systemMenu_RED/NandFormatter/ARM7.TWL/Makefile new file mode 100644 index 00000000..f1d02566 --- /dev/null +++ b/build/systemMenu_RED/NandFormatter/ARM7.TWL/Makefile @@ -0,0 +1,90 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - tests - camera-test +# File: Makefile +# +# Copyright 2007 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$ +#---------------------------------------------------------------------------- + +SUBDIRS = + + +#---------------------------------------------------------------------------- + +#============================================================================ +# NandInitializerから一部の機能を削除するために定義を追加します。 +MACRO_FLAGS += -DNAND_FORMATTER_MODE +#============================================================================ + +override TARGET_PLATFORM = TWL +override TWL_PROC = ARM7 +TWL_ARCHGEN = LIMITED +TWL_NO_STD_PCHDR = True +#TWL_CODEGEN = THUMB + +TARGET_TEF = main.tef +LCFILE_SPEC = ../../NandInitializer/ARM7.TWL/main.lsf +LCFILE_TEMPLATE = ../../NandInitializer/ARM7.TWL/racoon.lcf.template +LDRES_TEMPLATE = ../../NandInitializer/ARM7.TWL/racoon.response.template + +SRCS = main.c \ + kami_pxi.c \ + formatter.c \ + nvram_misc.c \ + initScfg.c \ + +LINCLUDES = ../../NandInitializer/common/include \ + ../../NandInitializer/ARM7.TWL/include \ + ../common/include $(ROOT)/build/libraries/spi/ARM7/include + + +SRCDIR = ../../NandInitializer/ARM7.TWL/src +#LCFILE = # using default + + +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +ifdef TWLSDK_NOCRYPTO +CCFLAGS += -DSDK_NOCRYPTO +endif + +ifndef TWLSDK_NOCRYPTO +MAKELCF_FLAGS += -DUSE_CRYPTO_LIBS='libsea_sp$(TWL_LIBSUFFIX).a libcrypto_sp$(TWL_LIBSUFFIX).a' +MACRO_FLAGS += -DSDK_SEA +endif + +ifeq ($(TWL_PLATFORM),BB) +MAKELCF_FLAGS += -DADDRESS_LTDWRAM='0x037e0000' +else +MAKELCF_FLAGS += -DADDRESS_LTDWRAM='0x037c0000' +endif + +MAKELCF_FLAGS += -DISDBG_LIBS_TWL='$(if $(ISDBG_LIBS_TWL),$(ISDBG_LIBS_TWL),libstubsistd_sp$(TWL_LIBSUFFIX).a)' \ + -DISDBG_LIBS_NITRO='libstubsisd_sp$(TWL_LIBSUFFIX).a' + +TWL_LIBS_EX = libcamera_sp$(TWL_LIBSUFFIX).a \ + libfatfs_sp$(TWL_LIBSUFFIX).a \ + libi2c_sp$(TWL_LIBSUFFIX).a \ + libcamera_sp$(TWL_LIBSUFFIX).a \ + libcdc_sp$(TWL_LIBSUFFIX).a \ + libtpex_sp$(TWL_LIBSUFFIX).a + +#---------------------------------------------------------------------------- + +do-build: $(TARGETS) + + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + + +#===== End of Makefile ===== diff --git a/build/systemMenu_RED/NandFormatter/ARM9.TWL/Makefile b/build/systemMenu_RED/NandFormatter/ARM9.TWL/Makefile new file mode 100644 index 00000000..b91aee39 --- /dev/null +++ b/build/systemMenu_RED/NandFormatter/ARM9.TWL/Makefile @@ -0,0 +1,110 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlIPL - systemMenu_RED - NandInitializer +# File: Makefile +# +# Copyright 2007 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$ +#---------------------------------------------------------------------------- + +SUBDIRS = + + +#---------------------------------------------------------------------------- + +#============================================================================ +#現時点で製品鍵を使った書き込みが行えてはダメなので、デフォルトOFFにしておいてください。 +#USE_PRODUCT_KEY = TRUE +#============================================================================ +#============================================================================ +# NandInitializerから一部の機能を削除するために定義を追加します。 +MACRO_FLAGS += -DNAND_FORMATTER_MODE +#============================================================================ + +TARGET_FIRM = SYSTEMMENU +TARGET_PLATFORM = TWL +TWL_ARCHGEN = LIMITED + +#TWL_CODEGEN = THUMB + +TITLEID_LO = FMTR +TARGET_TAD = $(BINDIR)/$(TITLEID_LO).$(TWL_BUILD_DIR)$(CODEGEN_ARCH).tad + +TARGET_BIN = NandFormatter.srl +LCFILE_SPEC = ../../NandInitializer/ARM9.TWL/ARM9-TS.lsf +ROM_SPEC = ../../NandInitializer/ARM9.TWL/main.rsf + +MAKEROM_ARM7_BASE = ../ARM7.TWL/bin/$(TWL_BUILDTYPE_ARM7)/main +MAKEROM_ARM7 = $(MAKEROM_ARM7_BASE).$(TWL_ELF_EXT) + +SRCS = main.c \ + kami_pxi.c \ + font_data.c \ + graphics.c \ + keypad.c \ + kami_font.c \ + cursor.c \ + process_format.c \ + process_topmenu.c \ + process_hw_info.c \ + process_fade.c \ + sd_event.c \ + hwi.c + +LINCLUDES = ../../NandInitializer/common/include \ + ../../NandInitializer/ARM9.TWL/include \ + $(ROOT)/build/libraries/lcfg/ARM9.TWL/include \ + ../../misc/include + +SRCDIR = ../../NandInitializer/ARM9.TWL/src \ + ../../HWInfoWriter/ARM9/src + +#LCFILE = # using default + + +ifneq ($(TWL_IPL_RED_PRIVATE_ROOT),) +ifdef USE_PRODUCT_KEY +MACRO_FLAGS += -DUSE_PRODUCT_KEY +MAKEROM_FLAGS += -DHWINFO_PRIVKEY='private_HWInfo.der' +else +MAKEROM_FLAGS += -DHWINFO_PRIVKEY='private_HWInfo_dev.der' +endif +endif + +MAKEROM_FLAGS += -DTITLEID_LO='$(TITLEID_LO)' \ + -DPRIVKEY_PATH='$(TWL_KEYSDIR)/rsa' +MAKETAD_FLAGS += -s + +LLIBRARIES += libes$(TWL_LIBSUFFIX).a \ + libboc$(TWL_LIBSUFFIX).a \ + libnam$(TWL_LIBSUFFIX).a \ + libsea$(TWL_LIBSUFFIX).a \ + libacsign_enc$(TWL_LIBSUFFIX).a \ + libnamut$(TWL_LIBSUFFIX).a + +include $(TWL_IPL_RED_ROOT)/build/buildtools/commondefs +include $(TWLSDK_ROOT)/build/buildtools/commondefs.gx.demolib + +MAKEROM = $(TWL_TOOLSDIR)/bin/makerom.TWL.secure.exe + +LDIRT_CLEAN = $(TARGET_TAD) +#INSTALL_TARGETS = $(TARGET_TAD) +#INSTALL_DIR = $(SDK_NMENU_DATADIR) + +#---------------------------------------------------------------------------- + +do-build: $(TARGETS) + +#include $(TWLSDK_ROOT)/build/buildtools/modulerules +include $(TWL_IPL_RED_ROOT)/build/buildtools/modulerules + +#===== End of Makefile ===== diff --git a/build/systemMenu_RED/NandFormatter/Makefile b/build/systemMenu_RED/NandFormatter/Makefile new file mode 100644 index 00000000..d593101e --- /dev/null +++ b/build/systemMenu_RED/NandFormatter/Makefile @@ -0,0 +1,34 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - tests - camera +# File: Makefile +# +# Copyright 2007 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 $(TWLSDK_ROOT)/build/buildtools/commondefs + + +#---------------------------------------------------------------------------- + +SUBDIRS = \ + banner \ + ARM7.TWL \ + ARM9.TWL \ + +#---------------------------------------------------------------------------- + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + + +#===== End of Makefile ===== diff --git a/build/systemMenu_RED/NandFormatter/banner/Makefile b/build/systemMenu_RED/NandFormatter/banner/Makefile new file mode 100644 index 00000000..1f8aa1d4 --- /dev/null +++ b/build/systemMenu_RED/NandFormatter/banner/Makefile @@ -0,0 +1,49 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlIPL +# File: Makefile +# +# Copyright 2007 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 $(TWL_IPL_RED_ROOT)/build/buildtools/commondefs + +ICON_DIR = ./icon + +BANNER_ICON = $(ICON_DIR)/gameIcon.bmp +BANNER_SPEC = banner_v3.bsf + +TARGETS = banner.bnr +INSTALL_DIR = ./ +INSTALL_TARGETS = $(TARGETS) + +BANNER_ICON_NAME = $(basename $(BANNER_ICON)) + +LDIRT_CLEAN = $(TARGETS) \ + $(BANNER_ICON_NAME).nbfs \ + $(BANNER_ICON_NAME).nbfc \ + $(BANNER_ICON_NAME).nbfp \ + $(TARGETS:.bnr=.srl) + +include $(TWL_IPL_RED_ROOT)/build/buildtools/modulerules + +#---------------------------------------------------------------------------- +# build +#---------------------------------------------------------------------------- +do-build: $(TARGETS) + +$(TARGETS): $(BANNER_SPEC) $(BANNER_ICON) + $(NTEXCONV) -no -bg -bgb -bgnc $(BANNER_ICON) >/dev/null && \ + $(MAKEBANNER) -N $(BANNER_ICON_NAME) $(BANNER_SPEC) $(TARGETS) + +# diff --git a/build/systemMenu_RED/NandFormatter/banner/banner_v3.bsf b/build/systemMenu_RED/NandFormatter/banner/banner_v3.bsf new file mode 100644 index 0000000000000000000000000000000000000000..746f3f4041c44e1d713ab4837f924294eecd08b6 GIT binary patch literal 852 zcmc(dL2Cjr5QX2>g8w1lxrzuLdTcRmMWncG?{QUJSgq`?O8BK4L)MO3&MlX+&v8GyR_OHrJ-8;ODU7-*7-obDZIazJ4 z7cxC9l$4ysSiPx)PgSjkWE`4ms3B0vyN@|A8Jr^*#H0l literal 0 HcmV?d00001 diff --git a/build/systemMenu_RED/NandFormatter/banner/icon/gameIcon.bmp b/build/systemMenu_RED/NandFormatter/banner/icon/gameIcon.bmp new file mode 100644 index 0000000000000000000000000000000000000000..29464f280fd0a83858099a8dc5d5e8d9bca0e774 GIT binary patch literal 592 zcmah`L5{*O4D=$@3#V{K+9gsXE}SBNfcvgivE~mvgqQ4#_9c9wjGY#V_J9>9o=of+ zwU_VTjYRx#KQX_i{E#gxkq!C%uIE7P>G6L($o=nA#&L|iod-#2pPz9|j0Jv@QKa++ zztTi#eHHK|uxS;|h8gfSu#yCP1+K{1YBlI9Z#H4?=VL_$lzras?~C!M=KWyMLXWnx zx4J+pK=zEraHhE^?Z!N7P^FquBlIXwG0Ian{HU^^Wtw!%(mQzDd6t}3D(3#eQ7GE_ XeAnlf^39De @@ -57,28 +57,26 @@ typedef struct FileProperty { #define FATFS_CLUSTER_SIZE ( 16 * 1024 ) // FATFSのクラスタサイズは16KBなので、データサイズが決まっていないものは、余裕を持たせて16KBにしておく static const FileProperty s_fileList[] = { - { 128, "F:/sys/ID.sgn" }, // 現状、全部サイズは適当。中身も空。 - { FATFS_CLUSTER_SIZE, "F:/sys/HWINFO.dat" }, - { FATFS_CLUSTER_SIZE, "F:/shared1/TWLCFG0.dat" }, - { FATFS_CLUSTER_SIZE, "F:/shared1/TWLCFG1.dat" }, // ミラー -// { FATFS_CLUSTER_SIZE, "F:/shared1/WIFICFG0.dat" }, -// { FATFS_CLUSTER_SIZE, "F:/shared1/WIFICFG1.dat" }, // ミラー + { 128, "nand:/sys/ID.sgn" }, // 現状、全部サイズは適当。中身も空。 + { FATFS_CLUSTER_SIZE, "nand:/sys/HWINFO.dat" }, + { FATFS_CLUSTER_SIZE, "nand:/shared1/TWLCFG0.dat" }, + { FATFS_CLUSTER_SIZE, "nand:/shared1/TWLCFG1.dat" }, // ミラー { 0, NULL }, }; static const char *s_pDirList0[] = { - (const char *)"sys", - (const char *)"title", - (const char *)"ticket", - (const char *)"shared1", - (const char *)"import", - (const char *)"tmp", + (const char *)"nand:/sys", + (const char *)"nand:/title", + (const char *)"nand:/ticket", + (const char *)"nand:/shared1", + (const char *)"nand:/import", + (const char *)"nand:/tmp", NULL, }; static const char *s_pDirList1[] = { - (const char *)"photo", - (const char *)"shared2", + (const char *)"nand2:/photo", + (const char *)"nand2:/shared2", NULL, }; @@ -118,6 +116,10 @@ ExeFormat(FormatMode format_mode) // NANDをフォーマット { int i; + u8 drive_nand; + u8 drive_nand2; + char drive_nand_path[4]; + char drive_nand2_path[4]; /* パーティションサイズをプロンプトから設定 */ u32 partition_MB_size[5]; @@ -126,12 +128,27 @@ ExeFormat(FormatMode format_mode) partition_MB_size[2] = PARTITION_1_SIZE; // FAT1領域 nand_fat_partition_num = NAND_FAT_PARTITION_NUM; - // F G ドライブアンマウント - for( i=0; idrive; ++info) + { + if (!STD_CompareNString( "nand2", info->archiveName, 5 )) + { + drive_nand2 = *(info->drive); + STD_TSPrintf(drive_nand2_path, "%c:", drive_nand2); + } + else if (!STD_CompareNString( "nand", info->archiveName, 4 )) + { + drive_nand = *(info->drive); + STD_TSPrintf(drive_nand_path, "%c:", drive_nand); + } + } + } + + // nand nand2 ドライブアンマウント + FATFS_UnmountDrive( drive_nand_path ); + FATFS_UnmountDrive( drive_nand2_path ); // NANDのパーティションを指定 // sizeInMB : パーティションサイズをメガバイト単位で格納した配列 @@ -139,17 +156,15 @@ ExeFormat(FormatMode format_mode) if (FATFSi_SetNANDPartitions(partition_MB_size, nand_fat_partition_num)) { // マウント - if (FATFS_MountDrive("F", FATFS_MEDIA_TYPE_NAND, 0)) + if (FATFS_MountDrive(drive_nand_path, FATFS_MEDIA_TYPE_NAND, 0)) { - const char *path = "F:"; // "F:"がFAT0パーティションになる。 - // デフォルトドライブ設定 - if (!FATFS_SetDefaultDrive(path)) + if (!FATFS_SetDefaultDrive(drive_nand_path)) { return FALSE; } // 指定のパスが指すドライブを含むメディア全体を初期化 - else if(!FATFS_FormatMedia(path)) + else if(!FATFS_FormatMedia(drive_nand_path)) { return FALSE; } @@ -159,31 +174,27 @@ ExeFormat(FormatMode format_mode) return FALSE; } // 指定のパスが指すドライブ全体を初期化 - else if(!FATFS_FormatDrive(path)) + else if(!FATFS_FormatDrive(drive_nand_path)) { return FALSE; } else { - // F以降のドライブの初期化 + // FAT1パーティションの初期化 for (i = 1; i < nand_fat_partition_num; ++i) { - char drive[4]; - STD_TSPrintf(drive, "%c:", 'F' + i); - if(!FATFS_MountDrive(drive, FATFS_MEDIA_TYPE_NAND, (u32)i)) + if(!FATFS_MountDrive(drive_nand2_path, FATFS_MEDIA_TYPE_NAND, (u32)i)) { return FALSE; } } for (i = 1; i < nand_fat_partition_num; ++i) { - char drive[4]; - STD_TSPrintf(drive, "%c:", 'F' + i); if (format_mode == FORMAT_MODE_FULL && !FATFSi_nandFillPartition( i, init_datbuf, 16)) { return FALSE; } - else if (!FATFS_FormatDrive(drive)) + else if (!FATFS_FormatDrive(drive_nand2_path)) { return FALSE; } @@ -197,29 +208,15 @@ ExeFormat(FormatMode format_mode) OS_Free( init_datbuf ); // ディレクトリ生成&チェック - if (!CreateDirectory( "F:", s_pDirList0 )) { return FALSE; } - if (!CheckDirectory ( "F:", s_pDirList0 )) { return FALSE; } - if (!CreateDirectory( "G:", s_pDirList1 )) { return FALSE; } - if (!CheckDirectory ( "G:", s_pDirList1 )) { return FALSE; } + if (!CreateDirectory( "nand:", s_pDirList0 )) { return FALSE; } + if (!CheckDirectory ( "nand:", s_pDirList0 )) { return FALSE; } + if (!CreateDirectory( "nand2:", s_pDirList1 )) { return FALSE; } + if (!CheckDirectory ( "nand2:", s_pDirList1 )) { return FALSE; } // ファイル生成&チェック if (!CreateFile( &s_fileList[0] )) { return FALSE; } if (!CheckFile ( &s_fileList[0] )) { return FALSE; } - // F,Gドライブアンマウント - { - int i; - for( i=0; idrive[0] != '\0'; ++pRegisteredInfo ) - { - if ( pRegisteredInfo->drive[0] == 'F') { existNAND = TRUE; } - else if ( pRegisteredInfo->drive[0] == 'G') { existSD = TRUE; } - } - - if (!existNAND) - { - MI_CpuCopy8(&info_nand, pRegisteredInfo, sizeof(info_nand)); - pRegisteredInfo->drive[0] = 'F'; - ++pRegisteredInfo; - } - - if (!existSD) - { - MI_CpuCopy8(&info_sd, pRegisteredInfo, sizeof(info_sd)); - pRegisteredInfo->drive[0] = 'G'; - } -} - 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 57dcb257..2588553f 100644 --- a/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_format.c +++ b/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_format.c @@ -34,11 +34,25 @@ 型定義 *---------------------------------------------------------------------------*/ +enum { + MENU_EASY_FORMAT=0, + MENU_CHECK_DISK, +#ifndef NAND_FORMATTER_MODE + MENU_NORMAL_FORMAT, + MENU_FILL_FORMAT, +#endif + MENU_RETURN, + NUM_OF_MENU_SELECT +}; + /*---------------------------------------------------------------------------* 定数定義 *---------------------------------------------------------------------------*/ -#define NUM_OF_MENU_SELECT 5 +// NANDの簡易フォーマットを実行する際に +// ツリー情報を出力する場合は定義します +//#define DUMP_NAND_TREE + #define DOT_OF_MENU_SPACE 16 #define CURSOR_ORIGIN_X 32 #define CURSOR_ORIGIN_Y 56 @@ -85,16 +99,21 @@ void* FormatProcess0(void) // メニュー一覧 kamiFontPrintf(3, 6, FONT_COLOR_BLACK, "+-------------------+-----+"); - kamiFontPrintf(3, 7, FONT_COLOR_BLACK, "l 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 FORMAT l l"); + kamiFontPrintf(3, 9, FONT_COLOR_BLACK, "l CHECK DISK l l"); kamiFontPrintf(3, 10, FONT_COLOR_BLACK, "+-------------------+-----+"); - kamiFontPrintf(3, 11, FONT_COLOR_BLACK, "l FORMAT l l"); +#ifndef NAND_FORMATTER_MODE + kamiFontPrintf(3, 11, FONT_COLOR_BLACK, "l FORMAT l l"); kamiFontPrintf(3, 12, FONT_COLOR_BLACK, "+-------------------+-----+"); - kamiFontPrintf(3, 13, FONT_COLOR_BLACK, "l CHECK DISK l l"); + kamiFontPrintf(3, 13, FONT_COLOR_BLACK, "l FORMAT l l"); kamiFontPrintf(3, 14, FONT_COLOR_BLACK, "+-------------------+-----+"); kamiFontPrintf(3, 15, FONT_COLOR_BLACK, "l RETURN l l"); kamiFontPrintf(3, 16, FONT_COLOR_BLACK, "+-------------------+-----+"); +#else + kamiFontPrintf(3, 11, FONT_COLOR_BLACK, "l RETURN l l"); + kamiFontPrintf(3, 12, FONT_COLOR_BLACK, "+-------------------+-----+"); +#endif // 背景全クリア for (i=0;i<24;i++) @@ -125,12 +144,14 @@ void* FormatProcess0(void) void* FormatProcess1(void) { +#ifndef NAND_FORMATTER_MODE // オート実行用 if (gAutoFlag) { - sMenuSelectNo = 1; + sMenuSelectNo = MENU_NORMAL_FORMAT; return FormatProcess2; } +#endif // 選択メニューの変更 if ( kamiPadIsRepeatTrigger(PAD_KEY_UP) ) @@ -177,8 +198,13 @@ void* FormatProcess2(void) switch( sMenuSelectNo ) { - case 0: // 擬似フォーマット -// NAMUT_DrawNandTree(); + case MENU_EASY_FORMAT: // 簡易フォーマット +#ifdef DUMP_NAND_TREE + NAMUT_DrawNandTree(); +#endif + kamiFontPrintf(24, y_pos, FONT_COLOR_GREEN, " WAIT"); + kamiFontLoadScreenData(); + if (NAMUT_Format()) { kamiFontPrintf(24, y_pos, FONT_COLOR_GREEN, " OK "); @@ -187,39 +213,32 @@ void* FormatProcess2(void) { kamiFontPrintf(24, y_pos, FONT_COLOR_RED, " NG "); } -// NAMUT_DrawNandTree(); +#ifdef DUMP_NAND_TREE + OS_Printf("\n"); + NAMUT_DrawNandTree(); +#endif return FormatProcess1; - case 1: // ノーマルフォーマット - sLock = TRUE; - 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: // チェックディスク + case MENU_CHECK_DISK: // チェックディスク { FATFSDiskInfo info; BOOL result = FALSE; - kamiFontPrintf(24, y_pos, FONT_COLOR_BLACK, " "); + kamiFontPrintf(24, y_pos, FONT_COLOR_BLACK, " WAIT"); kamiFontLoadScreenData(); - FATFS_UnmountDrive("F:"); - FATFS_UnmountDrive("G:"); +// FATFS_UnmountDrive("F:"); +// FATFS_UnmountDrive("G:"); // 指定のNANDパーティション0をFドライブにマウント - if (FATFS_MountDrive("F", FATFS_MEDIA_TYPE_NAND, 0)) +// if (FATFS_MountDrive("F", FATFS_MEDIA_TYPE_NAND, 0)) { // チェックディスク実行 - if (FATFS_CheckDisk("F:", &info, TRUE, TRUE, TRUE)) + if (FATFS_CheckDisk("nand:", &info, TRUE, TRUE, TRUE)) { // 指定のNANDパーティション1をGドライブにマウント - if (FATFS_MountDrive("G", FATFS_MEDIA_TYPE_NAND, 1)) +// if (FATFS_MountDrive("G", FATFS_MEDIA_TYPE_NAND, 1)) { // チェックディスク実行 - if (FATFS_CheckDisk("G:", &info, TRUE, TRUE, TRUE)) + if (FATFS_CheckDisk("nand2:", &info, TRUE, TRUE, TRUE)) { result = TRUE; } @@ -228,15 +247,27 @@ void* FormatProcess2(void) } // デフォルトマウント状態に戻しておく - FATFS_UnmountDrive("G:"); - FATFS_MountDrive("G", FATFS_MEDIA_TYPE_SD, 0); +// FATFS_UnmountDrive("G:"); +// FATFS_MountDrive("G", FATFS_MEDIA_TYPE_SD, 0); if (result == TRUE) { kamiFontPrintf(24, y_pos, FONT_COLOR_GREEN, " OK "); } else { kamiFontPrintf(24, y_pos, FONT_COLOR_RED, " NG "); } return FormatProcess1; } - case 4: +#ifndef NAND_FORMATTER_MODE + case MENU_NORMAL_FORMAT: // ノーマルフォーマット + sLock = TRUE; + ExeFormatAsync(FORMAT_MODE_QUICK, FormatCallback); + kamiFontPrintf(24, y_pos, FONT_COLOR_BLACK, " "); + return FormatProcess3; + case MENU_FILL_FORMAT: // フルフォーマット + sLock = TRUE; + ExeFormatAsync(FORMAT_MODE_FULL, FormatCallback); + kamiFontPrintf(24, y_pos, FONT_COLOR_BLACK, " "); + return FormatProcess3; +#endif + case MENU_RETURN: FADE_OUT_RETURN( TopmenuProcess0 ); } } @@ -276,26 +307,25 @@ static void FormatCallback(KAMIResult result, void* /*arg*/) void* FormatProcess3(void) { static s32 progress; - s16 y_pos; + s16 y_pos = (s16)(7 + sMenuSelectNo * CHAR_OF_MENU_SPACE); // 処理終了判定 if (sLock == FALSE) { progress = 0; - + +#ifndef NAND_FORMATTER_MODE // Auto用 if (gAutoFlag) { if (sFormatResult == TRUE) { FADE_OUT_RETURN( AutoProcess1 ); } else { FADE_OUT_RETURN( AutoProcess2 ); } } +#endif return FormatProcess1; } - if ( sMenuSelectNo == 0 ) { y_pos = 7; } - else { y_pos = 9; } - // 進捗表示更新 if ( ++progress >= 30*5 ) { 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 3e1d7695..d01a1be1 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 @@ -208,12 +208,14 @@ void* HWInfoProcess0(void) void* HWInfoProcess1(void) { +#ifndef NAND_FORMATTER_MODE // オート実行用 if (gAutoFlag) { sMenuSelectNo = 0; return HWInfoProcess2; } +#endif // 選択メニューの変更 if ( kamiPadIsRepeatTrigger(PAD_KEY_UP) ) @@ -291,12 +293,14 @@ void* HWInfoProcess2(void) kamiFontPrintf(26, (s16)(7+sMenuSelectNo*CHAR_OF_MENU_SPACE), FONT_COLOR_RED, "NG"); } +#ifndef NAND_FORMATTER_MODE // Auto用 if (gAutoFlag) { if (result) { FADE_OUT_RETURN( AutoProcess1 ); } else { FADE_OUT_RETURN( AutoProcess2 ); } } +#endif return HWInfoProcess1; } @@ -320,8 +324,8 @@ static BOOL WriteHWInfoFile( u8 region ) static const char *pMsgNormalWriting = "Writing Normal File..."; static const char *pMsgSecureWriting = "Writing Secure File..."; static const char *pMsgSignWriting = "Writing Sign File..."; - static const char *pMsgSucceeded = "Succeeded!"; - static const char *pMsgFailed = "Failed!"; + static const char *pMsgSucceeded = "Success!\n"; + static const char *pMsgFailed = "Failed!\n"; BOOL result = TRUE; // ノーマルファイルのライト @@ -373,8 +377,8 @@ static BOOL DeleteHWInfoFile( void ) { static const char *pMsgNormalDeleting = "Deleting Normal File..."; static const char *pMsgSecureDeleting = "Deteting Secure File..."; - static const char *pMsgSucceeded = "Succeeded!"; - static const char *pMsgFailed = "Failed!"; + static const char *pMsgSucceeded = "Success!\n"; + static const char *pMsgFailed = "Failed!\n"; BOOL result = TRUE; // ノーマルファイル 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 3639f8f9..5d77583a 100644 --- a/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_topmenu.c +++ b/build/systemMenu_RED/NandInitializer/ARM9.TWL/src/process_topmenu.c @@ -37,7 +37,12 @@ 定数定義 *---------------------------------------------------------------------------*/ +#ifndef NAND_FORMATTER_MODE #define NUM_OF_MENU_SELECT 6 +#else +#define NUM_OF_MENU_SELECT 2 +#endif + #define DOT_OF_MENU_SPACE 16 #define CURSOR_ORIGIN_X 32 #define CURSOR_ORIGIN_Y 56 @@ -74,15 +79,21 @@ void* TopmenuProcess0(void) kamiFontClear(); // バージョン表示 +#ifndef NAND_FORMATTER_MODE kamiFontPrintf(4, 2, 0, "Nand Initializer ver 0.1"); +#else + kamiFontPrintf(4, 2, 0, "Nand Formatter ver 0.1"); +#endif // メニュー一覧 kamiFontPrintf(3, 7, FONT_COLOR_BLACK, " FORMAT NAND "); kamiFontPrintf(3, 9, FONT_COLOR_BLACK, " WRITE HARDWARE INFO "); +#ifndef NAND_FORMATTER_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++) @@ -98,7 +109,7 @@ void* TopmenuProcess0(void) 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_FORMATTER_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 ); @@ -114,6 +125,7 @@ void* TopmenuProcess0(void) 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 // カーソル消去 SetCursorPos((u16)200, (u16)200); @@ -152,11 +164,13 @@ void* TopmenuProcess1(void) return TopmenuProcess2; } +#ifndef NAND_FORMATTER_MODE // L&R同時押しでオート実行! if (kamiPadIsPress(PAD_BUTTON_L) && kamiPadIsPress(PAD_BUTTON_R)) { FADE_OUT_RETURN( AutoProcess0 ); } +#endif return TopmenuProcess1; } @@ -179,6 +193,7 @@ void* TopmenuProcess2(void) FADE_OUT_RETURN( FormatProcess0 ); case 1: FADE_OUT_RETURN( HWInfoProcess0 ); +#ifndef NAND_FORMATTER_MODE case 2: FADE_OUT_RETURN( eTicketProcess0 ); case 3: @@ -187,6 +202,7 @@ void* TopmenuProcess2(void) FADE_OUT_RETURN( NandfirmProcess0 ); case 5: FADE_OUT_RETURN( NorfirmProcess0 ); +#endif } return TopmenuProcess1;