Programming Cautions Regarding Game Boy; Lcdc/Vram - Nintendo GAME BOY Programming Manual

Hide thumbs Also See for GAME BOY:
Table of Contents

Advertisement

2. PROGRAMMING CAUTIONS REGARDING GAME BOY

Covers:
DMG: DMG, MGB, and MGL
SGB: SGB and SGB2
CGB: CGB

2.1 LCDC/VRAM

2.1.1 Setting the LCDC to OFF (Recommended)
Covers: DMG and CGB
In early DMGs, a black horizontal line appears on the screen if the LCDC is stopped (LCDC
register bit 7 ← 0) at any time other than during vertical blanking. Therefore, the LCDC should be
set to OFF during V-blanking. If the occurrence of V-blanking cannot be confirmed, the LCDC
should be set to OFF when the value of the LY register is 145 (91h) or greater. These restrictions
do not apply in CGB. Thus, when creating software for use on CGB only, the timing of setting the
LCDC to OFF need not be considered.
2.1.2 Window x-coordinate Register (Required)
Covers: DMG, SGB, and CGB
When the window is displayed, the window x-coordinate register (register WX, address FF4Bh)
must be set in the range 7-165. A setting of 0-6 or 166 is prohibited. Specifying a value of 167 or
greater causes the window not to be displayed.
2.1.3 Displaying Multiple Windows (Required)
Covers: CGB
Multiple windows that divide the screen horizontally into upper and lower areas can be displayed
by setting the window x-coordinate register (WX) to a value of 167 or greater during a horizontal
blanking period. Attempting to display multiple windows by switching the window ON and OFF
during H-blanking may result in the lower window not being displayed.
Display Data
Window
BG (Background)
Window
LCD Display Screen
Display Data
Window
BG (Background)
Window
LCD Display Screen
Appendix 1: Programming Cautions
WX Value
WX=7
167<WX<255
WX=7
Window
ON
OFF
ON
255

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents