mirror of
https://github.com/rvtr/TwlIPL.git
synced 2025-10-31 06:01:12 -04:00
SystemMenuUpdaterとして全ての機能が実装完了。
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@2576 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
parent
bc0f2ba91c
commit
2b29416930
@ -68,8 +68,12 @@ SRCS = main.c \
|
||||
process_log.c \
|
||||
process_finish.c \
|
||||
process_import.c \
|
||||
process_write_files.c \
|
||||
process_write_font.c \
|
||||
process_write_cert.c \
|
||||
process_write_dummy.c \
|
||||
process_nandfirm.c \
|
||||
process_namut_format.c \
|
||||
process_delete_other_region_sysmenu.c \
|
||||
fade.c
|
||||
|
||||
LINCLUDES = include \
|
||||
|
||||
@ -26,10 +26,8 @@ extern "C" {
|
||||
|
||||
#include <twl.h>
|
||||
|
||||
#define WRAP_DATA_FILE_PATH_IN_NAND "nand:/shared2/launcher/wrap.bin"
|
||||
|
||||
BOOL kamiCopyFile(char* srcPath, char* dstPath);
|
||||
BOOL kamiWriteWrapData(void);
|
||||
BOOL kamiCreateDummyData(const char* path);
|
||||
|
||||
/*===========================================================================*/
|
||||
|
||||
|
||||
@ -47,6 +47,7 @@ typedef enum
|
||||
’è<EFBFBD>”’è‹`
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#define SYSTEM_UPDATER_NAME L"System Menu Updater ver.1.0"
|
||||
#define SYSTEM_UPDATER_LOG_PATH "nand:/sys/log/updater.log"
|
||||
#define SYSTEM_UPDATER_MAGIC_CODE 44001111
|
||||
|
||||
@ -75,12 +76,16 @@ extern BOOL ProcessHwinfo(void);
|
||||
extern void ProcessLog(void);
|
||||
extern void ProcessFinish(BOOL result);
|
||||
extern BOOL ProcessImport(void);
|
||||
extern BOOL ProcessWriteFiles(void);
|
||||
extern BOOL ProcessWriteFont(void);
|
||||
extern BOOL ProcessWriteCert(void);
|
||||
extern BOOL ProcessWriteDummy(void);
|
||||
extern BOOL FadeOutTick(void);
|
||||
extern BOOL FadeInTick(void);
|
||||
extern BOOL FadeInMaster(void);
|
||||
extern RunningConsole GetConsole(void);
|
||||
extern BOOL ProcessNandfirm(void);
|
||||
extern BOOL ProcessNamutFormat(void);
|
||||
extern BOOL ProcessDeleteOtherResionSysmenu(void);
|
||||
|
||||
/*===========================================================================*/
|
||||
|
||||
|
||||
@ -224,8 +224,8 @@ RomSpec
|
||||
Root /data
|
||||
File *
|
||||
HostRoot ../data
|
||||
Root /font
|
||||
File tbf_ww_s.NFTR
|
||||
Root /local
|
||||
File tbf_ww_s.NFTR cert.sys
|
||||
HostRoot $(PRIVKEY_PATH)
|
||||
Root /key
|
||||
File $(HWINFO_PRIVKEY) $(HWID_PRIVKEY)
|
||||
|
||||
@ -159,7 +159,7 @@ static void InitCanvas(void)
|
||||
void* pFontFile;
|
||||
u32 size;
|
||||
|
||||
size = LoadFile( &pFontFile, "/font/tbf_ww_s.NFTR" );
|
||||
size = LoadFile( &pFontFile, "/local/tbf_ww_s.NFTR" );
|
||||
NNS_G2D_ASSERT( size > 0 );
|
||||
|
||||
NNS_G2dFontInitUTF16(&gFont, pFontFile);
|
||||
@ -297,14 +297,8 @@ void UpdateFreePltt(u16 color)
|
||||
*---------------------------------------------------------------------------*/
|
||||
void InitFont(void)
|
||||
{
|
||||
char string1[256];
|
||||
u16 string2[256];
|
||||
|
||||
InitCanvas();
|
||||
|
||||
MI_CpuClear8(string1, sizeof(string1));
|
||||
MI_CpuClear8(string2, sizeof(string2));
|
||||
|
||||
OS_WaitVBlankIntr();
|
||||
NNS_G2dCharCanvasClear(&gCanvas, TXT_COLOR_WHITE);
|
||||
OS_WaitVBlankIntr();
|
||||
@ -312,11 +306,8 @@ void InitFont(void)
|
||||
OS_WaitVBlankIntr();
|
||||
NNS_G2dCharCanvasClearArea(&gCanvas2, TXT_COLOR_BLACK, 0, 0, 256, 30);
|
||||
|
||||
STD_TSPrintf(string1, "System Updater rev.%s-%s", g_strSDKSvnRevision, g_strIPLSvnRevision);
|
||||
STD_ConvertStringSjisToUnicode(string2, NULL, string1, NULL, NULL);
|
||||
|
||||
NNS_G2dTextCanvasDrawText(&gTextCanvas2, 30, 6,
|
||||
NNS_G2dTextCanvasDrawText(&gTextCanvas2, 39, 6,
|
||||
TXT_COLOR_BLACK_BASE, TXT_DRAWTEXT_FLAG_DEFAULT,
|
||||
(const char *)string2
|
||||
(const char *)SYSTEM_UPDATER_NAME
|
||||
);
|
||||
}
|
||||
|
||||
@ -103,8 +103,8 @@ BOOL kamiCopyFile(char* srcPath, char* dstPath)
|
||||
return result;
|
||||
}
|
||||
|
||||
// ダミーのDSメニューラッピング用ファイル作成(UIGランチャーが作っているもの)
|
||||
BOOL kamiWriteWrapData(void)
|
||||
// ダミーファイル作成
|
||||
BOOL kamiCreateDummyData(const char* path)
|
||||
{
|
||||
FSFile file;
|
||||
BOOL open_is_ok;
|
||||
@ -112,18 +112,18 @@ BOOL kamiWriteWrapData(void)
|
||||
|
||||
// 既に存在するなら何もしない
|
||||
FS_InitFile(&file);
|
||||
open_is_ok = FS_OpenFile(&file, WRAP_DATA_FILE_PATH_IN_NAND);
|
||||
open_is_ok = FS_OpenFile(&file, path);
|
||||
if (open_is_ok)
|
||||
{
|
||||
FS_CloseFile(&file);
|
||||
OS_Printf("%s is already exist.\n", WRAP_DATA_FILE_PATH_IN_NAND);
|
||||
OS_Printf("%s is already exist.\n", path);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if( FS_CreateFileAuto( WRAP_DATA_FILE_PATH_IN_NAND, FS_PERMIT_R | FS_PERMIT_W ) )
|
||||
if( FS_CreateFileAuto( path, FS_PERMIT_R | FS_PERMIT_W ) )
|
||||
{
|
||||
FSFile file;
|
||||
if( FS_OpenFileEx( &file, WRAP_DATA_FILE_PATH_IN_NAND, FS_FILEMODE_RW ) )
|
||||
if( FS_OpenFileEx( &file, path, FS_FILEMODE_RW ) )
|
||||
{
|
||||
(void)FS_SetFileLength( &file, FATFS_CLUSTER_SIZE );
|
||||
FS_CloseFile( &file );
|
||||
|
||||
@ -96,6 +96,7 @@ TwlMain()
|
||||
GX_Init();
|
||||
FX_Init();
|
||||
SND_Init();
|
||||
SNDEX_Init();
|
||||
TP_Init();
|
||||
RTC_Init();
|
||||
|
||||
@ -172,24 +173,33 @@ TwlMain()
|
||||
|
||||
result = TRUE;
|
||||
|
||||
// フォーマット
|
||||
// result &= ProcessFormat();
|
||||
// NANDのフォーマットが古ければフォーマット
|
||||
result &= ProcessFormat();
|
||||
|
||||
// 全ハードウェア情報の更新
|
||||
result &= ProcessHwinfo();
|
||||
|
||||
// 必要なファイルの書き込み
|
||||
result &= ProcessWriteFiles();
|
||||
// フォントの書き込み
|
||||
result &= ProcessWriteFont();
|
||||
|
||||
// ダミーのラッピングデータ書き込み
|
||||
// result &= kamiWriteWrapData();
|
||||
// cert.sysの書き込み
|
||||
result &= ProcessWriteCert();
|
||||
|
||||
// ダミーファイルの生成
|
||||
result &= ProcessWriteDummy();
|
||||
|
||||
// TADのインポート開始
|
||||
result &= ProcessImport();
|
||||
|
||||
// 選択リージョン以外のSystemMenuの消去を行う
|
||||
result &= ProcessDeleteOtherResionSysmenu();
|
||||
|
||||
// NANDファームのインストール開始
|
||||
result &= ProcessNandfirm();
|
||||
|
||||
// 本体初期化を行う
|
||||
result &= ProcessNamutFormat();
|
||||
|
||||
// 更新ログを作成してVersionDownを防ぐ
|
||||
if (result)
|
||||
{
|
||||
|
||||
@ -0,0 +1,146 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: SystemUpdater
|
||||
File: process_delete_tad.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/lcfg.h>
|
||||
#include <sysmenu/namut.h>
|
||||
#include "kami_font.h"
|
||||
#include "hw_info.h"
|
||||
#include "TWLHWInfo_api.h"
|
||||
#include "graphics.h"
|
||||
#include "kami_global.h"
|
||||
#include "font.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
型定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
定数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
#define TITLE_ID_MUST_ERASE_NUM 3
|
||||
#define TITLE_ID_LIST_NUM 4
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
内部変数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
static const u64 sTitleIdListMust[TITLE_ID_MUST_ERASE_NUM] =
|
||||
{
|
||||
0x00030017484e4141, // ALL HNAA
|
||||
0x00030015484e4241, // ALL HNBA
|
||||
0x0003000f484e4c41, // ALL HNLA
|
||||
};
|
||||
|
||||
static const u64 sTitleIdListHNA[TITLE_ID_LIST_NUM] =
|
||||
{
|
||||
0x00030017484e414A, // Japan HNAJ
|
||||
0x00030017484e4145, // America HNAE
|
||||
0x00030017484e4150, // Europe HNAP
|
||||
0x00030017484e4155, // Australia HNAU
|
||||
};
|
||||
|
||||
static const u64 sTitleIdListHNB[TITLE_ID_LIST_NUM] =
|
||||
{
|
||||
0x00030015484e424A, // Japan HNBJ
|
||||
0x00030015484e4245, // America HNBE
|
||||
0x00030015484e4250, // Europe HNBP
|
||||
0x00030015484e4255, // Australia HNBU
|
||||
};
|
||||
|
||||
static const u64 sTitleIdListHNL[TITLE_ID_LIST_NUM] =
|
||||
{
|
||||
0x0003000f484e4c4A, // Japan HNLJ
|
||||
0x0003000f484e4c45, // America HNLE
|
||||
0x0003000f484e4c50, // Europe HNLP
|
||||
0x0003000f484e4c55, // Australia HNLU
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
内部関数宣言
|
||||
*---------------------------------------------------------------------------*/
|
||||
static BOOL DeleteTitle(u64 titleId);
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
処理関数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: ProcessDeleteOtherResionSysmenu
|
||||
|
||||
Description: 選択リージョン以外のSystemMenuを消去する。
|
||||
ユーザーアプリは本体初期化の際に消去される。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
BOOL ProcessDeleteOtherResionSysmenu(void)
|
||||
{
|
||||
s32 i;
|
||||
BOOL ret = TRUE;
|
||||
|
||||
// ランチャーと本体設定とSysMenuバージョンのALL版は全て消去する
|
||||
for (i=0;i<TITLE_ID_MUST_ERASE_NUM;i++)
|
||||
{
|
||||
ret = DeleteTitle( sTitleIdListMust[i] );
|
||||
}
|
||||
|
||||
// 選択リージョンと異なるランチャーは消去する
|
||||
for (i=0;i<TITLE_ID_LIST_NUM;i++)
|
||||
{
|
||||
if (i != gRegion)
|
||||
{
|
||||
ret = DeleteTitle( sTitleIdListHNA[i] );
|
||||
}
|
||||
}
|
||||
|
||||
// 選択リージョンと異なる本体設定は消去する
|
||||
for (i=0;i<TITLE_ID_LIST_NUM;i++)
|
||||
{
|
||||
if (i != gRegion)
|
||||
{
|
||||
ret = DeleteTitle( sTitleIdListHNB[i] );
|
||||
}
|
||||
}
|
||||
|
||||
// 選択リージョンと異なるSysMenuバージョンは消去する
|
||||
for (i=0;i<TITLE_ID_LIST_NUM;i++)
|
||||
{
|
||||
if (i != gRegion)
|
||||
{
|
||||
ret = DeleteTitle( sTitleIdListHNL[i] );
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static BOOL DeleteTitle(u64 titleId)
|
||||
{
|
||||
s32 nam_result = NAM_DeleteTitleCompletely( titleId );
|
||||
if ( nam_result != NAM_OK )
|
||||
{
|
||||
kamiFontPrintfConsole(CONSOLE_RED, "tad delete Fail! RetCode=%x\n", nam_result);
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@ -38,6 +38,7 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
内部定数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
#define CORRECT_NAND_ARCHIVE_SIZE 0xcde0000
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
内部変数定義
|
||||
@ -61,11 +62,27 @@ static void FormatCallback(KAMIResult result, void* arg);
|
||||
*---------------------------------------------------------------------------*/
|
||||
BOOL ProcessFormat(void)
|
||||
{
|
||||
NNS_G2dCharCanvasClear(&gCanvas, TXT_COLOR_BLACK);
|
||||
NNS_G2dCharCanvasClearArea(&gCanvas, TXT_COLOR_WHITE, 0, 30, 256, 100);
|
||||
FSArchiveResource resource;
|
||||
|
||||
NNS_G2dTextCanvasDrawText(&gTextCanvas, 40, 60,
|
||||
TXT_COLOR_WHITE_BASE, TXT_DRAWTEXT_FLAG_DEFAULT, "Now Format");
|
||||
// 既に最新フォーマットであればフォーマットしない
|
||||
if (FS_GetArchiveResource("nand:/", &resource))
|
||||
{
|
||||
if (resource.totalSize == CORRECT_NAND_ARCHIVE_SIZE)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
OS_WaitVBlankIntr();
|
||||
NNS_G2dCharCanvasClearArea(&gCanvas, TXT_COLOR_WHITE, 0, 30, 256, 100);
|
||||
OS_WaitVBlankIntr();
|
||||
NNS_G2dCharCanvasClearArea(&gCanvas2, TXT_COLOR_BLACK, 0, 130, 256, 62);
|
||||
OS_WaitVBlankIntr();
|
||||
|
||||
NNS_G2dTextCanvasDrawText(&gTextCanvas, 74, 72,
|
||||
TXT_COLOR_WHITE_BASE, TXT_DRAWTEXT_FLAG_DEFAULT, (const char*)
|
||||
L"Now Format Nand.."
|
||||
);
|
||||
|
||||
// フォーマット実行
|
||||
sIsFormatFinish = FALSE;
|
||||
@ -78,6 +95,7 @@ BOOL ProcessFormat(void)
|
||||
G3_PolygonAttr(GX_LIGHTMASK_NONE, GX_POLYGONMODE_DECAL, GX_CULL_NONE, 0, 31, 0);
|
||||
G3_SwapBuffers(GX_SORTMODE_AUTO, GX_BUFFERMODE_W);
|
||||
OS_WaitVBlankIntr();
|
||||
FadeInTick();
|
||||
|
||||
if (sIsFormatFinish) break;
|
||||
}
|
||||
@ -96,6 +114,11 @@ BOOL ProcessFormat(void)
|
||||
NAM_End( NULL, NULL );
|
||||
NAM_Init( OS_AllocFromMain, OS_FreeToMain );
|
||||
|
||||
while (!FadeOutTick())
|
||||
{
|
||||
OS_WaitVBlankIntr();
|
||||
}
|
||||
|
||||
return sFormatResult;
|
||||
}
|
||||
|
||||
|
||||
@ -68,7 +68,7 @@ static u8 sStack[THREAD_STACK_SIZE];
|
||||
内部関数宣言
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
static s32 kamiImportTad(const char* path);
|
||||
static s32 kamiImportTad(const char* path, BOOL erase);
|
||||
static void ProgressThread(void* arg);
|
||||
static void Destructor(void* arg);
|
||||
void ProgressDraw(f32 ratio);
|
||||
@ -101,6 +101,8 @@ BOOL ProcessImport(void)
|
||||
OS_WaitVBlankIntr();
|
||||
NNS_G2dCharCanvasClearArea(&gCanvas2, TXT_COLOR_BLACK, 0, 130, 256, 62);
|
||||
OS_WaitVBlankIntr();
|
||||
NNS_G2dTextCanvasDrawText(&gTextCanvas, 40, 60,
|
||||
TXT_COLOR_WHITE_BASE, TXT_DRAWTEXT_FLAG_DEFAULT, (const char*)L"Now Import..");
|
||||
|
||||
while(!FadeInTick())
|
||||
{
|
||||
@ -156,24 +158,24 @@ BOOL ProcessImport(void)
|
||||
// MAX_RETRY_COUNTまでリトライする
|
||||
for (j=0; j<MAX_RETRY_COUNT; j++)
|
||||
{
|
||||
nam_result = kamiImportTad(full_path);
|
||||
nam_result = kamiImportTad(full_path, j);
|
||||
if (nam_result == NAM_OK)
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
kamiFontPrintfConsole(CONSOLE_RED, "Import %d Retry!\n", i+1);
|
||||
kamiFontPrintfConsole(CONSOLE_GREEN, "Import %d Retry!\n", i);
|
||||
}
|
||||
}
|
||||
|
||||
if ( nam_result == NAM_OK)
|
||||
{
|
||||
kamiFontPrintfConsole(FONT_COLOR_GREEN, "List : %d Import Success.\n", i+1 );
|
||||
kamiFontPrintfConsole(FONT_COLOR_GREEN, "List : %d Import Success.\n", i);
|
||||
}
|
||||
else
|
||||
{
|
||||
kamiFontPrintfConsole(FONT_COLOR_RED, "Error: %d : RetCode = %d\n", i+1, nam_result );
|
||||
kamiFontPrintfConsole(FONT_COLOR_RED, "Error: %d : RetCode = %d\n", i, nam_result );
|
||||
result = FALSE;
|
||||
}
|
||||
|
||||
@ -200,7 +202,7 @@ BOOL ProcessImport(void)
|
||||
|
||||
Returns: None.
|
||||
*---------------------------------------------------------------------------*/
|
||||
static s32 kamiImportTad(const char* path)
|
||||
static s32 kamiImportTad(const char* path, BOOL erase)
|
||||
{
|
||||
NAMTadInfo tadInfo;
|
||||
OSThread thread;
|
||||
@ -215,11 +217,14 @@ static s32 kamiImportTad(const char* path)
|
||||
|
||||
// ESの仕様で古い e-ticket があると新しい e-ticket を使ったインポートができない
|
||||
// 暫定対応として該当タイトルを完全削除してからインポートする
|
||||
nam_result = NAM_DeleteTitleCompletely(tadInfo.titleInfo.titleId);
|
||||
if ( nam_result != NAM_OK )
|
||||
if (erase)
|
||||
{
|
||||
kamiFontPrintfConsole(CONSOLE_RED, "Fail! RetCode=%x\n", nam_result);
|
||||
return FALSE;
|
||||
nam_result = NAM_DeleteTitleCompletely(tadInfo.titleInfo.titleId);
|
||||
if ( nam_result != NAM_OK )
|
||||
{
|
||||
kamiFontPrintfConsole(CONSOLE_RED, "Fail! RetCode=%x\n", nam_result);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
// インポート開始フラグを立てる
|
||||
|
||||
@ -0,0 +1,96 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: SystemUpdater
|
||||
File: process_namut_format.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 <stdlib.h> // atoi
|
||||
#include <twl.h>
|
||||
#include <twl/nam.h>
|
||||
#include <sysmenu/namut.h>
|
||||
#include "font.h"
|
||||
#include "graphics.h"
|
||||
#include "keypad.h"
|
||||
#include "debugger_hw_reset_control.h"
|
||||
#include "debugger_card_rom.h"
|
||||
#include "kami_global.h"
|
||||
#include "kami_pxi.h"
|
||||
#include "kami_font.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
型定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
グローバル変数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
内部定数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
内部変数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
内部関数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: ProcessNamutFormat
|
||||
|
||||
Description:
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
BOOL ProcessNamutFormat(void)
|
||||
{
|
||||
BOOL result;
|
||||
|
||||
OS_WaitVBlankIntr();
|
||||
NNS_G2dCharCanvasClearArea(&gCanvas, TXT_COLOR_WHITE, 0, 30, 256, 100);
|
||||
OS_WaitVBlankIntr();
|
||||
NNS_G2dCharCanvasClearArea(&gCanvas2, TXT_COLOR_BLACK, 0, 130, 256, 62);
|
||||
OS_WaitVBlankIntr();
|
||||
|
||||
NNS_G2dTextCanvasDrawText(&gTextCanvas, 50, 72,
|
||||
TXT_COLOR_WHITE_BASE, TXT_DRAWTEXT_FLAG_DEFAULT, (const char*)
|
||||
L"Format System Memory.."
|
||||
);
|
||||
|
||||
while(!FadeInTick())
|
||||
{
|
||||
G3X_Reset();
|
||||
G3_Identity();
|
||||
G3_PolygonAttr(GX_LIGHTMASK_NONE, GX_POLYGONMODE_DECAL, GX_CULL_NONE, 0, 31, 0);
|
||||
G3_SwapBuffers(GX_SORTMODE_AUTO, GX_BUFFERMODE_W);
|
||||
OS_WaitVBlankIntr();
|
||||
}
|
||||
|
||||
result = NAMUT_Format();
|
||||
|
||||
while (!FadeOutTick())
|
||||
{
|
||||
G3X_Reset();
|
||||
G3_Identity();
|
||||
G3_PolygonAttr(GX_LIGHTMASK_NONE, GX_POLYGONMODE_DECAL, GX_CULL_NONE, 0, 31, 0);
|
||||
G3_SwapBuffers(GX_SORTMODE_AUTO, GX_BUFFERMODE_W);
|
||||
OS_WaitVBlankIntr();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
@ -0,0 +1,86 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: SystemUpdater
|
||||
File: process_write_cert.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 "font.h"
|
||||
#include "graphics.h"
|
||||
#include "keypad.h"
|
||||
#include "debugger_hw_reset_control.h"
|
||||
#include "debugger_card_rom.h"
|
||||
#include "kami_global.h"
|
||||
#include "kami_copy_file.h"
|
||||
#include "kami_font.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
型定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
typedef struct _CopyFileList
|
||||
{
|
||||
char* srcPath;
|
||||
char* dstPath;
|
||||
} CopyFileList;
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
グローバル変数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
内部定数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
static const CopyFileList sCertList =
|
||||
{
|
||||
"rom:/local/cert.sys", "nand:/sys/cert.sys"
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
内部変数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
内部関数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: ProcessWriteCert
|
||||
|
||||
Description:
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
BOOL ProcessWriteCert(void)
|
||||
{
|
||||
BOOL ret;
|
||||
|
||||
ret = kamiCopyFile(sCertList.srcPath, sCertList.dstPath);
|
||||
|
||||
if (ret)
|
||||
{
|
||||
kamiFontPrintfConsole(FONT_COLOR_GREEN, "Write Data2 Success.\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
kamiFontPrintfConsole(FONT_COLOR_RED, "Write Data2 Failure!\n");
|
||||
}
|
||||
|
||||
OS_WaitVBlankIntr();
|
||||
kamiFontLoadScreenData();
|
||||
return ret;
|
||||
}
|
||||
@ -0,0 +1,81 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: SystemUpdater
|
||||
File: process_write_dummy.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 "font.h"
|
||||
#include "graphics.h"
|
||||
#include "keypad.h"
|
||||
#include "debugger_hw_reset_control.h"
|
||||
#include "debugger_card_rom.h"
|
||||
#include "kami_global.h"
|
||||
#include "kami_copy_file.h"
|
||||
#include "kami_font.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
型定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
グローバル変数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
内部定数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
#define DUMMY_FILE_NUM 2
|
||||
|
||||
static const char* sDummyFileList[DUMMY_FILE_NUM] =
|
||||
{
|
||||
"nand:/shared2/launcher/wrap.bin", // ないと本体初期化でこける
|
||||
"nand:/sys/dev.kp" // ないとアプリ管理画面が表示されない
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
内部変数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
内部関数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: ProcessWriteDummy
|
||||
|
||||
Description:
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
BOOL ProcessWriteDummy(void)
|
||||
{
|
||||
BOOL ret = TRUE;
|
||||
s32 i;
|
||||
|
||||
for (i=0;i<DUMMY_FILE_NUM;i++)
|
||||
{
|
||||
if (!kamiCreateDummyData(sDummyFileList[i]))
|
||||
{
|
||||
kamiFontPrintfConsole(FONT_COLOR_RED, "Write Dummy %d Fail!\n", i);
|
||||
ret = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
OS_WaitVBlankIntr();
|
||||
kamiFontLoadScreenData();
|
||||
return ret;
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: SystemUpdater
|
||||
File: process_write_files.c
|
||||
File: process_write_font.c
|
||||
|
||||
Copyright 2008 Nintendo. All rights reserved.
|
||||
|
||||
@ -58,7 +58,7 @@ static const CopyFileList sCopyFileList[] =
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: ProcessWriteFiles
|
||||
Name: ProcessWriteFont
|
||||
|
||||
Description:
|
||||
|
||||
@ -66,7 +66,7 @@ static const CopyFileList sCopyFileList[] =
|
||||
|
||||
Returns: ‚È‚µ<EFBFBD>B
|
||||
*---------------------------------------------------------------------------*/
|
||||
BOOL ProcessWriteFiles(void)
|
||||
BOOL ProcessWriteFont(void)
|
||||
{
|
||||
FSFile dir;
|
||||
FSDirectoryEntryInfo info[1];
|
||||
@ -122,12 +122,12 @@ BOOL ProcessWriteFiles(void)
|
||||
{
|
||||
if (kamiCopyFile(full_path, "nand:sys/TWLFontTable.dat"))
|
||||
{
|
||||
kamiFontPrintfConsole(FONT_COLOR_GREEN, "Write Font Data Success.\n");
|
||||
kamiFontPrintfConsole(FONT_COLOR_GREEN, "Write Data1 Success.\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
result = FALSE;
|
||||
kamiFontPrintfConsole(FONT_COLOR_RED, "Write Font Data Failure!\n");
|
||||
kamiFontPrintfConsole(FONT_COLOR_RED, "Write Data1 Failure!\n");
|
||||
}
|
||||
}
|
||||
|
||||
BIN
build/systemMenu_tools/SystemUpdaterRegionSelect/data/cert.sys
Normal file
BIN
build/systemMenu_tools/SystemUpdaterRegionSelect/data/cert.sys
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user