From 664a947c4e52b45232f7bd6a251284e3541f9cd4 Mon Sep 17 00:00:00 2001 From: Eldred Habert Date: Fri, 27 Sep 2024 19:25:08 +0200 Subject: [PATCH] Improve clarity of Tile Data page (#570) Some suggestions by @bbbbbr, thank you! --- src/Tile_Data.md | 90 +++++++++++++++++++++--------------------------- 1 file changed, 40 insertions(+), 50 deletions(-) diff --git a/src/Tile_Data.md b/src/Tile_Data.md index 1958035c..4d258588 100644 --- a/src/Tile_Data.md +++ b/src/Tile_Data.md @@ -14,59 +14,49 @@ objects behind it to show through. There are three "blocks" of 128 tiles each: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BlockVRAM AddressCorresponding Tile IDs
ObjectsBG/Win if LCDC.4=1BG/Win if LCDC.4=0
0$8000–$87FF0–1270–127
1$8800–$8FFF128–255128–255 - 128–255
- (or -128–-1) -
2$9000–$97FF(Can't use)0–127
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Tile IDs for...Block 0Block 1Block 2
$8000–87FF$8800–8FFF$9000–97FF
Objects0–127128–255
BG/Win, if LCDC.4=10–127128–255
BG/Win, if LCDC.4=0128–2550–127
+ +Tiles are always indexed using an 8-bit integer, but the addressing method may differ: + +- 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. +- 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. +(You can notice that block 1 is shared by both addressing methods) -Tiles are always indexed using an 8-bit integer, but the addressing -method may differ. 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. 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. (You can notice that block 1 is shared -by both addressing methods) +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>). -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>). +## Data format Each tile occupies 16 bytes, where each line is represented by 2 bytes: