*Added the FatFS link map feature which should greatly decrease load times
git-svn-id: svn://localhost/Users/andi/Downloads/code/DML@41 be6c1b03-d731-4111-a574-e37d80d43941
This commit is contained in:
parent
14f9f79cdf
commit
6daa97aaaf
25
DVD.c
25
DVD.c
@ -8,15 +8,28 @@ extern FIL GameFile;
|
|||||||
extern u32 FSTMode;
|
extern u32 FSTMode;
|
||||||
|
|
||||||
static u8 *FSTable ALIGNED(32);
|
static u8 *FSTable ALIGNED(32);
|
||||||
u32 ApploaderSize=0;
|
|
||||||
u32 dolOffset=0;
|
u32 ApploaderSize = 0;
|
||||||
u32 FSTableSize=0;
|
u32 dolOffset = 0;
|
||||||
u32 FSTableOffset=0;
|
u32 FSTableSize = 0;
|
||||||
|
u32 FSTableOffset = 0;
|
||||||
|
|
||||||
u32 FCEntry=0;
|
u32 FCEntry=0;
|
||||||
FileCache FC[FILECACHE_MAX];
|
FileCache FC[FILECACHE_MAX];
|
||||||
u32 FCState[FILECACHE_MAX];
|
u32 FCState[FILECACHE_MAX];
|
||||||
|
DWORD LTable[1024];
|
||||||
|
|
||||||
|
static void DVDCreateLinkMap( FIL *File )
|
||||||
|
{
|
||||||
|
GameFile.cltbl = LTable;
|
||||||
|
GameFile.cltbl[0] = sizeof(LTable);
|
||||||
|
|
||||||
|
s32 fres = f_lseek( &GameFile, CREATE_LINKMAP );
|
||||||
|
if( fres == FR_NOT_ENOUGH_CORE )
|
||||||
|
{
|
||||||
|
GameFile.cltbl = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
s32 DVDSelectGame( void )
|
s32 DVDSelectGame( void )
|
||||||
{
|
{
|
||||||
char *str = (char*)malloca( 256, 32 );
|
char *str = (char*)malloca( 256, 32 );
|
||||||
@ -74,6 +87,8 @@ s32 DVDSelectGame( void )
|
|||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DVDCreateLinkMap(&GameFile);
|
||||||
|
|
||||||
f_lseek( &GameFile, 0 );
|
f_lseek( &GameFile, 0 );
|
||||||
f_read( &GameFile, (void*)0, 0x20, &read );
|
f_read( &GameFile, (void*)0, 0x20, &read );
|
||||||
|
|
||||||
@ -254,6 +269,8 @@ void FSTRead( char *Buffer, u32 Length, u32 Offset )
|
|||||||
FC[FCEntry].Offset = fe[i].FileOffset;
|
FC[FCEntry].Offset = fe[i].FileOffset;
|
||||||
FCState[FCEntry] = 0x23;
|
FCState[FCEntry] = 0x23;
|
||||||
|
|
||||||
|
DVDCreateLinkMap(&(FC[FCEntry].File));
|
||||||
|
|
||||||
f_lseek( &(FC[FCEntry].File), nOffset );
|
f_lseek( &(FC[FCEntry].File), nOffset );
|
||||||
f_read( &(FC[FCEntry].File), Buffer, Length, &read );
|
f_read( &(FC[FCEntry].File), Buffer, Length, &read );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user