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
|
2023-09-02 05:46:26 +00:00
|
|
|
typedef struct File
|
2018-01-21 21:51:04 +00:00
|
|
|
{
|
2023-08-28 02:56:09 +00:00
|
|
|
/* 0x0 */ char *name;
|
|
|
|
/* 0x4 */ u8 *data;
|
2023-09-02 05:46:26 +00:00
|
|
|
} File;
|
2018-01-21 21:51:04 +00:00
|
|
|
|
2023-08-28 02:56:09 +00:00
|
|
|
// size: 0x8
|
2023-09-02 05:46:26 +00:00
|
|
|
typedef struct OpenedFile
|
2018-01-21 21:51:04 +00:00
|
|
|
{
|
2023-09-02 05:46:26 +00:00
|
|
|
/* 0x0 */ File *file;
|
2023-08-28 02:56:09 +00:00
|
|
|
/* 0x4 */ u8 *data;
|
2023-09-02 05:46:26 +00:00
|
|
|
} OpenedFile;
|
2018-01-21 21:51:04 +00:00
|
|
|
|
2023-08-28 02:56:09 +00:00
|
|
|
// size: 0x10
|
2023-09-02 05:46:26 +00:00
|
|
|
typedef struct FileArchive
|
2018-01-21 21:51:04 +00:00
|
|
|
{
|
2023-08-28 02:56:09 +00:00
|
|
|
/* 0x0 */ char magic[8];
|
|
|
|
/* 0x8 */ s32 count;
|
2023-09-02 05:46:26 +00:00
|
|
|
/* 0xC */ File *entries;
|
|
|
|
} FileArchive;
|
2018-01-21 21:51:04 +00:00
|
|
|
|
2023-08-28 02:56:09 +00:00
|
|
|
// size: 0x8
|
2023-09-02 05:46:26 +00:00
|
|
|
typedef struct SiroArchive
|
2018-01-21 21:51:04 +00:00
|
|
|
{
|
2023-08-28 02:56:09 +00:00
|
|
|
/* 0x0 */ u32 magic;
|
|
|
|
/* 0x4 */ u8 *data;
|
2023-09-02 05:46:26 +00:00
|
|
|
} SiroArchive;
|
2018-01-21 21:51:04 +00:00
|
|
|
|
2023-08-28 02:56:09 +00:00
|
|
|
// size: 0x8
|
2023-09-07 07:26:32 +00:00
|
|
|
typedef struct UnkFileStruct
|
2020-09-21 06:40:48 +00:00
|
|
|
{
|
2023-09-02 05:46:26 +00:00
|
|
|
/* 0x0 */ u32 unk0;
|
|
|
|
/* 0x4 */ u32 unk4;
|
2023-09-07 07:26:32 +00:00
|
|
|
} UnkFileStruct;
|
2020-09-21 06:40:48 +00:00
|
|
|
|
2023-09-09 23:53:10 +00:00
|
|
|
OpenedFile *Call_OpenFileAndGetFileDataPtr(const u8 *filename, const FileArchive *arc);
|
|
|
|
void CloseFile(OpenedFile *openedFile);
|
|
|
|
u8 *GetFileDataPtr(OpenedFile *openedFile, s32 unused);
|
2023-08-06 07:10:51 +00:00
|
|
|
void InitFileSystem(void);
|
2023-09-09 23:53:10 +00:00
|
|
|
OpenedFile *OpenFile(const u8 *filename, const FileArchive *arc);
|
|
|
|
OpenedFile *OpenFileAndGetFileDataPtr(const u8 *filename, const FileArchive *arc);
|
2023-09-07 07:26:32 +00:00
|
|
|
|
2023-09-09 23:53:10 +00:00
|
|
|
u32 sub_800A8F8(u32 value);
|
2018-01-21 21:51:04 +00:00
|
|
|
|
|
|
|
#endif //GUARD_FILE_SYSTEM_H
|