.SetDemoAutoPlay LDA #5 ; Set the icon par pointer to button 5 (which is the JSR SetIconBarPointer ; sixth button of 12, just before the halfway point) JSR SetupDemoUniverse ; Configure the universe for the demo, which includes ; setting the random number seeds to a known value so ; the demo always runs in the same way LDX languageIndex ; Set autoPlayKeys(1 0) to the chosen language's entry LDA autoPlayKeys1Lo,X ; from the (autoPlayKeys1Hi autoPlayKeys1Lo) tables STA autoPlayKeys LDA autoPlayKeys1Hi,X STA autoPlayKeys+1 LDA #0 ; Set autoPlayKey = 0 to reset the current key being STA autoPlayKey ; "pressed" in the auto-play STA autoPlayRepeat ; Set autoPlayRepeat = 0 to reset the number of repeats ; in the auto-play (as otherwise the first button press ; would start repeating) LDX #%10000000 ; Set bit 7 of autoPlayDemo so the NMI handler will play STX autoPlayDemo ; the demo automatically using the controller key ; presses in the autoPlayKeys tables RTS ; Return from the subroutineName: SetDemoAutoPlay [Show more] Type: Subroutine Category: Combat demo Summary: Set up the NMI handler to automatically play the demo using the controller key presses in the autoPlayKeys tableContext: See this subroutine in context in the source code References: This subroutine is called as follows: * SetDemoAutoPlay_b5 calls SetDemoAutoPlay
[X]
Subroutine SetIconBarPointer (category: Icon bar)
Set the icon bar pointer to a specific position
[X]
Subroutine SetupDemoUniverse (category: Combat demo)
Initialise the local bubble of universe for the demo
[X]
Variable autoPlayDemo in workspace WP
Controls whether to play the demo automatically (which happens after it is left idle for a while)
[X]
Variable autoPlayKey in workspace WP
Stores the buttons to be automatically pressed during auto-play
[X]
Variable autoPlayKeys in workspace ZP
The address of the table containing the key presses to apply when auto-playing the demo
[X]
Variable autoPlayKeys1Hi (category: Combat demo)
High byte of the address of the auto-play key table for each language
[X]
Variable autoPlayKeys1Lo (category: Combat demo)
Low byte of the address of the auto-play key table for each language
[X]
Variable autoPlayRepeat in workspace WP
Stores the number of times a step should be repeated during auto-play
[X]
Variable languageIndex in workspace WP
The language that was chosen on the Start screen as an index into the various lookup tables