Skip to navigation


Flight: TT18

[Acorn Electron version]

Name: TT18 [Show more] Type: Subroutine Category: Flight Summary: Try to initiate a jump into hyperspace
Context: See this subroutine in context in the source code Variations: See code variations for this subroutine in the different versions 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.
.TT18 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 STA QQ14 \ Store the updated fuel amount in QQ14 LDA QQ11 \ If the current view is not a space view, jump to ee5 BNE ee5 \ to skip the following JSR TT66 \ Clear the top part of the screen, draw a white border, \ and set the current view type in QQ11 to 0 (space \ view) JSR LL164 \ Call LL164 to show the hyperspace tunnel and make the \ hyperspace sound .ee5 JSR hyp1 \ Jump straight to the system at (QQ9, QQ10) JSR GVL \ Calculate the availability for each market item in the \ new system JSR RES2 \ Reset a number of flight variables and workspaces JSR SOLAR \ Halve our legal status, update the missile indicators, \ and set up the data block and slot for the planet LDA QQ11 \ If the current view in QQ11 is not a space view (0) or AND #%00111111 \ one of the charts (64 or 128), return from the BNE hyR \ subroutine (as hyR contains an RTS) JSR TTX66 \ Otherwise clear the screen and draw a white border LDA QQ11 \ If the current view is one of the charts, jump to BNE TT114 \ TT114 (from which we jump to the correct routine to \ display the chart) INC QQ11 \ This is a space view, so increment QQ11 to 1 \ Fall through into TT110 to show the front space view