Skip to navigation

Elite on the BBC Micro and NES

Combat demo: FixRandomNumbers

[NES version, Bank 7]

Name: FixRandomNumbers [Show more] Type: Subroutine Category: Combat demo Summary: Fix the random number seeds to a known value so the random numbers generated are always the same when we run the demo
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * PlayDemo calls FixRandomNumbers
.FixRandomNumbers LDA #$75 ; Set the random number seeds to a known state, so the STA RAND ; demo plays out in the same way every time LDA #$0A STA RAND+1 LDA #$2A STA RAND+2 LDX #$E6 STX RAND+3 RTS ; Return from the subroutine