.TT18 JSR ResetMusicAfterNMI ; Wait for the next NMI before resetting the current ; tune to 0 (no tune) and stopping the music LDA QQ14 ; Subtract the distance to the selected system (in QQ8) SEC ; from the amount of fuel in our tank (in QQ14) into A SBC QQ8 BCS P%+4 ; If the subtraction didn't overflow, skip the next ; instruction LDA #0 ; The subtraction overflowed, so set A = 0 so we don't ; end up with a negative amount of fuel STA QQ14 ; Store the updated fuel amount in QQ14 LDA QQ11 ; If this is not the space view, then jump to hypr1 to BNE hypr1 ; skip drawing the hyperspace tunnel, but still make the ; hyperspace sound JSR ClearScanner ; Remove all ships from the scanner and hide the scanner ; sprites JSR LL164_b6 ; Call LL164 to show the hyperspace tunnel and make the ; hyperspace sound JMP hypr2 ; Jump to hypr2 to skip the following, as we already ; the hyperspace sound in LL164 .hypr1 JSR MakeHyperSound ; Make the hyperspace sound for when we are not in the ; space view .hypr2 LDA controller1Up ; If either of the up or down buttons are being pressed, ORA controller1Down ; then jump to MJP to force a mis-jump BMI MJP .ee5 JSR DORND ; Set A and X to random numbers CMP #253 ; If A >= 253 (0.78% chance) then jump to MJP to trigger BCS MJP ; a mis-jump into witchspace JSR hyp1 ; Jump straight to the system at (QQ9, QQ10) JSR WaitForNMI ; Wait until the next NMI interrupt has passed (i.e. the ; next VBlank) JSR RES2 ; Reset a number of flight variables and workspaces JSR SOLAR ; Halve our legal status, update the missile indicators, ; and set up data blocks and slots for the planet and ; sunName: TT18 [Show more] Type: Subroutine Category: Flight Summary: Try to initiate a jump into hyperspaceContext: See this subroutine in context in the source code References: This subroutine is called as follows: * TT102 calls TT18
Try to go through hyperspace. Called from TT102 in the main loop when the hyperspace countdown has finished.
[X]
Subroutine ClearScanner (category: Dashboard)
Remove all ships from the scanner and hide the scanner sprites
[X]
Subroutine DORND (category: Maths (Arithmetic))
Generate random numbers
[X]
Subroutine LL164_b6 (category: Flight)
Call the LL164 routine in ROM bank 6
[X]
Subroutine MJP (category: Flight)
Process a mis-jump into witchspace
[X]
Subroutine MakeHyperSound (category: Sound)
Make the hyperspace sound
[X]
Subroutine RES2 (category: Start and end)
Reset a number of flight variables and workspaces
[X]
Subroutine ResetMusicAfterNMI (category: Sound)
Wait for the next NMI before resetting the current tune to 0 and stopping the music
[X]
Subroutine SOLAR (category: Universe)
Set up various aspects of arriving in a new system
[X]
Subroutine WaitForNMI (category: Utility routines)
Wait until the next NMI interrupt has passed (i.e. the next VBlank)
[X]
Variable controller1Down in workspace WP
A shift register for recording presses of the down button on controller 1
[X]
Variable controller1Up in workspace WP
A shift register for recording presses of the up button on controller 1
[X]
Subroutine hyp1 (category: Universe)
Process a jump to the system closest to (QQ9, QQ10)
[X]
Label hypr1 is local to this routine
[X]
Label hypr2 is local to this routine