SDK4636への対応。

HWInfoWriterで無線強制OFFを設定できるようにする。

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@856 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
yosiokat 2008-03-10 12:57:20 +00:00
parent b5f4910d7f
commit 982d25aaee
12 changed files with 62 additions and 42 deletions

View File

@ -548,7 +548,8 @@ SECTIONS
} > <PROPERTY.OVERLAYTABLE>F
############################ OTHERS #################################
SDK_WRAM_ARENA_LO = SDK_AUTOLOAD.WRAM.BSS_END;
SDK_SEA_KEY_STORE = SDK_AUTOLOAD.WRAM.BSS_END;
SDK_WRAM_ARENA_LO = SDK_AUTOLOAD.WRAM.BSS_END + 0x40;
SDK_IRQ_STACKSIZE = <STATIC.IRQSTACKSIZE>; # allocated in WRAM
SDK_SYS_STACKSIZE = <STATIC.STACKSIZE>; # allocated in WRAM

View File

@ -68,6 +68,8 @@ Autoload WRAM
Library libnvram_sp$(LIBSUFFIX).a
Library librtc_sp$(LIBSUFFIX).a
Library libsea_sp$(LIBSUFFIX).a
Library libcrypto_sp$(LIBSUFFIX).a
Object * (.etable)
Object * (.wram)

View File

@ -41,9 +41,7 @@
#include "nvram_sp.h"
#include "pm_pmic.h"
#include "internal_api.h"
#ifdef SDK_SEA
#include <twl/sea.h>
#endif // ifdef SDK_SEA
/*---------------------------------------------------------------------------*
è<EFBFBD>è`

View File

@ -877,7 +877,7 @@ static AuthResult SYSMi_AuthenticateHeader( TitleProperty *pBootTitle)
return SYSMi_AuthenticateTWLHeader( pBootTitle );
case LAUNCHER_BOOTTYPE_TEMP:
OS_TPrintf( "Authenticate :TWL_TEMP start.\n" );
if (!hs->permit_tmp_jump)
if (!hs->permit_landing_tmp_jump)
{
OS_TPrintf("Authenticate failed: TMP flag error.\n");
return AUTH_RESULT_AUTHENTICATE_FAILED;
@ -903,7 +903,7 @@ static AuthResult SYSMi_AuthenticateHeader( TitleProperty *pBootTitle)
return SYSMi_AuthenticateNTRNandAppHeader( pBootTitle );
case LAUNCHER_BOOTTYPE_TEMP:
OS_TPrintf( "Authenticate :NTR_TEMP start.\n" );
if (!hs->permit_tmp_jump)
if (!hs->permit_landing_tmp_jump)
{
OS_TPrintf("Authenticate failed: TMP flag error.\n");
return AUTH_RESULT_AUTHENTICATE_FAILED;

View File

@ -31,7 +31,7 @@
// extern data------------------------------------------
// function's prototype declaration---------------------
static void WriteHWInfoFile( u8 region );
static void WriteHWInfoFile( u8 region, BOOL isDisableWireless );
static void DeleteHWInfoFile( void );
static void DispMessage( int x, int y, u16 color, const u16 *pMsg );
@ -46,6 +46,7 @@ static u8 *s_pPrivKeyBuffer = NULL;
static LCFGReadResult (*s_pReadSecureInfoFunc)( void );
static BOOL s_isReadTSD;
static u8 s_region_old;
static BOOL s_isDisableWireless;
// const data -----------------------------------------
static const u16 *const s_pStrWriter[ WRITER_ELEMENT_NUM ] = {
@ -59,13 +60,13 @@ static const u16 *const s_pStrWriter[ WRITER_ELEMENT_NUM ] = {
};
static MenuPos s_writerPos[] = {
{ TRUE, 3 * 8, 3 * 8 },
{ TRUE, 3 * 8, 5 * 8 },
{ TRUE, 3 * 8, 7 * 8 },
{ TRUE, 3 * 8, 9 * 8 },
{ TRUE, 3 * 8, 11 * 8 },
{ TRUE, 3 * 8, 13 * 8 },
{ TRUE, 3 * 8, 15 * 8 },
{ TRUE, 3 * 8, 4 * 8 },
{ TRUE, 3 * 8, 6 * 8 },
{ TRUE, 3 * 8, 8 * 8 },
{ TRUE, 3 * 8, 10 * 8 },
{ TRUE, 3 * 8, 12 * 8 },
{ TRUE, 3 * 8, 14 * 8 },
{ TRUE, 3 * 8, 16 * 8 },
};
@ -91,6 +92,10 @@ static const char *strRegion[] = {
//======================================================
// HW情報ライター
//======================================================
const char *pWireless[] = {
"Enable Wireless",
"Force disable Wireless",
};
// HW情報ライターの初期化
void HWInfoWriterInit( void )
@ -121,7 +126,11 @@ void HWInfoWriterInit( void )
}
PrintfSJIS( 14 * 8, 0 * 8, TXT_COLOR_RED, "[%s Signature MODE]", pMode );
}
// ³<E28093>ü­<E280B9>§ON/OFF<46>î•ñÌ•\ަ
s_isDisableWireless = LCFG_THW_IsForceDisableWireless();
PrintfSJIS( 3 * 8, 2 * 8, TXT_COLOR_BLACK, pWireless[ s_isDisableWireless ] );
OS_TPrintf( "region = %d\n", LCFG_THW_GetRegion() );
PrintfSJISSub( 2 * 8, 16 * 8, TXT_COLOR_BLACK, "Region = %s", strRegion[ LCFG_THW_GetRegion() ] );
PrintfSJISSub( 2 * 8, 18 * 8, TXT_COLOR_BLACK, "SerialNo = %s", LCFG_THW_GetSerialNoPtr() );
@ -159,7 +168,13 @@ void HWInfoWriterMain( void )
}
}
DrawMenu( s_csr, &s_writerParam );
if( pad.trg & PAD_BUTTON_START ) {
PrintfSJIS( 3 * 8, 2 * 8, TXT_COLOR_WHITE, pWireless[ s_isDisableWireless ] );
s_isDisableWireless ^= 0x01;
PrintfSJIS( 3 * 8, 2 * 8, TXT_COLOR_BLACK, pWireless[ s_isDisableWireless ] );
}
// 実行
if( pad.trg == PAD_BUTTON_A ) {
if( s_csr == WRITER_ELEMENT_NUM - 1 ) {
@ -167,7 +182,7 @@ void HWInfoWriterMain( void )
(void)DeleteHWInfoFile();
}else {
OS_TPrintf( "Write start.\n" );
WriteHWInfoFile( (u8)s_csr );
WriteHWInfoFile( (u8)s_csr, s_isDisableWireless );
}
}
@ -176,7 +191,7 @@ void HWInfoWriterMain( void )
// HW情報全体のライト
static void WriteHWInfoFile( u8 region )
static void WriteHWInfoFile( u8 region, BOOL isDisableWireless )
{
static const u16 *pMsgNormalWriting = (const u16 *)L"Writing Normal File...";
static const u16 *pMsgSecureWriting = (const u16 *)L"Writing Secure File...";
@ -200,7 +215,7 @@ static void WriteHWInfoFile( u8 region )
// -------------------------------------
(void)PutStringUTF16( MSG_X * 8, ( MSG_Y + 2 ) * 8, TXT_COLOR_BLACK, pMsgSecureWriting );
if( HWI_WriteHWSecureInfoFile( region, NULL ) ) {
if( HWI_WriteHWSecureInfoFile( region, NULL, isDisableWireless ) ) {
(void)PutStringUTF16( ( MSG_X + 20 ) * 8, ( MSG_Y + 2 ) * 8, TXT_COLOR_BLUE, pMsgSucceeded );
}else {
(void)PutStringUTF16( ( MSG_X + 20 ) * 8, ( MSG_Y + 2 ) * 8, TXT_COLOR_RED, pMsgFailed );

View File

@ -273,7 +273,7 @@ void HWI_ModifyLanguage( u8 region )
LCFG_TSD_SetCountry( LCFG_TWL_COUNTRY_UNDEFINED );
// ペアレンタルコントロール情報もクリアしておく
MI_CpuClearFast( (void *)LCFG_TSD_GetPCTLPtr(), sizeof(LCFGTWLParentalControl) );
// regionが変わった場合は、LANGUAGE_BITMAPも必ず変わるので、それをNTR側に反映させるために必ずTWL設定データの書き込みも行う。
{
@ -323,7 +323,7 @@ BOOL HWI_WriteHWNormalInfoFile( void )
Returns: None.
*---------------------------------------------------------------------------*/
BOOL HWI_WriteHWSecureInfoFile( u8 region, const u8 *pSerialNo )
BOOL HWI_WriteHWSecureInfoFile( u8 region, const u8 *pSerialNo, BOOL isDisableWireless )
{
BOOL isWrite = TRUE;
LCFGReadResult result;
@ -338,7 +338,8 @@ BOOL HWI_WriteHWSecureInfoFile( u8 region, const u8 *pSerialNo )
isWrite = FALSE;
}
}
LCFG_THW_SetFlagForceDisableWireless( isDisableWireless );
// リージョンのセット
LCFG_THW_SetRegion( region );

View File

@ -39,7 +39,7 @@ HwiInitResult;
HwiInitResult HWI_Init( void *(*pAlloc)( u32 ), void (*pFree)( void * ) );
void HWI_ModifyLanguage( u8 region );
BOOL HWI_WriteHWNormalInfoFile( void );
BOOL HWI_WriteHWSecureInfoFile( u8 region, const u8 *pSerialNo );
BOOL HWI_WriteHWSecureInfoFile( u8 region, const u8 *pSerialNo, BOOL isDisableWireless );
BOOL HWI_WriteHWIDSignFile( void );
BOOL HWI_DeleteHWNormalInfoFile( void );
BOOL HWI_DeleteHWSecureInfoFile( void );

View File

@ -105,7 +105,7 @@ void InstallFirmCallback(void* arg)
BOOL GetFirmwareFilepath(char *path)
{
u8 title[4];
u8 title[4] = { 'W','F','W','0' };
#if( USE_LCFG_STRING == 0 )
char *title0 = "WFW0";
@ -115,7 +115,6 @@ BOOL GetFirmwareFilepath(char *path)
u32 titleID_lo;
u64 titleID = 0;
LCFG_THW_GetWirelessFirmTitleID_Lo( title );
#if( USE_LCFG_STRING == 0 )
{

View File

@ -67,6 +67,9 @@ Autoload WRAM
Object $(OBJDIR)/formatter.o
Object $(OBJDIR)/nvram_misc.o
Library libsea_sp$(LIBSUFFIX).a
Library libcrypto_sp$(LIBSUFFIX).a
# caches in fatfs library, that should be on WRAM.
# 2007/12/11 OBJECT() による .bss シンボルのリンクがうまくいかないので、
# 変数定義箇所に pragma で .ltdwram セクションに含まれるように暫定対策しました。

View File

@ -548,7 +548,8 @@ SECTIONS
} > <PROPERTY.OVERLAYTABLE>F
############################ OTHERS #################################
SDK_WRAM_ARENA_LO = SDK_AUTOLOAD.WRAM.BSS_END;
SDK_SEA_KEY_STORE = SDK_AUTOLOAD.WRAM.BSS_END;
SDK_WRAM_ARENA_LO = SDK_AUTOLOAD.WRAM.BSS_END + 0x40;
SDK_IRQ_STACKSIZE = <STATIC.IRQSTACKSIZE>; # allocated in WRAM
SDK_SYS_STACKSIZE = <STATIC.STACKSIZE>; # allocated in WRAM

View File

@ -337,7 +337,7 @@ static BOOL WriteHWInfoFile( u8 region )
// セキュアファイルのライト
kamiFontPrintfConsoleEx(CONSOLE_ORANGE, pMsgSecureWriting );
if( HWI_WriteHWSecureInfoFile( region, NULL ) ) {
if( HWI_WriteHWSecureInfoFile( region, NULL, FALSE ) ) { // とりあえず無線は有効で。
kamiFontPrintfConsoleEx(CONSOLE_ORANGE, pMsgSucceeded );
}else {
kamiFontPrintfConsoleEx(CONSOLE_RED, pMsgFailed );

View File

@ -158,22 +158,22 @@ int main(int argc, char *argv[])
// 0x02f0 - 0x0300 Parental Controls Rating Info
// u8 ParentalControlsRatingInfo[ 0x10 ];
rom_header.s.ParentalControlsRatingInfo[ 0x0 ] = 0;
rom_header.s.ParentalControlsRatingInfo[ 0x1 ] = 1;
rom_header.s.ParentalControlsRatingInfo[ 0x2 ] = 2;
rom_header.s.ParentalControlsRatingInfo[ 0x3 ] = 3;
rom_header.s.ParentalControlsRatingInfo[ 0x4 ] = 4;
rom_header.s.ParentalControlsRatingInfo[ 0x5 ] = 5;
rom_header.s.ParentalControlsRatingInfo[ 0x6 ] = 6;
rom_header.s.ParentalControlsRatingInfo[ 0x7 ] = 7;
rom_header.s.ParentalControlsRatingInfo[ 0x8 ] = 8;
rom_header.s.ParentalControlsRatingInfo[ 0x9 ] = 9;
rom_header.s.ParentalControlsRatingInfo[ 0xa ] = 0xa;
rom_header.s.ParentalControlsRatingInfo[ 0xb ] = 0xb;
rom_header.s.ParentalControlsRatingInfo[ 0xc ] = 0xc;
rom_header.s.ParentalControlsRatingInfo[ 0xd ] = 0xd;
rom_header.s.ParentalControlsRatingInfo[ 0xe ] = 0xe;
rom_header.s.ParentalControlsRatingInfo[ 0xf ] = 0xf;
rom_header.s.parental_control_rating_info[ 0x0 ] = 0;
rom_header.s.parental_control_rating_info[ 0x1 ] = 1;
rom_header.s.parental_control_rating_info[ 0x2 ] = 2;
rom_header.s.parental_control_rating_info[ 0x3 ] = 3;
rom_header.s.parental_control_rating_info[ 0x4 ] = 4;
rom_header.s.parental_control_rating_info[ 0x5 ] = 5;
rom_header.s.parental_control_rating_info[ 0x6 ] = 6;
rom_header.s.parental_control_rating_info[ 0x7 ] = 7;
rom_header.s.parental_control_rating_info[ 0x8 ] = 8;
rom_header.s.parental_control_rating_info[ 0x9 ] = 9;
rom_header.s.parental_control_rating_info[ 0xa ] = 0xa;
rom_header.s.parental_control_rating_info[ 0xb ] = 0xb;
rom_header.s.parental_control_rating_info[ 0xc ] = 0xc;
rom_header.s.parental_control_rating_info[ 0xd ] = 0xd;
rom_header.s.parental_control_rating_info[ 0xe ] = 0xe;
rom_header.s.parental_control_rating_info[ 0xf ] = 0xf;
/* SRLファイルの書き出し */
if(1 != fwrite((void *)&rom_header, sizeof(ROM_Header), 1, srl_fp) ) {