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
Border has an extra scanline, visible in some cases (#474)
* Border has an extra scanline, visible in some cases
One scanline immediately below the SGB border flickers when
SGB is busy. Explain why, and how to hide it
Related Border Crossing commit:
pinobatch/little-things-gb@a3df90f
Co-authored-by: Antonio Vivace <[email protected]>
@@ -83,8 +84,19 @@ border defining all unique tiles would have to define this many tiles:
83
84
84
85
Because the CHR RAM allocated by SGB for border holds only 256 tiles, a full-screen border must repeat at least 281 tiles and a letterboxed border at least 90.
85
86
87
+
It turns out that 29 rows of the border tilemap sent through PCT_TRN are at least partly visible in some situations.
88
+
The SGB system software sets the border layer's vertical scroll position (BG1VOFS) to 0.
89
+
Because the S-PPU normally displays lines BGxVOFS+1 through BGxVOFS+224 of each layer, this hides the first scanline of the top row of tiles and adds one scanline of the nominally invisible 29th row at the bottom.
90
+
Most of the time, SGB hides this extra line with forced blanking (writing $80 to INIDISP at address $012100).
91
+
While SGB is busy processing some packets, such as fading out the border's palette or loading a new scene's palette and attributes, it neglects to force blanking, making the line flicker on some TVs.
92
+
This can be seen even with some built-in borders.
93
+
94
+
To fully eliminate flicker, write a row of all-black tilemap entries after the bottom row of the border ($8700-$873F in VRAM in a PCT_TRN), or at least a row of tiles whose top row of pixels is blank.
95
+
If that is not convenient, such as if a border data format doesn't guarantee an all-black tile ID, you can make the flicker less noticeable by repeating the last scanline.
96
+
Take the bottommost row (at $86C0-$86FF in VRAM) and copy it to the extra row, flipped vertically (XOR with $8000).
97
+
86
98
The Super NES supports 8 background palettes.
87
-
The SGB system software (when run in a LLE such as Mesen-S) has been observed to use background palette 0 for the GB screen, palettes 1, 2, 3, and 7 for the menus, and palettes 4, 5, and 6 for the border.
99
+
The SGB system software (when run in a LLE such as Mesen 2) has been observed to use background palette 0 for the GB screen, palettes 1, 2, 3, and 7 for the menus, and palettes 4, 5, and 6 for the border.
88
100
Thus a border can use three 15-color palettes.
89
101
90
102
## SGB Command $18 — OBJ_TRN
@@ -95,10 +107,9 @@ one-shot 4KBytes VRAM transfer method. Instead, when enabled (below
95
107
execute bit set), data is permanently (each frame) read out from the
96
108
lower character line of the Game Boy screen. To suppress garbage on the
97
109
display, the lower line is masked, and only the upper 20x17 characters
98
-
of the Game Boy window are used - the masking method is unknwon - frozen,
110
+
of the Game Boy window are used - the masking method is unknown - frozen,
99
111
black, or recommended to be covered by the SGB border, or else ??? Also,
100
-
when the function is enabled, "system attract mode is not performed" -
101
-
whatever that means ???
112
+
when the function is enabled, attract mode (built-in borders' screen saver on idle) is not performed.
102
113
103
114
This command does nothing on some SGB revisions. (SGBv2, SGB2?)
0 commit comments