(NandInitializer/SystemUpdater) フォントデータの名称変更に対応

ソース整理

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@2438 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
kamikawa 2008-09-08 08:29:41 +00:00
parent 5e2c831038
commit 5e02b1d3ae
15 changed files with 58 additions and 180 deletions

View File

@ -40,8 +40,6 @@ endif
GEN_FONT_TABLE = $(SYSMENU_TOOLSDIR)/bin/genFontTable.plx GEN_FONT_TABLE = $(SYSMENU_TOOLSDIR)/bin/genFontTable.plx
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
INSTALL_TARGETS = $(FONT_TABLE)
INSTALL_DIR = $(TWL_IPL_RED_ROOT)/build/systemMenu_tools/SystemUpdater/data
LDIRT_CLEAN = $(FONT_TABLE_WITH_TIMESTAMP) LDIRT_CLEAN = $(FONT_TABLE_WITH_TIMESTAMP)

View File

@ -79,7 +79,6 @@ SRCS = main.c \
process_hw_info.c \ process_hw_info.c \
process_wireless_setting.c \ process_wireless_setting.c \
process_fade.c \ process_fade.c \
sd_event.c \
hwi.c \ hwi.c \
debugger_hw_reset_control.c debugger_hw_reset_control.c

View File

@ -80,7 +80,6 @@ SRCS = main.c \
process_write_data.c \ process_write_data.c \
process_mcu.c \ process_mcu.c \
process_wireless_setting.c \ process_wireless_setting.c \
sd_event.c \
hwi.c \ hwi.c \
debugger_hw_reset_control.c debugger_hw_reset_control.c

View File

@ -76,7 +76,6 @@ SRCS = main.c \
process_write_data.c \ process_write_data.c \
process_mcu.c \ process_mcu.c \
process_wireless_setting.c \ process_wireless_setting.c \
sd_event.c \
hwi.c \ hwi.c \
debugger_hw_reset_control.c debugger_hw_reset_control.c

View File

@ -29,7 +29,6 @@ extern "C" {
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
è<EFBFBD>è` è<EFBFBD>è`
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
#define FONT_DATA_FILE_PATH_IN_SDMC "sdmc:/TWLFontTable.dat"
#define FONT_DATA_FILE_PATH_IN_NAND "nand:sys/TWLFontTable.dat" #define FONT_DATA_FILE_PATH_IN_NAND "nand:sys/TWLFontTable.dat"
#define WRAP_DATA_FILE_PATH_IN_NAND "nand:/shared2/launcher/wrap.bin" #define WRAP_DATA_FILE_PATH_IN_NAND "nand:/shared2/launcher/wrap.bin"
#define CERT_DATA_FILE_PATH_IN_ROM "rom:/data/cert.sys" #define CERT_DATA_FILE_PATH_IN_ROM "rom:/data/cert.sys"

View File

@ -1,45 +0,0 @@
/*---------------------------------------------------------------------------*
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 <nitro.h>
/*---------------------------------------------------------------------------*
ŠÖ<EFBFBD>è`
*---------------------------------------------------------------------------*/
void SDEvents(void *userdata, FSEvent event, void *arg);
/*===========================================================================*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* SD_EVENT_H_ */
/*---------------------------------------------------------------------------*
End of file
*---------------------------------------------------------------------------*/

View File

@ -28,7 +28,6 @@
#include "graphics.h" #include "graphics.h"
#include "keypad.h" #include "keypad.h"
#include "kami_pxi.h" #include "kami_pxi.h"
#include "sd_event.h"
#include "process_fade.h" #include "process_fade.h"
#include "hwi.h" #include "hwi.h"

View File

@ -32,7 +32,7 @@
#include "process_fade.h" #include "process_fade.h"
#include "cursor.h" #include "cursor.h"
#include "keypad.h" #include "keypad.h"
#include "common_utility.h"
#include "TWLHWInfo_api.h" #include "TWLHWInfo_api.h"
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
@ -100,7 +100,6 @@ static void ProgressThread(void* arg);
static void Destructor(void* arg); static void Destructor(void* arg);
static void ShowTadList(void); static void ShowTadList(void);
static void DumpTadInfo(void); static void DumpTadInfo(void);
static void MakeFullPathForSD(char* file_name, char* full_path);
static void ShowTitleinfoDifference( NAMTitleInfo* titleInfoNand, NAMTitleInfo* titleInfoSd); static void ShowTitleinfoDifference( NAMTitleInfo* titleInfoNand, NAMTitleInfo* titleInfoSd);
void ProgessInit(void); void ProgessInit(void);
void ProgressDraw(f32 ratio); void ProgressDraw(f32 ratio);
@ -841,22 +840,6 @@ static void DumpTadInfo(void)
} }
} }
/*---------------------------------------------------------------------------*
Name: MakeFullPathForSD
Description:
Arguments: no
Returns: None.
*---------------------------------------------------------------------------*/
static void MakeFullPathForSD(char* file_name, char* full_path)
{
// フルパスを作成
STD_CopyString( full_path, "sdmc:/" );
STD_ConcatenateString( full_path, file_name );
}
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
Name: ShowTitleinfoDifference Name: ShowTitleinfoDifference

View File

@ -27,8 +27,7 @@
#include "process_fade.h" #include "process_fade.h"
#include "cursor.h" #include "cursor.h"
#include "keypad.h" #include "keypad.h"
#include "common_utility.h"
extern void MakeFullPathForSD(char* file_name, char* full_path);
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*

View File

@ -30,6 +30,7 @@
#include "cursor.h" #include "cursor.h"
#include "keypad.h" #include "keypad.h"
#include "kami_write_nandfirm.h" #include "kami_write_nandfirm.h"
#include "common_utility.h"
#include "TWLHWInfo_api.h" #include "TWLHWInfo_api.h"
#include <firm/format/firm_common.h> #include <firm/format/firm_common.h>
@ -113,8 +114,7 @@ void* NandfirmProcess0(void)
// SDカードのルートディレクトリを検索 // SDカードのルートディレクトリを検索
if ( !FS_OpenDirectory(&dir, "sdmc:/", FS_FILEMODE_R | FS_FILEMODE_W) ) if ( !FS_OpenDirectory(&dir, "sdmc:/", FS_FILEMODE_R | FS_FILEMODE_W) )
{ {
OS_Printf("Error FS_OpenDirectory(sdmc:/)\n"); kamiFontPrintfConsole(CONSOLE_RED, "Error FS_OpenDirectory(sdmc:/)");
kamiFontPrintf(3, 13, FONT_COLOR_BLACK, "Error FS_OpenDirectory(sdmc:/)");
} }
else else
{ {
@ -279,23 +279,3 @@ void* NandfirmProcess2(void)
return NandfirmProcess1; return NandfirmProcess1;
} }
/*---------------------------------------------------------------------------*
*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*
Name: MakeFullPathForSD
Description:
Arguments: no
Returns: None.
*---------------------------------------------------------------------------*/
void MakeFullPathForSD(char* file_name, char* full_path)
{
// フルパスを作成
STD_CopyString( full_path, "sdmc:/" );
STD_ConcatenateString( full_path, file_name );
}

View File

@ -30,7 +30,7 @@
#include "process_fade.h" #include "process_fade.h"
#include "cursor.h" #include "cursor.h"
#include "keypad.h" #include "keypad.h"
#include "common_utility.h"
#include "TWLHWInfo_api.h" #include "TWLHWInfo_api.h"
#include <firm/format/firm_common.h> #include <firm/format/firm_common.h>
@ -68,7 +68,6 @@ static u8 sFileNum;
àŠÖ<EFBFBD><EFBFBD>錾 àŠÖ<EFBFBD><EFBFBD>錾
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
static void MakeFullPathForSD(char* file_name, char* full_path);
static BOOL WriteNorfirm(char* file_name); static BOOL WriteNorfirm(char* file_name);
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
@ -264,27 +263,11 @@ void* NorfirmProcess2(void)
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
Name: MakeFullPathForSD Name: WriteNorfirm
Description: Description:
Arguments: no Arguments:
Returns: None.
*---------------------------------------------------------------------------*/
static void MakeFullPathForSD(char* file_name, char* full_path)
{
// ƒtƒƒpƒXð<E2809A>ì<EFBFBD>¬
STD_CopyString( full_path, "sdmc:/" );
STD_ConcatenateString( full_path, file_name );
}
/*---------------------------------------------------------------------------*
Name: MakeFullPathForSD
Description:
Arguments: no
Returns: None. Returns: None.
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/

View File

@ -27,6 +27,7 @@
#include "process_fade.h" #include "process_fade.h"
#include "cursor.h" #include "cursor.h"
#include "keypad.h" #include "keypad.h"
#include "common_utility.h"
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
@ -245,20 +246,57 @@ void* WriteDataProcess2(void)
static BOOL WriteFontData(void) static BOOL WriteFontData(void)
{ {
FSFile file; FSFile dir, file;
BOOL open_is_ok; BOOL open_is_ok;
BOOL read_is_ok; BOOL read_is_ok;
void* pTempBuf; void* pTempBuf;
u32 file_size; u32 file_size;
u32 alloc_size; u32 alloc_size;
BOOL result = TRUE; BOOL result = TRUE;
char full_path[FS_ENTRY_LONGNAME_MAX+6];
FS_InitFile(&dir);
// SDカードのルートディレクトリを検索
if ( !FS_OpenDirectory(&dir, "sdmc:/", FS_FILEMODE_R) )
{
kamiFontPrintfConsole(CONSOLE_RED, "Error FS_OpenDirectory(sdmc:/)");
}
else
{
FSDirectoryEntryInfo info[1];
// .dat を探す
while (FS_ReadDirectory(&dir, info))
{
if ((info->attributes & (FS_ATTRIBUTE_DOS_DIRECTORY | FS_ATTRIBUTE_IS_DIRECTORY)) == 0)
{
char* pExtension;
// 拡張子のチェック
pExtension = STD_SearchCharReverse( info->longname, '.');
if (pExtension)
{
if (!STD_CompareString( pExtension, ".dat") || !STD_CompareString( pExtension, ".DAT"))
{
if (!STD_CompareNString(info->longname, "TWLFontTable", STD_GetStringLength("TWLFontTable")))
{
MakeFullPathForSD(info->longname, full_path);
break;
}
}
}
}
}
(void)FS_CloseDirectory(&dir);
}
// ROMファイルオープン // ROMファイルオープン
FS_InitFile(&file); FS_InitFile(&file);
open_is_ok = FS_OpenFile(&file, FONT_DATA_FILE_PATH_IN_SDMC); open_is_ok = FS_OpenFile(&file, full_path);
if (!open_is_ok) if (!open_is_ok)
{ {
OS_Printf("FS_OpenFile(\"%s\") ... ERROR!\n", FONT_DATA_FILE_PATH_IN_SDMC); kamiFontPrintfConsoleEx(CONSOLE_RED, "FS_OpenFile(\"%s\") ... ERROR!\n", full_path);
return FALSE; return FALSE;
} }
@ -271,7 +309,7 @@ static BOOL WriteFontData(void)
read_is_ok = FS_ReadFile( &file, pTempBuf, (s32)file_size ); read_is_ok = FS_ReadFile( &file, pTempBuf, (s32)file_size );
if (!read_is_ok) if (!read_is_ok)
{ {
kamiFontPrintfConsoleEx(CONSOLE_RED, "FS_ReadFile(\"%s\") ... ERROR!\n", FONT_DATA_FILE_PATH_IN_SDMC); kamiFontPrintfConsoleEx(CONSOLE_RED, "FS_ReadFile(\"%s\") ... ERROR!\n", full_path);
FS_CloseFile(&file); FS_CloseFile(&file);
OS_Free(pTempBuf); OS_Free(pTempBuf);
return FALSE; return FALSE;

View File

@ -1,57 +0,0 @@
/*---------------------------------------------------------------------------*
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 <twl.h>
#include "kami_font.h"
#include <twl/fatfs.h>
#include <nitro/card.h>
#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");
}
}

View File

@ -37,7 +37,9 @@ LDIRT_CLEAN = HNAA.tad \
HNCA.tad \ HNCA.tad \
HNHA.tad \ HNHA.tad \
HNLA.tad \ HNLA.tad \
menu_launcher.nand menu_launcher.nand \
TWLFontTable.dat \
properties
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
@ -51,8 +53,8 @@ do-build : HNAA.tad \
HNCA.tad \ HNCA.tad \
HNHA.tad \ HNHA.tad \
HNLA.tad \ HNLA.tad \
menu_launcher.nand menu_launcher.nand \
TWLFontTable.dat
# maketad.updaterで作られたTADが他のフォルダに残らないように、ここでTAD化処理する。 # maketad.updaterで作られたTADが他のフォルダに残らないように、ここでTAD化処理する。
@ -74,4 +76,7 @@ HNLA.tad: $(SYSMENU_VERSION_DIR)/$(SYSMENU_VERSION_FILE)
menu_launcher.nand: ../../../nandfirm/menu-launcher/menu_launcher-$(TWL_BUILD_TYPE)-$(IPL_REVISION)-$(SDK_REVISION).nand menu_launcher.nand: ../../../nandfirm/menu-launcher/menu_launcher-$(TWL_BUILD_TYPE)-$(IPL_REVISION)-$(SDK_REVISION).nand
cp $< ./$@ cp $< ./$@
TWLFontTable.dat: ../../../systemMenu_RED/sharedFont/TWLFontTable_????????.dat
cp $< ./$@
#===== End of Makefile ===== #===== End of Makefile =====

View File

@ -40,8 +40,7 @@ SRCS = main.c \
font_data.c \ font_data.c \
graphics.c \ graphics.c \
keypad.c \ keypad.c \
kami_font.c \ kami_font.c
sd_event.c \
LINCLUDES = ../../NandInitializerRed/common/include \ LINCLUDES = ../../NandInitializerRed/common/include \
../../NandInitializerRed/ARM9.TWL/include ../../NandInitializerRed/ARM9.TWL/include