aboutsummaryrefslogtreecommitdiffstats
path: root/home
diff options
context:
space:
mode:
authorSylvie <35663410+Rangi42@users.noreply.github.com>2024-09-24 10:48:10 -0400
committerGitHub <noreply@github.com>2024-09-24 10:48:10 -0400
commit6ae63a8ceac9c191ad89a1e9382ce3c87e6b2481 (patch)
tree7cdbc055c2bb6c949946a4fd931a4451b0adff97 /home
parentIdentify more bit flags (#465) (diff)
downloadpokeyellow-6ae63a8ceac9c191ad89a1e9382ce3c87e6b2481.tar.gz
pokeyellow-6ae63a8ceac9c191ad89a1e9382ce3c87e6b2481.tar.xz
pokeyellow-6ae63a8ceac9c191ad89a1e9382ce3c87e6b2481.zip
Identify hardware register bits (#469)
Diffstat (limited to 'home')
-rw-r--r--home/init.asm4
-rw-r--r--home/lcd.asm4
-rw-r--r--home/load_font.asm6
3 files changed, 7 insertions, 7 deletions
diff --git a/home/init.asm b/home/init.asm
index 619a2493..ab85192d 100644
--- a/home/init.asm
+++ b/home/init.asm
@@ -8,7 +8,6 @@ SoftReset::
Init::
; Program init.
-DEF rLCDC_DEFAULT EQU %11100011
; * LCD enabled
; * Window tile map at $9C00
; * Window display enabled
@@ -17,6 +16,7 @@ DEF rLCDC_DEFAULT EQU %11100011
; * 8x8 OBJ size
; * OBJ display enabled
; * BG display enabled
+DEF rLCDC_DEFAULT EQU (1 << rLCDC_ENABLE) | (1 << rLCDC_WINDOW_TILEMAP) | (1 << rLCDC_WINDOW_ENABLE) | (1 << rLCDC_SPRITES_ENABLE) | (1 << rLCDC_BG_PRIORITY)
di
@@ -35,7 +35,7 @@ DEF rLCDC_DEFAULT EQU %11100011
ldh [rOBP0], a
ldh [rOBP1], a
- ld a, rLCDC_ENABLE_MASK
+ ld a, 1 << rLCDC_ENABLE
ldh [rLCDC], a
call DisableLCD
diff --git a/home/lcd.asm b/home/lcd.asm
index 5c496824..aef6d43f 100644
--- a/home/lcd.asm
+++ b/home/lcd.asm
@@ -3,7 +3,7 @@ DisableLCD::
ldh [rIF], a
ldh a, [rIE]
ld b, a
- res 0, a
+ res rIE_VBLANK, a
ldh [rIE], a
.wait
@@ -12,7 +12,7 @@ DisableLCD::
jr nz, .wait
ldh a, [rLCDC]
- and ~rLCDC_ENABLE_MASK
+ and ~(1 << rLCDC_ENABLE)
ldh [rLCDC], a
ld a, b
ldh [rIE], a
diff --git a/home/load_font.asm b/home/load_font.asm
index 3b56d3a8..0f48e84c 100644
--- a/home/load_font.asm
+++ b/home/load_font.asm
@@ -1,6 +1,6 @@
LoadFontTilePatterns::
ldh a, [rLCDC]
- bit 7, a ; is the LCD enabled?
+ bit rLCDC_ENABLE, a
jr nz, .on
.off
ld hl, FontGraphics
@@ -16,7 +16,7 @@ LoadFontTilePatterns::
LoadTextBoxTilePatterns::
ldh a, [rLCDC]
- bit 7, a ; is the LCD enabled?
+ bit rLCDC_ENABLE, a
jr nz, .on
.off
ld hl, TextBoxGraphics
@@ -32,7 +32,7 @@ LoadTextBoxTilePatterns::
LoadHpBarAndStatusTilePatterns::
ldh a, [rLCDC]
- bit 7, a ; is the LCD enabled?
+ bit rLCDC_ENABLE, a
jr nz, .on
.off
ld hl, HpBarAndStatusGraphics