mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-04 18:45:05 +01:00
30535c6f5d
formatted the code to make it easier to read. no functional changes at all. i didn't put anything from the libwiigui folder or banner folder in the beautifier. my automated .bat seems to have done a good job. the only places i see it fucked up was on (GXColor){blablabla}. it treated the brackets in the color like all the other brackets and put the color on a new line and indented it. i think i fixed most of them. not sure if it messed up anywhere else. also not sure about how it handled different linebreaks. it looks fine on windows. if it looks messed up on linux, it can be reverted. the code still compiles and runs fine.
38 lines
929 B
C
38 lines
929 B
C
#include <gccore.h>
|
|
|
|
#include "fstfile.h"
|
|
|
|
|
|
char *fstfiles(FST_ENTRY *fst, u32 index) {
|
|
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;
|
|
}
|
|
}
|
|
|
|
char *fstfilename(u32 index) {
|
|
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;
|
|
}
|
|
}
|
|
|
|
u32 fstfileoffset(u32 index) {
|
|
FST_ENTRY *fst = (FST_ENTRY *)*(u32 *)0x80000038;
|
|
u32 count = fst[0].filelen;
|
|
if (index < count) {
|
|
return fst[index].fileoffset;
|
|
} else {
|
|
return 0;
|
|
}
|
|
}
|