Nintendo DMG-01 Manual - Page 21
Low-Power Mode
View all Nintendo DMG-01 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 21 highlights
Game BoyTM CPU Manual 2.7.3. Low-Power Mode FA FA 34 12 ld a,(34FA) ld (de),a 3) Finally an interesting side effect 76 halt 76 halt This combination hangs the cpu. The first HALT causes the second HALT to be repeated, which therefore causes the following command (=itself) to be repeated - again and again. Placing a NOP between the two halts would cause the NOP to be repeated once, the second HALT wouldn't lock the cpu. Below is suggested code for Game Boy programs: ; **** Main Game Loop **** Main: halt ; stop system clock ; return from halt when ; interrupted nop ; (See WARNING above.) ld a,(VblnkFlag) or a ; V-Blank interrupt ? jr z,Main ; No, some other ; interrupt xor a ld (VblnkFlag),a ; Clear V-Blank flag call call Controls Game ; button inputs ; game operation jr Main by DP Page 21