.ScanKeyboard LDA #129 \ Call OSBYTE with A = 129, X = key number and Y = &FF LDY #&FF \ to scan the keyboard for the key in X, returning the JSR OSBYTE \ following in both X and Y: \ \ * 0 = the key is not being pressed \ \ * &FF = the key is being pressed CPX #&FF \ Set the Z flag depending on whether the key is being \ pressed RTS \ Return from the subroutineName: ScanKeyboard [Show more] Type: Subroutine Category: Keyboard Summary: Scan the keyboard for a specific key Deep dive: The key loggerContext: See this subroutine in context in the source code References: This subroutine is called as follows: * DrawGunSights calls ScanKeyboard * MainLoop (Part 7 of 15) calls ScanKeyboard * MainLoop (Part 11 of 15) calls ScanKeyboard * MainLoop (Part 14 of 15) calls ScanKeyboard * ProcessVolumeKeys calls ScanKeyboard * TerminateGame calls ScanKeyboard * ToggleJoystick calls ScanKeyboard * UpdateKeyLogger calls ScanKeyboard
Arguments: X The internal key number of the key to scan for
Returns: Z flag If set (BEQ) then the key is being pressed, if clear (BNE) then it is not being pressed
[X]
Configuration variable OSBYTE = &FFF4
The address for the OSBYTE routine