mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-02-21 14:48:43 +13:00
rename hJoyHeldLast -> hJoyLast
This commit is contained in:
parent
f94af3e2d6
commit
b35294752c
3 changed files with 19 additions and 10 deletions
|
|
@ -1,9 +1,13 @@
|
|||
_Joypad::
|
||||
; hJoyReleased: (hJoyLast ^ hJoyInput) & hJoyLast
|
||||
; hJoyPressed: (hJoyLast ^ hJoyInput) & hJoyInput
|
||||
|
||||
ld a, [hJoyInput]
|
||||
cp A_BUTTON + B_BUTTON + SELECT + START ; soft reset
|
||||
jp z, TrySoftReset
|
||||
|
||||
ld b, a
|
||||
ld a, [hJoyHeldLast]
|
||||
ld a, [hJoyLast]
|
||||
ld e, a
|
||||
xor b
|
||||
ld d, a
|
||||
|
|
@ -13,15 +17,19 @@ _Joypad::
|
|||
and b
|
||||
ld [hJoyPressed], a
|
||||
ld a, b
|
||||
ld [hJoyHeldLast], a
|
||||
ld [hJoyLast], a
|
||||
|
||||
ld a, [wd730]
|
||||
bit 5, a
|
||||
jr nz, DiscardButtonPresses
|
||||
ld a, [hJoyHeldLast]
|
||||
|
||||
ld a, [hJoyLast]
|
||||
ld [hJoyHeld], a
|
||||
|
||||
ld a, [wJoyIgnore]
|
||||
and a
|
||||
ret z
|
||||
|
||||
cpl
|
||||
ld b, a
|
||||
ld a, [hJoyHeld]
|
||||
|
|
@ -41,11 +49,13 @@ DiscardButtonPresses:
|
|||
|
||||
TrySoftReset:
|
||||
call DelayFrame
|
||||
; reset joypad (to make sure the
|
||||
; player is really trying to reset)
|
||||
|
||||
; deselect (redundant)
|
||||
ld a, $30
|
||||
ld [rJOYP], a
|
||||
|
||||
ld hl, hSoftReset
|
||||
dec [hl]
|
||||
jp z, SoftReset
|
||||
|
||||
jp Joypad
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue