mirror of
https://github.com/rvtr/TwlIPL.git
synced 2025-10-31 06:01:12 -04:00
InstalledSoftBoxCount FreeSoftBoxCount の対応作業を行いました。
FreeSoftBoxCountに空きが無い場合はインポートできないようにしました。 HWInfoの削除メニューをなくしました。 git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@984 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
parent
0460e64d9b
commit
ddb34e418b
@ -11,8 +11,8 @@
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Date:: $
|
||||
$Rev:$
|
||||
$Author:$
|
||||
$Rev$
|
||||
$Author$
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef PROCESS_HW_INFO_H_
|
||||
@ -42,6 +42,18 @@ void* HWInfoProcess2(void);
|
||||
void* HWInfoProcess3(void);
|
||||
void* HWInfoProcess4(void);
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: UpdateNandBoxCount
|
||||
|
||||
Description: InstalledSoftBoxCount, FreeSoftBoxCount の値を
|
||||
現在のNANDの状態に合わせて更新します。
|
||||
|
||||
Arguments: None.
|
||||
|
||||
Returns: None.
|
||||
*---------------------------------------------------------------------------*/
|
||||
void UpdateNandBoxCount( void );
|
||||
|
||||
/*===========================================================================*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@ -28,6 +28,8 @@
|
||||
#include "kami_pxi.h"
|
||||
#include "sd_event.h"
|
||||
#include "process_fade.h"
|
||||
#include "hwi.h"
|
||||
|
||||
extern void HWInfoWriterInit( void );
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
@ -116,6 +118,23 @@ TwlMain()
|
||||
#endif
|
||||
kamiFontPrintfConsole( CONSOLE_ORANGE, "+---------------------------+\n");
|
||||
|
||||
// HWInfoŠÖ˜A‚Ì‘O<E28098>€”õ
|
||||
switch (HWI_Init( OS_AllocFromMain, OS_FreeToMain ))
|
||||
{
|
||||
case HWI_INIT_FAILURE:
|
||||
kamiFontPrintfConsoleEx(CONSOLE_RED, "HWI_INIT() Failure!\n" );
|
||||
break;
|
||||
case HWI_INIT_SUCCESS_PRO_SIGNATURE_MODE:
|
||||
kamiFontPrintfConsoleEx(CONSOLE_ORANGE, "[PRO Signature MODE]\n" );
|
||||
break;
|
||||
case HWI_INIT_SUCCESS_DEV_SIGNATURE_MODE:
|
||||
kamiFontPrintfConsoleEx(CONSOLE_ORANGE, "[DEV Signature MODE]\n" );
|
||||
break;
|
||||
case HWI_INIT_SUCCESS_NO_SIGNATRUE_MODE:
|
||||
kamiFontPrintfConsoleEx(CONSOLE_RED, "[No Signature MODE]\n" );
|
||||
break;
|
||||
}
|
||||
|
||||
while (1)
|
||||
{
|
||||
kamiPadRead();
|
||||
|
||||
@ -153,7 +153,9 @@ void* AutoProcess2(void)
|
||||
kamiFontPrintf(3, 11, FONT_COLOR_BLACK, " WRITE ETICKET SIGN ");
|
||||
kamiFontPrintf(3, 13, FONT_COLOR_BLACK, " INPORT TAD FROM SD ");
|
||||
kamiFontPrintf(3, 15, FONT_COLOR_BLACK, " INPORT NANDFIRM FROM SD");
|
||||
#ifndef AUTO_FORMAT_MODE
|
||||
kamiFontPrintf(3, 22, FONT_COLOR_BLACK, " Button B : return to menu");
|
||||
#endif
|
||||
|
||||
for (i=0;i<sMenuSelectNo-1;i++)
|
||||
{
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
#include "kami_pxi.h"
|
||||
#include "process_topmenu.h"
|
||||
#include "process_format.h"
|
||||
#include "process_hw_info.h"
|
||||
#include "process_auto.h"
|
||||
#include "process_fade.h"
|
||||
#include "cursor.h"
|
||||
@ -35,7 +36,7 @@
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
enum {
|
||||
MENU_EASY_FORMAT=0,
|
||||
MENU_CLEAN_UP=0,
|
||||
MENU_CHECK_DISK,
|
||||
#ifndef NAND_FORMATTER_MODE
|
||||
MENU_NORMAL_FORMAT,
|
||||
@ -198,7 +199,7 @@ void* FormatProcess2(void)
|
||||
|
||||
switch( sMenuSelectNo )
|
||||
{
|
||||
case MENU_EASY_FORMAT: // 簡易フォーマット
|
||||
case MENU_CLEAN_UP: // 簡易フォーマット
|
||||
#ifdef DUMP_NAND_TREE
|
||||
OS_Printf("---------------------------------------\n");
|
||||
OS_Printf(" Before \n");
|
||||
@ -223,7 +224,12 @@ void* FormatProcess2(void)
|
||||
OS_Printf("---------------------------------------\n");
|
||||
NAMUT_DrawNandTree();
|
||||
#endif
|
||||
|
||||
// InstalledSoftBoxCount, FreeSoftBoxCount の値を現在のNANDの状態に合わせて更新します。
|
||||
UpdateNandBoxCount();
|
||||
|
||||
return FormatProcess1;
|
||||
|
||||
case MENU_CHECK_DISK: // ƒ`ƒFƒbƒNƒfƒBƒXƒN
|
||||
{
|
||||
FATFSDiskInfo info;
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
#include <twl/fatfs.h>
|
||||
#include <twl/lcfg.h>
|
||||
#include <nitro/card.h>
|
||||
#include <sysmenu/namut.h>
|
||||
#include "kami_font.h"
|
||||
#include "kami_pxi.h"
|
||||
#include "process_topmenu.h"
|
||||
@ -42,7 +43,7 @@
|
||||
定数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#define NUM_OF_MENU_SELECT 8
|
||||
#define NUM_OF_MENU_SELECT 7
|
||||
#define DOT_OF_MENU_SPACE 16
|
||||
#define CHAR_OF_MENU_SPACE 2
|
||||
#define CURSOR_ORIGIN_X 32
|
||||
@ -94,7 +95,7 @@ static BOOL s_isReadTSD;
|
||||
static BOOL WriteHWInfoFile( u8 region );
|
||||
static BOOL WriteHWNormalInfoFile( void );
|
||||
static BOOL WriteHWSecureInfoFile( u8 region );
|
||||
static BOOL DeleteHWInfoFile( void );
|
||||
//static BOOL DeleteHWInfoFile( void );
|
||||
|
||||
const LCFGTWLHWNormalInfo *LCFG_THW_GetDefaultNormalInfo( void );
|
||||
const LCFGTWLHWSecureInfo *LCFG_THW_GetDefaultSecureInfo( void );
|
||||
@ -117,7 +118,6 @@ const LCFGTWLHWSecureInfo *LCFG_THW_GetSecureInfo( void );
|
||||
|
||||
void* HWInfoProcess0(void)
|
||||
{
|
||||
HwiInitResult initResult;
|
||||
int i;
|
||||
|
||||
// 文字列全クリア
|
||||
@ -141,10 +141,10 @@ void* HWInfoProcess0(void)
|
||||
kamiFontPrintf(3, 16, FONT_COLOR_BLACK, "+--------------------+----+");
|
||||
kamiFontPrintf(3, 17, FONT_COLOR_BLACK, "l REGION KOREA l l");
|
||||
kamiFontPrintf(3, 18, FONT_COLOR_BLACK, "+--------------------+----+");
|
||||
kamiFontPrintf(3, 19, FONT_COLOR_BLACK, "l DELETE l l");
|
||||
// kamiFontPrintf(3, 19, FONT_COLOR_BLACK, "l DELETE l l");
|
||||
// kamiFontPrintf(3, 20, FONT_COLOR_BLACK, "+--------------------+----+");
|
||||
kamiFontPrintf(3, 19, FONT_COLOR_BLACK, "l RETURN l l");
|
||||
kamiFontPrintf(3, 20, FONT_COLOR_BLACK, "+--------------------+----+");
|
||||
kamiFontPrintf(3, 21, FONT_COLOR_BLACK, "l RETURN l l");
|
||||
kamiFontPrintf(3, 22, FONT_COLOR_BLACK, "+--------------------+----+");
|
||||
|
||||
// 背景全クリア
|
||||
for (i=0;i<24;i++)
|
||||
@ -160,24 +160,6 @@ void* HWInfoProcess0(void)
|
||||
// カーソル除外
|
||||
SetCursorPos((u16)200, (u16)200);
|
||||
|
||||
// ‘O<E28098>€”õ
|
||||
initResult = HWI_Init( OS_AllocFromMain, OS_FreeToMain );
|
||||
switch (initResult)
|
||||
{
|
||||
case HWI_INIT_FAILURE:
|
||||
kamiFontPrintfConsoleEx(CONSOLE_RED, "HWI_INIT() Failure!\n" );
|
||||
break;
|
||||
case HWI_INIT_SUCCESS_PRO_SIGNATURE_MODE:
|
||||
kamiFontPrintfConsoleEx(CONSOLE_ORANGE, "[PRO Signature MODE]\n" );
|
||||
break;
|
||||
case HWI_INIT_SUCCESS_DEV_SIGNATURE_MODE:
|
||||
kamiFontPrintfConsoleEx(CONSOLE_ORANGE, "[DEV Signature MODE]\n" );
|
||||
break;
|
||||
case HWI_INIT_SUCCESS_NO_SIGNATRUE_MODE:
|
||||
kamiFontPrintfConsoleEx(CONSOLE_RED, "[No Signature MODE]\n" );
|
||||
break;
|
||||
}
|
||||
|
||||
FADE_IN_RETURN( HWInfoProcess1 );
|
||||
}
|
||||
|
||||
@ -255,11 +237,11 @@ void* HWInfoProcess2(void)
|
||||
OS_TPrintf( "Write Start.\n" );
|
||||
result = WriteHWInfoFile( (u8)sMenuSelectNo );
|
||||
break;
|
||||
// case 6:
|
||||
// OS_TPrintf( "Delete start.\n" );
|
||||
// result = DeleteHWInfoFile();
|
||||
// break;
|
||||
case 6:
|
||||
OS_TPrintf( "Delete start.\n" );
|
||||
result = DeleteHWInfoFile();
|
||||
break;
|
||||
case 7:
|
||||
FADE_OUT_RETURN( TopmenuProcess0 );
|
||||
}
|
||||
|
||||
@ -311,6 +293,7 @@ static BOOL WriteHWInfoFile( u8 region )
|
||||
static const char *pMsgSignWriting = "Writing Sign File...";
|
||||
static const char *pMsgSucceeded = "Success!\n";
|
||||
static const char *pMsgFailed = "Failed!\n";
|
||||
u32 installedSoftBoxCount = 0;
|
||||
BOOL result = TRUE;
|
||||
|
||||
// ノーマルファイルのライト
|
||||
@ -344,6 +327,9 @@ static BOOL WriteHWInfoFile( u8 region )
|
||||
}
|
||||
|
||||
HWI_ModifyLanguage( region );
|
||||
|
||||
// InstalledSoftBoxCount, FreeSoftBoxCount の値を現在のNANDの状態に合わせて更新します。
|
||||
UpdateNandBoxCount();
|
||||
|
||||
return result;
|
||||
}
|
||||
@ -390,3 +376,41 @@ static BOOL DeleteHWInfoFile( void )
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: UpdateNandBoxCount
|
||||
|
||||
Description: InstalledSoftBoxCount, FreeSoftBoxCount の値を
|
||||
現在のNANDの状態に合わせて更新します。
|
||||
|
||||
Arguments: None.
|
||||
|
||||
Returns: None.
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
void UpdateNandBoxCount( void )
|
||||
{
|
||||
u32 installedSoftBoxCount;
|
||||
u32 freeSoftBoxCount;
|
||||
|
||||
// InstalledSoftBoxCount, FreeSoftBoxCount を数えなおす
|
||||
installedSoftBoxCount = NAMUT_SearchInstalledSoftBoxCount();
|
||||
freeSoftBoxCount = LCFG_TWL_FREE_SOFT_BOX_COUNT_MAX - installedSoftBoxCount;
|
||||
|
||||
// OS_Printf("installedSoftBoxCount = %d\n", installedSoftBoxCount);
|
||||
// OS_Printf("freeSoftBoxCount = %d\n", freeSoftBoxCount);
|
||||
|
||||
// LCFGライブラリの静的変数に対する更新
|
||||
LCFG_TSD_SetInstalledSoftBoxCount( (u8)installedSoftBoxCount );
|
||||
LCFG_TSD_SetFreeSoftBoxCount( (u8)freeSoftBoxCount );
|
||||
|
||||
// LCFGライブラリの静的変数の値をNANDに反映
|
||||
{
|
||||
u8 *pBuffer = OS_Alloc( LCFG_WRITE_TEMP );
|
||||
if( pBuffer ) {
|
||||
(void)LCFG_WriteTWLSettings( (u8 (*)[ LCFG_WRITE_TEMP ] )pBuffer );
|
||||
OS_Free( pBuffer );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -20,10 +20,13 @@
|
||||
#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 "kami_pxi.h"
|
||||
#include "process_topmenu.h"
|
||||
#include "process_import.h"
|
||||
#include "process_hw_info.h"
|
||||
#include "process_eticket.h"
|
||||
#include "process_auto.h"
|
||||
#include "process_fade.h"
|
||||
@ -675,6 +678,17 @@ static BOOL ImportTad(char* file_name, TadWriteOption option)
|
||||
}
|
||||
}
|
||||
|
||||
// NOT_LAUNCH_FLAG または DATA_ONLY_FLAG が立っていないタイトルの場合
|
||||
// freeSoftBoxCountに空きがなければインポートしない
|
||||
if (!(titleInfo.titleId & (TITLE_ID_NOT_LAUNCH_FLAG_MASK | TITLE_ID_DATA_ONLY_FLAG_MASK)))
|
||||
{
|
||||
if (NAMUT_SearchInstalledSoftBoxCount() == LCFG_TWL_FREE_SOFT_BOX_COUNT_MAX)
|
||||
{
|
||||
kamiFontPrintfConsole(1, "NAND FreeSoftBoxCount == 0");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
// インポート開始フラグを立てる
|
||||
sNowImport = TRUE;
|
||||
|
||||
@ -698,14 +712,17 @@ static BOOL ImportTad(char* file_name, TadWriteOption option)
|
||||
|
||||
if ( nam_result == NAM_OK )
|
||||
{
|
||||
kamiFontPrintfConsole(CONSOLE_ORANGE, "Import %s Sucess.\n", file_name );
|
||||
kamiFontPrintfConsole(CONSOLE_ORANGE, "Sucess!\n");
|
||||
ret = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
kamiFontPrintfConsole(1, "Import %s Fail.\n", file_name );
|
||||
kamiFontPrintfConsole(CONSOLE_RED, "Fail!\n");
|
||||
}
|
||||
|
||||
// InstalledSoftBoxCount, FreeSoftBoxCount の値を現在のNANDの状態に合わせて更新します。
|
||||
UpdateNandBoxCount();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user