Skip to content

MGB file format

Kyuchumimo edited this page Nov 17, 2024 · 9 revisions

MGB is the file format that Magellan exports containing binary data.

  • 0x00: BIN_HEADER_MAG
    MG
  • 0x02: BIN_HEADER_VER
    02
  • 0x04: chunkFlags
    It is used to indicate what type of content the binary has.
Colorset Chunk  -> 1 << 1  
Character Chunk -> 1 << 2  
Sprite Chunk    -> 1 << 3  
  • 0x05: mapCount
    This byte indicates the number of maps available from the Map Data. If this is so, in theory you can make up to 256 maps, each with its own area.
  • 0x06: Colorset Chunk (256 bytes)
    If the option "Include Color Sets" in the export settings is checked, this chunk will appear here. This chunk contains the TMS9918 graphics color table (32 bytes).
  • 0x106: charCount
    This byte indicates the number of characters available from the Character Chunk. You can choose a range of characters to export in the export settings. The selection you have made affects this byte
  • 0x107: Character Chunk (2048 bytes)
    If the option "Include Character Data" in the export settings is checked, this chunk will appear here. This chunk contains the TMS9918 graphics pattern table (2048 bytes).
  • 0x907: spriteCount
    This byte indicates the number of sprites available from the Sprite Chunk. You can choose a range of sprites to export in the export settings. The selection you have made affects this byte
  • 0x908: Sprite Chunk (2048 bytes)
    If the option "Include Sprite Data" in the export settings is checked, this chunk will appear here. This chunk contains the TMS9918 graphics sprite patterns (2048 bytes).
  • 0x1108: BIN_MAP_HEADER_RESERVED1
    Reserved byte for Magellan use
  • 0x1109: BIN_MAP_HEADER_RESERVED2
    Reserved byte for Magellan use
  • 0x110A: BIN_MAP_HEADER_RESERVED3
    Reserved byte for Magellan use
  • 0x110B: BIN_MAP_HEADER_RESERVED4
    Reserved byte for Magellan use
  • 0x110C: map size as a series of bytes
    Map area
  • 0x1114: map columns as a byte pair
    Map width
  • 0x1116: map rows as a byte pair
    Map height
  • 0x1118: map screen color
    This byte contains the backdrop color. The backdrop color can be selected from the screen ComboBox.
  • 0x1119: Map Data
    If the option "Current Map Only" in the export settings is checked, this chunk will appear here. This chunk contains the TMS9918 graphics name table (768 bytes).

⚠️ Note: Before exporting the binary, verify that you have a single 32x24 character map and that Expanded Character Set and Graphics 1 Color Mode are checked in the options tab.
In the export settings check all boxes and cover the full range of characters and sprites.

Clone this wiki locally