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