Skip to navigation

Elite on the BBC Micro and NES

Controllers: U%

[NES version, Bank 0]

Name: U% [Show more] Type: Subroutine Category: Controllers Summary: Clear the key logger
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * DEATH2 calls U% * TITLE calls U%

Returns: A A is set to 0
.U% LDX #6 ; We want to clear the 6 key logger locations from ; KY1 to KY6, so set a counter in X LDA #0 ; Set A to 0, as this means "key not pressed" in the ; key logger at KL STA iconBarKeyPress ; Reset the key logger entry for the icon bar button ; choice .DKL3 STA KL,X ; Store 0 in the X-th byte of the key logger DEX ; Decrement the counter BPL DKL3 ; Loop back for the next key, until we have cleared from ; KL to KL+6 (i.e. KY1 through KY6) RTS ; Return from the subroutine