From 6bd86e10c32cd7b464425adfc01621f3ff6726aa Mon Sep 17 00:00:00 2001 From: Rangi Date: Fri, 3 Jul 2020 13:03:21 -0400 Subject: Reorganize home header --- home/lcd.asm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 home/lcd.asm (limited to 'home/lcd.asm') diff --git a/home/lcd.asm b/home/lcd.asm new file mode 100644 index 00000000..e88a42b3 --- /dev/null +++ b/home/lcd.asm @@ -0,0 +1,25 @@ +DisableLCD:: + xor a + ld [rIF], a + ld a, [rIE] + ld b, a + res 0, a + ld [rIE], a + +.wait + ld a, [rLY] + cp LY_VBLANK + jr nz, .wait + + ld a, [rLCDC] + and $ff ^ rLCDC_ENABLE_MASK + ld [rLCDC], a + ld a, b + ld [rIE], a + ret + +EnableLCD:: + ld a, [rLCDC] + set rLCDC_ENABLE, a + ld [rLCDC], a + ret -- cgit v1.3.1-sl0p