Skip to navigation

Elite on the BBC Micro and NES

Flight: MJP

[NES version, Bank 0]

Name: MJP [Show more] Type: Subroutine Category: Flight Summary: Process a mis-jump into witchspace
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * TT18 calls MJP

Process a mis-jump into witchspace (which happens very rarely). Witchspace has a strange, almost dust-free aspect to it, and it is populated by hostile Thargoids. Using our escape pod will be fatal, and our position on the galactic chart is in-between systems. It is a scary place... There is a 0.78% chance that this routine is called from TT18 instead of doing a normal hyperspace, or we can manually trigger a mis-jump by holding down either the up or down button at the point that the hyperspace countdown reaches zero.
Other entry points:
.MJP LDY #29 ; Call the NOISE routine with Y = 29 to make the first JSR NOISE ; sound of a mis-jump JSR RES2 ; Reset a number of flight variables and workspaces, as ; well as setting Y to $FF STY MJ ; Set the mis-jump flag in MJ to $FF, to indicate that ; we are now in witchspace LDA QQ1 ; Fetch the current system's galactic y-coordinate in EOR #%00011111 ; QQ1 and flip bits 0-5, so we end up somewhere in the STA QQ1 ; vicinity of our original destination, but above or ; below it in the galactic chart .MJP1 JSR GTHG ; Call GTHG three times to spawn three Thargoid ships JSR GTHG ; and three Thargon companions JSR GTHG LDA #3 ; Set NOSTM (the maximum number of stardust particles) STA NOSTM ; to 3, so there are fewer bits of stardust in ; witchspace (normal space has a maximum of 18) JSR SelectNearbySystem ; Set the current system to the nearest system to ; (QQ9, QQ10) and update the selected system flags ; accordingly JSR UpdateIconBar_b3 ; Update the icon bar to show the hyperspace icon LDY #30 ; Call the NOISE routine with Y = 30 to make the second JSR NOISE ; sound of a mis-jump JMP RedrawCurrentView ; Update the current view for when we arrive in a new ; system, returning from the subroutine using a tail ; call