From 5c593fff04b8e6e000eabe842b43123a7c645998 Mon Sep 17 00:00:00 2001 From: kamikawa Date: Mon, 2 Mar 2009 11:46:39 +0000 Subject: [PATCH] =?UTF-8?q?FontWriter=E6=96=B0=E8=A6=8F=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@2758 b08762b0-b915-fc4b-9d8c-17b2551a87ff --- .../FontWriter/ARM9.TWL/Makefile | 115 +++++ .../FontWriter/ARM9.TWL/local_src/main.c | 198 ++++++++ .../ARM9.TWL/local_src/process_write_data.c | 468 ++++++++++++++++++ .../FontWriter/ARM9.TWL/main.rsf | 221 +++++++++ build/systemMenu_tools/FontWriter/Makefile | 33 ++ .../FontWriter/banner/Makefile | 47 ++ .../FontWriter/banner/banner_v3.bsf | Bin 0 -> 788 bytes .../FontWriter/banner/icon/gameIcon.bmp | Bin 0 -> 630 bytes 8 files changed, 1082 insertions(+) create mode 100644 build/systemMenu_tools/FontWriter/ARM9.TWL/Makefile create mode 100644 build/systemMenu_tools/FontWriter/ARM9.TWL/local_src/main.c create mode 100644 build/systemMenu_tools/FontWriter/ARM9.TWL/local_src/process_write_data.c create mode 100644 build/systemMenu_tools/FontWriter/ARM9.TWL/main.rsf create mode 100644 build/systemMenu_tools/FontWriter/Makefile create mode 100644 build/systemMenu_tools/FontWriter/banner/Makefile create mode 100644 build/systemMenu_tools/FontWriter/banner/banner_v3.bsf create mode 100644 build/systemMenu_tools/FontWriter/banner/icon/gameIcon.bmp diff --git a/build/systemMenu_tools/FontWriter/ARM9.TWL/Makefile b/build/systemMenu_tools/FontWriter/ARM9.TWL/Makefile new file mode 100644 index 00000000..afe2a912 --- /dev/null +++ b/build/systemMenu_tools/FontWriter/ARM9.TWL/Makefile @@ -0,0 +1,115 @@ +#! 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 = + +#---------------------------------------------------------------------------- + +#============================================================================ +#製品鍵を使った書き込みを行う場合は、TwlIPL/build/buildtools/commondefsの"FIRM_USE_PRODUCT_KEYS=TRUE"を有効にしてください。 +#============================================================================ +#============================================================================ +# NandInitializerRedから一部の機能を削除するために定義を追加します。 +MACRO_FLAGS += -DNAND_INITIALIZER_LIMITED_MODE +#============================================================================ +#============================================================================ +# FontWriter用としてビルドする場合定義します。(要:Make Clean) +MACRO_FLAGS += -DTWL_FONT_WRITER +#============================================================================ + +SYSM_DISABLE_DEBUG = TRUE + +TARGET_FIRM = SYSTEMMENU +TARGET_PLATFORM = TWL +TWL_ARCHGEN = LIMITED + +#TARGET_CODEGEN = THUMB + +TITLEID_LO = 0FWA +#TARGET_TAD = + +TARGET_BIN = FontWriter.srl + +LCFILE_SPEC = ../../NandInitializerRed/ARM9.TWL/ARM9-TS.lsf +ROM_SPEC = ./main.rsf + +MAKEROM_ARM7_BASE = $(TWL_COMPONENTSDIR)/armadillo/$(TWL_BUILDTYPE_ARM7)/armadillo +MAKEROM_ARM7 = $(MAKEROM_ARM7_BASE).TWL.FLX.sbin + +SRCS = ./local_src/main.c \ + ./local_src/process_write_data.c \ + kami_pxi.c \ + font_data.c \ + graphics.c \ + keypad.c \ + kami_font.c \ + cursor.c \ + process_fade.c + +LINCLUDES = ../../NandInitializerRed/common/include \ + ../../NandInitializerRed/ARM9.TWL/include \ + $(ROOT)/build/libraries/lcfg/ARM9.TWL/include \ + ../../common/ARM9/include + +SRCDIR = ../../NandInitializerRed/ARM9.TWL/src \ + ../../HWInfoWriter/ARM9/src \ + ../../common/ARM9/src + +#LCFILE = # using default + +#---------------------------------------------------------------------------- + +include $(TWL_IPL_RED_ROOT)/build/buildtools/commondefs + + +MAKEROM_FLAGS += -DTITLEID_LO='$(TITLEID_LO)' \ + -DCARD_REGION='$(CARD_REGION)' \ + -DDISABLE_DEBUG='$(SYSM_DISABLE_DEBUG)' + +MAKETAD_FLAGS += -s + +SYSMENU_LIBS = \ + libnamut$(TWL_LIBSUFFIX).a + +SDK_APPEND_LIBS = \ + libes$(TWL_LIBSUFFIX).a \ + libboc$(TWL_LIBSUFFIX).a \ + libsfs$(TWL_LIBSUFFIX).a \ + libnam$(TWL_LIBSUFFIX).a \ + libsea$(TWL_LIBSUFFIX).a \ + liblcfg$(TWL_LIBSUFFIX).a + +LLIBRARIES += $(SYSMENU_LIBS) $(SDK_APPEND_LIBS) + +MAKEROM = $(TWL_TOOLSDIR)/bin/makerom.TWL.secure.exe + +# インストール設定 +#ifeq ($(TWL_BUILD_TYPE),FINALROM) +#INSTALL_DIR = $(ROOT)/bin/ARM9-TS/Rom +#INSTALL_TARGETS = $(BINDIR)/$(TARGET_NAME).srl +#endif + + +#---------------------------------------------------------------------------- + +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_tools/FontWriter/ARM9.TWL/local_src/main.c b/build/systemMenu_tools/FontWriter/ARM9.TWL/local_src/main.c new file mode 100644 index 00000000..292caf75 --- /dev/null +++ b/build/systemMenu_tools/FontWriter/ARM9.TWL/local_src/main.c @@ -0,0 +1,198 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - NandInitializer + File: main.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 +#include +#include +#include +#include +#include +#include "kami_font.h" +#include "process_write_data.h" +#include "graphics.h" +#include "keypad.h" +#include "kami_pxi.h" +#include "process_fade.h" +#include "hwi.h" + +#define SCRAMBLE_MASK 0x00406000 + +extern void HWInfoWriterInit( void ); + +/*---------------------------------------------------------------------------* + 内部変数定義 + *---------------------------------------------------------------------------*/ + +static Process sProcess; +static FSEventHook sSDHook; + +/*---------------------------------------------------------------------------* + 内部関数定義 + *---------------------------------------------------------------------------*/ +static void VBlankIntr(void); +static void InitAllocation(void); + +/*---------------------------------------------------------------------------* + Name: TwlMain + + Description: main + + Arguments: None + + Returns: None + *---------------------------------------------------------------------------*/ +void +TwlMain() +{ + // 製品ビルドランチャー&デバッガ上での起動対応 + if ( OS_GetRunningConsoleType() & OS_CONSOLE_TWLDEBUGGER ) + { + ROM_Header *dh = (void *)HW_ROM_HEADER_BUF; + dh->s.game_cmd_param &= ~SCRAMBLE_MASK; + } + + OS_Init(); + OS_InitTick(); + OS_InitArena(); + PXI_Init(); + OS_InitLock(); + OS_InitArenaEx(); + OS_InitIrqTable(); + OS_SetIrqStackChecker(); + MI_Init(); + OS_InitVAlarm(); + OSi_InitVramExclusive(); + OS_InitThread(); + OS_InitReset(); + GX_Init(); + FX_Init(); + SND_Init(); + SNDEX_Init(); + TP_Init(); + RTC_Init(); + +#ifndef NAND_INITIALIZER_LIMITED_MODE + KamiPxiInit(); /* 独自PXI初期化 */ +#endif + + // Vブランク割り込み設定 + OS_SetIrqFunction(OS_IE_V_BLANK, VBlankIntr); + (void)OS_EnableIrqMask(OS_IE_V_BLANK); + (void)OS_EnableIrqMask(OS_IE_FIFO_RECV); + (void)OS_EnableIrq(); + (void)GX_VBlankIntr(TRUE); + + // initialize file-system + FS_Init(FS_DMA_NOT_USE); + + // SDカードの挿抜イベント監視コールバック設定 +// FS_RegisterEventHook("sdmc", &sSDHook, SDEvents, NULL); + + // FS_Initの後の方が良い模様 + InitAllocation(); + + // 表示関連初期化 + InitGraphics(); + kamiFontInit(); + + /* always preload FS table for faster directory access. */ + { + u32 need_size = FS_GetTableSize(); + void *p_table = OS_Alloc(need_size); + SDK_ASSERT(p_table != NULL); + (void)FS_LoadTable(p_table, need_size); + } + + // 初期シーケンス設定 + sProcess = WriteDataProcess0; + + kamiFontPrintfConsole( CONSOLE_ORANGE, "How to \n"); + kamiFontPrintfConsole( CONSOLE_ORANGE, "+---------------------------+\n"); + kamiFontPrintfConsole( CONSOLE_ORANGE, "l A Button : Select Menu l\n"); + kamiFontPrintfConsole( CONSOLE_ORANGE, "l Up/Down Key : Change Menu l\n"); +#ifndef NAND_INITIALIZER_LIMITED_MODE + kamiFontPrintfConsole( CONSOLE_ORANGE, "l L&R Button : Auto Init l\n"); +#endif + kamiFontPrintfConsole( CONSOLE_ORANGE, "+---------------------------+\n"); + + + // NAMライブラリ初期化 + NAM_Init( OS_AllocFromMain, OS_FreeToMain); + NAMUT_Init( OS_AllocFromMain, OS_FreeToMain); + + + while (1) + { + kamiPadRead(); + + // コマンドフラッシュ +// (void)SND_FlushCommand(SND_COMMAND_NOBLOCK); + + // Vブランク待ち + OS_WaitVBlankIntr(); + + // ARM7コマンド応答受信 +// while (SND_RecvCommandReply(SND_COMMAND_NOBLOCK) != NULL) +// { +// } + + // フォントスクリーンデータロード + kamiFontLoadScreenData(); + + sProcess = sProcess(); + } +} + +/*---------------------------------------------------------------------------* + Name: VBlankIntr + + Description: VBlank割り込み処理 + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +static void +VBlankIntr(void) +{ + OS_SetIrqCheckFlag(OS_IE_V_BLANK); // checking VBlank interrupt +} + +/*---------------------------------------------------------------------------* + Name: InitAllocation + + Description: ヒープの初期化. + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +static void InitAllocation(void) +{ + void *tmp; + OSHeapHandle hh; + + /* アリーナの初期化 */ + tmp = OS_InitAlloc(OS_ARENA_MAIN, OS_GetMainArenaLo(), OS_GetMainArenaHi(), 1); + OS_SetArenaLo(OS_ARENA_MAIN, tmp); + hh = OS_CreateHeap(OS_ARENA_MAIN, OS_GetMainArenaLo(), OS_GetMainArenaHi()); + if (hh < 0) + OS_Panic("ARM9: Fail to create heap...\n"); + hh = OS_SetCurrentHeap(OS_ARENA_MAIN, hh); +} + diff --git a/build/systemMenu_tools/FontWriter/ARM9.TWL/local_src/process_write_data.c b/build/systemMenu_tools/FontWriter/ARM9.TWL/local_src/process_write_data.c new file mode 100644 index 00000000..1aaafafc --- /dev/null +++ b/build/systemMenu_tools/FontWriter/ARM9.TWL/local_src/process_write_data.c @@ -0,0 +1,468 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - NandInitializer + File: process_write_data.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 +#include +#include +#include "kami_font.h" +#include "kami_pxi.h" +#include "process_topmenu.h" +#include "process_write_data.h" +#include "process_auto.h" +#include "process_fade.h" +#include "cursor.h" +#include "keypad.h" +#include "common_utility.h" + +/*---------------------------------------------------------------------------* + 型定義 + *---------------------------------------------------------------------------*/ + +enum { + MENU_FONT=0, + NUM_OF_MENU_SELECT +}; + +/*---------------------------------------------------------------------------* + 定数定義 + *---------------------------------------------------------------------------*/ + +#define DOT_OF_MENU_SPACE 16 +#define CURSOR_ORIGIN_X 32 +#define CURSOR_ORIGIN_Y 56 +#define CURSOR_ORIGIN_Y_INDIVIDUALLY 40 +#define CHAR_OF_MENU_SPACE 2 +#define CHAR_OF_MENU_SPACE_INDIVIDUALLY 1 + +#define ROUND_UP(value, alignment) \ + (((u32)(value) + (alignment-1)) & ~(alignment-1)) + +#define DOT_OF_MENU_SPACE 16 +#define DOT_OF_MENU_SPACE_INDIVIDUALLY 8 + +#define FILE_NUM_MAX 256 +#define VIEW_LINES_MAX 16 + +/*---------------------------------------------------------------------------* + 内部変数定義 + *---------------------------------------------------------------------------*/ + +static s8 sMenuSelectNo; +static s32 sMenuSelectNoIndividually; + +static char sFilePath[FILE_NUM_MAX][FS_ENTRY_LONGNAME_MAX]; + +static u8 sFileNum; + +static s32 sDatListViewOffset; + +static s32 sLines; + +/*---------------------------------------------------------------------------* + 内部関数宣言 + *---------------------------------------------------------------------------*/ + +static BOOL WriteFontData(void); +static BOOL WriteDummyData(const char* nandpath); +static BOOL WriteCertData(void); +static void ShowDatList(void); + +void* WriteDataProcess0(void); +void* WriteDataProcess1(void); +void* WriteDataProcess2(void); +void* WriteDataProcess3(void); +void* WriteDataProcess4(void); +void* WriteDataProcess5(void); + +/*---------------------------------------------------------------------------* + プロセス関数定義 + *---------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------* + Name: WriteData プロセス0 + + Description: + + Arguments: None. + + Returns: next sequence + *---------------------------------------------------------------------------*/ + +void* WriteDataProcess0(void) +{ + int i; + + // 配列クリア + MI_CpuClear8( sFilePath, sizeof(sFilePath) ); + + // ファイル数初期化 + sFileNum = 0; + + // 表示オフセット初期化 + sDatListViewOffset = 0; + + // 文字列全クリア + kamiFontClear(); + + // バージョン表示 + kamiFontPrintf(2, 1, FONT_COLOR_BLACK, "FONT WRITER"); + kamiFontPrintf(0, 2, FONT_COLOR_BLACK, "--------------------------------"); + + // メニュー一覧 + kamiFontPrintf(3, 6, FONT_COLOR_BLACK, "+-------------------+-----+"); + kamiFontPrintf(3, 7, FONT_COLOR_BLACK, "l Serch SD Card l l"); + kamiFontPrintf(3, 8, FONT_COLOR_BLACK, "+-------------------+-----+"); + + // 背景全クリア + for (i=0;i<24;i++) + { + kamiFontFillChar( i, BG_COLOR_TRANS, BG_COLOR_TRANS ); + } + + // 背景上部 + kamiFontFillChar( 0, BG_COLOR_BROWN, BG_COLOR_BROWN ); + kamiFontFillChar( 1, BG_COLOR_BROWN, BG_COLOR_BROWN ); + kamiFontFillChar( 2, BG_COLOR_BROWN, BG_COLOR_TRANS ); + + // カーソル消去 + SetCursorPos((u16)200, (u16)200); + + FADE_IN_RETURN( WriteDataProcess1 ); +} + +/*---------------------------------------------------------------------------* + Name: WriteData プロセス1 + + Description: + + Arguments: None. + + Returns: next sequence + *---------------------------------------------------------------------------*/ + +void* WriteDataProcess1(void) +{ + // カーソル配置 + SetCursorPos((u16)CURSOR_ORIGIN_X, (u16)(CURSOR_ORIGIN_Y + sMenuSelectNo * DOT_OF_MENU_SPACE)); + + // 決定 + if (kamiPadIsTrigger(PAD_BUTTON_A)) + { + FADE_OUT_RETURN( WriteDataProcess2 ); + } + + return WriteDataProcess1; +} + +/*---------------------------------------------------------------------------* + Name: WriteData プロセス2 + + Description: + + Arguments: None. + + Returns: next sequence + *---------------------------------------------------------------------------*/ + +void* WriteDataProcess2(void) +{ + FSFile dir; + + // SDカードのルートディレクトリを検索 + if ( !FS_OpenDirectory(&dir, "sdmc:/", FS_FILEMODE_R | FS_FILEMODE_W) ) + { + kamiFontPrintfConsole(CONSOLE_RED, "Error FS_OpenDirectory(sdmc:/)\n"); + } + else + { + FSDirectoryEntryInfo info[1]; + OS_Printf("[%s]:\n", "sdmc:/"); + + kamiFontPrintfConsole(CONSOLE_ORANGE, "------ font file List -----\n"); + + // .dat を探してファイル名を保存しておく + while (FS_ReadDirectory(&dir, info)) + { + OS_Printf(" %s", info->longname); + if ((info->attributes & (FS_ATTRIBUTE_DOS_DIRECTORY | FS_ATTRIBUTE_IS_DIRECTORY)) != 0) + { + OS_Printf("/\n"); + } + else + { + char* pExtension; + OS_Printf(" (%d BYTEs)\n", info->filesize); + + // 拡張子のチェック + pExtension = STD_SearchCharReverse( info->longname, '.'); + if (pExtension) + { + if (!STD_CompareString( pExtension, ".dat") || !STD_CompareString( pExtension, ".DAT") ) + { + char full_path[FS_ENTRY_LONGNAME_MAX+6]; + + // フルパスを作成 + MakeFullPathForSD(info->longname, full_path); + + STD_CopyString( sFilePath[sFileNum], info->longname ); + kamiFontPrintfConsole(CONSOLE_ORANGE, "%d:%s\n", sFileNum, info->longname); + + if (++sFileNum >= FILE_NUM_MAX) + { + break; + } + } + } + } + } + (void)FS_CloseDirectory(&dir); + + kamiFontPrintfConsole(CONSOLE_ORANGE, "--------------------------\n"); + +// DumpTadInfo(); + } + ShowDatList(); + + // カーソル消去 + SetCursorPos((u16)200, (u16)200); + + FADE_IN_RETURN( WriteDataProcess3 ); +} + +/*---------------------------------------------------------------------------* + Name: WriteData プロセス3 + + Description: + + Arguments: None. + + Returns: next sequence + *---------------------------------------------------------------------------*/ + +void* WriteDataProcess3(void) +{ + + // 選択メニューの変更 + if ( kamiPadIsRepeatTrigger(PAD_KEY_UP) ) + { + if (--sMenuSelectNoIndividually < 0) + { + sMenuSelectNoIndividually = sFileNum - 1; + if (sFileNum > VIEW_LINES_MAX) + { + sDatListViewOffset = sFileNum - VIEW_LINES_MAX; + } + else + { + sDatListViewOffset = 0; + } + } + if (sMenuSelectNoIndividually < sDatListViewOffset) + { + sDatListViewOffset--; + } + } + else if ( kamiPadIsRepeatTrigger(PAD_KEY_DOWN) ) + { + if (++sMenuSelectNoIndividually > sFileNum - 1) + { + sMenuSelectNoIndividually = 0; + sDatListViewOffset = 0; + } + if ((sMenuSelectNoIndividually - sDatListViewOffset) > VIEW_LINES_MAX - 1) + { + sDatListViewOffset++; + } + + } + + // カーソル配置 + SetCursorPos((u16)CURSOR_ORIGIN_X, (u16)(CURSOR_ORIGIN_Y_INDIVIDUALLY + (sMenuSelectNoIndividually - sDatListViewOffset) * DOT_OF_MENU_SPACE_INDIVIDUALLY)); + + // 決定 + if (kamiPadIsTrigger(PAD_BUTTON_A)) + { + return WriteDataProcess4; + } + // ひとつ前のメニューへ戻る + else if (kamiPadIsTrigger(PAD_BUTTON_B)) + { + FADE_OUT_RETURN( WriteDataProcess0 ); + } + + return WriteDataProcess3; +} + +/*---------------------------------------------------------------------------* + Name: WriteData プロセス4 + + Description: + + Arguments: None. + + Returns: next sequence + *---------------------------------------------------------------------------*/ + +void* WriteDataProcess4(void) +{ + BOOL ret; + + if (STD_GetStringLength(sFilePath[sMenuSelectNoIndividually])) + { + // 個別インポート + ret = WriteFontData(); + } + else + { + // リターン + return WriteDataProcess0; + } + + // 今回の結果を表示 + if ( ret == TRUE ) + { + kamiFontPrintf(26, (s16)(5+sMenuSelectNoIndividually*CHAR_OF_MENU_SPACE_INDIVIDUALLY), FONT_COLOR_GREEN, "OK"); + kamiFontPrintfConsoleEx(CONSOLE_GREEN, "Write Font Success!\n"); + } + else + { + kamiFontPrintf(26, (s16)(5+sMenuSelectNoIndividually*CHAR_OF_MENU_SPACE_INDIVIDUALLY), FONT_COLOR_RED, "NG"); + kamiFontPrintfConsoleEx(CONSOLE_RED, "Write Font Error!\n"); + } + + // フォントスクリーンデータロード + kamiFontLoadScreenData(); + + return WriteDataProcess3; +} + +/*---------------------------------------------------------------------------* + 処理関数定義 + *---------------------------------------------------------------------------*/ + +static BOOL WriteFontData(void) +{ + FSFile file; + BOOL open_is_ok; + BOOL read_is_ok; + void* pTempBuf; + u32 file_size; + u32 alloc_size; + BOOL result = TRUE; + char full_path[FS_ENTRY_LONGNAME_MAX+6]; + + // フルパスを作成 + MakeFullPathForSD(sFilePath[sMenuSelectNoIndividually], full_path); + + // ROMファイルオープン + FS_InitFile(&file); + open_is_ok = FS_OpenFile(&file, full_path); + if (!open_is_ok) + { + kamiFontPrintfConsoleEx(CONSOLE_RED, "FS_OpenFile(\"%s\") ... ERROR!\n", full_path); + return FALSE; + } + + // ROMファイルリード + file_size = FS_GetFileLength(&file) ; + alloc_size = ROUND_UP(file_size, 32) ; + pTempBuf = OS_Alloc( alloc_size ); + SDK_NULL_ASSERT(pTempBuf); + DC_InvalidateRange(pTempBuf, alloc_size); + read_is_ok = FS_ReadFile( &file, pTempBuf, (s32)file_size ); + if (!read_is_ok) + { + kamiFontPrintfConsoleEx(CONSOLE_RED, "FS_ReadFile(\"%s\") ... ERROR!\n", full_path); + FS_CloseFile(&file); + OS_Free(pTempBuf); + return FALSE; + } + + // ROMファイルクローズ + FS_CloseFile(&file); + + // 一旦フォントデータを削除する + (void)FS_DeleteFile(FONT_DATA_FILE_PATH_IN_NAND); + + // nand:sys/TWLFontTable.dat作成 + if (!FS_CreateFile(FONT_DATA_FILE_PATH_IN_NAND, FS_PERMIT_R | FS_PERMIT_W)) + { + kamiFontPrintfConsoleEx(CONSOLE_RED, "FS_CreateFile(%s) failed.\n", FONT_DATA_FILE_PATH_IN_NAND); + result = FALSE; + } + else + { + // nand:sys/TWLFontTable.datオープン + FS_InitFile(&file); + open_is_ok = FS_OpenFileEx(&file, FONT_DATA_FILE_PATH_IN_NAND, FS_FILEMODE_W); + if (!open_is_ok) + { + kamiFontPrintfConsoleEx(CONSOLE_RED, "FS_OpenFile(%s) failed.\n", FONT_DATA_FILE_PATH_IN_NAND); + result = FALSE; + } + // nand:sys/TWLFontTable.dat書き込み + else if (FS_WriteFile(&file, pTempBuf, (s32)file_size) == -1) + { + kamiFontPrintfConsoleEx(CONSOLE_RED, "FS_WritFile() failed.\n"); + result = FALSE; + } + (void)FS_CloseFile(&file); + } + + OS_Free(pTempBuf); + + return result; +} + +/*---------------------------------------------------------------------------* + Name: ShowDatList + + Description: .dad のリストを表示する + + Arguments: arg - 使用しない。 + + Returns: None. + *---------------------------------------------------------------------------*/ +static void ShowDatList(void) +{ + int i; + + // 文字列全クリア + kamiFontClear(); + + // バージョン表示 + kamiFontPrintf(2, 1, FONT_COLOR_BLACK, "FONT WRITER"); + kamiFontPrintf(0, 2, FONT_COLOR_BLACK, "--------------------------------"); + + // メニュー一覧 + kamiFontPrintf(3, 4, FONT_COLOR_BLACK, "+--------------------+----+"); + if (sFileNum > 15) { sLines = VIEW_LINES_MAX; } + else { sLines = sFileNum; } + for (i=0;ia$z=PDw2=&{nYiWD(g&zrQ;KoccNEq(dwH@i6}H)UbinSXZj z&18PgW6hK*k<%m`hwoK!wyKGy`r?*zOH^pj{Zb>1yX^SpZ*2Uo)2nunG!T7sL{6m+ zL|S4Qgic4;3;Y(Z!Y_i&dFfFaqL%wct%Oc)bf+iH|FtvgZVi{w75apC3gK;FGVM{% zL@wYpt<`(ip}jDDu2rv|=%rU*P@%8>1GDPW(*eHw0lwvc9{+x{j{fVgr41YD!(ZMo otxPBE4!>nT+Zt-X7Pp1$Hsd;d{EEu?LP4uNW)kjA`PTr SA>@TL;7^)+|1ZD(&x&6sjZuF9 literal 0 HcmV?d00001