| At line 1 changed one line |
| BMG files are the jnlib file format for storing text strings. The BMG file header is as follows: |
| BMG files (Binary Message) are the JSystem file format for storing message data. The format is the same as it appears in GameCube and Wii games using the JSystem library, but with little endian fields. The file header is as follows: |
| At line 9 changed one line |
| | 0x11 | u8[[0xF] | Unused? |
| | 0x11 | u8[[0xF] | Unused. |
| At line 14 changed one line |
| | 0x00 | char[[4] | Tag |
| | 0x00 | u32 | Block type |
| At line 17 added 2 lines |
| Each block's size is rounded up to a multiple of 32 bytes, and the size reported in the block header reflects this. |
|
| At line 19 changed one line |
| The {{INF1}} (info) block stores basic info about the BMG file. It takes the following structure: |
| The {{INF1}} (info) block stores the BMG message table. Each message is represented in the table with a {{JMSMesgEntry}} structure, whose structure may vary depending on the file. In general, the first 4 bytes of the structure are an offset into the {{DAT1}} block. The other data fields are game-dependent (Mario Kart does not use any extra data). |
| At line 23 changed one line |
| | 0x02 | u16 | Size of entry (always 4?) |
| | 0x02 | u16 | Size of the {{JMSMesgEntry}} struct |
| At line 27 changed one line |
| | 0x08 | u32[[...] | Offsets to strings. This is a list of offsets into the {{DAT1}} block. |
| | 0x08 | {{JMSMesgEntry}}[[...] | Offsets to strings. This is a list of offsets into the {{DAT1}} block. |
| At line 31 added 28 lines |
| !!DAT1 Block |
|
| The {{DAT1}} block stores message data. This block's data takes the form of a string pool, with data referenced by the {{INF1}} block. In files produced by the Message Editor, the block begins with an empty string, with each successive string in the file concatenated (with null terminators). |
|
| Strings may contain tags to be processed by the library. Tags are started with a character code {{1A}} (ASCII substitution character) in hex. This is followed by the following structure: |
|
| ||Offset||Type||Meaning |
| | 0x00 | u8 | Tag length (including the substitution character) |
| | 0x01 | u8 | Tag group |
| | 0x02 | u16 | Tag ID |
| | 0x04 | u8[[...] | Tag data |
|
| When UTF-16 character encoding is used, the total length of the tag is padded to a multiple of 2, and the tag length byte reflects this. |
|
| The format defines a system tag group with ID {{FF}} in hex. In this system tag group, the following tags are defined: |
|
| ||Tag ID||Meaning||Format |
| | 0 | Color | {{u8 color;}} |
| | 1 | Size | {{u16 size;}} |
| | 2 | Ruby Text | {{u8 baseLength; u8 rubyText[[0];}} |
| | 3 | Font | {{u8 font;}} |
| | 4 | Word | |
| | 5 | Message | |
| | 6 | Jump | |
| | 7 | Ruby Text Extended | {{u8 info; u8 baseLength; u8 rubyText[[0];}} |
|
| The game is free to use other tag groups for their own purposes. Mario Kart DS defines some. |
|
| At line 31 changed one line |
| !!DAT1 Block |
| This block is optional, and maps each message index to an ID. Message IDs need not be in order or consecutive. The block format is as follows: |
| At line 33 changed one line |
| The {{DAT1}} block stores message data. This block is an unstructured string pool referenced by the offset array in the {{INF1}} block. |
| ||Offset||Type||Meaning |
| | 0x00 | u16 | Number of entries. |
| | 0x02 | u8 | Info. This is {{0x00}} if the message IDs are out of order, or {{0x10}} if they are in order. |
| | 0x03 | u8 | Format. |
| | 0x04 | u8 | Reserved. |
| At line 69 added 11 lines |
| The format identifies the breakdown of bits per entry. These are broken down as: |
|
| ||Format||Bits |
| | 0 | 32 low bits, 0 high bits |
| | 1 | 24 low bits, 8 high bits |
| | 2 | 16 low bits, 16 high bits |
| | 3 | 8 low bits, 24 high bits |
| | 4 | 0 low bits, 32 high bits |
|
| Following the header is an array of ID entries. The entry at index ''i'' defines the ID of entry ''i'' in the {{INF1}} block. Each entry is 32 bits wide. |
|