mirror of
https://github.com/rvtr/TwlIPL.git
synced 2025-10-31 06:01:12 -04:00
util_menuAppManagerにてNANDタイトル情報を取得する際に、InstalledSoftBoxCountおよびFreeSoftBoxCountを正しい値に修正する処理を追加
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@2118 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
parent
f818fd7e7d
commit
7030e95953
@ -40,6 +40,8 @@ static void AMN_unlockSubBannerFileBuffer();
|
||||
static u32 AMN_getBannerAnimeCRC(const BannerAnime* pAnime);
|
||||
static BOOL AMN_checkAndReplaceBannerAnime(s32 index);
|
||||
|
||||
static void AMNi_updateFreeBoxCount( u8 count );
|
||||
|
||||
static vu8 sThreadStarted;
|
||||
static vu8 sReadCancelFlag; // とりあえず無視。
|
||||
static vu8 sNandTitleListReady;
|
||||
@ -609,6 +611,7 @@ static void AMN_initNandTitleList_()
|
||||
s32 ret;
|
||||
s32 l;
|
||||
NAMTitleId* pNandAllTitleIDList = NULL;
|
||||
u8 count_valid_app_for_launcher = 0;
|
||||
|
||||
// インポートされているタイトルの取得
|
||||
sNandAllTitleListLength = NAM_GetNumTitles();
|
||||
@ -646,9 +649,16 @@ static void AMN_initNandTitleList_()
|
||||
AMNi_getAndAddNandTitleData( pNandAllTitleIDList[l], TRUE );
|
||||
// 本体設定の場合、アプリマネージャ用indexは飛び飛びになったり、ForSetting()が返す値(個数)より大きくなるので
|
||||
// getNandTitleListLengthForSetting()は用意しない。
|
||||
|
||||
// FreeboxCount更新のためのカウンタ
|
||||
count_valid_app_for_launcher++;
|
||||
}
|
||||
}
|
||||
|
||||
// FreeboxCount更新
|
||||
AMNi_updateFreeBoxCount( count_valid_app_for_launcher );
|
||||
|
||||
|
||||
// ローンチ対象でないタイトルの情報の取得
|
||||
for (l = 0; l < sNandAllTitleListLength; l++) {
|
||||
if (!AMN_isTitleIdValidForLauncher(pNandAllTitleIDList[l])) {
|
||||
@ -667,6 +677,7 @@ static void AMN_initNandTitleRomHeaderShortList_()
|
||||
s32 ret;
|
||||
s32 l;
|
||||
NAMTitleId* pNandAllTitleIDList = NULL;
|
||||
u8 count_valid_app_for_launcher = 0;
|
||||
|
||||
// インポートされているタイトルの取得
|
||||
sNandAllTitleListLength = NAM_GetNumTitles();
|
||||
@ -697,7 +708,14 @@ static void AMN_initNandTitleRomHeaderShortList_()
|
||||
// タイトルの情報(ヘッダのみ)の取得
|
||||
for (l = 0; l < sNandAllTitleListLength; l++) {
|
||||
AMNi_getAndAddNandTitleData( pNandAllTitleIDList[l], FALSE );
|
||||
if (AMN_isTitleIdValidForLauncher(pNandAllTitleIDList[l])) {
|
||||
// FreeboxCount更新のためのカウンタ
|
||||
count_valid_app_for_launcher++;
|
||||
}
|
||||
}
|
||||
|
||||
// FreeboxCount更新
|
||||
AMNi_updateFreeBoxCount( count_valid_app_for_launcher );
|
||||
|
||||
if (pNandAllTitleIDList) {
|
||||
AMNi_Free( pNandAllTitleIDList );
|
||||
@ -1205,6 +1223,58 @@ BOOL AMN_isIndexValidForSetting(s32 index)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void AMNi_updateFreeBoxCount( u8 count )
|
||||
{
|
||||
u32 installed;
|
||||
u8 free;
|
||||
BOOL changed = FALSE;
|
||||
u8 *pBuffer;
|
||||
BOOL retval = TRUE;
|
||||
|
||||
installed = LCFG_TSD_GetInstalledSoftBoxCount();
|
||||
free = LCFG_TSD_GetFreeSoftBoxCount();
|
||||
|
||||
if( count > LCFG_TWL_FREE_SOFT_BOX_COUNT_MAX )
|
||||
{
|
||||
count = LCFG_TWL_FREE_SOFT_BOX_COUNT_MAX;
|
||||
}
|
||||
|
||||
OS_TPrintf( "AMNi_updateFreeBoxCount : Install:%d, Free:%d, LCFG_Install:%d, LCFG_Free:%d, MAX:%d\n",
|
||||
count, LCFG_TWL_FREE_SOFT_BOX_COUNT_MAX - count, installed, free, LCFG_TWL_FREE_SOFT_BOX_COUNT_MAX );
|
||||
|
||||
if( (u8)installed != count )
|
||||
{
|
||||
LCFG_TSD_SetInstalledSoftBoxCount( ( u8 )count );
|
||||
changed = TRUE;
|
||||
}
|
||||
|
||||
if( LCFG_TWL_FREE_SOFT_BOX_COUNT_MAX - count != free )
|
||||
{
|
||||
LCFG_TSD_SetFreeSoftBoxCount( (u8)( LCFG_TWL_FREE_SOFT_BOX_COUNT_MAX - count ) );
|
||||
changed = TRUE;
|
||||
}
|
||||
|
||||
if(changed)
|
||||
{
|
||||
// LCFGライブラリの静的変数の値をNANDに反映
|
||||
pBuffer = AMNi_Alloc( LCFG_WRITE_TEMP );
|
||||
if (!pBuffer) {
|
||||
OS_TPrintf( "AMNi_updateFreeBoxCount : AMNi_Alloc failed.\n" );
|
||||
return;
|
||||
}
|
||||
retval = LCFG_WriteTWLSettings( (u8 (*)[ LCFG_WRITE_TEMP ] )pBuffer );
|
||||
AMNi_Free( pBuffer );
|
||||
if (!retval) {
|
||||
OS_TPrintf( "AMNi_updateFreeBoxCount : LCFG_WriteTWLSettings failed.\n" );
|
||||
return;
|
||||
}
|
||||
OS_TPrintf( "AMNi_updateFreeBoxCount : FreeBoxCount is updated.\n" );
|
||||
}else
|
||||
{
|
||||
OS_TPrintf( "AMNi_updateFreeBoxCount : FreeBoxCount is not updated.\n" );
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------------
|
||||
|
||||
// アプリケーションに埋め込むテストコードのサンプル
|
||||
|
||||
Loading…
Reference in New Issue
Block a user