You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: list/guides/deadcscroll.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ The `SCY`/`SCX` registers have a simple purpose: specify the coordinate of the s
22
22
23
23
When you don't require scrolling, and when your cart boots, `SCY`/`SCX` is typically set to 0,0. When a screen is displayed, it appears normally even though you only set the values once. This is because as the screen draws, the PPU automatically adds the value in `LY` ($FF44) to the value in `SCY` in order to know what row of pixels to draw.
24
24
25
-
```
25
+
```:no-line-numbers
26
26
SCY value (set once)
27
27
│
28
28
│ screen
@@ -37,7 +37,7 @@ SCY value (set once)
37
37
└───────┘
38
38
```
39
39
If `SCY` = $20 (for example):
40
-
```
40
+
```:no-line-numbers
41
41
SCY value (set once)
42
42
│
43
43
│ screen
@@ -55,7 +55,7 @@ SCY value (set once)
55
55
You can take advantage of how the PPU renders the screen by setting these registers *as the screen draws*. If you do this, you can create some interesting 'raster' effects that are presented here.
56
56
57
57
As an example, let's say you wanted to triple line 0 and show it for line 0, line 1, and line 2, and then continue with line 3. You would write to the `SCY` register like so:
58
-
```
58
+
```:no-line-numbers
59
59
SCY value (set once per line)
60
60
│
61
61
│ screen
@@ -93,7 +93,7 @@ There are two key elements to make this system very stable and very fast:
93
93
The idea of the double-buffer is that while one buffer is being used by the hardware to draw the screen, you modify (fill) values in the other. When the screen is done drawing, you switch buffers so the one you were just modifying is being used for drawing and you start modifying the other.
94
94
95
95
While the Draw Buffer (A) is used to render the screen, you change values in the Fill Buffer (B).
96
-
```
96
+
```:no-line-numbers
97
97
┌───────┐ ┌───────┐
98
98
│Draw │ │Fill │
99
99
│Buffer │ │Buffer │
@@ -106,7 +106,7 @@ While the Draw Buffer (A) is used to render the screen, you change values in the
106
106
```
107
107
108
108
When the screen is done being drawn (and you know this because the VBlank interrupt would have triggered or the value in `LY` changed to 144), you switch the buffers.
109
-
```
109
+
```:no-line-numbers
110
110
┌───────┐ ┌───────┐
111
111
│Fill │ │Draw │
112
112
│Buffer │ │Buffer │
@@ -119,7 +119,7 @@ When the screen is done being drawn (and you know this because the VBlank interr
119
119
```
120
120
121
121
Here, "switch buffers" means to switch the *purpose* of each buffer. It doesn't mean to copy buffers. Remember, we need this to be as fast as possible so to change buffers, you simply change pointers:
0 commit comments