Skool Daze Routines
26584: Get input from Kempston joystick if in use
Used by the routine at 26422. Returns with the zero flag set if there was no joystick input. Otherwise returns with the zero flag reset and the ASCII code of the equivalent keypress in A.
26584 LD HL,23611 Prepare HL in case we return to 26422
26587 LD A,(26655) A=107 if Kempston joystick is being used, 0 otherwise
26590 AND A Is the Kempston joystick being used?
26591 RET Z Return if not
26592 IN A,(31) Collect input from the joystick
26594 AND 31
26596 RET Z Return with the zero flag set if there was no input
26597 POP HL Drop the return address from the stack so we return straight to the caller of 26422
26598 LD L,A
26599 BIT 4,L
26601 LD A,102 102='f' (fire catapult)
26603 RET NZ Return if the fire button was pressed
26604 LD A,81 81='Q' (up)
26606 BIT 3,L
26608 RET NZ Return if the joystick was moved up
26609 DEC A A=80: 'P' (right)
26610 BIT 0,L
26612 RET NZ Return if the joystick was moved right
26613 DEC A A=79: 'O' (left)
26614 BIT 1,L
26616 RET NZ Return if the joystick was moved left
26617 LD A,65 65='A' (down)
26619 AND A Reset the zero flag
26620 RET