Session end : 11h59m55s | Hide picture Sexe : OFF | Donations 2024 : 920.48 € |
ORG #87B5
LD HL,#0400 ; keyboard buffer (#0400-#0409)
LD BC,#0AFF
L87BB:
LD A,(HL)
CP C
JP Z,L87C2
SCF
RET ; Carry = 1 if any key is pressed
L87C2:
INC L
DJNZ L87BB ; skip to the next keyboard row
OR A
RET ; Carry = 0 if no key has been pressed
ORG #87B5
LD A,(#0409) ; #0409 = Row 9 = Joystick 1
AND #10 ; Joy1 Fire1 key isolate
JR Z,L87BE ;
OR A
RET ; Carry = 0 if Fire1 key isn't pressed
L87BE:
LD A,(#0409)
AND #10
JR Z,L87BE ; loop while holding down the Fire1 key
SCF
RET ; Carry = 1 if Fire1 key WAS pressed