Skip to content

Commit 664a947

Browse files
authored
Improve clarity of Tile Data page (#570)
Some suggestions by @bbbbbr, thank you!
1 parent 4dd33d4 commit 664a947

File tree

1 file changed

+40
-50
lines changed

1 file changed

+40
-50
lines changed

src/Tile_Data.md

Lines changed: 40 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -14,59 +14,49 @@ objects behind it to show through.
1414

1515
There are three "blocks" of 128 tiles each:
1616

17-
<table>
18-
<thead>
19-
<tr>
20-
<th rowspan="2">Block</th>
21-
<th rowspan="2">VRAM Address</th>
22-
<th colspan="3">Corresponding Tile IDs</th>
23-
</tr>
24-
<tr>
25-
<td>Objects</td>
26-
<td>BG/Win if LCDC.4=1</td>
27-
<td>BG/Win if LCDC.4=0</td>
28-
</tr>
29-
</thead>
30-
<tbody>
31-
<tr>
32-
<td>0</td>
33-
<td>$8000&ndash;$87FF</td>
34-
<td>0&ndash;127</td>
35-
<td>0&ndash;127</td>
36-
<td></td>
37-
</tr>
38-
<tr>
39-
<td>1</td>
40-
<td>$8800&ndash;$8FFF</td>
41-
<td>128&ndash;255</td>
42-
<td>128&ndash;255</td>
43-
<td>
44-
128&ndash;255 <br />
45-
(or -128&ndash;-1)
46-
</td>
47-
</tr>
48-
<tr>
49-
<td>2</td>
50-
<td>$9000&ndash;$97FF</td>
51-
<td colspan="2">(Can't use)</td>
52-
<td>0&ndash;127</td>
53-
</tr>
54-
</tbody>
55-
</table>
17+
<div class="table-wrapper" style="text-align: center;"><table><thead>
18+
<tr>
19+
<th rowspan=2>Tile IDs for...</th>
20+
<th>Block 0</th>
21+
<th>Block 1</th>
22+
<th>Block 2</th>
23+
</tr>
24+
<tr>
25+
<th>$8000–87FF</th>
26+
<th>$8800–8FFF</th>
27+
<th>$9000–97FF</th>
28+
</tr>
29+
</thead><tbody>
30+
<tr>
31+
<td><strong>Objects</strong></td>
32+
<td>0–127</td>
33+
<td>128–255</td>
34+
<td>—</td>
35+
</tr>
36+
<tr>
37+
<td><strong>BG/Win</strong>, if LCDC.4=1</td>
38+
<td>0–127</td>
39+
<td>128–255</td>
40+
<td>—</td>
41+
</tr>
42+
<tr>
43+
<td><strong>BG/Win</strong>, if LCDC.4=0</td>
44+
<td>—</td>
45+
<td>128–255</td>
46+
<td>0–127</td>
47+
</tr>
48+
</tbody></table></div>
49+
50+
Tiles are always indexed using an 8-bit integer, but the addressing method may differ:
51+
52+
- The "**$8000 method**" uses \$8000 as its base pointer and uses an unsigned addressing, meaning that tiles 0-127 are in block 0, and tiles 128-255 are in block 1.
53+
- The "**$8800 method**" uses \$9000 as its base pointer and uses a signed addressing, meaning that tiles 0-127 are in block 2, and tiles -128 to -1 are in block 1; or, to put it differently, "$8800 addressing" takes tiles 0-127 from block 2 and tiles 128-255 from block 1.
5654

55+
(You can notice that block 1 is shared by both addressing methods)
5756

58-
Tiles are always indexed using an 8-bit integer, but the addressing
59-
method may differ. The "$8000 method" uses \$8000 as its base pointer
60-
and uses an unsigned addressing, meaning that tiles 0-127 are in block
61-
0, and tiles 128-255 are in block 1. The "$8800 method" uses \$9000 as
62-
its base pointer and uses a signed addressing, meaning that tiles 0-127
63-
are in block 2, and tiles -128 to -1 are in block 1, or to put it differently,
64-
"$8800 addressing" takes tiles 0-127 from block 2
65-
and tiles 128-255 from block 1. (You can notice that block 1 is shared
66-
by both addressing methods)
57+
Objects always use "$8000 addressing", but the BG and Window can use either mode, controlled by [LCDC bit 4](<#LCDC.4 — BG and Window tile data area>).
6758

68-
Objects always use "$8000 addressing", but the BG and Window can use either
69-
mode, controlled by [LCDC bit 4](<#LCDC.4 — BG and Window tile data area>).
59+
## Data format
7060

7161
Each tile occupies 16 bytes, where each line is represented by 2 bytes:
7262

0 commit comments

Comments
 (0)