mirror of
https://github.com/rvtr/TwlIPL.git
synced 2025-10-31 06:01:12 -04:00
FontWriter新規追加。
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@2758 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
parent
3c38336557
commit
5c593fff04
115
build/systemMenu_tools/FontWriter/ARM9.TWL/Makefile
Normal file
115
build/systemMenu_tools/FontWriter/ARM9.TWL/Makefile
Normal file
@ -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 =====
|
||||
198
build/systemMenu_tools/FontWriter/ARM9.TWL/local_src/main.c
Normal file
198
build/systemMenu_tools/FontWriter/ARM9.TWL/local_src/main.c
Normal file
@ -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 <twl.h>
|
||||
#include <nitro/snd.h>
|
||||
#include <twl/fatfs.h>
|
||||
#include <nitro/card.h>
|
||||
#include <twl/nam.h>
|
||||
#include <twl/os/common/format_rom.h>
|
||||
#include <sysmenu/namut.h>
|
||||
#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);
|
||||
}
|
||||
|
||||
@ -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 <twl.h>
|
||||
#include <nitro/snd.h>
|
||||
#include <twl/fatfs.h>
|
||||
#include <nitro/card.h>
|
||||
#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;i<sLines;i++)
|
||||
{
|
||||
kamiFontPrintf(3, (s16)(5+i), FONT_COLOR_BLACK, "l l l");
|
||||
}
|
||||
kamiFontPrintf(3, (s16)(5+sLines), FONT_COLOR_BLACK, "+--------------------+----+");
|
||||
|
||||
// dat ファイルリストを表示
|
||||
for (i=0;i<sLines; i++)
|
||||
{
|
||||
// ファイル名追加
|
||||
kamiFontPrintf(3, (s16)(5+CHAR_OF_MENU_SPACE_INDIVIDUALLY*i), FONT_COLOR_BLACK, "l %-16.16s l l", sFilePath[sDatListViewOffset+i]);
|
||||
}
|
||||
}
|
||||
221
build/systemMenu_tools/FontWriter/ARM9.TWL/main.rsf
Normal file
221
build/systemMenu_tools/FontWriter/ARM9.TWL/main.rsf
Normal file
@ -0,0 +1,221 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: TwlSDK - include
|
||||
# File: ROM-BB.rsf
|
||||
#
|
||||
# Copyright 2007 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded insructions, 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$
|
||||
#----------------------------------------------------------------------------
|
||||
#
|
||||
# TWL ROM SPEC FILE
|
||||
#
|
||||
|
||||
Arm9
|
||||
{
|
||||
Static "$(MAKEROM_ARM9:r).TWL.FLX.sbin$(COMPSUFFIX9)"
|
||||
OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.FLX.sbin$(COMPSUFFIX9)"
|
||||
OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.FLX.sbin$(COMPSUFFIX9)"
|
||||
Elf "$(MAKEROM_ARM9:r).tef"
|
||||
}
|
||||
|
||||
Arm7
|
||||
{
|
||||
Static "$(MAKEROM_ARM7_BASE:r).TWL.FLX.sbin$(COMPSUFFIX7)"
|
||||
OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.FLX.sbin$(COMPSUFFIX7)"
|
||||
OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.FLX.sbin$(COMPSUFFIX7)"
|
||||
Elf "$(MAKEROM_ARM7_BASE:r).tef"
|
||||
}
|
||||
|
||||
Arm9.Ltd
|
||||
{
|
||||
Static "$(MAKEROM_ARM9:r).TWL.LTD.sbin$(COMPSUFFIX9)"
|
||||
OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.LTD.sbin$(COMPSUFFIX9)"
|
||||
OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.LTD.sbin$(COMPSUFFIX9)"
|
||||
}
|
||||
|
||||
Arm7.Ltd
|
||||
{
|
||||
Static "$(MAKEROM_ARM7_BASE:r).TWL.LTD.sbin$(COMPSUFFIX7)"
|
||||
OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.LTD.sbin$(COMPSUFFIX7)"
|
||||
OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.LTD.sbin$(COMPSUFFIX7)"
|
||||
}
|
||||
|
||||
Property
|
||||
{
|
||||
###
|
||||
### Settings for FinalROM
|
||||
###
|
||||
#### BEGIN
|
||||
#
|
||||
# TITLE NAME: Your product name within 12bytes
|
||||
#
|
||||
#TitleName "YourAppName"
|
||||
|
||||
#
|
||||
# MAKER CODE: Your company ID# in 2 ascii words
|
||||
# issued by NINTENDO
|
||||
#
|
||||
#MakerCode "00"
|
||||
|
||||
#
|
||||
# REMASTER VERSION: Mastering version
|
||||
#
|
||||
RomVersion 2
|
||||
|
||||
#
|
||||
# ROM SPEED TYPE: [MROM/1TROM/UNDEFINED]
|
||||
#
|
||||
RomSpeedType $(MAKEROM_ROMSPEED)
|
||||
|
||||
#
|
||||
# ROM SIZE: in bit [64M/128M/256M/512M/1G/2G]
|
||||
#
|
||||
#RomSize 64M
|
||||
|
||||
#
|
||||
# ROM PADDING: TRUE if finalrom
|
||||
#
|
||||
#RomFootPadding TRUE
|
||||
|
||||
#
|
||||
# ROM HEADER TEMPLATE: Provided to every product by NINTENDO
|
||||
#
|
||||
#RomHeaderTemplate ./etc/rom_header.template.sbin
|
||||
|
||||
#
|
||||
# BANNER FILE: generated from Banner Spec File
|
||||
#
|
||||
BannerFile ../banner/banner.bnr
|
||||
|
||||
###
|
||||
### Setting for TWL
|
||||
###
|
||||
|
||||
#
|
||||
# ROM HEADER Ltd: Provided to every product by NINTENDO
|
||||
#
|
||||
RomHeaderLtd $(TWLSDK_ROOT)/tools/bin/rom_header.LTD.sbin
|
||||
|
||||
#
|
||||
# Digest parameters:
|
||||
#
|
||||
DigestParam 1024 32
|
||||
|
||||
#
|
||||
# WRAM mapping: [MAP_BB_HYB/MAP_BB_LTD/MAP_TS_HYB/MAP_TS_LTD]
|
||||
# don't have to edit
|
||||
#
|
||||
WramMapping MAP_TS_SCR
|
||||
|
||||
#
|
||||
# CardRegion: card region [Japan/America/Europe/Australia/China/Korea]
|
||||
#
|
||||
CardRegion ALL
|
||||
|
||||
#
|
||||
# CommonClientKey: launcher deliver common client Key [TRUE/FALSE]
|
||||
#
|
||||
CommonClientKey FALSE
|
||||
|
||||
#
|
||||
# HwAESSlotB: launcher deliver HW AES slot B setting [TRUE/FALSE]
|
||||
#
|
||||
HwAESSlotB FALSE
|
||||
|
||||
#
|
||||
# HwAESSlotC: launcher deliver HW AES slot C setting [TRUE/FALSE]
|
||||
#
|
||||
HwAESSlotC FALSE
|
||||
|
||||
#
|
||||
# SDCardAccess: sd card access control [TRUE/FALSE]
|
||||
#
|
||||
SDCardAccess TRUE
|
||||
|
||||
#
|
||||
# NANDAccess: NAND access control [TRUE/FALSE]
|
||||
#
|
||||
NANDAccess TRUE
|
||||
|
||||
#
|
||||
# Codec mode:
|
||||
# don't have to edit
|
||||
#
|
||||
CodecMode $(MAKEROM_CODEC_MODE)
|
||||
|
||||
#
|
||||
# DisableDebug :最終ROMでは、実行時にデバッグできないようにTRUEにする必要があります。
|
||||
#
|
||||
DisableDebug $(DISABLE_DEBUG)
|
||||
|
||||
###
|
||||
#### END
|
||||
}
|
||||
|
||||
|
||||
AppendProperty
|
||||
{
|
||||
#
|
||||
# Publisher : "Nintendo"
|
||||
# don't have to edit
|
||||
Publisher Nintendo
|
||||
|
||||
#
|
||||
# Application type : [USER/SYSTEM]
|
||||
# don't have to edit
|
||||
AppType System
|
||||
|
||||
#
|
||||
# launch title on the launcher : [TRUE/FALSE]
|
||||
# don't have to edit
|
||||
Launch TRUE
|
||||
|
||||
#
|
||||
# Data only title : [TRUE/FALSE]
|
||||
# don't have to edit
|
||||
DataOnly FALSE
|
||||
|
||||
#
|
||||
# Secure title : [TRUE/FALSE]
|
||||
# don't have to edit
|
||||
Secure TRUE
|
||||
|
||||
#
|
||||
# Boot allowed Media: [GameCard/NAND]
|
||||
#
|
||||
Media GameCard
|
||||
|
||||
#
|
||||
# GameCode for TitleID : Your GameCode in 4 ascii words
|
||||
#
|
||||
GameCode $(TITLEID_LO)
|
||||
|
||||
#
|
||||
# Public save data size: [16K/32K/64K/128K/256K/512K/1M/2M/4M/8M]
|
||||
#
|
||||
#PublicSaveDataSize 32K
|
||||
|
||||
#
|
||||
# Private save data size: [16K/32K/64K/128K/256K/512K/1M/2M/4M/8M]
|
||||
#
|
||||
#PrivateSaveDataSize 16K
|
||||
|
||||
#
|
||||
# Enable SubBannerFile
|
||||
#SubBannerFile TRUE
|
||||
}
|
||||
|
||||
|
||||
RomSpec
|
||||
{
|
||||
Offset 0x00000000
|
||||
Segment ALL
|
||||
}
|
||||
33
build/systemMenu_tools/FontWriter/Makefile
Normal file
33
build/systemMenu_tools/FontWriter/Makefile
Normal file
@ -0,0 +1,33 @@
|
||||
#! 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 \
|
||||
ARM9.TWL \
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
include $(TWLSDK_ROOT)/build/buildtools/modulerules
|
||||
|
||||
|
||||
#===== End of Makefile =====
|
||||
47
build/systemMenu_tools/FontWriter/banner/Makefile
Normal file
47
build/systemMenu_tools/FontWriter/banner/Makefile
Normal file
@ -0,0 +1,47 @@
|
||||
#! 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))
|
||||
BANNER_ICON_MIDDLE = $(addprefix $(BANNER_ICON_NAME), .nbfs .nbfc .nbfp)
|
||||
|
||||
LDIRT_CLEAN = $(TARGETS) \
|
||||
$(BANNER_ICON_MIDDLE) \
|
||||
$(TARGETS:.bnr=.srl)
|
||||
|
||||
include $(TWL_IPL_RED_ROOT)/build/buildtools/modulerules
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# build
|
||||
#----------------------------------------------------------------------------
|
||||
do-build: $(TARGETS)
|
||||
|
||||
$(TARGETS): $(BANNER_SPEC) $(BANNER_ICON) $(BANNER_ICON_MIDDLE)
|
||||
$(MAKEBANNER) -N $(BANNER_ICON_NAME) $(BANNER_SPEC) $(TARGETS)
|
||||
|
||||
#
|
||||
BIN
build/systemMenu_tools/FontWriter/banner/banner_v3.bsf
Normal file
BIN
build/systemMenu_tools/FontWriter/banner/banner_v3.bsf
Normal file
Binary file not shown.
BIN
build/systemMenu_tools/FontWriter/banner/icon/gameIcon.bmp
Normal file
BIN
build/systemMenu_tools/FontWriter/banner/icon/gameIcon.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 630 B |
Loading…
Reference in New Issue
Block a user