Expand description
Tile data: the 384 slots at 0x8000, sixteen bytes each.
§Slots and indices
A tilemap byte is eight bits, so it names one of 256 tiles, but there are 384.
LCDC bit 4 chooses which window of 256 it names, and the two windows overlap
in the middle:
| Block | Address | Slot | Base8000 | Base8800 |
|---|---|---|---|---|
| 0 | 8000-87FF | 0-127 | index 0-127 | out of reach |
| 1 | 8800-8FFF | 128-255 | index 128-255 | index 128-255 |
| 2 | 9000-97FF | 256-383 | out of reach | index 0-127 |
Objects ignore the bit and always read as Base8000, so putting the
background on Base8800 gives each a private block and leaves block 1
shared, putting all 384 within reach at once.
Writing here addresses a slot, which means the same tile whichever mode is
set; index converts one to the byte a map needs. See
https://gbdev.io/pandocs/Tile_Data.html.
Enums§
- Addressing
- Which 256 slots a tilemap byte names, from
LCDCbit 4.
Constants§
- SLOT_
COUNT - Tile slots in one VRAM bank.
Functions§
- addressing
- Which window
LCDCcurrently selects for the background and window layers. - index
- The tilemap byte that names
slotundermode, ifmodereaches it. - set_
addressing - Select the window for the background and window layers.
- slot
- The slot a tilemap byte of
indexnames undermode. - write
- Write one tile into
slot. - write_
all - Write
datainto consecutive slots fromfirst.