Skip to navigation

Elite on the BBC Micro and NES

Keyboard: PAUSE2

[Elite-A, Encyclopedia]

Name: PAUSE2 [Show more] Type: Subroutine Category: Keyboard Summary: Wait until a key is pressed, ignoring any existing key press
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * trading calls PAUSE2

Returns: X The internal key number of the key that was pressed
.PAUSE2 JSR RDKEY \ Scan the keyboard for a key press and return the \ internal key number in X (or 0 for no key press) BNE PAUSE2 \ If a key was already being held down when we entered \ this routine, keep looping back up to PAUSE2, until \ the key is released \ --- Mod: Code added for Elite-A: --------------------> .l_out \ --- End of added code -------------------------------> JSR RDKEY \ Any pre-existing key press is now gone, so we can \ start scanning the keyboard again, returning the \ internal key number in X (or 0 for no key press) \ --- Mod: Code removed for Elite-A: ------------------> \ BEQ PAUSE2 \ Keep looping up to PAUSE2 until a key is pressed \ --- And replaced by: --------------------------------> BEQ l_out \ Keep looping up to l_out until a key is pressed \ --- End of replacement ------------------------------> RTS \ Return from the subroutine