.DKS1 \ --- Mod: Code added for Elite-A: --------------------> LDA BSTK \ If BSTK is negative, then the Delta 14B joystick is BMI b_14 \ configured, so jump to b_14 to check the Delta 14B \ joystick buttons \ --- End of added code -------------------------------> LDX KYTB,Y \ Get the internal key number from the Y-th byte of the \ KYTB table above JSR DKS4 \ Call DKS4, which will set A and X to a negative value \ if the key is being pressed \ --- Mod: Code removed for Elite-A: ------------------> \BPL DKS2-1 \ The key is not being pressed, so return from the \ \ subroutine (as DKS2-1 contains an RTS) \ --- And replaced by: --------------------------------> BPL b_quit \ The key is not being pressed, so return from the \ subroutine (as b_quit contains an RTS) .b_pressed \ --- End of replacement ------------------------------> LDA #&FF \ Store &FF in the Y-th byte of the key logger at KL STA KL,Y \ --- Mod: Code added for Elite-A: --------------------> .b_quit \ --- End of added code -------------------------------> RTS \ Return from the subroutineName: DKS1 [Show more] Type: Subroutine Category: Keyboard Summary: Scan the keyboard for a flight key Deep dive: The key loggerContext: See this subroutine in context in the source code References: This subroutine is called as follows: * DK4 calls DKS1 * DKJ1 calls DKS1 * DOKEY calls DKS1 * b_14 calls via b_pressed * b_14 calls via b_quit
Scan the keyboard for the flight key given in register Y, where Y is the offset into the KYTB table above (so we can scan for Space by setting Y to 2, for example). If the key is pressed, set the corresponding byte in the key logger at KL to &FF.
Arguments: Y The offset into the KYTB table above of the key that we want to scan on the keyboard
Other entry points: b_pressed Store &FF in the Y-th byte of the key logger at KL, to indicate that key is being pressed b_quit Contains an RTS
[X]
Subroutine DKS4 (category: Keyboard)
Scan the keyboard to see if a specific key is being pressed
[X]
Variable KYTB (category: Keyboard)
Lookup table for in-flight keyboard controls
[X]
Subroutine b_14 (category: Keyboard)
Scan the Delta 14B joystick buttons