mirror of
https://github.com/rvtr/TwlIPL.git
synced 2025-10-31 06:01:12 -04:00
ランチャー:nandアプリのサブバナーに対応
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@799 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
parent
7c31c4d039
commit
8f9a322839
@ -28,6 +28,7 @@ typedef struct BannerCheckParam {
|
||||
// extern data-----------------------------------------------------------------
|
||||
// function's prototype-------------------------------------------------------
|
||||
static BOOL SYSMi_CheckBannerFile( TWLBannerFile *pBanner );
|
||||
static BOOL SYSMi_CheckSubBannerFile( TWLSubBannerFile *pBanner );
|
||||
|
||||
// global variable-------------------------------------------------------------
|
||||
// static variable-------------------------------------------------------------
|
||||
@ -87,7 +88,7 @@ BOOL SYSMi_ReadBanner_NAND( NAMTitleId titleID, TWLBannerFile *pDst )
|
||||
s32 readLen;
|
||||
s32 offset;
|
||||
|
||||
//[TODO:]サブバナーが保存されている場合、そちらを使う
|
||||
FS_InitFile(file);
|
||||
|
||||
start = OS_GetTick();
|
||||
readLen = NAM_GetTitleBootContentPathFast( path, titleID );
|
||||
@ -150,9 +151,50 @@ BOOL SYSMi_ReadBanner_NAND( NAMTitleId titleID, TWLBannerFile *pDst )
|
||||
}
|
||||
|
||||
FS_CloseFile(file);
|
||||
|
||||
// サブバナーファイルを読み込んでみる
|
||||
if(NAM_OK == NAM_GetTitleBannerFilePath( path, titleID ))
|
||||
{
|
||||
if( FS_OpenFileEx(file, path, FS_FILEMODE_R) )
|
||||
{
|
||||
TWLSubBannerFile subBanner;
|
||||
readLen = FS_ReadFile(file, &subBanner, sizeof(TWLSubBannerFile));
|
||||
FS_CloseFile(file);
|
||||
if( readLen == sizeof(TWLSubBannerFile) )
|
||||
{
|
||||
// 読み込みには成功したので正当性チェック
|
||||
if( SYSMi_CheckSubBannerFile(&subBanner) )
|
||||
{
|
||||
// 成功したのでコピーする
|
||||
pDst->h = subBanner.h;
|
||||
pDst->anime = subBanner.anime;
|
||||
OS_TPrintf("SYSMi_ReadBanner_NAND : subbanner check succeed. id=%.16x\n", titleID);
|
||||
}else
|
||||
{
|
||||
OS_TPrintf("SYSMi_ReadBanner_NAND : subbanner check failed. id=%.16x\n", titleID);
|
||||
}
|
||||
}else
|
||||
{
|
||||
OS_TPrintf("SYSMi_ReadBanner_NAND : subbanner read failed. id=%.16x\n", titleID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// サブバナーデータの正誤チェック
|
||||
static BOOL SYSMi_CheckSubBannerFile( TWLSubBannerFile *pBanner )
|
||||
{
|
||||
BOOL retval = TRUE;
|
||||
|
||||
// アニメ部チェック
|
||||
if( pBanner->h.crc16_anime != SVC_GetCRC16( 0xffff, &pBanner->anime, sizeof(BannerAnime) ) ) {
|
||||
retval = FALSE;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
// バナーデータの正誤チェック
|
||||
static BOOL SYSMi_CheckBannerFile( TWLBannerFile *pBanner )
|
||||
{
|
||||
|
||||
@ -20,7 +20,7 @@ include $(TWLSDK_ROOT)/build/buildtools/commondefs
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SUBDIRS = RelocateChecker
|
||||
SUBDIRS = SubBanner RelocateChecker
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user