Files
st/include/files.h
T
Yanis 5e934a8c9b Decompile overlay 24 (Part 3) (#68)
* name func_01ffd3d8 and func_01ffd400

* name func_01ffd3b0

* match func_ov024_020cf9d4 + improve the Random struct

* UnkStruct_027e0cf8_00_0C_024 45%

* match PassengerManager::GetRandomIndex

* UnkStruct_027e0cf8_00_0C_024 OK

* UnkStruct_027e0cf8_00_0C_024: do other sections

* UnkStruct_027e0cf8_08_024 55%

* cleanup: remplace delete into null by the delete macro

* UnkStruct_027e0cf8_08_024 OK

* fix build issues

* UnkStruct_ov024_020d86a0_024 OK

* PlayerActor_A0_38_024 .text OK, CreditsEndingType OK

* tools: create courselist.py to convert .CLB data to yaml

* UnkDataStruct4_14 OK

* UnkDataStruct4 17%

* UnkDataStruct4 OK

* MiscAdvManager OK

* PassengerManager OK

* fix build issues

* ZeldaTrainBinary OK

* mark PassengerManager as complete and adjust delinks

* UnkStruct_027e0cf8_08_00_024 OK

* document more of UnkStruct_027e0ce0

* savefile hotfixes

* UnkStruct_027e0ce0_34_024 OK

* code_020d46b4_024 OK

* UnkStruct_027e0d00 & UnkStruct_027e0d00_20 OK

* code_020d51dc_024 OK

* fix weird formatting

* UnkTrainSystem1 OK

* fix jp broken match

* UnkTrainSystem2 OK

* UnkStruct_027e0d08_024 31%

* fix build issues

* UnkStruct_027e0d08 OK!!!

* remove useless parenthesis

* ActorUnk_ov000_020a8bb0_EC OK

* move ActorUnk_ov000_020a8bb0_EC to MainGame/Actor/

* ActorUnkOBPC OK

* add sjiswrap support

* solve remaining gaps and fix build issues

* reorganise files + counter docs

* tools: remove format command execution from defaults
2026-06-09 23:01:32 +02:00

173 lines
4.5 KiB
C

#pragma once
#include "Map/MapObjectId.hpp"
#include "types.h"
#include <nitro/math.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef u32 FileType;
enum FileType_ {
FileType_ZOB = 'BLOZ',
FileType_ZTB = '1BTZ',
FileType_ZMB = '1BMZ',
};
typedef struct FileInfos {
/* 00 */ void *pFile;
/* 04 */ size_t size;
} FileInfos;
// .zob
typedef struct ZeldaObjectList {
/* 00 */ FileType type; // always "ZOLB"
/* 04 */ unk32 nSize; // file size?
/* 08 */ unk16 unk_08;
/* 0A */ unk16 unk_0a;
/* 0C */ u16 nEntries; // number of entries
/* 0E */ unk16 unk_0e;
/* 10 */ u32 aIdList[]; // actor id or map object id
} ZeldaObjectList;
// .ztb
typedef u32 ZTBSectionType;
enum ZTBSectionType_ {
ZTBSectionType_GRDB = 'GRDB', // grid block?
ZTBSectionType_GRRL = 'GRRL', // grid rail?
ZTBSectionType_STAB = 'STAB', // station block
ZTBSectionType_LDMK = 'LDMK', // land mark?
};
typedef struct ZTBHeader {
/* 00 */ u32 magic; // 'MTRB'
/* 04 */ FileType type; // always "ZTB1"
/* 08 */ size_t nSize;
/* 0C */ u32 nEntries;
/* 10 */ u8 unused[0x10];
} ZTBHeader; // size = 0x20
typedef struct ZTBSectionHeader {
/* 00 */ ZTBSectionType type;
/* 04 */ size_t nSize;
/* 08 */ union {
u16 nEntries;
struct {
u8 nEntries1;
u8 nEntries2;
};
};
/* 0A */ u8 unk_0A;
/* 0B */ u8 unk_0B;
} ZTBSectionHeader; // size = 0x0C
typedef struct ZTBEntryGRDB {
/* 00 */ u8 unk_00;
/* 01 */ u8 unk_01;
/* 02 */ u8 unk_02;
/* 03 */ u8 unk_03;
} ZTBEntryGRDB; // size = 0x04
typedef struct ZTBEntryGRRL {
/* 00 */ u8 unk_00;
/* 01 */ u8 unk_01;
/* 02 */ u8 unk_02;
/* 03 */ u8 unk_03;
/* 04 */ u8 unk_04;
/* 05 */ u8 unk_05;
/* 06 */ u16 unk_06;
} ZTBEntryGRRL; // size = 0x08
typedef struct ZTBEntrySTAB {
/* 00 */ char sceneName[16];
/* 10 */ u8 unk_10;
/* 11 */ u8 unk_11;
/* 12 */ u8 unk_12;
/* 13 */ u8 unk_13;
} ZTBEntrySTAB; // size = 0x14
typedef struct ZTBEntryLDMK {
/* 00 */ u8 unk_00;
/* 01 */ u8 unk_01;
/* 02 */ u8 unk_02;
/* 03 */ u8 unk_03;
} ZTBEntryLDMK; // size = 0x04
typedef struct ZTBSectionGRDB {
/* 00 */ ZTBSectionHeader header;
/* 0C */ ZTBEntryGRDB entries[];
} ZTBSectionGRDB;
typedef struct ZTBSectionGRRL {
/* 00 */ ZTBSectionHeader header;
/* 0C */ ZTBEntryGRRL entries[];
} ZTBSectionGRRL;
typedef struct ZTBSectionSTAB {
/* 00 */ ZTBSectionHeader header;
/* 0C */ ZTBEntrySTAB entries[];
} ZTBSectionSTAB;
typedef struct ZTBSectionLDMK {
/* 00 */ ZTBSectionHeader header;
/* 0C */ ZTBEntryLDMK entries[];
} ZTBSectionLDMK;
struct UnkDataStruct4;
extern BOOL ZTB_ParseFile(FileInfos *pFileInfos, UnkDataStruct4 *pDst);
extern BOOL ZTB_ParseGRDB(FileInfos *pFileInfos, UnkDataStruct4 *pDst, ZTBSectionGRDB *pGRDB);
extern BOOL ZTB_ParseGRRL(FileInfos *pFileInfos, UnkDataStruct4 *pDst, ZTBSectionGRRL *pGRRL);
extern BOOL ZTB_ParseSTAB(FileInfos *pFileInfos, UnkDataStruct4 *pDst, ZTBSectionSTAB *pSTAB);
extern BOOL ZTB_ParseLDMK(FileInfos *pFileInfos, UnkDataStruct4 *pDst, ZTBSectionLDMK *pLDMK);
// .zmb
typedef u32 ZMBSectionType;
enum ZMBSectionType_ {
ZMBSectionType_LDLB = 'LDLB', // related to script triggers
ZMBSectionType_ROMB = 'ROMB', // unknown
ZMBSectionType_ROOB = 'ROOM', // room settings
ZMBSectionType_ARAB = 'ARAB', // locations? (?)
ZMBSectionType_RALB = 'RALB', // paths?
ZMBSectionType_WARP = 'WARP', // exits?
ZMBSectionType_CAME = 'CAME', // camera settings?
ZMBSectionType_PLYR = 'PLYR', // player entrances?
ZMBSectionType_MPOB = 'MPOB', // map object list, parameters are stored here
ZMBSectionType_NPCA = 'NPCA', // actor list, same as above
};
typedef struct ZMBHeader {
/* 00 */ u32 magic; // 'MAPB'
/* 04 */ FileType type; // always "ZMB1"
/* 08 */ size_t nSize;
/* 0C */ u32 nEntries;
/* 10 */ u8 unused[0x10];
} ZMBHeader; // size = 0x20
typedef struct ZMBSectionHeader {
/* 00 */ ZMBSectionType type;
/* 04 */ size_t nSize;
/* 08 */ u16 nEntries;
/* 0A */ u8 unk_0A;
/* 0B */ u8 unk_0B;
} ZMBSectionHeader; // size = 0x0C
typedef struct ZMBEntryRALB {
/* 00 */ u8 unk_00;
/* 01 */ u8 unk_01;
/* 02 */ u8 unk_02;
/* 03 */ u8 unk_03;
/* 04 */ unk32 unk_04;
} ZMBEntryRALB; // size = 0x08
typedef struct ZMBSectionRALB {
/* 00 */ ZMBSectionHeader header;
/* 0C */ ZMBEntryRALB entries[];
} ZMBSectionRALB;
#ifdef __cplusplus
} // extern "C"
#endif