Mother 3/Map tile data table: Difference between revisions

From Data Crystal
Jump to navigation Jump to search
(Created page with "{{Infobox table|name=Map tile data table |game=MOTHER 3 |loc=ROM |start=0x104D9CC |end=0x111DEB3 |numentries=1000 (0x3E8) |entrylength=Variable |totallength=853224 bytes (0xD0...")
 
Line 21: Line 21:
* <tt>00-01 (02)</tt> = Bitfield
* <tt>00-01 (02)</tt> = Bitfield
** <tt>0x0001</tt> = Collision flag?
** <tt>0x0001</tt> = Collision flag?
** <tt>0x0008</tt> = Door flag. If a door is to be used on this file, this bit must be set or else the door won't do anything.
** <tt>0x0008</tt> = Door flag. If a door is to be used on this tile, this bit must be set or else the door won't do anything.
** <tt>0xFFF6</tt> = ''Unclassified data''
** <tt>0xFFF6</tt> = ''Unclassified data''
* <tt>02-03 (02)</tt> = Bitfield
* <tt>02-03 (02)</tt> = Bitfield

Revision as of 22:37, 6 August 2013

Map tile data table
Game MOTHER 3
Start Address 0x104D9CC
End Address 0x111DEB3
# of Entries 1000 (0x3E8)
Entry Length Variable
Total Length 853224 bytes (0xD04E8)
Back to the ROM map

Overview

This table contains info for the 16x16 tiles of each map. There is an offset table at the beginning. There is one entry for each of the game's 1000 maps. The tile data is compressed. All tile data blocks in MOTHER 3 end up being 0x1800 bytes long once uncompressed.

Format

Once uncompressed, you end up with a table of 8-byte entries. There should be 0x300 entries (for a total of 0x1800 bytes). The table is indexed by the tile number for each tilemap entry in the layer being displayed.

Every 0x40 entries corresponds to one of the map's 12 tilesets. Even if a map is using a null tileset, there still needs to be 0x40 corresponding null entries in this table. This is to enforce a total entry count of (0x40 * 12 = ) 0x300. So, to figure out which of the 12 tilesets should be used when displaying a tile, simply use the upper 4 bits of the tile number (from the tilemap entry).

Each entry represents a 16x16 pixel area on the map, composed of four 8x8 pixel minitiles. The 8 bytes of each entry are formatted as follows: (coordinates are (x, y))

  • 00-01 (02) = Bitfield
    • 0x0001 = Collision flag?
    • 0x0008 = Door flag. If a door is to be used on this tile, this bit must be set or else the door won't do anything.
    • 0xFFF6 = Unclassified data
  • 02-03 (02) = Bitfield
    • 0x0001 = Minitile (0, 0) visibility. Must be set to 1 for the minitile at (0, 0) to be displayed.
    • 0x0002 = Minitile (1, 0) visibility.
    • 0x0004 = Minitile (0, 1) visibility.
    • 0x0008 = Minitile (1, 1) visibility.
    • 0xFFF0 = Unclassified data
  • 04-04 (01) = Minitile (0, 0) bitfield
    • 0x3F = Minitile number (index into the graphics tileset)
    • 0x40 = Horizontal flip
    • 0x80 = Vertical flip
  • 05-05 (01) = Minitile (1, 0) bitfield
  • 06-06 (01) = Minitile (0, 1) bitfield
  • 07-07 (01) = Minitile (1, 1) bitfield