Skip to navigation

Elite on the BBC Micro and NES

Keyboard: DOKEY

[Elite-A, Parasite]

Name: DOKEY [Show more] Type: Subroutine Category: Keyboard Summary: Scan for the seven primary flight controls and apply the docking computer manoeuvring code Deep dive: The key logger The docking computer
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * TT17 calls DOKEY
.DOKEY LDA JSTK \ If JSTK is zero, then we are configured to use the BEQ DK4 \ keyboard rather than the joystick, so jump to DK4 to \ scan for pause, configuration and secondary flight \ keys LDX #1 \ Call DKS2 to fetch the value of ADC channel 1 (the JSR DKS2 \ joystick X value) into (A X), and OR A with 1. This ORA #1 \ ensures that the high byte is at least 1, and then we STA JSTX \ store the result in JSTX LDX #2 \ Call DKS2 to fetch the value of ADC channel 2 (the JSR DKS2 \ joystick Y value) into (A X), and EOR A with JSTGY. EOR JSTGY \ JSTGY will be &FF if the game is configured to STA JSTY \ reverse the joystick Y channel, so this EOR does \ exactly that, and then we store the result in JSTY \ Fall through into DK4 to scan for other keys