shithub: pokered

ref: e4845d3d317cd00b97a96038cb7dc069ec0fae0e
dir: /home/lcd.asm/

View raw version
DisableLCD::
	xor a
	ldh [rIF], a
	ldh a, [rIE]
	ld b, a
	res 0, a
	ldh [rIE], a

.wait
	ldh a, [rLY]
	cp LY_VBLANK
	jr nz, .wait

	ldh a, [rLCDC]
	and $ff ^ rLCDC_ENABLE_MASK
	ldh [rLCDC], a
	ld a, b
	ldh [rIE], a
	ret

EnableLCD::
	ldh a, [rLCDC]
	set rLCDC_ENABLE, a
	ldh [rLCDC], a
	ret