mirror of
https://github.com/thornAvery/kep-hack.git
synced 2025-11-14 00:56:40 +13:00
rename hJoyHeldLast -> hJoyLast
This commit is contained in:
parent
f94af3e2d6
commit
b35294752c
|
|
@ -1,9 +1,13 @@
|
||||||
_Joypad::
|
_Joypad::
|
||||||
|
; hJoyReleased: (hJoyLast ^ hJoyInput) & hJoyLast
|
||||||
|
; hJoyPressed: (hJoyLast ^ hJoyInput) & hJoyInput
|
||||||
|
|
||||||
ld a, [hJoyInput]
|
ld a, [hJoyInput]
|
||||||
cp A_BUTTON + B_BUTTON + SELECT + START ; soft reset
|
cp A_BUTTON + B_BUTTON + SELECT + START ; soft reset
|
||||||
jp z, TrySoftReset
|
jp z, TrySoftReset
|
||||||
|
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [hJoyHeldLast]
|
ld a, [hJoyLast]
|
||||||
ld e, a
|
ld e, a
|
||||||
xor b
|
xor b
|
||||||
ld d, a
|
ld d, a
|
||||||
|
|
@ -13,15 +17,19 @@ _Joypad::
|
||||||
and b
|
and b
|
||||||
ld [hJoyPressed], a
|
ld [hJoyPressed], a
|
||||||
ld a, b
|
ld a, b
|
||||||
ld [hJoyHeldLast], a
|
ld [hJoyLast], a
|
||||||
|
|
||||||
ld a, [wd730]
|
ld a, [wd730]
|
||||||
bit 5, a
|
bit 5, a
|
||||||
jr nz, DiscardButtonPresses
|
jr nz, DiscardButtonPresses
|
||||||
ld a, [hJoyHeldLast]
|
|
||||||
|
ld a, [hJoyLast]
|
||||||
ld [hJoyHeld], a
|
ld [hJoyHeld], a
|
||||||
|
|
||||||
ld a, [wJoyIgnore]
|
ld a, [wJoyIgnore]
|
||||||
and a
|
and a
|
||||||
ret z
|
ret z
|
||||||
|
|
||||||
cpl
|
cpl
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [hJoyHeld]
|
ld a, [hJoyHeld]
|
||||||
|
|
@ -41,11 +49,13 @@ DiscardButtonPresses:
|
||||||
|
|
||||||
TrySoftReset:
|
TrySoftReset:
|
||||||
call DelayFrame
|
call DelayFrame
|
||||||
; reset joypad (to make sure the
|
|
||||||
; player is really trying to reset)
|
; deselect (redundant)
|
||||||
ld a, $30
|
ld a, $30
|
||||||
ld [rJOYP], a
|
ld [rJOYP], a
|
||||||
|
|
||||||
ld hl, hSoftReset
|
ld hl, hSoftReset
|
||||||
dec [hl]
|
dec [hl]
|
||||||
jp z, SoftReset
|
jp z, SoftReset
|
||||||
|
|
||||||
jp Joypad
|
jp Joypad
|
||||||
|
|
|
||||||
|
|
@ -381,7 +381,7 @@ SendSGBPacket: ; 71feb (1c:5feb)
|
||||||
LoadSGB: ; 7202b (1c:602b)
|
LoadSGB: ; 7202b (1c:602b)
|
||||||
xor a
|
xor a
|
||||||
ld [wOnSGB], a
|
ld [wOnSGB], a
|
||||||
call Func_7209b
|
call CheckSGB
|
||||||
ret nc
|
ret nc
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [wOnSGB], a
|
ld [wOnSGB], a
|
||||||
|
|
@ -440,7 +440,7 @@ PointerTable_72089: ; 72089 (1c:6089)
|
||||||
dw DataSnd_725a8
|
dw DataSnd_725a8
|
||||||
dw DataSnd_725b8
|
dw DataSnd_725b8
|
||||||
|
|
||||||
Func_7209b: ; 7209b (1c:609b)
|
CheckSGB: ; 7209b (1c:609b)
|
||||||
ld hl, MltReq2Packet
|
ld hl, MltReq2Packet
|
||||||
di
|
di
|
||||||
call SendSGBPacket
|
call SendSGBPacket
|
||||||
|
|
@ -536,8 +536,7 @@ Func_7210b: ; 7210b (1c:610b)
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Wait7000: ; 7214a (1c:614a)
|
Wait7000: ; 7214a (1c:614a)
|
||||||
; each loop takes about 10 cycles so this routine actually loops through 70000
|
; Each loop takes 9 cycles so this routine actually waits 63000 cycles.
|
||||||
; cycles.
|
|
||||||
ld de, 7000
|
ld de, 7000
|
||||||
.loop
|
.loop
|
||||||
nop
|
nop
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue