summaryrefslogtreecommitdiff
path: root/home/lcd.asm
diff options
context:
space:
mode:
authordannye <33dannye@gmail.com>2020-11-04 00:06:44 -0600
committerdannye <33dannye@gmail.com>2020-11-04 00:06:44 -0600
commit5647ca687b92954dcf37a6ea6bfbc9a341c32de4 (patch)
treedde1937a1bfdb3a835f4155e1c2eb8f1aaf86f63 /home/lcd.asm
parent53fcd05aa24693093d8af1dc8ec4fedd3957decc (diff)
Sync with pokered
Diffstat (limited to 'home/lcd.asm')
-rw-r--r--home/lcd.asm25
1 files changed, 25 insertions, 0 deletions
diff --git a/home/lcd.asm b/home/lcd.asm
new file mode 100644
index 00000000..72fc70ed
--- /dev/null
+++ b/home/lcd.asm
@@ -0,0 +1,25 @@
+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