mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-05-24 15:00:55 -04:00
81d679d207
Use less strict compiler flags instead of modifying source code Add ugly defines so MSVC stops complaining about zero length arrays
47 lines
1.6 KiB
C
47 lines
1.6 KiB
C
#ifndef JMESSAGE_H
|
|
#define JMESSAGE_H
|
|
|
|
#include <dolphin/dolphin.h>
|
|
|
|
// Struct definitions might be wrong
|
|
typedef struct bmg_header_t {
|
|
/* 0x00 */ char magic[8]; // "MESGbmg1"
|
|
/* 0x08 */ u32 size; // total size of file not including FLW1/FLI1 sections
|
|
/* 0x0C */ u32 n_sections; // number of sections
|
|
/* 0x10 */ u8 encoding; // text encoding
|
|
/* 0x11 */ u8 padding[0x20 - 0x11]; // padding
|
|
} bmg_header_t;
|
|
|
|
typedef struct bmg_section_t {
|
|
/* 0x0 */ u32 magic; // four character magic string
|
|
/* 0x4 */ u32 size; // total size of the section
|
|
} bmg_section_t;
|
|
|
|
typedef struct inf1_entry_t {
|
|
/* 0x0 */ u32 string_offset; // offset into DAT1 section entries, pointing to where message text starts
|
|
/* 0x4 */ // attributes // attribute data. size fills up the rest of defined INF1 "entry_size"
|
|
} inf1_entry_t;
|
|
|
|
typedef struct inf1_section_t {
|
|
/* 0x00 */ bmg_section_t header; // section header
|
|
/* 0x08 */ u16 entry_num; // number of entries in this section
|
|
/* 0x0A */ u16 entry_size; // size of an entry
|
|
/* 0x0C */ u8 padding[4]; // padding
|
|
} inf1_section_t;
|
|
|
|
typedef struct str1_entry_t {
|
|
char str[0];
|
|
} str1_entry_t;
|
|
|
|
typedef struct str1_section_t {
|
|
/* 0x00 */ bmg_section_t header; // section header
|
|
#ifdef _MSVC_LANG
|
|
str1_entry_t* __get_entries() const { return (str1_entry_t*)(this + 1); }
|
|
__declspec(property(get = __get_entries)) str1_entry_t* entries;
|
|
#else
|
|
/* 0x08 */ str1_entry_t entries[0];
|
|
#endif
|
|
} str1_section_t;
|
|
|
|
#endif /* JMESSAGE_H */
|