diff options
author | Rangi <35663410+Rangi42@users.noreply.github.com> | 2018-08-25 22:23:45 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-25 22:23:45 -0400 |
commit | 3eacab563d0e1ab5557c2443556a7a5e58d14cad (patch) | |
tree | 3d747166409fdc94f0fd1aa760693a7ee5bd2156 /home/lcd.asm | |
parent | 89681d231611938a791f4256e602c88c2f9aa3e1 (diff) | |
parent | b2adcd6d6ff91efc764a6ecc65147be7b9cda9e8 (diff) |
Merge pull request #555 from Rangi42/ldh
Use real labels for HRAM instead of constants, and the ldh instruction
Diffstat (limited to 'home/lcd.asm')
-rw-r--r-- | home/lcd.asm | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/home/lcd.asm b/home/lcd.asm index 7ea53d453..68edf9b0f 100644 --- a/home/lcd.asm +++ b/home/lcd.asm @@ -1,8 +1,8 @@ ; LCD handling Unreferenced_Function547:: - ld a, [hLCDCPointer] - cp rSCX - $ff00 + ldh a, [hLCDCPointer] + cp LOW(rSCX) ret nz ld c, a ld a, [wLYOverrides] @@ -11,18 +11,18 @@ Unreferenced_Function547:: LCD:: push af - ld a, [hLCDCPointer] + ldh a, [hLCDCPointer] and a jr z, .done ; At this point it's assumed we're in WRAM bank 5! push bc - ld a, [rLY] + ldh a, [rLY] ld c, a ld b, HIGH(wLYOverrides) ld a, [bc] ld b, a - ld a, [hLCDCPointer] + ldh a, [hLCDCPointer] ld c, a ld a, b ld [$ff00+c], a @@ -36,37 +36,37 @@ DisableLCD:: ; Turn the LCD off ; Don't need to do anything if the LCD is already off - ld a, [rLCDC] + ldh a, [rLCDC] bit rLCDC_ENABLE, a ret z xor a - ld [rIF], a - ld a, [rIE] + ldh [rIF], a + ldh a, [rIE] ld b, a ; Disable VBlank res 0, a ; vblank - ld [rIE], a + ldh [rIE], a .wait ; Wait until VBlank would normally happen - ld a, [rLY] + ldh a, [rLY] cp LY_VBLANK + 1 jr nz, .wait - ld a, [rLCDC] + ldh a, [rLCDC] and $ff ^ (1 << rLCDC_ENABLE) - ld [rLCDC], a + ldh [rLCDC], a xor a - ld [rIF], a + ldh [rIF], a ld a, b - ld [rIE], a + ldh [rIE], a ret EnableLCD:: - ld a, [rLCDC] + ldh a, [rLCDC] set rLCDC_ENABLE, a - ld [rLCDC], a + ldh [rLCDC], a ret |