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 /engine/rtc | |
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 'engine/rtc')
-rw-r--r-- | engine/rtc/reset_password.asm | 2 | ||||
-rw-r--r-- | engine/rtc/restart_clock.asm | 4 | ||||
-rw-r--r-- | engine/rtc/rtc.asm | 8 | ||||
-rw-r--r-- | engine/rtc/timeset.asm | 34 |
4 files changed, 24 insertions, 24 deletions
diff --git a/engine/rtc/reset_password.asm b/engine/rtc/reset_password.asm index 1a5461b15..7de7a1d73 100644 --- a/engine/rtc/reset_password.asm +++ b/engine/rtc/reset_password.asm @@ -73,7 +73,7 @@ ClockResetPassword: call .updateIDdisplay .loop2 call JoyTextDelay - ld a, [hJoyLast] + ldh a, [hJoyLast] ld b, a and A_BUTTON jr nz, .confirm diff --git a/engine/rtc/restart_clock.asm b/engine/rtc/restart_clock.asm index 5071fef48..309faaed2 100644 --- a/engine/rtc/restart_clock.asm +++ b/engine/rtc/restart_clock.asm @@ -66,9 +66,9 @@ RestartClock: call UpdateTime call GetWeekday ld [wBuffer4], a - ld a, [hHours] + ldh a, [hHours] ld [wBuffer5], a - ld a, [hMinutes] + ldh a, [hMinutes] ld [wBuffer6], a .loop diff --git a/engine/rtc/rtc.asm b/engine/rtc/rtc.asm index 4a8aab50a..f79c3f297 100644 --- a/engine/rtc/rtc.asm +++ b/engine/rtc/rtc.asm @@ -24,7 +24,7 @@ StartRTC: GetTimeOfDay:: ; get time of day based on the current hour - ld a, [hHours] ; hour + ldh a, [hHours] ; hour ld hl, TimesOfDay .check @@ -65,11 +65,11 @@ StageRTCTimeForSave: ld hl, wRTC ld a, [wCurDay] ld [hli], a - ld a, [hHours] + ldh a, [hHours] ld [hli], a - ld a, [hMinutes] + ldh a, [hMinutes] ld [hli], a - ld a, [hSeconds] + ldh a, [hSeconds] ld [hli], a ret diff --git a/engine/rtc/timeset.asm b/engine/rtc/timeset.asm index 0b05f9c03..e634b2180 100644 --- a/engine/rtc/timeset.asm +++ b/engine/rtc/timeset.asm @@ -3,10 +3,10 @@ TIMESET_DOWN_ARROW EQUS "\"♀\"" ; $f5 InitClock: ; Ask the player to set the time. - ld a, [hInMenu] + ldh a, [hInMenu] push af ld a, $1 - ld [hInMenu], a + ldh [hInMenu], a ld a, $0 ld [wSpriteUpdatesEnabled], a @@ -24,7 +24,7 @@ InitClock: ld b, SCGB_DIPLOMA call GetSGBLayout xor a - ld [hBGMapMode], a + ldh [hBGMapMode], a call LoadStandardFont ld de, TimeSetBackgroundGFX ld hl, vTiles2 tile $00 @@ -117,22 +117,22 @@ InitClock: call PrintText call WaitPressAorB_BlinkCursor pop af - ld [hInMenu], a + ldh [hInMenu], a ret .ClearScreen: xor a - ld [hBGMapMode], a + ldh [hBGMapMode], a hlcoord 0, 0 ld bc, SCREEN_HEIGHT * SCREEN_WIDTH xor a call ByteFill ld a, $1 - ld [hBGMapMode], a + ldh [hBGMapMode], a ret SetHour: - ld a, [hJoyPressed] + ldh a, [hJoyPressed] and A_BUTTON jr nz, .Confirm @@ -223,7 +223,7 @@ UnreferencedFunction907f1: ret SetMinutes: - ld a, [hJoyPressed] + ldh a, [hJoyPressed] and A_BUTTON jr nz, .a_button ld hl, hJoyLast @@ -391,10 +391,10 @@ TimeSetDownArrowGFX: INCBIN "gfx/new_game/down_arrow.1bpp" SetDayOfWeek: - ld a, [hInMenu] + ldh a, [hInMenu] push af ld a, $1 - ld [hInMenu], a + ldh [hInMenu], a ld de, TimeSetUpArrowGFX ld hl, vTiles0 tile TIMESET_UP_ARROW lb bc, BANK(TimeSetUpArrowGFX), 1 @@ -440,11 +440,11 @@ SetDayOfWeek: call InitDayOfWeek call LoadStandardFont pop af - ld [hInMenu], a + ldh [hInMenu], a ret .GetJoypadAction: - ld a, [hJoyPressed] + ldh a, [hJoyPressed] and A_BUTTON jr z, .not_A scf @@ -487,7 +487,7 @@ SetDayOfWeek: .finish_dpad xor a - ld [hBGMapMode], a + ldh [hBGMapMode], a hlcoord 10, 4 ld b, 2 ld c, 9 @@ -563,9 +563,9 @@ InitialSetDSTFlag: .Text: start_asm call UpdateTime - ld a, [hHours] + ldh a, [hHours] ld b, a - ld a, [hMinutes] + ldh a, [hMinutes] ld c, a decoord 1, 14 farcall PrintHoursMins @@ -591,9 +591,9 @@ InitialClearDSTFlag: .Text: start_asm call UpdateTime - ld a, [hHours] + ldh a, [hHours] ld b, a - ld a, [hMinutes] + ldh a, [hMinutes] ld c, a decoord 1, 14 farcall PrintHoursMins |