MOTHER 3:Map tilemap table

From Data Crystal
Revision as of 18:28, 6 August 2013 by JeffMan (talk | contribs) (Format)
Jump to: navigation, search
Map tilemap table
Game MOTHER 3
Start Address 0xF9003C
End Address 0x104D9CB
# of Entries 3000 (0xBB8)
Entry Length Variable
Total Length 776592 bytes (0xBD990)
Back to the ROM map

Overview

This table contains all of the map tilemaps. There is an offset table at the beginning. There are three tilemaps for each map area (one for each map layer). The tilemaps are compressed. Once uncompressed, they should be exactly (width * height * 2) bytes, where the width and height are pulled from the map info table. Note that not all layers for a map may have the same dimensions, so it's important to check the map info for each layer.

Format

A tilemap is a collection of 16-bit tile entries. The entries contain the same data as a standard GBA tile entry; however, the data are ordered differently. The format of each tile entry is shown below as a bitfield:

  • 0x03FF = Tile number (index into the corresponding tile data for this map). Each tile physically represents a 16x16 pixel area. A value of 0x300 or higher indicates a null entry.
  • 0x3C00 = Sub-palette number. Each map has a set of 16 palettes, picked by the map palette info table and loaded from the map palette table. This number is an index into the 16 palettes.
  • 0x4000 = Horizontal flip. If this bit is set, the entire 16x16 tile is flipped horizontally. If any of the 8x8 minitiles within this tile already had their flip flag set, they will be double-flipped (a net flip of nothing).
  • 0x8000 = Vertical flip. Same deal as above.