Skip to content

Commit fe13a13

Browse files
committed
Overhaul "Pixel FIFO" article into "Rendering Internals"
Also avoid describing SameBoy internals, instead relying on it when otherwise corroborated, or on schematics and/or test ROMs when possible. Restructure the article to describe behavior more than components, especially in a way that is more friendly to someone not knowing what all the components are about. Add a diagram, too, and move the mode timing diagram to the STAT article, where it belongs just as well, but where it will be more visible and thus more useful.
1 parent acd54eb commit fe13a13

9 files changed

+605
-270
lines changed

custom/style.css

+9-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ html {
2424

2525
body {
2626
font-family: "Inter";
27-
/* Enable some font features for Inter (https://rsms.me/inter/#features/calt) */
27+
/* Enable some font features for Inter (https://rsms.me/inter/#features) */
2828
font-feature-settings: "ss01", /* Alternate (Open) digits */ "ss02",
29-
/* Disambiguation gliphs */ "case";
29+
/* Disambiguation glyphs */ "case", /* No contextual alternatives (e.g. 3x9 → 3×9) */ "calt" 0;
3030
/* Case alternates */
3131
letter-spacing: -0.005em;
3232
/* equals -0.5% */
@@ -112,6 +112,13 @@ code {
112112
margin: 25px 0px 25px 0px;
113113
}
114114

115+
/* Classes for custom table styling */
116+
117+
table.compact th {
118+
padding: 3px 5px;
119+
}
120+
121+
115122
/* Global CSS variables */
116123

117124
:root {

src/Power_Up_Sequence.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ It is speculated that this may be debug remnants.
106106

107107
The boot ROM is responsible for the automatic colorization of monochrome-only games when run on a GBC.
108108

109-
When in DMG compatibility mode, the [CGB palettes](<#LCD Color Palettes (CGB only)>) are still being used: the background uses BG palette 0 (likely because the entire [attribute map](<#BG Map Attributes (CGB Mode only)>) is set to all zeros), and objects use OBJ palette 0 or 1 depending on bit 4 of [their attribute](<#Byte 3 — Attributes/Flags>).
109+
When in DMG compatibility mode, the [CGB palettes](<#LCD Color Palettes (CGB only)>) are still being used: the background uses BG palette 0 (likely because the entire [attribute map](<#BG Map attributes (CGB Mode only)>) is set to all zeros), and objects use OBJ palette 0 or 1 depending on bit 4 of [their attribute](<#Byte 3 — Attributes/Flags>).
110110
[`BGP`, `OBP0`, and `OBP1`](<#LCD Monochrome Palettes>) actually index into the CGB palettes instead of the DMG's shades of grey.
111111

112112
The boot ROM picks a compatibility palette using an ID computed using the following algorithm:

src/Rendering_Internals.md

+408
Large diffs are not rendered by default.

src/STAT.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
:::tip TERMINOLOGY
44

5-
A *dot* is the shortest period over which the PPU can output one pixel: is it equivalent to 1 T-cycle on DMG or on CGB Single Speed mode or 2 T-cycles on CGB Double Speed mode. On each dot during mode 3, either the PPU outputs a pixel or the fetcher is stalling the [FIFOs](<#Pixel FIFO>).
5+
A *dot* is the shortest period over which the PPU can output one pixel: is it equivalent to 1 T-cycle on DMG or on CGB Single Speed mode or 2 T-cycles on CGB Double Speed mode. On each dot during mode 3, either the PPU outputs a pixel or the fetcher is stalling the [FIFOs](<#Rendering Internals>).
66

77
:::
88

src/SUMMARY.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
- [Scrolling](./Scrolling.md)
2424
- [Palettes](./Palettes.md)
2525
- [Rendering](./Rendering.md)
26-
- [Pixel FIFO](./pixel_fifo.md)
26+
- [Rendering internals](./Rendering_Internals.md)
2727
- [Audio](./Audio.md)
2828
- [Audio Registers](./Audio_Registers.md)
2929
- [Audio Details](./Audio_details.md)

src/Scrolling.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ scanline.
4646

4747
### Scrolling
4848

49-
The scroll registers are re-read on each [tile fetch](<#Get Tile>), except for the low 3 bits of SCX, which are only read at the beginning of the scanline (for the initial shifting of pixels).
49+
The scroll registers are re-read on each [tile fetch](<#Get tile ID>), except for the low 3 bits of SCX, which are only read at the beginning of the scanline (for the initial shifting of pixels).
5050

5151
All models before the CGB-D read the Y coordinate once for each bitplane (so a very precisely timed SCY write allows "desyncing" them), but CGB-D and later use the same Y coordinate for both no matter what.
5252

src/Tile_Maps.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ The Game Boy contains two 32×32 tile maps in VRAM at
55
the memory areas `$9800-$9BFF` and `$9C00-$9FFF`. Any of these maps can be used to
66
display the Background or the Window.
77

8-
## Tile Indexes
8+
## Tile indices
99

10-
Each tile map contains the 1-byte indexes of the
11-
tiles to be displayed.
10+
Each tile map contains the 1-byte indices of the tiles to be displayed.
1211

1312
Tiles are obtained from the Tile Data Table using either of the two
1413
addressing modes (described in [VRAM Tile Data](<#VRAM Tile Data>)), which
@@ -17,7 +16,7 @@ can be selected via [the LCDC register](<#FF40 — LCDC: LCD control>).
1716
Since one tile has 8×8 pixels, each map holds a 256×256 pixels picture.
1817
Only 160×144 of those pixels are displayed on the LCD at any given time.
1918

20-
## BG Map Attributes (CGB Mode only)
19+
## BG Map attributes (CGB Mode only)
2120

2221
In CGB Mode, an additional map of 32×32 bytes is stored in VRAM Bank 1
2322
(each byte defines attributes for the corresponding tile-number map

src/imgs/src/ppu_overview.svg

+181
Loading

0 commit comments

Comments
 (0)