.BR1 JSR SetupPPUForIconBar ; If the PPU has started drawing the icon bar, configure ; the PPU to use nametable 0 and pattern table 0 JSR ResetCommander_b6 ; Reset the current commander to the default "JAMESON" ; commander JSR ResetMusicAfterNMI ; Wait for the next NMI before resetting the current ; tune to 0 (no tune) and stopping the music JSR ping ; Set the target system coordinates (QQ9, QQ10) to the ; current system coordinates (QQ0, QQ1) we just loaded JSR TT111 ; Select the system closest to galactic coordinates ; (QQ9, QQ10) JSR jmp ; Set the current system to the selected system LDX #5 ; We now want to copy the seeds for the selected system ; in QQ15 into QQ2, where we store the seeds for the ; current system, so set up a counter in X for copying ; 6 bytes (for three 16-bit seeds) ; The label below is called likeTT112 because this code ; is almost identical to the TT112 loop in the hyp1 ; routine .likeTT112 LDA QQ15,X ; Copy the X-th byte in QQ15 to the X-th byte in QQ2 STA QQ2,X DEX ; Decrement the counter BPL likeTT112 ; Loop back to likeTT112 if we still have more bytes to ; copy INX ; Set X = 0 (as we ended the above loop with X = $FF) STX EV ; Set EV, the extra vessels spawning counter, to 0, as ; we are entering a new system with no extra vessels ; spawned LDA QQ3 ; Set the current system's economy in QQ28 to the STA QQ28 ; selected system's economy from QQ3 LDA QQ5 ; Set the current system's tech level in tek to the STA tek ; selected system's economy from QQ5 LDA QQ4 ; Set the current system's government in gov to the STA gov ; selected system's government from QQ4 RTS ; Return from the subroutine
[X]
Subroutine ResetCommander_b6 (category: Save and load)
Call the ResetCommander routine in ROM bank 6
[X]
Subroutine ResetMusicAfterNMI (category: Sound)
Wait for the next NMI before resetting the current tune to 0 and stopping the music
[X]
Subroutine SetupPPUForIconBar (category: PPU)
If the PPU has started drawing the icon bar, configure the PPU to use nametable 0 and pattern table 0, while preserving A
[X]
Subroutine TT111 (category: Universe)
Set the current system to the nearest system to a point
[X]
Subroutine jmp (category: Universe)
Set the current system to the selected system
[X]
Label likeTT112 is local to this routine
[X]
Subroutine ping (category: Universe)
Set the selected system to the current system