.ScanKeyboard LDA #129 \ Call OSBYTE with A = 129, Y = &FF and the inkey value LDY #&FF \ in X, to scan the keyboard for key X JSR OSBYTE CPX #&FF \ If the key in X is being pressed, the above call sets \ both X and Y to &FF, so this sets the Z flag depending \ on whether the key is being pressed (so a BEQ after \ the call will branch if the key in X is being pressed) RTS \ Return from the subroutineName: ScanKeyboard [Show more] Type: Subroutine Category: Keyboard Summary: Scan the keyboard for a specific key pressContext: See this subroutine in context in the source code References: This subroutine is called as follows: * CheckRestartKeys calls ScanKeyboard * GetMenuOption calls ScanKeyboard * ProcessDrivingKeys (Part 1 of 6) calls ScanKeyboard * ProcessDrivingKeys (Part 2 of 6) calls ScanKeyboard * ProcessDrivingKeys (Part 4 of 6) calls ScanKeyboard * ProcessDrivingKeys (Part 6 of 6) calls ScanKeyboard * ProcessEngineStart calls ScanKeyboard * ProcessShiftedKeys calls ScanKeyboard * WaitForSpaceReturn calls ScanKeyboard * Absolute16Bit calls via ScanKeyboard-1
Arguments: X The negative inkey value of the key to scan for (in the range &80 to &FF)
Returns: Z flag The result: * Set if the key in X is being pressed, in which case BEQ will branch * Clear if the key in X is not being pressed, in which case BNE will branch
Other entry points: ScanKeyboard-1 Contains an RTS
[X]
Configuration variable OSBYTE = &FFF4
The address for the OSBYTE routine