Nintendo DMG-01 Manual - Page 135
Emulator Notes
View all Nintendo DMG-01 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 135 highlights
Game BoyTM CPU Manual 5.1. Emulator Notes Write1: ldh a,[$41] ;read $ff41 and 2 jr nz,Write1 ld [hl],b ei ;turn on interrupts ret There should not be many instructions between the "jr nz" and write to memory "ld [hl],b". A worst case of 64 CPU clock cycles are available to access main video memory (not OAM!) following the "jr nz" command. The "di" and "ei" commands above are only required if you are using Serial, Timer, or Hi-2-Lo interrupts. 5. The LCD display is on at reset (bit 7 of $ff40 set to bit 7 of $ff40 set to 1). Before the LCD display can be turned off you must wait for V-Blank. One popular way of doing this is the following: ; Turn off LCD display LCDOff: ldh a,[$44h] ; $ff44=LCDC Y-Pos cp $90 ; $90 and bigger = in VBL jr nz,LCDOff ; Loop until = $90 xor a ldh [$41],a ; Turn off LCD display ret Note you should disable interrupts, if they are enabled, before executing the above code or else the test of $ff44 could prove invalid. Turning the LCD display on can be done at any time. by DP Page 135