SDK4505に対応のはず。

LCFGデータおよびAPIの仕様変更に対応。

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@813 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
yosiokat 2008-03-04 12:51:56 +00:00
parent ebd923eb3d
commit 7531235341
16 changed files with 92 additions and 25 deletions

View File

@ -62,7 +62,13 @@ void SYSM_SetBackLightBrightness( u8 brightness )
LCFG_TSD_SetBacklightBrightness( brightness );
// [TODO:] バックライト輝度は毎回セーブせずに、アプリ起動やリセット、電源OFF時に値が変わっていたらセーブするようにする。
LCFG_WriteTWLSettings();
{
u8 *pBuffer = SYSM_Alloc( LCFG_WRITE_TEMP );
if( pBuffer != NULL ) {
LCFG_WriteTWLSettings( (u8 (*)[ LCFG_WRITE_TEMP ] )pBuffer );
SYSM_Free( pBuffer );
}
}
}
@ -114,7 +120,13 @@ void SYSMi_CheckRTC( void )
LCFG_TSD_SetFlagDateTime( FALSE );
LCFG_TSD_SetRTCOffset( 0 );
LCFG_TSD_SetRTCLastSetYear( 0 );
LCFG_WriteTWLSettings();
{
u8 *pBuffer = SYSM_Alloc( LCFG_WRITE_TEMP );
if( pBuffer != NULL ) {
LCFG_WriteTWLSettings( (u8 (*)[ LCFG_WRITE_TEMP ] )pBuffer );
SYSM_Free( pBuffer );
}
}
}
}

View File

@ -158,6 +158,7 @@ TitleProperty *SYSM_ReadParameters( void )
if( !LCFG_ReadHWNormalInfo() ) {
OS_TPrintf( "HW Normal Info Broken!\n" );
SYSMi_GetWork()->flags.common.isBrokenHWNormalInfo = TRUE;
SYSMi_GetWork()->flags.common.isFatalError = TRUE;
}
// セキュア情報リード
if( !LCFG_ReadHWSecureInfo() ) {
@ -169,9 +170,19 @@ TitleProperty *SYSM_ReadParameters( void )
//-----------------------------------------------------
// 本体設定データのリード
//-----------------------------------------------------
if( LCFG_ReadTWLSettings() ) { // NANDからTWL本体設定データをリード
SYSM_CaribrateTP(); // 読み出したTWL本体設定データをもとにTPキャリブレーション。
brightness = (u8)LCFG_TSD_GetBacklightBrightness();
{
u8 *pBuffer = SYSM_Alloc( LCFG_READ_TEMP );
if( pBuffer == NULL ) {
SYSMi_GetWork()->flags.common.isFatalError = TRUE;
}else if( LCFG_ReadTWLSettings( (u8 (*)[LCFG_READ_TEMP])pBuffer ) ) { // NANDからTWL本体設定データをリード
SYSM_CaribrateTP(); // 読み出したTWL本体設定データをもとにTPキャリブレーション。
brightness = (u8)LCFG_TSD_GetBacklightBrightness();
}else {
SYSMi_GetWork()->flags.common.isInitialSettings = TRUE; // リード失敗なら初回起動シーケンスへ
}
if( pBuffer ) {
SYSM_Free( pBuffer );
}
}
//-----------------------------------------------------

View File

@ -123,7 +123,12 @@ HwiInitResult HWI_Init( void *(*pAlloc)( u32 ), void (*pFree)( void * ) )
// TWL設定データのリード
static void ReadTWLSettings( void )
{
s_isReadTSD = LCFGi_TSD_ReadSettings();
u8 *pBuffer = spAlloc( sizeof(LCFGTWLSettingsData) * 2 );
s_isReadTSD = FALSE;
if( pBuffer ) {
s_isReadTSD = LCFGi_TSD_ReadSettings( (u8 (*)[ sizeof(LCFGTWLSettingsData) * 2 ] )pBuffer );
spFree( pBuffer );
}
if( s_isReadTSD ) {
OS_TPrintf( "TSD read succeeded.\n" );
}else {
@ -260,6 +265,7 @@ void HWI_ModifyLanguage( u8 region )
LCFG_TSD_SetFlagCountry( FALSE ); // ※ついでに国コードもクリアしておく。
LCFG_TSD_SetCountry( LCFG_TWL_COUNTRY_UNDEFINED );
LCFGi_TSD_WriteSettings();
OS_TPrintf( "Language Change \"%s\" -> \"%s\"\n",
strLanguage[ nowLanguage ], strLanguage[ LCFG_TSD_GetLanguage() ] );
}

View File

@ -449,7 +449,13 @@ static void PollBackLightBrightness( void )
{
// マイコンから取ってきた輝度とLCFGの設定値がズレていたらLCFGの値を設定しなおし
LCFG_TSD_SetBacklightBrightness( brightness );
LCFG_WriteTWLSettings();
{
u8 *pBuffer = SYSM_Alloc( LCFG_WRITE_TEMP );
if( pBuffer != NULL ) {
LCFG_WriteTWLSettings( (u8 (*)[ LCFG_WRITE_TEMP ] )pBuffer );
SYSM_Free( pBuffer );
}
}
}
}

View File

@ -130,9 +130,14 @@ void TwlMain( void )
// 各種パラメータの取得------------
pBootTitle = SYSM_ReadParameters(); // 本体設定データ、リセットパラメータ、
// 初回起動シーケンス判定、
// 検査用オート起動カード判定、量産ライン用キーショートカット起動判定等のリード
pBootTitle = SYSM_ReadParameters(); // 本体設定データ、リセットパラメータのリード、検査用オート起動カード判定、量産ライン用キーショートカット起動判定等のリード
if( SYSMi_GetWork()->flags.common.isFatalError ) {
// FATALエラー処理
}
if( SYSMi_GetWork()->flags.common.isInitialSettings ) {
// 初回起動シーケンス判定
}
(void)SYSM_GetCardTitleList( s_titleList ); // カードアプリリストの取得カードアプリはs_titleList[0]に格納される)

View File

@ -340,3 +340,15 @@ static int InitialSettingFinalizeMain( void )
return 0;
}
// 本体設定データのライト
BOOL MY_WriteTWLSettings( void )
{
BOOL retval = FALSE;
u8 *pBuffer = SYSM_Alloc( LCFG_WRITE_TEMP );
if( pBuffer != NULL ) {
retval = LCFG_WriteTWLSettings( (u8 (*)[ LCFG_WRITE_TEMP ] )pBuffer );
SYSM_Free( pBuffer );
}
return retval;
}

View File

@ -76,6 +76,7 @@ extern void CheckOKCancelButton(BOOL *tp_ok, BOOL *tp_cancel);
extern void InputDecimal(int *tgtp, InputNumParam *inpp);
extern void ClearRTC( void );
extern BOOL MY_WriteTWLSettings( void );
#ifdef __cplusplus
}

View File

@ -422,7 +422,7 @@ int TP_CalibrationMain( void )
// ::::::::::::::::::::::::::::::::::::::::::::::
// TWL設定データファイルへの書き込み
// ::::::::::::::::::::::::::::::::::::::::::::::
if( !LCFG_WriteTWLSettings() ) {
if( !MY_WriteTWLSettings() ) {
OS_TPrintf( "TWL settings write failed.\n" );
}

View File

@ -70,6 +70,12 @@ void TwlMain(void)
// ※本来ならランチャーからのパラメータチェックを行い、
// 初回起動シーケンスに入るパスがある
{
OS_TPrintf( "LCFGTWLOwnerInfo : 0x%04x\n", sizeof(LCFGTWLOwnerInfo) );
OS_TPrintf( "LCFGTWLParentalControl : 0x%04x\n", sizeof(LCFGTWLParentalControl) );
OS_TPrintf( "LCFGTWLSettingsData : 0x%04x\n", sizeof(LCFGTWLSettingsData) );
}
// TWL設定のリード
SYSM_SetAllocFunc( Alloc, Free ); // SYSM_ReadTWLSettingsFile()の実行に必要。
@ -77,7 +83,14 @@ void TwlMain(void)
// TWL設定データファイルの読み込み
// ::::::::::::::::::::::::::::::::::::::::::::::
(void)LCFG_ReadHWSecureInfo();
g_isValidTSD = LCFG_ReadTWLSettings();
{
u8 *pBuffer = SYSM_Alloc( LCFG_READ_TEMP );
g_isValidTSD = FALSE;
if( pBuffer) {
g_isValidTSD = LCFG_ReadTWLSettings( (u8 (*)[ LCFG_READ_TEMP ] )pBuffer );
SYSM_Free( pBuffer );
}
}
if( g_isValidTSD ) {
SYSM_CaribrateTP();
}

View File

@ -323,7 +323,7 @@ int SelectCountryMain( void )
// ::::::::::::::::::::::::::::::::::::::::::::::
// TWL設定データファイルへの書き込み
// ::::::::::::::::::::::::::::::::::::::::::::::
if( !LCFG_WriteTWLSettings() ) {
if( !MY_WriteTWLSettings() ) {
OS_TPrintf( "TWL settings write failed.\n" );
}

View File

@ -181,7 +181,7 @@ int SelectLanguageMain( void )
// ::::::::::::::::::::::::::::::::::::::::::::::
// TWL設定データファイルへの書き込み
// ::::::::::::::::::::::::::::::::::::::::::::::
if( !LCFG_WriteTWLSettings() ) {
if( !MY_WriteTWLSettings() ) {
OS_TPrintf( "TWL settings write failed.\n" );
}

View File

@ -432,7 +432,7 @@ static void PushKeys( u16 code, NameOrComment noc )
// ::::::::::::::::::::::::::::::::::::::::::::::
// TWL設定データファイルへの書き込み
// ::::::::::::::::::::::::::::::::::::::::::::::
if( !LCFG_WriteTWLSettings() ) {
if( !MY_WriteTWLSettings() ) {
OS_TPrintf( "TWL settings write failed.\n" );
}
// セーブ後にキャンセル処理と合流
@ -770,7 +770,7 @@ static int SetBirthdayMain( void )
// ::::::::::::::::::::::::::::::::::::::::::::::
// TWL設定データファイルへの書き込み
// ::::::::::::::::::::::::::::::::::::::::::::::
if( !LCFG_WriteTWLSettings() ) {
if( !MY_WriteTWLSettings() ) {
OS_TPrintf( "TWL settings write failed.\n" );
}
SetOwnerInfoInit();
@ -893,7 +893,7 @@ static int SetUserColorMain( void )
// ::::::::::::::::::::::::::::::::::::::::::::::
// TWL設定データファイルへの書き込み
// ::::::::::::::::::::::::::::::::::::::::::::::
if( !LCFG_WriteTWLSettings() ) {
if( !MY_WriteTWLSettings() ) {
OS_TPrintf( "TWL settings write failed.\n" );
}
SetOwnerInfoInit();

View File

@ -1155,7 +1155,7 @@ static void PushKeys( u16 code, eUseSoftKey noc )
// ::::::::::::::::::::::::::::::::::::::::::::::
// TWL設定データファイルへの書き込み
// ::::::::::::::::::::::::::::::::::::::::::::::
if( !LCFG_WriteTWLSettings() )
if( !MY_WriteTWLSettings() )
{
OS_TPrintf( "TWL settings write failed.\n" );
}
@ -1448,7 +1448,7 @@ static int SetRatingOgnMain( void )
// ::::::::::::::::::::::::::::::::::::::::::::::
// TWL設定データファイルへの書き込み
// ::::::::::::::::::::::::::::::::::::::::::::::
if( !LCFG_WriteTWLSettings() )
if( !MY_WriteTWLSettings() )
{
OS_TPrintf( "TWL settings write failed.\n" );
}
@ -1543,7 +1543,7 @@ static int SetRatingLockMain( void )
// ::::::::::::::::::::::::::::::::::::::::::::::
// TWL設定データファイルへの書き込み
// ::::::::::::::::::::::::::::::::::::::::::::::
if( !LCFG_WriteTWLSettings() )
if( !MY_WriteTWLSettings() )
{
OS_TPrintf( "TWL settings write failed.\n" );
}
@ -1643,7 +1643,7 @@ static int SetRatingAgeMain( void )
// ::::::::::::::::::::::::::::::::::::::::::::::
// TWL設定データファイルへの書き込み
// ::::::::::::::::::::::::::::::::::::::::::::::
if( !LCFG_WriteTWLSettings() )
if( !MY_WriteTWLSettings() )
{
OS_TPrintf( "TWL settings write failed.\n" );
}
@ -1745,7 +1745,7 @@ static int SetSecretQuestionIDMain( void )
// ::::::::::::::::::::::::::::::::::::::::::::::
// TWL設定データファイルへの書き込み
// ::::::::::::::::::::::::::::::::::::::::::::::
if( !LCFG_WriteTWLSettings() )
if( !MY_WriteTWLSettings() )
{
OS_TPrintf( "TWL settings write failed.\n" );
}
@ -2066,7 +2066,7 @@ static int SetPasswordMain( void )
// ::::::::::::::::::::::::::::::::::::::::::::::
// TWL設定データファイルへの書き込み
// ::::::::::::::::::::::::::::::::::::::::::::::
if( !LCFG_WriteTWLSettings() )
if( !MY_WriteTWLSettings() )
{
OS_TPrintf( "TWL settings write failed.\n" );
}

View File

@ -383,7 +383,7 @@ static int InputRtcDateTimeMain( void )
// ::::::::::::::::::::::::::::::::::::::::::::::
// TWL設定データファイルへの書き込み
// ::::::::::::::::::::::::::::::::::::::::::::::
if( !LCFG_WriteTWLSettings() ) {
if( !MY_WriteTWLSettings() ) {
OS_TPrintf( "TWL settings write failed.\n" );
}
@ -551,7 +551,7 @@ void ClearRTC( void )
// ::::::::::::::::::::::::::::::::::::::::::::::
// TWL設定データファイルへの書き込み
// ::::::::::::::::::::::::::::::::::::::::::::::
if( !LCFG_WriteTWLSettings() ) {
if( !MY_WriteTWLSettings() ) {
OS_TPrintf( "TWL settings write failed.\n" );
}
}

Binary file not shown.

View File

@ -86,6 +86,7 @@ typedef struct SYSM_work {
vu32 isLogoSkip :1; // ロゴデモスキップ
vu32 isLoadSucceeded :1; // アプリロード完了?
vu32 isCardBoot :1; // カードブートか?
vu32 isInitialSettings :1; // 初回起動シーケンスか?
vu32 isBrokenHWNormalInfo :1; // HWーマル情報が破損している。
vu32 isBrokenHWSecureInfo :1; // HWセキュア情報が破損している。
vu32 isResetRTC :1; // RTCリセット発生