.SetIconBarPointer ASL A ; Set xIconBarPointer = A * 4 ASL A ; STA xIconBarPointer ; As xIconBarPointer contains the x-coordinate of the ; icon bar pointer, incrementing by 4 for each button LDX #0 ; Zero all the pointer timer and movement variables so STX pointerMoveCounter ; the pointer is not moving and the MoveIconBarPointer STX xPointerDelta ; routine does not start looking for double-taps of STX pointerPressedB ; the B button STX pointerTimer IF _PAL STX pointerTimerB ; Reset the PAL-specific timer that controls whether a ; tap on the B button is the second tap of a double-tap ENDIF RTS ; Return from the subroutineName: SetIconBarPointer [Show more] Type: Subroutine Category: Icon bar Summary: Set the icon bar pointer to a specific positionContext: See this subroutine in context in the source code References: This subroutine is called as follows: * DEATH2 calls SetIconBarPointer * SetDemoAutoPlay calls SetIconBarPointer
Arguments: A The button number on which to position the pointer
[X]
Variable pointerMoveCounter in workspace WP
The position of the icon bar pointer as it moves between icons, counting down from 12 (at the start of the move) to 0 (at the end of the move)
[X]
Variable pointerPressedB in workspace WP
Controls whether the MoveIconBarPointer routine looks for a second tap of the B button when trying to detect a double-tap on the B button
[X]
Variable pointerTimer in workspace WP
A timer that counts down by 1 on each call to the MoveIconBarPointer routine, so that a double-tap on the B button can be interpreted as such
[X]
Variable pointerTimerB in workspace WP
A timer used in the PAL version to detect the B button being pressed twice in quick succession (a double-tap)
[X]
Variable xIconBarPointer in workspace WP
The x-coordinate of the icon bar pointer
[X]
Variable xPointerDelta in workspace WP
The direction in which the icon bar pointer is moving, expressed as a delta to add to the x-coordinate of the pointer sprites