diff options
author | yenatch <yenatch@gmail.com> | 2015-01-23 09:48:14 -0800 |
---|---|---|
committer | yenatch <yenatch@gmail.com> | 2015-02-07 11:39:49 -0800 |
commit | b35294752c55b5df88ccfc785279c36f30a43fd6 (patch) | |
tree | a415f9d7cad23cbda2d69d078d831e92a667fa8e /engine/joypad.asm | |
parent | f94af3e2d6effcaf94c8912a17542b99c1e7e9f8 (diff) |
rename hJoyHeldLast -> hJoyLast
Diffstat (limited to 'engine/joypad.asm')
-rw-r--r-- | engine/joypad.asm | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/engine/joypad.asm b/engine/joypad.asm index d2ad1c31..31e197e2 100644 --- a/engine/joypad.asm +++ b/engine/joypad.asm @@ -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 |