Skip to content

Commit cd3783f

Browse files
alloncmISSOtm
andauthored
Update Tile_Maps
Co-authored-by: Eldred Habert <[email protected]>
1 parent 3b0eb4a commit cd3783f

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/Tile_Maps.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ the one at `0:9800`!
3939

4040
### BG-to-OBJ Priority in CGB Mode
4141

42-
In the CGB mode there are 3 different places where the priority between the BG (and window) layer and the OBJ layer is declared:
42+
In CGB Mode, the priority between the BG (and window) layer and the OBJ layer is declared in three different places:
4343
1. [BG Map Attribute bit 7](#bg-map-attributes-cgb-mode-only) - BG-to-OAM Priority (CGB Mode)
4444
2. [LCDC bit 0](LCDC.md#lcdc0--bg-and-window-enablepriority) - BG and Window Priority (CGB Mode)
4545
3. [OAM Attributes bit 7](OAM.md#byte-3--attributesflags) - BG and Window over OBJ
@@ -53,23 +53,23 @@ OAM Attributes bit 7 will grant OBJ priority when clear and not when set
5353

5454
:::
5555

56-
| OAM Attributes bit 7 | BG Map Attribute bit 7 | LCDC bit 0 | Priority |
57-
| :--------------------: | :----------------------: | :----------: | -------- |
58-
| 0 | 1 | 1 | BG color 0 - OBJ, otherwise BG |
59-
| 0 | 1 | 0 | OBJ |
60-
| 1 | 0 | 1 | BG color 0 - OBJ, otherwise BG |
61-
| 1 | 1 | 1 | BG color 0 - OBJ, otherwise BG |
62-
| 0 | 0 | 1 | OBJ |
63-
| 0 | 0 | 0 | OBJ |
64-
| 1 | 1 | 0 | OBJ |
65-
| 1 | 0 | 0 | OBJ |
56+
LCDC bit 0 | OAM attr bit 7 | BG attr bit 7 | Priority
57+
:---------:|:--------------:|:-------------:|---------
58+
0 | 0 | 0 | OBJ
59+
0 | 0 | 1 | OBJ
60+
0 | 1 | 0 | OBJ
61+
0 | 1 | 1 | OBJ
62+
1 | 0 | 0 | OBJ
63+
1 | 0 | 1 | BG color 1–3, otherwise OBJ
64+
1 | 1 | 0 | BG color 1–3, otherwise OBJ
65+
1 | 1 | 1 | BG color 1–3, otherwise OBJ
6666

6767
From the table we can infer the following:
6868
* When the BG color is 0 the OBJ will always have priority (ignoring the flags)
6969
* When LCDC bit 0 is clear OBJ will always have priority (ignoring the rest of the flags)
7070
* In order to grant the BG priority (color 1-3) LCDC bit 0 must be set and if OAM attributes bit 7 is clear BG Map attributes bit 7 must be set to override it
7171

72-
A test ROM for this behavior can be found [here](https://github.com/alloncm/MagenTests)
72+
[This test ROM](https://github.com/alloncm/MagenTests) can be used to observe the above.
7373

7474
## Background (BG)
7575

0 commit comments

Comments
 (0)