Skip to navigation

Keyboard: FocusOnKeyAction

Name: FocusOnKeyAction [Show more] Type: Subroutine Category: Keyboard Summary: Tell the game to start focusing effort on the action that has been initiated, such as a pan of the landscape, absorb, transfer etc.
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * CheckForKeyPresses calls FocusOnKeyAction * PerformHyperspace calls FocusOnKeyAction * ProcessActionKeys (Part 1 of 2) calls FocusOnKeyAction * ProcessGameplay calls FocusOnKeyAction * CheckForKeyPresses calls via focu1

Other entry points: focu1 Store the current setting of focusOnKeyAction in the previousFocus variable so we can detect (in the ProcessGameplay routine) whether the player is still holding down a pan key after we finish scrolling the screen for the previous pan... and then return from the subroutine
.FocusOnKeyAction LDA #%10000000 \ Set bit 7 of focusOnKeyAction to tell the game to STA focusOnKeyAction \ focus effort on implementing the key action that has \ just been initiated, such as a pan of the landscape \ view, absorb, transfer and so on STA doNotDitherObject \ Set bit 7 of doNotDitherObject to disable updating of \ objects on-screen using a dithered effect, so we don't \ dither any object changes onto the screen while we are \ focusing on processing the action, which itself might \ need to update the screen when it's done .focu1 LDA focusOnKeyAction \ Set previousFocus = focusOnKeyAction so we can detect STA previousFocus \ whether the value of focusOnKeyAction changes \ \ This is used by the ProcessGameplay routine to detect \ whether the player is still holding the same pan key \ down after we finish scrolling the screen for the pan RTS \ Return from the subroutine