Skip to content

Commit 529270a

Browse files
authored
Make the priority flag description clearer by explicitly referring to "color IDs" instead of "colors" (#595)
* Make the priority flag description clearer by explicitly referring to color IDs * Docs: Change "colors" to "color indices" to be more precise and switch to new linking syntax at the same time. * Docs: Change all occurrences of color ID to color index including a link
1 parent 215cae0 commit 529270a

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

src/Graphics.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ in 8×8 squares, called _tiles_ (or sometimes "patterns" or "characters"), often
2020
the base unit in Game Boy graphics.
2121

2222
A tile does not encode color information. Instead, a tile assigns a
23-
_color ID_ to each of its pixels, ranging from 0 to 3. For this reason,
23+
[_color indices_](<#Data format>) to each of its pixels, ranging from 0 to 3. For this reason,
2424
Game Boy graphics are also called _2bpp_ (2 bits per pixel). When a tile is used
25-
in the Background or Window, these color IDs are associated with a _palette_. When
26-
a tile is used in an object, the IDs 1 to 3 are associated with a palette, but
25+
in the Background or Window, these [color indices](<#Data format>) are associated with a _palette_. When
26+
a tile is used in an object, the indices 1 to 3 are associated with a palette, but
2727
ID 0 means transparent.
2828

2929
## Palettes

src/OAM.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ tile is "NN & \$FE", and the bottom 8×8 tile is "NN | \$01".
5353
"Attributes" 7:"Priority" 6:"Y flip" 5:"X flip" 4:"DMG palette" 3:"Bank" 2-0:"CGB palette";
5454
}}
5555

56-
- **Priority**: `0` = No, `1` = BG and Window colors 1–3 are drawn over this OBJ
56+
- **Priority**: `0` = No, `1` = BG and Window [color indices](<#Data format>) 1–3 are drawn over this OBJ
5757
- **Y flip**: `0` = Normal, `1` = Entire OBJ is vertically mirrored
5858
- **X flip**: `0` = Normal, `1` = Entire OBJ is horizontally mirrored
5959
- **DMG palette** *\[Non CGB Mode only\]*: `0` = OBP0, `1` = OBP1

src/Palettes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
### FF47 — BGP (Non-CGB Mode only): BG palette data
77

8-
This register assigns gray shades to the [color IDs](./Tile_Data.md) of the BG and Window tiles.
8+
This register assigns gray shades to the [color indices](<#Data format>) of the BG and Window tiles.
99

1010
{{#bits 8 >
1111
"Color for..." 7-6:"ID 3" 5-4:"ID 2" 3-2:"ID 1" 1-0:"ID 0";

src/Tile_Data.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,18 @@ $38 $7C` appears as follows:
8181
</figure>
8282

8383
For the first row, the values `$3C $7E` are `00111100` and `01111110` in
84-
binary. The leftmost bits are 0 and 0, thus the color ID is binary `00`, or 0.
85-
The next bits are 0 and 1, thus the color ID is binary `10`, or 2 (remember to
84+
binary. The leftmost bits are 0 and 0, thus the [color index](<#Data format>) is binary `00`, or 0.
85+
The next bits are 0 and 1, thus the [color index](<#Data format>) is binary `10`, or 2 (remember to
8686
flip the order of the bits!). The full eight-pixel row evaluates to 0 2 3 3 3 3
8787
2 0.
8888

8989
A tool for viewing tiles can be found
9090
[here](https://www.huderlem.com/demos/gameboy2bpp.html).
9191

92-
So, each pixel has a color ID of 0 to 3. The color
92+
So, each pixel has a [color index](<#Data format>) of 0 to 3. The color
9393
numbers are translated into real colors (or gray shades) depending on
9494
the current palettes, except that when the tile is used in an OBJ the
95-
color ID 0 means transparent. The palettes are defined through registers
95+
[color index](<#Data format>) 0 means transparent. The palettes are defined through registers
9696
[BGP](<#FF47 — BGP (Non-CGB Mode only): BG palette data>),
9797
[OBP0 and OBP1](<#FF48–FF49 — OBP0, OBP1 (Non-CGB Mode only): OBJ palette 0, 1 data>), and
9898
[BCPS/BGPI](<#FF68 — BCPS/BGPI (CGB Mode only): Background color palette specification / Background palette index>),

src/Tile_Maps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ entry in VRAM Bank 0, that is, 1:9800 defines the attributes for the tile at
2828
"BG attributes" 7:"Priority" 6:"Y flip" 5:"X flip" 3:"Bank" 2-0:"Color palette";
2929
}}
3030

31-
- **Priority**: `0` = No; `1` = Colors 1–3 of the corresponding BG/Window tile are drawn over OBJ, regardless of [OBJ priority](<#Byte 3 — Attributes/Flags>)
31+
- **Priority**: `0` = No; `1` = [Color indices](<#Data format>) 1–3 of the corresponding BG/Window tile are drawn over OBJ, regardless of [OBJ priority](<#Byte 3 — Attributes/Flags>)
3232
- **Y flip**: `0` = Normal; `1` = Tile is drawn vertically mirrored
3333
- **X flip**: `0` = Normal; `1` = Tile is drawn horizontally mirrored
3434
- **Bank**: `0` = Fetch tile from VRAM bank 0; `1` = Fetch tile from VRAM bank 1

0 commit comments

Comments
 (0)