バンブラパッチ仮実装

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@2048 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
yoshida_teruhisa 2008-07-31 07:28:07 +00:00
parent a7f2a4420e
commit 1fffe92263
3 changed files with 12 additions and 7 deletions

View File

@ -1689,7 +1689,7 @@ void SYSM_TryToBootTitle( TitleProperty *pBootTitle )
SYSMi_makeTitleIdList();
// バンブラパッチ
// SYSMi_applyPatchToBandBrothers();
SYSMi_applyPatchToBandBrothers();
BOOT_Ready(); // never return.
@ -1702,20 +1702,25 @@ static void SYSMi_applyPatchToBandBrothers( void )
if( ( 0 == STD_CompareNString( hs->game_code , "AXBJ", 4 ) ) && ( hs->rom_version == 0 ) )
{
s32 len = 0;
s32 llen;
u32 len = 0;
u32 llen;
FSFile src;
void *dest;
// データ読み込み + パッチ
FS_InitFile( &src );
if ( !FS_OpenFileEx( &src, "rom:/bandbroth_7flx.bin", FS_FILEMODE_R ) ) return;
len = (int)FS_GetFileLength( &src );
if ( !FS_OpenFileEx( &src, "rom:/data/bandbrothers_arm7flx_patch.sbin", FS_FILEMODE_R ) ) return;
len = FS_GetFileLength( &src );
// ヘッダ情報のうち、ARM7FLXのサイズを改変する
hs->sub_size = len;
if( SYSMi_GetWork()->romRelocateInfo[ARM7_STATIC].src != NULL )
{
// ARM7FLXが再配置の場合
dest = (void *)SYSMi_GetWork()->romRelocateInfo[ARM7_STATIC].src;
SYSMi_GetWork()->romRelocateInfo[ARM7_STATIC].length = len;
OS_TPrintf("bandbrothers patch : relocate info changed! \n");
}else
{
// 再配置なし
@ -1725,7 +1730,7 @@ static void SYSMi_applyPatchToBandBrothers( void )
for(llen = 0; llen < len; )
{
int rd;
rd = FS_ReadFile( &src, dest, len );
rd = FS_ReadFile( &src, dest, (s32)len );
if(rd == -1)
{
FS_CloseFile( &src );

View File

@ -216,5 +216,5 @@ RomSpec
Segment ALL
HostRoot ../../data
Root /data
File NTR_IPL_font_m.NFTR NoCardBanner.bnr EmptyBanner.bnr NoBanner.bnr fanfare.32.wav
File NTR_IPL_font_m.NFTR NoCardBanner.bnr EmptyBanner.bnr NoBanner.bnr fanfare.32.wav bandbrothers_arm7flx_patch.sbin
}