2018-01-21 21:51:04 +00:00
|
|
|
#ifndef GUARD_FILE_SYSTEM_H
|
|
|
|
#define GUARD_FILE_SYSTEM_H
|
|
|
|
|
2023-08-28 02:56:09 +00:00
|
|
|
// size: 0x8
|
2018-01-21 21:51:04 +00:00
|
|
|
struct File
|
|
|
|
{
|
2023-08-28 02:56:09 +00:00
|
|
|
/* 0x0 */ char *name;
|
|
|
|
/* 0x4 */ u8 *data;
|
2018-01-21 21:51:04 +00:00
|
|
|
};
|
|
|
|
|
2023-08-28 02:56:09 +00:00
|
|
|
// size: 0x8
|
2018-01-21 21:51:04 +00:00
|
|
|
struct OpenedFile
|
|
|
|
{
|
2023-08-28 02:56:09 +00:00
|
|
|
/* 0x0 */ struct File *file;
|
|
|
|
/* 0x4 */ u8 *data;
|
2018-01-21 21:51:04 +00:00
|
|
|
};
|
|
|
|
|
2023-08-28 02:56:09 +00:00
|
|
|
// size: 0x10
|
2018-01-21 21:51:04 +00:00
|
|
|
struct FileArchive
|
|
|
|
{
|
2023-08-28 02:56:09 +00:00
|
|
|
/* 0x0 */ char magic[8];
|
|
|
|
/* 0x8 */ s32 count;
|
|
|
|
/* 0xC */ struct File *entries;
|
2018-01-21 21:51:04 +00:00
|
|
|
};
|
|
|
|
|
2023-08-28 02:56:09 +00:00
|
|
|
// size: 0x8
|
2018-01-21 21:51:04 +00:00
|
|
|
struct SiroArchive
|
|
|
|
{
|
2023-08-28 02:56:09 +00:00
|
|
|
/* 0x0 */ u32 magic;
|
|
|
|
/* 0x4 */ u8 *data;
|
2018-01-21 21:51:04 +00:00
|
|
|
};
|
|
|
|
|
2023-08-28 02:56:09 +00:00
|
|
|
// size: 0x8
|
2020-09-21 06:40:48 +00:00
|
|
|
struct UnkFileStruct1
|
|
|
|
{
|
2023-08-28 02:56:09 +00:00
|
|
|
u32 unk0;
|
|
|
|
u32 unk4;
|
2020-09-21 06:40:48 +00:00
|
|
|
};
|
|
|
|
|
2023-08-06 07:10:51 +00:00
|
|
|
void InitFileSystem(void);
|
2018-01-21 21:51:04 +00:00
|
|
|
struct OpenedFile *OpenFile(const char *filename, const struct FileArchive *arc);
|
|
|
|
u8 *GetFileDataPtr(struct OpenedFile *openedFile, int unused);
|
|
|
|
struct OpenedFile *OpenFileAndGetFileDataPtr(const char *filename, const struct FileArchive *arc);
|
|
|
|
struct OpenedFile *Call_OpenFileAndGetFileDataPtr(const char *filename, const struct FileArchive *arc);
|
2021-07-26 04:11:01 +00:00
|
|
|
u32 DecompressATFile(char *result, s32 resultLength, struct OpenedFile *file);
|
2020-12-28 03:23:40 +00:00
|
|
|
void CloseFile(struct OpenedFile *openedFile);
|
2022-11-18 23:14:06 +00:00
|
|
|
u32 DecompressATGlobalFile(u32 *result, s32 resultLength, struct OpenedFile *file);
|
2018-01-21 21:51:04 +00:00
|
|
|
|
|
|
|
#endif //GUARD_FILE_SYSTEM_H
|