mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-02-21 14:48:43 +13:00
Specify the ldh instruction, don't turn ld into ldh
This commit is contained in:
parent
c480632d54
commit
772fcc7588
219 changed files with 2556 additions and 2556 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue