Skip to content

Commit bae52a7

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 427c393 commit bae52a7

File tree

7 files changed

+565
-276
lines changed

7 files changed

+565
-276
lines changed

custom/style.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@ code {
100100
}
101101

102102

103+
/* Classes for custom table styling */
104+
105+
table.compact th {
106+
padding: 3px 5px;
107+
}
108+
109+
103110
/* Global CSS variables */
104111

105112
:root {

src/Rendering_Internals.md

Lines changed: 370 additions & 0 deletions
Large diffs are not rendered by default.

src/STAT.md

Lines changed: 5 additions & 3 deletions
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-state on DMG or on CGB single-speed mode or 2 T-states 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-state on DMG or on CGB single-speed mode or 2 T-states 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

@@ -56,11 +56,13 @@ Mode | Action | Duration
5656
0 | Nothing (HBlank) | 85 to 208 dots (20 to 49 µs) depending on previous mode 3 duration | VRAM, OAM, CGB palettes
5757
1 | Nothing (VBlank) | 4560 dots (1087 µs, 10 scanlines) | VRAM, OAM, CGB palettes
5858

59-
## Properties of STAT modes
59+
## STAT modes
60+
61+
{{#include imgs/ppu_modes_timing.svg:2:}}
6062

6163
Unlike most game consoles, the Game Boy can pause the dot clock briefly,
6264
making Mode 3 longer and Mode 0 shorter. It routinely takes a 6 to 11 dot
63-
break to fetch an OBJ's tile between background tile pattern fetches.
65+
break to fetch an OBJ's tile between background tile fetches.
6466
On DMG and GBC in DMG mode, mid-scanline writes to [`BGP`](<#FF47 - BGP (BG Palette Data) (R/W) - Non CGB Mode Only>)
6567
allow observing this behavior, as the delay from drawing an OBJ shifts the
6668
write's effect to the left by that many dots.

src/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
- [LCD Status](./STAT.md)
2424
- [Scrolling](./Scrolling.md)
2525
- [Palettes](./Palettes.md)
26-
- [Pixel FIFO](./pixel_fifo.md)
26+
- [Rendering internals](./Rendering_Internals.md)
2727
- [Sound Controller](./Sound_Controller.md)
2828
- [Joypad Input](./Joypad_Input.md)
2929
- [Serial Data Transfer](./Serial_Data_Transfer_(Link_Cable).md)

src/Scrolling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ scanline.
4848

4949
### Scrolling
5050

51-
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).
51+
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).
5252

5353
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.
5454

src/imgs/ppu_overview.svg

Lines changed: 181 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)