2009-10-01 01:10:58 +02:00
|
|
|
#include <gccore.h>
|
|
|
|
|
|
|
|
#include "fstfile.h"
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
char *fstfiles(FST_ENTRY *fst, u32 index)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2011-07-26 00:28:22 +02:00
|
|
|
u32 count = fst[0].filelen;
|
|
|
|
u32 stringoffset;
|
|
|
|
if (index < count)
|
|
|
|
{
|
|
|
|
stringoffset = *(u32 *) &(fst[index]) % (256 * 256 * 256);
|
|
|
|
return (char *) ((u32) fst + count * 12 + stringoffset);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
char *fstfilename(u32 index)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2011-07-26 00:28:22 +02:00
|
|
|
FST_ENTRY *fst = (FST_ENTRY *) *(u32 *) 0x80000038;
|
|
|
|
u32 count = fst[0].filelen;
|
|
|
|
u32 stringoffset;
|
|
|
|
if (index < count)
|
|
|
|
{
|
|
|
|
stringoffset = *(u32 *) &(fst[index]) % (256 * 256 * 256);
|
|
|
|
return (char *) (*(u32 *) 0x80000038 + count * 12 + stringoffset);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
u32 fstfileoffset(u32 index)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2011-07-26 00:28:22 +02:00
|
|
|
FST_ENTRY *fst = (FST_ENTRY *) *(u32 *) 0x80000038;
|
|
|
|
u32 count = fst[0].filelen;
|
|
|
|
if (index < count)
|
|
|
|
{
|
|
|
|
return fst[index].fileoffset;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|