diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-07-06 19:03:05 -0400 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-07-06 19:03:05 -0400 |
commit | 772fcc7588a4e1fbe146a02b429cf64282c81dcb (patch) | |
tree | f491fa1d38e37ab10534b3f18422e0149ad0deca /engine/joypad.asm | |
parent | c480632d5494d04f7f5f0298a31877a2293b564e (diff) |
Specify the ldh instruction, don't turn ld into ldh
Diffstat (limited to 'engine/joypad.asm')
-rw-r--r-- | engine/joypad.asm | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/engine/joypad.asm b/engine/joypad.asm index 31e197e2..87f92635 100644 --- a/engine/joypad.asm +++ b/engine/joypad.asm @@ -2,29 +2,29 @@ _Joypad:: ; hJoyReleased: (hJoyLast ^ hJoyInput) & hJoyLast ; hJoyPressed: (hJoyLast ^ hJoyInput) & hJoyInput - ld a, [hJoyInput] + ldh a, [hJoyInput] cp A_BUTTON + B_BUTTON + SELECT + START ; soft reset jp z, TrySoftReset ld b, a - ld a, [hJoyLast] + ldh a, [hJoyLast] ld e, a xor b ld d, a and e - ld [hJoyReleased], a + ldh [hJoyReleased], a ld a, d and b - ld [hJoyPressed], a + ldh [hJoyPressed], a ld a, b - ld [hJoyLast], a + ldh [hJoyLast], a ld a, [wd730] bit 5, a jr nz, DiscardButtonPresses - ld a, [hJoyLast] - ld [hJoyHeld], a + ldh a, [hJoyLast] + ldh [hJoyHeld], a ld a, [wJoyIgnore] and a @@ -32,19 +32,19 @@ _Joypad:: cpl ld b, a - ld a, [hJoyHeld] + ldh a, [hJoyHeld] and b - ld [hJoyHeld], a - ld a, [hJoyPressed] + ldh [hJoyHeld], a + ldh a, [hJoyPressed] and b - ld [hJoyPressed], a + ldh [hJoyPressed], a ret DiscardButtonPresses: xor a - ld [hJoyHeld], a - ld [hJoyPressed], a - ld [hJoyReleased], a + ldh [hJoyHeld], a + ldh [hJoyPressed], a + ldh [hJoyReleased], a ret TrySoftReset: @@ -52,7 +52,7 @@ TrySoftReset: ; deselect (redundant) ld a, $30 - ld [rJOYP], a + ldh [rJOYP], a ld hl, hSoftReset dec [hl] |