EarthBound/Map Data/Compressed Tileset Character Data: Difference between revisions

From Data Crystal
Jump to navigation Jump to search
(→‎Blocks: Finish documenting block contents)
 
(10 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{subpage|game=EarthBound:ROM map}}
{{subpage|game=EarthBound:ROM map}}
Data blocks storing compressed raw graphics for map tilesets. Data for a given map tileset is found using the [[EarthBound:Map_Data:Tileset_Pointer_Table|Tileset Pointer Table]].


==Blocks==
==Blocks==
Line 9: Line 11:
|end=<tt>0x19FE17</tt>
|end=<tt>0x19FE17</tt>
|numentries=1
|numentries=1
|entrylength=Varies
|entrylength=Varies, 28673 bytes (<tt>0x7001</tt>) after decompression
|totallength=11718 bytes (<tt>0x2dc6</tt>)
|totallength=11718 bytes (<tt>0x2dc6</tt>), 28673 bytes (<tt>0x7001</tt>) after decompression
}}
}}


Line 27: Line 29:
|end=<tt>0x1CD836</tt>
|end=<tt>0x1CD836</tt>
|numentries=1
|numentries=1
|entrylength=Varies
|entrylength=Varies, 28673 bytes (<tt>0x7001</tt>) after decompression
|totallength=9748 bytes (<tt>0x2614</tt>)
|totallength=9748 bytes (<tt>0x2614</tt>), 28673 bytes (<tt>0x7001</tt>) after decompression
}}
}}


Line 45: Line 47:
|end=<tt>0x1E00CD</tt>
|end=<tt>0x1E00CD</tt>
|numentries=6
|numentries=6
|entrylength=Varies
|entrylength=Varies, 28673 bytes (<tt>0x7001</tt>) after decompression
|totallength=65229 bytes (<tt>0xFECE</tt>)
|totallength=65230 bytes (<tt>0xFECE</tt>), 172038 bytes (<tt>0x02A006</tt>) after decompression
}}
}}


Line 66: Line 68:


{{clear}}
{{clear}}
===Block 4===
===Block 4===
{{Infobox table|name=Map Data: Compressed Tileset Character Data, Block 4
{{Infobox table|name=Map Data: Compressed Tileset Character Data, Block 4
Line 73: Line 76:
|end=<tt>0x1EF2E6</tt>
|end=<tt>0x1EF2E6</tt>
|numentries=6
|numentries=6
|entrylength=Varies
|entrylength=Varies, 28673 bytes (<tt>0x7001</tt>) after decompression
|totallength=61671 bytes (<tt>0xF0E7</tt>)
|totallength=61671 bytes (<tt>0xF0E7</tt>), 172038 bytes (<tt>0x02A006</tt>) after decompression
}}
}}


Line 90: Line 93:
| <tt>0x1ea301</tt> || [[EarthBound:Map_Data:Global_Tileset/Palette_Table#Indoors1|Indoors 1]] || <tt>10</tt> || 11577 bytes (<tt>0x2D39</tt>)
| <tt>0x1ea301</tt> || [[EarthBound:Map_Data:Global_Tileset/Palette_Table#Indoors1|Indoors 1]] || <tt>10</tt> || 11577 bytes (<tt>0x2D39</tt>)
|-
|-
| <tt>0x1ed03a</tt> || [[EarthBound:Map_Data:Global_Tileset/Palette_Table#Indoors2|Indoors 2]] || <tt>11</tt> || 8877 bytes(<tt>0x22AD</tt>)
| <tt>0x1ed03a</tt> || [[EarthBound:Map_Data:Global_Tileset/Palette_Table#Indoors2|Indoors 2]] || <tt>11</tt> || 8877 bytes (<tt>0x22AD</tt>)
|}
|}


{{clear}}
{{clear}}
===Block 5===
===Block 5===
{{Infobox table|name=Map Data: Compressed Tileset Character Data, Block 5
{{Infobox table|name=Map Data: Compressed Tileset Character Data, Block 5
Line 101: Line 105:
|end=<tt>0x1FC442</tt>
|end=<tt>0x1FC442</tt>
|numentries=6
|numentries=6
|entrylength=Varies
|entrylength=Varies, 28673 bytes (<tt>0x7001</tt>) after decompression
|totallength=49731 bytes (<tt>0xC243</tt>)
|totallength=49731 bytes (<tt>0xC243</tt>), 172038 bytes (<tt>0x02A006</tt>) after decompression
}}
}}


Line 125: Line 129:
==Format==
==Format==


===Decompressed Format===
Data for each map tileset is individually compressed. See [[EarthBound:ASM:Decompression_Routine#CompressionFormat|Compression Format]].
{{stub}}
 
===Decompressed Format<span class="anchor" id="DecompressedFormat"></span>===
 
Each entry, once decompressed, consists of 896 tileset characters, each a 4-bits-per-pixel 8x8 [https://snes.nesdev.org/wiki/Tiles SNES graphics tile] (sometimes referred to as a "minitile" by EarthBound modders). Each entry ends with a single null byte (<code>0x00</code>). At 32 bytes per character plus the final null byte, each entry is a total of 28673 bytes (<tt>0x7001</tt>) after decompression.
 
The first 512 characters represent background tiles that will be loaded into [https://snes.nesdev.org/wiki/Backgrounds SNES background] layer 1 (BG1) and appear behind sprites. The remaining 384 characters represent foreground tiles that will be loaded into SNES background layer 2 (BG2) with the [https://snes.nesdev.org/wiki/Tilemaps BG priority bit] set and may appear in front of sprites, depending on the [[EarthBound:Map_Data:Tile_Arrangement_Collision_Data#Tile_Format|collision flags]] of the tile the sprite entity is positioned on. The characters at indices <tt>000</tt> and <tt>512</tt> (the first background tile and the first foreground tile) are always completely transparent.
 
EarthBound ROM tilemap data does not specify the background vs foreground tiles separately. Instead, character indices are always specified between [<tt>000</tt>, <tt>512</tt>) to specify both tiles jointly. If a tilemap specifies a character with index less than <tt>384</tt>, both background and forground tiles are loaded using that index into the respective sections of the tileset characters, and the foreground tile is loaded with the [https://snes.nesdev.org/wiki/Tilemaps BG priority bit] set. If a tilemap specifies a character index greater than or equal to <tt>384</tt> only a background tile will be loaded. (Technically, for an index greater than or equal to <tt>384</tt>, EarthBound will still load a character into BG2 using character index <tt>000</tt> from the foreground section of tileset characters (overall character index <tt>512</tt>), which is always completely transparent, and will additionally not set the BG priority bit, thus rendering that BG2 character behind BG1 and behind any sprites.)
 
[[Category:EarthBound:Map_Data|Compressed Tileset Character Data]]

Latest revision as of 02:41, 24 January 2024

This is a sub-page of EarthBound/Map Data.

Data blocks storing compressed raw graphics for map tilesets. Data for a given map tileset is found using the Tileset Pointer Table.

Blocks

Block 1

Map Data: Compressed Tileset Character Data, Block 1
Game EarthBound
Start Address 0x19D052
End Address 0x19FE17
# of Entries 1
Entry Length Varies, 28673 bytes (0x7001) after decompression
Total Length 11718 bytes (0x2dc6), 28673 bytes (0x7001) after decompression
Back to the ROM map
Address Tileset name Tileset index Compressed length
0x19D052 Caves 1 13 11718 bytes (0x2dc6)

Block 2

Map Data: Compressed Tileset Character Data, Block 2
Game EarthBound
Start Address 0x1CB223
End Address 0x1CD836
# of Entries 1
Entry Length Varies, 28673 bytes (0x7001) after decompression
Total Length 9748 bytes (0x2614), 28673 bytes (0x7001) after decompression
Back to the ROM map
Address Tileset name Tileset index Compressed length
0x1CB223 Indoors 3 14 9748 bytes (0x2614)

Block 3

Map Data: Compressed Tileset Character Data, Block 3
Game EarthBound
Start Address 0x1D0200
End Address 0x1E00CD
# of Entries 6
Entry Length Varies, 28673 bytes (0x7001) after decompression
Total Length 65230 bytes (0xFECE), 172038 bytes (0x02A006) after decompression
Back to the ROM map
Address Tileset name Tileset index Compressed length
0x1D0200 Lost Underworld 00 12948 bytes (0x3294)
0x1d3494 Onett 01 11395 bytes (0x2C83)
0x1d6117 Dalaam 09 10891 bytes (0x2A8B)
0x1d8ba2 Threed 03 11823 bytes (0x2E2F)
0x1db9d1 Fourside 04 10090 bytes (0x276A)
0x1de13b Magicant 05 8083 bytes (0x1F93)

Block 4

Map Data: Compressed Tileset Character Data, Block 4
Game EarthBound
Start Address 0x1E0200
End Address 0x1EF2E6
# of Entries 6
Entry Length Varies, 28673 bytes (0x7001) after decompression
Total Length 61671 bytes (0xF0E7), 172038 bytes (0x02A006) after decompression
Back to the ROM map
Address Tileset name Tileset index Compressed length
0x1E0200 Outdoors 06 13001 bytes (0x32C9)
0x1e34c9 Summers 07 8566 bytes (0x2176)
0x1e563f Dusty Dunes Desert 08 8255 bytes (0x203F)
0x1e767e Twoson 02 11395 bytes (0x2C83)
0x1ea301 Indoors 1 10 11577 bytes (0x2D39)
0x1ed03a Indoors 2 11 8877 bytes (0x22AD)

Block 5

Map Data: Compressed Tileset Character Data, Block 5
Game EarthBound
Start Address 0x1F0200
End Address 0x1FC442
# of Entries 6
Entry Length Varies, 28673 bytes (0x7001) after decompression
Total Length 49731 bytes (0xC243), 172038 bytes (0x02A006) after decompression
Back to the ROM map
Address Tileset name Tileset index Compressed length
0x1F0200 Stores 1 12 10552 bytes (0x2938)
0x1f2b38 Indoors 4 16 10226 bytes (0x27F2)
0x1f532a Winters 17 6846 bytes (0x1ABE)
0x1f6de8 Scaraba 18 5539 bytes (0x15A3)
0x1f838b Caves 2 19 7628 bytes (0x1DCC)
0x1fa157 Stores 2 15 8940 bytes (0x22EC)

Format

Data for each map tileset is individually compressed. See Compression Format.

Decompressed Format

Each entry, once decompressed, consists of 896 tileset characters, each a 4-bits-per-pixel 8x8 SNES graphics tile (sometimes referred to as a "minitile" by EarthBound modders). Each entry ends with a single null byte (0x00). At 32 bytes per character plus the final null byte, each entry is a total of 28673 bytes (0x7001) after decompression.

The first 512 characters represent background tiles that will be loaded into SNES background layer 1 (BG1) and appear behind sprites. The remaining 384 characters represent foreground tiles that will be loaded into SNES background layer 2 (BG2) with the BG priority bit set and may appear in front of sprites, depending on the collision flags of the tile the sprite entity is positioned on. The characters at indices 000 and 512 (the first background tile and the first foreground tile) are always completely transparent.

EarthBound ROM tilemap data does not specify the background vs foreground tiles separately. Instead, character indices are always specified between [000, 512) to specify both tiles jointly. If a tilemap specifies a character with index less than 384, both background and forground tiles are loaded using that index into the respective sections of the tileset characters, and the foreground tile is loaded with the BG priority bit set. If a tilemap specifies a character index greater than or equal to 384 only a background tile will be loaded. (Technically, for an index greater than or equal to 384, EarthBound will still load a character into BG2 using character index 000 from the foreground section of tileset characters (overall character index 512), which is always completely transparent, and will additionally not set the BG priority bit, thus rendering that BG2 character behind BG1 and behind any sprites.)