So, in Legend of Zelda, I'm using Direct Input to check for keypresses. I have all of the keys I need checked for (code below), but I need to now check for dual arrow keypresses (UP+LEFT, UP+RIGHT, DOWN+LEFT, DOWN+RIGHT)
Code:
What cp should I use for them? Never done multiple presses before. And, not sure if this matters, and you can likely infer from the code, but the only group active at this time is the arrows.
Code:
KeysCheck
ld a,%11111110
out ($01),a ; activate arrow keys
in a,($01)
bit 0,a
jr z,movedown
bit 1,a
jr z,moveleft
bit 2,a
jr z,moveright
bit 3,a
jr z,moveup
ld a,%11011111
out ($01),a
in a,($01)
bit 7,a
jr z,usespell
bit 6,a
jr z,usesecondary
ld a,%10111111
out ($01),a
in a,($01)
bit 7,a
jr z,pausemenu
bit 6,a
jr z,inventory
bit 5,a
jr z,useprimary
ld a,$FF
out ($01),a
ret
What cp should I use for them? Never done multiple presses before. And, not sure if this matters, and you can likely infer from the code, but the only group active at this time is the arrows.