Skip to content

Commit

Permalink
Fix program freeze when lcd is off at boot
Browse files Browse the repository at this point in the history
When running with no bootrom LCD could be off
(could be handled on the emulator too)
the program would freeze
  • Loading branch information
alloncm committed Dec 25, 2022
1 parent bf961a5 commit e92bb53
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/color_bg_oam_priority.asm
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ WaitVblank:
; Turn off the LCD display
;----------------------------------------------------
TurnOffLcd:
and a, %10000000 ; get LCDC bit 7 to check if lcd is off
cp a, 0 ; check lcdc for lcd off
ret z ; if lcd already off return and dont wait for vblank (it will never return)
call WaitVblank
ld a, 0
ld [rLCDC], a
Expand Down

0 comments on commit e92bb53

Please sign in to comment.