From c7df9b6545aa25d82e95a94766de0903bcb89726 Mon Sep 17 00:00:00 2001 From: bbbbbr Date: Tue, 4 May 2021 13:52:12 -0700 Subject: [PATCH 1/2] Add VRAM Tile Data diagram for layout of sprites and BG/WIN --- content/Video_Display.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/content/Video_Display.md b/content/Video_Display.md index 2d5b3d0b..b38140de 100644 --- a/content/Video_Display.md +++ b/content/Video_Display.md @@ -479,6 +479,19 @@ Sprites 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). +``` + Block | VRAM Addr | Sprites | | BG/WIN | + | | | LCDC.4=1 | LCDC.4=0 | + ------------------- ------------- -------------------------- + 0 $8000-$87FF | 0 - 127 | | 0 - 127 | | + ------------------- ------------- -------------------------- + 1 $8800-$8FFF | 128 - 255 | | 128 - 255 | 128 - 255 | + | | | | (-127 - 0) | + ------------------- ------------- -------------------------- + 2 $9000-$97FF | | | (unused) | 0 - 127 | + ------------------- ------------- -------------------------- +``` + Each tile occupies 16 bytes, where each line is represented by 2 bytes: ``` From d6a5926649c05cdd45a544a82c9839874de69cef Mon Sep 17 00:00:00 2001 From: bbbbbr Date: Sun, 9 May 2021 09:59:46 -0700 Subject: [PATCH 2/2] Change VRAM Tile Data blocks to a table --- content/Video_Display.md | 60 +++++++++++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 16 deletions(-) diff --git a/content/Video_Display.md b/content/Video_Display.md index b38140de..d18e0152 100644 --- a/content/Video_Display.md +++ b/content/Video_Display.md @@ -461,9 +461,50 @@ don't use color 0 - it's transparent instead. There are three "blocks" of 128 tiles each: -- Block 0 is $8000-$87FF -- Block 1 is $8800-$8FFF -- Block 2 is $9000-$97FF + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BlockVRAM AddressSprite TilesBG/Win Tiles
if LCDC.4=1if LCDC.4=0
0$8000 - $87FF0 - 1270 - 127
1$8800 - $8FFF128 - 255128 - 255 + 128 - 255
+ or (-127 - 0) +
2$9000 - $97FF(unused)0 - 127
+ Tiles are always indexed using a 8-bit integer, but the addressing method may differ. The "$8000 method" uses \$8000 as its base pointer @@ -479,19 +520,6 @@ Sprites 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). -``` - Block | VRAM Addr | Sprites | | BG/WIN | - | | | LCDC.4=1 | LCDC.4=0 | - ------------------- ------------- -------------------------- - 0 $8000-$87FF | 0 - 127 | | 0 - 127 | | - ------------------- ------------- -------------------------- - 1 $8800-$8FFF | 128 - 255 | | 128 - 255 | 128 - 255 | - | | | | (-127 - 0) | - ------------------- ------------- -------------------------- - 2 $9000-$97FF | | | (unused) | 0 - 127 | - ------------------- ------------- -------------------------- -``` - Each tile occupies 16 bytes, where each line is represented by 2 bytes: ```