Skip to navigation
⌂
∞
Elite
on the BBC Micro and NES
404 Error (Page Not Found)
I'm afraid the page you're looking for doesn't exist.
Home page
Using this site
Home page
Start at the very beginning
Quick start guide
All you need to know to start exploring this site
All about this project
Project history, building the source and more
All about this project
About this project
The story of how this project came to be
Terminology used in this commentary
Read this before you explore the source code
Building Elite from the source
How to build your own working copy of Elite
Useful links
A collection of links to pages I've found useful during this project
Acknowledgements
The giants on whose shoulders this project stands
Site history
A short history of this site's development
Site map
A top-level map of this website
Playing with the source code
Playing 8-bit Elite in the 21st century
How to play all the versions of Elite analysed here
Deep dive articles
Over 100 articles on how Elite weaves its magic
Index
Index of all deep dive articles
Discover how Elite works under the hood
Deep dives
Memory maps
Details of memory usage in the different versions
Memory maps
BBC Micro cassette Elite memory map
Memory usage in the classic version of Elite, where space is really tight
BBC Micro disc Elite memory map
Memory usage in the enhanced disc version of Elite
6502 Second Processor Elite memory map
Memory usage in the Tube-based version of Elite
BBC Master Elite memory map
Memory usage in the smoothest version of Elite
Acorn Electron Elite memory map
Memory usage in the smallest and most basic version of Elite
NES Elite memory map
Memory usage in the only console-based version of Elite
The main loop
The main game loop and task scheduler
The main loop
Program flow of the main game loop
The sequence of events in the main game loop and the main flight loop
Scheduling tasks with the main loop counter
How the main loop counter controls what we do and when we do it
Splitting the main loop in the NES version
How the main flight loop is split and shared with the combat demo
The split-screen mode
Elite's custom and split-screen modes
The split-screen mode
The split-screen mode in BBC Micro Elite
Elite's famous split-screen mode, dissected and explained in detail
The split-screen mode in NES Elite
How the NES version implements a split-screen mode without hardware timers
Simulating the local bubble
Spawning and managing ships in our local bubble
Simulating the local bubble
The local bubble of universe
The data structures used to simulate the universe around our ship
The elusive Cougar
They say it is vanishingly rare... but just how rare is the mysterious Cougar?
The space station safe zone
Details of the calculations behind the space station safe zone
Ship data
Ship blueprints and ship data blocks
Ship data
Ship blueprints
Specifications for all the different types of ship in the universe
Ship blueprints in the disc version
How the disc version loads its ship blueprints into memory
Ship data blocks
Storing data for each of the ships in the local bubble of universe
Simulating the universe
Procedural galaxies, system seeds, market prices
Simulating the universe
Galaxy and system seeds
How system data is extracted from the galaxy and system seeds
Generating system data
The algorithms behind the procedural generation of system data
Generating system names
Producing system names from twisted seeds and two-letter tokens
Twisting the system seeds
How the system seeds are twisted to produce entire galaxies of stars
Market item prices and availability
The algorithms behind the generation of each system's cargo market
Moving and rotating in space
Pitching, rolling and moving in 3D vector space
Moving and rotating in space
Pitching and rolling
Applying our pitch and roll to another ship's orientation in space
Pitching and rolling by a fixed angle
How other ships manage to pitch and roll in space
Program flow of the ship-moving routine
A breakdown of the routine that moves the entire universe around us
Rotating the universe
What happens to the rest of the universe when we rotate our ship?
Orientation vectors
The three vectors that determine a ship's orientation in space
Tidying orthonormal vectors
Making the orientation vectors orthonormal, and why this matters
Flying and flight controls
Docking, space views and the flight keys
Flying and flight controls
Docking checks
The checks that determine whether we are docking... or just crashing
The docking computer
How the docking computer steers us home in the enhanced versions of Elite
Flipping axes between space views
Details of how the different space views are implemented
The key logger
Supporting concurrent in-flight key presses using a key logger
Bolting NES controllers onto the key logger
How the NES version simulates a joystick and keyboard
Tactics and combat
Ranks, weapons and intelligent enemy ships
Tactics and combat
Combat rank
The long, long road from Harmless to Elite
In the crosshairs
How the game knows whether an enemy is being hit by our laser fire
Program flow of the tactics routine
How ships and missiles work out attack patterns... or how to run away
Advanced tactics with the NEWB flags
How the enhanced versions of Elite give their ships a bit more personality
The scanner and dashboard
The 3D elliptical scanner and other indicators
The scanner and dashboard
The 3D scanner
The maths behind Elite's famous 3D elliptical scanner
The dashboard indicators
How the bar-based dashboard indicators display their data
Drawing pixels
Poking pixels directly into screen memory
Drawing pixels
Drawing monochrome pixels in mode 4
Poking screen memory to display monochrome pixels in the space view
Drawing colour pixels in mode 5
Poking screen memory to display colour pixels in the dashboard view
Drawing pixels in the Electron version
Poking pixels into screen memory in the Acorn Electron version of Elite
Drawing pixels in the NES version
How the NES version pokes pixels into the console's tile-based screen
Extended screen coordinates
The extended 16-bit screen coordinate system behind the space view
Drawing text
Poking text characters into screen memory
Drawing text
Drawing text
How Elite draws text on-screen by poking character bitmaps directly into screen memory
Fonts in NES Elite
The three different fonts used in the Nintendo version of Elite
Drawing lines
Line-drawing algorithms and efficient clipping
Drawing lines
Bresenham's line algorithm
The main line-drawing algorithm used to draw non-horizontal lines
Line-clipping
Efficiently clipping an extended line to the part that's on-screen
Drawing lines in the NES version
Using tiles as stepping stones when drawing lines on the NES
Drawing ships
Drawing 3D wireframes and flicker-free ships
Drawing ships
Drawing ships
The main routine for drawing 3D wireframe ships in space
Back-face culling
How Elite draws solid-looking 3D ships by only drawing visible faces
Calculating vertex coordinates
Determining whether a ship's vertex is visible or hidden from us
Flicker-free ship drawing
How the BBC Master version reduces when drawing ships
Backporting the flicker-free algorithm
Applying the BBC Master's flicker-free algorithm to the other versions
Drawing circles and ellipses
Circles, ellipses, hyperspace and docking effects
Drawing circles and ellipses
Drawing circles
The routines that draw planets and the hyperspace and docking tunnels
The ball line heap
How we remember the lines used to draw circles so they can be redrawn
Drawing ellipses
How Elite draws ellipses for the planet's crater, meridian and equator
Drawing planets
Craters, meridians and the dots of Saturn
Drawing planets
Drawing craters
The algorithms behind the huge craters of planets like Diso
Drawing meridians and equators
The algorithms behind the meridians and equators of planets like Lave
Drawing Saturn on the loading screen
How the loader draws the dot-based Saturn in Elite's epic loading screen
Drawing suns and explosions
Shimmering suns and glittering explosion clouds
Drawing suns and explosions
Drawing the sun
Drawing and storing the sun, and the systems on the Short-range Chart
Drawing explosion clouds
Drawing and storing explosion clouds for ships whose luck runs out...
Stardust
How the tiny particles of moving stardust work
Stardust
Stardust in the front view
The algorithms behind the stardust particles in the front view
Stardust in the side views
The algorithms behind the stardust particles in the side views
Missions
The three missions in the 6502 versions of Elite
Missions
The Constrictor mission
Hunting high and low for the stolen Constrictor
The Thargoid Plans mission
Evading the Thargoid threat in the depths of the third galaxy
The Trumbles mission
Furry fun in the NES version of Elite
Text
Text tokenisation and the "goat soup" algorithm
Text
Printing text tokens
Printing recursive text tokens, two-letter tokens and control codes
Extended text tokens
The extended text token system in the enhanced versions of Elite
Extended system descriptions
The famous "goat soup" algorithm that generates those strange and wonderful system descriptions
Printing decimal numbers
How to print big decimal numbers with decimal points and padding
Multi-language support in NES Elite
How the NES version supports English, German and French text
Maths
Arithmetic, geometry and random numbers
Maths
Adding sign-magnitude numbers
Doing basic arithmetic with sign-magnitude numbers
Calculating square roots
The algorithm behind the square root routine
Shift-and-add multiplication
The main algorithm behind Elite's many multiplication routines
Multiplication and division using logarithms
Faster multiplication and division routines by using logarithm lookup tables
Shift-and-subtract division
The main algorithm behind Elite's many division routines
The sine, cosine and arctan tables
The lookup tables used for the planet-drawing trigonometric functions
Generating random numbers
The algorithm behind Elite's random number generation routines
Saving and loading
Commander files and competition codes
Saving and loading
Commander save files
A description of each and every byte in the saved commander file
The competition code
All the information that's hidden in the Elite competition code
6502 Second Processor Elite
Tube APIs, scroll texts, speech support and more
6502 Second Processor Elite
6502 Second Processor Tube communication
How the 6502 Second Processor version of Elite talks over the Tube
The 6502 Second Processor demo mode
All about the Star Wars-esque scroll text in the Tube-based version of Elite
The TINA hook
Adding your own custom code to the 6502 Second Processor version using TINA
Secrets of the Executive version
Infinite jumps, retro-futuristic fonts, speech support... and Pizzasoft?
NES Elite
Elite on the Nintendo Entertainment System
NES Elite
Comparing NES Elite with the other versions
The features that make NES Elite so unique
Understanding the NES for Elite
The NES architecture and how it applies to Elite
Splitting NES Elite across multiple ROM banks
Details of the MMC1 controller and the 128K game ROM
The pattern and nametable buffers
How the NES version achieves its beautifully smooth wireframe graphics
Bitplanes in NES Elite
Squeezing two patterns into one tile using separate bitplanes
Drawing vector graphics using NES tiles
The art of the impossible: vector graphics on the NES
Views and view types in NES Elite
Configuring all the different views in the console version
Image and data compression
How images and data are compressed in NES Elite
Displaying two-layer images
The beautiful pixel art of the commander and system images
Sprite usage in NES Elite
Stardust, scanners, images, crosshairs and more
The NES combat demo
How the scroll text and combat practice works
Auto-playing the combat demo
The magic of watching Elite playing itself
Sound effects in NES Elite
The largest set of sound effects in all the 6502 Elites
Music in NES Elite
How David Whittaker's music module plays The Blue Danube
Elite-A
How Angus Duggan modified the original Elite
Elite-A
Making room for the modifications in Elite-A
How Angus Duggan found enough spare memory for Elite-A's modifications
Buying and flying ships in Elite-A
What it's like to save up for and fly your dream ship in Elite-A
Ship blueprints in Elite-A
The enhanced logic behind Elite-A's sophisticated ship blueprints system
The Encyclopedia Galactica
Inside the encyclopedia, Elite-A's most recognisable modification
The I.F.F. system
Friend or foe? Adding ship information to the 3D scanner
Fixing ship positions
Why Elite spawns certain ships in certain places, and how Elite-A fixes this
Special cargo missions
Procedurally generating delivery missions and tracking progress
Delta 14b joystick support
All the controls of Elite in one single handset - the future is here!
Tube communication in Elite-A
How the 6502 Second Processor version of Elite-A talks over the Tube
The original source files
How the original Elite-A source was written, edited and compiled
Elite hacks
Universe editor, flicker-free, teletext and more
Index
Index of all Elite hacks
A list of all the Elite hacks on this site
Elite hacks
Elite Compendium
The best way to play all the hacked and enhanced versions of Acornsoft Elite
Elite Compendium
About the Elite Compendium
Bringing all the best Elite hacks together in one feature-packed disc
Downloading the Elite Compendium
How to download and play the Elite Compendium on the BBC Master
Technical information
Details of all the hacks and enhancements in the Elite Compendium
Elite Universe Editor
Create your own Elite universes and "press play" to bring them to life
Elite Universe Editor
An introduction to the Elite Universe Editor
Create your own Elite universes and "press play" to bring them to life
Downloading the Elite Universe Editor
How to download and play the Elite Universe Editor
A summary of keys
All the keys used in all the different versions of the Elite Universe Editor
Instructions for the BBC version
Full instructions for the Elite Universe Editor on the BBC Micro and Master
Instructions for the Commodore 64 version
Full instructions for the Elite Universe Editor on the Commodore 64
Technical information
Details of how the Elite Universe Editor works under the bonnet
Flicker-free Elite
Improved ship drawing on the BBC Micro, Commodore 64 and Commodore Plus/4
Flicker-free Elite
An introduction to flicker-free Elite
Improved ship drawing on the BBC Micro, Commodore 64 and Commodore Plus/4
Downloading flicker-free Elite
How to download and play flicker-free Elite, on both the BBC and Commodore
Technical information
Details of how flicker-free Elite weaves its magic
Teletext Elite
The disc version of BBC Micro Elite, converted to run in teletext
Teletext Elite
An introduction to Teletext Elite
The disc version of BBC Micro Elite, converted to run in teletext
Downloading Teletext Elite
How to download and play Teletext Elite
Instructions for Teletext Elite
Full instructions for Teletext Elite on the BBC Micro
Technical information
Details of how Elite was converted to use teletext
BBC Micro Elite... with music!
The title and docking music from the Commodore 64, shoehorned into BBC Micro Elite
BBC Micro Elite... with music!
About the musical version of BBC Micro Elite
BBC Micro and BBC Master Elite, with added title and docking music
Downloading musical BBC Micro Elite
How to download and play the musical version of BBC Micro Elite
Technical information
How the Commodore 64's music was ported to Elite on the BBC Micro
BBC Master disc Elite
The disc version of BBC Micro Elite, converted to run on the BBC Master
BBC Master disc Elite
About BBC Micro disc Elite on the BBC Master
The disc version of BBC Micro Elite, converted to run on the BBC Master
Downloading BBC Master disc Elite
How to download and play the original disc version of Elite on the BBC Master
Technical information
Details of how disc Elite was converted from the BBC Micro to the BBC Master
Elite over Econet
BBC Master and 6502 Second Processor Elite, updated to load over Econet
Elite over Econet
About Elite over Econet
BBC Master and 6502 Second Processor Elite, updated so they will load over an Econet network
Downloading Elite over Econet
How to download and install Elite over Econet
Technical information
Details of how Elite over Econet works
Exploring the source code
BBC Micro cassette source code
Annotated source of the original version of Elite
Version information
About the BBC Micro cassette version
Information on the original version of Elite
Different variants of the BBC Micro cassette version
Code variations found in cassette Elite
BBC Micro cassette source code by file
Map of the source code
An overview of how the source code for Elite is structured
Annotated original source files
The source files in their original structure
Game loader
Loader source
The loading screen, copy protection and set-up for the main game
Main game
Workspaces and configuration
The main variable workspaces used in Elite
Text tokens
Elite's tokenised game text
Elite A source
Part 1 of the main game code
Elite B source
Part 2 of the main game code
Elite C source
Part 3 of the main game code
Elite D source
Part 4 of the main game code
Elite E source
Part 5 of the main game code
Elite F source
Part 6 of the main game code
Elite G source
Part 7 of the main game code
Ship blueprints
Data for the 13 different ship designs
Big Code File
Big Code File source
Concatenates the individual source code parts into one big game file
BBC Micro cassette source code by category
Charts
Long-range and short-range galactic charts
Subroutines
hm
Select the closest system and redraw the chart crosshairs
TT103
Draw a small set of crosshairs on a chart
TT105
Draw crosshairs on the Short-range Chart, with clipping
TT114
Display either the Long-range or Short-range Chart
TT123
Move galactic coordinates by a signed delta
TT16
Move the crosshairs on a chart
TT22 *
Show the Long-range Chart (red key f4)
TT23 *
Show the Short-range Chart (red key f5)
Copy protection
Hiding the Elite code from prying eyes
Subroutines
BEGIN% (Loader)
Single-byte decryption and copying routine, run on the stack
CHECKER (Loader)
Run checksum checks on tokens, loader and tape block count
David7 (Loader)
Part of the multi-jump obfuscation code in PROT1
DOMOVE (Loader) *
Multi-byte decryption and copying routine, run on the stack
doPROT1 (Loader) *
Routine to self-modify the loader code
LBL (Big Code file)
Checksum the two pages of code that were copied from UU% to LE%
swine (Loader)
Resets the machine if the copy protection detects a problem
Variables
Authors' names
The authors' names and a copyright notice, buried in the code
Authors' names (Loader)
The authors' names, buried in the code
BLOCK (Loader)
Addresses for the obfuscated jumps that use RTS not JMP
CHECKbyt (Loader)
Checksum for the validity of the UU% workspace
checksum0
Checksum for the entire main game code
CHECKV (Loader)
The address of the LBL routine in the decryption header
David23 (Loader)
Address pointer to the start of the 6502 stack
David9 (Loader)
Address used as part of the stack-based decryption loop
FOOLV (Loader)
Part of the AFOOL roundabout obfuscation routine
MAINSUM (Loader)
Two checksums for the decryption header and text token table
MHCA (Loader)
Used to set one of the vectors in the copy protection code
Dashboard
The dials, 3D scanner and compass
Subroutines
ABORT
Disarm missiles and update the dashboard indicators
ABORT2
Set/unset the lock target for a missile and update the dashboard
BULB
Draw an indicator bulb on the dashboard
BUMP2
Bump up the value of the pitch or roll dashboard indicator
cntr
Apply damping to the pitch or roll dashboard indicator
COMPAS *
Update the compass
DIALS (Part 1 of 4)
Update the dashboard: speed indicator
DIALS (Part 2 of 4)
Update the dashboard: pitch and roll indicators
DIALS (Part 3 of 4)
Update the dashboard: four energy banks
DIALS (Part 4 of 4)
Update the dashboard: shields, fuel, laser & cabin temp, altitude
DIL2
Update the roll or pitch indicator on the dashboard
DILX *
Update a bar-based indicator on the dashboard
DOT
Draw a dash on the compass
ECBLB
Light up the E.C.M. indicator bulb ("E") on the dashboard
ECBLB2
Start up the E.C.M. (light up the indicator, start the countdown and make the E.C.M. sound)
MSBAR
Draw a specific indicator in the dashboard's missile bar
msblob
Display the dashboard's missile indicators in green
PZW
Fetch the current dashboard colours, to support flashing
REDU2
Reduce the value of the pitch or roll dashboard indicator
SCAN *
Display the current ship on the scanner
SP1
Draw the space station on the compass
SP2
Draw a dot on the compass, given the planet/station vector
SPBLB
Light up the space station indicator ("S") on the dashboard
WPSHPS
Clear the scanner, reset the ball line and sun line heaps
Variables
ECBT
The character bitmap for the E.C.M. indicator bulb
SPBT
The bitmap definition for the space station indicator bulb
Drawing circles
Hyperspace tunnels, launch rings and planets
Subroutines
BLINE *
Draw a circle segment and add it to the ball line heap
CHKON
Check whether any part of a circle appears on the extended screen
CIRCLE
Draw a circle for the planet
CIRCLE2 *
Draw a circle (for the planet or chart)
HFS2 *
Draw the launch or hyperspace tunnel
LAUN
Make the launch sound and draw the launch tunnel
LL164
Make the hyperspace sound and draw the hyperspace tunnel
TT128 *
Draw a circle on a chart
TT14
Draw a circle with crosshairs on a chart
Drawing lines
The core line-drawing routines
Subroutines
EDGES
Draw a horizontal line given a centre and a half-width
HLOIN *
Draw a horizontal line from (X1, Y1) to (X2, Y1)
HLOIN2
Remove a line from the sun line heap and draw it on-screen
LASLI
Draw the laser lines for when we fire our lasers
LL118
Move a point along a line until it is on-screen
LL145 (Part 1 of 4) *
Clip line: Work out which end-points are on-screen, if any
LL145 (Part 2 of 4)
Clip line: Work out if any part of the line is on-screen
LL145 (Part 3 of 4)
Clip line: Calculate the line's gradient
LL145 (Part 4 of 4)
Clip line: Call the routine in LL188 to do the actual clipping
LOIN (Part 1 of 7) *
Draw a line: Calculate the line gradient in the form of deltas
LOIN (Part 2 of 7)
Draw a line: Line has a shallow gradient, step right along x-axis
LOIN (Part 3 of 7)
Draw a shallow line going right and up or left and down
LOIN (Part 4 of 7)
Draw a shallow line going right and down or left and up
LOIN (Part 5 of 7)
Draw a line: Line has a steep gradient, step up along y-axis
LOIN (Part 6 of 7)
Draw a steep line going up and left or down and right
LOIN (Part 7 of 7)
Draw a steep line going up and right or down and left
NLIN
Draw a horizontal line at pixel row 23 to box in a title
NLIN2
Draw a screen-wide horizontal line at the pixel row in A
NLIN3
Print a title and draw a horizontal line at row 19 to box it in
NLIN4
Draw a horizontal line at pixel row 19 to box in a title
TT15
Draw a set of crosshairs
Variables
TWFL
Ready-made character rows for the left end of a horizontal line in mode 4
TWFR
Ready-made character rows for the right end of a horizontal line in mode 4
Drawing pixels
How to plot pixels in various colours
Subroutines
CPIX2 *
Draw a single-height dash on the dashboard
CPIX4
Draw a double-height dot on the dashboard
PIX (Loader)
Draw a single pixel at a specific coordinate
PIXEL *
Draw a 1-pixel dot, 2-pixel dash or 4-pixel square
PIXEL2
Draw a stardust particle relative to the screen centre
PX3
Plot a single pixel at (X, Y) within a character block
Variables
CTWOS
Ready-made single-pixel character row bytes for mode 5
TWOS
Ready-made single-pixel character row bytes for mode 4
TWOS (Loader)
Ready-made single-pixel character row bytes for mode 4
TWOS2
Ready-made double-pixel character row bytes for mode 4
Drawing planets
Planets with meridians and craters
Subroutines
PL2
Remove the planet or sun from the screen
PL21
Return from a planet/sun-drawing routine with a failure flag
PL9 (Part 1 of 3) *
Draw the planet, with either an equator and meridian, or a crater
PL9 (Part 2 of 3)
Draw the planet's equator and meridian
PL9 (Part 3 of 3)
Draw the planet's crater
PLANET
Draw the planet or sun
PLL1 (Part 1 of 3) (Loader)
Draw Saturn on the loading screen (draw the planet)
PLL1 (Part 2 of 3) (Loader)
Draw Saturn on the loading screen (draw the stars)
PLL1 (Part 3 of 3) (Loader)
Draw Saturn on the loading screen (draw the rings)
PLS1
Calculate (Y A) = nosev_x / z
PLS2
Draw a half-ellipse
PLS22 *
Draw an ellipse or half-ellipse
PLS3
Calculate (Y A P) = 222 * roofv_x / z
PLS4
Calculate CNT2 = arctan(P / A) / 4
PLS5
Calculate roofv_x / z and roofv_y / z
PLS6
Calculate (X K) = (A P) / (z_sign z_hi z_lo)
WP1
Reset the ball line heap
WPLS2
Remove the planet from the screen
Variables
CNT (Loader)
A counter for use in drawing Saturn's planetary body
CNT2 (Loader)
A counter for use in drawing Saturn's background stars
CNT3 (Loader)
A counter for use in drawing Saturn's rings
Drawing ships
The celebrated 3D ship plotting process
Subroutines
DOEXP *
Draw an exploding ship
LL9 (Part 1 of 12)
Draw ship: Check if ship is exploding, check if ship is in front
LL9 (Part 2 of 12)
Draw ship: Check if ship is in field of view, close enough to draw
LL9 (Part 3 of 12)
Draw ship: Set up orientation vector, ship coordinate variables
LL9 (Part 4 of 12)
Draw ship: Set visibility for exploding ship (all faces visible)
LL9 (Part 5 of 12)
Draw ship: Calculate the visibility of each of the ship's faces
LL9 (Part 6 of 12)
Draw ship: Calculate the visibility of each of the ship's vertices
LL9 (Part 7 of 12)
Draw ship: Calculate the visibility of each of the ship's vertices
LL9 (Part 8 of 12)
Draw ship: Calculate the screen coordinates of visible vertices
LL9 (Part 9 of 12)
Draw ship: Draw laser beams if the ship is firing its laser at us
LL9 (Part 10 of 12)
Draw ship: Calculate the visibility of each of the ship's edges
LL9 (Part 11 of 12)
Draw ship: Add all visible edges to the ship line heap
LL9 (Part 12 of 12)
Draw ship: Draw all the visible edges from the ship line heap
SHPPT
Draw a distant ship as a point rather than a full wireframe
Variables
SHIP_ASTEROID
Ship blueprint for an asteroid
SHIP_CANISTER
Ship blueprint for a cargo canister
SHIP_COBRA_MK_3
Ship blueprint for a Cobra Mk III
SHIP_CORIOLIS
Ship blueprint for a Coriolis space station
SHIP_ESCAPE_POD
Ship blueprint for an escape pod
SHIP_MAMBA
Ship blueprint for a Mamba
SHIP_MISSILE
Ship blueprint for a missile
SHIP_PYTHON
Ship blueprint for a Python
SHIP_SIDEWINDER
Ship blueprint for a Sidewinder
SHIP_THARGOID
Ship blueprint for a Thargoid mothership
SHIP_THARGON
Ship blueprint for a Thargon
SHIP_VIPER
Ship blueprint for a Viper
XX21
Ship blueprints lookup table
Macros
EDGE
Macro definition for adding edges to ship blueprints
FACE
Macro definition for adding faces to ship blueprints
VERTEX
Macro definition for adding vertices to ship blueprints
Drawing suns
The epic, shimmering Elite sun
Subroutines
FLFLLS
Reset the sun line heap
SUN (Part 1 of 4)
Draw the sun: Set up all the variables needed to draw the sun
SUN (Part 2 of 4)
Draw the sun: Start from the bottom of the screen and erase the old sun line by line
SUN (Part 3 of 4)
Draw the sun: Continue to move up the screen, drawing the new sun line by line
SUN (Part 4 of 4)
Draw the sun: Continue to the top of the screen, erasing the old sun line by line
WPLS
Remove the sun from the screen
Drawing the screen
The split-screen mode and different screen views
Subroutines
CLYNS
Clear the bottom three text rows of the mode 4 screen
DET1
Show or hide the dashboard (for when we die)
IRQ1 *
The main screen-mode interrupt handler (IRQ1V points here)
IRQ1 (Loader) *
The loader's screen-mode interrupt handler (IRQ1V points here)
LYN
Clear most of a row of pixels
TT66
Clear the screen and set the current view type
TTX66
Clear the top part of the screen and draw a white border
WSCAN
Wait for the vertical sync
Variables
B% (Loader)
VDU commands for setting the square mode 4 screen
block1 (Loader)
Palette data for the two dashboard colour scheme
block2 (Loader)
Palette data for the space part of the screen
TVT1
Palette data for space and the two dashboard colour schemes
VEC
The original value of the IRQ1 vector
Equipment
Buying and selling weapons and ship upgrades
Subroutines
eq
Subtract the price of equipment from the cash pot
EQSHP *
Show the Equip Ship screen (red key f3)
prx
Return the price of a piece of equipment
qv
Print a menu of the four space views, for buying lasers
Variables
PRXS
Equipment prices
Flight
Docking, hyperspace, views, shields and more
Subroutines
DENGY
Drain some energy from the energy banks
ee3
Print the hyperspace countdown in the top-left of the screen
ESCAPE
Launch our escape pod
Ghy
Perform a galactic hyperspace jump
hy6
Print a message to say there is no hyperspacing allowed inside the station
hyp
Start the hyperspace process
LOOK1
Initialise the space view
me1
Erase an old in-flight message and display a new one
me2
Remove an in-flight message from the space view
mes9
Print a text token, possibly followed by " DESTROYED"
MESS
Display an in-flight message
MJP
Process a mis-jump into witchspace
OOPS
Take some damage
ou2
Display "E.C.M.SYSTEM DESTROYED" as an in-flight message
ou3
Display "FUEL SCOOPS DESTROYED" as an in-flight message
OUCH
Potentially lose cargo or equipment following damage
PLUT *
Flip the coordinate axes for the four different views
SESCP
Spawn an escape pod from the current (parent) ship
SHD
Charge a shield and drain some energy from the energy banks
SIGHT
Draw the laser crosshairs
TT110
Launch from a station or show the front space view
TT147
Print an error when a system is out of hyperspace range
TT18
Try to initiate a jump into hyperspace
WARP *
Perform an in-system jump
wW
Start a hyperspace countdown
Keyboard
Processing key presses and joysticks
Subroutines
CTRL
Scan the keyboard to see if CTRL is currently pressed
DK4
Scan for pause, configuration and secondary flight keys
DKJ1
Read joystick and flight controls
DKS1
Scan the keyboard for a flight key
DKS2
Read the joystick position
DKS3
Toggle a configuration setting and emit a beep
DKS4
Scan the keyboard to see if a specific key is being pressed
DOKEY *
Scan for the seven primary flight controls
RDKEY
Scan the keyboard for key presses
TT102 *
Process function key, save key, hyperspace and chart key presses and update the hyperspace counter
TT17
Scan the keyboard for cursor key or joystick movement
TT214
Ask a question with a "Y/N?" prompt and return the response
TT217
Scan the keyboard until a key is pressed
U%
Clear the key logger
Variables
KYTB
Lookup table for in-flight keyboard controls
Loader
The loading screen and system setup
Subroutines
Elite loader (Part 1 of 6) (Loader)
Include binaries for recursive tokens, Python blueprint and images
Elite loader (Part 2 of 6) (Loader)
Perform a number of OS calls, set up sound, push routines on stack
Elite loader (Part 3 of 6) (Loader)
Move and decrypt recursive tokens, Python blueprint and images
Elite loader (Part 4 of 6) (Loader)
Copy more code onto stack, decrypt TUT block, set up IRQ1 handler
Elite loader (Part 5 of 6) (Loader)
Load main game code, decrypt it, move it to the correct location
Elite loader (Part 6 of 6) (Loader)
Set up interrupt vectors, calculate checksums, run main game code
Main loop
The core loop that runs Elite
Subroutines
Main flight loop (Part 1 of 16)
Seed the random number generator
Main flight loop (Part 2 of 16)
Calculate the alpha and beta angles from the current pitch and roll of our ship
Main flight loop (Part 3 of 16)
Scan for flight keys and process the results
Main flight loop (Part 4 of 16)
For each nearby ship: Copy the ship's data block from K% to the zero-page workspace at INWK
Main flight loop (Part 5 of 16)
For each nearby ship: If an energy bomb has been set off, potentially kill this ship
Main flight loop (Part 6 of 16)
For each nearby ship: Move the ship in space and copy the updated INWK data block back to K%
Main flight loop (Part 7 of 16)
For each nearby ship: Check whether we are docking, scooping or colliding with it
Main flight loop (Part 8 of 16)
For each nearby ship: Process us potentially scooping this item
Main flight loop (Part 9 of 16)
For each nearby ship: If it is a space station, check whether we are successfully docking with it
Main flight loop (Part 10 of 16)
For each nearby ship: Remove if scooped, or process collisions
Main flight loop (Part 11 of 16)
For each nearby ship: Process missile lock and firing our laser
Main flight loop (Part 12 of 16)
For each nearby ship: Draw the ship, remove if killed, loop back
Main flight loop (Part 13 of 16)
Show energy bomb effect, charge shields and energy banks
Main flight loop (Part 14 of 16)
Spawn a space station if we are close enough to the planet
Main flight loop (Part 15 of 16)
Perform altitude checks with the planet and sun and process fuel scooping if appropriate
Main flight loop (Part 16 of 16)
Process laser pulsing, E.C.M. energy drain, call stardust routine
Main game loop (Part 1 of 6)
Spawn a trader (a peaceful Cobra Mk III)
Main game loop (Part 2 of 6) *
Call the main flight loop, and potentially spawn a trader, an asteroid, or a cargo canister
Main game loop (Part 3 of 6)
Potentially spawn a cop, particularly if we've been bad
Main game loop (Part 4 of 6)
Potentially spawn a lone bounty hunter, a Thargoid, or up to four pirates
Main game loop (Part 5 of 6)
Cool down lasers, make calls to update the dashboard
Main game loop (Part 6 of 6)
Process non-flight key presses (red function keys, docked keys)
Market
Market prices, selling, buying and inventory
Subroutines
dn
Print the amount of money we have left in the cash pot, then make a short, high beep and delay for 1 second
gnum
Get a number from the keyboard
tnpr
Work out if we have space for a specific amount of cargo
TT151
Print the name, price and availability of a market item
TT152
Print the unit ("t", "kg" or "g") for a market item
TT160
Print "t" (for tonne) and a space
TT161
Print "kg" (for kilograms)
TT163
Print the headers for the table of market prices
TT167 *
Show the Market Price screen (red key f7)
TT16a
Print "g" (for grams)
TT208 *
Show the Sell Cargo screen (red key f2)
TT210
Show a list of current cargo in our hold, optionally to sell
TT213 *
Show the Inventory screen (red key f9)
TT219 *
Show the Buy Cargo screen (red key f1)
var
Calculate QQ19+3 = economy * |economic_factor|
Variables
QQ23
Market prices table
Macros
ITEM
Macro definition for the market prices table
Maths (Arithmetic)
Addition, subtraction, multiplication, division
Subroutines
ADD *
Calculate (A X) = (A P) + (S R)
DORND *
Generate random numbers
DORND (Loader) *
Generate random numbers
DV41
Calculate (P R) = 256 * DELTA / A
DV42
Calculate (P R) = 256 * DELTA / z_hi
DVID3B2
Calculate K(3 2 1 0) = (A P+1 P) / (z_sign z_hi z_lo)
DVID4 *
Calculate (P R) = 256 * A / Q
DVIDT
Calculate (P+1 A) = (A P) / Q
FMLTU
Calculate A = A * Q / 256
FMLTU2
Calculate A = K * sin(A)
GC2
Calculate (Y X) = (A P) * 4
GCASH
Calculate (Y X) = P * Q * 4
LCASH
Subtract an amount of cash from the cash pot
LL120
Calculate (Y X) = (S x1_lo) * XX12+2 or (S x1_lo) / XX12+2
LL123
Calculate (Y X) = (S R) / XX12+2 or (S R) * XX12+2
LL129
Calculate Q = XX12+2, A = S EOR XX12+3 and (S R) = |S R|
LL28
Calculate R = 256 * A / Q
LL38
Calculate (S A) = (S R) + (A Q)
LL5
Calculate Q = SQRT(R Q)
LL61
Calculate (U R) = 256 * A / Q
LL62
Calculate 128 - (U R)
MAD
Calculate (A X) = Q * A + (S R)
MAS3
Calculate A = x_hi^2 + y_hi^2 + z_hi^2 in the K% block
MCASH
Add an amount of cash to the cash pot
MLS1
Calculate (A P) = ALP1 * A
MLS2
Calculate (S R) = XX(1 0) and (A P) = A * ALP1
MLTU2
Calculate (A P+1 P) = (A ~P) * Q
MLU1
Calculate Y1 = y_hi and (A P) = |y_hi| * Q for Y-th stardust
MLU2
Calculate (A P) = |A| * Q
MU1
Copy X into P and A, and clear the C flag
MU11
Calculate (A P) = P * X
MU5
Set K(3 2 1 0) = (A A A A) and clear the C flag
MU6
Set P(1 0) = (A A)
MULT1
Calculate (A P) = Q * A
MULT12
Calculate (S R) = Q * A
MULT3
Calculate K(3 2 1 0) = (A P+1 P) * Q
MULTU *
Calculate (A P) = P * Q
MUT1
Calculate R = XX and (A P) = Q * A
MUT2
Calculate (S R) = XX(1 0) and (A P) = Q * A
MUT3
An unused routine that does the same as MUT2
PIX1
Calculate (YY+1 SYL+Y) = (A P) + (S R) and draw stardust particle
ROOT (Loader)
Calculate ZP = SQRT(ZP(1 0))
SPS2
Calculate (Y X) = A / 10
SQUA
Clear bit 7 of A and calculate (A P) = A * A
SQUA2
Calculate (A P) = A * A
SQUA2 (Loader)
Calculate (A P) = A * A
TAS1
Calculate K3 = (x_sign x_hi x_lo) - V(1 0)
TIS1
Calculate (A ?) = (-X * A + (S R)) / 96
TIS2
Calculate A = A / Q
TIS3
Calculate -(nosev_1 * roofv_1 + nosev_2 * roofv_2) / nosev_3
Unused duplicate of MULTU
An unused duplicate of the MULTU routine
Maths (Geometry)
Vectors, coordinates, dot products and matrices
Subroutines
ARCTAN
Calculate A = arctan(P / Q)
FAROF
Compare x_hi, y_hi and z_hi with 224
FAROF2
Compare x_hi, y_hi and z_hi with A
LL51
Calculate the dot product of XX15 and XX16
MAS1
Add an orientation vector coordinate to an INWK coordinate
MAS2
Calculate a cap on the maximum distance to the planet or sun
MAS4
Calculate a cap on the maximum distance to a ship
NORM *
Normalise the three-coordinate vector in XX15
PROJ
Project the current ship or planet onto the screen
SPS1
Calculate the vector to the planet and store it in XX15
SPS3
Copy a space coordinate from the K% block into K3
SPS4
Calculate the vector to the space station
TAS2
Normalise the three-coordinate vector in K3
TAS3
Calculate the dot product of XX15 and an orientation vector
TIDY *
Orthonormalise the orientation vectors for a ship
Variables
ACT
Arctan table
SNE
Sine/cosine table
Moving
Moving and rotating ships and planets in space
Subroutines
MV40
Rotate the planet or sun's location in space by the amount of pitch and roll of our ship
MVEIT (Part 1 of 9)
Move current ship: Tidy the orientation vectors
MVEIT (Part 2 of 9)
Move current ship: Call tactics routine, remove ship from scanner
MVEIT (Part 3 of 9)
Move current ship: Move ship forward according to its speed
MVEIT (Part 4 of 9)
Move current ship: Apply acceleration to ship's speed as a one-off
MVEIT (Part 5 of 9)
Move current ship: Rotate ship's location by our pitch and roll
MVEIT (Part 6 of 9)
Move current ship: Move the ship in space according to our speed
MVEIT (Part 7 of 9)
Move current ship: Rotate ship's orientation vectors by pitch/roll
MVEIT (Part 8 of 9)
Move current ship: Rotate ship about itself by its own pitch/roll
MVEIT (Part 9 of 9)
Move current ship: Redraw on scanner, if it hasn't been destroyed
MVS4 *
Apply pitch and roll to an orientation vector
MVS5
Apply a 3.6 degree pitch or roll to an orientation vector
MVT1
Calculate (x_sign x_hi x_lo) = (x_sign x_hi x_lo) + (A R)
MVT3
Calculate K(3 2 1) = (x_sign x_hi x_lo) + K(3 2 1)
MVT6
Calculate (A P+2 P+1) = (x_sign x_hi x_lo) + (A P+2 P+1)
SFS2
Move a ship in space along one of the coordinate axes
Save and load
Commander files and competition codes
Subroutines
CHECK
Calculate the checksum for the last saved commander data block
GTNME
Fetch the name of a commander file to save or load
LOD *
Load a commander file
QUS1
Save or load the commander file
SVE *
Save the commander file
TR1
Copy the last saved commander's name from NA% to INWK
TRNME
Copy the last saved commander's name from INWK to NA%
Variables
CHK
First checksum byte for the saved commander data file
CHK2
Second checksum byte for the saved commander data file
NA%
The data block for the last saved commander
SVN
The "saving in progress" flag
Sound
Explosions, laser fire, hyperspace and more
Subroutines
BEEP
Make a short, high beep
BELL
Make a standard system beep
ECMOF
Switch off the E.C.M.
EXNO
Make the sound of a laser strike or ship explosion
EXNO3
Make an explosion sound
NO3
Make a sound from a prepared sound block
NOISE *
Make the sound whose number is in A
NOS1
Prepare a sound block
Variables
E% (Loader)
Sound envelope definitions
SFX
Sound data
Macros
FNE (Loader)
Macro definition for defining a sound envelope
Stardust
Stardust generation and movement
Subroutines
FLIP
Reflect the stardust particles in the screen diagonal and redraw the stardust field
nWq
Create a random cloud of stardust
NWSTARS
Initialise the stardust field
STARS *
The main routine for processing the stardust
STARS1
Process the stardust for the front view
STARS2
Process the stardust for the left or right view
STARS6
Process the stardust for the rear view
Start and end
The title screen... and the Game Over screen
Subroutines
BR1 (Part 1 of 2)
Show the "Load New Commander (Y/N)?" screen and start the game
BR1 (Part 2 of 2)
Show the "Press Fire or Space, Commander" screen and start the game
DEATH *
Display the death screen
DEATH2
Reset most of the game and restart from the title screen
QU5
Reset the current commander data block to the last saved commander
RES2
Reset a number of flight variables and workspaces
RESET
Reset most variables
TITLE *
Display a title screen with a rotating ship and prompt
TT170 *
Main entry point for the Elite game code
Status
Showing the commander's status and rank
Subroutines
BAD
Calculate how bad we have been
BAY
Go to the docking bay (i.e. show the Status Mode screen)
cmn
Print the commander's name
csh
Print the current amount of cash
EXNO2
Process us making a kill
fwl
Print fuel and cash levels
STATUS *
Show the Status Mode screen (red key f8)
Tactics
AI tactics for enemy ships and missiles
Subroutines
ANGRY
Make a ship hostile
FR1
Display the "missile jammed" message
FRMIS
Fire a missile from our ship
FRS1
Launch a ship straight ahead of us, below the laser sights
HITCH *
Work out if the ship in INWK is in our crosshairs
SFRMIS
Add an enemy missile to our local bubble of universe
TACTICS (Part 1 of 7)
Apply tactics: Process missiles, both enemy missiles and our own
TACTICS (Part 2 of 7) *
Apply tactics: Escape pod, station, lone Thargon, safe-zone pirate
TACTICS (Part 3 of 7)
Apply tactics: Calculate dot product to determine ship's aim
TACTICS (Part 4 of 7)
Apply tactics: Check energy levels, maybe launch escape pod if low
TACTICS (Part 5 of 7)
Apply tactics: Consider whether to launch a missile at us
TACTICS (Part 6 of 7)
Apply tactics: Consider firing a laser at us, if aim is true
TACTICS (Part 7 of 7)
Apply tactics: Set pitch, roll, and acceleration
Text
The game's recursive text tokenisation system
Subroutines
BPRNT *
Print a 32-bit number, left-padded to a specific number of digits, with an optional decimal point
crlf
Tab to column 21 and print a colon
dn2
Make a short, high beep and delay for 1 second
ex
Print a recursive token
plf
Print a text token followed by a newline
plf2
Print text followed by a newline and indent of 6 characters
pr2
Print an 8-bit number, left-padded to 3 digits, and optional point
pr5
Print a 16-bit number, left-padded to 5 digits, and optional point
pr6
Print 16-bit number, left-padded to 5 digits, no point
prq
Print a text token followed by a question mark
qw
Print a recursive token in the range 128-145
spc
Print a text token followed by a space
TT11
Print a 16-bit number, left-padded to n digits, and optional point
TT162
Print a space
TT26 *
Print a character at the text cursor by poking into screen memory
TT26 (Loader) *
Print a character at the text cursor (WRCHV points here)
TT27 *
Print a text token
TT41
Print a letter according to Sentence Case
TT42
Print a letter in lower case
TT43
Print a two-letter token or recursive token 0-95
TT45
Print a letter in lower case
TT46
Print a character and switch to capitals
TT60
Print a text token and a paragraph break
TT67
Print a newline
TT68
Print a text token followed by a colon
TT69
Set Sentence Case and print a newline
TT73
Print a colon
TT74
Print a character
TTX69
Print a paragraph break
Variables
QQ16
The two-letter token lookup table
QQ18
The recursive token table for tokens 0-148
RLINE
The OSWORD configuration block used to fetch a line of text from the keyboard
TENS
A constant used when printing large numbers in BPRNT
XC (Loader)
The x-coordinate of the text cursor
YC (Loader)
The y-coordinate of the text cursor
Macros
CHAR
Macro definition for characters in the recursive token table
CONT
Macro definition for control codes in the recursive token table
RTOK
Macro definition for recursive tokens in the recursive token table
TWOK
Macro definition for two-letter tokens in the token table
Universe
Ship spawning, local bubble, system/market data
Subroutines
cpl
Print the selected system name
GINF
Fetch the address of a ship's data block into INF
GTHG
Spawn a Thargoid ship and a Thargon companion
GVL
Calculate the availability of market items
hyp1
Process a jump to the system closest to (QQ9, QQ10)
jmp
Set the current system to the selected system
KILLSHP *
Remove a ship from our local bubble of universe
KS1
Remove the current ship from our local bubble of universe
KS2
Check the local bubble for missiles with target lock
KS3
Set the SLSP ship line heap pointer after shuffling ship slots
KS4
Remove the space station and replace it with the sun
NwS1
Flip the sign and double an INWK byte
NWSHP
Add a new ship to our local bubble of universe
NWSPS
Add a new space station to our local bubble of universe
ping
Set the selected system to the current system
SFS1 *
Spawn a child ship from the current (parent) ship
SOLAR
Set up various aspects of arriving in a new system
SOS1
Update the missile indicators, set up the planet data block
tal
Print the current galaxy number
TT111
Set the current system to the nearest system to a point
TT146
Print the distance to the selected system in light years
TT20
Twist the selected system's seeds four times
TT24 *
Calculate system data from the system seeds
TT25 *
Show the Data on System screen (red key f6)
TT54 *
Twist the selected system's seeds
TT70
Display "MAINLY " and jump to TT72
TT81
Set the selected system's seeds to those of system 0
ypl
Print the current system name
Ze
Initialise the INWK workspace to a hostile ship
ZINF
Reset the INWK workspace and orientation vectors
Variables
UNIV
Table of pointers to the local universe's ship data blocks
Utility routines
Memory/screen clearing, delay routines
Subroutines
command (Loader)
Execute an OS command
DELAY
Wait for a specified time, in 1/50s of a second
FX200
Set the behaviour of the ESCAPE and BREAK keys
OSB (Loader)
A convenience routine for calling OSBYTE with Y = 0
osprint (Loader)
Print a character
ZERO
Zero-fill pages &9, &A, &B, &C and &D
ZES1
Zero-fill the page whose number is in X
ZES2
Zero-fill a specific page
Variables
M2 (Loader)
Used for testing the 6522 System VIA status byte in IRQ1
MESS1 (Loader)
Contains an OS command string for loading the main game code
oscliv (Loader)
Contains the address of OSCLIV, for executing OS commands
Workspaces
Collections of important variables into blocks
Workspaces
K% *
Ship data blocks and ship line heaps
S%
Vector addresses, compass colour and configuration settings
T%
Current commander data and stardust data blocks
UU% (Loader)
Marker for a block that is moved as part of the obfuscation
WP
Ship slots, variables
XX3
Temporary storage space for complex calculations
ZP *
Lots of important variables are stored in the zero page workspace as it is quicker and more space-efficient to access memory here
ZP (Big Code file) *
Important variables used by the loader
ZP (Loader) *
Important variables used by the loader
BBC Micro disc source code
An enhanced version with missions and more ships
Version information
About the BBC Micro disc version
Information on the enhanced version of Elite
Different variants of the BBC Micro disc version
Code variations found in disc Elite
BBC Micro disc source code by file
Map of the source code
An overview of how the source code for Elite is structured
Annotated original source files
The source files in their original structure
Game loader
Loader 1 source
Initial setup and disc copy protection
Loader 2 source
The mode 7 screen set-up for the main game
Text tokens
Elite's tokenised game text
Missile ship blueprint
The ship blueprint for the missile
Loader 3 source
The Saturn loading screen and main game loader
Main game docked code
Docked workspaces
The main variable workspaces used when docked
Elite A docked source
Part 1 of the main docked code
Elite B docked source
Part 2 of the main docked code
Elite C docked source
Part 3 of the main docked code
Elite D docked source
Part 4 of the main docked code
Elite E docked source
Part 5 of the main docked code
Elite F docked source
Part 6 of the main docked code
Elite G docked source
Part 7 of the main docked code
Elite H docked source
Part 8 of the main docked code
Ship hangar blueprints
Data for ships in the ship hangar
Main game flight code
Flight workspaces
The main variable workspaces used in flight
Elite A flight source
Part 1 of the main flight code
Elite B flight source
Part 2 of the main flight code
Elite C flight source
Part 3 of the main flight code
Elite D flight source
Part 4 of the main flight code
Elite E flight source
Part 5 of the main flight code
Elite F flight source
Part 6 of the main flight code
Elite G flight source
Part 7 of the main flight code
Elite H flight source
Part 8 of the main flight code
Ship blueprint files
Ship blueprints A source
The D.MOA ship blueprints file
Ship blueprints B source
The D.MOB ship blueprints file
Ship blueprints C source
The D.MOC ship blueprints file
Ship blueprints D source
The D.MOD ship blueprints file
Ship blueprints E source
The D.MOE ship blueprints file
Ship blueprints F source
The D.MOF ship blueprints file
Ship blueprints G source
The D.MOG ship blueprints file
Ship blueprints H source
The D.MOH ship blueprints file
Ship blueprints I source
The D.MOI ship blueprints file
Ship blueprints J source
The D.MOJ ship blueprints file
Ship blueprints K source
The D.MOK ship blueprints file
Ship blueprints L source
The D.MOL ship blueprints file
Ship blueprints M source
The D.MOM ship blueprints file
Ship blueprints N source
The D.MON ship blueprints file
Ship blueprints O source
The D.MOO ship blueprints file
Ship blueprints P source
The D.MOP ship blueprints file
BBC Micro disc source code by category
Charts
Long-range and short-range galactic charts
Subroutines
hm (Docked)
Select the closest system and redraw the chart crosshairs
hm (Flight)
Select the closest system and redraw the chart crosshairs
HME2 (Docked)
Search the galaxy for a system
TT103 (Docked)
Draw a small set of crosshairs on a chart
TT103 (Flight)
Draw a small set of crosshairs on a chart
TT105 (Docked)
Draw crosshairs on the Short-range Chart, with clipping
TT105 (Flight)
Draw crosshairs on the Short-range Chart, with clipping
TT114 (Flight)
Display either the Long-range or Short-range Chart
TT123 (Docked)
Move galactic coordinates by a signed delta
TT123 (Flight)
Move galactic coordinates by a signed delta
TT16 (Docked)
Move the crosshairs on a chart
TT16 (Flight)
Move the crosshairs on a chart
TT22 (Docked) *
Show the Long-range Chart (red key f4)
TT22 (Flight) *
Show the Long-range Chart (red key f4)
TT23 (Docked) *
Show the Short-range Chart (red key f5)
TT23 (Flight) *
Show the Short-range Chart (red key f5)
Copy protection
Hiding the Elite code from prying eyes
Subroutines
BEGIN (Loader 1)
Decrypt the loader code using a rolling EOR that uses the decryption routine itself to seed the decryption
CHECK (Loader 3)
Calculate a checksum from two 256-byte portions of the loader code
LOAD (Loader 1)
Load a hidden file from disc (not used in this version as disc protection is disabled)
LOAD (Loader 2)
This code accesses the disc directly (not used in this version as disc protection is disabled)
LOADcode (Loader 2)
LOAD routine, bundled up in the loader so it can be moved to &0400 to be run
OSBmod (Loader 3)
Calculate a checksum on &0F00 to &0FFF (the test is disabled in this version)
PROT1 (Loader 3)
Part of the CHKSM copy protection checksum calculation
PROT2 (Loader 3)
Part of the CHKSM copy protection checksum calculation
PROT3 (Loader 3)
Part of the CHKSM copy protection checksum calculation
Unused copy protection routine (Loader 2)
This code doesn't appear to be run in this version
Variables
BLOCK (Loader 1)
These bytes are copied and decrypted by the loader routine (not used in this version as disc protection is disabled)
Checksum (Docked)
Contains a checksum at &55FF that is checked by the loader
PARAMS1 (Loader 1)
OSWORD parameter block for accessing a specific track on the disc (not used in this version as disc protection is disabled)
PARAMS2 (Loader 1)
OSWORD parameter block for accessing a specific track on the disc (not used in this version as disc protection is disabled)
PARAMS3 (Loader 1)
OSWORD parameter block for loading the ELITE3 loader file (not used in this version as disc protection is disabled)
Dashboard
The dials, 3D scanner and compass
Subroutines
ABORT (Docked)
Disarm missiles and update the dashboard indicators
ABORT (Flight)
Disarm missiles and update the dashboard indicators
ABORT2 (Docked)
Set/unset the lock target for a missile and update the dashboard
ABORT2 (Flight)
Set/unset the lock target for a missile and update the dashboard
BULB (Docked)
Draw an indicator bulb on the dashboard
BULB (Flight)
Draw an indicator bulb on the dashboard
BUMP2 (Docked)
Bump up the value of the pitch or roll dashboard indicator
BUMP2 (Flight)
Bump up the value of the pitch or roll dashboard indicator
cntr (Docked)
Apply damping to the pitch or roll dashboard indicator
cntr (Flight)
Apply damping to the pitch or roll dashboard indicator
COMPAS (Flight) *
Update the compass
DIALS (Part 1 of 4) (Docked)
Update the dashboard: speed indicator
DIALS (Part 1 of 4) (Flight)
Update the dashboard: speed indicator
DIALS (Part 2 of 4) (Docked)
Update the dashboard: pitch and roll indicators
DIALS (Part 2 of 4) (Flight)
Update the dashboard: pitch and roll indicators
DIALS (Part 3 of 4) (Docked)
Update the dashboard: four energy banks
DIALS (Part 3 of 4) (Flight)
Update the dashboard: four energy banks
DIALS (Part 4 of 4) (Docked)
Update the dashboard: shields, fuel, laser & cabin temp, altitude
DIALS (Part 4 of 4) (Flight)
Update the dashboard: shields, fuel, laser & cabin temp, altitude
DIL2 (Docked)
Update the roll or pitch indicator on the dashboard
DIL2 (Flight)
Update the roll or pitch indicator on the dashboard
DILX (Docked) *
Update a bar-based indicator on the dashboard
DILX (Flight) *
Update a bar-based indicator on the dashboard
DOT (Flight)
Draw a dash on the compass
ECBLB (Flight)
Light up the E.C.M. indicator bulb ("E") on the dashboard
ECBLB2 (Flight)
Start up the E.C.M. (light up the indicator, start the countdown and make the E.C.M. sound)
MSBAR (Docked)
Draw a specific indicator in the dashboard's missile bar
MSBAR (Flight)
Draw a specific indicator in the dashboard's missile bar
msblob (Docked)
Display the dashboard's missile indicators in green
msblob (Flight)
Display the dashboard's missile indicators in green
PZW (Docked)
Fetch the current dashboard colours, to support flashing
PZW (Flight)
Fetch the current dashboard colours, to support flashing
REDU2 (Docked)
Reduce the value of the pitch or roll dashboard indicator
REDU2 (Flight)
Reduce the value of the pitch or roll dashboard indicator
SCAN (Flight) *
Display the current ship on the scanner
SP1 (Flight)
Draw the space station on the compass
SP2 (Flight)
Draw a dot on the compass, given the planet/station vector
SPBLB (Docked)
Light up the space station indicator ("S") on the dashboard
SPBLB (Flight)
Light up the space station indicator ("S") on the dashboard
WPSHPS (Docked)
Clear the scanner, reset the ball line and sun line heaps
WPSHPS (Flight)
Clear the scanner, reset the ball line and sun line heaps
Variables
ECBT (Flight)
The character bitmap for the E.C.M. indicator bulb
SPBT (Docked)
The bitmap definition for the space station indicator bulb
SPBT (Flight)
The bitmap definition for the space station indicator bulb
Drawing circles
Hyperspace tunnels, launch rings and planets
Subroutines
BLINE (Docked) *
Draw a circle segment and add it to the ball line heap
BLINE (Flight) *
Draw a circle segment and add it to the ball line heap
CHKON (Docked)
Check whether any part of a circle appears on the extended screen
CHKON (Flight)
Check whether any part of a circle appears on the extended screen
CIRCLE (Docked)
Draw a circle for the planet
CIRCLE (Flight)
Draw a circle for the planet
CIRCLE2 (Docked) *
Draw a circle (for the planet or chart)
CIRCLE2 (Flight) *
Draw a circle (for the planet or chart)
HFS2 (Docked) *
Draw the launch or hyperspace tunnel
HFS2 (Flight) *
Draw the launch or hyperspace tunnel
LAUN (Docked)
Make the launch sound and draw the launch tunnel
LAUN (Flight)
Make the launch sound and draw the launch tunnel
LL164 (Docked)
Make the hyperspace sound and draw the hyperspace tunnel
LL164 (Flight)
Make the hyperspace sound and draw the hyperspace tunnel
TT128 (Docked) *
Draw a circle on a chart
TT128 (Flight) *
Draw a circle on a chart
TT14 (Docked)
Draw a circle with crosshairs on a chart
TT14 (Flight)
Draw a circle with crosshairs on a chart
Drawing lines
The core line-drawing routines
Subroutines
EDGES (Docked)
Draw a horizontal line given a centre and a half-width
EDGES (Flight)
Draw a horizontal line given a centre and a half-width
HLOIN (Docked) *
Draw a horizontal line from (X1, Y1) to (X2, Y1)
HLOIN (Flight) *
Draw a horizontal line from (X1, Y1) to (X2, Y1)
HLOIN2 (Docked)
Remove a line from the sun line heap and draw it on-screen
HLOIN2 (Flight)
Remove a line from the sun line heap and draw it on-screen
LASLI (Flight)
Draw the laser lines for when we fire our lasers
LL118 (Docked)
Move a point along a line until it is on-screen
LL118 (Flight)
Move a point along a line until it is on-screen
LL145 (Part 1 of 4) (Docked) *
Clip line: Work out which end-points are on-screen, if any
LL145 (Part 1 of 4) (Flight) *
Clip line: Work out which end-points are on-screen, if any
LL145 (Part 2 of 4) (Docked)
Clip line: Work out if any part of the line is on-screen
LL145 (Part 2 of 4) (Flight)
Clip line: Work out if any part of the line is on-screen
LL145 (Part 3 of 4) (Docked)
Clip line: Calculate the line's gradient
LL145 (Part 3 of 4) (Flight)
Clip line: Calculate the line's gradient
LL145 (Part 4 of 4) (Docked)
Clip line: Call the routine in LL188 to do the actual clipping
LL145 (Part 4 of 4) (Flight)
Clip line: Call the routine in LL188 to do the actual clipping
LOIN (Part 1 of 7) (Docked) *
Draw a line: Calculate the line gradient in the form of deltas
LOIN (Part 1 of 7) (Flight) *
Draw a line: Calculate the line gradient in the form of deltas
LOIN (Part 2 of 7) (Docked)
Draw a line: Line has a shallow gradient, step right along x-axis
LOIN (Part 2 of 7) (Flight)
Draw a line: Line has a shallow gradient, step right along x-axis
LOIN (Part 3 of 7) (Docked)
Draw a shallow line going right and up or left and down
LOIN (Part 3 of 7) (Flight)
Draw a shallow line going right and up or left and down
LOIN (Part 4 of 7) (Docked)
Draw a shallow line going right and down or left and up
LOIN (Part 4 of 7) (Flight)
Draw a shallow line going right and down or left and up
LOIN (Part 5 of 7) (Docked)
Draw a line: Line has a steep gradient, step up along y-axis
LOIN (Part 5 of 7) (Flight)
Draw a line: Line has a steep gradient, step up along y-axis
LOIN (Part 6 of 7) (Docked)
Draw a steep line going up and left or down and right
LOIN (Part 6 of 7) (Flight)
Draw a steep line going up and left or down and right
LOIN (Part 7 of 7) (Docked)
Draw a steep line going up and right or down and left
LOIN (Part 7 of 7) (Flight)
Draw a steep line going up and right or down and left
NLIN (Docked)
Draw a horizontal line at pixel row 23 to box in a title
NLIN (Flight)
Draw a horizontal line at pixel row 23 to box in a title
NLIN2 (Docked)
Draw a screen-wide horizontal line at the pixel row in A
NLIN2 (Flight)
Draw a screen-wide horizontal line at the pixel row in A
NLIN3 (Docked)
Print a title and draw a horizontal line at row 19 to box it in
NLIN3 (Flight)
Print a title and draw a horizontal line at row 19 to box it in
NLIN4 (Docked)
Draw a horizontal line at pixel row 19 to box in a title
NLIN4 (Flight)
Draw a horizontal line at pixel row 19 to box in a title
TT15 (Docked)
Draw a set of crosshairs
TT15 (Flight)
Draw a set of crosshairs
Variables
TWFL (Docked)
Ready-made character rows for the left end of a horizontal line in mode 4
TWFL (Flight)
Ready-made character rows for the left end of a horizontal line in mode 4
TWFR (Docked)
Ready-made character rows for the right end of a horizontal line in mode 4
TWFR (Flight)
Ready-made character rows for the right end of a horizontal line in mode 4
Drawing pixels
How to plot pixels in various colours
Subroutines
CPIX2 (Docked) *
Draw a single-height dash on the dashboard
CPIX2 (Flight) *
Draw a single-height dash on the dashboard
CPIX4 (Docked)
Draw a double-height dot on the dashboard
CPIX4 (Flight)
Draw a double-height dot on the dashboard
PIX (Loader 3)
Draw a single pixel at a specific coordinate
PIXEL (Docked) *
Draw a 1-pixel dot, 2-pixel dash or 4-pixel square
PIXEL (Flight) *
Draw a 1-pixel dot, 2-pixel dash or 4-pixel square
PIXEL2 (Docked)
Draw a stardust particle relative to the screen centre
PIXEL2 (Flight)
Draw a stardust particle relative to the screen centre
PX3 (Docked)
Plot a single pixel at (X, Y) within a character block
PX3 (Flight)
Plot a single pixel at (X, Y) within a character block
Variables
CTWOS (Docked)
Ready-made single-pixel character row bytes for mode 5
CTWOS (Flight)
Ready-made single-pixel character row bytes for mode 5
TWOS (Docked)
Ready-made single-pixel character row bytes for mode 4
TWOS (Flight)
Ready-made single-pixel character row bytes for mode 4
TWOS (Loader 3)
Ready-made single-pixel character row bytes for mode 4
TWOS2 (Docked)
Ready-made double-pixel character row bytes for mode 4
TWOS2 (Flight)
Ready-made double-pixel character row bytes for mode 4
Drawing planets
Planets with meridians and craters
Subroutines
PL2 (Flight)
Remove the planet or sun from the screen
PL21 (Docked)
Return from a planet/sun-drawing routine with a failure flag
PL21 (Flight)
Return from a planet/sun-drawing routine with a failure flag
PL9 (Part 1 of 3) (Flight) *
Draw the planet, with either an equator and meridian, or a crater
PL9 (Part 2 of 3) (Flight)
Draw the planet's equator and meridian
PL9 (Part 3 of 3) (Flight)
Draw the planet's crater
PLANET (Flight)
Draw the planet or sun
PLL1 (Part 1 of 3) (Loader 3)
Draw Saturn on the loading screen (draw the planet)
PLL1 (Part 2 of 3) (Loader 3)
Draw Saturn on the loading screen (draw the stars)
PLL1 (Part 3 of 3) (Loader 3)
Draw Saturn on the loading screen (draw the rings)
PLS1 (Flight)
Calculate (Y A) = nosev_x / z
PLS2 (Flight)
Draw a half-ellipse
PLS22 (Flight) *
Draw an ellipse or half-ellipse
PLS3 (Flight)
Calculate (Y A P) = 222 * roofv_x / z
PLS4 (Flight)
Calculate CNT2 = arctan(P / A) / 4
PLS5 (Flight)
Calculate roofv_x / z and roofv_y / z
PLS6 (Flight)
Calculate (X K) = (A P) / (z_sign z_hi z_lo)
WP1 (Docked)
Reset the ball line heap
WP1 (Flight)
Reset the ball line heap
WPLS2 (Flight)
Remove the planet from the screen
Variables
CNT (Loader 3)
A counter for use in drawing Saturn's planetary body
CNT2 (Loader 3)
A counter for use in drawing Saturn's background stars
CNT3 (Loader 3)
A counter for use in drawing Saturn's rings
RAND (Loader 3)
The random number seed used for drawing Saturn
Drawing ships
The celebrated 3D ship plotting process
Subroutines
DOEXP (Docked) *
Draw an exploding ship
DOEXP (Flight) *
Draw an exploding ship
LL9 (Part 1 of 12) (Docked)
Draw ship: Check if ship is exploding, check if ship is in front
LL9 (Part 1 of 12) (Flight)
Draw ship: Check if ship is exploding, check if ship is in front
LL9 (Part 2 of 12) (Docked)
Draw ship: Check if ship is in field of view, close enough to draw
LL9 (Part 2 of 12) (Flight)
Draw ship: Check if ship is in field of view, close enough to draw
LL9 (Part 3 of 12) (Docked)
Draw ship: Set up orientation vector, ship coordinate variables
LL9 (Part 3 of 12) (Flight)
Draw ship: Set up orientation vector, ship coordinate variables
LL9 (Part 4 of 12) (Docked)
Draw ship: Set visibility for exploding ship (all faces visible)
LL9 (Part 4 of 12) (Flight)
Draw ship: Set visibility for exploding ship (all faces visible)
LL9 (Part 5 of 12) (Docked)
Draw ship: Calculate the visibility of each of the ship's faces
LL9 (Part 5 of 12) (Flight)
Draw ship: Calculate the visibility of each of the ship's faces
LL9 (Part 6 of 12) (Docked)
Draw ship: Calculate the visibility of each of the ship's vertices
LL9 (Part 6 of 12) (Flight)
Draw ship: Calculate the visibility of each of the ship's vertices
LL9 (Part 7 of 12) (Docked)
Draw ship: Calculate the visibility of each of the ship's vertices
LL9 (Part 7 of 12) (Flight)
Draw ship: Calculate the visibility of each of the ship's vertices
LL9 (Part 8 of 12) (Docked)
Draw ship: Calculate the screen coordinates of visible vertices
LL9 (Part 8 of 12) (Flight)
Draw ship: Calculate the screen coordinates of visible vertices
LL9 (Part 9 of 12) (Docked)
Draw ship: Draw laser beams if the ship is firing its laser at us
LL9 (Part 9 of 12) (Flight)
Draw ship: Draw laser beams if the ship is firing its laser at us
LL9 (Part 10 of 12) (Docked)
Draw ship: Calculate the visibility of each of the ship's edges
LL9 (Part 10 of 12) (Flight)
Draw ship: Calculate the visibility of each of the ship's edges
LL9 (Part 11 of 12) (Docked)
Draw ship: Add all visible edges to the ship line heap
LL9 (Part 11 of 12) (Flight)
Draw ship: Add all visible edges to the ship line heap
LL9 (Part 12 of 12) (Docked)
Draw ship: Draw all the visible edges from the ship line heap
LL9 (Part 12 of 12) (Flight)
Draw ship: Draw all the visible edges from the ship line heap
SHPPT (Docked)
Draw a distant ship as a point in the middle of the screen
SHPPT (Flight)
Draw a distant ship as a point rather than a full wireframe
Variables
E% (Docked)
Ship blueprints default NEWB flags for the ship hangar
E% (Ship blueprints A)
Ship blueprints default NEWB flags for the D.MOA file
E% (Ship blueprints B)
Ship blueprints default NEWB flags for the D.MOB file
E% (Ship blueprints C)
Ship blueprints default NEWB flags for the D.MOC file
E% (Ship blueprints D)
Ship blueprints default NEWB flags for the D.MOD file
E% (Ship blueprints E)
Ship blueprints default NEWB flags for the D.MOE file
E% (Ship blueprints F)
Ship blueprints default NEWB flags for the D.MOF file
E% (Ship blueprints G)
Ship blueprints default NEWB flags for the D.MOG file
E% (Ship blueprints H)
Ship blueprints default NEWB flags for the D.MOH file
E% (Ship blueprints I)
Ship blueprints default NEWB flags for the D.MOI file
E% (Ship blueprints J)
Ship blueprints default NEWB flags for the D.MOJ file
E% (Ship blueprints K)
Ship blueprints default NEWB flags for the D.MOK file
E% (Ship blueprints L)
Ship blueprints default NEWB flags for the D.MOL file
E% (Ship blueprints M)
Ship blueprints default NEWB flags for the D.MOM file
E% (Ship blueprints N)
Ship blueprints default NEWB flags for the D.MON file
E% (Ship blueprints O)
Ship blueprints default NEWB flags for the D.MOO file
E% (Ship blueprints P)
Ship blueprints default NEWB flags for the D.MOP file
SHIP_ADDER (Ship blueprints B)
Ship blueprint for an Adder
SHIP_ADDER (Ship blueprints G)
Ship blueprint for an Adder
SHIP_ADDER (Ship blueprints I)
Ship blueprint for an Adder
SHIP_ADDER (Ship blueprints M)
Ship blueprint for an Adder
SHIP_ANACONDA (Ship blueprints L)
Ship blueprint for an Anaconda
SHIP_ASP_MK_2 (Ship blueprints N)
Ship blueprint for an Asp Mk II
SHIP_ASP_MK_2 (Ship blueprints P)
Ship blueprint for an Asp Mk II
SHIP_ASTEROID (Ship blueprints C)
Ship blueprint for an asteroid
SHIP_ASTEROID (Ship blueprints D)
Ship blueprint for an asteroid
SHIP_ASTEROID (Ship blueprints H)
Ship blueprint for an asteroid
SHIP_ASTEROID (Ship blueprints K)
Ship blueprint for an asteroid
SHIP_ASTEROID (Ship blueprints N)
Ship blueprint for an asteroid
SHIP_ASTEROID (Ship blueprints O)
Ship blueprint for an asteroid
SHIP_ASTEROID (Ship blueprints P)
Ship blueprint for an asteroid
SHIP_BOA (Ship blueprints C)
Ship blueprint for a Boa
SHIP_BOA (Ship blueprints F)
Ship blueprint for a Boa
SHIP_BOULDER (Ship blueprints B)
Ship blueprint for a boulder
SHIP_BOULDER (Ship blueprints E)
Ship blueprint for a boulder
SHIP_BOULDER (Ship blueprints F)
Ship blueprint for a boulder
SHIP_BOULDER (Ship blueprints G)
Ship blueprint for a boulder
SHIP_BOULDER (Ship blueprints P)
Ship blueprint for a boulder
SHIP_CANISTER (Docked)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints A)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints B)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints C)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints D)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints E)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints F)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints G)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints H)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints I)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints J)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints K)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints L)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints M)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints N)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints O)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints P)
Ship blueprint for a cargo canister
SHIP_COBRA_MK_1 (Ship blueprints D)
Ship blueprint for a Cobra Mk I
SHIP_COBRA_MK_1 (Ship blueprints E)
Ship blueprint for a Cobra Mk I
SHIP_COBRA_MK_1 (Ship blueprints J)
Ship blueprint for a Cobra Mk I
SHIP_COBRA_MK_1 (Ship blueprints K)
Ship blueprint for a Cobra Mk I
SHIP_COBRA_MK_1 (Ship blueprints M)
Ship blueprint for a Cobra Mk I
SHIP_COBRA_MK_1 (Ship blueprints O)
Ship blueprint for a Cobra Mk I
SHIP_COBRA_MK_3 (Docked)
Ship blueprint for a Cobra Mk III
SHIP_COBRA_MK_3 (Ship blueprints B)
Ship blueprint for a Cobra Mk III
SHIP_COBRA_MK_3 (Ship blueprints C)
Ship blueprint for a Cobra Mk III
SHIP_COBRA_MK_3 (Ship blueprints D)
Ship blueprint for a Cobra Mk III
SHIP_COBRA_MK_3 (Ship blueprints E)
Ship blueprint for a Cobra Mk III
SHIP_COBRA_MK_3 (Ship blueprints F)
Ship blueprint for a Cobra Mk III
SHIP_COBRA_MK_3 (Ship blueprints G)
Ship blueprint for a Cobra Mk III
SHIP_COBRA_MK_3 (Ship blueprints K)
Ship blueprint for a Cobra Mk III
SHIP_COBRA_MK_3 (Ship blueprints L)
Ship blueprint for a Cobra Mk III
SHIP_COBRA_MK_3 (Ship blueprints N)
Ship blueprint for a Cobra Mk III
SHIP_COBRA_MK_3 (Ship blueprints O)
Ship blueprint for a Cobra Mk III
SHIP_COBRA_MK_3 (Ship blueprints P)
Ship blueprint for a Cobra Mk III
SHIP_COBRA_MK_3_P (Ship blueprints A)
Ship blueprint for a Cobra Mk III (pirate)
SHIP_COBRA_MK_3_P (Ship blueprints H)
Ship blueprint for a Cobra Mk III (pirate)
SHIP_COBRA_MK_3_P (Ship blueprints I)
Ship blueprint for a Cobra Mk III (pirate)
SHIP_COBRA_MK_3_P (Ship blueprints J)
Ship blueprint for a Cobra Mk III (pirate)
SHIP_COBRA_MK_3_P (Ship blueprints M)
Ship blueprint for a Cobra Mk III (pirate)
SHIP_CONSTRICTOR (Docked)
Ship blueprint for a Constrictor
SHIP_CONSTRICTOR (Ship blueprints G)
Ship blueprint for a Constrictor
SHIP_CORIOLIS (Ship blueprints A)
Ship blueprint for a Coriolis space station
SHIP_CORIOLIS (Ship blueprints C)
Ship blueprint for a Coriolis space station
SHIP_CORIOLIS (Ship blueprints E)
Ship blueprint for a Coriolis space station
SHIP_CORIOLIS (Ship blueprints G)
Ship blueprint for a Coriolis space station
SHIP_CORIOLIS (Ship blueprints I)
Ship blueprint for a Coriolis space station
SHIP_CORIOLIS (Ship blueprints K)
Ship blueprint for a Coriolis space station
SHIP_CORIOLIS (Ship blueprints M)
Ship blueprint for a Coriolis space station
SHIP_CORIOLIS (Ship blueprints O)
Ship blueprint for a Coriolis space station
SHIP_DODO (Ship blueprints B)
Ship blueprint for a Dodecahedron ("Dodo") space station
SHIP_DODO (Ship blueprints D)
Ship blueprint for a Dodecahedron ("Dodo") space station
SHIP_DODO (Ship blueprints F)
Ship blueprint for a Dodecahedron ("Dodo") space station
SHIP_DODO (Ship blueprints H)
Ship blueprint for a Dodecahedron ("Dodo") space station
SHIP_DODO (Ship blueprints J)
Ship blueprint for a Dodecahedron ("Dodo") space station
SHIP_DODO (Ship blueprints L)
Ship blueprint for a Dodecahedron ("Dodo") space station
SHIP_DODO (Ship blueprints N)
Ship blueprint for a Dodecahedron ("Dodo") space station
SHIP_DODO (Ship blueprints P)
Ship blueprint for a Dodecahedron ("Dodo") space station
SHIP_ESCAPE_POD (Ship blueprints A)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints B)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints C)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints D)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints E)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints F)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints G)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints H)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints I)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints J)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints K)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints L)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints N)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints O)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints P)
Ship blueprint for an escape pod
SHIP_FER_DE_LANCE (Ship blueprints A)
Ship blueprint for a Fer-de-Lance
SHIP_FER_DE_LANCE (Ship blueprints L)
Ship blueprint for a Fer-de-Lance
SHIP_GECKO (Ship blueprints D)
Ship blueprint for a Gecko
SHIP_GECKO (Ship blueprints E)
Ship blueprint for a Gecko
SHIP_GECKO (Ship blueprints F)
Ship blueprint for a Gecko
SHIP_GECKO (Ship blueprints J)
Ship blueprint for a Gecko
SHIP_GECKO (Ship blueprints K)
Ship blueprint for a Gecko
SHIP_GECKO (Ship blueprints M)
Ship blueprint for a Gecko
SHIP_GECKO (Ship blueprints N)
Ship blueprint for a Gecko
SHIP_KRAIT (Docked)
Ship blueprint for a Krait
SHIP_KRAIT (Ship blueprints A)
Ship blueprint for a Krait
SHIP_KRAIT (Ship blueprints B)
Ship blueprint for a Krait
SHIP_KRAIT (Ship blueprints C)
Ship blueprint for a Krait
SHIP_KRAIT (Ship blueprints E)
Ship blueprint for a Krait
SHIP_KRAIT (Ship blueprints G)
Ship blueprint for a Krait
SHIP_KRAIT (Ship blueprints H)
Ship blueprint for a Krait
SHIP_KRAIT (Ship blueprints I)
Ship blueprint for a Krait
SHIP_KRAIT (Ship blueprints J)
Ship blueprint for a Krait
SHIP_KRAIT (Ship blueprints M)
Ship blueprint for a Krait
SHIP_KRAIT (Ship blueprints N)
Ship blueprint for a Krait
SHIP_KRAIT (Ship blueprints O)
Ship blueprint for a Krait
SHIP_KRAIT (Ship blueprints P)
Ship blueprint for a Krait
SHIP_MAMBA (Ship blueprints A)
Ship blueprint for a Mamba
SHIP_MAMBA (Ship blueprints B)
Ship blueprint for a Mamba
SHIP_MAMBA (Ship blueprints E)
Ship blueprint for a Mamba
SHIP_MAMBA (Ship blueprints G)
Ship blueprint for a Mamba
SHIP_MAMBA (Ship blueprints I)
Ship blueprint for a Mamba
SHIP_MAMBA (Ship blueprints J)
Ship blueprint for a Mamba
SHIP_MAMBA (Ship blueprints L)
Ship blueprint for a Mamba
SHIP_MAMBA (Ship blueprints M)
Ship blueprint for a Mamba
SHIP_MAMBA (Ship blueprints O)
Ship blueprint for a Mamba
SHIP_MISSILE (Missile ship blueprint)
Ship blueprint for a missile
SHIP_MORAY (Ship blueprints K)
Ship blueprint for a Moray
SHIP_PLATE (Ship blueprints A)
Ship blueprint for an alloy plate
SHIP_PLATE (Ship blueprints B)
Ship blueprint for an alloy plate
SHIP_PLATE (Ship blueprints E)
Ship blueprint for an alloy plate
SHIP_PLATE (Ship blueprints G)
Ship blueprint for an alloy plate
SHIP_PLATE (Ship blueprints I)
Ship blueprint for an alloy plate
SHIP_PLATE (Ship blueprints J)
Ship blueprint for an alloy plate
SHIP_PLATE (Ship blueprints O)
Ship blueprint for an alloy plate
SHIP_PLATE (Ship blueprints P)
Ship blueprint for an alloy plate
SHIP_PYTHON (Docked)
Ship blueprint for a Python
SHIP_PYTHON (Ship blueprints A)
Ship blueprint for a Python
SHIP_PYTHON (Ship blueprints H)
Ship blueprint for a Python
SHIP_PYTHON (Ship blueprints K)
Ship blueprint for a Python
SHIP_PYTHON_P (Ship blueprints I)
Ship blueprint for a Python (pirate)
SHIP_PYTHON_P (Ship blueprints O)
Ship blueprint for a Python (pirate)
SHIP_SHUTTLE (Docked)
Ship blueprint for a Shuttle
SHIP_SHUTTLE (Ship blueprints H)
Ship blueprint for a Shuttle
SHIP_SIDEWINDER (Ship blueprints A)
Ship blueprint for a Sidewinder
SHIP_SIDEWINDER (Ship blueprints C)
Ship blueprint for a Sidewinder
SHIP_SIDEWINDER (Ship blueprints D)
Ship blueprint for a Sidewinder
SHIP_SIDEWINDER (Ship blueprints E)
Ship blueprint for a Sidewinder
SHIP_SIDEWINDER (Ship blueprints F)
Ship blueprint for a Sidewinder
SHIP_SIDEWINDER (Ship blueprints H)
Ship blueprint for a Sidewinder
SHIP_SIDEWINDER (Ship blueprints I)
Ship blueprint for a Sidewinder
SHIP_SIDEWINDER (Ship blueprints J)
Ship blueprint for a Sidewinder
SHIP_SIDEWINDER (Ship blueprints K)
Ship blueprint for a Sidewinder
SHIP_SIDEWINDER (Ship blueprints L)
Ship blueprint for a Sidewinder
SHIP_SIDEWINDER (Ship blueprints M)
Ship blueprint for a Sidewinder
SHIP_SIDEWINDER (Ship blueprints N)
Ship blueprint for a Sidewinder
SHIP_SIDEWINDER (Ship blueprints P)
Ship blueprint for a Sidewinder
SHIP_SPLINTER (Ship blueprints C)
Ship blueprint for a splinter
SHIP_SPLINTER (Ship blueprints D)
Ship blueprint for a splinter
SHIP_SPLINTER (Ship blueprints H)
Ship blueprint for a splinter
SHIP_SPLINTER (Ship blueprints K)
Ship blueprint for a splinter
SHIP_SPLINTER (Ship blueprints N)
Ship blueprint for a splinter
SHIP_SPLINTER (Ship blueprints O)
Ship blueprint for a splinter
SHIP_SPLINTER (Ship blueprints P)
Ship blueprint for a splinter
SHIP_THARGOID (Ship blueprints C)
Ship blueprint for a Thargoid mothership
SHIP_THARGOID (Ship blueprints D)
Ship blueprint for a Thargoid mothership
SHIP_THARGON (Ship blueprints C)
Ship blueprint for a Thargon
SHIP_THARGON (Ship blueprints D)
Ship blueprint for a Thargon
SHIP_TRANSPORTER (Docked)
Ship blueprint for a Transporter
SHIP_TRANSPORTER (Ship blueprints F)
Ship blueprint for a Transporter
SHIP_VIPER (Docked)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints A)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints B)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints C)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints D)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints E)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints F)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints G)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints H)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints I)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints J)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints K)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints L)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints M)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints N)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints O)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints P)
Ship blueprint for a Viper
SHIP_WORM (Ship blueprints B)
Ship blueprint for a Worm
SHIP_WORM (Ship blueprints L)
Ship blueprint for a Worm
XX21 (Docked)
Ship blueprints lookup table for the ship hangar
XX21 (Ship blueprints A)
Ship blueprints lookup table for the D.MOA file
XX21 (Ship blueprints B)
Ship blueprints lookup table for the D.MOB file
XX21 (Ship blueprints C)
Ship blueprints lookup table for the D.MOC file
XX21 (Ship blueprints D)
Ship blueprints lookup table for the D.MOD file
XX21 (Ship blueprints E)
Ship blueprints lookup table for the D.MOE file
XX21 (Ship blueprints F)
Ship blueprints lookup table for the D.MOF file
XX21 (Ship blueprints G)
Ship blueprints lookup table for the D.MOG file
XX21 (Ship blueprints H)
Ship blueprints lookup table for the D.MOH file
XX21 (Ship blueprints I)
Ship blueprints lookup table for the D.MOI file
XX21 (Ship blueprints J)
Ship blueprints lookup table for the D.MOJ file
XX21 (Ship blueprints K)
Ship blueprints lookup table for the D.MOK file
XX21 (Ship blueprints L)
Ship blueprints lookup table for the D.MOL file
XX21 (Ship blueprints M)
Ship blueprints lookup table for the D.MOM file
XX21 (Ship blueprints N)
Ship blueprints lookup table for the D.MON file
XX21 (Ship blueprints O)
Ship blueprints lookup table for the D.MOO file
XX21 (Ship blueprints P)
Ship blueprints lookup table for the D.MOP file
Macros
EDGE (Docked)
Macro definition for adding edges to ship blueprints
EDGE (Missile ship blueprint)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints A)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints B)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints C)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints D)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints E)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints F)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints G)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints H)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints I)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints J)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints K)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints L)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints M)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints N)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints O)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints P)
Macro definition for adding edges to ship blueprints
FACE (Docked)
Macro definition for adding faces to ship blueprints
FACE (Missile ship blueprint)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints A)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints B)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints C)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints D)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints E)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints F)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints G)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints H)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints I)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints J)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints K)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints L)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints M)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints N)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints O)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints P)
Macro definition for adding faces to ship blueprints
VERTEX (Docked)
Macro definition for adding vertices to ship blueprints
VERTEX (Missile ship blueprint)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints A)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints B)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints C)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints D)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints E)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints F)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints G)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints H)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints I)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints J)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints K)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints L)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints M)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints N)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints O)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints P)
Macro definition for adding vertices to ship blueprints
Drawing suns
The epic, shimmering Elite sun
Subroutines
FLFLLS (Docked)
Reset the sun line heap
FLFLLS (Flight)
Reset the sun line heap
SUN (Part 1 of 4) (Docked)
Draw the sun: Set up all the variables needed to draw the sun
SUN (Part 1 of 4) (Flight)
Draw the sun: Set up all the variables needed to draw the sun
SUN (Part 2 of 4) (Docked)
Draw the sun: Start from the bottom of the screen and erase the old sun line by line
SUN (Part 2 of 4) (Flight)
Draw the sun: Start from the bottom of the screen and erase the old sun line by line
SUN (Part 3 of 4) (Docked)
Draw the sun: Continue to move up the screen, drawing the new sun line by line
SUN (Part 3 of 4) (Flight)
Draw the sun: Continue to move up the screen, drawing the new sun line by line
SUN (Part 4 of 4) (Docked)
Draw the sun: Continue to the top of the screen, erasing the old sun line by line
SUN (Part 4 of 4) (Flight)
Draw the sun: Continue to the top of the screen, erasing the old sun line by line
WPLS (Docked)
Remove the sun from the screen
WPLS (Flight)
Remove the sun from the screen
Drawing the screen
The split-screen mode and different screen views
Subroutines
CLYNS (Docked)
Clear the bottom three text rows of the mode 4 screen
CLYNS (Flight)
Clear the bottom three text rows of the mode 4 screen
DET1 (Docked)
Show or hide the dashboard (for when we die)
DET1 (Flight)
Show or hide the dashboard (for when we die)
IRQ1 (Loader 3) *
The main screen-mode interrupt handler (IRQ1V points here)
LYN (Docked)
Clear most of a row of pixels
LYN (Flight)
Clear most of a row of pixels
TT66 (Docked)
Clear the screen and set the current view type
TT66 (Flight)
Clear the screen and set the current view type
TTX66 (Docked)
Clear the top part of the screen and draw a white border
TTX66 (Flight)
Clear the top part of the screen and draw a white border
WSCAN (Docked)
Wait for the vertical sync
WSCAN (Flight)
Wait for the vertical sync
Variables
B% (Loader 1)
VDU commands for switching to a mode 7 screen
B% (Loader 3)
VDU commands for setting the square mode 4 screen
TVT1 (Loader 3)
Palette data for space and the two dashboard colour schemes
VEC (Missile ship blueprint)
The original value of the IRQ1 vector
Equipment
Buying and selling weapons and ship upgrades
Subroutines
eq (Docked)
Subtract the price of equipment from the cash pot
EQSHP (Docked) *
Show the Equip Ship screen (red key f3)
prx (Docked)
Return the price of a piece of equipment
qv (Docked)
Print a menu of the four space views, for buying lasers
refund (Docked)
Install a new laser, processing a refund if applicable
Variables
PRXS (Docked)
Equipment prices
Flight
Docking, hyperspace, views, shields and more
Subroutines
DCS1 (Flight)
Calculate the vector from the ideal docking position to the ship
DENGY (Docked)
Drain some energy from the energy banks
DENGY (Flight)
Drain some energy from the energy banks
DOCKIT (Flight)
Apply docking manoeuvres to the ship in INWK
DOENTRY (Docked)
Dock at the space station, show the ship hangar and work out any mission progression
ee3 (Docked)
Print the hyperspace countdown in the top-left of the screen
ee3 (Flight)
Print the hyperspace countdown in the top-left of the screen
ESCAPE (Flight)
Launch our escape pod
Ghy (Docked)
Perform a galactic hyperspace jump
Ghy (Flight)
Perform a galactic hyperspace jump
hyp (Docked)
Start the hyperspace process
hyp (Flight)
Start the hyperspace process
LOOK1 (Flight)
Initialise the space view
me1 (Docked)
Erase an old in-flight message and display a new one
me1 (Flight)
Erase an old in-flight message and display a new one
me2 (Docked)
Remove an in-flight message from the space view
me2 (Flight)
Remove an in-flight message from the space view
mes9 (Docked)
Print a text token, possibly followed by " DESTROYED"
mes9 (Flight)
Print a text token, possibly followed by " DESTROYED"
MESS (Docked)
Display an in-flight message
MESS (Flight)
Display an in-flight message
MJP (Flight)
Process a mis-jump into witchspace
OOPS (Flight)
Take some damage
ou2 (Flight)
Display "E.C.M.SYSTEM DESTROYED" as an in-flight message
ou3 (Flight)
Display "FUEL SCOOPS DESTROYED" as an in-flight message
OUCH (Flight)
Potentially lose cargo or equipment following damage
PU1 (Flight)
Flip the coordinate axes for the four different views
SESCP (Flight)
Spawn an escape pod from the current (parent) ship
SHD (Docked)
Charge a shield and drain some energy from the energy banks
SHD (Flight)
Charge a shield and drain some energy from the energy banks
SIGHT (Docked)
Draw the laser crosshairs
SIGHT (Flight)
Draw the laser crosshairs
TT110 (Docked)
Launch from a station or show the front space view
TT110 (Flight)
Launch from a station or show the front space view
TT147 (Docked)
Print an error when a system is out of hyperspace range
TT147 (Flight)
Print an error when a system is out of hyperspace range
TT18 (Flight)
Try to initiate a jump into hyperspace
TTX110 (Docked)
Set the current system to the nearest system and return to hyp
TTX110 (Flight)
Set the current system to the nearest system and return to hyp
WARP (Flight) *
Perform an in-system jump
wW (Docked)
Start a hyperspace countdown
wW (Flight)
Start a hyperspace countdown
Keyboard
Processing key presses and joysticks
Subroutines
CTRL (Docked)
Scan the keyboard to see if CTRL is currently pressed
CTRL (Flight)
Scan the keyboard to see if CTRL is currently pressed
DK4 (Docked)
Scan for pause, configuration and secondary flight keys
DK4 (Flight)
Scan for pause, configuration and secondary flight keys
DKJ1 (Docked)
Read joystick and flight controls
DKJ1 (Flight)
Read joystick and flight controls
DKS1 (Flight)
Scan the keyboard for a flight key
DKS2 (Docked)
Read the joystick position
DKS2 (Flight)
Read the joystick position
DKS3 (Docked)
Toggle a configuration setting and emit a beep
DKS3 (Flight)
Toggle a configuration setting and emit a beep
DKS4 (Docked)
Scan the keyboard to see if a specific key is being pressed
DKS4 (Flight)
Scan the keyboard to see if a specific key is being pressed
DOKEY (Docked) *
Scan for the joystick
DOKEY (Flight) *
Scan for the seven primary flight controls and apply the docking computer manoeuvring code
FLKB (Docked)
Flush the keyboard buffer
FLKB (Flight)
Flush the keyboard buffer
PAUSE2 (Docked)
Wait until a key is pressed, ignoring any existing key press
RDKEY (Docked)
Scan the keyboard for key presses
RDKEY (Flight)
Scan the keyboard for key presses
TT102 (Docked) *
Process function key, save key, hyperspace and chart key presses
TT102 (Flight) *
Process function key, save key, hyperspace and chart key presses and update the hyperspace counter
TT17 (Docked)
Scan the keyboard for cursor key or joystick movement
TT17 (Flight)
Scan the keyboard for cursor key or joystick movement
TT214 (Docked)
Ask a question with a "Y/N?" prompt and return the response
TT217 (Docked)
Scan the keyboard until a key is pressed
U% (Flight)
Clear the key logger
Variables
KYTB (Flight)
Lookup table for in-flight keyboard controls
Loader
The loading screen and system setup
Subroutines
BEGIN (Docked)
Initialise the configuration variables and start the game
BRBR1 (Loader 3)
Loader break handler: print a newline and the error message, and then hang the computer
DEEOR (Docked)
Decrypt the main docked code between &1300 and &5FFF and the main game loop
DEEOR (Flight)
Decrypt the main flight code between &1300 and &55FF and jump into the main game loop
DOBEGIN (Docked)
Decrypt the main docked code, initialise the configuration variables and start the game
DOENTRY (Flight)
Load and run the docked code
Elite loader (Loader 1)
Reset vectors, change to mode 7, and load and run the ELITE3 loader
Elite loader (Part 1 of 2) (Loader 2)
Various copy protection checks, and make sure there is no Tube
Elite loader (Part 1 of 3) (Loader 3)
Set up the split screen mode, move code around, set up the sound envelopes and configure the system
Elite loader (Part 2 of 2) (Loader 2)
Load and run the ELITE4 loader
Elite loader (Part 2 of 3) (Loader 3)
Include binaries for recursive tokens, Missile blueprint and images
Elite loader (Part 3 of 3) (Loader 3)
Include binaries for the loading screen images
INBAY (Docked)
An unused routine that is never run
INBAY (Flight)
Load and run the main docked code in T.CODE
LOAD (Loader 3)
Load the main docked code, set up various vectors, run a checksum and start the game
LOADcode (Loader 3)
Encrypted LOAD routine, bundled up in the loader so it can be moved to &0B00 to be run
LOADSCR (Loader 2)
Show the mode 7 Acornsoft loading screen
LOGOS (Loader 2)
Print a large Acornsoft logo as part of the loading screen
LOMOD (Flight)
Load a new ship blueprints file
PROT1 (Loader 2)
Various copy protection shenanigans in preparation for showing the Acornsoft loading screen
prstr (Loader 2)
Print the NOP-terminated string immediately following the JSR instruction that called the routine
RSHIPS (Flight)
Launch from the station, load a new set of ship blueprints and jump into the main game loop
SCRAM (Docked)
Decrypt the main docked code, reset the flight variables and start the game
TVT1code (Loader 3)
Code block at &1100-&11E2 that remains resident in both docked and flight mode (palettes, screen mode routine and commander data)
Variables
ECHAR (Loader 2)
Character definitions for the Electron to mimic the graphics characters of the BBC Micro's mode 7 teletext screen
LOGO (Loader 2)
Tables containing the Acornsoft logo for the BBC Micro and Acorn Electron
LTLI (Flight)
The OS command string for loading the docked code in file T.CODE
MESS1 (Loader 1)
The OS command string for switching to the disc filing system
MESS1 (Loader 2)
The OS command string for loading the ELITE4 loader
MESS1 (Loader 3)
The OS command string for changing the disc directory to E
MESS2 (Loader 1)
The OS command string for loading the ELITE3 binary
RDLI (Docked)
The OS command string for running the flight code in file D.CODE
SHIPI (Flight)
The OS command string for loading a ship blueprints file
Main loop
The core loop that runs Elite
Subroutines
Main flight loop (Part 1 of 16) (Flight)
Seed the random number generator
Main flight loop (Part 2 of 16) (Flight)
Calculate the alpha and beta angles from the current pitch and roll of our ship
Main flight loop (Part 3 of 16) (Flight)
Scan for flight keys and process the results
Main flight loop (Part 4 of 16) (Flight)
For each nearby ship: Copy the ship's data block from K% to the zero-page workspace at INWK
Main flight loop (Part 5 of 16) (Flight)
For each nearby ship: If an energy bomb has been set off, potentially kill this ship
Main flight loop (Part 6 of 16) (Flight)
For each nearby ship: Move the ship in space and copy the updated INWK data block back to K%
Main flight loop (Part 7 of 16) (Flight)
For each nearby ship: Check whether we are docking, scooping or colliding with it
Main flight loop (Part 8 of 16) (Flight)
For each nearby ship: Process us potentially scooping this item
Main flight loop (Part 9 of 16) (Flight)
For each nearby ship: If it is a space station, check whether we are successfully docking with it
Main flight loop (Part 10 of 16) (Flight)
For each nearby ship: Remove if scooped, or process collisions
Main flight loop (Part 11 of 16) (Flight)
For each nearby ship: Process missile lock and firing our laser
Main flight loop (Part 12 of 16) (Flight)
For each nearby ship: Draw the ship, remove if killed, loop back
Main flight loop (Part 13 of 16) (Flight)
Show energy bomb effect, charge shields and energy banks
Main flight loop (Part 14 of 16) (Flight)
Spawn a space station if we are close enough to the planet
Main flight loop (Part 15 of 16) (Flight)
Perform altitude checks with the planet and sun and process fuel scooping if appropriate
Main flight loop (Part 16 of 16) (Flight)
Process laser pulsing, E.C.M. energy drain, call stardust routine
Main game loop (Part 1 of 6) (Flight)
Spawn a trader (a Cobra Mk III, Python, Boa or Anaconda)
Main game loop (Part 2 of 6) (Docked) *
Potentially spawn a trader, an asteroid, or a cargo canister (though this has no effect when docked)
Main game loop (Part 2 of 6) (Flight) *
Call the main flight loop, and potentially spawn a trader, an asteroid, or a cargo canister
Main game loop (Part 3 of 6) (Flight)
Potentially spawn a cop, particularly if we've been bad
Main game loop (Part 4 of 6) (Flight)
Potentially spawn a lone bounty hunter or up to four pirates
Main game loop (Part 5 of 6) (Docked)
Cool down lasers, make calls to update the dashboard
Main game loop (Part 5 of 6) (Flight)
Cool down lasers, make calls to update the dashboard
Main game loop (Part 6 of 6) (Docked)
Process non-flight key presses (red function keys, docked keys)
Main game loop (Part 6 of 6) (Flight)
Process non-flight key presses (red function keys, docked keys)
Market
Market prices, selling, buying and inventory
Subroutines
dn (Docked)
Print the amount of money we have left in the cash pot, then make a short, high beep and delay for 1 second
gnum (Docked)
Get a number from the keyboard
NWDAV4 (Docked)
Print an "ITEM?" error, make a beep and rejoin the TT210 routine
tnpr (Docked)
Work out if we have space for a specific amount of cargo
tnpr (Flight)
Work out if we have space for a specific amount of cargo
tnpr1 (Flight)
Work out if we have space for one tonne of cargo
TT151 (Docked)
Print the name, price and availability of a market item
TT151 (Flight)
Print the name, price and availability of a market item
TT152 (Docked)
Print the unit ("t", "kg" or "g") for a market item
TT152 (Flight)
Print the unit ("t", "kg" or "g") for a market item
TT160 (Docked)
Print "t" (for tonne) and a space
TT160 (Flight)
Print "t" (for tonne) and a space
TT161 (Docked)
Print "kg" (for kilograms)
TT161 (Flight)
Print "kg" (for kilograms)
TT163 (Docked)
Print the headers for the table of market prices
TT163 (Flight)
Print the headers for the table of market prices
TT167 (Docked) *
Show the Market Price screen (red key f7)
TT167 (Flight) *
Show the Market Price screen (red key f7)
TT16a (Docked)
Print "g" (for grams)
TT16a (Flight)
Print "g" (for grams)
TT208 (Docked) *
Show the Sell Cargo screen (red key f2)
TT210 (Docked)
Show a list of current cargo in our hold, optionally to sell
TT210 (Flight)
Show a list of current cargo in our hold, optionally to sell
TT213 (Docked) *
Show the Inventory screen (red key f9)
TT213 (Flight) *
Show the Inventory screen (red key f9)
TT219 (Docked) *
Show the Buy Cargo screen (red key f1)
var (Docked)
Calculate QQ19+3 = economy * |economic_factor|
var (Flight)
Calculate QQ19+3 = economy * |economic_factor|
Variables
QQ23 (Docked)
Market prices table
QQ23 (Flight)
Market prices table
Macros
ITEM (Docked)
Macro definition for the market prices table
ITEM (Flight)
Macro definition for the market prices table
Maths (Arithmetic)
Addition, subtraction, multiplication, division
Subroutines
ADD (Docked) *
Calculate (A X) = (A P) + (S R)
ADD (Flight) *
Calculate (A X) = (A P) + (S R)
DORND (Docked) *
Generate random numbers
DORND (Flight) *
Generate random numbers
DORND (Loader 3) *
Generate random numbers
DV41 (Docked)
Calculate (P R) = 256 * DELTA / A
DV41 (Flight)
Calculate (P R) = 256 * DELTA / A
DV42 (Docked)
Calculate (P R) = 256 * DELTA / z_hi
DV42 (Flight)
Calculate (P R) = 256 * DELTA / z_hi
DVID3B2 (Docked)
Calculate K(3 2 1 0) = (A P+1 P) / (z_sign z_hi z_lo)
DVID3B2 (Flight)
Calculate K(3 2 1 0) = (A P+1 P) / (z_sign z_hi z_lo)
DVID4 (Docked) *
Calculate (P R) = 256 * A / Q
DVID4 (Flight) *
Calculate (P R) = 256 * A / Q
DVIDT (Docked)
Calculate (P+1 A) = (A P) / Q
DVIDT (Flight)
Calculate (P+1 A) = (A P) / Q
FMLTU (Docked)
Calculate A = A * Q / 256
FMLTU (Flight)
Calculate A = A * Q / 256
FMLTU2 (Docked)
Calculate A = K * sin(A)
FMLTU2 (Flight)
Calculate A = K * sin(A)
GC2 (Docked)
Calculate (Y X) = (A P) * 4
GC2 (Flight)
Calculate (Y X) = (A P) * 4
GCASH (Docked)
Calculate (Y X) = P * Q * 4
GCASH (Flight)
Calculate (Y X) = P * Q * 4
LCASH (Docked)
Subtract an amount of cash from the cash pot
LL120 (Docked)
Calculate (Y X) = (S x1_lo) * XX12+2 or (S x1_lo) / XX12+2
LL120 (Flight)
Calculate (Y X) = (S x1_lo) * XX12+2 or (S x1_lo) / XX12+2
LL123 (Docked)
Calculate (Y X) = (S R) / XX12+2 or (S R) * XX12+2
LL123 (Flight)
Calculate (Y X) = (S R) / XX12+2 or (S R) * XX12+2
LL129 (Docked)
Calculate Q = XX12+2, A = S EOR XX12+3 and (S R) = |S R|
LL129 (Flight)
Calculate Q = XX12+2, A = S EOR XX12+3 and (S R) = |S R|
LL28 (Docked)
Calculate R = 256 * A / Q
LL28 (Flight)
Calculate R = 256 * A / Q
LL38 (Docked)
Calculate (S A) = (S R) + (A Q)
LL38 (Flight)
Calculate (S A) = (S R) + (A Q)
LL5 (Docked)
Calculate Q = SQRT(R Q)
LL5 (Flight)
Calculate Q = SQRT(R Q)
LL61 (Docked)
Calculate (U R) = 256 * A / Q
LL61 (Flight)
Calculate (U R) = 256 * A / Q
LL62 (Docked)
Calculate 128 - (U R)
LL62 (Flight)
Calculate 128 - (U R)
MAD (Docked)
Calculate (A X) = Q * A + (S R)
MAD (Flight)
Calculate (A X) = Q * A + (S R)
MAS3 (Flight)
Calculate A = x_hi^2 + y_hi^2 + z_hi^2 in the K% block
MCASH (Docked)
Add an amount of cash to the cash pot
MCASH (Flight)
Add an amount of cash to the cash pot
MLS1 (Flight)
Calculate (A P) = ALP1 * A
MLS2 (Docked)
Calculate (S R) = XX(1 0) and (A P) = A * ALP1
MLS2 (Flight)
Calculate (S R) = XX(1 0) and (A P) = A * ALP1
MLTU2 (Docked)
Calculate (A P+1 P) = (A ~P) * Q
MLTU2 (Flight)
Calculate (A P+1 P) = (A ~P) * Q
MLU1 (Docked)
Calculate Y1 = y_hi and (A P) = |y_hi| * Q for Y-th stardust
MLU1 (Flight)
Calculate Y1 = y_hi and (A P) = |y_hi| * Q for Y-th stardust
MLU2 (Docked)
Calculate (A P) = |A| * Q
MLU2 (Flight)
Calculate (A P) = |A| * Q
MU1 (Docked)
Copy X into P and A, and clear the C flag
MU1 (Flight)
Copy X into P and A, and clear the C flag
MU11 (Docked)
Calculate (A P) = P * X
MU11 (Flight)
Calculate (A P) = P * X
MU5 (Docked)
Set K(3 2 1 0) = (A A A A) and clear the C flag
MU5 (Flight)
Set K(3 2 1 0) = (A A A A) and clear the C flag
MU6 (Docked)
Set P(1 0) = (A A)
MU6 (Flight)
Set P(1 0) = (A A)
MULT1 (Docked)
Calculate (A P) = Q * A
MULT1 (Flight)
Calculate (A P) = Q * A
MULT12 (Docked)
Calculate (S R) = Q * A
MULT12 (Flight)
Calculate (S R) = Q * A
MULT3 (Flight)
Calculate K(3 2 1 0) = (A P+1 P) * Q
MULTU (Docked) *
Calculate (A P) = P * Q
MULTU (Flight) *
Calculate (A P) = P * Q
MUT1 (Docked)
Calculate R = XX and (A P) = Q * A
MUT1 (Flight)
Calculate R = XX and (A P) = Q * A
MUT2 (Docked)
Calculate (S R) = XX(1 0) and (A P) = Q * A
MUT2 (Flight)
Calculate (S R) = XX(1 0) and (A P) = Q * A
MUT3 (Docked)
An unused routine that does the same as MUT2
MUT3 (Flight)
An unused routine that does the same as MUT2
PIX1 (Docked)
Calculate (YY+1 SYL+Y) = (A P) + (S R) and draw stardust particle
PIX1 (Flight)
Calculate (YY+1 SYL+Y) = (A P) + (S R) and draw stardust particle
ROOT (Loader 3)
Calculate ZP = SQRT(ZP(1 0))
SPS2 (Flight)
Calculate (Y X) = A / 10
SQUA (Docked)
Clear bit 7 of A and calculate (A P) = A * A
SQUA (Flight)
Clear bit 7 of A and calculate (A P) = A * A
SQUA2 (Docked)
Calculate (A P) = A * A
SQUA2 (Flight)
Calculate (A P) = A * A
SQUA2 (Loader 3)
Calculate (A P) = A * A
TAS1 (Flight)
Calculate K3 = (x_sign x_hi x_lo) - V(1 0)
TIS1 (Docked)
Calculate (A ?) = (-X * A + (S R)) / 96
TIS1 (Flight)
Calculate (A ?) = (-X * A + (S R)) / 96
TIS2 (Docked)
Calculate A = A / Q
TIS2 (Flight)
Calculate A = A / Q
TIS3 (Docked)
Calculate -(nosev_1 * roofv_1 + nosev_2 * roofv_2) / nosev_3
TIS3 (Flight)
Calculate -(nosev_1 * roofv_1 + nosev_2 * roofv_2) / nosev_3
Unused duplicate of MULTU (Docked)
An unused duplicate of the MULTU routine
Unused duplicate of MULTU (Flight)
An unused duplicate of the MULTU routine
VCSU1 (Flight)
Calculate vector K3(8 0) = [x y z] - coordinates of the sun or space station
VCSUB (Flight)
Calculate vector K3(8 0) = [x y z] - coordinates in (A V)
Maths (Geometry)
Vectors, coordinates, dot products and matrices
Subroutines
ARCTAN (Flight)
Calculate A = arctan(P / Q)
FAROF (Flight)
Compare x_hi, y_hi and z_hi with 224
FAROF2 (Flight)
Compare x_hi, y_hi and z_hi with A
LL51 (Docked)
Calculate the dot product of XX15 and XX16
LL51 (Flight)
Calculate the dot product of XX15 and XX16
MAS1 (Flight)
Add an orientation vector coordinate to an INWK coordinate
MAS2 (Flight)
Calculate a cap on the maximum distance to the planet or sun
MAS4 (Flight)
Calculate a cap on the maximum distance to a ship
NORM (Docked) *
Normalise the three-coordinate vector in XX15
NORM (Flight) *
Normalise the three-coordinate vector in XX15
PROJ (Flight)
Project the current ship or planet onto the screen
SPS1 (Docked)
Calculate the vector to the planet and store it in XX15
SPS1 (Flight)
Calculate the vector to the planet and store it in XX15
SPS3 (Docked)
Copy a space coordinate from the K% block into K3
SPS3 (Flight)
Copy a space coordinate from the K% block into K3
SPS4 (Flight)
Calculate the vector to the space station
TAS2 (Docked)
Normalise the three-coordinate vector in K3
TAS2 (Flight)
Normalise the three-coordinate vector in K3
TAS3 (Docked)
Calculate the dot product of XX15 and an orientation vector
TAS3 (Flight)
Calculate the dot product of XX15 and an orientation vector
TAS4 (Flight)
Calculate the dot product of XX15 and one of the space station's orientation vectors
TAS6 (Flight)
Negate the vector in XX15 so it points in the opposite direction
TIDY (Docked) *
Orthonormalise the orientation vectors for a ship
TIDY (Flight) *
Orthonormalise the orientation vectors for a ship
Variables
ACT (Text tokens)
Arctan table
SNE (Text tokens)
Sine/cosine table
Missions
Hunting stolen ships and evading Thargoids
Subroutines
BRIEF (Docked)
Start mission 1 and show the mission briefing
BRIEF2 (Docked)
Start mission 2
BRIEF3 (Docked)
Receive the briefing and plans for mission 2
BRIS (Docked)
Clear the screen, display "INCOMING MESSAGE" and wait for 2 seconds
BRP (Docked)
Print an extended token and show the Status Mode screen
DEBRIEF (Docked)
Finish mission 1
DEBRIEF2 (Docked)
Finish mission 2
PAS1 (Docked)
Display a rotating ship at space coordinates (0, 112, 256) and scan the keyboard
PAUSE (Docked)
Display a rotating ship, waiting until a key is pressed, then remove the ship from the screen
THERE (Flight)
Check whether we are in the Constrictor's system in mission 1
Moving
Moving and rotating ships and planets in space
Subroutines
MV40 (Flight)
Rotate the planet or sun's location in space by the amount of pitch and roll of our ship
MVEIT (Part 1 of 9) (Docked)
Move current ship: Tidy the orientation vectors
MVEIT (Part 1 of 9) (Flight)
Move current ship: Tidy the orientation vectors
MVEIT (Part 2 of 9) (Flight)
Move current ship: Call tactics routine, remove ship from scanner
MVEIT (Part 3 of 9) (Flight)
Move current ship: Move ship forward according to its speed
MVEIT (Part 4 of 9) (Flight)
Move current ship: Apply acceleration to ship's speed as a one-off
MVEIT (Part 5 of 9) (Flight)
Move current ship: Rotate ship's location by our pitch and roll
MVEIT (Part 6 of 9) (Flight)
Move current ship: Move the ship in space according to our speed
MVEIT (Part 7 of 9) (Docked)
Move current ship: Rotate ship's orientation vectors by pitch/roll
MVEIT (Part 7 of 9) (Flight)
Move current ship: Rotate ship's orientation vectors by pitch/roll
MVEIT (Part 8 of 9) (Docked)
Move current ship: Rotate ship about itself by its own pitch/roll
MVEIT (Part 8 of 9) (Flight)
Move current ship: Rotate ship about itself by its own pitch/roll
MVEIT (Part 9 of 9) (Docked)
Move current ship: Redraw on scanner, if it hasn't been destroyed
MVEIT (Part 9 of 9) (Flight)
Move current ship: Redraw on scanner, if it hasn't been destroyed
MVS4 (Docked) *
Apply pitch and roll to an orientation vector
MVS4 (Flight) *
Apply pitch and roll to an orientation vector
MVS5 (Docked)
Apply a 3.6 degree pitch or roll to an orientation vector
MVS5 (Flight)
Apply a 3.6 degree pitch or roll to an orientation vector
MVT1 (Docked)
Calculate (x_sign x_hi x_lo) = (x_sign x_hi x_lo) + (A R)
MVT1 (Flight)
Calculate (x_sign x_hi x_lo) = (x_sign x_hi x_lo) + (A R)
MVT3 (Docked)
Calculate K(3 2 1) = (x_sign x_hi x_lo) + K(3 2 1)
MVT3 (Flight)
Calculate K(3 2 1) = (x_sign x_hi x_lo) + K(3 2 1)
MVT6 (Docked)
Calculate (A P+2 P+1) = (x_sign x_hi x_lo) + (A P+2 P+1)
MVT6 (Flight)
Calculate (A P+2 P+1) = (x_sign x_hi x_lo) + (A P+2 P+1)
SFS2 (Flight)
Move a ship in space along one of the coordinate axes
Save and load
Commander files and competition codes
Subroutines
BRKBK (Docked)
Set the standard BRKV handler for the game
CAT (Docked)
Catalogue a disc, wait for a key press and display the disc access menu
CATD (Loader 3)
Load disc sectors 0 and 1 to &0E00 and &0F00 respectively
CATDcode (Loader 3)
The CATD routine, bundled up in the loader so it can be moved to &0D7A to be run
CATS (Docked)
Ask for a disc drive number and print a catalogue of that drive
CHECK (Docked)
Calculate the checksum for the last saved commander data block
DELT (Docked)
Catalogue a disc, ask for a filename to delete, and delete the file
GTDRV (Docked)
Get an ASCII disc drive number from the keyboard
GTNMEW (Docked)
Fetch the name of a commander file to save or load
LOD (Docked) *
Load a commander file
MEBRK (Docked)
The BRKV handler for disc access operations
QUS1 (Docked)
Save or load the commander file
retry (Docked)
Scan the keyboard until a key is pressed and display the disc access menu
SVE (Docked) *
Save the commander file
TR1 (Docked)
Copy the last saved commander's name from NA% to INWK
TRNME (Docked)
Copy the last saved commander's name from INWK to NA%
Variables
CHK (Loader 3)
First checksum byte for the saved commander data file
CHK2 (Loader 3)
Second checksum byte for the saved commander data file
CTLI (Docked)
The OS command string for cataloguing a disc
DELI (Docked)
The OS command string for deleting a file
NA% (Loader 3)
The data block for the last saved commander
S1% (Loader 3)
The drive and directory number used when saving or loading a commander file
stack (Docked)
Temporary storage for the stack pointer when switching the BRKV handler between BRBR and MEBRK
Ship hangar
The ship hangar that's displayed on docking
Subroutines
HALL (Docked)
Draw the ships in the ship hangar, then draw the hangar
HANGER (Docked)
Display the ship hangar
HAS1 (Docked)
Draw a ship in the ship hangar
HAS2 (Docked)
Draw a hangar background line from left to right
HAS3 (Docked)
Draw a hangar background line from right to left
UNWISE (Docked)
Switch the main line-drawing routine between EOR and OR logic
Variables
HATB (Docked)
Ship hangar group table
Sound
Explosions, laser fire, hyperspace and more
Subroutines
BEEP (Docked)
Make a short, high beep
BEEP (Flight)
Make a short, high beep
BELL (Docked)
Make a standard system beep
BELL (Flight)
Make a standard system beep
ECMOF (Docked)
Switch off the E.C.M.
ECMOF (Flight)
Switch off the E.C.M.
EXNO (Docked)
Make the sound of a laser strike or ship explosion
EXNO (Flight)
Make the sound of a laser strike or ship explosion
EXNO3 (Docked)
Make an explosion sound
EXNO3 (Flight)
Make an explosion sound
NO3 (Docked)
Make a sound from a prepared sound block
NO3 (Flight)
Make a sound from a prepared sound block
NOISE (Docked) *
Make the sound whose number is in A
NOISE (Flight) *
Make the sound whose number is in A
NOS1 (Docked)
Prepare a sound block
NOS1 (Flight)
Prepare a sound block
Variables
E% (Loader 3)
Sound envelope definitions
SFX (Docked)
Sound data
SFX (Flight)
Sound data
Macros
FNE (Loader 3)
Macro definition for defining a sound envelope
Stardust
Stardust generation and movement
Subroutines
FLIP (Docked)
Reflect the stardust particles in the screen diagonal and redraw the stardust field
FLIP (Flight)
Reflect the stardust particles in the screen diagonal and redraw the stardust field
nWq (Flight)
Create a random cloud of stardust
NWSTARS (Flight)
Initialise the stardust field
STARS (Flight) *
The main routine for processing the stardust
STARS1 (Flight)
Process the stardust for the front view
STARS2 (Flight)
Process the stardust for the left or right view
STARS6 (Flight)
Process the stardust for the rear view
Start and end
The title screen... and the Game Over screen
Subroutines
BR1 (Part 1 of 2) (Docked)
Show the "Load New Commander (Y/N)?" screen and start the game
BR1 (Part 2 of 2) (Docked)
Show the "Press Fire or Space, Commander" screen and start the game
DEATH (Flight) *
Display the death screen
DEATH2 (Docked)
Reset most of the game and restart from the title screen
DEATH2 (Flight)
Reset most of the game and restart from the title screen
DFAULT (Docked)
Reset the current commander data block to the last saved commander
RES2 (Docked)
Reset a number of flight variables and workspaces
RES2 (Flight)
Reset a number of flight variables and workspaces
RESET (Docked)
Reset most variables
RESET (Flight)
Reset most variables
TITLE (Docked) *
Display a title screen with a rotating ship and prompt
TT170 (Docked) *
Main entry point for the Elite game code
Status
Showing the commander's status and rank
Subroutines
BAD (Docked)
Calculate how bad we have been
BAD (Flight)
Calculate how bad we have been
BAY (Docked)
Go to the docking bay (i.e. show the Status Mode screen)
cmn (Docked)
Print the commander's name
cmn (Flight)
Print the commander's name
csh (Docked)
Print the current amount of cash
csh (Flight)
Print the current amount of cash
EXNO2 (Docked)
Process us making a kill
EXNO2 (Flight)
Process us making a kill
fwl (Docked)
Print fuel and cash levels
fwl (Flight)
Print fuel and cash levels
STATUS (Docked) *
Show the Status Mode screen (red key f8)
STATUS (Flight) *
Show the Status Mode screen (red key f8)
Tactics
AI tactics for enemy ships and missiles
Subroutines
ANGRY (Flight)
Make a ship hostile
FR1 (Flight)
Display the "missile jammed" message
FRMIS (Flight)
Fire a missile from our ship
FRS1 (Flight)
Launch a ship straight ahead of us, below the laser sights
HITCH (Flight) *
Work out if the ship in INWK is in our crosshairs
SFRMIS (Flight)
Add an enemy missile to our local bubble of universe
TACTICS (Part 1 of 7) (Flight)
Apply tactics: Process missiles, both enemy missiles and our own
TACTICS (Part 2 of 7) (Flight) *
Apply tactics: Escape pod, station, lone Thargon, safe-zone pirate
TACTICS (Part 3 of 7) (Flight)
Apply tactics: Calculate dot product to determine ship's aim
TACTICS (Part 4 of 7) (Flight)
Apply tactics: Check energy levels, maybe launch escape pod if low
TACTICS (Part 5 of 7) (Flight)
Apply tactics: Consider whether to launch a missile at us
TACTICS (Part 6 of 7) (Flight)
Apply tactics: Consider firing a laser at us, if aim is true
TACTICS (Part 7 of 7) (Flight)
Apply tactics: Set pitch, roll, and acceleration
Text
The game's recursive text tokenisation system
Subroutines
BPRNT (Docked) *
Print a 32-bit number, left-padded to a specific number of digits, with an optional decimal point
BPRNT (Flight) *
Print a 32-bit number, left-padded to a specific number of digits, with an optional decimal point
CHPR (Docked)
Print a character at the text cursor by poking into screen memory
crlf (Docked)
Tab to column 21 and print a colon
crlf (Flight)
Tab to column 21 and print a colon
DETOK (Docked)
Print an extended recursive token from the TKN1 token table
DETOK2 (Docked)
Print an extended text token (1-255)
DETOK3 (Docked)
Print an extended recursive token from the RUTOK token table
dn2 (Docked)
Make a short, high beep and delay for 1 second
ex (Docked)
Print a recursive token
ex (Flight)
Print a recursive token
FEED (Docked)
Print a newline
MT1 (Docked)
Switch to ALL CAPS when printing extended tokens
MT13 (Docked)
Switch to lower case when printing extended tokens
MT14 (Docked)
Switch to justified text when printing extended tokens
MT15 (Docked)
Switch to left-aligned text when printing extended tokens
MT16 (Docked)
Print the character in variable DTW7
MT17 (Docked)
Print the selected system's adjective, e.g. Lavian for Lave
MT18 (Docked)
Print a random 1-8 letter word in Sentence Case
MT19 (Docked)
Capitalise the next letter
MT2 (Docked)
Switch to Sentence Case when printing extended tokens
MT23 (Docked)
Move to row 10, switch to white text, and switch to lower case when printing extended tokens
MT26 (Docked)
Fetch a line of text from the keyboard
MT27 (Docked)
Print the captain's name during mission briefings
MT28 (Docked)
Print the location hint during the mission 1 briefing
MT29 (Docked)
Move to row 6, switch to white text, and switch to lower case when printing extended tokens
MT5 (Docked)
Switch to extended tokens
MT6 (Docked)
Switch to standard tokens in Sentence Case
MT8 (Docked)
Tab to column 6 and start a new word when printing extended tokens
MT9 (Docked)
Clear the screen and set the current view type to 1
plf (Docked)
Print a text token followed by a newline
plf (Flight)
Print a text token followed by a newline
plf2 (Docked)
Print text followed by a newline and indent of 6 characters
plf2 (Flight)
Print text followed by a newline and indent of 6 characters
pr2 (Docked)
Print an 8-bit number, left-padded to 3 digits, and optional point
pr2 (Flight)
Print an 8-bit number, left-padded to 3 digits, and optional point
pr5 (Docked)
Print a 16-bit number, left-padded to 5 digits, and optional point
pr5 (Flight)
Print a 16-bit number, left-padded to 5 digits, and optional point
pr6 (Docked)
Print 16-bit number, left-padded to 5 digits, no point
pr6 (Flight)
Print 16-bit number, left-padded to 5 digits, no point
prq (Docked)
Print a text token followed by a question mark
prq (Flight)
Print a text token followed by a question mark
qw (Docked)
Print a recursive token in the range 128-145
qw (Flight)
Print a recursive token in the range 128-145
spc (Docked)
Print a text token followed by a space
spc (Flight)
Print a text token followed by a space
TT11 (Docked)
Print a 16-bit number, left-padded to n digits, and optional point
TT11 (Flight)
Print a 16-bit number, left-padded to n digits, and optional point
TT162 (Docked)
Print a space
TT162 (Flight)
Print a space
TT26 (Docked) *
Print a character at the text cursor, with support for verified text in extended tokens
TT26 (Flight) *
Print a character at the text cursor by poking into screen memory
TT27 (Docked) *
Print a text token
TT27 (Flight) *
Print a text token
TT41 (Docked)
Print a letter according to Sentence Case
TT41 (Flight)
Print a letter according to Sentence Case
TT42 (Docked)
Print a letter in lower case
TT42 (Flight)
Print a letter in lower case
TT43 (Docked)
Print a two-letter token or recursive token 0-95
TT43 (Flight)
Print a two-letter token or recursive token 0-95
TT45 (Docked)
Print a letter in lower case
TT45 (Flight)
Print a letter in lower case
TT46 (Docked)
Print a character and switch to capitals
TT46 (Flight)
Print a character and switch to capitals
TT60 (Docked)
Print a text token and a paragraph break
TT60 (Flight)
Print a text token and a paragraph break
TT67 (Docked)
Print a newline
TT67 (Flight)
Print a newline
TT68 (Docked)
Print a text token followed by a colon
TT68 (Flight)
Print a text token followed by a colon
TT69 (Docked)
Set Sentence Case and print a newline
TT69 (Flight)
Set Sentence Case and print a newline
TT73 (Docked)
Print a colon
TT73 (Flight)
Print a colon
TT74 (Docked)
Print a character
TT74 (Flight)
Print a character
TTX69 (Docked)
Print a paragraph break
TTX69 (Flight)
Print a paragraph break
VOWEL (Docked)
Test whether a character is a vowel
Variables
DTW1 (Docked)
A mask for applying the lower case part of Sentence Case to extended text tokens
DTW2 (Docked)
A flag that indicates whether we are currently printing a word
DTW3 (Docked)
A flag for switching between standard and extended text tokens
DTW4 (Docked)
Flags that govern how justified extended text tokens are printed
DTW5 (Docked)
The size of the justified text buffer at BUF
DTW6 (Docked)
A flag to denote whether printing in lower case is enabled for extended text tokens
DTW8 (Docked)
A mask for capitalising the next letter in an extended text token
JMTB (Docked)
The extended token table for jump tokens 1-32 (DETOK)
MTIN (Docked)
Lookup table for random tokens in the extended token table (0-37)
QQ16 (Docked)
The two-letter token lookup table
QQ18 (Text tokens)
The recursive token table for tokens 0-148
RLINE (Docked)
The OSWORD configuration block used to fetch a line of text from the keyboard
RUGAL (Docked)
The criteria for systems with extended description overrides
RUPLA (Docked)
System numbers that have extended description overrides
RUTOK (Docked)
The second extended token table for recursive tokens 0-26 (DETOK3)
TENS (Docked)
A constant used when printing large numbers in BPRNT
TENS (Flight)
A constant used when printing large numbers in BPRNT
TKN1 (Docked)
The first extended token table for recursive tokens 0-255 (DETOK)
TKN2 (Docked)
The extended two-letter token lookup table
Macros
CHAR (Text tokens)
Macro definition for characters in the recursive token table
CONT (Text tokens)
Macro definition for control codes in the recursive token table
ECHR (Docked)
Macro definition for characters in the extended token table
EJMP (Docked)
Macro definition for jump tokens in the extended token table
ERND (Docked)
Macro definition for random tokens in the extended token table
ETOK (Docked)
Macro definition for recursive tokens in the extended token table
ETWO (Docked)
Macro definition for two-letter tokens in the extended token table
RTOK (Text tokens)
Macro definition for recursive tokens in the recursive token table
TOKN (Docked)
Macro definition for standard tokens in the extended token table
TWOK (Text tokens)
Macro definition for two-letter tokens in the token table
Universe
Ship spawning, local bubble, system/market data
Subroutines
cpl (Docked)
Print the selected system name
cpl (Flight)
Print the selected system name
GINF (Docked)
Fetch the address of a ship's data block into INF
GINF (Flight)
Fetch the address of a ship's data block into INF
GTHG (Flight)
Spawn a Thargoid ship and a Thargon companion
GVL (Flight)
Calculate the availability of market items
hyp1 (Docked)
Process a jump to the system closest to (QQ9, QQ10)
hyp1 (Flight)
Process a jump to the system closest to (QQ9, QQ10)
jmp (Docked)
Set the current system to the selected system
jmp (Flight)
Set the current system to the selected system
KILLSHP (Flight) *
Remove a ship from our local bubble of universe
KS1 (Flight)
Remove the current ship from our local bubble of universe
KS2 (Flight)
Check the local bubble for missiles with target lock
KS3 (Flight)
Set the SLSP ship line heap pointer after shuffling ship slots
KS4 (Flight)
Remove the space station and replace it with the sun
NwS1 (Docked)
Flip the sign and double an INWK byte
NwS1 (Flight)
Flip the sign and double an INWK byte
NWSHP (Docked)
Add a new ship to our local bubble of universe
NWSHP (Flight)
Add a new ship to our local bubble of universe
NWSPS (Flight)
Add a new space station to our local bubble of universe
PDESC (Docked)
Print the system's extended description or a mission 1 directive
ping (Docked)
Set the selected system to the current system
ping (Flight)
Set the selected system to the current system
SFS1 (Flight) *
Spawn a child ship from the current (parent) ship
SOLAR (Flight)
Set up various aspects of arriving in a new system
SOS1 (Flight)
Update the missile indicators, set up the planet data block
SPIN (Flight)
Randomly spawn cargo from a destroyed ship
tal (Docked)
Print the current galaxy number
tal (Flight)
Print the current galaxy number
TT111 (Docked)
Set the current system to the nearest system to a point
TT111 (Flight)
Set the current system to the nearest system to a point
TT146 (Docked)
Print the distance to the selected system in light years
TT146 (Flight)
Print the distance to the selected system in light years
TT20 (Docked)
Twist the selected system's seeds four times
TT20 (Flight)
Twist the selected system's seeds four times
TT24 (Docked) *
Calculate system data from the system seeds
TT24 (Flight) *
Calculate system data from the system seeds
TT25 (Docked) *
Show the Data on System screen (red key f6)
TT25 (Flight) *
Show the Data on System screen (red key f6)
TT54 (Docked) *
Twist the selected system's seeds
TT54 (Flight) *
Twist the selected system's seeds
TT70 (Docked)
Display "MAINLY " and jump to TT72
TT70 (Flight)
Display "MAINLY " and jump to TT72
TT81 (Docked)
Set the selected system's seeds to those of system 0
TT81 (Flight)
Set the selected system's seeds to those of system 0
ypl (Docked)
Print the current system name
ypl (Flight)
Print the current system name
Ze (Docked)
Initialise the INWK workspace to a hostile ship
Ze (Flight)
Initialise the INWK workspace to a hostile ship
ZINF (Docked)
Reset the INWK workspace and orientation vectors
ZINF (Flight)
Reset the INWK workspace and orientation vectors
Variables
UNIV (Docked)
Table of pointers to the local universe's ship data blocks
UNIV (Flight)
Table of pointers to the local universe's ship data blocks
Utility routines
Memory/screen clearing, delay routines
Subroutines
BRBR (Docked)
The standard BRKV handler for the game
DELAY (Docked)
Wait for a specified time, in 1/50s of a second
DELAY (Flight)
Wait for a specified time, in 1/50s of a second
FX200 (Docked)
Set the behaviour of the ESCAPE and BREAK keys
GTNMES (Docked)
An unused routine that fetches the name of a commander file
MPL (Loader 2)
Move two pages of memory from LOADcode to LOAD and jump to ENTRY2
MVBL (Loader 3)
Decrypt and move a multi-page block of memory
MVPG (Loader 3)
Decrypt and move a page of memory
OSB (Loader 3)
A convenience routine for calling OSBYTE with Y = 0
ZEBC (Docked)
Zero-fill pages &B and &C
ZERO (Docked)
Reset the local bubble of universe and ship status
ZERO (Flight)
Reset the local bubble of universe and ship status
ZES1 (Docked)
Zero-fill the page whose number is in X
ZES1 (Flight)
Zero-fill the page whose number is in X
ZES2 (Docked)
Zero-fill a specific page
ZES2 (Flight)
Zero-fill a specific page
Variables
brkd (Docked)
The brkd counter for error handling
Unused block (Docked)
These bytes appear to be unused (the same block appears in both the flight and docked code)
Unused block (Flight)
These bytes appear to be unused (the same block appears in both the flight and docked code)
Workspaces
Collections of important variables into blocks
Workspaces
K% (Docked) *
Ship data blocks and ship line heaps
K% (Flight) *
Ship data blocks and ship line heaps
S% (Docked)
Entry points and vector addresses in the main docked code
S% (Flight)
Entry points and vector addresses in the main flight code
UP (Docked)
Ship slots, variables
UP (Flight)
Ship slots, variables
WP (Docked)
Variables
WP (Flight)
Variables
XX3 (Docked)
Temporary storage space for complex calculations
XX3 (Flight)
Temporary storage space for complex calculations
ZP (Docked) *
Lots of important variables are stored in the zero page workspace as it is quicker and more space-efficient to access memory here
ZP (Flight) *
Lots of important variables are stored in the zero page workspace as it is quicker and more space-efficient to access memory here
ZP (Loader 1) *
Important variables used by the loader
ZP (Loader 2) *
Important variables used by the loader
ZP (Loader 3) *
Important variables used by the loader
6502 Second Processor source code
The fastest and most colourful version of Elite
Version information
About the 6502 Second Processor version
Information on the fastest version of Elite
Different variants of the 6502 Second Processor version
Code variations found in 6502 Second Processor Elite
6502 Second Processor source code by file
Map of the source code
An overview of how the source code for Elite is structured
Annotated original source files
The source files in their original structure
Game loader
Loader 1 source
The Saturn loading screen, copy protection and set-up for the main game
Loader 2 source
The rest of the loading screen and main game loader
Main game
Workspaces and configuration
The main variable workspaces used in Elite
Text tokens
Elite's tokenised game text
Elite A source
Part 1 of the main game code
Elite B source
Part 2 of the main game code
Elite C source
Part 3 of the main game code
Elite D source
Part 4 of the main game code
Elite E source
Part 5 of the main game code
Elite F source
Part 6 of the main game code
Elite G source
Part 7 of the main game code
Elite H source
Part 8 of the main game code
Elite I source
Part 9 of the main game code
Elite J source
Part 10 of the main game code
Ship blueprints
Data for the 33 different ship designs
I/O processor source
I/O processor source
The I/O processor source
Big Code File
Big Code File source
Concatenates the individual source code parts into one big game file
6502 Second Processor source code by category
Charts
Long-range and short-range galactic charts
Subroutines
hm
Select the closest system and redraw the chart crosshairs
HME2
Search the galaxy for a system
TT103
Draw a small set of crosshairs on a chart
TT105
Draw crosshairs on the Short-range Chart, with clipping
TT114
Display either the Long-range or Short-range Chart
TT123
Move galactic coordinates by a signed delta
TT16
Move the crosshairs on a chart
TT22 *
Show the Long-range Chart (red key f4)
TT23 *
Show the Short-range Chart (red key f5)
Copy protection
Hiding the Elite code from prying eyes
Subroutines
Checksum
Checksum the code from &1000 to &9FFF and check against S%-1
DEEOR
Decrypt bytes between &1300 and &9FFF by EOR'ing them with their page offset
do65C02 (I/O processor)
Reverse the order of all bytes between the addresses in (1 0) and (3 2) and start the game
SOMEPROT (I/O processor)
Implement the OSWORD 249 command (some copy protection)
Variables
copyright (Loader 1)
A copyright notice, buried in the code
Firebird
The name "Firebird", buried in the code of the Executive version
Dashboard
The dials, 3D scanner and compass
Subroutines
ABORT
Disarm missiles and update the dashboard indicators
ABORT2
Set/unset the lock target for a missile and update the dashboard
ADPARAMS (I/O processor)
Implement the OSWRCH 137
command (add a dashboard parameter and update the dashboard when all are received)
BUMP2
Bump up the value of the pitch or roll dashboard indicator
cntr
Apply damping to the pitch or roll dashboard indicator
COMPAS *
Update the compass
DIALS *
Update the dashboard indicators and flight variables by sending a #RDPARAMS command to the I/O processor
DIALS (Part 1 of 4) (I/O processor)
Update the dashboard: speed indicator
DIALS (Part 2 of 4) (I/O processor)
Update the dashboard: pitch and roll indicators
DIALS (Part 3 of 4) (I/O processor)
Update the dashboard: four energy banks
DIALS (Part 4 of 4) (I/O processor)
Update the dashboard: shields, fuel, laser & cabin temp, altitude
DIL2 (I/O processor)
Update the roll or pitch indicator on the dashboard
DILX (I/O processor) *
Update a bar-based indicator on the dashboard
DOBULB (I/O processor)
Implement the #DOBULB 0 command (draw the space station indicator bulb)
DOT (I/O processor)
Implement the #DOdot command (draw a dash on the compass)
ECBLB
Light up the E.C.M. indicator bulb ("E") on the dashboard by sending a #DOBULB 255 command to the I/O processor
ECBLB (I/O processor)
Implement the #DOBULB 255 command (draw the E.C.M. indicator bulb)
ECBLB2
Start up the E.C.M. (light up the indicator, start the countdown and make the E.C.M. sound)
MSBAR
Draw a specific indicator in the dashboard's missile bar by sending a #DOmsbar command to the I/O processor
MSBAR (I/O processor)
Implement the #DOmsbar command (draw a specific indicator in the dashboard's missile bar)
msblob
Display the dashboard's missile indicators in green
PZW (I/O processor)
Fetch the current dashboard colours, to support flashing
PZW2 (I/O processor)
Fetch the current dashboard colours for non-striped indicators, to support flashing
RDPARAMS (I/O processor)
Implement the #RDPARAMS command (start receiving a new set of parameters for updating the dashboard)
REDU2
Reduce the value of the pitch or roll dashboard indicator
SC48 (I/O processor)
Implement the #onescan command (draw a ship on the 3D scanner)
SCAN *
Display the current ship on the scanner
SP1
Draw the space station on the compass
SP2
Draw a dot on the compass, given the planet/station vector
SPBLB
Light up the space station indicator ("S") on the dashboard by sending a #DOBULB 0 command to the I/O processor
WPSHPS
Clear the scanner, reset the ball line and sun line heaps
Variables
ECBT (I/O processor)
The character bitmap for the E.C.M. indicator bulb
SCANpars
The scanner buffer to send with the #onescan command
SPBT (I/O processor)
The bitmap definition for the space station indicator bulb
Demo
Star Wars scroll texts and a huge Elite logo
Subroutines
DEMON
Show the demo
GRIDSET
Populate the line coordinate tables with the lines for the scroll text
GRS1
Populate the line coordinate tables with the lines for a single scroll text character
SLIDE
Display a Star Wars scroll text
TWIST
Pitch the current ship by a small angle in a positive direction
ZZAAP
Draw a vertical red laser line from (128, 67) to (128, 160)
Variables
acorn
The text for the demo's opening scroll text
byian
The text for the demo's middle scroll text
executive
Extra text for the demo in the Executive version
HIMCNT
Used as a loop counter for the Cobra's slow approach in the demo
LTDEF
Line definitions for characters in the Star Wars scroll text
NOFX
The x-coordinates of the scroll text letter grid
NOFY
The y-coordinates of the scroll text letter grid
true3
The text for the demo's final scroll text
Drawing circles
Hyperspace tunnels, launch rings and planets
Subroutines
BLINE *
Draw a circle segment and add it to the ball line heap
CHKON
Check whether any part of a circle appears on the extended screen
CIRCLE
Draw a circle for the planet
CIRCLE2 *
Draw a circle (for the planet or chart)
DOHFX (I/O processor)
Implement the #DOHFX
command (update the hyperspace effect flag)
HFS2 *
Draw the launch or hyperspace tunnel
LAUN
Make the launch sound and draw the launch tunnel
LL164
Make the hyperspace sound and draw the hyperspace tunnel
LS2FL
Draw the contents of the ball line heap by sending an OSWRCH 129 command to the I/O processor
TT128 *
Draw a circle on a chart
TT14
Draw a circle with crosshairs on a chart
Drawing lines
The core line-drawing routines
Subroutines
ADDBYT (I/O processor)
Implement the OSWRCH 130
command (add a byte to a line and draw it when all bytes are received)
BEGINLIN (I/O processor)
Implement the OSWRCH 129
command (start receiving a new line to draw)
EDGES
Draw a horizontal line given a centre and a half-width
HBFL
Draw the sun lines in the horizontal line buffer in orange by sending an OSWORD 247 command to the I/O processor
HBZE
Reset the horizontal line buffer
HLOIN *
Add a sun line to the horizontal line buffer
HLOIN (I/O processor) *
Implement the OSWORD 247 command (draw the sun lines in the horizontal line buffer in orange)
HLOIN2
Remove a line from the sun line heap and draw it on-screen
HLOIN2 (I/O processor)
Draw a horizontal line in a specific colour
LASLI
Draw the laser lines for when we fire our lasers
LBFL
Draw the lines in the multi-segment line buffer by sending an OSWRCH 129 command to the I/O processor
LL118
Move a point along a line until it is on-screen
LL145 (Part 1 of 4) *
Clip line: Work out which end-points are on-screen, if any
LL145 (Part 2 of 4)
Clip line: Work out if any part of the line is on-screen
LL145 (Part 3 of 4)
Clip line: Calculate the line's gradient
LL145 (Part 4 of 4)
Clip line: Call the routine in LL188 to do the actual clipping
LL30
Draw a one-segment line by sending an OSWRCH 129 command to the I/O processor
LOIN
Add a line segment to the multi-segment line buffer
LOIN (Part 1 of 7) (I/O processor) *
Draw a line: Calculate the line gradient in the form of deltas
LOIN (Part 2 of 7) (I/O processor)
Draw a line: Line has a shallow gradient, step right along x-axis
LOIN (Part 3 of 7) (I/O processor)
Draw a shallow line going right and up or left and down
LOIN (Part 4 of 7) (I/O processor)
Draw a shallow line going right and down or left and up
LOIN (Part 5 of 7) (I/O processor)
Draw a line: Line has a steep gradient, step up along y-axis
LOIN (Part 6 of 7) (I/O processor)
Draw a steep line going up and left or down and right
LOIN (Part 7 of 7) (I/O processor)
Draw a steep line going up and right or down and left
NLIN
Draw a horizontal line at pixel row 23 to box in a title
NLIN2
Draw a screen-wide horizontal line at the pixel row in A
NLIN3
Print a title and draw a horizontal line at row 19 to box it in
NLIN4
Draw a horizontal line at pixel row 19 to box in a title
TT15
Draw a set of crosshairs
Variables
HBUF
The horizontal line buffer to send with the OSWORD 247 command
LBUF
The multi-segment line buffer used by LOIN
LSX2
The ball line heap for storing x-coordinates
LSY2
The ball line heap for storing y-coordinates
TABLE (I/O processor)
The line buffer for line data transmitted from the parasite
TWFL
Ready-made character rows for the left end of a horizontal line in mode 4
TWFR
Ready-made character rows for the right end of a horizontal line in mode 4
Drawing pixels
How to plot pixels in various colours
Subroutines
CPIX2 (I/O processor) *
Draw a single-height dash on the dashboard
CPIX4 (I/O processor)
Draw a double-height dot on the dashboard
DOT
Draw a dash on the compass by sending a #DOdot command to the I/O processor
PBFL
Draw the pixel in the pixel buffer by sending an OSWORD 241 command to the I/O processor
PBZE
Reset the pixel buffer
PIX (Loader 1)
Draw a single pixel at a specific coordinate
PIXEL *
Add a white dot at a specific distance to the pixel buffer (2-pixel dash or 4-pixel square)
PIXEL (I/O processor) *
Implement the OSWORD 241 command (draw space view pixels)
PIXEL2
Draw a stardust particle relative to the screen centre
PIXEL3
Add a coloured dot at a specific distance to the pixel buffer (1-pixel dot, 2-pixel dash or 4-pixel square)
Variables
CTWOS
Ready-made single-pixel character row bytes for mode 5
CTWOS (I/O processor)
Ready-made single-pixel character row bytes for mode 2
orange (I/O processor)
Lookup table for 2-pixel mode 1 orange pixels for the sun
PBUF
The pixel buffer to send with the OSWORD 241 command
PXCL (I/O processor)
A four-colour mode 1 pixel byte that represents a dot's distance
TWFL (I/O processor)
Ready-made character rows for the left end of a horizontal line
TWFR (I/O processor)
Ready-made character rows for the right end of a horizontal line
TWOS
Ready-made single-pixel character row bytes for mode 4
TWOS (I/O processor)
Ready-made single-pixel character row bytes for mode 1
TWOS (Loader 1)
Ready-made single-pixel character row bytes for mode 1
TWOS2
Ready-made double-pixel character row bytes for mode 4
TWOS2 (I/O processor)
Ready-made double-pixel character row bytes for mode 1
ylookup (I/O processor)
Lookup table for converting pixel y-coordinate to page number of screen address
Drawing planets
Planets with meridians and craters
Subroutines
PL2
Remove the planet or sun from the screen
PL21
Return from a planet/sun-drawing routine with a failure flag
PL9 (Part 1 of 3) *
Draw the planet, with either an equator and meridian, or a crater
PL9 (Part 2 of 3)
Draw the planet's equator and meridian
PL9 (Part 3 of 3)
Draw the planet's crater
PLANET
Draw the planet or sun
PLL1 (Part 1 of 3) (Loader 1)
Draw Saturn on the loading screen (draw the planet)
PLL1 (Part 2 of 3) (Loader 1)
Draw Saturn on the loading screen (draw the stars)
PLL1 (Part 3 of 3) (Loader 1)
Draw Saturn on the loading screen (draw the rings)
PLS1
Calculate (Y A) = nosev_x / z
PLS2
Draw a half-ellipse
PLS22 *
Draw an ellipse or half-ellipse
PLS3
Calculate (Y A P) = 222 * roofv_x / z
PLS4
Calculate CNT2 = arctan(P / A) / 4
PLS5
Calculate roofv_x / z and roofv_y / z
PLS6
Calculate (X K) = (A P) / (z_sign z_hi z_lo)
Variables
CNT (Loader 1)
A counter for use in drawing Saturn's planetary body
CNT2 (Loader 1)
A counter for use in drawing Saturn's background stars
CNT3 (Loader 1)
A counter for use in drawing Saturn's rings
RAND (Loader 1)
The random number seed used for drawing Saturn
Drawing ships
The celebrated 3D ship plotting process
Subroutines
DOEXP *
Draw an exploding ship
LL9 (Part 1 of 12)
Draw ship: Check if ship is exploding, check if ship is in front
LL9 (Part 2 of 12)
Draw ship: Check if ship is in field of view, close enough to draw
LL9 (Part 3 of 12)
Draw ship: Set up orientation vector, ship coordinate variables
LL9 (Part 4 of 12)
Draw ship: Set visibility for exploding ship (all faces visible)
LL9 (Part 5 of 12)
Draw ship: Calculate the visibility of each of the ship's faces
LL9 (Part 6 of 12)
Draw ship: Calculate the visibility of each of the ship's vertices
LL9 (Part 7 of 12)
Draw ship: Calculate the visibility of each of the ship's vertices
LL9 (Part 8 of 12)
Draw ship: Calculate the screen coordinates of visible vertices
LL9 (Part 9 of 12)
Draw ship: Draw laser beams if the ship is firing its laser at us
LL9 (Part 10 of 12)
Draw ship: Calculate the visibility of each of the ship's edges
LL9 (Part 11 of 12)
Draw ship: Add all visible edges to the ship line heap
LL9 (Part 12 of 12)
Draw ship: Draw all the visible edges from the ship line heap
SHPPT
Draw a distant ship as a point rather than a full wireframe
Variables
E%
Ship blueprints default NEWB flags
scacol
Ship colours on the scanner
SHIP_ADDER
Ship blueprint for an Adder
SHIP_ANACONDA
Ship blueprint for an Anaconda
SHIP_ASP_MK_2
Ship blueprint for an Asp Mk II
SHIP_ASTEROID
Ship blueprint for an asteroid
SHIP_BOA
Ship blueprint for a Boa
SHIP_BOULDER
Ship blueprint for a boulder
SHIP_CANISTER
Ship blueprint for a cargo canister
SHIP_COBRA_MK_1
Ship blueprint for a Cobra Mk I
SHIP_COBRA_MK_3
Ship blueprint for a Cobra Mk III
SHIP_COBRA_MK_3_P
Ship blueprint for a Cobra Mk III (pirate)
SHIP_CONSTRICTOR
Ship blueprint for a Constrictor
SHIP_CORIOLIS
Ship blueprint for a Coriolis space station
SHIP_COUGAR
Ship blueprint for a Cougar
SHIP_DODO
Ship blueprint for a Dodecahedron ("Dodo") space station
SHIP_ESCAPE_POD
Ship blueprint for an escape pod
SHIP_FER_DE_LANCE
Ship blueprint for a Fer-de-Lance
SHIP_GECKO
Ship blueprint for a Gecko
SHIP_KRAIT
Ship blueprint for a Krait
SHIP_LOGO
Ship blueprint for the Elite logo
SHIP_MAMBA
Ship blueprint for a Mamba
SHIP_MISSILE
Ship blueprint for a missile
SHIP_MORAY
Ship blueprint for a Moray
SHIP_PLATE
Ship blueprint for an alloy plate
SHIP_PYTHON
Ship blueprint for a Python
SHIP_PYTHON_P
Ship blueprint for a Python (pirate)
SHIP_ROCK_HERMIT
Ship blueprint for a rock hermit (asteroid)
SHIP_SHUTTLE
Ship blueprint for a Shuttle
SHIP_SIDEWINDER
Ship blueprint for a Sidewinder
SHIP_SPLINTER
Ship blueprint for a splinter
SHIP_THARGOID
Ship blueprint for a Thargoid mothership
SHIP_THARGON
Ship blueprint for a Thargon
SHIP_TRANSPORTER
Ship blueprint for a Transporter
SHIP_VIPER
Ship blueprint for a Viper
SHIP_WORM
Ship blueprint for a Worm
shpcol
Ship colours
XX21
Ship blueprints lookup table
Macros
EDGE
Macro definition for adding edges to ship blueprints
FACE
Macro definition for adding faces to ship blueprints
VERTEX
Macro definition for adding vertices to ship blueprints
Drawing suns
The epic, shimmering Elite sun
Subroutines
FLFLLS
Reset the sun line heap
SUN (Part 1 of 4)
Draw the sun: Set up all the variables needed to draw the sun
SUN (Part 2 of 4)
Draw the sun: Start from the bottom of the screen and erase the old sun line by line
SUN (Part 3 of 4)
Draw the sun: Continue to move up the screen, drawing the new sun line by line
SUN (Part 4 of 4)
Draw the sun: Continue to the top of the screen, erasing the old sun line by line
WPLS
Remove the sun from the screen
Drawing the screen
The split-screen mode and different screen views
Subroutines
cls (I/O processor)
Clear the top part of the screen and draw a white border
CLYNS
Clear the bottom three text rows of the mode 1 screen by sending a #clyns command to the I/O processor
CLYNS (I/O processor)
Implement the #clyns command (clear the bottom of the screen)
DET1
Show or hide the dashboard (for when we die) by sending a #DODIALS command to the I/O processor
DODIALS (I/O processor)
Implement the #DODIALS
command (show or hide the dashboard)
DOVDU19
Change the mode 1 palette by sending a #SETVDU19 command to the I/O processor
IRQ1 (I/O processor) *
The main screen-mode interrupt handler (IRQ1V points here)
SETVDU19 (I/O processor)
Implement the #SETVDU19
command (change mode 1 palette)
TRADEMODE
Clear the screen and set up a printable trading screen
TT66
Clear the screen and set the current view type
TTX66
Send control code 11 to the I/O processor to clear the top part of the screen and draw a white border
TTX66 (I/O processor)
Clear the top part of the screen and draw a white border
WSCAN
Ask the I/O processor to wait for the vertical sync by sending a #wscn command to the I/O processor
WSCAN (I/O processor)
Implement the #wscn command (wait for the vertical sync)
Variables
B% (Loader 1)
VDU commands for setting the square mode 1 screen
TVT1 (I/O processor)
Palette data for the mode 2 part of the screen (the dashboard)
TVT3 (I/O processor)
Palette data for the mode 1 part of the screen (the top part)
Equipment
Buying and selling weapons and ship upgrades
Subroutines
eq
Subtract the price of equipment from the cash pot
EQSHP *
Show the Equip Ship screen (red key f3)
prx
Return the price of a piece of equipment
qv
Print a menu of the four space views, for buying lasers
refund
Install a new laser, processing a refund if applicable
Variables
PRXS
Equipment prices
Flight
Docking, hyperspace, views, shields and more
Subroutines
DCS1
Calculate the vector from the ideal docking position to the ship
DENGY
Drain some energy from the energy banks
dockEd
Print a message to say there is no hyperspacing allowed inside the station
DOCKIT
Apply docking manoeuvres to the ship in INWK
DOENTRY
Dock at the space station, show the ship hangar and work out any mission progression
DOFE21 (I/O processor)
Implement the #DOFE21
command (show the energy bomb effect)
ee3
Print the hyperspace countdown in the top-left of the screen
ESCAPE
Launch our escape pod
Ghy
Perform a galactic hyperspace jump
hyp
Start the hyperspace process
LOOK1
Initialise the space view
me1
Erase an old in-flight message and display a new one
me2
Remove an in-flight message from the space view
mes9
Print a text token, possibly followed by " DESTROYED"
MESS
Display an in-flight message
MJP
Process a mis-jump into witchspace
OOPS
Take some damage
ou2
Display "E.C.M.SYSTEM DESTROYED" as an in-flight message
ou3
Display "FUEL SCOOPS DESTROYED" as an in-flight message
OUCH
Potentially lose cargo or equipment following damage
PLUT *
Flip the coordinate axes for the four different views
SESCP
Spawn an escape pod from the current (parent) ship
SHD
Charge a shield and drain some energy from the energy banks
SIGHT
Draw the laser crosshairs
TT110
Launch from a station or show the front space view
TT147
Print an error when a system is out of hyperspace range
TT18
Try to initiate a jump into hyperspace
TTX110
Set the current system to the nearest system and return to hyp
WARP *
Perform an in-system jump
wW
Start a hyperspace countdown
Keyboard
Processing key presses and joysticks
Subroutines
CTRL
Scan the keyboard to see if CTRL is currently pressed
DK4
Scan for pause, configuration and secondary flight keys
DKJ1
Read joystick and flight controls
DKS2
Read the joystick position
DKS3
Toggle a configuration setting and emit a beep
DKS4
Scan for a particular key press by sending a #DODKS4 command to the I/O processor
DODKS4 (I/O processor)
Implement the #DODKS4 command (scan the keyboard to see if a specific key is being pressed)
DOKEY *
Scan for the seven primary flight controls and apply the docking computer manoeuvring code
DOVIAE (I/O processor)
Implement the #VIAE
command (enable/disable interrupts)
FLKB
Flush the keyboard buffer
KEYBOARD (I/O processor)
Implement the OSWORD 240 command (scan the keyboard and joystick and log the results)
PAUSE2
Wait until a key is pressed, ignoring any existing key press
RDKEY
Scan the keyboard for key presses by sending an OSWORD 240 command to the I/O processor
TT102 *
Process function key, save key, hyperspace and chart key presses and update the hyperspace counter
TT17
Scan the keyboard for cursor key or joystick movement
TT214
Ask a question with a "Y/N?" prompt and return the response
TT217
Scan the keyboard until a key is pressed
U%
Clear the key logger
ZEKTRAN
Reset the key logger buffer at KTRAN
Variables
KTRAN
The key logger buffer that gets updated by the OSWORD 240 command
KYTB
Lookup table for in-flight keyboard controls
KYTB (I/O processor)
Lookup table for in-flight keyboard controls
TRANTABLE
Translation table from internal key number to ASCII
Macros
DKS4 (I/O processor)
Scan the keyboard to see if a specific key is being pressed
Loader
The loading screen and system setup
Subroutines
BEGIN
Initialise the configuration variables and start the game
COLD
Copy the recursive tokens and ship blueprints to their correct locations
Elite loader (Loader 1)
Check for a 6502 Second Processor, perform a number of OS calls, set up sound and run the second loader
Elite loader (Part 1 of 2) (Loader 2)
Move loading screen binaries into screen memory and load and run the main game code
Elite loader (Part 2 of 2) (Loader 2)
Include binaries for loading screen and dashboard images
S%
Checksum, decrypt and unscramble the main game code, and start the game
STARTUP (I/O processor)
Set the various vectors, interrupts and timers, and terminate the loading process so the vector handlers can take over
Variables
MESS1 (Loader 1)
The OS command string for changing the disc directory to E
MESS2 (Loader 1)
The OS command string for running the second part of the loader in file ELITEa
MESS2 (Loader 2)
The OS command string for running the I/O processor's main game code in file I.CODE
MESS3 (Loader 2)
The OS command string for running the parasite's main game code in file P.CODE
RDLI
The OS command string for running the flight code in file D.CODE in the disc version of Elite
Main loop
The core loop that runs Elite
Subroutines
Main flight loop (Part 1 of 16)
Seed the random number generator
Main flight loop (Part 2 of 16)
Calculate the alpha and beta angles from the current pitch and roll of our ship
Main flight loop (Part 3 of 16)
Scan for flight keys and process the results
Main flight loop (Part 4 of 16)
For each nearby ship: Copy the ship's data block from K% to the zero-page workspace at INWK
Main flight loop (Part 5 of 16)
For each nearby ship: If an energy bomb has been set off, potentially kill this ship
Main flight loop (Part 6 of 16)
For each nearby ship: Move the ship in space and copy the updated INWK data block back to K%
Main flight loop (Part 7 of 16)
For each nearby ship: Check whether we are docking, scooping or colliding with it
Main flight loop (Part 8 of 16)
For each nearby ship: Process us potentially scooping this item
Main flight loop (Part 9 of 16)
For each nearby ship: If it is a space station, check whether we are successfully docking with it
Main flight loop (Part 10 of 16)
For each nearby ship: Remove if scooped, or process collisions
Main flight loop (Part 11 of 16)
For each nearby ship: Process missile lock and firing our laser
Main flight loop (Part 12 of 16)
For each nearby ship: Draw the ship, remove if killed, loop back
Main flight loop (Part 13 of 16)
Show energy bomb effect, charge shields and energy banks
Main flight loop (Part 14 of 16)
Spawn a space station if we are close enough to the planet
Main flight loop (Part 15 of 16)
Perform altitude checks with the planet and sun and process fuel scooping if appropriate
Main flight loop (Part 16 of 16)
Process laser pulsing, E.C.M. energy drain, call stardust routine
Main game loop (Part 1 of 6)
Spawn a trader (a Cobra Mk III, Python, Boa or Anaconda)
Main game loop (Part 2 of 6) *
Call the main flight loop, and potentially spawn a trader, an asteroid, or a cargo canister
Main game loop (Part 3 of 6)
Potentially spawn a cop, particularly if we've been bad
Main game loop (Part 4 of 6)
Potentially spawn a lone bounty hunter, a Thargoid, or up to four pirates
Main game loop (Part 5 of 6)
Cool down lasers, make calls to update the dashboard
Main game loop (Part 6 of 6)
Process non-flight key presses (red function keys, docked keys)
Market
Market prices, selling, buying and inventory
Subroutines
dn
Print the amount of money we have left in the cash pot, then make a short, high beep and delay for 1 second
gnum
Get a number from the keyboard
NWDAV4
Print an "ITEM?" error, make a beep and rejoin the TT210 routine
tnpr
Work out if we have space for a specific amount of cargo
tnpr1
Work out if we have space for one tonne of cargo
TT151
Print the name, price and availability of a market item
TT152
Print the unit ("t", "kg" or "g") for a market item
TT160
Print "t" (for tonne) and a space
TT161
Print "kg" (for kilograms)
TT163
Print the headers for the table of market prices
TT167 *
Show the Market Price screen (red key f7)
TT16a
Print "g" (for grams)
TT208 *
Show the Sell Cargo screen (red key f2)
TT210
Show a list of current cargo in our hold, optionally to sell
TT213 *
Show the Inventory screen (red key f9)
TT219 *
Show the Buy Cargo screen (red key f1)
var
Calculate QQ19+3 = economy * |economic_factor|
Variables
QQ23
Market prices table
Macros
ITEM
Macro definition for the market prices table
Maths (Arithmetic)
Addition, subtraction, multiplication, division
Subroutines
ADD *
Calculate (A X) = (A P) + (S R)
ADD (I/O processor) *
Calculate (A X) = (A P) + (S R)
DORND *
Generate random numbers
DORND (Loader 1) *
Generate random numbers
DV41
Calculate (P R) = 256 * DELTA / A
DV42
Calculate (P R) = 256 * DELTA / z_hi
DVID3B2
Calculate K(3 2 1 0) = (A P+1 P) / (z_sign z_hi z_lo)
DVID4 *
Calculate (P R) = 256 * A / Q
DVID4 (I/O processor) *
Calculate (P R) = 256 * A / Q
DVIDT
Calculate (P+1 A) = (A P) / Q
FMLTU
Calculate A = A * Q / 256
FMLTU2
Calculate A = K * sin(A)
GC2
Calculate (Y X) = (A P) * 4
GCASH
Calculate (Y X) = P * Q * 4
LCASH
Subtract an amount of cash from the cash pot
LL120
Calculate (Y X) = (S x1_lo) * XX12+2 or (S x1_lo) / XX12+2
LL123
Calculate (Y X) = (S R) / XX12+2 or (S R) * XX12+2
LL129
Calculate Q = XX12+2, A = S EOR XX12+3 and (S R) = |S R|
LL28
Calculate R = 256 * A / Q
LL38
Calculate (S A) = (S R) + (A Q)
LL5
Calculate Q = SQRT(R Q)
LL61
Calculate (U R) = 256 * A / Q
LL62
Calculate 128 - (U R)
MAD
Calculate (A X) = Q * A + (S R)
MAS3
Calculate A = x_hi^2 + y_hi^2 + z_hi^2 in the K% block
MCASH
Add an amount of cash to the cash pot
MLS1
Calculate (A P) = ALP1 * A
MLS2
Calculate (S R) = XX(1 0) and (A P) = A * ALP1
MLTU2
Calculate (A P+1 P) = (A ~P) * Q
MLU1
Calculate Y1 = y_hi and (A P) = |y_hi| * Q for Y-th stardust
MLU2
Calculate (A P) = |A| * Q
MU1
Copy X into P and A, and clear the C flag
MU11
Calculate (A P) = P * X
MU5
Set K(3 2 1 0) = (A A A A) and clear the C flag
MU6
Set P(1 0) = (A A)
MULT1
Calculate (A P) = Q * A
MULT12
Calculate (S R) = Q * A
MULT3
Calculate K(3 2 1 0) = (A P+1 P) * Q
MULTU *
Calculate (A P) = P * Q
MUT1
Calculate R = XX and (A P) = Q * A
MUT2
Calculate (S R) = XX(1 0) and (A P) = Q * A
MUT3
An unused routine that does the same as MUT2
PIX1
Calculate (YY+1 SYL+Y) = (A P) + (S R) and draw stardust particle
ROOT (Loader 1)
Calculate ZP = SQRT(ZP(1 0))
SPS2
Calculate (Y X) = A / 10
SQUA
Clear bit 7 of A and calculate (A P) = A * A
SQUA2
Calculate (A P) = A * A
SQUA2 (Loader 1)
Calculate (A P) = A * A
TAS1
Calculate K3 = (x_sign x_hi x_lo) - V(1 0)
TIS1
Calculate (A ?) = (-X * A + (S R)) / 96
TIS2
Calculate A = A / Q
TIS3
Calculate -(nosev_1 * roofv_1 + nosev_2 * roofv_2) / nosev_3
VCSU1
Calculate vector K3(8 0) = [x y z] - coordinates of the sun or space station
VCSUB
Calculate vector K3(8 0) = [x y z] - coordinates in (A V)
Variables
antilog
Binary antilogarithm table
antilog (I/O processor)
Binary antilogarithm table
antilogODD
Binary antilogarithm table
antilogODD (I/O processor)
Binary antilogarithm table
log
Binary logarithm table (high byte)
log (I/O processor)
Binary logarithm table (high byte)
logL
Binary logarithm table (low byte)
logL (I/O processor)
Binary logarithm table (low byte)
Maths (Geometry)
Vectors, coordinates, dot products and matrices
Subroutines
ARCTAN
Calculate A = arctan(P / Q)
FAROF
Compare x_hi, y_hi and z_hi with 224
FAROF2
Compare x_hi, y_hi and z_hi with A
LL51
Calculate the dot product of XX15 and XX16
MAS1
Add an orientation vector coordinate to an INWK coordinate
MAS2
Calculate a cap on the maximum distance to the planet or sun
MAS4
Calculate a cap on the maximum distance to a ship
NORM *
Normalise the three-coordinate vector in XX15
PROJ
Project the current ship or planet onto the screen
SPS1
Calculate the vector to the planet and store it in XX15
SPS3
Copy a space coordinate from the K% block into K3
SPS4
Calculate the vector to the space station
TAS2
Normalise the three-coordinate vector in K3
TAS3
Calculate the dot product of XX15 and an orientation vector
TAS4
Calculate the dot product of XX15 and one of the space station's orientation vectors
TAS6
Negate the vector in XX15 so it points in the opposite direction
TIDY *
Orthonormalise the orientation vectors for a ship
Variables
ACT
Arctan table
SNE
Sine/cosine table
Missions
Hunting stolen ships and evading Thargoids
Subroutines
BRIEF
Start mission 1 and show the mission briefing
BRIEF2
Start mission 2
BRIEF3
Receive the briefing and plans for mission 2
BRIS
Clear the screen, display "INCOMING MESSAGE" and wait for 2 seconds
BRP
Print an extended token and show the Status Mode screen
DEBRIEF
Finish mission 1
DEBRIEF2
Finish mission 2
PAS1
Display a rotating ship at space coordinates (0, 112, 256) and scan the keyboard
PAUSE
Display a rotating ship, waiting until a key is pressed, then remove the ship from the screen
THERE
Check whether we are in the Constrictor's system in mission 1
Moving
Moving and rotating ships and planets in space
Subroutines
MV40
Rotate the planet or sun's location in space by the amount of pitch and roll of our ship
MVEIT (Part 1 of 9)
Move current ship: Tidy the orientation vectors
MVEIT (Part 2 of 9)
Move current ship: Call tactics routine, remove ship from scanner
MVEIT (Part 3 of 9)
Move current ship: Move ship forward according to its speed
MVEIT (Part 4 of 9)
Move current ship: Apply acceleration to ship's speed as a one-off
MVEIT (Part 5 of 9)
Move current ship: Rotate ship's location by our pitch and roll
MVEIT (Part 6 of 9)
Move current ship: Move the ship in space according to our speed
MVEIT (Part 7 of 9)
Move current ship: Rotate ship's orientation vectors by pitch/roll
MVEIT (Part 8 of 9)
Move current ship: Rotate ship about itself by its own pitch/roll
MVEIT (Part 9 of 9)
Move current ship: Redraw on scanner, if it hasn't been destroyed
MVS4 *
Apply pitch and roll to an orientation vector
MVS5
Apply a 3.6 degree pitch or roll to an orientation vector
MVT1
Calculate (x_sign x_hi x_lo) = (x_sign x_hi x_lo) + (A R)
MVT3
Calculate K(3 2 1) = (x_sign x_hi x_lo) + K(3 2 1)
MVT6
Calculate (A P+2 P+1) = (x_sign x_hi x_lo) + (A P+2 P+1)
SFS2
Move a ship in space along one of the coordinate axes
Save and load
Commander files and competition codes
Subroutines
BRKBK
Set the standard BRKV handler for the game
CAT
Catalogue a disc, wait for a key press and display the disc access menu
CATS
Ask for a disc drive number and print a catalogue of that drive
CHECK
Calculate the checksum for the last saved commander data block
DELT
Catalogue a disc, ask for a filename to delete, and delete the file
DOCATF (I/O processor)
Implement the #DOCATF
command (update the disc catalogue flag)
DODOSVN
Set the SVN ("save in progress") flag by sending a #DOsvn command to the I/O processor
DOSVN (I/O processor)
Implement the #DOSVN
command (update the "save in progress" flag)
GTDRV
Get an ASCII disc drive number from the keyboard
GTNMEW
Fetch the name of a commander file to save or load
LOD *
Load a commander file
MEBRK
The BRKV handler for disc access operations
QUS1
Save or load the commander file
retry
Scan the keyboard until a key is pressed and display the disc access menu
savscr
Save a screenshot if CTRL-D is pressed when the game is paused
SVE *
Display the disc access menu and process saving of commander files
TR1
Copy the last saved commander's name from NA% to INWK
TRNME
Copy the last saved commander's name from INWK to NA%
Variables
CHK
First checksum byte for the saved commander data file
CHK2
Second checksum byte for the saved commander data file
CTLI
The OS command string for cataloguing a disc
DELI
The OS command string for deleting a file
NA%
The data block for the last saved commander
oscobl
OSFILE configuration block for saving a screenshot
oscobl2
Master OSFILE configuration block for saving a screenshot
S1%
The drive and directory number used when saving or loading a commander file
scname
Filename to be used when saving a screenshot
stack
Temporary storage for the stack pointer when switching the BRKV handler between BRBR and MEBRK
Ship hangar
The ship hangar that's displayed on docking
Subroutines
HAL3 (I/O processor)
Draw a hangar background line from left to right, stopping when it bumps into existing on-screen content
HALL
Draw the ships in the ship hangar, then draw the hangar by sending an OSWORD 248 command to the I/O processor
HANGER (I/O processor)
Implement the OSWORD 248 command (display the ship hangar)
HAS1
Draw a ship in the ship hangar
HAS2 (I/O processor)
Draw a hangar background line from left to right
HAS3 (I/O processor)
Draw a hangar background line from right to left
UNWISE
Switch the main line-drawing routine between EOR and OR logic
Variables
HATB
Ship hangar group table
Sound
Explosions, laser fire, hyperspace and more
Subroutines
BEEP
Make a short, high beep
BELL
Make a standard system beep
ECMOF
Switch off the E.C.M.
EXNO
Make the sound of a laser strike or ship explosion
EXNO3
Make an explosion sound
NO3
Make a sound from a prepared sound block
NOISE *
Make the sound whose number is in A
NOS1
Prepare a sound block
TALK
Speak using the Watford Electronics Beeb Speech Synthesiser
Variables
E% (Loader 1)
Sound envelope definitions
SFX
Sound data
SPEECH
Phrases for the Watford Electronics Beeb Speech Synthesiser
Macros
FNE (Loader 1)
Macro definition for defining a sound envelope
Stardust
Stardust generation and movement
Subroutines
FLIP
Reflect the stardust particles in the screen diagonal and redraw the stardust field
nWq
Create a random cloud of stardust
NWSTARS
Initialise the stardust field
STARS *
The main routine for processing the stardust
STARS1
Process the stardust for the front view
STARS2
Process the stardust for the left or right view
STARS6
Process the stardust for the rear view
Start and end
The title screen... and the Game Over screen
Subroutines
BR1 (Part 1 of 2)
Show the "Load New Commander (Y/N)?" screen and start the game
BR1 (Part 2 of 2)
Show the "Press Fire or Space, Commander" screen and start the game
DEATH *
Display the death screen
DEATH2
Reset most of the game and restart from the title screen
DFAULT
Reset the current commander data block to the last saved commander
RES2
Reset a number of flight variables and workspaces
RESET
Reset most variables
TITLE *
Display a title screen with a rotating ship and prompt
TT170 *
Main entry point for the Elite game code
Status
Showing the commander's status and rank
Subroutines
BAD
Calculate how bad we have been
BAY
Go to the docking bay (i.e. show the Status Mode screen)
cmn
Print the commander's name
csh
Print the current amount of cash
EXNO2
Process us making a kill
fwl
Print fuel and cash levels
STATUS *
Show the Status Mode screen (red key f8)
Tactics
AI tactics for enemy ships and missiles
Subroutines
ANGRY
Make a ship hostile
FR1
Display the "missile jammed" message
FRMIS
Fire a missile from our ship
FRS1
Launch a ship straight ahead of us, below the laser sights
HITCH *
Work out if the ship in INWK is in our crosshairs
SFRMIS
Add an enemy missile to our local bubble of universe
TACTICS (Part 1 of 7)
Apply tactics: Process missiles, both enemy missiles and our own
TACTICS (Part 2 of 7) *
Apply tactics: Escape pod, station, lone Thargon, safe-zone pirate
TACTICS (Part 3 of 7)
Apply tactics: Calculate dot product to determine ship's aim
TACTICS (Part 4 of 7)
Apply tactics: Check energy levels, maybe launch escape pod if low
TACTICS (Part 5 of 7)
Apply tactics: Consider whether to launch a missile at us
TACTICS (Part 6 of 7)
Apply tactics: Consider firing a laser at us, if aim is true
TACTICS (Part 7 of 7)
Apply tactics: Set pitch, roll, and acceleration
Text
The game's recursive text tokenisation system
Subroutines
BPRNT *
Print a 32-bit number, left-padded to a specific number of digits, with an optional decimal point
CHPR
Send a character to the I/O processor for printing or processing
crlf
Tab to column 21 and print a colon
DETOK
Print an extended recursive token from the TKN1 token table
DETOK2
Print an extended text token (1-255)
DETOK3
Print an extended recursive token from the RUTOK token table
dn2
Make a short, high beep and delay for 1 second
DOCOL
Set the text colour by sending a #SETCOL command to the I/O processor
DOCOL (I/O processor)
Implement the #SETCOL
command (set the current colour)
DOXC
Move the text cursor to a specified column by sending a #SETXC command to the I/O processor
DOYC
Move the text cursor to a specified row by sending a #SETYC command to the I/O processor
ex
Print a recursive token
FEED
Print a newline
INCYC
Move the text cursor to the next row
label
Send a two-byte OSWRCH command to the I/O processor
MT1
Switch to ALL CAPS when printing extended tokens
MT13
Switch to lower case when printing extended tokens
MT14
Switch to justified text when printing extended tokens
MT15
Switch to left-aligned text when printing extended tokens
MT16
Print the character in variable DTW7
MT17
Print the selected system's adjective, e.g. Lavian for Lave
MT18
Print a random 1-8 letter word in Sentence Case
MT19
Capitalise the next letter
MT2
Switch to Sentence Case when printing extended tokens
MT23
Move to row 10, switch to white text, and switch to lower case when printing extended tokens
MT26
Fetch a line of text from the keyboard
MT27
Print the captain's name during mission briefings
MT28
Print the location hint during the mission 1 briefing
MT29
Move to row 6, switch to white text, and switch to lower case when printing extended tokens
MT5
Switch to extended tokens
MT6
Switch to standard tokens in Sentence Case
MT8
Tab to column 6 and start a new word when printing extended tokens
MT9
Clear the screen and set the current view type to 1
plf
Print a text token followed by a newline
plf2
Print text followed by a newline and indent of 6 characters
POSWRCH (I/O processor)
Print a character on the printer only
pr2
Print an 8-bit number, left-padded to 3 digits, and optional point
pr5
Print a 16-bit number, left-padded to 5 digits, and optional point
pr6
Print 16-bit number, left-padded to 5 digits, no point
prilf (I/O processor)
Implement the #prilf command (print a blank line on the printer)
printer (I/O processor)
Implement the #printcode
command (print a character on the printer and screen)
prq
Print a text token followed by a question mark
qw
Print a recursive token in the range 128-145
SETXC (I/O processor)
Implement the #SETXC
command (move the text cursor to a specific column)
SETYC (I/O processor)
Implement the #SETYC
command (move the text cursor to a specific row)
spc
Print a text token followed by a space
tosend (I/O processor)
Print a printable character and return to the printer routine
TT11
Print a 16-bit number, left-padded to n digits, and optional point
TT162
Print a space
TT26 *
Print a character at the text cursor, with support for verified text in extended tokens
TT26 (I/O processor) *
Print a character at the text cursor by poking into screen memory
TT27 *
Print a text token
TT41
Print a letter according to Sentence Case
TT42
Print a letter in lower case
TT43
Print a two-letter token or recursive token 0-95
TT45
Print a letter in lower case
TT46
Print a character and switch to capitals
TT60
Print a text token and a paragraph break
TT67
Print a newline
TT67 (I/O processor)
Print a newline
TT68
Print a text token followed by a colon
TT69
Set Sentence Case and print a newline
TT73
Print a colon
TT74
Print a character
TTX69
Print a paragraph break
VOWEL
Test whether a character is a vowel
WHITETEXT
Switch to white text
Variables
DTW1
A mask for applying the lower case part of Sentence Case to extended text tokens
DTW2
A flag that indicates whether we are currently printing a word
DTW3
A flag for switching between standard and extended text tokens
DTW4
Flags that govern how justified extended text tokens are printed
DTW5
The size of the justified text buffer at BUF
DTW6
A flag to denote whether printing in lower case is enabled for extended text tokens
DTW8
A mask for capitalising the next letter in an extended text token
FONT% (I/O processor)
A copy of the character definition bitmap table from the MOS ROM
JMTB
The extended token table for jump tokens 1-32 (DETOK)
MTIN
Lookup table for random tokens in the extended token table (0-37)
printflag
A flag that determines whether to send text output to the printer as well as the screen
QQ16
The two-letter token lookup table
QQ18
The recursive token table for tokens 0-148
RLINE
The OSWORD configuration block used to fetch a line of text from the keyboard
RUGAL
The criteria for systems with extended description overrides
RUPLA
System numbers that have extended description overrides
RUTOK
The second extended token table for recursive tokens 0-26 (DETOK3)
TENS
A constant used when printing large numbers in BPRNT
TKN1
The first extended token table for recursive tokens 0-255 (DETOK)
TKN2
The extended two-letter token lookup table
Macros
CHAR
Macro definition for characters in the recursive token table
CONT
Macro definition for control codes in the recursive token table
ECHR
Macro definition for characters in the extended token table
EJMP
Macro definition for jump tokens in the extended token table
ERND
Macro definition for random tokens in the extended token table
ETOK
Macro definition for recursive tokens in the extended token table
ETWO
Macro definition for two-letter tokens in the extended token table
RTOK
Macro definition for recursive tokens in the recursive token table
TOKN
Macro definition for standard tokens in the extended token table
TWOK
Macro definition for two-letter tokens in the token table
Tube
Communicating with the Second Processor in Elite
Subroutines
newosrdch (I/O processor)
The custom OSRDCH routine for reading characters
NWOSWD (I/O processor)
The custom OSWORD routine
PUTBACK (I/O processor)
Reset the OSWRCH vector in WRCHV to point to USOSWRCH
USOSWRCH (I/O processor)
The custom OSWRCH routine for writing characters and implementing jump table commands
Variables
JMPTAB (I/O processor)
The lookup table for OSWRCH jump commands (128-147)
OSWVECS (I/O processor)
The lookup table for OSWORD jump commands (240-255)
Universe
Ship spawning, local bubble, system/market data
Subroutines
cpl
Print the selected system name
GINF
Fetch the address of a ship's data block into INF
GTHG
Spawn a Thargoid ship and a Thargon companion
GVL
Calculate the availability of market items
hyp1
Process a jump to the system closest to (QQ9, QQ10)
jmp
Set the current system to the selected system
KILLSHP *
Remove a ship from our local bubble of universe
KS1
Remove the current ship from our local bubble of universe
KS2
Check the local bubble for missiles with target lock
KS3
Set the SLSP ship line heap pointer after shuffling ship slots
KS4
Remove the space station and replace it with the sun
NwS1
Flip the sign and double an INWK byte
NWSHP
Add a new ship to our local bubble of universe
NWSPS
Add a new space station to our local bubble of universe
PDESC
Print the system's extended description or a mission 1 directive
ping
Set the selected system to the current system
SFS1 *
Spawn a child ship from the current (parent) ship
SOLAR
Set up various aspects of arriving in a new system
SOS1
Update the missile indicators, set up the planet data block
SPIN
Randomly spawn cargo from a destroyed ship
STORE
Copy the ship data block at INWK back to the K% workspace
tal
Print the current galaxy number
TT111
Set the current system to the nearest system to a point
TT146
Print the distance to the selected system in light years
TT20
Twist the selected system's seeds four times
TT24 *
Calculate system data from the system seeds
TT25 *
Show the Data on System screen (red key f6)
TT54 *
Twist the selected system's seeds
TT70
Display "MAINLY " and jump to TT72
TT81
Set the selected system's seeds to those of system 0
ypl
Print the current system name
Ze
Initialise the INWK workspace to a hostile ship
ZINF
Reset the INWK workspace and orientation vectors
ZINF2
Reset the INWK workspace and orientation vectors
Variables
spasto
Contains the address of the Coriolis space station's ship blueprint
UNIV
Table of pointers to the local universe's ship data blocks
Utility routines
Memory/screen clearing, delay routines
Subroutines
backtonormal
Disable the keyboard, set the SVN flag to 0, and return with A = 0
BRBR
The standard BRKV handler for the game
CLDELAY
Delay by iterating through 5 * 256 (1280) empty loops
DELAY
Wait for a specified time, in 1/50s of a second
DOBRK (I/O processor)
Implement the OSWRCH 145 command (execute a BRK instruction)
FX200
Set the behaviour of the ESCAPE and BREAK keys
MVBL (Loader 2)
Move a multi-page block of memory from one location to another
OSB (Loader 1)
A convenience routine for calling OSBYTE with Y = 0
SCLI2
Execute an OS command, setting the SVN flag while it's running
ZEBC
Zero-fill pages &B and &C
ZERO
Reset the local bubble of universe and ship status
ZES1
Zero-fill the page whose number is in X
ZES1 (I/O processor)
Zero-fill the page whose number is in X
ZES2
Zero-fill a specific page
ZES2 (I/O processor)
Zero-fill a specific page
ZEVB
Zero-fill the Y1VB variable
Variables
brkd
The brkd counter for error handling
F%
Denotes the end of the main game code, from Elite A to Elite J
Macros
MVE (Loader 2)
Move a one-page block of memory from one location to another
Workspaces
Collections of important variables into blocks
Workspaces
I/O variables (I/O processor)
Various variables used by the I/O processor
K% *
Ship data blocks
LP
Variables used for displaying the scrolling text in the demo
Parasite variables
Various variables used by the parasite
TINA (I/O processor)
The code block for the TINA hook
UP
Ship slots, variables
WP
Variables
XX3
Temporary storage space for complex calculations
ZP *
Lots of important variables are stored in the zero page workspace as it is quicker and more space-efficient to access memory here
ZP (I/O processor) *
Important variables used by the I/O processor
ZP (Loader 1) *
Important variables used by the loader
ZP (Loader 2) *
Important variables used by the loader
BBC Master source code
The smoothest animation of all the BBC versions
Version information
About the BBC Master version
Information on the smoothest version of Elite
Different variants of the BBC Master version
Code variations found in BBC Master Elite
BBC Master source code by file
Map of the source code
An overview of how the source code for Elite is structured
Annotated original source files
The source files in their original structure
Game loader
Loader source
The loading screen and set-up for the main game
Main game
Workspaces and configuration
The main variable workspaces used in Elite
Elite A source
Part 1 of the main game code
Elite B source
Part 2 of the main game code
Elite C source
Part 3 of the main game code
Elite D source
Part 4 of the main game code
Elite E source
Part 5 of the main game code
Elite F source
Part 6 of the main game code
Elite G source
Part 7 of the main game code
Elite H source
Part 8 of the main game code
Game data
Game data source
The game data file, which contains the dashboard image, ship blueprints and text tokens
Ship blueprints
Data for the 33 different ship designs
Text tokens
Elite's tokenised game text
BBC Master source code by category
Charts
Long-range and short-range galactic charts
Subroutines
hm
Select the closest system and redraw the chart crosshairs
HME2
Search the galaxy for a system
TT103
Draw a small set of crosshairs on a chart
TT105
Draw crosshairs on the Short-range Chart, with clipping
TT114
Display either the Long-range or Short-range Chart
TT123
Move galactic coordinates by a signed delta
TT16
Move the crosshairs on a chart
TT22 *
Show the Long-range Chart (red key f4)
TT23 *
Show the Short-range Chart (red key f5)
Dashboard
The dials, 3D scanner and compass
Subroutines
ABORT
Disarm missiles and update the dashboard indicators
ABORT2
Set/unset the lock target for a missile and update the dashboard
BUMP2
Bump up the value of the pitch or roll dashboard indicator
cntr
Apply damping to the pitch or roll dashboard indicator
COMPAS *
Update the compass
DIALS (Part 1 of 4)
Update the dashboard: speed indicator
DIALS (Part 2 of 4)
Update the dashboard: pitch and roll indicators
DIALS (Part 3 of 4)
Update the dashboard: four energy banks
DIALS (Part 4 of 4)
Update the dashboard: shields, fuel, laser & cabin temp, altitude
DIL2
Update the roll or pitch indicator on the dashboard
DILX *
Update a bar-based indicator on the dashboard
DOT
Draw a dash on the compass
ECBLB
Light up the E.C.M. indicator bulb ("E") on the dashboard
ECBLB2
Start up the E.C.M. (light up the indicator, start the countdown and make the E.C.M. sound)
MSBAR
Draw a specific indicator in the dashboard's missile bar
msblob
Display the dashboard's missile indicators in green
PZW
Fetch the current dashboard colours, to support flashing
PZW2
Fetch the current dashboard colours for non-striped indicators, to support flashing
REDU2
Reduce the value of the pitch or roll dashboard indicator
SCAN *
Display the current ship on the scanner
SP1
Draw the space station on the compass
SP2
Draw a dot on the compass, given the planet/station vector
SPBLB
Light up the space station indicator ("S") on the dashboard
WPSHPS
Clear the scanner, reset the ball line and sun line heaps
Variables
ECBT
The character bitmap for the E.C.M. indicator bulb
SPBT
The bitmap definition for the space station indicator bulb
Drawing circles
Hyperspace tunnels, launch rings and planets
Subroutines
BLINE *
Draw a circle segment and add it to the ball line heap
CHKON
Check whether any part of a circle appears on the extended screen
CIRCLE
Draw a circle for the planet
CIRCLE2 *
Draw a circle (for the planet or chart)
HFS2 *
Draw the launch or hyperspace tunnel
LAUN
Make the launch sound and draw the launch tunnel
LL164
Make the hyperspace sound and draw the hyperspace tunnel
TT128 *
Draw a circle on a chart
TT14
Draw a circle with crosshairs on a chart
Drawing lines
The core line-drawing routines
Subroutines
BOMBEFF2
Erase the energy bomb zig-zag lightning bolt, make the sound of the energy bomb going off, draw a new bolt and repeat four times
BOMBOFF
Draw the zig-zag lightning bolt for the energy bomb
BOMBON
Randomise and draw the energy bomb's zig-zag lightning bolt lines
DVLOIN
Draw a horizontal line from (A, 24) to (A, 152)
EDGES
Draw a horizontal line given a centre and a half-width
HLOIN *
Draw a horizontal line from (X1, Y1) to (X2, Y1)
HLOIN2
Remove a line from the sun line heap and draw it on-screen
LASLI
Draw the laser lines for when we fire our lasers
LL118
Move a point along a line until it is on-screen
LL145 (Part 1 of 4) *
Clip line: Work out which end-points are on-screen, if any
LL145 (Part 2 of 4)
Clip line: Work out if any part of the line is on-screen
LL145 (Part 3 of 4)
Clip line: Calculate the line's gradient
LL145 (Part 4 of 4)
Clip line: Call the routine in LL188 to do the actual clipping
LOIN
Draw a one-segment line
LOIN (Part 1 of 7) *
Draw a line: Calculate the line gradient in the form of deltas
LOIN (Part 2 of 7)
Draw a line: Line has a shallow gradient, step right along x-axis
LOIN (Part 3 of 7)
Draw a shallow line going right and up or left and down
LOIN (Part 4 of 7)
Draw a shallow line going right and down or left and up
LOIN (Part 5 of 7)
Draw a line: Line has a steep gradient, step up along y-axis
LOIN (Part 6 of 7)
Draw a steep line going up and left or down and right
LOIN (Part 7 of 7)
Draw a steep line going up and right or down and left
LSPUT
Draw a ship line using flicker-free animation
NLIN
Draw a horizontal line at pixel row 23 to box in a title
NLIN2
Draw a screen-wide horizontal line at the pixel row in A
NLIN3
Print a title and draw a horizontal line at row 19 to box it in
NLIN4
Draw a horizontal line at pixel row 19 to box in a title
TT15
Draw a set of crosshairs
Variables
BOMBPOS
A set of x-coordinates that are used as the basis for the energy bomb's zig-zag lightning bolt
BOMBTBX
This is where we store the x-coordinates for the energy bomb's zig-zag lightning bolt
BOMBTBY
This is where we store the y-coordinates for the energy bomb's zig-zag lightning bolt
SIGHTCOL
Colours for the crosshair sights on the different laser types
Drawing pixels
How to plot pixels in various colours
Subroutines
CPIXK
Draw a single-height dash on the dashboard
PIX (Loader)
Draw a single pixel at a specific coordinate
PIXEL *
Draw a 1-pixel dot, 2-pixel dash or 4-pixel square
PIXEL2
Draw a stardust particle relative to the screen centre
Variables
CTWOS
Ready-made single-pixel character row bytes for mode 2
orange
Lookup table for 2-pixel mode 1 orange pixels for the sun
PXCL
A four-colour mode 1 pixel byte that represents a dot's distance
TWFL
Ready-made character rows for the left end of a horizontal line
TWFR
Ready-made character rows for the right end of a horizontal line
TWOS
Ready-made single-pixel character row bytes for mode 1
TWOS (Loader)
Ready-made single-pixel character row bytes for mode 1
TWOS2
Ready-made double-pixel character row bytes for mode 1
ylookup
Lookup table for converting pixel y-coordinate to page number of screen address
Drawing planets
Planets with meridians and craters
Subroutines
PL2
Remove the planet or sun from the screen
PL21
Return from a planet/sun-drawing routine with a failure flag
PL9 (Part 1 of 3) *
Draw the planet, with either an equator and meridian, or a crater
PL9 (Part 2 of 3)
Draw the planet's equator and meridian
PL9 (Part 3 of 3)
Draw the planet's crater
PLANET
Draw the planet or sun
PLL1 (Part 1 of 3) (Loader)
Draw Saturn on the loading screen (draw the planet)
PLL1 (Part 2 of 3) (Loader)
Draw Saturn on the loading screen (draw the stars)
PLL1 (Part 3 of 3) (Loader)
Draw Saturn on the loading screen (draw the rings)
PLS1
Calculate (Y A) = nosev_x / z
PLS2
Draw a half-ellipse
PLS22 *
Draw an ellipse or half-ellipse
PLS3
Calculate (Y A P) = 222 * roofv_x / z
PLS4
Calculate CNT2 = arctan(P / A) / 4
PLS5
Calculate roofv_x / z and roofv_y / z
PLS6
Calculate (X K) = (A P) / (z_sign z_hi z_lo)
WP1
Reset the ball line heap
WPLS2
Remove the planet from the screen
Variables
CNT (Loader)
A counter for use in drawing Saturn's planetary body
CNT2 (Loader)
A counter for use in drawing Saturn's background stars
CNT3 (Loader)
A counter for use in drawing Saturn's rings
RAND (Loader)
The random number seed used for drawing Saturn
Drawing ships
The celebrated 3D ship plotting process
Subroutines
DOEXP *
Draw an exploding ship
LL9 (Part 1 of 12)
Draw ship: Check if ship is exploding, check if ship is in front
LL9 (Part 2 of 12)
Draw ship: Check if ship is in field of view, close enough to draw
LL9 (Part 3 of 12)
Draw ship: Set up orientation vector, ship coordinate variables
LL9 (Part 4 of 12)
Draw ship: Set visibility for exploding ship (all faces visible)
LL9 (Part 5 of 12)
Draw ship: Calculate the visibility of each of the ship's faces
LL9 (Part 6 of 12)
Draw ship: Calculate the visibility of each of the ship's vertices
LL9 (Part 7 of 12)
Draw ship: Calculate the visibility of each of the ship's vertices
LL9 (Part 8 of 12)
Draw ship: Calculate the screen coordinates of visible vertices
LL9 (Part 9 of 12)
Draw ship: Draw laser beams if the ship is firing its laser at us
LL9 (Part 10 of 12)
Draw ship: Calculate the visibility of each of the ship's edges and draw the visible ones using flicker-free animation
LL9 (Part 11 of 12)
Draw ship: Loop back for the next edge
LL9 (Part 12 of 12)
Draw ship: Draw all the visible edges from the ship line heap
SHPPT
Draw a distant ship as a point rather than a full wireframe
Variables
coltabl
Colours for ship explosions
E% (Game data)
Ship blueprints default NEWB flags
exlook
An unused block of explosion data
scacol
Ship colours on the scanner
SHIP_ADDER (Game data)
Ship blueprint for an Adder
SHIP_ANACONDA (Game data)
Ship blueprint for an Anaconda
SHIP_ASP_MK_2 (Game data)
Ship blueprint for an Asp Mk II
SHIP_ASTEROID (Game data)
Ship blueprint for an asteroid
SHIP_BOA (Game data)
Ship blueprint for a Boa
SHIP_BOULDER (Game data)
Ship blueprint for a boulder
SHIP_CANISTER (Game data)
Ship blueprint for a cargo canister
SHIP_COBRA_MK_1 (Game data)
Ship blueprint for a Cobra Mk I
SHIP_COBRA_MK_3 (Game data)
Ship blueprint for a Cobra Mk III
SHIP_COBRA_MK_3_P (Game data)
Ship blueprint for a Cobra Mk III (pirate)
SHIP_CONSTRICTOR (Game data)
Ship blueprint for a Constrictor
SHIP_CORIOLIS (Game data)
Ship blueprint for a Coriolis space station
SHIP_COUGAR (Game data)
Ship blueprint for a Cougar
SHIP_DODO (Game data)
Ship blueprint for a Dodecahedron ("Dodo") space station
SHIP_ESCAPE_POD (Game data)
Ship blueprint for an escape pod
SHIP_FER_DE_LANCE (Game data)
Ship blueprint for a Fer-de-Lance
SHIP_GECKO (Game data)
Ship blueprint for a Gecko
SHIP_KRAIT (Game data)
Ship blueprint for a Krait
SHIP_MAMBA (Game data)
Ship blueprint for a Mamba
SHIP_MISSILE (Game data)
Ship blueprint for a missile
SHIP_MORAY (Game data)
Ship blueprint for a Moray
SHIP_PLATE (Game data)
Ship blueprint for an alloy plate
SHIP_PYTHON (Game data)
Ship blueprint for a Python
SHIP_PYTHON_P (Game data)
Ship blueprint for a Python (pirate)
SHIP_ROCK_HERMIT (Game data)
Ship blueprint for a rock hermit (asteroid)
SHIP_SHUTTLE (Game data)
Ship blueprint for a Shuttle
SHIP_SIDEWINDER (Game data)
Ship blueprint for a Sidewinder
SHIP_SPLINTER (Game data)
Ship blueprint for a splinter
SHIP_THARGOID (Game data)
Ship blueprint for a Thargoid mothership
SHIP_THARGON (Game data)
Ship blueprint for a Thargon
SHIP_TRANSPORTER (Game data)
Ship blueprint for a Transporter
SHIP_VIPER (Game data)
Ship blueprint for a Viper
SHIP_WORM (Game data)
Ship blueprint for a Worm
shpcol
Ship colours
XX21 (Game data)
Ship blueprints lookup table
Macros
EDGE (Game data)
Macro definition for adding edges to ship blueprints
FACE (Game data)
Macro definition for adding faces to ship blueprints
VERTEX (Game data)
Macro definition for adding vertices to ship blueprints
Drawing suns
The epic, shimmering Elite sun
Subroutines
FLFLLS
Reset the sun line heap
SUN (Part 1 of 4)
Draw the sun: Set up all the variables needed to draw the sun
SUN (Part 2 of 4)
Draw the sun: Start from the bottom of the screen and erase the old sun line by line
SUN (Part 3 of 4)
Draw the sun: Continue to move up the screen, drawing the new sun line by line
SUN (Part 4 of 4)
Draw the sun: Continue to the top of the screen, erasing the old sun line by line
WPLS
Remove the sun from the screen
Drawing the screen
The split-screen mode and different screen views
Subroutines
cls
Clear the top part of the screen and draw a white border
CLYNS
Clear the bottom three text rows of the mode 4 screen
DET1
Show or hide the dashboard (for when we die)
DOVDU19
Change the mode 1 palette
IRQ1 *
The main screen-mode interrupt handler (IRQ1V points here)
TRADEMODE
Clear the screen and set up a trading screen
TT66
Clear the screen and set the current view type
TTX66
Clear the top part of the screen and draw a white border
TTX66K
Clear the top part of the screen and draw a white border
WSCAN
Implement the #wscn command (wait for the vertical sync)
Variables
B% (Loader)
VDU commands for setting the square mode 1 screen
TVT1
Palette data for the mode 2 part of the screen (the dashboard)
TVT3
Palette data for the mode 1 part of the screen (the top part)
VEC
The original value of the IRQ1 vector
VSCAN
Defines the split position in the split-screen mode
Equipment
Buying and selling weapons and ship upgrades
Subroutines
eq
Subtract the price of equipment from the cash pot
EQSHP *
Show the Equip Ship screen (red key f3)
prx
Return the price of a piece of equipment
qv
Print a menu of the four space views, for buying lasers
refund
Install a new laser, processing a refund if applicable
Variables
PRXS
Equipment prices
Flight
Docking, hyperspace, views, shields and more
Subroutines
DCS1
Calculate the vector from the ideal docking position to the ship
DENGY
Drain some energy from the energy banks
dockEd
Print a message to say there is no hyperspacing allowed inside the station
DOCKIT
Apply docking manoeuvres to the ship in INWK
DOENTRY
Dock at the space station, show the ship hangar and work out any mission progression
ee3
Print the hyperspace countdown in the top-left of the screen
ESCAPE
Launch our escape pod
Ghy
Perform a galactic hyperspace jump
hyp
Start the hyperspace process
LOOK1
Initialise the space view
me1
Erase an old in-flight message and display a new one
me2
Remove an in-flight message from the space view
mes9
Print a text token, possibly followed by " DESTROYED"
MESS
Display an in-flight message
MJP
Process a mis-jump into witchspace
OOPS
Take some damage
ou2
Display "E.C.M.SYSTEM DESTROYED" as an in-flight message
ou3
Display "FUEL SCOOPS DESTROYED" as an in-flight message
OUCH
Potentially lose cargo or equipment following damage
PLUT *
Flip the coordinate axes for the four different views
SESCP
Spawn an escape pod from the current (parent) ship
SHD
Charge a shield and drain some energy from the energy banks
SIGHT
Draw the laser crosshairs
TT110
Launch from a station or show the front space view
TT147
Print an error when a system is out of hyperspace range
TT18
Try to initiate a jump into hyperspace
TTX110
Set the current system to the nearest system and return to hyp
WARP *
Perform an in-system jump
wW
Start a hyperspace countdown
Keyboard
Processing key presses and joysticks
Subroutines
CTRL
Scan the keyboard to see if CTRL is currently pressed
CTRLmc
Scan the Master Compact keyboard to see if CTRL is currently pressed
DJOY
Scan the keyboard for cursor key or digital joystick movement
DK4
Scan for pause, configuration and secondary flight keys
DKS3
Toggle a configuration setting and emit a beep
DKS4mc
Scan the Master Compact keyboard to see if a specific key is being pressed
DKS5
Scan the keyboard to see if a specific key is being pressed
DOKEY *
Scan for the seven primary flight controls and apply the docking computer manoeuvring code
FILLKL
Scan the keyboard for a flight key and update the key logger
FLKB
Flush the keyboard buffer
PAUSE2
Wait until a key is pressed, ignoring any existing key press
RDFIRE
Read the fire button on either the analogue or digital joystick
RDJOY
Read from either the analogue or digital joystick
RDKEY
Scan the keyboard for key presses
RETURN
Scan the keyboard to see if RETURN is currently pressed
SHIFT
Scan the keyboard to see if SHIFT is currently pressed
TT102 *
Process function key, save key, hyperspace and chart key presses and update the hyperspace counter
TT17
Scan the keyboard for cursor key or joystick movement
TT17X
Scan the digital joystick for movement
TT214
Ask a question with a "Y/N?" prompt and return the response
TT217
Scan the keyboard until a key is pressed
YESNO
Wait until either "Y" or "N" is pressed
ZEKTRAN
Clear the key logger
Variables
IKNS
Lookup table for in-flight keyboard controls
KTRAN
The key logger buffer that gets updated by the OSWORD 240 command
TGINT
The keys used to toggle configuration settings when the game is paused
TRTB%
Translation table from internal key number to ASCII
Loader
The loading screen and system setup
Subroutines
BEGIN
Initialise the configuration variables and start the game
Elite loader (Loader)
Perform a number of OS calls, check for sideways RAM, load and move the main game data, and load and run the main game code
S%
Move code, set up break handler and start the game
SETINTS
Set the various vectors, interrupts and timers
Variables
Dashboard image (Game data)
The binary for the dashboard image
MESS1 (Loader)
The OS command string for loading the BDATA binary
MESS2 (Loader)
The OS command string for loading the main game code binary
MESS3 (Loader)
The OS command string for changing the disc directory to E
Main loop
The core loop that runs Elite
Subroutines
Main flight loop (Part 1 of 16)
Seed the random number generator
Main flight loop (Part 2 of 16)
Calculate the alpha and beta angles from the current pitch and roll of our ship
Main flight loop (Part 3 of 16)
Scan for flight keys and process the results
Main flight loop (Part 4 of 16)
For each nearby ship: Copy the ship's data block from K% to the zero-page workspace at INWK
Main flight loop (Part 5 of 16)
For each nearby ship: If an energy bomb has been set off, potentially kill this ship
Main flight loop (Part 6 of 16)
For each nearby ship: Move the ship in space and copy the updated INWK data block back to K%
Main flight loop (Part 7 of 16)
For each nearby ship: Check whether we are docking, scooping or colliding with it
Main flight loop (Part 8 of 16)
For each nearby ship: Process us potentially scooping this item
Main flight loop (Part 9 of 16)
For each nearby ship: If it is a space station, check whether we are successfully docking with it
Main flight loop (Part 10 of 16)
For each nearby ship: Remove if scooped, or process collisions
Main flight loop (Part 11 of 16)
For each nearby ship: Process missile lock and firing our laser
Main flight loop (Part 12 of 16)
For each nearby ship: Draw the ship, remove if killed, loop back
Main flight loop (Part 13 of 16)
Show energy bomb effect, charge shields and energy banks
Main flight loop (Part 14 of 16)
Spawn a space station if we are close enough to the planet
Main flight loop (Part 15 of 16)
Perform altitude checks with the planet and sun and process fuel scooping if appropriate
Main flight loop (Part 16 of 16)
Process laser pulsing, E.C.M. energy drain, call stardust routine
Main game loop (Part 1 of 6)
Spawn a trader (a Cobra Mk III, Python, Boa or Anaconda)
Main game loop (Part 2 of 6) *
Call the main flight loop, and potentially spawn a trader, an asteroid, or a cargo canister
Main game loop (Part 3 of 6)
Potentially spawn a cop, particularly if we've been bad
Main game loop (Part 4 of 6)
Potentially spawn a lone bounty hunter, a Thargoid, or up to four pirates
Main game loop (Part 5 of 6)
Cool down lasers, make calls to update the dashboard
Main game loop (Part 6 of 6)
Process non-flight key presses (red function keys, docked keys)
Market
Market prices, selling, buying and inventory
Subroutines
dn
Print the amount of money we have left in the cash pot, then make a short, high beep and delay for 1 second
gnum
Get a number from the keyboard
NWDAV4
Print an "ITEM?" error, make a beep and rejoin the TT210 routine
tnpr
Work out if we have space for a specific amount of cargo
tnpr1
Work out if we have space for one tonne of cargo
TT151
Print the name, price and availability of a market item
TT152
Print the unit ("t", "kg" or "g") for a market item
TT160
Print "t" (for tonne) and a space
TT161
Print "kg" (for kilograms)
TT163
Print the headers for the table of market prices
TT167 *
Show the Market Price screen (red key f7)
TT16a
Print "g" (for grams)
TT208 *
Show the Sell Cargo screen (red key f2)
TT210
Show a list of current cargo in our hold, optionally to sell
TT213 *
Show the Inventory screen (red key f9)
TT219 *
Show the Buy Cargo screen (red key f1)
var
Calculate QQ19+3 = economy * |economic_factor|
Variables
QQ23
Market prices table
Macros
ITEM
Macro definition for the market prices table
Maths (Arithmetic)
Addition, subtraction, multiplication, division
Subroutines
ADD *
Calculate (A X) = (A P) + (S R)
ADDK
Calculate (A X) = (A P) + (S R)
DORND *
Generate random numbers
DORND (Loader) *
Generate random numbers
DV41
Calculate (P R) = 256 * DELTA / A
DV42
Calculate (P R) = 256 * DELTA / z_hi
DVID3B2
Calculate K(3 2 1 0) = (A P+1 P) / (z_sign z_hi z_lo)
DVID4 *
Calculate (P R) = 256 * A / Q
DVID4K
Calculate (P R) = 256 * A / Q
DVIDT
Calculate (P+1 A) = (A P) / Q
FMLTU
Calculate A = A * Q / 256
FMLTU2
Calculate A = K * sin(A)
GC2
Calculate (Y X) = (A P) * 4
GCASH
Calculate (Y X) = P * Q * 4
LCASH
Subtract an amount of cash from the cash pot
LL120
Calculate (Y X) = (S x1_lo) * XX12+2 or (S x1_lo) / XX12+2
LL123
Calculate (Y X) = (S R) / XX12+2 or (S R) * XX12+2
LL129
Calculate Q = XX12+2, A = S EOR XX12+3 and (S R) = |S R|
LL28
Calculate R = 256 * A / Q
LL38
Calculate (S A) = (S R) + (A Q)
LL5
Calculate Q = SQRT(R Q)
LL61
Calculate (U R) = 256 * A / Q
LL62
Calculate 128 - (U R)
MAD
Calculate (A X) = Q * A + (S R)
MAS3
Calculate A = x_hi^2 + y_hi^2 + z_hi^2 in the K% block
MCASH
Add an amount of cash to the cash pot
MLS1
Calculate (A P) = ALP1 * A
MLS2
Calculate (S R) = XX(1 0) and (A P) = A * ALP1
MLTU2
Calculate (A P+1 P) = (A ~P) * Q
MLU1
Calculate Y1 = y_hi and (A P) = |y_hi| * Q for Y-th stardust
MLU2
Calculate (A P) = |A| * Q
MU1
Copy X into P and A, and clear the C flag
MU11
Calculate (A P) = P * X
MU5
Set K(3 2 1 0) = (A A A A) and clear the C flag
MU6
Set P(1 0) = (A A)
MULT1
Calculate (A P) = Q * A
MULT12
Calculate (S R) = Q * A
MULT3
Calculate K(3 2 1 0) = (A P+1 P) * Q
MULTU *
Calculate (A P) = P * Q
MUT1
Calculate R = XX and (A P) = Q * A
MUT2
Calculate (S R) = XX(1 0) and (A P) = Q * A
MUT3
An unused routine that does the same as MUT2
PIX1
Calculate (YY+1 SYL+Y) = (A P) + (S R) and draw stardust particle
ROOT (Loader)
Calculate ZP = SQRT(ZP(1 0))
SPS2
Calculate (Y X) = A / 10
SQUA
Clear bit 7 of A and calculate (A P) = A * A
SQUA2
Calculate (A P) = A * A
SQUA2 (Loader)
Calculate (A P) = A * A
TAS1
Calculate K3 = (x_sign x_hi x_lo) - V(1 0)
TIS1
Calculate (A ?) = (-X * A + (S R)) / 96
TIS2
Calculate A = A / Q
TIS3
Calculate -(nosev_1 * roofv_1 + nosev_2 * roofv_2) / nosev_3
VCSU1
Calculate vector K3(8 0) = [x y z] - coordinates of the sun or space station
VCSUB
Calculate vector K3(8 0) = [x y z] - coordinates in (A V)
Variables
alogh
Binary antilogarithm table
log
Binary logarithm table (high byte)
logL
Binary logarithm table (low byte)
Maths (Geometry)
Vectors, coordinates, dot products and matrices
Subroutines
ARCTAN
Calculate A = arctan(P / Q)
FAROF
Compare x_hi, y_hi and z_hi with 224
FAROF2
Compare x_hi, y_hi and z_hi with A
LL51
Calculate the dot product of XX15 and XX16
MAS1
Add an orientation vector coordinate to an INWK coordinate
MAS2
Calculate a cap on the maximum distance to the planet or sun
MAS4
Calculate a cap on the maximum distance to a ship
NORM *
Normalise the three-coordinate vector in XX15
PROJ
Project the current ship or planet onto the screen
SCALEX
Scale the x-coordinate in A
SCALEY
Scale the y-coordinate in A
SCALEY2
Scale the y-coordinate in A
SPS1
Calculate the vector to the planet and store it in XX15
SPS3
Copy a space coordinate from the K% block into K3
SPS4
Calculate the vector to the space station
TAS2
Normalise the three-coordinate vector in K3
TAS3
Calculate the dot product of XX15 and an orientation vector
TAS4
Calculate the dot product of XX15 and one of the space station's orientation vectors
TAS6
Negate the vector in XX15 so it points in the opposite direction
TIDY *
Orthonormalise the orientation vectors for a ship
Variables
ACT (Game data)
Arctan table
SNE (Game data)
Sine/cosine table
Missions
Hunting stolen ships and evading Thargoids
Subroutines
BRIEF
Start mission 1 and show the mission briefing
BRIEF2
Start mission 2
BRIEF3
Receive the briefing and plans for mission 2
BRIS
Clear the screen, display "INCOMING MESSAGE" and wait for 2 seconds
BRP
Print an extended token and show the Status Mode screen
DEBRIEF
Finish mission 1
DEBRIEF2
Finish mission 2
PAS1
Display a rotating ship at space coordinates (0, 120, 256) and scan the keyboard
PAUSE
Display a rotating ship, waiting until a key is pressed, then remove the ship from the screen
TBRIEF
Start mission 3
THERE
Check whether we are in the Constrictor's system in mission 1
Moving
Moving and rotating ships and planets in space
Subroutines
MV40
Rotate the planet or sun's location in space by the amount of pitch and roll of our ship
MVEIT (Part 1 of 9)
Move current ship: Tidy the orientation vectors
MVEIT (Part 2 of 9)
Move current ship: Call tactics routine, remove ship from scanner
MVEIT (Part 3 of 9)
Move current ship: Move ship forward according to its speed
MVEIT (Part 4 of 9)
Move current ship: Apply acceleration to ship's speed as a one-off
MVEIT (Part 5 of 9)
Move current ship: Rotate ship's location by our pitch and roll
MVEIT (Part 6 of 9)
Move current ship: Move the ship in space according to our speed
MVEIT (Part 7 of 9)
Move current ship: Rotate ship's orientation vectors by pitch/roll
MVEIT (Part 8 of 9)
Move current ship: Rotate ship about itself by its own pitch/roll
MVEIT (Part 9 of 9)
Move current ship: Redraw on scanner, if it hasn't been destroyed
MVS4 *
Apply pitch and roll to an orientation vector
MVS5
Apply a 3.6 degree pitch or roll to an orientation vector
MVT1
Calculate (x_sign x_hi x_lo) = (x_sign x_hi x_lo) + (A R)
MVT3
Calculate K(3 2 1) = (x_sign x_hi x_lo) + K(3 2 1)
MVT6
Calculate (A P+2 P+1) = (x_sign x_hi x_lo) + (A P+2 P+1)
SFS2
Move a ship in space along one of the coordinate axes
Save and load
Commander files and competition codes
Subroutines
CATS
Ask for a disc drive number and print a catalogue of that drive
CHECK
Calculate the checksum for the last saved commander data block
COLD
Set the standard BRKV handler for the game
DELT
Catalogue a disc, ask for a filename to delete, and delete the file
FILEPR
Display the currently selected media (disc or tape)
GTDIR
Fetch the name of an ADFS directory on the Master Compact and change to that directory
GTDRV
Get an ASCII disc drive number from the keyboard
GTNMEW
Fetch the name of a commander file to save or load
JAMESON
Restore the default JAMESON commander
LOD *
Load a commander file
OTHERFILEPR
Display the non-selected media (disc or tape)
rfile
Load the commander file
SVE *
Display the disc access menu and process saving of commander files
TR1
Copy the last saved commander's name from NA% to INWK
TRNME
Copy the last saved commander's name from INWK to NA%
wfile
Save the commander file
Variables
CHK
First checksum byte for the saved commander data file
CHK2
Second checksum byte for the saved commander data file
CTLI
The OS command string for cataloguing a disc
DELI
The OS command string for deleting a file
DIRI
The OS command string for changing directory on the Master Compact
lodosc
The OS command string for loading a commander file
NA%
The data block for the last saved commander
NA2%
The data block for the default commander
oldlong
Contains the length of the last saved commander name
S1%
The drive and directory number used when saving or loading a commander file
savosc
The OS command string for saving a commander file
stackpt
Temporary storage for the stack pointer when jumping to the break handler at NEWBRK
thislong
Contains the length of the most recently entered commander name
Ship hangar
The ship hangar that's displayed on docking
Subroutines
HAL3
Draw a hangar background line from left to right, stopping when it bumps into existing on-screen content
HALL
Draw the ships in the ship hangar, then draw the hangar
HANGER
Display the ship hangar
HAS1
Draw a ship in the ship hangar
HAS2
Draw a hangar background line from left to right
HAS3
Draw a hangar background line from right to left
Variables
HANGFLAG
The number of ships being displayed in the ship hangar
HATB
Ship hangar group table
Sound
Explosions, laser fire, hyperspace and more
Subroutines
BEEP
Make a short, high beep
BELL
Make a standard system beep
BOOP
Make a long, low beep
ECMOF
Switch off the E.C.M.
ELASNO
Make the sound of us being hit
EXNO
Make the sound of a laser strike or ship explosion
EXNO3
Make an explosion sound
LASNO
Make the sound of our laser firing
NOISE *
Make the sound whose number is in Y by populating the sound buffer
SOFLUSH
Reset the sound buffer and turn off all sound channels
SOINT
Process the contents of the sound buffer and send it to the sound chip
SOUS1
Write sound data directly to the 76489 sound chip
Variables
SFXBT
Sound data block 2
SFXFQ
Sound data block 3
SFXPR
Sound data block 1
SFXVC
Sound data block 4
SOFH
Sound chip data mask for choosing a tone channel in the range 0-2
SOFLG
The sound buffer where the data to be sent to the sound chip is processed
SOOFF
Sound chip data to turn the volume down on all channels and to act as a mask for choosing a tone channel in the range 0-2
Stardust
Stardust generation and movement
Subroutines
FLIP
Reflect the stardust particles in the screen diagonal and redraw the stardust field
nWq
Create a random cloud of stardust
NWSTARS
Initialise the stardust field
STARS *
The main routine for processing the stardust
STARS1
Process the stardust for the front view
STARS2
Process the stardust for the left or right view
STARS6
Process the stardust for the rear view
Start and end
The title screen... and the Game Over screen
Subroutines
BR1 (Part 1 of 2)
Show the "Load New Commander (Y/N)?" screen and start the game
BR1 (Part 2 of 2)
Show the "Press Fire or Space, Commander" screen and start the game
DEATH *
Display the death screen
DEATH2
Reset most of the game and restart from the title screen
DFAULT
Reset the current commander data block to the last saved commander
RES2
Reset a number of flight variables and workspaces
RESET
Reset most variables
TITLE *
Display a title screen with a rotating ship and prompt
TT170 *
Main entry point for the Elite game code
Status
Showing the commander's status and rank
Subroutines
BAD
Calculate how bad we have been
BAY
Go to the docking bay (i.e. show the Status Mode screen)
cmn
Print the commander's name
csh
Print the current amount of cash
EXNO2
Process us making a kill
fwl
Print fuel and cash levels
STATUS *
Show the Status Mode screen (red key f8)
Variables
KWH% (Game data)
Integer number of kills awarded for destroying each type of ship
KWL% (Game data)
Fractional number of kills awarded for destroying each type of ship
Tactics
AI tactics for enemy ships and missiles
Subroutines
ANGRY
Make a ship hostile
FR1
Display the "missile jammed" message
FRMIS
Fire a missile from our ship
FRS1
Launch a ship straight ahead of us, below the laser sights
HITCH *
Work out if the ship in INWK is in our crosshairs
SFRMIS
Add an enemy missile to our local bubble of universe
TACTICS (Part 1 of 7)
Apply tactics: Process missiles, both enemy missiles and our own
TACTICS (Part 2 of 7) *
Apply tactics: Escape pod, station, lone Thargon, safe-zone pirate
TACTICS (Part 3 of 7)
Apply tactics: Calculate dot product to determine ship's aim
TACTICS (Part 4 of 7)
Apply tactics: Check energy levels, maybe launch escape pod if low
TACTICS (Part 5 of 7)
Apply tactics: Consider whether to launch a missile at us
TACTICS (Part 6 of 7)
Apply tactics: Consider firing a laser at us, if aim is true
TACTICS (Part 7 of 7)
Apply tactics: Set pitch, roll, and acceleration
yetanotherrts
Contains an RTS
Text
The game's recursive text tokenisation system
Subroutines
BPRNT *
Print a 32-bit number, left-padded to a specific number of digits, with an optional decimal point
CHPR
Print a character at the text cursor by poking into screen memory
crlf
Tab to column 21 and print a colon
DETOK
Print an extended recursive token from the TKN1 token table
DETOK2
Print an extended text token (1-255)
DETOK3
Print an extended recursive token from the RUTOK token table
dn2
Make a short, high beep and delay for 0.5 seconds
DOXC
Move the text cursor to a specific column
DOYC
Move the text cursor to a specific row
ex
Print a recursive token
FEED
Print a newline
INCYC
Move the text cursor to the next row
MT1
Switch to ALL CAPS when printing extended tokens
MT13
Switch to lower case when printing extended tokens
MT14
Switch to justified text when printing extended tokens
MT15
Switch to left-aligned text when printing extended tokens
MT16
Print the character in variable DTW7
MT17
Print the selected system's adjective, e.g. Lavian for Lave
MT18
Print a random 1-8 letter word in Sentence Case
MT19
Capitalise the next letter
MT2
Switch to Sentence Case when printing extended tokens
MT23
Move to row 10, switch to white text, and switch to lower case when printing extended tokens
MT26
Fetch a line of text from the keyboard
MT27
Print the captain's name during mission briefings
MT28
Print the location hint during the mission 1 briefing
MT29
Move to row 6, switch to white text, and switch to lower case when printing extended tokens
MT5
Switch to extended tokens
MT6
Switch to standard tokens in Sentence Case
MT8
Tab to column 6 and start a new word when printing extended tokens
MT9
Clear the screen and set the current view type to 1
NUMBOR
An unused routine that prints a number in hexadecimal
OUTX
Print the character in Q before returning to gnum
plf
Print a text token followed by a newline
plf2
Print text followed by a newline and indent of 6 characters
pr2
Print an 8-bit number, left-padded to 3 digits, and optional point
pr5
Print a 16-bit number, left-padded to 5 digits, and optional point
pr6
Print 16-bit number, left-padded to 5 digits, no point
prq
Print a text token followed by a question mark
qw
Print a recursive token in the range 128-145
spc
Print a text token followed by a space
TT11
Print a 16-bit number, left-padded to n digits, and optional point
TT162
Print a space
TT26 *
Print a character at the text cursor, with support for verified text in extended tokens
TT27 *
Print a text token
TT41
Print a letter according to Sentence Case
TT42
Print a letter in lower case
TT43
Print a two-letter token or recursive token 0-95
TT45
Print a letter in lower case
TT46
Print a character and switch to capitals
TT60
Print a text token and a paragraph break
TT67
Print a newline
TT67X
Print a newline
TT68
Print a text token followed by a colon
TT69
Set Sentence Case and print a newline
TT73
Print a colon
TT74
Print a character
TTX69
Print a paragraph break
VOWEL
Test whether a character is a vowel
Variables
DTW1
A mask for applying the lower case part of Sentence Case to extended text tokens
DTW2
A flag that indicates whether we are currently printing a word
DTW3
A flag for switching between standard and extended text tokens
DTW4
Flags that govern how justified extended text tokens are printed
DTW5
The size of the justified text buffer at BUF
DTW6
A flag to denote whether printing in lower case is enabled for extended text tokens
DTW8
A mask for capitalising the next letter in an extended text token
FONT%
A copy of the character definition bitmap table from the MOS ROM
JMTB
The extended token table for jump tokens 1-32 (DETOK)
MTIN
Lookup table for random tokens in the extended token table (0-37)
QQ16
The two-letter token lookup table
QQ18 (Game data)
The recursive token table for tokens 0-148
RLINE
The OSWORD configuration block used to fetch a line of text from the keyboard
RUGAL (Game data)
The criteria for systems with extended description overrides
RUPLA (Game data)
System numbers that have extended description overrides
RUTOK (Game data)
The second extended token table for recursive tokens 0-26 (DETOK3)
TENS
A constant used when printing large numbers in BPRNT
TKN1 (Game data)
The first extended token table for recursive tokens 0-255 (DETOK)
TKN2
The extended two-letter token lookup table
Macros
CHAR (Game data)
Macro definition for characters in the recursive token table
CONT (Game data)
Macro definition for control codes in the recursive token table
ECHR (Game data)
Macro definition for characters in the extended token table
EJMP (Game data)
Macro definition for jump tokens in the extended token table
ERND (Game data)
Macro definition for random tokens in the extended token table
ETOK (Game data)
Macro definition for recursive tokens in the extended token table
ETWO (Game data)
Macro definition for two-letter tokens in the extended token table
RTOK (Game data)
Macro definition for recursive tokens in the recursive token table
TOKN (Game data)
Macro definition for standard tokens in the extended token table
TWOK (Game data)
Macro definition for two-letter tokens in the token table
Universe
Ship spawning, local bubble, system/market data
Subroutines
cpl
Print the selected system name
GINF
Fetch the address of a ship's data block into INF
GTHG
Spawn a Thargoid ship and a Thargon companion
GVL
Calculate the availability of market items
hyp1
Process a jump to the system closest to (QQ9, QQ10)
jmp
Set the current system to the selected system
KILLSHP *
Remove a ship from our local bubble of universe
KS1
Remove the current ship from our local bubble of universe
KS2
Check the local bubble for missiles with target lock
KS3
Set the SLSP ship line heap pointer after shuffling ship slots
KS4
Remove the space station and replace it with the sun
NwS1
Flip the sign and double an INWK byte
NWSHP
Add a new ship to our local bubble of universe
NWSPS
Add a new space station to our local bubble of universe
PDESC
Print the system's extended description or a mission 1 directive
ping
Set the selected system to the current system
SFS1 *
Spawn a child ship from the current (parent) ship
SOLAR
Set up various aspects of arriving in a new system
SOS1
Update the missile indicators, set up the planet data block
SPIN
Randomly spawn cargo from a destroyed ship
tal
Print the current galaxy number
TT111
Set the current system to the nearest system to a point
TT146
Print the distance to the selected system in light years
TT20
Twist the selected system's seeds four times
TT24 *
Calculate system data from the system seeds
TT25 *
Show the Data on System screen (red key f6)
TT54 *
Twist the selected system's seeds
TT70
Display "MAINLY " and jump to TT72
TT81
Set the selected system's seeds to those of system 0
ypl
Print the current system name
Ze
Initialise the INWK workspace to a hostile ship
ZINF
Reset the INWK workspace and orientation vectors
Variables
spasto
Contains the address of the Coriolis space station's ship blueprint
UNIV
Table of pointers to the local universe's ship data blocks
Utility routines
Memory/screen clearing, delay routines
Subroutines
DEEOR
Unscramble the main code
DEEORS
Decrypt a multi-page block of memory
DELAY
Wait for a specified time, in 1/50s of a second
getzp
Swap zero page (&0090 to &00EF) with the buffer at &3000
NEWBRK
The standard BRKV handler for the game
NMICLAIM
Claim the NMI workspace (&00A0 to &00A7) back from the MOS so the game can use it once again
NMIRELEASE
Release the NMI workspace (&00A0 to &00A7) so the MOS can use it and store the top part of zero page in the the buffer at &3000
OSB (Loader)
A convenience routine for calling OSBYTE with Y = 0
setzp
Copy the top part of zero page (&0090 to &00FF) into the buffer at &3000
SWAPPZERO
An unused routine that swaps bytes in zero page
ZERO
Reset the local bubble of universe and ship status
ZES1
Zero-fill the page whose number is in X
ZES2
Zero-fill a specific page
Variables
F%
Denotes the end of the main game code, from Elite A to Elite H
Workspaces
Collections of important variables into blocks
Workspaces
K% *
Ship data blocks and ship line heaps
UP
Configuration variables
WP
Ship slots, variables
XX3
Temporary storage space for complex calculations
ZP *
Lots of important variables are stored in the zero page workspace as it is quicker and more space-efficient to access memory here
ZP (Loader) *
Important variables used by the loader
Acorn Electron source code
A cut-down version for the Beeb's little brother
Version information
About the Electron version
Information on the cut-down version of Elite
Different variants of the Electron version
Code variations found in Electron Elite
Acorn Electron source code by file
Map of the source code
An overview of how the source code for Elite is structured
Annotated original source files
The source files in their original structure
Game loader
Loader source
The loading screen, copy protection and set-up for the main game
Main game
Workspaces and configuration
The main variable workspaces used in Elite
Text tokens
Elite's tokenised game text
Elite A source
Part 1 of the main game code
Elite B source
Part 2 of the main game code
Elite C source
Part 3 of the main game code
Elite D source
Part 4 of the main game code
Elite E source
Part 5 of the main game code
Elite F source
Part 6 of the main game code
Elite G source
Part 7 of the main game code
Ship blueprints
Data for the 11 different ship designs
Big Code File
Big Code File source
Concatenates the individual source code parts into one big game file
Acorn Electron source code by category
Charts
Long-range and short-range galactic charts
Subroutines
hm
Select the closest system and redraw the chart crosshairs
TT103
Draw a small set of crosshairs on a chart
TT105
Draw crosshairs on the Short-range Chart, with clipping
TT114
Display either the Long-range or Short-range Chart
TT123
Move galactic coordinates by a signed delta
TT16
Move the crosshairs on a chart
TT22 *
Show the Long-range Chart (FUNC-5)
TT23 *
Show the Short-range Chart (FUNC-6)
Copy protection
Hiding the Elite code from prying eyes
Subroutines
BEGIN% (Loader)
Single-byte decryption and copying routine, run on the stack
crunchit (Loader)
Multi-byte decryption and copying routine
David7 (Loader)
Part of the multi-jump obfuscation code in PROT1
doPROT1 (Loader) *
Routine to self-modify the loader code
swine (Loader)
Resets the machine if the copy protection detects a problem
Variables
Authors' names
The authors' names and a copyright notice, buried in the code
Authors' names (Loader)
The authors' names, buried in the code
checksum0
Checksum for the entire main game code
David23 (Loader)
Address pointer to the start of the 6502 stack
David9 (Loader)
Address used as part of the stack-based decryption loop
MHCA (Loader)
Used to set one of the vectors in the copy protection code
Dashboard
The dials, 3D scanner and compass
Subroutines
ABORT
Disarm missiles and update the dashboard indicators
ABORT2
Set/unset the lock target for a missile and update the dashboard
BULB
Draw an indicator bulb on the dashboard
BUMP2
Bump up the value of the pitch or roll dashboard indicator
cntr
Apply damping to the pitch or roll dashboard indicator
COMPAS *
Update the compass
DIALS (Part 1 of 4)
Update the dashboard: speed indicator
DIALS (Part 2 of 4)
Update the dashboard: pitch and roll indicators
DIALS (Part 3 of 4)
Update the dashboard: four energy banks
DIALS (Part 4 of 4)
Update the dashboard: shields, fuel, laser & cabin temp, altitude
DIL2
Update the roll or pitch indicator on the dashboard
DILX *
Update a bar-based indicator on the dashboard
DOT
Draw a dash on the compass
ECBLB
Light up the E.C.M. indicator bulb ("E") on the dashboard
ECBLB2
Start up the E.C.M. (light up the indicator, start the countdown and make the E.C.M. sound)
MSBAR
Draw a specific indicator in the dashboard's missile bar
msblob
Display the dashboard's missile indicators as white squares
REDU2
Reduce the value of the pitch or roll dashboard indicator
SCAN *
Display the current ship on the scanner
SP1
Draw the space station on the compass
SP2
Draw a dot on the compass, given the planet/station vector
SPBLB
Light up the space station indicator ("S") on the dashboard
WPSHPS
Clear the scanner and reset the ball line heap
Variables
ECBT
The character bitmap for the E.C.M. indicator bulb
MDIALS
The missile indicator bitmaps for the monochrome dashboard
SPBT
The bitmap definition for the space station indicator bulb
Drawing circles
Hyperspace tunnels, launch rings and planets
Subroutines
BLINE *
Draw a circle segment and add it to the ball line heap
CHKON
Check whether any part of a circle appears on the extended screen
CIRCLE
Draw a circle for the planet
CIRCLE2 *
Draw a circle (for the planet or chart)
HFS2 *
Draw the launch or hyperspace tunnel
LAUN
Make the launch sound and draw the launch tunnel
LL164
Make the hyperspace sound and draw the hyperspace tunnel
TT128 *
Draw a circle on a chart
TT14
Draw a circle with crosshairs on a chart
Drawing lines
The core line-drawing routines
Subroutines
HLOIN *
Draw a horizontal line from (X1, Y1) to (X2, Y1)
LASLI
Draw the laser lines for when we fire our lasers
LL118
Move a point along a line until it is on-screen
LL145 (Part 1 of 4) *
Clip line: Work out which end-points are on-screen, if any
LL145 (Part 2 of 4)
Clip line: Work out if any part of the line is on-screen
LL145 (Part 3 of 4)
Clip line: Calculate the line's gradient
LL145 (Part 4 of 4)
Clip line: Call the routine in LL188 to do the actual clipping
LOIN (Part 1 of 7) *
Draw a line: Calculate the line gradient in the form of deltas
LOIN (Part 2 of 7)
Draw a line: Line has a shallow gradient, step right along x-axis
LOIN (Part 3 of 7)
Draw a shallow line going right and up or left and down
LOIN (Part 4 of 7)
Draw a shallow line going right and down or left and up
LOIN (Part 5 of 7)
Draw a line: Line has a steep gradient, step up along y-axis
LOIN (Part 6 of 7)
Draw a steep line going up and left or down and right
LOIN (Part 7 of 7)
Draw a steep line going up and right or down and left
NLIN
Draw a horizontal line at pixel row 23 to box in a title
NLIN2
Draw a screen-wide horizontal line at the pixel row in A
NLIN3
Print a title and draw a horizontal line at row 19 to box it in
NLIN4
Draw a horizontal line at pixel row 19 to box in a title
TT15
Draw a set of crosshairs
Drawing pixels
How to plot pixels in various colours
Subroutines
CPIX2 *
Draw a single-height dash on the dashboard
CPIX4
Draw a double-height dot on the dashboard
PIX (Loader)
Draw a single pixel at a specific coordinate
PIXEL *
Draw a 1-pixel dot, 2-pixel dash or 4-pixel square
PIXEL2
Draw a stardust particle relative to the screen centre
Variables
CTWOS
Ready-made double-pixel character row bytes for the mode 4 dashboard
TWOS
Ready-made single-pixel character row bytes for mode 4
TWOS (Loader)
Ready-made single-pixel character row bytes for mode 4
TWOS2
Ready-made double-pixel character row bytes for mode 4
Drawing planets
Planets with meridians and craters
Subroutines
PL2
Remove the planet from the screen
PL21
Return from a planet-drawing routine with a failure flag
PLANET
Draw the planet
PLL1 (Part 1 of 3) (Loader)
Draw Saturn on the loading screen (draw the planet)
PLL1 (Part 2 of 3) (Loader)
Draw Saturn on the loading screen (draw the stars)
PLL1 (Part 3 of 3) (Loader)
Draw Saturn on the loading screen (draw the rings)
PLS6
Calculate (X K) = (A P) / (z_sign z_hi z_lo)
WP1
Reset the ball line heap
WPLS2
Remove the planet from the screen
Variables
CNT (Loader)
A counter for use in drawing Saturn's planetary body
CNT2 (Loader)
A counter for use in drawing Saturn's background stars
CNT3 (Loader)
A counter for use in drawing Saturn's rings
Drawing ships
The celebrated 3D ship plotting process
Subroutines
DOEXP *
Draw an exploding ship
LL9 (Part 1 of 12)
Draw ship: Check if ship is exploding, check if ship is in front
LL9 (Part 2 of 12)
Draw ship: Check if ship is in field of view, close enough to draw
LL9 (Part 3 of 12)
Draw ship: Set up orientation vector, ship coordinate variables
LL9 (Part 4 of 12)
Draw ship: Set visibility for exploding ship (all faces visible)
LL9 (Part 5 of 12)
Draw ship: Calculate the visibility of each of the ship's faces
LL9 (Part 6 of 12)
Draw ship: Calculate the visibility of each of the ship's vertices
LL9 (Part 7 of 12)
Draw ship: Calculate the visibility of each of the ship's vertices
LL9 (Part 8 of 12)
Draw ship: Calculate the screen coordinates of visible vertices
LL9 (Part 9 of 12)
Draw ship: Draw laser beams if the ship is firing its laser at us
LL9 (Part 10 of 12)
Draw ship: Calculate the visibility of each of the ship's edges
LL9 (Part 11 of 12)
Draw ship: Add all visible edges to the ship line heap
LL9 (Part 12 of 12)
Draw ship: Draw all the visible edges from the ship line heap
SHPPT
Draw a distant ship as a point rather than a full wireframe
Variables
SHIP_ASTEROID
Ship blueprint for an asteroid
SHIP_CANISTER
Ship blueprint for a cargo canister
SHIP_COBRA_MK_3
Ship blueprint for a Cobra Mk III
SHIP_CORIOLIS
Ship blueprint for a Coriolis space station
SHIP_ESCAPE_POD
Ship blueprint for an escape pod
SHIP_MAMBA
Ship blueprint for a Mamba
SHIP_MISSILE
Ship blueprint for a missile
SHIP_PYTHON
Ship blueprint for a Python
SHIP_SIDEWINDER
Ship blueprint for a Sidewinder
SHIP_VIPER
Ship blueprint for a Viper
XX21
Ship blueprints lookup table
Macros
EDGE
Macro definition for adding edges to ship blueprints
FACE
Macro definition for adding faces to ship blueprints
VERTEX
Macro definition for adding vertices to ship blueprints
Drawing the screen
The mode 4 screen and configuring screen views
Subroutines
CLYNS
Clear the bottom three text rows of the mode 4 screen
LYN
Clear most of a row of pixels
NEXTR
Move to the next character row in the Electron mode 4 screen
TT66
Clear the screen and set the current view type
TTX66
Clear the top part of the screen and draw a white border
Variables
B% (Loader)
VDU commands for changing to a standard mode 4 screen
Equipment
Buying and selling weapons and ship upgrades
Subroutines
eq
Subtract the price of equipment from the cash pot
EQSHP *
Show the Equip Ship screen (FUNC-4)
prx
Return the price of a piece of equipment
qv
Print a menu of the four space views, for buying lasers
Variables
PRXS
Equipment prices
Flight
Docking, hyperspace, views, shields and more
Subroutines
DENGY
Drain some energy from the energy banks
ee3
Print the hyperspace countdown in the top-left of the screen
ESCAPE
Launch our escape pod
Ghy
Perform a galactic hyperspace jump
hy6
Print a message to say there is no hyperspacing allowed inside the station
hyp
Start the hyperspace process
LOOK1
Initialise the space view
me1
Erase an old in-flight message and display a new one
me2
Remove an in-flight message from the space view
mes9
Print a text token, possibly followed by " DESTROYED"
MESS
Display an in-flight message
OOPS
Take some damage
ou2
Display "E.C.M.SYSTEM DESTROYED" as an in-flight message
ou3
Display "FUEL SCOOPS DESTROYED" as an in-flight message
OUCH
Potentially lose cargo or equipment following damage
PLUT *
Flip the coordinate axes for the four different views
SESCP
Spawn an escape pod from the current (parent) ship
SHD
Charge a shield and drain some energy from the energy banks
SIGHT
Draw the laser crosshairs
TT110
Launch from a station or show the front space view
TT147
Print an error when a system is out of hyperspace range
TT18
Try to initiate a jump into hyperspace
WARP *
Perform an in-system jump
wW
Start a hyperspace countdown
Keyboard
Processing key presses and joysticks
Subroutines
DK4
Scan for pause, configuration and secondary flight keys
DKS2
Read the joystick position
DKS3
Toggle a configuration setting and emit a beep
DKS4
Scan the keyboard to see if a specific key is being pressed
DOKEY *
Scan for the seven primary flight controls
FLKB
Flush the keyboard buffer
KEY1
The main keyboard interrupt handler (KEYV points here)
RDKEY
Scan the keyboard for key presses
TT102 *
Process function key, save key, hyperspace and chart key presses and update the hyperspace counter
TT17
Scan the keyboard for cursor key movement
TT214
Ask a question with a "Y/N?" prompt and return the response
TT217
Scan the keyboard until a key is pressed
U%
Clear the key logger
Variables
KYTB
Lookup table for in-flight keyboard controls
Loader
The loading screen and system setup
Subroutines
Elite loader (Part 1 of 5) (Loader)
Include binaries for recursive tokens and images
Elite loader (Part 2 of 5) (Loader)
Perform a number of OS calls, set up sound, push routines on stack
Elite loader (Part 3 of 5) (Loader)
Move recursive tokens and images
Elite loader (Part 4 of 5) (Loader)
Call part 5 of the loader now that is has been relocated
Elite loader (Part 5 of 5) (Loader)
Set up interrupt vectors, calculate checksums, run main game code
Main loop
The core loop that runs Elite
Subroutines
Main flight loop (Part 1 of 16)
Seed the random number generator
Main flight loop (Part 2 of 16)
Calculate the alpha and beta angles from the current pitch and roll of our ship
Main flight loop (Part 3 of 16)
Scan for flight keys and process the results
Main flight loop (Part 4 of 16)
For each nearby ship: Copy the ship's data block from K% to the zero-page workspace at INWK
Main flight loop (Part 5 of 16)
For each nearby ship: If an energy bomb has been set off, potentially kill this ship
Main flight loop (Part 6 of 16)
For each nearby ship: Move the ship in space and copy the updated INWK data block back to K%
Main flight loop (Part 7 of 16)
For each nearby ship: Check whether we are docking, scooping or colliding with it
Main flight loop (Part 8 of 16)
For each nearby ship: Process us potentially scooping this item
Main flight loop (Part 9 of 16)
For each nearby ship: If it is a space station, check whether we are successfully docking with it
Main flight loop (Part 10 of 16)
For each nearby ship: Remove if scooped, or process collisions
Main flight loop (Part 11 of 16)
For each nearby ship: Process missile lock and firing our laser
Main flight loop (Part 12 of 16)
For each nearby ship: Draw the ship, remove if killed, loop back
Main flight loop (Part 13 of 16)
Show energy bomb effect, charge shields and energy banks
Main flight loop (Part 14 of 16)
Spawn a space station if we are close enough to the planet
Main flight loop (Part 15 of 16)
Perform altitude checks with the planet
Main flight loop (Part 16 of 16)
Process laser pulsing, E.C.M. energy drain, call stardust routine
Main game loop (Part 1 of 6)
Spawn a trader (a peaceful Cobra Mk III)
Main game loop (Part 2 of 6) *
Call the main flight loop, and potentially spawn a trader, an asteroid, or a cargo canister
Main game loop (Part 3 of 6)
Potentially spawn a cop, particularly if we've been bad
Main game loop (Part 4 of 6)
Potentially spawn a lone bounty hunter or up to four pirates
Main game loop (Part 5 of 6)
Cool down lasers, make calls to update the dashboard
Main game loop (Part 6 of 6)
Process non-flight key presses (FUNC keys, docked keys)
Market
Market prices, selling, buying and inventory
Subroutines
dn
Print the amount of money we have left in the cash pot, then make a short, high beep and delay for 1 second
gnum
Get a number from the keyboard
tnpr
Work out if we have space for a specific amount of cargo
TT151
Print the name, price and availability of a market item
TT152
Print the unit ("t", "kg" or "g") for a market item
TT160
Print "t" (for tonne) and a space
TT161
Print "kg" (for kilograms)
TT163
Print the headers for the table of market prices
TT167 *
Show the Market Price screen (FUNC-8)
TT16a
Print "g" (for grams)
TT208 *
Show the Sell Cargo screen (FUNC-3)
TT210
Show a list of current cargo in our hold, optionally to sell
TT213 *
Show the Inventory screen (FUNC-0)
TT219 *
Show the Buy Cargo screen (FUNC-2)
var
Calculate QQ19+3 = economy * |economic_factor|
Variables
QQ23
Market prices table
Macros
ITEM
Macro definition for the market prices table
Maths (Arithmetic)
Addition, subtraction, multiplication, division
Subroutines
ADD *
Calculate (A X) = (A P) + (S R)
DORND *
Generate random numbers
DORND (Loader) *
Generate random numbers
DV41
Calculate (P R) = 256 * DELTA / A
DV42
Calculate (P R) = 256 * DELTA / z_hi
DVID3B2
Calculate K(3 2 1 0) = (A P+1 P) / (z_sign z_hi z_lo)
DVID4 *
Calculate (P R) = 256 * A / Q
DVIDT
Calculate (P+1 A) = (A P) / Q
FMLTU
Calculate A = A * Q / 256
FMLTU2
Calculate A = K * sin(A)
GC2
Calculate (Y X) = (A P) * 4
GCASH
Calculate (Y X) = P * Q * 4
LCASH
Subtract an amount of cash from the cash pot
LL120
Calculate (Y X) = (S x1_lo) * XX12+2 or (S x1_lo) / XX12+2
LL123
Calculate (Y X) = (S R) / XX12+2 or (S R) * XX12+2
LL129
Calculate Q = XX12+2, A = S EOR XX12+3 and (S R) = |S R|
LL28
Calculate R = 256 * A / Q
LL38
Calculate (S A) = (S R) + (A Q)
LL5
Calculate Q = SQRT(R Q)
LL61
Calculate (U R) = 256 * A / Q
LL62
Calculate 128 - (U R)
MAD
Calculate (A X) = Q * A + (S R)
MAS3
Calculate A = x_hi^2 + y_hi^2 + z_hi^2 in the K% block
MCASH
Add an amount of cash to the cash pot
MLS1
Calculate (A P) = ALP1 * A
MLS2
Calculate (S R) = XX(1 0) and (A P) = A * ALP1
MLTU2
Calculate (A P+1 P) = (A ~P) * Q
MLU1
Calculate Y1 = y_hi and (A P) = |y_hi| * Q for Y-th stardust
MLU2
Calculate (A P) = |A| * Q
MU1
Copy X into P and A, and clear the C flag
MU11
Calculate (A P) = P * X
MU5
Set K(3 2 1 0) = (A A A A) and clear the C flag
MU6
Set P(1 0) = (A A)
MULT1
Calculate (A P) = Q * A
MULT12
Calculate (S R) = Q * A
MULT3
Calculate K(3 2 1 0) = (A P+1 P) * Q
MULTU *
Calculate (A P) = P * Q
MUT1
Calculate R = XX and (A P) = Q * A
MUT2
Calculate (S R) = XX(1 0) and (A P) = Q * A
MUT3
An unused routine that does the same as MUT2
PIX1
Calculate (YY+1 SYL+Y) = (A P) + (S R) and draw stardust particle
ROOT (Loader)
Calculate ZP = SQRT(ZP(1 0))
SPS2
Calculate (Y X) = A / 10
SQUA
Clear bit 7 of A and calculate (A P) = A * A
SQUA2
Calculate (A P) = A * A
SQUA2 (Loader)
Calculate (A P) = A * A
TAS1
Calculate K3 = (x_sign x_hi x_lo) - V(1 0)
TIS1
Calculate (A ?) = (-X * A + (S R)) / 96
TIS2
Calculate A = A / Q
TIS3
Calculate -(nosev_1 * roofv_1 + nosev_2 * roofv_2) / nosev_3
Unused duplicate of MULTU
An unused duplicate of the MULTU routine
Maths (Geometry)
Vectors, coordinates, dot products and matrices
Subroutines
ARCTAN
Calculate A = arctan(P / Q)
FAROF
Compare x_hi, y_hi and z_hi with 224
FAROF2
Compare x_hi, y_hi and z_hi with A
LL51
Calculate the dot product of XX15 and XX16
MAS1
Add an orientation vector coordinate to an INWK coordinate
MAS2
Calculate a cap on the maximum distance to the planet
MAS4
Calculate a cap on the maximum distance to a ship
NORM *
Normalise the three-coordinate vector in XX15
PROJ
Project the current ship or planet onto the screen
SPS1
Calculate the vector to the planet and store it in XX15
SPS3
Copy a space coordinate from the K% block into K3
SPS4
Calculate the vector to the space station
TAS2
Normalise the three-coordinate vector in K3
TAS3
Calculate the dot product of XX15 and an orientation vector
TIDY *
Orthonormalise the orientation vectors for a ship
Variables
ACT
Arctan table
SNE
Sine/cosine table
Moving
Moving and rotating ships and planets in space
Subroutines
MV40
Rotate the planet's location in space by the amount of pitch and roll of our ship
MVEIT (Part 1 of 9)
Move current ship: Tidy the orientation vectors
MVEIT (Part 2 of 9)
Move current ship: Call tactics routine, remove ship from scanner
MVEIT (Part 3 of 9)
Move current ship: Move ship forward according to its speed
MVEIT (Part 4 of 9)
Move current ship: Apply acceleration to ship's speed as a one-off
MVEIT (Part 5 of 9)
Move current ship: Rotate ship's location by our pitch and roll
MVEIT (Part 6 of 9)
Move current ship: Move the ship in space according to our speed
MVEIT (Part 7 of 9)
Move current ship: Rotate ship's orientation vectors by pitch/roll
MVEIT (Part 8 of 9)
Move current ship: Rotate ship about itself by its own pitch/roll
MVEIT (Part 9 of 9)
Move current ship: Redraw on scanner, if it hasn't been destroyed
MVS4 *
Apply pitch and roll to an orientation vector
MVS5
Apply a 3.6 degree pitch or roll to an orientation vector
MVT1
Calculate (x_sign x_hi x_lo) = (x_sign x_hi x_lo) + (A R)
MVT3
Calculate K(3 2 1) = (x_sign x_hi x_lo) + K(3 2 1)
MVT6
Calculate (A P+2 P+1) = (x_sign x_hi x_lo) + (A P+2 P+1)
SFS2
Move a ship in space along one of the coordinate axes
Save and load
Commander files and competition codes
Subroutines
CHECK
Calculate the checksum for the last saved commander data block
GTNME
Fetch the name of a commander file to save or load
LOD *
Load a commander file
QUS1
Save or load the commander file
SVE *
Save the commander file
TR1
Copy the last saved commander's name from NA% to INWK
TRNME
Copy the last saved commander's name from INWK to NA%
Variables
CHK
First checksum byte for the saved commander data file
CHK2
Second checksum byte for the saved commander data file
NA%
The data block for the last saved commander
Sound
Explosions, laser fire, hyperspace and more
Subroutines
BEEP
Make a short, high beep
BELL
Make a standard system beep
ECMOF
Switch off the E.C.M.
EXNO
Make the sound of a laser strike or ship explosion
EXNO3
Make an explosion sound
NO3
Make a sound from a prepared sound block
NOISE *
Make the sound whose number is in A
NOS1
Prepare a sound block
Variables
E% (Loader)
Sound envelope definitions
SFX
Sound data
Macros
FNE (Loader)
Macro definition for defining a sound envelope
Stardust
Stardust generation and movement
Subroutines
FLIP
Reflect the stardust particles in the screen diagonal and redraw the stardust field
nWq
Create a random cloud of stardust
NWSTARS
Initialise the stardust field
STARS *
The main routine for processing the stardust
STARS1
Process the stardust for the front view
STARS2
Process the stardust for the left or right view
STARS6
Process the stardust for the rear view
Start and end
The title screen... and the Game Over screen
Subroutines
BR1 (Part 1 of 2)
Show the "Load New Commander (Y/N)?" screen and start the game
BR1 (Part 2 of 2)
Show the "Press Fire or Space, Commander" screen and start the game
DEATH *
Display the death screen
DEATH2
Reset most of the game and restart from the title screen
QU5
Reset the current commander data block to the last saved commander
RES2
Reset a number of flight variables and workspaces
RESET
Reset most variables
TITLE *
Display a title screen with a rotating ship and prompt
TT170 *
Main entry point for the Elite game code
Status
Showing the commander's status and rank
Subroutines
BAD
Calculate how bad we have been
BAY
Go to the docking bay (i.e. show the Status Mode screen)
cmn
Print the commander's name
csh
Print the current amount of cash
EXNO2
Process us making a kill
fwl
Print fuel and cash levels
STATUS *
Show the Status Mode screen (FUNC-9)
Tactics
AI tactics for enemy ships and missiles
Subroutines
ANGRY
Make a ship hostile
FR1
Display the "missile jammed" message
FRMIS
Fire a missile from our ship
FRS1
Launch a ship straight ahead of us, below the laser sights
HITCH *
Work out if the ship in INWK is in our crosshairs
SFRMIS
Add an enemy missile to our local bubble of universe
TACTICS (Part 1 of 7)
Apply tactics: Process missiles, both enemy missiles and our own
TACTICS (Part 2 of 7) *
Apply tactics: Escape pod, station, safe-zone pirate
TACTICS (Part 3 of 7)
Apply tactics: Calculate dot product to determine ship's aim
TACTICS (Part 4 of 7)
Apply tactics: Check energy levels, maybe launch escape pod if low
TACTICS (Part 5 of 7)
Apply tactics: Consider whether to launch a missile at us
TACTICS (Part 6 of 7)
Apply tactics: Consider firing a laser at us, if aim is true
TACTICS (Part 7 of 7)
Apply tactics: Set pitch, roll, and acceleration
Text
The game's recursive text tokenisation system
Subroutines
BPRNT *
Print a 32-bit number, left-padded to a specific number of digits, with an optional decimal point
crlf
Tab to column 21 and print a colon
dn2
Make a short, high beep and delay for 1 second
ex
Print a recursive token
plf
Print a text token followed by a newline
plf2
Print text followed by a newline and indent of 6 characters
pr2
Print an 8-bit number, left-padded to 3 digits, and optional point
pr5
Print a 16-bit number, left-padded to 5 digits, and optional point
pr6
Print 16-bit number, left-padded to 5 digits, no point
prq
Print a text token followed by a question mark
qw
Print a recursive token in the range 128-145
spc
Print a text token followed by a space
TT11
Print a 16-bit number, left-padded to n digits, and optional point
TT162
Print a space
TT26 *
Print a character at the text cursor by poking into screen memory
TT27 *
Print a text token
TT41
Print a letter according to Sentence Case
TT42
Print a letter in lower case
TT43
Print a two-letter token or recursive token 0-95
TT45
Print a letter in lower case
TT46
Print a character and switch to capitals
TT60
Print a text token and a paragraph break
TT67
Print a newline
TT68
Print a text token followed by a colon
TT69
Set Sentence Case and print a newline
TT73
Print a colon
TT74
Print a character
TTX69
Print a paragraph break
Variables
QQ16
The two-letter token lookup table
QQ18
The recursive token table for tokens 0-148
RLINE
The OSWORD configuration block used to fetch a line of text from the keyboard
TENS
A constant used when printing large numbers in BPRNT
Macros
CHAR
Macro definition for characters in the recursive token table
CONT
Macro definition for control codes in the recursive token table
RTOK
Macro definition for recursive tokens in the recursive token table
TWOK
Macro definition for two-letter tokens in the token table
Universe
Ship spawning, local bubble, system/market data
Subroutines
cpl
Print the selected system name
GINF
Fetch the address of a ship's data block into INF
GVL
Calculate the availability of market items
hyp1
Process a jump to the system closest to (QQ9, QQ10)
jmp
Set the current system to the selected system
KILLSHP *
Remove a ship from our local bubble of universe
KS1
Remove the current ship from our local bubble of universe
KS2
Check the local bubble for missiles with target lock
KS3
Set the SLSP ship line heap pointer after shuffling ship slots
KS4
Remove the space station and replace with a placeholder
NwS1
Flip the sign and double an INWK byte
NWSHP
Add a new ship to our local bubble of universe
NWSPS
Add a new space station to our local bubble of universe
ping
Set the selected system to the current system
SFS1 *
Spawn a child ship from the current (parent) ship
SOLAR
Set up various aspects of arriving in a new system
SOS1
Update the missile indicators, set up the planet data block
tal
Print the current galaxy number
TT111
Set the current system to the nearest system to a point
TT146
Print the distance to the selected system in light years
TT20
Twist the selected system's seeds four times
TT24 *
Calculate system data from the system seeds
TT25 *
Show the Data on System screen (FUNC-7)
TT54 *
Twist the selected system's seeds
TT70
Display "MAINLY " and jump to TT72
TT81
Set the selected system's seeds to those of system 0
ypl
Print the current system name
Ze
Initialise the INWK workspace to a hostile ship
ZINF
Reset the INWK workspace and orientation vectors
Variables
UNIV
Table of pointers to the local universe's ship data blocks
Utility routines
Memory/screen clearing, delay routines
Subroutines
DELAY
Wait for a specified time
FX200
Set the behaviour of the ESCAPE and BREAK keys
IRQ1 *
The main interrupt handler (IRQ1V points here)
OSB (Loader)
A convenience routine for calling OSBYTE with Y = 0
ZERO
Zero-fill pages &9, &A, &B, &C and &D
ZES1
Zero-fill the page whose number is in X
ZES2
Zero-fill a specific page
Variables
MESS1 (Loader)
Contains an OS command string for loading the main game code
oscliv (Loader)
Contains the address of OSCLIV, for executing OS commands
Workspaces
Collections of important variables into blocks
Workspaces
K% *
Ship data blocks and ship line heaps
S% (Part 1 of 2)
Vector addresses, compass shape and configuration settings
S% (Part 2 of 2)
Compass shape and configuration settings
T%
Current commander data and stardust data blocks
UU% (Loader)
Marker for a block that is moved as part of the obfuscation
WP
Ship slots, variables
XX3
Temporary storage space for complex calculations
ZP *
Lots of important variables are stored in the zero page workspace as it is quicker and more space-efficient to access memory here
ZP (Loader) *
Important variables used by the loader
NES source code
The "impossible" version of Elite on the Nintendo
Version information
About the NES version
Information on the "impossible" version of Elite
Different variants of the NES version
Code variations found in NES Elite
NES source code by file
Map of the source code
An overview of how the source code for Elite is structured
Annotated original source files
The source files in their original structure
Common code
Common source
Variables and macros that are shared by all banks
Main game
iNES header source
Source for the iNES header
Bank 0 source (Part 1 of 5)
The contents of ROM bank 0 (first part)
Bank 0 source (Part 2 of 5)
The contents of ROM bank 0 (second part)
Bank 0 source (Part 3 of 5)
The contents of ROM bank 0 (third part)
Bank 0 source (Part 4 of 5)
The contents of ROM bank 0 (fourth part)
Bank 0 source (Part 5 of 5)
The contents of ROM bank 0 (fifth part)
Bank 1 source (Part 1 of 3)
The contents of ROM bank 1 (first part)
Bank 1 source (Part 2 of 3)
The contents of ROM bank 1 (second part)
Bank 1 source (Part 3 of 3)
The contents of ROM bank 1 (third part)
Bank 2 source (Part 1 of 4)
The contents of ROM bank 2 (first part)
Bank 2 source (Part 2 of 4)
The contents of ROM bank 2 (second part)
Bank 2 source (Part 3 of 4)
The contents of ROM bank 2 (third part)
Bank 2 source (Part 4 of 4)
The contents of ROM bank 2 (fourth part)
Bank 3 source (Part 1 of 2)
The contents of ROM bank 3 (first part)
Bank 3 source (Part 2 of 2)
The contents of ROM bank 3 (second part)
Bank 4 source
The contents of ROM bank 4
Bank 5 source
The contents of ROM bank 5
Bank 6 source (Part 1 of 3)
The contents of ROM bank 6 (first part)
Bank 6 source (Part 2 of 3)
The contents of ROM bank 6 (second part)
Bank 6 source (Part 3 of 3)
The contents of ROM bank 6 (third part)
Bank 7 source (Part 1 of 4)
The contents of ROM bank 7 (first part)
Bank 7 source (Part 2 of 4)
The contents of ROM bank 7 (second part)
Bank 7 source (Part 3 of 4)
The contents of ROM bank 7 (third part)
Bank 7 source (Part 4 of 4)
The contents of ROM bank 7 (fourth part)
NES source code by category
Charts
Long-range and short-range galactic charts
Subroutines
DrawChartSystem (Bank 0)
Draw system blobs on short-range chart
DrawCrosshairs (Bank 0)
Draw a set of moveable crosshairs as a square reticle
HideCrosshairs (Bank 0)
Hide the moveable crosshairs (i.e. the square reticle)
HME2 (Bank 0)
Search the galaxy for a system
TT103 (Bank 0)
Draw a small set of crosshairs on a chart
TT105 (Bank 0)
Draw crosshairs on the Short-range Chart, with clipping
TT114 (Bank 0)
Display either the Long-range or Short-range Chart
TT123 (Bank 0)
Move galactic coordinates by a signed delta
TT16 (Bank 0)
Move the crosshairs on a chart
TT22 (Bank 0) *
Show the Long-range Chart
TT23 (Bank 0) *
Show the Short-range Chart
Variables
xShortRange (Bank 0)
The text column for the Short-range Chart title for each language
Combat demo
Scroll text and training for first-time players
Subroutines
AutoPlayDemo (Bank 7)
Automatically play the demo using the auto-play commands from the autoplayKeys tables
CalculateGridLines (Bank 6)
Reset the line coordinate tables and populate them with the characters for a specified scroll text
DrawScrollFrame (Bank 6)
Draw one frame of the scroll text
DrawScrollFrames (Bank 6)
Draw a scroll text over multiple frames
DrawScrollInNMI (Bank 6)
Configure the NMI handler to draw the scroll text screen
DrawScrollText (Bank 6)
Display a Star Wars scroll text
FixRandomNumbers (Bank 7)
Fix the random number seeds to a known value so the random numbers generated are always the same when we run the demo
GetScrollDivisions (Bank 6)
Set up the division calculations for the scroll text
GRIDSET (Bank 6)
Populate the line coordinate tables with the pixel lines for one 21-character line of scroll text
GRS1 (Bank 6)
Populate the line coordinate tables with the lines for a single scroll text character
PlayDemo (Bank 0)
Play the combat demo
PlayDemo_b0 (Bank 7)
Call the PlayDemo routine in ROM bank 0
ProjectScrollText (Bank 6)
Project a scroll text coordinate onto the screen
RunDemoFlightLoop (Bank 0)
Run a fixed number of iterations of the main flight loop for the combat demo
ScrollTextUpScreen (Bank 6)
Go through the line y-coordinate table at Y1TB, moving each line coordinate up the screen by W2Y (i.e. by one full line of text)
SetDemoAutoPlay (Bank 5)
Set up the NMI handler to automatically play the demo using the controller key presses in the autoPlayKeys table
SetDemoAutoPlay_b5 (Bank 7)
Call the SetDemoAutoPlay routine in ROM bank 5
SetupDemoShip (Bank 0)
Set up the ship workspace for a new ship in the combat demo
SetupDemoUniverse (Bank 7)
Initialise the local bubble of universe for the demo
ShowScrollText (Bank 6)
Show a scroll text and start the combat demo
ShowScrollText_b6 (Bank 7)
Call the ShowScrollText routine in ROM bank 6
Variables
autoPlayKeys1_DE (Bank 7)
Auto-play commands for the first part of the auto-play combat demo (combat practice) when German is the chosen language
autoPlayKeys1_EN (Bank 7)
Auto-play commands for the first part of the auto-play combat demo (combat practice) when English is the chosen language
autoPlayKeys1_FR (Bank 7)
Auto-play commands for the first part of the auto-play combat demo (combat practice) when French is the chosen language
autoPlayKeys1Hi (Bank 5)
High byte of the address of the auto-play key table for each language
autoPlayKeys1Lo (Bank 5)
Low byte of the address of the auto-play key table for each language
autoPlayKeys2 (Bank 7)
Auto-play commands for the second part of the auto-play demo (demonstrating the game itself)
creditsText1 (Bank 6)
Text for the first part of the credits scroll text
creditsText1Hi (Bank 6)
Lookup table for the high byte of the address of the creditsText1 text for each language
creditsText1Lo (Bank 6)
Lookup table for the low byte of the address of the creditsText1 text for each language
creditsText2 (Bank 6)
Text for the second part of the credits scroll text
creditsText2Hi (Bank 6)
Lookup table for the high byte of the address of the creditsText2 text for each language
creditsText2Lo (Bank 6)
Lookup table for the low byte of the address of the creditsText2 text for each language
creditsText3 (Bank 6)
Text for the third part of the credits scroll text
creditsText3Hi (Bank 6)
Lookup table for the high byte of the address of the creditsText3 text for each language
creditsText3Lo (Bank 6)
Lookup table for the low byte of the address of the creditsText3 text for each language
LTDEF (Bank 6)
Line definitions for characters in the Star Wars scroll text
NOFX (Bank 6)
The x-coordinates of the scroll text letter grid
NOFY (Bank 6)
The y-coordinates of the scroll text letter grid
scrollText1_DE (Bank 6)
Text for the first scroll text in German
scrollText1_EN (Bank 6)
Text for the first scroll text in English
scrollText1_FR (Bank 6)
Text for the first scroll text in French
scrollText1Hi (Bank 6)
Lookup table for the high byte of the address of the scrollText1 text for each language
scrollText1Lo (Bank 6)
Lookup table for the low byte of the address of the scrollText1 text for each language
scrollText2_DE (Bank 6)
Text for the second scroll text in German
scrollText2_EN (Bank 6)
Text for the second scroll text in English
scrollText2_FR (Bank 6)
Text for the second scroll text in French
scrollText2Hi (Bank 6)
Lookup table for the high byte of the address of the scrollText2 text for each language
scrollText2Lo (Bank 6)
Lookup table for the low byte of the address of the scrollText2 text for each language
Controllers
Routines for scanning both NES controllers
Subroutines
ChangeLetter (Bank 6)
Choose a letter using the up and down buttons
DecreaseJoystick (Bank 7)
Decrease a joystick value by a specific amount, jumping straight to the indicator centre if we decrease from the right-hand side
DOKEY (Bank 0) *
Scan for the seven primary flight controls and apply the docking computer manoeuvring code
IncreaseJoystick (Bank 7)
Increase a joystick value by a specific amount, jumping straight to the indicator centre if we increase from the left-hand side
InputName (Bank 6)
Get a name from the controller for searching the galaxy or changing commander name
InputName_b6 (Bank 7)
Call the InputName routine in ROM bank 6
PAUSE2 (Bank 2)
Wait until a key is pressed, ignoring any existing key press
ReadControllers (Bank 7) *
Read the buttons on the controllers and update the control variables
ScanButtons (Bank 7)
Scan a specific controller and update the control variables
SetControllerPast (Bank 7)
Set the controller history variables to the values from four VBlanks ago
SetKeyLogger (Bank 6)
Populate the key logger table with the controller button presses
SetKeyLogger_b6 (Bank 7)
Call the SetKeyLogger routine in ROM bank 6
TT17 (Bank 0)
Scan the key logger for the directional pad buttons
U% (Bank 0)
Clear the key logger
UpdateJoystick (Bank 7)
Update the values of JSTX and JSTY with the values from the controller
WaitForNoDirection (Bank 6)
Wait until the left and right buttons on controller 1 have been released and remain released for at least four VBlanks
YESNO (Bank 0)
Display "YES" or "NO" and wait until one is chosen
Dashboard
The dials, 3D scanner and compass
Subroutines
ABORT (Bank 0)
Disarm missiles and update the dashboard indicators
ABORT2 (Bank 0)
Set/unset the lock target for a missile and update the dashboard
BUMP2 (Bank 7)
Bump up the value of the pitch or roll dashboard indicator
ClearScanner (Bank 7)
Remove all ships from the scanner and hide the scanner sprites
cntr (Bank 7)
Apply damping to the pitch or roll dashboard indicator
COMPAS (Bank 0) *
Update the compass
DIALS (Bank 6) *
Update the dashboard
DIALS_b6 (Bank 7)
Call the DIALS routine in ROM bank 6
DILX (Bank 6) *
Update a bar-based indicator on the dashboard
DrawDashNames (Bank 3)
Draw the dashboard into both the nametable buffers
DrawDashNames_b3 (Bank 7)
Call the DrawDashNames routine in ROM bank 3
DrawPitchRollBars (Bank 0)
Update the pitch and roll bars on the dashboard
ECBLB2 (Bank 7)
Start up the E.C.M. (start the countdown and make the E.C.M. sound)
HideFromScanner (Bank 1)
Hide the current ship from the scanner
HideFromScanner_b1 (Bank 7)
Call the HideFromScanner routine in ROM bank 1
HideShip (Bank 1)
Update the current ship so it is no longer shown on the scanner
HideShip_b1 (Bank 7)
Update the current ship so it is no longer shown on the scanner
MSBAR (Bank 7)
Draw a specific indicator in the dashboard's missile bar
MSBAR_b6 (Bank 6)
Draw a specific indicator in the dashboard's missile bar
msblob (Bank 0)
Display the dashboard's missile indicators in black or grey
REDU2 (Bank 7)
Reduce the value of the pitch or roll dashboard indicator
ResetScanner (Bank 3)
Reset the sprites used for drawing ships on the scanner
ResetScanner_b3 (Bank 7)
Call the ResetScanner routine in ROM bank 3
SCAN (Bank 1) *
Display the current ship on the scanner
SCAN_b1 (Bank 7)
Call the SCAN routine in ROM bank 1
SP1 (Bank 0)
Draw the space station on the compass
SP2 (Bank 0)
Draw a dot on the compass, given the planet/station vector
WPSHPS (Bank 0)
Set all ships to be hidden from the screen
Variables
conditionAttrs (Bank 6)
Sprite attributes for the status condition indicator on the dashboard
conditionPatts (Bank 6)
Pattern numbers for the status condition indicator on the dashboard
dashImage (Bank 3)
Packed image data for the dashboard
dashNames (Bank 3)
Nametable entries for the dashboard
missileNames (Bank 7)
Tile numbers for the four missile indicators on the dashboard, as offsets from the start of tile row 22
missileNames_b6 (Bank 6)
Tile numbers for the four missile indicators on the dashboard, as offsets from the start of tile row 22
Drawing circles
Planet ellipses and navigation chart circles
Subroutines
BLINE (Bank 1) *
Draw a circle segment and add it to the ball line heap
CHKON (Bank 1)
Check whether any part of a circle appears on the extended screen
CIRCLE (Bank 1)
Draw a circle for the planet
CIRCLE2 (Bank 1) *
Draw a circle (for the planet or chart)
CIRCLE2_b1 (Bank 7)
Call the CIRCLE2 routine in ROM bank 1
TT128 (Bank 0) *
Draw a circle on a chart
TT14 (Bank 0)
Draw a circle with crosshairs on a chart
Drawing lines
The core line-drawing routines
Subroutines
CLIP_b1 (Bank 7)
Call the CLIP routine in ROM bank 1, drawing the clipped line if it fits on-screen
DrawVerticalLine (Part 1 of 3) (Bank 7)
Draw a vertical line from (X1, Y1) to (X1, Y2)
DrawVerticalLine (Part 2 of 3) (Bank 7)
Draw the top end or bottom end of the line
DrawVerticalLine (Part 3 of 3) (Bank 7)
Draw the middle portion of the line from full-height blocks
EDGES (Bank 1)
Draw a horizontal line given a centre and a half-width
HLOIN (Part 1 of 5) (Bank 7)
Draw a horizontal line from (X1, Y) to (X2, Y) using EOR logic
HLOIN (Part 2 of 5) (Bank 7)
Draw the left end of the line
HLOIN (Part 3 of 5) (Bank 7)
Draw the middle part of the line
HLOIN (Part 4 of 5) (Bank 7)
Draw the right end of the line
HLOIN (Part 5 of 5) (Bank 7)
Draw the line when it's all within one character block
LASLI (Bank 0)
Draw the laser lines for when we fire our lasers
LL118 (Bank 1)
Move a point along a line until it is on-screen
LL145 (Part 1 of 4) (Bank 1) *
Clip line: Work out which end-points are on-screen, if any
LL145 (Part 2 of 4) (Bank 1)
Clip line: Work out if any part of the line is on-screen
LL145 (Part 3 of 4) (Bank 1)
Clip line: Calculate the line's gradient
LL145 (Part 4 of 4) (Bank 1)
Clip line: Call the routine in LL188 to do the actual clipping
LOIN (Part 1 of 7) (Bank 7) *
Draw a line: Calculate the line gradient in the form of deltas
LOIN (Part 2 of 7) (Bank 7)
Draw a line: Line has a shallow gradient, step right along x-axis
LOIN (Part 3 of 7) (Bank 7)
Draw a shallow line going right and up or left and down
LOIN (Part 4 of 7) (Bank 7)
Draw a shallow line going right and down or left and up
LOIN (Part 5 of 7) (Bank 7)
Draw a line: Line has a steep gradient, step up along y-axis
LOIN (Part 6 of 7) (Bank 7)
Draw a steep line going up and left or down and right
LOIN (Part 7 of 7) (Bank 7)
Draw a steep line going up and right or down and left
NLIN2 (Bank 7)
Draw a horizontal line on tile row 2 to box in a title
NLIN3 (Bank 7)
Print a title and draw a screen-wide horizontal line on tile row 2 to box it in
NLIN4 (Bank 7)
Draw a horizontal line on tile row 2 to box in a title
TT15 (Bank 0)
Draw a set of crosshairs
Variables
lineImage (Bank 7)
Image data for the horizontal line, vertical line and block images
TWFL (Bank 7)
Ready-made character rows for the left end of a horizontal line in the space view
TWFR (Bank 7)
Ready-made character rows for the right end of a horizontal line in the space view
Drawing pixels
How to plot pixels in various colours
Subroutines
DrawDash (Bank 7)
Draw a 2-pixel dash
PIXEL (Bank 7) *
Draw a 1-pixel dot
PIXEL2 (Bank 1)
Draw a stardust particle relative to the screen centre
Variables
TWOS (Bank 7)
Ready-made single-pixel character row bytes for the space view
TWOS2 (Bank 7)
Ready-made double-pixel character row bytes for the space view
yLookupHi (Bank 7)
Lookup table for converting pixel y-coordinate to tile number (high byte)
yLookupLo (Bank 7)
Lookup table for converting pixel y-coordinate to tile number (low byte)
Drawing planets
Planets with meridians and craters
Subroutines
PL21 (Bank 1)
Return from a planet/sun-drawing routine with a failure flag
PL44 (Bank 1)
Return from a planet/sun-drawing routine with a success flag
PL9 (Part 1 of 3) (Bank 1) *
Draw the planet, with either an equator and meridian, or a crater
PL9 (Part 2 of 3) (Bank 1)
Draw the planet's equator and meridian
PL9 (Part 3 of 3) (Bank 1)
Draw the planet's crater
PLANET (Bank 1)
Draw the planet or sun
PLS1 (Bank 1)
Calculate (Y A) = nosev_x / z
PLS2 (Bank 1)
Draw a half-ellipse
PLS22 (Bank 1) *
Draw an ellipse or half-ellipse
PLS3 (Bank 1)
Calculate (Y A P) = 222 * roofv_x / z
PLS4 (Bank 1)
Calculate CNT2 = arctan(P / A) / 4
PLS5 (Bank 1)
Calculate roofv_x / z and roofv_y / z
PLS6 (Bank 7)
Calculate (X K) = (A P) / (z_sign z_hi z_lo)
Drawing ships
The celebrated 3D ship plotting process
Subroutines
DOEXP (Bank 1) *
Draw an exploding ship
DrawExplosionBurst (Bank 1)
Draw an exploding ship along with an explosion burst made up of colourful sprites
DrawShipInBitplane (Bank 7)
Flip the drawing bitplane and draw the current ship in the newly flipped bitplane
GetDefaultNEWB (Bank 7)
Fetch the default NEWB flags for a specified ship type
GetShipBlueprint (Bank 7)
Fetch a specified byte from the current ship blueprint
HideExplosionBurst (Bank 7)
Hide the four sprites that make up the explosion burst that flashes up when a ship explodes
LL9 (Part 1 of 12) (Bank 1)
Draw ship: Check if ship is exploding, check if ship is in front
LL9 (Part 2 of 12) (Bank 1)
Draw ship: Check if ship is in field of view, close enough to draw
LL9 (Part 3 of 12) (Bank 1)
Draw ship: Set up orientation vector, ship coordinate variables
LL9 (Part 4 of 12) (Bank 1)
Draw ship: Set visibility for exploding ship (all faces visible)
LL9 (Part 5 of 12) (Bank 1)
Draw ship: Calculate the visibility of each of the ship's faces
LL9 (Part 6 of 12) (Bank 1)
Draw ship: Calculate the visibility of each of the ship's vertices
LL9 (Part 7 of 12) (Bank 1)
Draw ship: Calculate the visibility of each of the ship's vertices
LL9 (Part 8 of 12) (Bank 1)
Draw ship: Calculate the screen coordinates of visible vertices
LL9 (Part 9 of 12) (Bank 1)
Draw ship: Draw laser beams if the ship is firing its laser at us
LL9 (Part 10 of 12) (Bank 1)
Draw ship: Calculate the visibility of each of the ship's edges
LL9 (Part 11 of 12) (Bank 1)
Draw ship: Loop back for the next edge
LL9 (Part 12 of 12) (Bank 1)
Does nothing in the NES version
LL9_b1 (Bank 7)
Call the LL9 routine in ROM bank 1
SHPPT (Bank 1)
Draw a distant ship as a point rather than a full wireframe
Variables
E% (Bank 1)
Ship blueprints default NEWB flags
scacol (Bank 0)
Ship colours on the scanner
SHIP_ADDER (Bank 1)
Ship blueprint for an Adder
SHIP_ANACONDA (Bank 1)
Ship blueprint for an Anaconda
SHIP_ASP_MK_2 (Bank 1)
Ship blueprint for an Asp Mk II
SHIP_ASTEROID (Bank 1)
Ship blueprint for an asteroid
SHIP_BOA (Bank 1)
Ship blueprint for a Boa
SHIP_BOULDER (Bank 1)
Ship blueprint for a boulder
SHIP_CANISTER (Bank 1)
Ship blueprint for a cargo canister
SHIP_COBRA_MK_1 (Bank 1)
Ship blueprint for a Cobra Mk I
SHIP_COBRA_MK_3 (Bank 1)
Ship blueprint for a Cobra Mk III
SHIP_COBRA_MK_3_P (Bank 1)
Ship blueprint for a Cobra Mk III (pirate)
SHIP_CONSTRICTOR (Bank 1)
Ship blueprint for a Constrictor
SHIP_CORIOLIS (Bank 1)
Ship blueprint for a Coriolis space station
SHIP_COUGAR (Bank 1)
Ship blueprint for a Cougar
SHIP_DODO (Bank 1)
Ship blueprint for a Dodecahedron ("Dodo") space station
SHIP_ESCAPE_POD (Bank 1)
Ship blueprint for an escape pod
SHIP_FER_DE_LANCE (Bank 1)
Ship blueprint for a Fer-de-Lance
SHIP_GECKO (Bank 1)
Ship blueprint for a Gecko
SHIP_KRAIT (Bank 1)
Ship blueprint for a Krait
SHIP_MAMBA (Bank 1)
Ship blueprint for a Mamba
SHIP_MISSILE (Bank 1)
Ship blueprint for a missile
SHIP_MORAY (Bank 1)
Ship blueprint for a Moray
SHIP_PLATE (Bank 1)
Ship blueprint for an alloy plate
SHIP_PYTHON (Bank 1)
Ship blueprint for a Python
SHIP_PYTHON_P (Bank 1)
Ship blueprint for a Python (pirate)
SHIP_ROCK_HERMIT (Bank 1)
Ship blueprint for a rock hermit (asteroid)
SHIP_SHUTTLE (Bank 1)
Ship blueprint for a Shuttle
SHIP_SIDEWINDER (Bank 1)
Ship blueprint for a Sidewinder
SHIP_SPLINTER (Bank 1)
Ship blueprint for a splinter
SHIP_THARGOID (Bank 1)
Ship blueprint for a Thargoid mothership
SHIP_THARGON (Bank 1)
Ship blueprint for a Thargon
SHIP_TRANSPORTER (Bank 1)
Ship blueprint for a Transporter
SHIP_VIPER (Bank 1)
Ship blueprint for a Viper
SHIP_WORM (Bank 1)
Ship blueprint for a Worm
Unused copy of XX21 (Bank 1)
Remnants of an unused copy of the XX21 ship blueprints lookup table
XX21 (Bank 7)
Ship blueprints lookup table
Macros
EDGE (Common)
Macro definition for adding edges to ship blueprints
FACE (Common)
Macro definition for adding faces to ship blueprints
VERTEX (Common)
Macro definition for adding vertices to ship blueprints
Drawing sprites
Drawing and hiding sprites
Subroutines
DrawSpriteImage (Bank 6)
Draw an image out of sprites using patterns in sequential tiles in the pattern buffer
DrawSpriteImage_b6 (Bank 7)
Call the DrawSpriteImage routine in ROM bank 6
FadeAndHideSprites (Bank 7)
Fade the screen to black and hide all sprites
HideMoreSprites (Bank 7)
Hide X + 1 sprites from sprite Y / 4 onwards
HideMostSprites (Bank 7)
Hide all sprites except for sprite 0 and the icon bar pointer
HideSprites (Bank 7)
Hide X sprites from sprite Y / 4 onwards
SendPaletteSprites (Bank 7)
Send the current palette and sprite data to the PPU
SetScreenForUpdate (Bank 7)
Get the screen ready for updating by hiding all sprites, after fading the screen to black if we are changing view
Drawing suns
The epic, shimmering Elite sun
Subroutines
DrawSunEdgeLeft (Bank 1)
Draw a sun line in the tile on the left end of a sun row
DrawSunEdgeRight (Bank 1)
Draw a sun line in the tile on the right end of a sun row
DrawSunRowOfBlocks (Bank 7)
Draw a row of character blocks that contain sunlight, silhouetting any existing content against the sun
PLFL (Bank 1)
Calculate the sun's width on a given pixel row
SUN (Part 1 of 2) (Bank 1)
Draw the sun: Set up all the variables needed to draw the sun
SUN (Part 2 of 2) (Bank 1)
Draw the sun: Starting from the bottom of the sun, draw the new sun line by line
SUN_b1 (Bank 7)
Call the SUN routine in ROM bank 1
Drawing the screen
Drawing and configuring views and the NMI handler
Subroutines
ChangeToView (Bank 0)
Clear the screen and set a new view type
ChangeToView_b0 (Bank 7)
Call the ChangeToView routine in ROM bank 0
ClearBuffers (Bank 7)
If there are enough free cycles, clear down the nametable and pattern buffers for both bitplanes
ClearDashEdge (Bank 6)
Clear the right edge of the dashboard
ClearDashEdge_b6 (Bank 7)
Call the ClearDashEdge routine in ROM bank 6
ClearDrawingPlane (Part 1 of 3) (Bank 7)
Clear the nametable and pattern buffers for the newly flipped drawing plane
ClearDrawingPlane (Part 2 of 3) (Bank 7)
Clear the nametable buffers for the newly flipped drawing plane
ClearDrawingPlane (Part 3 of 3) (Bank 7)
Clear the pattern buffers for the newly flipped drawing plane
ClearPlaneBuffers (Part 1 of 2) (Bank 7)
Clear the nametable and pattern buffers of data that has already been sent to the PPU, starting with the nametable buffer
ClearPlaneBuffers (Part 2 of 2) (Bank 7)
Clear the pattern buffer of data that has already been sent to the PPU for the current bitplane
ClearScreen (Bank 3)
Clear the screen by clearing patterns 66 to 255 in both pattern buffers, and clearing both nametable buffers to the background
ClearScreen_b3 (Bank 7)
Call the ClearScreen routine in ROM bank 3
CLYNS (Bank 7)
Clear the bottom two text rows of the visible screen
CopyNameBuffer0To1 (Bank 7)
Copy the contents of nametable buffer 0 to nametable buffer 1
DrawBackground (Bank 3)
Draw the background of a system or commander image into the nametable buffer
DrawBackground_b3 (Bank 7)
Call the DrawBackground routine in ROM bank 3
DrawBitplaneInNMI (Bank 7)
Configure the NMI to send the drawing bitplane to the PPU after drawing the box edges and setting the next free tile number
DrawBoxEdges (Bank 7)
Draw the left and right edges of the box along the sides of the screen, drawing into the nametable buffer for the drawing bitplane
DrawBoxTop (Bank 7)
Draw the top edge of the box along the top of the screen in nametable buffer 0
DrawImageFrame (Bank 3)
Draw a frame around the system image or commander headshot
DrawImageFrame_b3 (Bank 7)
Call the DrawImageFrame routine in ROM bank 3
DrawImageNames (Bank 4)
Set the nametable buffer entries for the specified image
DrawImageNames_b4 (Bank 7)
Call the DrawImageNames routine in ROM bank 4
DrawMessageInNMI (Bank 7)
Configure the NMI to send the portion of the screen that contains the in-flight message to the PPU (i.e. tile rows 22 to 24)
DrawRowOfTiles (Bank 3)
Draw a row of tiles into the nametable buffer
DrawScreenInNMI (Bank 0)
Configure the NMI handler to draw the screen
DrawScreenInNMI_b0 (Bank 7)
Call the DrawScreenInNMI routine in ROM bank 0
DrawSmallBox (Bank 3)
Draw a small box, typically used for popups or outlines
DrawSmallBox_b3 (Bank 7)
Call the DrawSmallBox routine in ROM bank 3
DrawSpaceViewInNMI (Bank 0)
Configure the NMI handler to draw the space view
FadeColours (Bank 3)
Fade the screen colours towards black
FadeColoursTwice (Bank 3)
Fade the screen colours towards black twice
FadeToBlack (Bank 3)
Fade the screen to black over the next four VBlanks
FadeToBlack_b3 (Bank 7)
Call the FadeToBlack routine in ROM bank 3
FadeToColour (Bank 3)
Reverse-fade the screen from black to full colour over the next four VBlanks
FadeToColour_b3 (Bank 7)
Call the FadeToColour routine in ROM bank 3
FlipDrawingPlane (Bank 7)
Flip the drawing bitplane
GetNameAddress (Bank 3)
Get the addresses in the nametable buffers for a given tile
GetRowNameAddress (Bank 7)
Get the addresses in the nametable buffers for the start of a given character row
GetViewPalettes (Bank 3)
Get the palette for the view type in QQ11a and store it in a table at XX3
HideHiddenColour (Bank 0)
Set the hidden colour to black, so that pixels in this colour in palette 0 are invisible
RedrawCurrentView (Bank 0)
Update the current view when we arrive in a new system
ResetBuffers (Bank 7)
Reset the pattern and nametable buffers
SetDrawingBitplane (Bank 7)
Set the drawing bitplane to a specified value
SetDrawingPlaneTo0 (Bank 7)
Set the drawing bitplane to 0
SetDrawPlaneFlags (Bank 7)
Set the drawing bitplane flags to the specified value, draw the box edges and set the next free tile number
SetLinePatterns (Bank 3)
Copy the patterns for horizontal line, vertical line and block images into the pattern buffers, depending on the view
SetLinePatterns_b3 (Bank 7)
Call the SetLinePatterns routine in ROM bank 3
SetNewViewType (Bank 0)
Clear the screen, set the current view type and move the cursor to row 0
SetPaletteColours (Bank 3)
Set the view's palette from the entries in the XX3 palette table
SetPaletteForView (Bank 7)
Send palette 0 for the current view to the PPU
SetPatternBuffer (Bank 7)
Set the high byte of the pattern buffer address variables
SetScreenHeight (Bank 0)
Set the screen height variables to the specified height
SetSpaceViewInNMI (Bank 0)
Change the current space view and configure the NMI to send both bitplanes to the PPU during VBlank
SetupFullViewInNMI (Bank 7)
Configure the PPU to send tiles for the full screen during VBlank
SetupSpaceView (Bank 0)
Set up the NMI variables for the space view
SetupViewInNMI (Bank 3)
Setup the view and configure the NMI to send both bitplanes to the PPU during VBlank
SetupViewInNMI_b3 (Bank 7)
Call the SetupViewInNMI routine in ROM bank 3
SetViewAttrs (Bank 3)
Set up attribute buffer 0 for the chosen view
SetViewAttrs_b3 (Bank 7)
Call the SetViewAttrs routine in ROM bank 3
TT66 (Bank 0)
Clear the screen and set the new view type
TT66_b0 (Bank 7)
Call the TT66 routine in ROM bank 0
UpdateView (Bank 0)
Update the view
UpdateView_b0 (Bank 7)
Call the UpdateView routine in ROM bank 0
UpdateViewWithFade (Bank 7)
Fade the screen to black, if required, hide all sprites and update the view
Variables
boxEdgeImages (Bank 3)
Image data for patterns 0 to 4
fadeColours (Bank 3)
Lookup table that converts a NES colour to the same colour but with a smaller brightness value
flagsForClearing (Bank 7)
A bitplane mask to control how bitplane buffer clearing works in the ClearPlaneBuffers routine
nameBufferHiAddr (Bank 7)
The high bytes of the addresses of the two nametable buffers
paletteForView (Bank 3)
Palette numbers for each view
pattBufferHiAddr (Bank 7)
The high bytes of the addresses of the two pattern buffers
viewAttrCount (Bank 3)
The number of sets of view attributes in the viewAttrOffset table
viewAttributes0 (Bank 3)
Packed view attribute data for attribute set 0
viewAttributes1 (Bank 3)
Packed view attribute data for attribute set 1
viewAttributes10 (Bank 3)
Packed view attribute data for attribute set 10
viewAttributes11 (Bank 3)
Packed view attribute data for attribute set 11
viewAttributes12 (Bank 3)
Packed view attribute data for attribute set 12
viewAttributes13 (Bank 3)
Packed view attribute data for attribute set 13
viewAttributes14 (Bank 3)
Packed view attribute data for attribute set 14
viewAttributes15 (Bank 3)
Packed view attribute data for attribute set 15
viewAttributes16 (Bank 3)
Packed view attribute data for attribute set 16
viewAttributes17 (Bank 3)
Packed view attribute data for attribute set 17
viewAttributes18 (Bank 3)
Packed view attribute data for attribute set 18
viewAttributes19 (Bank 3)
Packed view attribute data for attribute set 19
viewAttributes2 (Bank 3)
Packed view attribute data for attribute set 2
viewAttributes20 (Bank 3)
Packed view attribute data for attribute set 20
viewAttributes21 (Bank 3)
Packed view attribute data for attribute set 21
viewAttributes22 (Bank 3)
Packed view attribute data for attribute set 22
viewAttributes23 (Bank 3)
Packed view attribute data for attribute set 23
viewAttributes3 (Bank 3)
Packed view attribute data for attribute set 3
viewAttributes4 (Bank 3)
Packed view attribute data for attribute set 4
viewAttributes5 (Bank 3)
Packed view attribute data for attribute set 5
viewAttributes6 (Bank 3)
Packed view attribute data for attribute set 6
viewAttributes7 (Bank 3)
Packed view attribute data for attribute set 7
viewAttributes8 (Bank 3)
Packed view attribute data for attribute set 8
viewAttributes9 (Bank 3)
Packed view attribute data for attribute set 9
viewAttributes_DE (Bank 3)
The view attributes to use for each view type in German
viewAttributes_EN (Bank 3)
The view attributes to use for each view type in English
viewAttributes_FR (Bank 3)
The view attributes to use for each view type in French
viewAttributesHi (Bank 3)
The high byte of the view attributes lookup table for each language
viewAttributesLo (Bank 3)
The low byte of the view attributes lookup table for each language
viewAttrOffset (Bank 3)
Offset to the data for each of the 24 sets of view attributes
viewPalettes (Bank 3)
The palettes to use for the different views
Macros
ADD_CYCLES (Common)
Add a specified number to the cycle count
ADD_CYCLES_CLC (Common)
Add a specified number to the cycle count
FILL_MEMORY (Common)
Fill memory with the specified number of bytes
SEND_DATA_TO_PPU (Common)
Send a specified block of memory to the PPU
SUBTRACT_CYCLES (Common)
Subtract a specified number from the cycle count
Equipment
Buying and selling weapons and ship upgrades
Subroutines
DrawCobraMkIII (Bank 0)
Draw the Cobra Mk III on the Equip Ship screen
DrawEquipment (Bank 6) *
Draw the currently fitted equipment onto the Cobra Mk III image on the Equip Ship screen
DrawEquipment_b6 (Bank 7)
Call the DrawEquipment routine in ROM bank 6
eq (Bank 0)
Subtract the price of equipment from the cash pot
EQSHP (Bank 0) *
Show the Equip Ship screen
GetLaserPattern (Bank 6)
Get the pattern number for a specific laser's equipment sprite
HighlightEquipment (Bank 0)
Highlight an item of equipment on the Equip Ship screen
HighlightLaserView (Bank 0)
Highlight the laser view name in the popup menu
MoveEquipmentDown (Bank 0)
Move the currently selected item down the list of equipment
MoveEquipmentUp (Bank 0)
Move the currently selected item up the list of equipment
PrintEquipment (Bank 0)
Print the name and price for a specified item of equipment
PrintLaserView (Bank 0)
Print the name of a laser view in the laser-buying popup, filled to the right by the correct number of spaces to fill the popup
prx (Bank 0)
Return the price of a piece of equipment
qv (Bank 0)
Print a popup menu of the four space views, for buying lasers
refund (Bank 0)
Install a new laser, processing a refund if applicable
SetEquipmentSprite (Bank 6)
Set up the sprites in the sprite buffer for a specific bit of equipment to show on our Cobra Mk III on the Equip Ship screen
SetLaserSprite (Bank 6)
Set up the sprites in the sprite buffer for a specific laser to show on our Cobra Mk III on the Equip Ship screen
UpdateEquipment (Bank 0)
Highlight the newly chosen item of equipment, update the Cobra Mk III, redraw the screen and rejoin the main EQSHP routine
Variables
cobraImage (Bank 3)
Packed image data for the Cobra Mk III shown on the Equip Ship screen
equipSprites (Bank 6)
Sprite configuration data for the sprites that show the equipment fitted to our Cobra Mk III on the Equip Ship screen
inventoryIcon (Bank 3)
Image data for the inventory icon shown on the icon bar in the Market Price screen
popupWidth (Bank 0)
The width of the popup that shows the views available for installing lasers in the Equipment screen
PRXS (Bank 0)
Equipment prices
xEquipShip (Bank 0)
The text column for the Equip Ship title for each language
xLaserView (Bank 0)
The text column of the right edge of the laser-buying popup, so the popup gets filled with spaces and covers what's underneath it
Flight
Docking, hyperspace, views, shields and more
Subroutines
ChargeShields (Bank 0)
Charge the shields and energy banks
CheckAltitude (Bank 0)
Perform an altitude check with the planet, ending the game if we hit the ground
CheckJumpSafety (Bank 0)
Check whether we are far enough away from the planet and sun to be able to do an in-system (fast-forward) jump
DCS1 (Bank 0)
Calculate the vector from the ideal docking position to the ship
DENGY (Bank 0)
Drain some energy from the energy banks
dockEd (Bank 0)
Print a message to say there is no hyperspacing allowed inside the station
DOCKIT (Bank 0)
Apply docking manoeuvres to the ship in INWK
DOENTRY (Bank 0)
Dock at the space station, show the ship hangar and work out any mission progression
DrawLaunchBox (Bank 6)
Draw a box as part of the launch tunnel animation
DrawLaunchBox_b6 (Bank 7)
Call the DrawLaunchBox routine in ROM bank 6
DrawLightning (Bank 6)
Draw a lightning effect for the launch tunnel and E.C.M. that consists of two random lightning bolts, one above the other
DrawLightning_b6 (Bank 7)
Call the DrawLightning routine in ROM bank 6
ESCAPE (Bank 0)
Launch our escape pod
FastForwardJump (Bank 0)
Perform an in-system jump
GalacticHyperdrive (Bank 0)
If we are in space and the countdown has ended, activate the galactic hyperdrive
Ghy (Bank 0)
Perform a galactic hyperspace jump
HideSightSprites (Bank 3)
Hide the sprites for the laser sights in the space view
hyp (Bank 0)
Start the hyperspace process
InSystemJump (Bank 0)
Perform an in-system (fast-forward) jump
LAUN (Bank 0)
Make the launch sound and draw the launch tunnel
LL164 (Bank 6)
Make the hyperspace sound and draw the hyperspace tunnel
LL164_b6 (Bank 7)
Call the LL164 routine in ROM bank 6
LOOK1 (Bank 0)
Initialise the space view
mes9 (Bank 0)
Print a text token, possibly followed by " DESTROYED"
MESS (Bank 0)
Display an in-flight message
MJP (Bank 0)
Process a mis-jump into witchspace
OOPS (Bank 0)
Take some damage
ou2 (Bank 0)
Display "E.C.M.SYSTEM DESTROYED" as an in-flight message
ou3 (Bank 0)
Display "FUEL SCOOPS DESTROYED" as an in-flight message
OUCH (Bank 0)
Potentially lose cargo or equipment following damage
PLUT (Bank 0) *
Flip the coordinate axes for the four different views
ResetShipStatus (Bank 0)
Reset the ship's speed, hyperspace counter, laser temperature, shields and energy banks
SESCP (Bank 0)
Spawn an escape pod from the current (parent) ship
SHD (Bank 0)
Charge a shield and drain some energy from the energy banks
SIGHT (Bank 3)
Draw the laser crosshairs
SIGHT_b3 (Bank 7)
Call the SIGHT routine in ROM bank 3
TT110 (Bank 0)
Launch from a station or show the front space view
TT147 (Bank 0)
Print an error when a system is out of hyperspace range
TT18 (Bank 0)
Try to initiate a jump into hyperspace
WARP (Bank 0) *
Process the fast-forward button to end the demo, dock instantly or perform an in-system jump
wW (Bank 0)
Start a hyperspace countdown
Variables
hyperspaceColour (Bank 6)
The different colours that can be used for the hyperspace effect
xSpaceView (Bank 7)
The text column for the space view name for each language
Icon bar
Processing the NES version's unique icon bar
Subroutines
BlankAllButtons (Bank 3)
Blank all the buttons on the icon bar
BlankButtons6To11 (Bank 3)
Blank from the sixth to the eleventh button on the icon bar
BlankButtons8To11 (Bank 3)
Blank from the eighth to the eleventh button on the icon bar
CheckForPause (Bank 0)
Pause the game if the pause button (Start) is pressed
CheckForPause_b0 (Bank 7)
Call the CheckForPause routine in ROM bank 0
CheckPauseButton (Bank 7)
Check whether the pause button has been pressed or an icon bar button has been chosen, and process pause/unpause if required
Draw2OptionTiles (Bank 3)
Draw a top and bottom tile over the top of an icon bar button in the Pause icon bar to change an option icon to a non-default state
Draw4OptionTiles (Bank 3)
Draw four tiles over the top of an icon bar button in the Pause icon bar to change an option icon to a non-default state
Draw6OptionTiles (Bank 3)
Draw six tiles over the top of an icon bar button in the Pause icon bar to change an option icon to a non-default state
DrawBlankButton2x2 (Bank 3)
Draw a blank icon bar button as a 2x2 tile block
DrawBlankButton3x2 (Bank 3)
Draw a blank icon bar button as a 3x2 tile block
DrawIconBar (Bank 3) *
Draw the icon bar into the nametable buffers for both bitplanes
DrawInventoryIcon (Bank 7)
Draw the inventory icon on top of the second button in the icon bar
HideIconBar (Bank 3)
Remove the icon bar from the screen by replacing it with background tiles
HideIconBarPointer (Bank 7)
Clear the icon bar choice and hide the icon bar pointer
MoveIconBarPointer (Bank 7)
Move the sprites that make up the icon bar pointer and record any choices
PauseGame (Bank 6)
Pause the game and process choices from the pause menu until the game is unpaused by another press of Start
PauseGame_b6 (Bank 7)
Call the PauseGame routine in ROM bank 6
SetIconBarButtons (Bank 3)
Set the correct list of button numbers for the icon bar
SetIconBarButtonsS (Bank 3)
Set the correct list of button numbers for the icon bar (this is a jump so we can call this routine using a branch instruction)
SetIconBarPointer (Bank 7)
Set the icon bar pointer to a specific position
SetIconBarRow (Bank 3)
Set the row on which the icon bar appears, which depends on the view type
SetupIconBar (Bank 3)
Set up the icons on the icon bar to show all available options
SetupIconBar_b3 (Bank 7)
Call the SetupIconBar routine in ROM bank 3
SetupIconBarCharts (Bank 3)
Set up the Charts icon bar
SetupIconBarDocked (Bank 3)
Set up the Docked icon bar
SetupIconBarFlight (Bank 3)
Set up the Flight icon bar
SetupIconBarPause (Bank 3)
Set up the game options shown on the icon bar when the game is paused
ShowIconBar (Bank 3)
Show a specified icon bar on-screen
ShowIconBar_b3 (Bank 7)
Call the ShowIconBar routine in ROM bank 3
TT102 (Bank 0) *
Process icon bar controller choices
UpdateIconBar (Bank 3)
Update the icon bar
UpdateIconBar_b3 (Bank 7)
Call the UpdateIconBar routine in ROM bank 3
Variables
barNames0 (Bank 3)
Nametable entries for icon bar 0 (Docked)
barNames1 (Bank 3)
Nametable entries for icon bar 1 (Flight)
barNames2 (Bank 3)
Nametable entries for icon bar 2 (Charts)
barNames3 (Bank 3)
Nametable entries for icon bar 3 (Pause)
barNames4 (Bank 3)
Nametable entries for icon bar 4 (Title screen copyright message)
iconBarButtons (Bank 7)
A list of button numbers for each icon bar type
iconBarImage0 (Bank 3)
Image data for icon bar 0 (Docked)
iconBarImage1 (Bank 3)
Image data for icon bar 1 (Flight)
iconBarImage2 (Bank 3)
Image data for icon bar 2 (Charts)
iconBarImage3 (Bank 3)
Image data for icon bar 3 (Pause)
iconBarImage4 (Bank 3)
Image data for icon bar 4 (Title screen copyright message)
Main loop
The core loop that runs Elite
Subroutines
FlightLoop4To16 (Bank 0)
Display in-flight messages, call parts 4 to 12 of the main flight loop for each slot, and fall through into parts 13 to 16
Main flight loop (Part 1 of 16) (Bank 0)
Seed the random number generator
Main flight loop (Part 2 of 16) (Bank 0)
Calculate the alpha and beta angles from the current pitch and roll of our ship
Main flight loop (Part 3 of 16) (Bank 0)
Scan for flight keys and process the results
Main flight loop (Part 4 of 16) (Bank 0)
For each nearby ship: Copy the ship's data block from K% to the zero-page workspace at INWK
Main flight loop (Part 5 of 16) (Bank 0)
For each nearby ship: If an energy bomb has been set off, potentially kill this ship
Main flight loop (Part 6 of 16) (Bank 0)
For each nearby ship: Move the ship in space and copy the updated INWK data block back to K%
Main flight loop (Part 7 of 16) (Bank 0)
For each nearby ship: Check whether we are docking, scooping or colliding with it
Main flight loop (Part 8 of 16) (Bank 0)
For each nearby ship: Process us potentially scooping this item
Main flight loop (Part 9 of 16) (Bank 0)
For each nearby ship: If it is a space station, check whether we are successfully docking with it
Main flight loop (Part 10 of 16) (Bank 0)
For each nearby ship: Remove if scooped, or process collisions
Main flight loop (Part 11 of 16) (Bank 0)
For each nearby ship: Process missile lock and firing our laser
Main flight loop (Part 12 of 16) (Bank 0)
For each nearby ship: Draw the ship, remove if killed, loop back
Main flight loop (Part 13 of 16) (Bank 0)
Show energy bomb effect, charge shields and energy banks
Main flight loop (Part 14 of 16) (Bank 0)
Spawn a space station if we are close enough to the planet
Main flight loop (Part 15 of 16) (Bank 0)
Perform altitude checks with the planet and sun and process fuel scooping if appropriate
Main flight loop (Part 16 of 16) (Bank 0)
Call stardust routine
Main game loop (Part 1 of 6) (Bank 0)
Spawn a trader (a Cobra Mk III, Python, Boa or Anaconda)
Main game loop (Part 2 of 6) (Bank 0) *
Call the main flight loop, and potentially spawn a trader, an asteroid, or a cargo canister
Main game loop (Part 3 of 6) (Bank 0)
Potentially spawn a cop, particularly if we've been bad
Main game loop (Part 4 of 6) (Bank 0)
Potentially spawn a lone bounty hunter, a Thargoid, or up to four pirates
Main game loop (Part 5 of 6) (Bank 0)
Cool down lasers, make calls to update the dashboard
Main game loop (Part 6 of 6) (Bank 0)
Process non-flight key presses (icon bar selections)
Market
Market prices, selling, buying and inventory
Subroutines
BuyAndSellCargo (Bank 0)
Process the buying and selling of cargo on the Market Price screen
dn (Bank 0)
Print the amount of money we have left in the cash pot
HighlightSaleItem (Bank 0)
Highlight the name, price and availability of a market item on the correct row for the chosen language
PrintCash (Bank 0)
Print our cash levels in the correct place for the chosen language
PrintMarketItem (Bank 0)
Print the name, price and availability of a market item on the correct row for the chosen language
PrintNumberInHold (Bank 0)
Print the number of units of a specified item that we have in the hold
tnpr (Bank 0)
Work out if we have space for a specific amount of cargo
tnpr1 (Bank 0)
Work out if we have space for one tonne of cargo
TT151 (Bank 0)
Print the name, price and availability of a market item
TT152 (Bank 0)
Print the unit ("t", "kg" or "g") for a market item
TT160 (Bank 0)
Print "t" (for tonne) and a space
TT161 (Bank 0)
Print "kg" (for kilograms)
TT163 (Bank 0)
Print the headers for the table of market prices
TT167 (Bank 0) *
Show the Market Price screen
TT16a (Bank 0)
Print "g" (for grams)
TT210 (Bank 0)
Show a list of current cargo in our hold, optionally to sell
TT213 (Bank 0) *
Show the Inventory screen
var (Bank 0)
Calculate QQ19+3 = economy * |economic_factor|
Variables
QQ23 (Bank 0)
Market prices table
xCash (Bank 0)
The text column for our cash levels on the Market Price page
yCash (Bank 0)
The text row for the cash levels on the Market Price page
yMarketPrice (Bank 0)
The text row for the Market Price title for each language
Macros
ITEM (Common)
Macro definition for the market prices table
Maths (Arithmetic)
Addition, subtraction, multiplication, division
Subroutines
ADD (Bank 7) *
Calculate (A X) = (A P) + (S R)
DORND (Bank 7) *
Generate random numbers
DV41 (Bank 7)
Calculate (P R) = 256 * DELTA / A
DV42 (Bank 7)
Calculate (P R) = 256 * DELTA / z_hi
DVID3B2 (Bank 7)
Calculate K(3 2 1 0) = (A P+1 P) / (z_sign z_hi z_lo)
DVID4 (Bank 7) *
Calculate (P R) = 256 * A / Q
DVIDT (Bank 1)
Calculate (P+1 A) = (A P) / Q
FMLTU (Bank 7)
Calculate A = A * Q / 256
FMLTU2 (Bank 7)
Calculate A = K * sin(A)
GC2 (Bank 0)
Calculate (Y X) = (A P) * 4
LCASH (Bank 0)
Subtract an amount of cash from the cash pot
LL120 (Bank 1)
Calculate (Y X) = (S x1_lo) * XX12+2 or (S x1_lo) / XX12+2
LL123 (Bank 1)
Calculate (Y X) = (S R) / XX12+2 or (S R) * XX12+2
LL129 (Bank 1)
Calculate Q = XX12+2, A = S EOR XX12+3 and (S R) = |S R|
LL28 (Bank 7)
Calculate R = 256 * A / Q
LL38 (Bank 1)
Calculate (S A) = (S R) + (A Q)
LL5 (Bank 7)
Calculate Q = SQRT(R Q)
LL61 (Bank 1)
Calculate (U R) = 256 * A / Q
LL62 (Bank 1)
Calculate 128 - (U R)
MAD (Bank 7)
Calculate (A X) = Q * A + (S R)
MAS3 (Bank 0)
Calculate A = x_hi^2 + y_hi^2 + z_hi^2 in the K% block
MCASH (Bank 0)
Add an amount of cash to the cash pot
MLS1 (Bank 7)
Calculate (A P) = ALP1 * A
MLS2 (Bank 7)
Calculate (S R) = XX(1 0) and (A P) = A * ALP1
MLTU2 (Bank 7)
Calculate (A P+1 P) = (A ~P) * Q
MLU1 (Bank 7)
Calculate Y1 = y_hi and (A P) = |y_hi| * Q for Y-th stardust
MLU2 (Bank 7)
Calculate (A P) = |A| * Q
MU1 (Bank 7)
Copy X into P and A, and clear the C flag
MU11 (Bank 7)
Calculate (A P) = P * X
MU5 (Bank 7)
Set K(3 2 1 0) = (A A A A) and clear the C flag
MU6 (Bank 7)
Set P(1 0) = (A A)
MULT1 (Bank 7)
Calculate (A P) = Q * A
MULT12 (Bank 7)
Calculate (S R) = Q * A
MULT3 (Bank 7)
Calculate K(3 2 1 0) = (A P+1 P) * Q
MULTU (Bank 7) *
Calculate (A P) = P * Q
MUT1 (Bank 7)
Calculate R = XX and (A P) = Q * A
MUT2 (Bank 7)
Calculate (S R) = XX(1 0) and (A P) = Q * A
MUT3 (Bank 7)
An unused routine that does the same as MUT2
SPS2 (Bank 0)
Calculate X = A / 16
SQUA (Bank 7)
Clear bit 7 of A and calculate (A P) = A * A
SQUA2 (Bank 7)
Calculate (A P) = A * A
TAS1 (Bank 0)
Calculate K3 = (x_sign x_hi x_lo) - V(1 0)
TIS1 (Bank 7)
Calculate (A ?) = (-X * A + (S R)) / 96
TIS2 (Bank 7)
Calculate A = A / Q
TIS3 (Bank 1)
Calculate -(nosev_1 * roofv_1 + nosev_2 * roofv_2) / nosev_3
VCSU1 (Bank 0)
Calculate vector K3(8 0) = [x y z] - coordinates of the sun or space station
VCSUB (Bank 0)
Calculate vector K3(8 0) = [x y z] - coordinates in (A V)
Variables
antilog (Bank 7)
Binary antilogarithm table
antilogODD (Bank 7)
Binary antilogarithm table
log (Bank 7)
Binary logarithm table (high byte)
logL (Bank 7)
Binary logarithm table (low byte)
Maths (Geometry)
Vectors, coordinates, dot products and matrices
Subroutines
ARCTAN (Bank 1)
Calculate A = arctan(P / Q)
FAROF (Bank 0)
Compare x_hi, y_hi and z_hi with 224
FAROF2 (Bank 7)
Compare x_hi, y_hi and z_hi with A
LL51 (Bank 1)
Calculate the dot product of XX15 and XX16
MAS1 (Bank 0)
Add an orientation vector coordinate to an INWK coordinate
MAS2 (Bank 0)
Calculate a cap on the maximum distance to the planet or sun
MAS4 (Bank 0)
Calculate a cap on the maximum distance to a ship
NORM (Bank 7) *
Normalise the three-coordinate vector in XX15
PROJ (Bank 7)
Project the current ship or planet onto the screen
SPS1 (Bank 0)
Calculate the vector to the planet and store it in XX15
SPS3 (Bank 0)
Copy a space coordinate from the K% block into K3
SPS4 (Bank 0)
Calculate the vector to the space station
TAS2 (Bank 0)
Normalise the three-coordinate vector in K3
TAS3 (Bank 7)
Calculate the dot product of XX15 and an orientation vector
TAS4 (Bank 0)
Calculate the dot product of XX15 and one of the space station's orientation vectors
TAS6 (Bank 0)
Negate the vector in XX15 so it points in the opposite direction
TIDY (Bank 1) *
Orthonormalise the orientation vectors for a ship
TIDY_b1 (Bank 7)
Call the TIDY routine in ROM bank 1
Variables
ACT (Bank 7)
Arctan table
SNE (Bank 7)
Sine/cosine table
Missions
Hunting ships, evading Thargoids... and Trumbles
Subroutines
BRIEF (Bank 0)
Start mission 1 and show the mission briefing
BRIEF2 (Bank 0)
Start mission 2
BRIEF3 (Bank 0)
Receive the briefing and plans for mission 2
BRIS (Bank 2)
Clear the screen, display "INCOMING MESSAGE" and wait for 2 seconds
BRIS_b0 (Bank 0)
Clear the screen, display "INCOMING MESSAGE" and wait for 2 seconds
BRP (Bank 0)
Print an extended token and show the Status Mode screen
DEBRIEF (Bank 0)
Finish mission 1
DEBRIEF2 (Bank 0)
Finish mission 2
PAS1 (Bank 0)
Display a rotating ship at space coordinates (0, 100, 256) and scan the controllers
PAS1_b0 (Bank 7)
Call the PAS1 routine in ROM bank 0
PAUSE (Bank 2)
Display a rotating ship, waiting until a key is pressed, then remove the ship from the screen
TBRIEF (Bank 0)
Start mission 3
THERE (Bank 0)
Check whether we are in the Constrictor's system in mission 1
Moving
Moving and rotating ships and planets in space
Subroutines
MV40 (Bank 0)
Rotate the planet or sun's location in space by the amount of pitch and roll of our ship
MVEIT (Part 1 of 9) (Bank 0)
Move current ship: Tidy the orientation vectors
MVEIT (Part 2 of 9) (Bank 0)
Move current ship: Call tactics routine, remove ship from scanner
MVEIT (Part 3 of 9) (Bank 0)
Move current ship: Move ship forward according to its speed
MVEIT (Part 4 of 9) (Bank 0)
Move current ship: Apply acceleration to ship's speed as a one-off
MVEIT (Part 5 of 9) (Bank 0)
Move current ship: Rotate ship's location by our pitch and roll
MVEIT (Part 6 of 9) (Bank 0)
Move current ship: Move the ship in space according to our speed
MVEIT (Part 7 of 9) (Bank 0)
Move current ship: Rotate ship's orientation vectors by pitch/roll
MVEIT (Part 8 of 9) (Bank 0)
Move current ship: Rotate ship about itself by its own pitch/roll
MVEIT (Part 9 of 9) (Bank 0)
Move current ship: Redraw on scanner, if it hasn't been destroyed
MVS4 (Bank 0) *
Apply pitch and roll to an orientation vector
MVS5 (Bank 0)
Apply a 3.6 degree pitch or roll to an orientation vector
MVS5_b0 (Bank 7)
Call the MVS5 routine in ROM bank 0
MVT1 (Bank 0)
Calculate (x_sign x_hi x_lo) = (x_sign x_hi x_lo) + (A R)
MVT3 (Bank 0)
Calculate K(3 2 1) = (x_sign x_hi x_lo) + K(3 2 1)
MVT6 (Bank 0)
Calculate (A P+2 P+1) = (x_sign x_hi x_lo) + (A P+2 P+1)
SFS2 (Bank 0)
Move a ship in space along one of the coordinate axes
PPU
Sending data to the Picture Processing Unit (PPU)
Subroutines
ConsiderSendTiles (Bank 7)
If there are enough free cycles, move on to the next stage of sending patterns to the PPU
SendBarNamesToPPU (Bank 7)
Send the nametable entries for the icon bar to the PPU
SendBarNamesToPPUS (Bank 7)
Send the nametable entries for the icon bar to the PPU (this is a jump so we can call this routine using a branch instruction)
SendBarPatts2ToPPU (Bank 7)
Send pattern data for tiles 64-127 for the icon bar to the PPU, split across multiple calls to the NMI handler if required
SendBarPattsToPPU (Bank 7)
Send pattern data for tiles 0-127 for the icon bar to the PPU, split across multiple calls to the NMI handler if required
SendBarPattsToPPUS (Bank 7)
Send the pattern data for the icon bar to the PPU (this is a jump so we can call this routine using a branch instruction)
SendBitplaneToPPU (Bank 3)
Send a bitplane to the PPU immediately
SendBitplaneToPPU_b3 (Bank 7)
Call the SendBitplaneToPPU routine in ROM bank 3
SendBuffersToPPU (Part 1 of 3) (Bank 7)
Send the icon bar nametable and palette data to the PPU, if it has changed, before moving on to tile data in part 2
SendBuffersToPPU (Part 2 of 3) (Bank 7)
If we are already sending tile data to the PPU, pick up where we left off, otherwise jump to part 3 to check for new data to send
SendBuffersToPPU (Part 3 of 3) (Bank 7)
If we need to send tile nametable and pattern data to the PPU for either bitplane, start doing just that
SendDashImageToPPU (Bank 3)
Unpack the dashboard image and send it to patterns 69 to 255 in pattern table 0 in the PPU
SendDataNowToPPU (Bank 3)
Send the specified bitplane buffers to the PPU immediately, without trying to squeeze it into VBlanks
SendFontImageToPPU (Bank 3)
Send a font to the PPU as a colour 1 font on a colour 0 background (i.e. colour 1 on black)
SendInventoryToPPU (Bank 7)
Send X batches of 16 bytes from SC(1 0) to the PPU, for sending the inventory icon bar image
SendNametableToPPU (Bank 7)
Send the tile nametable to the PPU if there are enough cycles left in the current VBlank
SendOtherBitplane (Bank 7)
Check whether we should send another bitplane to the PPU
SendPalettesToPPU (Bank 7)
Send the palette data from XX3 to the PPU
SendPatternsToPPU (Part 1 of 6) (Bank 7)
Calculate how many patterns we need to send and jump to the most efficient routine for sending them
SendPatternsToPPU (Part 2 of 6) (Bank 7)
Configure variables for sending data to the PPU one pattern at a time with checks
SendPatternsToPPU (Part 3 of 6) (Bank 7)
Send pattern data to the PPU for one pattern at a time, checking after each one to see if is the last one
SendPatternsToPPU (Part 4 of 6) (Bank 7)
Configure variables for sending data to the PPU until we run out of cycles
SendPatternsToPPU (Part 5 of 6) (Bank 7)
Send pattern data to the PPU for two patterns at a time, until we run out of cycles (and without checking for the last pattern)
SendPatternsToPPU (Part 6 of 6) (Bank 7)
Save progress for use in the next VBlank and return from the subroutine
SendScreenToPPU (Bank 7) *
Update the screen with the contents of the buffers
SendSpaceViewToPPU (Bank 0)
Set a new space view, clear the screen, copy the nametable buffers and configure the PPU for the new view
SendTilesToPPU (Bank 7)
Set up the variables needed to send the tile nametable and pattern data to the PPU, and then send them
SendViewToPPU (Bank 3)
Configure the PPU for the view type in QQ11
SendViewToPPU_b3 (Bank 7)
Call the SendViewToPPU routine in ROM bank 3
SetPPURegisters (Bank 7)
Set PPU_CTRL, PPU_ADDR and PPU_SCROLL for the current hidden bitplane
SetPPUTablesTo0 (Bank 7)
Set nametable 0 and pattern table 0 for drawing the icon bar
SetupPPUForIconBar (Bank 7)
If the PPU has started drawing the icon bar, configure the PPU to use nametable 0 and pattern table 0, while preserving A
SetupSprite0 (Bank 3)
Set the coordinates of sprite 0 so we can detect when the PPU starts to draw the icon bar
UpdateHangarView (Bank 7)
Update the hangar view on-screen by sending the data to the PPU, either immediately or during VBlank
UpdateScreen (Bank 7)
Update the screen by sending data to the PPU, either immediately or during VBlank, depending on whether the screen is visible
WaitForIconBarPPU (Bank 7)
Wait until the PPU starts drawing the icon bar
WaitForPPUToFinish (Bank 7)
Wait until the NMI handler has finished updating both bitplanes, so the screen is no longer refreshing
Macros
SETUP_PPU_FOR_ICON_BAR (Common)
If the PPU has started drawing the icon bar, configure the PPU to use nametable 0 and pattern table 0
Save and load
Commander files, save slots and cheat codes
Subroutines
ChangeCmdrName (Bank 6)
Process changing the commander name
ChangeCmdrName_b6 (Bank 7)
Call the ChangeCmdrName routine in ROM bank 6
CheckSaveLoadBar (Bank 6)
Check the icon bar buttons on the Save and Load icon bar and process any choices
CheckSaveSlots (Bank 6)
Load the commanders for all eight save slots, one after the other, to check their integrity and reset any that fail their checksums
CheckSaveSlots_b6 (Bank 7)
Call the CheckSaveSlots routine in ROM bank 6
ClearNameInMiddle (Bank 6)
Remove the commander name from the middle column
CopyCommanderToBuf (Bank 6)
Copy a commander file in the BUF buffer, either from a save slot or from the currently active commander in-game
DrawSaveSlotMark (Bank 6)
Draw a slot mark (a dash) next to a saved slot
DrawSmallLogo (Bank 4)
Set the sprite buffer entries for the small Elite logo on the Save and Load screen
DrawSmallLogo_b4 (Bank 7)
Call the DrawSmallLogo routine in ROM bank 4
FILEPR (Bank 2)
Display the currently selected media (disc or tape)
GetSaveAddresses (Bank 6)
Fetch the addresses of the three saved parts for a specific save slot
HighlightSaveName (Bank 6)
Highlight the name of a specific save slot
JAMESON (Bank 6)
Copy the default "JAMESON" commander to the buffer at currentSlot
JAMESON_b6 (Bank 7)
Call the JAMESON routine in ROM bank 6
MoveInLeftColumn (Bank 6)
Process moving the highlight when it's in the left column (the current commander)
MoveInMiddleColumn (Bank 6)
Process moving the highlight when it's in the middle column
MoveInRightColumn (Bank 6)
Process moving the highlight when it's in the right column (the save slots)
MoveToLeftColumn (Bank 6)
Move the highlight to the left column (the current commander)
OTHERFILEPR (Bank 2)
Display the non-selected media (disc or tape)
PrintCommanderName (Bank 6)
Print the commander name from the commander file in BUF, with the save count added to the end
PrintNameInMiddle (Bank 6)
Print the commander name in the middle column using the highlight font
PrintSaveHeader (Bank 6)
Print header text for the Save and Load screen
PrintSaveName (Bank 6)
Print the name of a specific save slot
ResetCommander (Bank 6)
Reset the current commander to the default "JAMESON" commander
ResetCommander_b6 (Bank 7)
Call the ResetCommander routine in ROM bank 6
ResetSaveBuffer (Bank 6)
Reset the commander file buffer at BUF to the default commander
ResetSaveSlots (Bank 6)
Reset the save slots for all eight save slots, so they will fail their checksums and get reset when they are next checked
saveHeader1_DE (Bank 6)
The Save and Load screen title in German
saveHeader1_EN (Bank 6)
The Save and Load screen title in English
saveHeader1_FR (Bank 6)
The Save and Load screen title in French
saveHeader2_DE (Bank 6)
The subheaders for the Save and Load screen title in German
saveHeader2_EN (Bank 6)
The subheaders for the Save and Load screen title in English
saveHeader2_FR (Bank 6)
The subheaders for the Save and Load screen title in French
SaveLoadCommander (Bank 6)
Either save the commander from BUF into a save slot, or load the commander from BUF into the game and start the game
SVE (Bank 6) *
Display the Save and Load screen and process saving and loading of commander files
SVE_b6 (Bank 7)
Call the SVE routine in ROM bank 6
UpdateSaveCount (Bank 7)
Update the save counter for the current commander
UpdateSaveScreen (Bank 6)
Update the Save and Load screen
Variables
cheatCmdrName (Bank 6)
The commander name that triggers cheat mode in each language
cobraNames (Bank 4)
Nametable entries for the Cobra Mk III shown on the Equip Ship screen
galaxySeeds (Bank 6)
The galaxy seeds to add to a commander save file
NA2% (Bank 6)
The data block for the default commander
saveBracketPatts (Bank 6)
Pattern numbers for the bracket on the Save and Load screen
saveHeader1Hi (Bank 6)
Lookup table for the high byte of the address of the saveHeader1 text for each language
saveHeader1Lo (Bank 6)
Lookup table for the low byte of the address of the saveHeader1 text for each language
saveHeader2Hi (Bank 6)
Lookup table for the high byte of the address of the saveHeader2 text for each language
saveHeader2Lo (Bank 6)
Lookup table for the low byte of the address of the saveHeader2 text for each language
saveSlotAddr1 (Bank 6)
The address of the first saved part for each save slot
saveSlotAddr2 (Bank 6)
The address of the second saved part for each save slot
saveSlotAddr3 (Bank 6)
The address of the third saved part for each save slot
smallLogoImage (Bank 3)
Packed image data for the small Elite logo shown on the Save and Load screen
smallLogoTile (Bank 4)
Pattern numbers in the smallLogoImage table for the sprites that make up the small Elite logo on the Save and Load screen
xSaveHeader (Bank 6)
The text column for the Save and Load screen headers for each language
Ship hangar
The ship hangar that's displayed on docking
Subroutines
DrawHangarWallLine (Bank 1)
Draw a vertical hangar wall line from top to bottom, stopping when it bumps into existing on-screen content
HAL3 (Bank 1)
Draw a hangar background line from left to right, stopping when it bumps into existing on-screen content
HALL (Bank 1)
Draw the ships in the ship hangar, then draw the hangar
HALL_b1 (Bank 7)
Call the HALL routine in ROM bank 1
HANGER (Bank 1)
Display the ship hangar
HAS1 (Bank 1)
Draw a ship in the ship hangar
HAS3 (Bank 1)
Draw a hangar background line from right to left
Variables
HATB (Bank 1)
Ship hangar group table
yHangarFloor (Bank 1)
Pixel y-coordinates for the four horizontal lines that make up the floor of the ship hangar
Sound
Sound effects, theme music and The Blue Danube
Subroutines
ApplyEnvelopeNOISE (Bank 6)
Apply volume and pitch changes to the NOISE channel
ApplyEnvelopeSQ1 (Bank 6)
Apply volume and pitch changes to the SQ1 channel
ApplyEnvelopeSQ2 (Bank 6)
Apply volume and pitch changes to the SQ2 channel
ApplyEnvelopeTRI (Bank 6)
Apply volume and pitch changes to the TRI channel
BEEP (Bank 7)
Make a short, high beep
BEEP_b7 (Bank 7)
Call the BEEP routine in ROM bank 7
BELL (Bank 2)
Make a standard system beep
BOOP (Bank 7)
Make a long, low beep
ChooseMusic (Bank 6)
Set the tune for the background music
ChooseMusic_b6 (Bank 7)
Call the ChooseMusic routine in ROM bank 6
ChooseMusicS (Bank 6)
A jump table entry at the start of bank 6 for the ChooseMusic routine
ECMOF (Bank 0)
Switch off the E.C.M.
EnableSound (Bank 6)
Enable sounds (music and sound effects)
EnableSoundS (Bank 6)
A jump table entry at the start of bank 6 for the EnableSound routine
EXNO (Bank 0)
Make the sound of a laser strike or ship explosion
EXNO3 (Bank 7)
Make an explosion sound
FlushSoundChannel (Bank 7)
Flush a specific sound channel
FlushSoundChannels (Bank 7)
Flush the SQ1, SQ2 and NOISE sound channels
FlushSpecificSound (Bank 7)
Flush the channels used by a specific sound
FlushSQ2AndNOISE (Bank 7)
Flush the SQ2 and NOISE sound channels
MakeHyperSound (Bank 7)
Make the hyperspace sound
MakeMusic (Bank 6) *
Play the current music on the SQ1, SQ2, TRI and NOISE channels
MakeMusicOnNOISE (Bank 6)
Play the current music on the NOISE channel
MakeMusicOnSQ1 (Bank 6)
Play the current music on the SQ1 channel
MakeMusicOnSQ2 (Bank 6)
Play the current music on the SQ2 channel
MakeMusicOnTRI (Bank 6)
Play the current music on the TRI channel
MakeScoopSound (Bank 7)
Make the sound of the fuel scoops working
MakeSound (Bank 6) *
Make the current sound effects on the SQ1, SQ2 and NOISE channels
MakeSoundOnNOISE (Bank 6)
Make the current sound effect on the NOISE channel
MakeSoundOnSQ1 (Bank 6)
Make the current sound effect on the SQ1 channel
MakeSoundOnSQ2 (Bank 6)
Make the current sound effect on the SQ2 channel
MakeSounds (Bank 6)
Make the current sounds (music and sound effects)
MakeSounds_b6 (Bank 7)
Call the MakeSounds routine in ROM bank 6
MakeSoundsAtVBlank (Bank 7)
Wait for the next VBlank and make the current sounds (music and sound effects)
MakeSoundsS (Bank 6)
A jump table entry at the start of bank 6 for the MakeSounds routine
NOISE (Bank 7) *
Make the sound effect whose number is in Y
ResetMusic (Bank 7)
Reset the current tune to the default and stop all sounds (music and sound effects)
ResetMusicAfterNMI (Bank 7)
Wait for the next NMI before resetting the current tune to 0 and stopping the music
StartEffect (Bank 6)
Start making a sound effect on the specified channel
StartEffect_b6 (Bank 7)
Call the StartEffect routine in ROM bank 6
StartEffect_b7 (Bank 7)
Call the StartEffect routine
StartEffectOnNOISE (Bank 6)
Make a sound effect on the NOISE channel
StartEffectOnNOISES (Bank 6)
A jump table entry at the start of bank 6 for the StartEffectOnNOISE routine
StartEffectOnSQ1 (Bank 6)
Make a sound effect on the SQ1 channel
StartEffectOnSQ1S (Bank 6)
A jump table entry at the start of bank 6 for the StartEffectOnSQ1 routine
StartEffectOnSQ2 (Bank 6)
Make a sound effect on the SQ2 channel
StartEffectOnSQ2S (Bank 6)
A jump table entry at the start of bank 6 for the StartEffectOnSQ2 routine
StopSounds (Bank 6)
Stop all sounds (music and sound effects)
StopSounds_b6 (Bank 7)
Call the StopSounds routine in ROM bank 6
StopSoundsS (Bank 6)
A jump table entry at the start of bank 6 for the StopSounds routine
UpdateVibratoSeeds (Bank 6)
Update the sound seeds that are used to randomise the vibrato effect
Variables
explosionSounds (Bank 0)
Sound numbers for explosions at different distances from our ship
noteFrequency (Bank 6)
A table of note frequencies
pitchEnvelope (Bank 6)
Pitch envelope data for the game music
soundChannel (Bank 7)
The sound channels used by each sound effect
soundData (Bank 6)
Sound data for the sound effects
soundPriority (Bank 7)
The default priority for each sound effect
soundVolume (Bank 6)
Volume envelope data for the sound effects
trumbleSounds (Bank 0)
The range of sounds that the Trumbles make in the hold
tuneData (Bank 6)
Data for the tunes played in the game
volumeEnvelope (Bank 6)
Volume envelope data for the game music
Stardust
Stardust generation and movement
Subroutines
FLIP (Bank 0)
Reflect the stardust particles in the screen diagonal
HideStardust (Bank 7)
Hide the stardust sprites
nWq (Bank 0)
Create a random cloud of stardust
NWSTARS (Bank 0)
Initialise the stardust field
ResetStardust (Bank 0)
Hide the sprites for the stardust
STARS (Bank 1) *
The main routine for processing the stardust
STARS1 (Bank 1)
Process the stardust for the front view
STARS2 (Bank 1)
Process the stardust for the left or right view
STARS6 (Bank 1)
Process the stardust for the rear view
STARS_b1 (Bank 7)
Call the STARS routine in ROM bank 1
Start and end
The title screens... and the Game Over screen
Subroutines
BEGIN (Bank 7)
Run through the NES initialisation process, reset the variables and start the game
BR1 (Bank 0)
Reset a number of variables, ready to start a new game
ChooseLanguage (Bank 6)
Draw the Start screen and process the language choice
ChooseLanguage_b6 (Bank 7)
Call the ChooseLanguage routine in ROM bank 6
DEATH (Bank 0) *
Display the death screen
DEATH2 (Bank 0)
Reset most of the game and restart from the title screen
DEATH2_b0 (Bank 7)
Switch to ROM bank 0 and call the DEATH2 routine
DrawBigLogo (Bank 4)
Set the pattern and nametable buffer entries for the big Elite logo on the Start screen
DrawBigLogo_b4 (Bank 7)
Call the DrawBigLogo routine in ROM bank 4
DrawTitleScreen (Bank 7)
Draw a sequence of rotating ships on-screen while checking for button presses on the controllers
Interrupts_b0 (Bank 0)
The IRQ and NMI handler while the MMC1 mapper reset routine is still running
Interrupts_b1 (Bank 1)
The IRQ and NMI handler while the MMC1 mapper reset routine is still running
Interrupts_b2 (Bank 2)
The IRQ and NMI handler while the MMC1 mapper reset routine is still running
Interrupts_b3 (Bank 3)
The IRQ and NMI handler while the MMC1 mapper reset routine is still running
Interrupts_b4 (Bank 4)
The IRQ and NMI handler while the MMC1 mapper reset routine is still running
Interrupts_b5 (Bank 5)
The IRQ and NMI handler while the MMC1 mapper reset routine is still running
Interrupts_b6 (Bank 6)
The IRQ and NMI handler while the MMC1 mapper reset routine is still running
RES2 (Bank 0)
Reset a number of flight variables and workspaces
RESET (Bank 0)
Reset most variables
ResetMMC1_b0 (Bank 0)
The MMC1 mapper reset routine at the start of the ROM bank
ResetMMC1_b1 (Bank 1)
The MMC1 mapper reset routine at the start of the ROM bank
ResetMMC1_b2 (Bank 2)
The MMC1 mapper reset routine at the start of the ROM bank
ResetMMC1_b3 (Bank 3)
The MMC1 mapper reset routine at the start of the ROM bank
ResetMMC1_b4 (Bank 4)
The MMC1 mapper reset routine at the start of the ROM bank
ResetMMC1_b5 (Bank 5)
The MMC1 mapper reset routine at the start of the ROM bank
ResetMMC1_b6 (Bank 6)
The MMC1 mapper reset routine at the start of the ROM bank
ResetOptions (Bank 7)
Reset the game options to their default values
ResetScreen (Bank 3)
Reset the screen by clearing down the PPU, setting all colours to black, and resetting the screen-related variables
ResetScreen_b3 (Bank 7)
Call the ResetScreen routine in ROM bank 3
ResetToStartScreen (Bank 7)
Reset the stack and the game's variables and show the Start screen
ResetVariables (Bank 7)
Reset all the RAM (in both the NES and cartridge), initialise all the game's variables, and switch to ROM bank 0
SetChosenLanguage (Bank 6)
Set the language-related variables according to the language chosen on the Start screen
SetLanguage (Bank 6)
Set the language-related variables for a specific language
SetupAfterLoad (Bank 0)
Configure the game following a commander file load
SetupAfterLoad_b0 (Bank 7)
Call the SetupAfterLoad routine in ROM bank 0
ShowStartScreen (Bank 0)
Show the start screen and start the game
StartGame (Bank 0)
Reset the stack and game variables, and start the game by going to the docking bay
StartGame_b0 (Bank 7)
Switch to ROM bank 0 and call the StartGame routine
TITLE (Bank 0) *
Display a title screen with a rotating ship and prompt
Variables
bigLogoImage (Bank 4)
Packed image data for the big Elite logo shown on the Start screen
bigLogoNames (Bank 4)
Nametable entries for the big Elite logo on the Start screen
iNES header (iNES header)
The iNES header for running in an emulator
logoBallImage (Bank 3)
Packed image data for the ball at the bottom of the big Elite logo shown on the Start screen
ResetMMC1_b7 (Bank 7)
The MMC1 mapper reset routine at the start of the ROM bank
titleShipDist (Bank 7)
The distances at which to show the rotating title screen ships
titleShipType (Bank 7)
The types of ship to show rotating on the title screen
xLanguage (Bank 6)
The text column for the language buttons on the Start screen
xTitleScreen (Bank 7)
The text column for the title screen's title for each language
yLanguage (Bank 6)
The text row for the language buttons on the Start screen
Status
Showing the commander's status and rank
Subroutines
BAD (Bank 0)
Calculate how bad we have been
BAY (Bank 0)
Go to the docking bay (i.e. show the Status Mode screen)
cmn (Bank 0)
Print the commander's name
csh (Bank 0)
Print the current amount of cash
DrawCmdrImage (Bank 6) *
Draw the commander image as a coloured face image in front of a greyscale headshot image, with optional embellishments
DrawCmdrImage_b6 (Bank 7)
Call the DrawCmdrImage routine in ROM bank 6
DrawGlasses (Bank 6)
Draw a pair of dark glasses on the commander image
DrawLeftEarring (Bank 6)
Draw an earring in the commander's left ear (i.e. on the right side of the commander image
DrawMedallion (Bank 6)
Draw a medallion on the commander image
DrawRightEarring (Bank 6)
Draw an earring in the commander's right ear (i.e. on the left side of the commander image
EXNO2 (Bank 0)
Process us making a kill
fwl (Bank 0)
Print fuel and cash levels
GetCmdrImage (Bank 4)
Fetch the headshot image for the commander and store it in the pattern buffers, and send the face and glasses images to the PPU
GetCmdrImage_b4 (Bank 7)
Call the GetCmdrImage routine in ROM bank 4
GetHeadshot (Bank 4)
Fetch the headshot image for the commander and store it in the pattern buffers, starting at pattern number picturePattern
GetHeadshot_b4 (Bank 7)
Call the GetHeadshot routine in ROM bank 4
GetHeadshotType (Bank 4)
Get the correct headshot number for the current combat rank and status condition
GetHeadshotType_b4 (Bank 7)
Call the GetHeadshotType routine in ROM bank 4
GetStatusCondition (Bank 7)
Calculate our ship's status condition
IncreaseTally (Bank 7)
Add the kill count to the fractional and low bytes of our combat rank tally following a kill
PrintCombatRank (Bank 0)
Print the current combat rank
PrintLegalStatus (Bank 0)
Print the current legal status (clean, offender or fugitive)
STATUS (Bank 0) *
Show the Status Mode screen
Variables
alertColours (Bank 7)
Colours for the background of the commander image to show the status condition when we are not looking at the space view
faceCount (Bank 4)
The number of commander face images in the faceOffset table
faceImage0 (Bank 4)
Packed image data for commander face image 0
faceImage1 (Bank 4)
Packed image data for commander face image 1
faceImage10 (Bank 4)
Packed image data for commander face image 10
faceImage11 (Bank 4)
Packed image data for commander face image 11
faceImage12 (Bank 4)
Packed image data for commander face image 12
faceImage13 (Bank 4)
Packed image data for commander face image 13
faceImage2 (Bank 4)
Packed image data for commander face image 2
faceImage3 (Bank 4)
Packed image data for commander face image 3
faceImage4 (Bank 4)
Packed image data for commander face image 4
faceImage5 (Bank 4)
Packed image data for commander face image 5
faceImage6 (Bank 4)
Packed image data for commander face image 6
faceImage7 (Bank 4)
Packed image data for commander face image 7
faceImage8 (Bank 4)
Packed image data for commander face image 8
faceImage9 (Bank 4)
Packed image data for commander face image 9
faceOffset (Bank 4)
Offset to the data for each of the 14 commander face images
glassesImage (Bank 4)
Packed image data for the glasses, earrings and medallion that the commander can wear
headCount (Bank 4)
The number of commander headshot images in the headOffset table
headImage0 (Bank 4)
Packed image data for commander headshot image 0
headImage1 (Bank 4)
Packed image data for commander headshot image 1
headImage10 (Bank 4)
Packed image data for commander headshot image 10
headImage11 (Bank 4)
Packed image data for commander headshot image 11
headImage12 (Bank 4)
Packed image data for commander headshot image 12
headImage13 (Bank 4)
Packed image data for commander headshot image 13
headImage2 (Bank 4)
Packed image data for commander headshot image 2
headImage3 (Bank 4)
Packed image data for commander headshot image 3
headImage4 (Bank 4)
Packed image data for commander headshot image 4
headImage5 (Bank 4)
Packed image data for commander headshot image 5
headImage6 (Bank 4)
Packed image data for commander headshot image 6
headImage7 (Bank 4)
Packed image data for commander headshot image 7
headImage8 (Bank 4)
Packed image data for commander headshot image 8
headImage9 (Bank 4)
Packed image data for commander headshot image 9
headOffset (Bank 4)
Offset to the data for each of the 14 commander headshot images
headShotsByRank (Bank 4)
Lookup table for headshots by rank and status condition
KWH% (Bank 1)
Integer number of kills awarded for destroying each type of ship
KWL% (Bank 1)
Fractional number of kills awarded for destroying each type of ship
xStatusMode (Bank 0)
The text column for the Status Mode entries for each language
yHeadshot (Bank 0)
The text row for the headshot on the Status Mode page
Tactics
AI tactics for enemy ships and missiles
Subroutines
ANGRY (Bank 0)
Make a ship hostile
FR1 (Bank 0)
Display the "missile jammed" message
FRMIS (Bank 0)
Fire a missile from our ship
FRS1 (Bank 0)
Launch a ship straight ahead of us, below the laser sights
HITCH (Bank 0) *
Work out if the ship in INWK is in our crosshairs
SFRMIS (Bank 0)
Add an enemy missile to our local bubble of universe
TACTICS (Part 1 of 7) (Bank 0)
Apply tactics: Process missiles, both enemy missiles and our own
TACTICS (Part 2 of 7) (Bank 0) *
Apply tactics: Escape pod, station, lone Thargon, safe-zone pirate
TACTICS (Part 3 of 7) (Bank 0)
Apply tactics: Calculate dot product to determine ship's aim
TACTICS (Part 4 of 7) (Bank 0)
Apply tactics: Check energy levels, maybe launch escape pod if low
TACTICS (Part 5 of 7) (Bank 0)
Apply tactics: Consider whether to launch a missile at us
TACTICS (Part 6 of 7) (Bank 0)
Apply tactics: Consider firing a laser at us, if aim is true
TACTICS (Part 7 of 7) (Bank 0)
Apply tactics: Set pitch, roll, and acceleration
Text
Recursive text tokens in three languages
Subroutines
BPRNT (Bank 0) *
Print a 32-bit number, left-padded to a specific number of digits, with an optional decimal point
CHPR (Part 1 of 6) (Bank 2)
Print a character at the text cursor by poking into screen memory
CHPR (Part 2 of 6) (Bank 2)
Jump to the right part of the routine depending on whether the font pattern we need is already loaded
CHPR (Part 3 of 6) (Bank 2)
Draw a character into the pattern buffers to show the character on-screen
CHPR (Part 4 of 6) (Bank 2)
Process the delete character
CHPR (Part 5 of 6) (Bank 2)
Print the character using a font that has already been loaded
CHPR (Part 6 of 6) (Bank 2)
Print a character in the space view when the relevant font is not loaded, merging the text with whatever is already on-screen
CHPR_b2 (Bank 7)
Call the CHPR routine in ROM bank 2
DASC_b2 (Bank 7)
Call the DASC routine in ROM bank 2
DETOK (Bank 2)
Print an extended recursive token from the TKN1 token table
DETOK2 (Bank 2)
Print an extended text token (1-255)
DETOK3 (Bank 2)
Print an extended recursive token from the RUTOK token table
DETOK_b2 (Bank 7)
Call the DETOK routine in ROM bank 2
DisableJustifyText (Bank 0)
Turn off justified text and reset the justified text buffer
DTS_b2 (Bank 7)
Call the DTS routine in ROM bank 2
ex (Bank 2)
Print a recursive token
ex_b2 (Bank 7)
Call the ex routine in ROM bank 2
fwls (Bank 0)
Print fuel and cash levels
LoadHighFont (Bank 3)
Load the highlight font into the pattern buffer from pattern 161 to 255
LoadHighFont_b3 (Bank 7)
Call the LoadHighFont routine in ROM bank 3
LoadNormalFont (Bank 3)
Load the normal font into the pattern buffer from pattern 66 to 160
LoadNormalFont_b3 (Bank 7)
Call the LoadNormalFont routine in ROM bank 3
MT1 (Bank 2)
Switch to ALL CAPS when printing extended tokens
MT13 (Bank 2)
Switch to lower case when printing extended tokens
MT14 (Bank 2)
Switch to justified text when printing extended tokens
MT15 (Bank 2)
Switch to left-aligned text when printing extended tokens
MT16 (Bank 2)
Print the character in variable DTW7
MT17 (Bank 2)
Print the selected system's adjective, e.g. Lavian for Lave
MT18 (Bank 2)
Print a random 1-8 letter word in Sentence Case
MT19 (Bank 2)
Capitalise the next letter
MT2 (Bank 2)
Switch to Sentence Case when printing extended tokens
MT23 (Bank 2)
Move to row 9 and switch to lower case when printing extended tokens
MT26 (Bank 2)
Print a space and capitalise the next letter
MT27 (Bank 2)
Print the captain's name during mission briefings
MT28 (Bank 2)
Print the location hint during the mission 1 briefing
MT29 (Bank 2)
Move to row 7 and switch to lower case when printing extended tokens
MT5 (Bank 2)
Switch to extended tokens
MT6 (Bank 2)
Switch to standard tokens in Sentence Case
MT8 (Bank 2)
Tab to column 6 and start a new word when printing extended tokens
MT9 (Bank 2)
Clear the screen and set the view type for a text-based mission
PDESC_b2 (Bank 7)
Call the PDESC routine in ROM bank 2
plf (Bank 0)
Print a text token followed by a newline
pr2 (Bank 0)
Print an 8-bit number, left-padded to 3 digits, and optional point
pr5 (Bank 0)
Print a 16-bit number, left-padded to 5 digits, and optional point
pr6 (Bank 0)
Print 16-bit number, left-padded to 5 digits, no point
Print2Spaces (Bank 0)
Print two spaces
Print4Spaces (Bank 0)
An unused routine that prints four spaces
PrintCharacter (Bank 0)
An unused routine that prints a character and sets the C flag
PrintCrTab (Bank 0)
Print a newline and the correct indent for Status Mode entries in the chosen language
PrintCtrlCode (Bank 0)
Print a control code (in the range 0 to 9)
PrintCtrlCode_b0 (Bank 7)
Call the PrintCtrlCode routine in ROM bank 0
PrintFlightMessage (Bank 0)
Print an in-flight message
PrintMessage (Bank 0)
Print a message in the middle of the screen (used for "GAME OVER" and demo missile messages only)
PrintSpaceAndToken (Bank 0)
Print a space followed by a text token
PrintSpacedHyphen (Bank 0)
Print two spaces, then a "-", and then another two spaces
PrintSpaceViewName (Bank 0)
Print the name of the current space view
PrintTokenAndColon (Bank 0)
Print a character followed by a colon, ensuring that the colon is always drawn in colour 3 on a black background
PrintTokenCrTab (Bank 0)
Print a token, a newline and the correct indent for Status Mode entries in the chosen language
prq (Bank 0)
Print a text token followed by a question mark
qw (Bank 2)
Print a recursive token in the range 128-145
spc (Bank 0)
Print a text token followed by a space
StoreMessage (Bank 0)
Copy a message from the justified text buffer at BUF into the message buffer
tals (Bank 0)
Print the current galaxy number
TT11 (Bank 0)
Print a 16-bit number, left-padded to n digits, and optional point
TT162 (Bank 0)
Print a space
TT26 (Bank 2) *
Print a character at the text cursor, with support for verified text in extended tokens
TT27 (Bank 2) *
Print a text token
TT27_b2 (Bank 7)
Call the TT27 routine in ROM bank 2
TT41 (Bank 2)
Print a letter according to Sentence Case
TT42 (Bank 2)
Print a letter in lower case
TT43 (Bank 2)
Print a two-letter token or recursive token 0-95
TT45 (Bank 2)
Print a letter in lower case
TT60 (Bank 0)
Print a text token and a paragraph break
TT67 (Bank 0)
Print a newline
TT68 (Bank 0)
Print a text token followed by a colon
TT69 (Bank 0)
Set Sentence Case and print a newline
TT73 (Bank 0)
Print a colon
TTX69 (Bank 0)
Print a paragraph break
VOWEL (Bank 2)
Test whether a character is a vowel
ypls (Bank 0)
Print the current system name
Variables
characterEndLang (Bank 6)
The number of the character beyond the end of the printable character set in each language
Copyright and version message (Bank 3)
A copyright and version message buried in the code
Copyright message (Bank 5)
A copyright message buried in the code, complete with typo
decimalPointLang (Bank 6)
The decimal point character to use for each language
extendedTokensHi (Bank 6)
High byte of the extended text token table for each language
extendedTokensLo (Bank 6)
Low byte of the extended text token table for each language
fontImage (Bank 7)
Image data for the text font
JMTB (Bank 2)
The extended token table for jump tokens 1-32 (DETOK)
languageIndexes (Bank 6)
The index of the chosen language for looking up values from language-indexed tables
languageLength (Bank 6)
The length of each language name
languageNumbers (Bank 6)
The language number for each language, as a set bit within a flag byte
lowerCase (Bank 2)
Lookup table for converting ASCII characters to lower case characters in the game's text font
MTIN (Bank 2)
Lookup table for random tokens in the extended token table (0-37)
NRU (Bank 2)
The number of planetary systems with extended system description overrides in the RUTOK table (NRU%) in three different languages
QQ16 (Bank 2)
The two-letter token lookup table
QQ18 (Bank 2)
The recursive token table for tokens 0-148
QQ18_DE (Bank 2)
The recursive token table for tokens 0-148 (German)
QQ18_FR (Bank 2)
The recursive token table for tokens 0-148 (French)
RUGAL (Bank 2)
The criteria for systems with extended description overrides
RUGAL_DE (Bank 2)
The criteria for systems with extended description overrides (German)
RUGAL_FR (Bank 2)
The criteria for systems with extended description overrides (French)
rugalHi (Bank 2)
Address lookup table for the RUGAL text token table in three different languages (high byte)
rugalLo (Bank 2)
Address lookup table for the RUGAL text token table in three different languages (low byte)
RUPLA (Bank 2)
System numbers that have extended description overrides
RUPLA_DE (Bank 2)
System numbers that have extended description overrides (German)
RUPLA_FR (Bank 2)
System numbers that have extended description overrides (French)
ruplaHi (Bank 2)
Address lookup table for the RUPLA text token table in three different languages (high byte)
ruplaLo (Bank 2)
Address lookup table for the RUPLA text token table in three different languages (low byte)
RUTOK (Bank 2)
The second extended token table for recursive tokens 0-26 (DETOK3)
RUTOK_DE (Bank 2)
The second extended token table for recursive tokens 0-26 (DETOK3) (German)
RUTOK_FR (Bank 2)
The second extended token table for recursive tokens 0-26 (DETOK3) (French)
rutokHi (Bank 2)
Address lookup table for the RUTOK text token table in three different languages (high byte)
rutokLo (Bank 2)
Address lookup table for the RUTOK text token table in three different languages (low byte)
TENS (Bank 0)
A constant used when printing large numbers in BPRNT
TKN1 (Bank 2)
The first extended token table for recursive tokens 0-255 (DETOK)
TKN1_DE (Bank 2)
The first extended token table for recursive tokens 0-255 (DETOK) (German)
TKN1_FR (Bank 2)
The first extended token table for recursive tokens 0-255 (DETOK) (French)
TKN2 (Bank 2)
The extended two-letter token lookup table
tokensHi (Bank 6)
High byte of the text token table for each language
tokensLo (Bank 6)
Low byte of the text token table for each language
versionNumber_b0 (Bank 0)
The game's version number in bank 0
versionNumber_b1 (Bank 1)
The game's version number in bank 1
versionNumber_b2 (Bank 2)
The game's version number in bank 2
versionNumber_b3 (Bank 3)
The game's version number in bank 3
versionNumber_b4 (Bank 4)
The game's version number in bank 4
versionNumber_b5 (Bank 5)
The game's version number in bank 5
versionNumber_b6 (Bank 6)
The game's version number in bank 6
Macros
CHAR (Common)
Macro definition for characters in the recursive token table
CONT (Common)
Macro definition for control codes in the recursive token table
ECHR (Common)
Macro definition for characters in the extended token table
EJMP (Common)
Macro definition for jump tokens in the extended token table
ERND (Common)
Macro definition for random tokens in the extended token table
ETOK (Common)
Macro definition for recursive tokens in the extended token table
ETWO (Common)
Macro definition for two-letter tokens in the extended token table
RTOK (Common)
Macro definition for recursive tokens in the recursive token table
TOKN (Common)
Macro definition for standard tokens in the extended token table
TWOK (Common)
Macro definition for two-letter tokens in the token table
Universe
Ship spawning, local bubble, system/market data
Subroutines
cpl (Bank 0)
Print the selected system name
DrawSystemImage (Bank 3) *
Draw the system image as a coloured foreground in front of a greyscale background
DrawSystemImage_b3 (Bank 7)
Call the DrawSystemImage routine in ROM bank 3
GetSystemBack (Bank 5)
Fetch the background image for the current system and store it in the pattern buffers
GetSystemBack_b5 (Bank 7)
Call the GetSystemBack routine in ROM bank 5
GetSystemImage (Bank 5)
Fetch the background image and foreground sprite for the current system image and send them to the pattern buffers and PPU
GetSystemImage_b5 (Bank 7)
Call the GetSystemImage routine in ROM bank 5
GINF (Bank 7)
Fetch the address of a ship's data block into INF
GTHG (Bank 0)
Spawn a Thargoid ship and a Thargon companion
GVL (Bank 0)
Calculate the availability of market items
hyp1 (Bank 0)
Process a jump to the system closest to (QQ9, QQ10)
jmp (Bank 0)
Set the current system to the selected system
KILLSHP (Bank 0) *
Remove a ship from our local bubble of universe
KS1 (Bank 0)
Remove the current ship from our local bubble of universe
KS2 (Bank 0)
Check the local bubble for missiles with target lock
KS4 (Bank 0)
Remove the space station and replace it with the sun
NwS1 (Bank 0)
Flip the sign and double an INWK byte
NWSHP (Bank 0)
Add a new ship to our local bubble of universe
NWSPS (Bank 0)
Add a new space station to our local bubble of universe
PDESC (Bank 2)
Print the system's extended description or a mission 1 directive
ping (Bank 0)
Set the selected system to the current system
RemoveShip (Bank 0)
Fetch a ship data block and remove that ship from our local bubble of universe
SelectNearbySystem (Bank 0)
Set the current system to the nearest system and update the selected system flags accordingly
SetCurrentSystem (Bank 0)
Set the seeds for the selected system to the system that we last snapped the crosshairs to
SetSelectedSeeds (Bank 0)
Set the seeds for the selected system in QQ15 to the seeds in the safehouse
SetSelectedSystem (Bank 0)
Set the selected system to the nearest system, if we don't already have a selected system
SetSelectionFlags (Bank 0)
Set the selected system flags for the currently selected system and update the icon bar if required
SFS1 (Bank 0) *
Spawn a child ship from the current (parent) ship
SOLAR (Bank 0)
Set up various aspects of arriving in a new system
SOS1 (Bank 0)
Update the missile indicators, set up the planet data block
SpawnSpaceStation (Bank 0)
Add a space station to the local bubble of universe if we are close enough to the station's orbit
SPIN (Bank 0)
Randomly spawn cargo from a destroyed ship
tal (Bank 0)
Print the current galaxy number
TT111 (Bank 0)
Set the current system to the nearest system to a point
TT146 (Bank 0)
Print the distance to the selected system in light years
TT20 (Bank 0)
Twist the selected system's seeds four times
TT24 (Bank 6) *
Calculate system data from the system seeds
TT24_b6 (Bank 7)
Call the TT24 routine in ROM bank 6
TT25 (Bank 0) *
Show the Data on System screen
TT54 (Bank 0) *
Twist the selected system's seeds
TT70 (Bank 0)
Display "MAINLY " and jump to TT72
TT81 (Bank 0)
Set the selected system's seeds to those of system 0
ypl (Bank 0)
Print the current system name
Ze (Bank 7)
Initialise the INWK workspace to a hostile ship
ZINF (Bank 0)
Reset the INWK workspace and orientation vectors
ZINF_b1 (Bank 1)
Reset the INWK workspace and orientation vectors
Variables
radiusText (Bank 0)
The text string "RADIUS" for use in the Data on System screen
systemCount (Bank 5)
The number of system images in the systemOffset table
systemImage0 (Bank 5)
Packed image data for system image 0
systemImage1 (Bank 5)
Packed image data for system image 1
systemImage10 (Bank 5)
Packed image data for system image 10
systemImage11 (Bank 5)
Packed image data for system image 11
systemImage12 (Bank 5)
Packed image data for system image 12
systemImage13 (Bank 5)
Packed image data for system image 13
systemImage14 (Bank 5)
Packed image data for system image 14
systemImage2 (Bank 5)
Packed image data for system image 2
systemImage3 (Bank 5)
Packed image data for system image 3
systemImage4 (Bank 5)
Packed image data for system image 4
systemImage5 (Bank 5)
Packed image data for system image 5
systemImage6 (Bank 5)
Packed image data for system image 6
systemImage7 (Bank 5)
Packed image data for system image 7
systemImage8 (Bank 5)
Packed image data for system image 8
systemImage9 (Bank 5)
Packed image data for system image 9
systemOffset (Bank 5)
Offset to the data for each of the 15 system images
systemPalettes (Bank 3)
Palettes for the system images
UNIV (Bank 7)
Table of pointers to the local universe's ship data blocks
xDataOnSystem (Bank 0)
The text column for the Data on System title for each language
Utility routines
NMI, memory, delay and bank-switching routines
Subroutines
ClearMemory (Bank 7)
Clear a block of memory, split across multiple calls if required
CopyLargeBlock (Bank 7)
An unused routine that copies a large number of pages in memory
CopySmallBlock (Bank 7)
An unused routine that copies a small number of pages in memory
DELAY (Bank 7)
Wait until a specified number of NMI interrupts have passed (i.e. a specified number of VBlanks)
FillMemory (Bank 7)
Fill a block of memory with a specified value
FillMemory32Bytes (Bank 7)
Fill a 32-byte block of memory with a specified value
IRQ (Bank 7)
Handle IRQ interrupts by doing nothing
NMI (Bank 7) *
The NMI interrupt handler that gets called every VBlank and which updates the screen, reads the controllers and plays music
ResetBank (Bank 7)
Retrieve a ROM bank number from the stack and page that bank into memory at $8000
ResetBankA (Bank 7)
Page a specified bank into memory at $8000 while preserving the value of A
ResetBankP (Bank 7)
Page a specified bank into memory at $8000 while preserving the value of A and the processor flags
SetAXTo15 (Bank 0)
An unused routine that sets A and X to 15
SetBank (Bank 7) *
Page a specified ROM bank into memory at $8000
SetBank0 (Bank 7)
Page ROM bank 0 into memory at $8000
SetNonZeroBank (Bank 7)
An unused routine that pages a specified ROM bank into memory at $8000, but only if it is non-zero
SetupMMC1 (Bank 7)
Configure the MMC1 mapper and page ROM bank 0 into memory at $8000
UnpackToPPU (Bank 7) *
Unpack compressed image data and send it to the PPU
UnpackToRAM (Bank 7) *
Unpack compressed image data to RAM
UpdateNMITimer (Bank 7)
Update the NMI timer, which we can use to keep track of time for places like the combat demo
WaitFor2NMIs (Bank 7)
Wait until two NMI interrupts have passed (i.e. the next two VBlanks)
WaitFor3xVBlank (Bank 7)
Wait for three VBlanks to pass
WaitForNextNMI (Bank 7)
An unused routine that waits until the NMI counter increments (i.e. the next VBlank)
WaitForNMI (Bank 7)
Wait until the next NMI interrupt has passed (i.e. the next VBlank)
WaitForVBlank (Bank 7)
Wait for the next VBlank to pass
ZERO (Bank 0)
Reset the local bubble of universe and ship status
Variables
Vectors_b0 (Bank 0)
Vectors and padding at the end of ROM bank 0
Vectors_b1 (Bank 1)
Vectors and padding at the end of ROM bank 1
Vectors_b2 (Bank 2)
Vectors and padding at the end of ROM bank 2
Vectors_b3 (Bank 3)
Vectors and padding at the end of ROM bank 3
Vectors_b4 (Bank 4)
Vectors and padding at the end of ROM bank 4
Vectors_b5 (Bank 5)
Vectors and padding at the end of ROM bank 5
Vectors_b6 (Bank 6)
Vectors and padding at the end of ROM bank 6
Vectors_b7 (Bank 7)
Vectors at the end of ROM bank 7
Workspaces
Collections of important variables into blocks
Workspaces
Cartridge WRAM (Common)
The 8K of battery-backed RAM in the Elite cartridge, which is used for the graphics buffers and storing saved commanders
K% (Common) *
Ship data blocks
Sprite buffer (Common)
Configuration data for sprites 0 to 63, which gets copied to the PPU to update the screen
WP (Common)
Ship slots, variables
XX3 (Common)
Temporary storage space for complex calculations
ZP (Common) *
Lots of important variables are stored in the zero page workspace as it is quicker and more space-efficient to access memory here
Elite-A source code
Angus Duggan's extended version of Elite
Version information
About Elite-A
Information on the extended version of Elite
Different variants of Elite-A
Code variations found in Elite-A
Elite-A source code by file
Map of the source code
An overview of how the source code for Elite is structured
Annotated original source files
The source files in their original structure
Game loader
Loader source
The loading screen, copy protection and set-up for the main game
Text tokens
Elite's tokenised game text
Missile ship blueprint
The ship blueprint for the missile
Main game docked code
Docked workspaces
The main variable workspaces used when docked
Elite A docked source
Part 1 of the main docked code
Elite B docked source
Part 2 of the main docked code
Elite C docked source
Part 3 of the main docked code
Elite D docked source
Part 4 of the main docked code
Elite E docked source
Part 5 of the main docked code
Elite F docked source
Part 6 of the main docked code
Elite G docked source
Part 7 of the main docked code
Elite H docked source
Part 8 of the main docked code
Ship hangar blueprints
Data for ships in the ship hangar
Main game flight code
Flight workspaces
The main variable workspaces used in flight
Elite A flight source
Part 1 of the main flight code
Elite B flight source
Part 2 of the main flight code
Elite C flight source
Part 3 of the main flight code
Elite D flight source
Part 4 of the main flight code
Elite E flight source
Part 5 of the main flight code
Elite F flight source
Part 6 of the main flight code
Elite G flight source
Part 7 of the main flight code
Elite H flight source
Part 8 of the main flight code
Main game encyclopedia code
Encyclopedia workspaces
The main variable workspaces used in encyclopedia
Elite A encyclopedia source
Part 1 of the main encyclopedia code
Elite B encyclopedia source
Part 2 of the main encyclopedia code
Elite C encyclopedia source
Part 3 of the main encyclopedia code
Elite D encyclopedia source
Part 4 of the main encyclopedia code
Elite E encyclopedia source
Part 5 of the main encyclopedia code
Elite F encyclopedia source
Part 6 of the main encyclopedia code
Elite G encyclopedia source
Part 7 of the main encyclopedia code
Elite H encyclopedia source
Part 8 of the main encyclopedia code
Ship blueprint files
Ship blueprints A source
The S.A ship blueprints file
Ship blueprints B source
The S.B ship blueprints file
Ship blueprints C source
The S.C ship blueprints file
Ship blueprints D source
The S.D ship blueprints file
Ship blueprints E source
The S.E ship blueprints file
Ship blueprints F source
The S.F ship blueprints file
Ship blueprints G source
The S.G ship blueprints file
Ship blueprints H source
The S.H ship blueprints file
Ship blueprints I source
The S.I ship blueprints file
Ship blueprints J source
The S.J ship blueprints file
Ship blueprints K source
The S.K ship blueprints file
Ship blueprints L source
The S.L ship blueprints file
Ship blueprints M source
The S.M ship blueprints file
Ship blueprints N source
The S.N ship blueprints file
Ship blueprints O source
The S.O ship blueprints file
Ship blueprints P source
The S.P ship blueprints file
Ship blueprints Q source
The S.Q ship blueprints file
Ship blueprints R source
The S.R ship blueprints file
Ship blueprints S source
The S.S ship blueprints file
Ship blueprints T source
The S.T ship blueprints file
Ship blueprints U source
The S.U ship blueprints file
Ship blueprints V source
The S.V ship blueprints file
Ship blueprints W source
The S.W ship blueprints file
6502 Second Processor source
I/O processor source
The I/O processor source
Parasite workspaces
The main variable workspaces used when parasite
Elite A parasite source
Part 1 of the main parasite code
Elite B parasite source
Part 2 of the main parasite code
Elite C parasite source
Part 3 of the main parasite code
Elite D parasite source
Part 4 of the main parasite code
Elite E parasite source
Part 5 of the main parasite code
Elite F parasite source
Part 6 of the main parasite code
Elite G parasite source
Part 7 of the main parasite code
Elite H parasite source
Part 8 of the main parasite code
Elite I parasite source
Part 9 of the main parasite code
Elite J parasite source
Part 10 of the main parasite code
Elite K parasite source
Part 11 of the main parasite code
Elite L parasite source
Part 12 of the main parasite code
Elite M parasite source
Part 13 of the main parasite code
Ship blueprints parasite source
Data for ships in the parasite
Elite-A source code by category
Buying ships
Elite-A allows you to fly different ships
Subroutines
buy_invnt (Encyclopedia)
Process key presses in the encyclopedia
n_buyship (Docked)
Show the Buy Ship screen (CTRL-f3)
n_buyship (Parasite)
Show the Buy Ship screen (CTRL-f3)
n_load (Docked)
Load the name and flight characteristics for the current ship type
n_load (Parasite)
Load the name and flight characteristics for the current ship type
n_price (Docked)
Set K(0 1 2 3) to the price of a given ship
n_price (Parasite)
Set K(0 1 2 3) to the price of a given ship
Variables
count_offs (Docked)
Offsets from LASER for equipment that takes up space in the hold
count_offs (Parasite)
Offsets from LASER for equipment that takes up space in the hold
new_details (Docked)
The flight characteristics for each of the different ship types
new_details (Parasite)
The flight characteristics for each of the different ship types
new_offsets (Docked)
Table of offsets for each ship type
new_offsets (Parasite)
Table of offsets for each ship type
new_ships (Docked)
Ship names and prices for the different ship types we can buy
new_ships (Parasite)
Ship names and prices for the different ship types we can buy
Charts
Long-range and short-range galactic charts
Subroutines
hm (Docked)
Select the closest system and redraw the chart crosshairs
hm (Encyclopedia)
Select the closest system and redraw the chart crosshairs
hm (Flight)
Select the closest system and redraw the chart crosshairs
hm (Parasite)
Select the closest system and redraw the chart crosshairs
HME2 (Docked)
Search the galaxy for a system
HME2 (Encyclopedia)
Search the galaxy for a system
HME2 (Parasite)
Search the galaxy for a system
TT103 (Docked)
Draw a small set of crosshairs on a chart
TT103 (Encyclopedia)
Draw a small set of crosshairs on a chart
TT103 (Flight)
Draw a small set of crosshairs on a chart
TT103 (Parasite)
Draw a small set of crosshairs on a chart
TT105 (Docked)
Draw crosshairs on the Short-range Chart, with clipping
TT105 (Encyclopedia)
Draw crosshairs on the Short-range Chart, with clipping
TT105 (Flight)
Draw crosshairs on the Short-range Chart, with clipping
TT105 (Parasite)
Draw crosshairs on the Short-range Chart, with clipping
TT114 (Flight)
Display either the Long-range or Short-range Chart
TT114 (Parasite)
Display either the Long-range or Short-range Chart
TT123 (Docked)
Move galactic coordinates by a signed delta
TT123 (Encyclopedia)
Move galactic coordinates by a signed delta
TT123 (Flight)
Move galactic coordinates by a signed delta
TT123 (Parasite)
Move galactic coordinates by a signed delta
TT16 (Docked)
Move the crosshairs on a chart
TT16 (Encyclopedia)
Move the crosshairs on a chart
TT16 (Flight)
Move the crosshairs on a chart
TT16 (Parasite)
Move the crosshairs on a chart
TT22 (Docked) *
Show the Long-range Chart (red key f4)
TT22 (Encyclopedia) *
Show the Long-range Chart (red key f4)
TT22 (Flight) *
Show the Long-range Chart (red key f4)
TT22 (Parasite) *
Show the Long-range Chart (red key f4)
TT23 (Docked) *
Show the Short-range Chart (red key f5)
TT23 (Encyclopedia) *
Show the Short-range Chart (red key f5)
TT23 (Flight) *
Show the Short-range Chart (red key f5)
TT23 (Parasite) *
Show the Short-range Chart (red key f5)
Copy protection
Hiding the Elite code from prying eyes
Subroutines
PROT3 (Loader)
Part of the CHKSM copy protection checksum calculation
Variables
Checksum (Docked)
Copy protection is disabled in Elite-A, so this block is unused
Dashboard
The dials, 3D scanner and compass
Subroutines
ABORT (Flight)
Disarm missiles and update the dashboard indicators
ABORT (Parasite)
Disarm missiles and update the dashboard indicators
ABORT, Removed (Docked)
Disarm missiles and update the dashboard indicators
ABORT2 (Flight)
Set/unset the lock target for a missile and update the dashboard
ABORT2 (Parasite)
Set/unset the lock target for a missile and update the dashboard
ABORT2, Removed (Docked)
Set/unset the lock target for a missile and update the dashboard
BULB (Flight)
Draw an indicator bulb on the dashboard
BULB (I/O processor)
Draw an indicator bulb on the dashboard
BULB, Removed (Docked)
Draw an indicator bulb on the dashboard
BUMP2 (Flight)
Bump up the value of the pitch or roll dashboard indicator
BUMP2 (Parasite)
Bump up the value of the pitch or roll dashboard indicator
BUMP2, Removed (Docked)
Bump up the value of the pitch or roll dashboard indicator
cntr (Flight)
Apply damping to the pitch or roll dashboard indicator
cntr (Parasite)
Apply damping to the pitch or roll dashboard indicator
cntr, Removed (Docked)
Apply damping to the pitch or roll dashboard indicator
COMPAS (Flight) *
Update the compass
COMPAS (Parasite) *
Update the compass
DIALS (Part 1 of 4) (Docked)
Update the dashboard: speed indicator
DIALS (Part 1 of 4) (Flight)
Update the dashboard: speed indicator
DIALS (Part 1 of 4) (Parasite)
Update the dashboard: speed indicator
DIALS (Part 2 of 4) (Docked)
Update the dashboard: pitch and roll indicators
DIALS (Part 2 of 4) (Flight)
Update the dashboard: pitch and roll indicators
DIALS (Part 2 of 4) (Parasite)
Update the dashboard: pitch and roll indicators
DIALS (Part 3 of 4) (Docked)
Update the dashboard: four energy banks
DIALS (Part 3 of 4) (Flight)
Update the dashboard: four energy banks
DIALS (Part 3 of 4) (Parasite)
Update the dashboard: four energy banks
DIALS (Part 4 of 4) (Docked)
Update the dashboard: shields, fuel, laser & cabin temp, altitude
DIALS (Part 4 of 4) (Flight)
Update the dashboard: shields, fuel, laser & cabin temp, altitude
DIALS (Part 4 of 4) (Parasite)
Update the dashboard: shields, fuel, laser & cabin temp, altitude
DIL2 (Docked)
Update the roll or pitch indicator on the dashboard
DIL2 (Flight)
Update the roll or pitch indicator on the dashboard
DIL2 (I/O processor)
Implement the draw_angle command (update the roll or pitch indicator on the dashboard)
DIL2 (Parasite)
Update the roll or pitch indicator on the dashboard by sending a draw_angle command to the I/O processor
DILX (Docked) *
Update a bar-based indicator on the dashboard
DILX (Flight) *
Update a bar-based indicator on the dashboard
DILX (I/O processor) *
Implement the draw_bar command (update a bar-based indicator on the dashboard
DILX (Parasite) *
Update a bar-based indicator on the dashboard by sending a draw_bar command to the I/O processor
DOT (Flight)
Draw a dash on the compass
DOT (Parasite)
Draw a dash on the compass
draw_tail (I/O processor)
Implement the draw_tail command (draw a ship on the 3D scanner)
ECBLB (Flight)
Light up the E.C.M. indicator bulb ("E") on the dashboard
ECBLB (I/O processor)
Light up the E.C.M. indicator bulb ("E") on the dashboard
ECBLB (Parasite)
Light up the E.C.M. indicator bulb ("E") on the dashboard by sending a draw_E command to the I/O processor
ECBLB2 (Flight)
Start up the E.C.M. (light up the indicator, start the countdown and make the E.C.M. sound)
ECBLB2 (Parasite)
Start up the E.C.M. (light up the indicator, start the countdown and make the E.C.M. sound)
iff_index (Loader)
Return the type index for this ship in the I.F.F. system
iff_index_code (Loader)
The iff_index routine, bundled up in the loader so it can be moved to &0D7A to be run
MSBAR (Docked)
Draw a specific indicator in the dashboard's missile bar
MSBAR (Flight)
Draw a specific indicator in the dashboard's missile bar
MSBAR (I/O processor)
Implement the put_missle command (update a missile indicator on the dashboard)
MSBAR (Parasite)
Draw a specific indicator in the dashboard's missile bar by sending a put_missle command to the I/O processor
MSBARS (Parasite)
Draw a specific indicator in the dashboard's missile bar
msblob (Docked)
Display the dashboard's missile indicators in green
msblob (Flight)
Display the dashboard's missile indicators in green
msblob (Parasite)
Display the dashboard's missile indicators in green
PZW (Docked)
Fetch the current dashboard colours, to support flashing
PZW (Flight)
Fetch the current dashboard colours, to support flashing
PZW (Parasite)
Fetch the current dashboard colours, to support flashing
REDU2 (Flight)
Reduce the value of the pitch or roll dashboard indicator
REDU2 (Parasite)
Reduce the value of the pitch or roll dashboard indicator
REDU2, Removed (Docked)
Reduce the value of the pitch or roll dashboard indicator
SCAN (Flight) *
Display the current ship on the scanner
SCAN (Parasite) *
Display the current ship on the scanner by sending a draw_tail command to the I/O processor
SP1, Removed (Flight)
Draw the space station on the compass
SP2 (Flight)
Draw a dot on the compass, given the planet/station vector
SP2 (Parasite)
Draw a dot on the compass, given the planet/station vector
SPBLB (Flight)
Light up the space station indicator ("S") on the dashboard
SPBLB (I/O processor)
Light up the space station indicator ("S") on the dashboard
SPBLB (Parasite)
Light up the space station indicator ("S") on the dashboard by sending a draw_S command to the I/O processor
SPBLB, Removed (Docked)
Light up the space station indicator ("S") on the dashboard
update_pod (Parasite)
Ensure the correct palette is shown for the dashboard/hyperspace tunnel, by sending a write_pod command to the I/O processor
WPSHPS (Docked)
Clear the scanner, reset the ball line and sun line heaps
WPSHPS (Encyclopedia)
Clear the scanner, reset the ball line and sun line heaps
WPSHPS (Flight)
Clear the scanner, reset the ball line and sun line heaps
WPSHPS (Parasite)
Clear the scanner, reset the ball line and sun line heaps
WPSHPSS (Parasite)
Clear the scanner, reset the ball line and sun line heaps
write_pod (I/O processor)
Implement the write_pod command (show the correct palette for the dashboard and hyperspace tunnel)
Variables
ECBT (Flight)
The character bitmap for the E.C.M. indicator bulb
ECBT (I/O processor)
The character bitmap for the E.C.M. indicator bulb
iff_base (Flight)
Base colours for different types of ship in the I.F.F. system
iff_base (Parasite)
Base colours for different types of ship in the I.F.F. system
iff_xor (Flight)
The EOR value for different types of ship in the I.F.F. system for creating striped sticks in the scanner
iff_xor (Parasite)
The EOR value for different types of ship in the I.F.F. system for creating striped sticks in the scanner
SPBT (Flight)
The bitmap definition for the space station indicator bulb
SPBT (I/O processor)
The bitmap definition for the space station indicator bulb
SPBT, Removed (Docked)
The bitmap definition for the space station indicator bulb
Drawing circles
Hyperspace tunnels, launch rings and planets
Subroutines
BLINE (Docked) *
Draw a circle segment and add it to the ball line heap
BLINE (Encyclopedia) *
Draw a circle segment and add it to the ball line heap
BLINE (Flight) *
Draw a circle segment and add it to the ball line heap
BLINE (Parasite) *
Draw a circle segment and add it to the ball line heap
CHKON (Docked)
Check whether any part of a circle appears on the extended screen
CHKON (Encyclopedia)
Check whether any part of a circle appears on the extended screen
CHKON (Flight)
Check whether any part of a circle appears on the extended screen
CHKON (Parasite)
Check whether any part of a circle appears on the extended screen
CIRCLE (Flight)
Draw a circle for the planet
CIRCLE (Parasite)
Draw a circle for the planet
CIRCLE, Removed (Docked)
Draw a circle for the planet
CIRCLE2 (Docked) *
Draw a circle (for the planet or chart)
CIRCLE2 (Encyclopedia) *
Draw a circle (for the planet or chart)
CIRCLE2 (Flight) *
Draw a circle (for the planet or chart)
CIRCLE2 (Parasite) *
Draw a circle (for the planet or chart)
HFS1 (Docked)
Draw the launch or hyperspace tunnel
HFS1 (Parasite)
Draw the launch or hyperspace tunnel
HFS2 (Flight) *
Draw the launch or hyperspace tunnel
HFS2 (Parasite) *
Clear the screen and draw the launch or hyperspace tunnel
LAUN (Flight)
Make the launch sound and draw the launch tunnel
LAUN (Parasite)
Make the launch sound and draw the launch tunnel
LAUN, Removed (Docked)
Make the launch sound and draw the launch tunnel
LL164 (Flight)
Make the hyperspace sound and draw the hyperspace tunnel
LL164 (Parasite)
Make the hyperspace sound and draw the hyperspace tunnel
LL164, Removed (Docked)
Make the hyperspace sound and draw the hyperspace tunnel
TT128 (Docked) *
Draw a circle on a chart
TT128 (Encyclopedia) *
Draw a circle on a chart
TT128 (Flight) *
Draw a circle on a chart
TT128 (Parasite) *
Draw a circle on a chart
TT14 (Docked)
Draw a circle with crosshairs on a chart
TT14 (Encyclopedia)
Draw a circle with crosshairs on a chart
TT14 (Flight)
Draw a circle with crosshairs on a chart
TT14 (Parasite)
Draw a circle with crosshairs on a chart
Drawing lines
The core line-drawing routines
Subroutines
EDGES (Docked)
Draw a horizontal line given a centre and a half-width
EDGES (Encyclopedia)
Draw a horizontal line given a centre and a half-width
EDGES (Flight)
Draw a horizontal line given a centre and a half-width
EDGES (Parasite)
Draw a horizontal line given a centre and a half-width
HLOIN (Docked) *
Draw a horizontal line from (X1, Y1) to (X2, Y1)
HLOIN (Encyclopedia) *
Draw a horizontal line from (X1, Y1) to (X2, Y1)
HLOIN (Flight) *
Draw a horizontal line from (X1, Y1) to (X2, Y1)
HLOIN (I/O processor) *
Implement the draw_hline command (draw a horizontal line
HLOIN (Parasite) *
Draw a horizontal line by sending a draw_hline command to the I/O processor
HLOIN2 (Docked)
Remove a line from the sun line heap and draw it on-screen
HLOIN2 (Encyclopedia)
Remove a line from the sun line heap and draw it on-screen
HLOIN2 (Flight)
Remove a line from the sun line heap and draw it on-screen
HLOIN2 (Parasite)
Remove a line from the sun line heap and draw it on-screen
LASLI (Flight)
Draw the laser lines for when we fire our lasers
LASLI (Parasite)
Draw the laser lines for when we fire our lasers
LL118 (Docked)
Move a point along a line until it is on-screen
LL118 (Encyclopedia)
Move a point along a line until it is on-screen
LL118 (Flight)
Move a point along a line until it is on-screen
LL118 (Parasite)
Move a point along a line until it is on-screen
LL145 (Part 1 of 4) (Docked) *
Clip line: Work out which end-points are on-screen, if any
LL145 (Part 1 of 4) (Encyclopedia) *
Clip line: Work out which end-points are on-screen, if any
LL145 (Part 1 of 4) (Flight) *
Clip line: Work out which end-points are on-screen, if any
LL145 (Part 1 of 4) (Parasite) *
Clip line: Work out which end-points are on-screen, if any
LL145 (Part 2 of 4) (Docked)
Clip line: Work out if any part of the line is on-screen
LL145 (Part 2 of 4) (Encyclopedia)
Clip line: Work out if any part of the line is on-screen
LL145 (Part 2 of 4) (Flight)
Clip line: Work out if any part of the line is on-screen
LL145 (Part 2 of 4) (Parasite)
Clip line: Work out if any part of the line is on-screen
LL145 (Part 3 of 4) (Docked)
Clip line: Calculate the line's gradient
LL145 (Part 3 of 4) (Encyclopedia)
Clip line: Calculate the line's gradient
LL145 (Part 3 of 4) (Flight)
Clip line: Calculate the line's gradient
LL145 (Part 3 of 4) (Parasite)
Clip line: Calculate the line's gradient
LL145 (Part 4 of 4) (Docked)
Clip line: Call the routine in LL188 to do the actual clipping
LL145 (Part 4 of 4) (Encyclopedia)
Clip line: Call the routine in LL188 to do the actual clipping
LL145 (Part 4 of 4) (Flight)
Clip line: Call the routine in LL188 to do the actual clipping
LL145 (Part 4 of 4) (Parasite)
Clip line: Call the routine in LL188 to do the actual clipping
LL30 (Parasite)
Draw a one-segment line by sending a draw_line command to the I/O processor
LOIN (Part 1 of 7) (Docked) *
Draw a line: Calculate the line gradient in the form of deltas
LOIN (Part 1 of 7) (Encyclopedia) *
Draw a line: Calculate the line gradient in the form of deltas
LOIN (Part 1 of 7) (Flight) *
Draw a line: Calculate the line gradient in the form of deltas
LOIN (Part 1 of 7) (I/O processor) *
Implement the draw_line command (draw a line)
LOIN (Part 2 of 7) (Docked)
Draw a line: Line has a shallow gradient, step right along x-axis
LOIN (Part 2 of 7) (Encyclopedia)
Draw a line: Line has a shallow gradient, step right along x-axis
LOIN (Part 2 of 7) (Flight)
Draw a line: Line has a shallow gradient, step right along x-axis
LOIN (Part 2 of 7) (I/O processor)
Draw a line: Line has a shallow gradient, step right along x-axis
LOIN (Part 3 of 7) (Docked)
Draw a shallow line going right and up or left and down
LOIN (Part 3 of 7) (Encyclopedia)
Draw a shallow line going right and up or left and down
LOIN (Part 3 of 7) (Flight)
Draw a shallow line going right and up or left and down
LOIN (Part 3 of 7) (I/O processor)
Draw a shallow line going right and up or left and down
LOIN (Part 4 of 7) (Docked)
Draw a shallow line going right and down or left and up
LOIN (Part 4 of 7) (Encyclopedia)
Draw a shallow line going right and down or left and up
LOIN (Part 4 of 7) (Flight)
Draw a shallow line going right and down or left and up
LOIN (Part 4 of 7) (I/O processor)
Draw a shallow line going right and down or left and up
LOIN (Part 5 of 7) (Docked)
Draw a line: Line has a steep gradient, step up along y-axis
LOIN (Part 5 of 7) (Encyclopedia)
Draw a line: Line has a steep gradient, step up along y-axis
LOIN (Part 5 of 7) (Flight)
Draw a line: Line has a steep gradient, step up along y-axis
LOIN (Part 5 of 7) (I/O processor)
Draw a line: Line has a steep gradient, step up along y-axis
LOIN (Part 6 of 7) (Docked)
Draw a steep line going up and left or down and right
LOIN (Part 6 of 7) (Encyclopedia)
Draw a steep line going up and left or down and right
LOIN (Part 6 of 7) (Flight)
Draw a steep line going up and left or down and right
LOIN (Part 6 of 7) (I/O processor)
Draw a steep line going up and left or down and right
LOIN (Part 7 of 7) (Docked)
Draw a steep line going up and right or down and left
LOIN (Part 7 of 7) (Encyclopedia)
Draw a steep line going up and right or down and left
LOIN (Part 7 of 7) (Flight)
Draw a steep line going up and right or down and left
LOIN (Part 7 of 7) (I/O processor)
Draw a steep line going up and right or down and left
NLIN (Docked)
Draw a horizontal line at pixel row 23 to box in a title
NLIN (Encyclopedia)
Draw a horizontal line at pixel row 23 to box in a title
NLIN (Flight)
Draw a horizontal line at pixel row 23 to box in a title
NLIN (Parasite)
Draw a horizontal line at pixel row 23 to box in a title
NLIN2 (Docked)
Draw a screen-wide horizontal line at the pixel row in A
NLIN2 (Encyclopedia)
Draw a screen-wide horizontal line at the pixel row in A
NLIN2 (Flight)
Draw a screen-wide horizontal line at the pixel row in A
NLIN2 (Parasite)
Draw a screen-wide horizontal line at the pixel row in A
NLIN3 (Docked)
Print a title and draw a horizontal line at row 19 to box it in
NLIN3 (Encyclopedia)
Print a title and draw a horizontal line at row 19 to box it in
NLIN3 (Flight)
Print a title and draw a horizontal line at row 19 to box it in
NLIN3 (Parasite)
Print a title and draw a horizontal line at row 19 to box it in
NLIN4 (Docked)
Draw a horizontal line at pixel row 19 to box in a title
NLIN4 (Encyclopedia)
Draw a horizontal line at pixel row 19 to box in a title
NLIN4 (Flight)
Draw a horizontal line at pixel row 19 to box in a title
NLIN4 (Parasite)
Draw a horizontal line at pixel row 19 to box in a title
TT15 (Docked)
Draw a set of crosshairs
TT15 (Encyclopedia)
Draw a set of crosshairs
TT15 (Flight)
Draw a set of crosshairs
TT15 (Parasite)
Draw a set of crosshairs
Variables
TWFL (Docked)
Ready-made character rows for the left end of a horizontal line in mode 4
TWFL (Encyclopedia)
Ready-made character rows for the left end of a horizontal line in mode 4
TWFL (Flight)
Ready-made character rows for the left end of a horizontal line in mode 4
TWFL (I/O processor)
Ready-made character rows for the left end of a horizontal line in mode 4
TWFR (Docked)
Ready-made character rows for the right end of a horizontal line in mode 4
TWFR (Encyclopedia)
Ready-made character rows for the right end of a horizontal line in mode 4
TWFR (Flight)
Ready-made character rows for the right end of a horizontal line in mode 4
TWFR (I/O processor)
Ready-made character rows for the right end of a horizontal line in mode 4
Drawing pixels
How to plot pixels in various colours
Subroutines
CPIX2 (Flight) *
Draw a single-height dash on the dashboard
CPIX2 (I/O processor) *
Draw a single-height dash on the dashboard
CPIX2 (Parasite) *
Draw a single-height dash on the dashboard by sending a draw_blob command to the I/O processor
CPIX2, Removed (Docked)
Draw a single-height dash on the dashboard
CPIX4 (Flight)
Draw a double-height dot on the dashboard
CPIX4 (Parasite)
Draw a double-height dot on the dashboard
CPIX4, Removed (Docked)
Draw a double-height dot on the dashboard
draw_blob (I/O processor)
Implement the draw_blob command (draw a single-height dash on the dashboard)
PIX (Loader)
Draw a single pixel at a specific coordinate
PIXEL (Docked) *
Draw a 1-pixel dot, 2-pixel dash or 4-pixel square
PIXEL (Encyclopedia) *
Draw a 1-pixel dot, 2-pixel dash or 4-pixel square
PIXEL (Flight) *
Draw a 1-pixel dot, 2-pixel dash or 4-pixel square
PIXEL (I/O processor) *
Implement the draw_pixel command (draw space view pixels)
PIXEL (Parasite) *
Draw a 1-pixel dot, 2-pixel dash or 4-pixel square by sending a draw_pixel command to the I/O processor
PIXEL2 (Flight)
Draw a stardust particle relative to the screen centre
PIXEL2 (Parasite)
Draw a stardust particle relative to the screen centre
PIXEL2, Removed (Docked)
Draw a stardust particle relative to the screen centre
PX3 (Docked)
Plot a single pixel at (X, Y) within a character block
PX3 (Encyclopedia)
Plot a single pixel at (X, Y) within a character block
PX3 (I/O processor)
Plot a single pixel at (X, Y) within a character block
PX3, Removed (Flight)
Plot a single pixel at (X, Y) within a character block
Variables
CTWOS (Docked)
Ready-made single-pixel character row bytes for mode 5
CTWOS (Encyclopedia)
Ready-made single-pixel character row bytes for mode 5
CTWOS (Flight)
Ready-made single-pixel character row bytes for mode 5
CTWOS (I/O processor)
Ready-made single-pixel character row bytes for mode 5
TWOS (Docked)
Ready-made single-pixel character row bytes for mode 4
TWOS (Encyclopedia)
Ready-made single-pixel character row bytes for mode 4
TWOS (Flight)
Ready-made single-pixel character row bytes for mode 4
TWOS (I/O processor)
Ready-made single-pixel character row bytes for mode 4
TWOS (Loader)
Ready-made single-pixel character row bytes for mode 4
TWOS2 (Docked)
Ready-made double-pixel character row bytes for mode 4
TWOS2 (Encyclopedia)
Ready-made double-pixel character row bytes for mode 4
TWOS2 (Flight)
Ready-made double-pixel character row bytes for mode 4
TWOS2 (I/O processor)
Ready-made double-pixel character row bytes for mode 4
Drawing planets
Planets with meridians and craters
Subroutines
PL2 (Flight)
Remove the planet or sun from the screen
PL2 (Parasite)
Remove the planet or sun from the screen
PL21 (Docked)
Return from a planet/sun-drawing routine with a failure flag
PL21 (Encyclopedia)
Return from a planet/sun-drawing routine with a failure flag
PL21 (Flight)
Return from a planet/sun-drawing routine with a failure flag
PL21 (Parasite)
Return from a planet/sun-drawing routine with a failure flag
PL21S (Parasite)
Return from a planet/sun-drawing routine with a failure flag
PL9 (Part 1 of 3) (Flight) *
Draw the planet, with either an equator and meridian, or a crater
PL9 (Part 1 of 3) (Parasite) *
Draw the planet, with either an equator and meridian, or a crater
PL9 (Part 2 of 3) (Flight)
Draw the planet's equator and meridian
PL9 (Part 2 of 3) (Parasite)
Draw the planet's equator and meridian
PL9 (Part 3 of 3) (Flight)
Draw the planet's crater
PL9 (Part 3 of 3) (Parasite)
Draw the planet's crater
PLANET (Flight)
Draw the planet or sun
PLANET (Parasite)
Draw the planet or sun
PLL1 (Part 1 of 3) (Loader)
Draw Saturn on the loading screen (draw the planet)
PLL1 (Part 2 of 3) (Loader)
Draw Saturn on the loading screen (draw the stars)
PLL1 (Part 3 of 3) (Loader)
Draw Saturn on the loading screen (draw the rings)
PLS1 (Flight)
Calculate (Y A) = nosev_x / z
PLS1 (Parasite)
Calculate (Y A) = nosev_x / z
PLS2 (Flight)
Draw a half-ellipse
PLS2 (Parasite)
Draw a half-ellipse
PLS22 (Flight) *
Draw an ellipse or half-ellipse
PLS22 (Parasite) *
Draw an ellipse or half-ellipse
PLS3 (Flight)
Calculate (Y A P) = 222 * roofv_x / z
PLS3 (Parasite)
Calculate (Y A P) = 222 * roofv_x / z
PLS4 (Flight)
Calculate CNT2 = arctan(P / A) / 4
PLS4 (Parasite)
Calculate CNT2 = arctan(P / A) / 4
PLS5 (Flight)
Calculate roofv_x / z and roofv_y / z
PLS5 (Parasite)
Calculate roofv_x / z and roofv_y / z
PLS6 (Flight)
Calculate (X K) = (A P) / (z_sign z_hi z_lo)
PLS6 (Parasite)
Calculate (X K) = (A P) / (z_sign z_hi z_lo)
WP1 (Flight)
Reset the ball line heap
WP1 (Parasite)
Reset the ball line heap
WP1, Removed (Docked)
Reset the ball line heap
WPLS2 (Flight)
Remove the planet from the screen
WPLS2 (Parasite)
Remove the planet from the screen
Variables
CNT (Loader)
A counter for use in drawing Saturn's planetary body
CNT2 (Loader)
A counter for use in drawing Saturn's background stars
CNT3 (Loader)
A counter for use in drawing Saturn's rings
RAND (Loader)
The random number seed used for drawing Saturn
Drawing ships
The celebrated 3D ship plotting process
Subroutines
DOEXP (Flight) *
Draw an exploding ship
DOEXP (Parasite) *
Draw an exploding ship
DOEXP, Removed (Docked)
Draw an exploding ship
LL9 (Part 1 of 12) (Docked)
Draw ship: Check if ship is exploding, check if ship is in front
LL9 (Part 1 of 12) (Encyclopedia)
Draw ship: Check if ship is exploding, check if ship is in front
LL9 (Part 1 of 12) (Flight)
Draw ship: Check if ship is exploding, check if ship is in front
LL9 (Part 1 of 12) (Parasite)
Draw ship: Check if ship is exploding, check if ship is in front
LL9 (Part 2 of 12) (Docked)
Draw ship: Check if ship is in field of view, close enough to draw
LL9 (Part 2 of 12) (Encyclopedia)
Draw ship: Check if ship is in field of view, close enough to draw
LL9 (Part 2 of 12) (Flight)
Draw ship: Check if ship is in field of view, close enough to draw
LL9 (Part 2 of 12) (Parasite)
Draw ship: Check if ship is in field of view, close enough to draw
LL9 (Part 3 of 12) (Docked)
Draw ship: Set up orientation vector, ship coordinate variables
LL9 (Part 3 of 12) (Encyclopedia)
Draw ship: Set up orientation vector, ship coordinate variables
LL9 (Part 3 of 12) (Flight)
Draw ship: Set up orientation vector, ship coordinate variables
LL9 (Part 3 of 12) (Parasite)
Draw ship: Set up orientation vector, ship coordinate variables
LL9 (Part 4 of 12) (Docked)
Draw ship: Set visibility for exploding ship (all faces visible)
LL9 (Part 4 of 12) (Encyclopedia)
Draw ship: Set visibility for exploding ship (all faces visible)
LL9 (Part 4 of 12) (Flight)
Draw ship: Set visibility for exploding ship (all faces visible)
LL9 (Part 4 of 12) (Parasite)
Draw ship: Set visibility for exploding ship (all faces visible)
LL9 (Part 5 of 12) (Docked)
Draw ship: Calculate the visibility of each of the ship's faces
LL9 (Part 5 of 12) (Encyclopedia)
Draw ship: Calculate the visibility of each of the ship's faces
LL9 (Part 5 of 12) (Flight)
Draw ship: Calculate the visibility of each of the ship's faces
LL9 (Part 5 of 12) (Parasite)
Draw ship: Calculate the visibility of each of the ship's faces
LL9 (Part 6 of 12) (Docked)
Draw ship: Calculate the visibility of each of the ship's vertices
LL9 (Part 6 of 12) (Encyclopedia)
Draw ship: Calculate the visibility of each of the ship's vertices
LL9 (Part 6 of 12) (Flight)
Draw ship: Calculate the visibility of each of the ship's vertices
LL9 (Part 6 of 12) (Parasite)
Draw ship: Calculate the visibility of each of the ship's vertices
LL9 (Part 7 of 12) (Docked)
Draw ship: Calculate the visibility of each of the ship's vertices
LL9 (Part 7 of 12) (Encyclopedia)
Draw ship: Calculate the visibility of each of the ship's vertices
LL9 (Part 7 of 12) (Flight)
Draw ship: Calculate the visibility of each of the ship's vertices
LL9 (Part 7 of 12) (Parasite)
Draw ship: Calculate the visibility of each of the ship's vertices
LL9 (Part 8 of 12) (Docked)
Draw ship: Calculate the screen coordinates of visible vertices
LL9 (Part 8 of 12) (Encyclopedia)
Draw ship: Calculate the screen coordinates of visible vertices
LL9 (Part 8 of 12) (Flight)
Draw ship: Calculate the screen coordinates of visible vertices
LL9 (Part 8 of 12) (Parasite)
Draw ship: Calculate the screen coordinates of visible vertices
LL9 (Part 9 of 12) (Docked)
Draw ship: Draw laser beams if the ship is firing its laser at us
LL9 (Part 9 of 12) (Encyclopedia)
Draw ship: Draw laser beams if the ship is firing its laser at us
LL9 (Part 9 of 12) (Flight)
Draw ship: Draw laser beams if the ship is firing its laser at us
LL9 (Part 9 of 12) (Parasite)
Draw ship: Draw laser beams if the ship is firing its laser at us
LL9 (Part 10 of 12) (Docked)
Draw ship: Calculate the visibility of each of the ship's edges
LL9 (Part 10 of 12) (Encyclopedia)
Draw ship: Calculate the visibility of each of the ship's edges
LL9 (Part 10 of 12) (Flight)
Draw ship: Calculate the visibility of each of the ship's edges
LL9 (Part 10 of 12) (Parasite)
Draw ship: Calculate the visibility of each of the ship's edges
LL9 (Part 11 of 12) (Docked)
Draw ship: Add all visible edges to the ship line heap
LL9 (Part 11 of 12) (Encyclopedia)
Draw ship: Add all visible edges to the ship line heap
LL9 (Part 11 of 12) (Flight)
Draw ship: Add all visible edges to the ship line heap
LL9 (Part 11 of 12) (Parasite)
Draw ship: Add all visible edges to the ship line heap
LL9 (Part 12 of 12) (Docked)
Draw ship: Draw all the visible edges from the ship line heap
LL9 (Part 12 of 12) (Encyclopedia)
Draw ship: Draw all the visible edges from the ship line heap
LL9 (Part 12 of 12) (Flight)
Draw ship: Draw all the visible edges from the ship line heap
LL9 (Part 12 of 12) (Parasite)
Draw ship: Draw all the visible edges from the ship line heap
LL9_FLIGHT (Parasite)
Draw a ship (flight version)
SHPPT (Docked)
Draw a distant ship as a point in the middle of the screen
SHPPT (Encyclopedia)
Draw a distant ship as a point in the middle of the screen
SHPPT (Flight)
Draw a distant ship as a point rather than a full wireframe
SHPPT (Parasite)
Draw a distant ship as a point rather than a full wireframe
Variables
E% (Docked)
Ship blueprints default NEWB flags for the ship hangar
E% (Parasite)
Ship blueprints default NEWB flags
E% (Ship blueprints A)
Ship blueprints default NEWB flags for the S.A file
E% (Ship blueprints B)
Ship blueprints default NEWB flags for the S.B file
E% (Ship blueprints C)
Ship blueprints default NEWB flags for the S.C file
E% (Ship blueprints D)
Ship blueprints default NEWB flags for the S.D file
E% (Ship blueprints E)
Ship blueprints default NEWB flags for the S.E file
E% (Ship blueprints F)
Ship blueprints default NEWB flags for the S.F file
E% (Ship blueprints G)
Ship blueprints default NEWB flags for the S.G file
E% (Ship blueprints H)
Ship blueprints default NEWB flags for the S.H file
E% (Ship blueprints I)
Ship blueprints default NEWB flags for the S.I file
E% (Ship blueprints J)
Ship blueprints default NEWB flags for the S.J file
E% (Ship blueprints K)
Ship blueprints default NEWB flags for the S.K file
E% (Ship blueprints L)
Ship blueprints default NEWB flags for the S.L file
E% (Ship blueprints M)
Ship blueprints default NEWB flags for the S.M file
E% (Ship blueprints N)
Ship blueprints default NEWB flags for the S.N file
E% (Ship blueprints O)
Ship blueprints default NEWB flags for the S.O file
E% (Ship blueprints P)
Ship blueprints default NEWB flags for the S.P file
E% (Ship blueprints Q)
Ship blueprints default NEWB flags for the S.Q file
E% (Ship blueprints R)
Ship blueprints default NEWB flags for the S.R file
E% (Ship blueprints S)
Ship blueprints default NEWB flags for the S.S file
E% (Ship blueprints T)
Ship blueprints default NEWB flags for the S.T file
E% (Ship blueprints U)
Ship blueprints default NEWB flags for the S.U file
E% (Ship blueprints V)
Ship blueprints default NEWB flags for the S.V file
E% (Ship blueprints W)
Ship blueprints default NEWB flags for the S.W file
SHIP_ADDER (Parasite)
Ship blueprint for an Adder
SHIP_ADDER (Ship blueprints A)
Ship blueprint for an Adder
SHIP_ADDER (Ship blueprints E)
Ship blueprint for an Adder
SHIP_ADDER (Ship blueprints G)
Ship blueprint for an Adder
SHIP_ADDER (Ship blueprints H)
Ship blueprint for an Adder
SHIP_ADDER (Ship blueprints O)
Ship blueprint for an Adder
SHIP_ADDER (Ship blueprints V)
Ship blueprint for an Adder
SHIP_ANACONDA (Parasite)
Ship blueprint for an Anaconda
SHIP_ANACONDA (Ship blueprints H)
Ship blueprint for an Anaconda
SHIP_ANACONDA (Ship blueprints I)
Ship blueprint for an Anaconda
SHIP_ASP_MK_2 (Parasite)
Ship blueprint for an Asp Mk II
SHIP_ASP_MK_2 (Ship blueprints I)
Ship blueprint for an Asp Mk II
SHIP_ASP_MK_2 (Ship blueprints N)
Ship blueprint for an Asp Mk II
SHIP_ASP_MK_2 (Ship blueprints T)
Ship blueprint for an Asp Mk II
SHIP_ASTEROID (Parasite)
Ship blueprint for an asteroid
SHIP_ASTEROID (Ship blueprints E)
Ship blueprint for an asteroid
SHIP_ASTEROID (Ship blueprints G)
Ship blueprint for an asteroid
SHIP_ASTEROID (Ship blueprints K)
Ship blueprint for an asteroid
SHIP_ASTEROID (Ship blueprints O)
Ship blueprint for an asteroid
SHIP_ASTEROID (Ship blueprints R)
Ship blueprint for an asteroid
SHIP_ASTEROID (Ship blueprints U)
Ship blueprint for an asteroid
ship_bits (Parasite)
Table of allowed ship blueprint positions for each ship type
SHIP_BOA (Parasite)
Ship blueprint for a Boa
SHIP_BOA (Ship blueprints D)
Ship blueprint for a Boa
SHIP_BOA (Ship blueprints F)
Ship blueprint for a Boa
SHIP_BOA (Ship blueprints G)
Ship blueprint for a Boa
SHIP_BOA (Ship blueprints K)
Ship blueprint for a Boa
SHIP_BOA (Ship blueprints L)
Ship blueprint for a Boa
SHIP_BOA (Ship blueprints R)
Ship blueprint for a Boa
SHIP_BOA (Ship blueprints V)
Ship blueprint for a Boa
SHIP_BOULDER (Parasite)
Ship blueprint for a boulder
SHIP_BOULDER (Ship blueprints A)
Ship blueprint for a boulder
SHIP_BOULDER (Ship blueprints D)
Ship blueprint for a boulder
SHIP_BOULDER (Ship blueprints K)
Ship blueprint for a boulder
SHIP_BOULDER (Ship blueprints O)
Ship blueprint for a boulder
SHIP_BOULDER (Ship blueprints Q)
Ship blueprint for a boulder
SHIP_BOULDER (Ship blueprints R)
Ship blueprint for a boulder
SHIP_BOULDER (Ship blueprints S)
Ship blueprint for a boulder
SHIP_BOULDER (Ship blueprints U)
Ship blueprint for a boulder
SHIP_BOULDER (Ship blueprints V)
Ship blueprint for a boulder
SHIP_BUSHMASTER (Parasite)
Ship blueprint for a Bushmaster
SHIP_BUSHMASTER (Ship blueprints D)
Ship blueprint for a Bushmaster
SHIP_BUSHMASTER (Ship blueprints F)
Ship blueprint for a Bushmaster
SHIP_BUSHMASTER (Ship blueprints J)
Ship blueprint for a Bushmaster
SHIP_BUSHMASTER (Ship blueprints M)
Ship blueprint for a Bushmaster
SHIP_BUSHMASTER (Ship blueprints Q)
Ship blueprint for a Bushmaster
SHIP_BUSHMASTER (Ship blueprints R)
Ship blueprint for a Bushmaster
SHIP_BUSHMASTER (Ship blueprints S)
Ship blueprint for a Bushmaster
ship_bytes (Parasite)
Table of data used when adding each ship type to the positions in the blueprints table
SHIP_CANISTER (Docked)
Ship blueprint for a cargo canister
SHIP_CANISTER (Parasite)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints A)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints B)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints C)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints D)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints E)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints F)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints G)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints H)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints I)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints J)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints K)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints L)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints M)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints N)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints O)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints P)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints Q)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints R)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints S)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints T)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints U)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints V)
Ship blueprint for a cargo canister
SHIP_CANISTER (Ship blueprints W)
Ship blueprint for a cargo canister
SHIP_CHAMELEON (Parasite)
Ship blueprint for a Chameleon
SHIP_CHAMELEON (Ship blueprints C)
Ship blueprint for a Chameleon
SHIP_CHAMELEON (Ship blueprints L)
Ship blueprint for a Chameleon
SHIP_CHAMELEON (Ship blueprints M)
Ship blueprint for a Chameleon
SHIP_CHAMELEON (Ship blueprints P)
Ship blueprint for a Chameleon
SHIP_CHAMELEON (Ship blueprints U)
Ship blueprint for a Chameleon
SHIP_COBRA_MK_1 (Parasite)
Ship blueprint for a Cobra Mk I
SHIP_COBRA_MK_1 (Ship blueprints A)
Ship blueprint for a Cobra Mk I
SHIP_COBRA_MK_1 (Ship blueprints B)
Ship blueprint for a Cobra Mk I
SHIP_COBRA_MK_1 (Ship blueprints H)
Ship blueprint for a Cobra Mk I
SHIP_COBRA_MK_1 (Ship blueprints I)
Ship blueprint for a Cobra Mk I
SHIP_COBRA_MK_1 (Ship blueprints M)
Ship blueprint for a Cobra Mk I
SHIP_COBRA_MK_1 (Ship blueprints O)
Ship blueprint for a Cobra Mk I
SHIP_COBRA_MK_1 (Ship blueprints U)
Ship blueprint for a Cobra Mk I
SHIP_COBRA_MK_1 (Ship blueprints V)
Ship blueprint for a Cobra Mk I
SHIP_COBRA_MK_3 (Docked)
Ship blueprint for a Cobra Mk III
SHIP_COBRA_MK_3 (Parasite)
Ship blueprint for a Cobra Mk III
SHIP_COBRA_MK_3 (Ship blueprints B)
Ship blueprint for a Cobra Mk III
SHIP_COBRA_MK_3 (Ship blueprints N)
Ship blueprint for a Cobra Mk III
SHIP_COBRA_MK_3 (Ship blueprints Q)
Ship blueprint for a Cobra Mk III
SHIP_COBRA_MK_3 (Ship blueprints T)
Ship blueprint for a Cobra Mk III
SHIP_COBRA_MK_3 (Ship blueprints V)
Ship blueprint for a Cobra Mk III
SHIP_CONSTRICTOR (Docked)
Ship blueprint for a Constrictor
SHIP_CONSTRICTOR (Parasite)
Ship blueprint for a Constrictor
SHIP_CONSTRICTOR (Ship blueprints G)
Ship blueprint for a Constrictor
SHIP_CORIOLIS (Parasite)
Ship blueprint for a Coriolis space station
SHIP_CORIOLIS (Ship blueprints A)
Ship blueprint for a Coriolis space station
SHIP_CORIOLIS (Ship blueprints C)
Ship blueprint for a Coriolis space station
SHIP_CORIOLIS (Ship blueprints E)
Ship blueprint for a Coriolis space station
SHIP_CORIOLIS (Ship blueprints G)
Ship blueprint for a Coriolis space station
SHIP_CORIOLIS (Ship blueprints I)
Ship blueprint for a Coriolis space station
SHIP_CORIOLIS (Ship blueprints K)
Ship blueprint for a Coriolis space station
SHIP_CORIOLIS (Ship blueprints M)
Ship blueprint for a Coriolis space station
SHIP_CORIOLIS (Ship blueprints O)
Ship blueprint for a Coriolis space station
SHIP_CORIOLIS (Ship blueprints Q)
Ship blueprint for a Coriolis space station
SHIP_CORIOLIS (Ship blueprints S)
Ship blueprint for a Coriolis space station
SHIP_CORIOLIS (Ship blueprints U)
Ship blueprint for a Coriolis space station
SHIP_CORIOLIS (Ship blueprints W)
Ship blueprint for a Coriolis space station
SHIP_DODO (Parasite)
Ship blueprint for a Dodecahedron ("Dodo") space station
SHIP_DODO (Ship blueprints B)
Ship blueprint for a Dodecahedron ("Dodo") space station
SHIP_DODO (Ship blueprints D)
Ship blueprint for a Dodecahedron ("Dodo") space station
SHIP_DODO (Ship blueprints F)
Ship blueprint for a Dodecahedron ("Dodo") space station
SHIP_DODO (Ship blueprints H)
Ship blueprint for a Dodecahedron ("Dodo") space station
SHIP_DODO (Ship blueprints J)
Ship blueprint for a Dodecahedron ("Dodo") space station
SHIP_DODO (Ship blueprints L)
Ship blueprint for a Dodecahedron ("Dodo") space station
SHIP_DODO (Ship blueprints N)
Ship blueprint for a Dodecahedron ("Dodo") space station
SHIP_DODO (Ship blueprints P)
Ship blueprint for a Dodecahedron ("Dodo") space station
SHIP_DODO (Ship blueprints R)
Ship blueprint for a Dodecahedron ("Dodo") space station
SHIP_DODO (Ship blueprints T)
Ship blueprint for a Dodecahedron ("Dodo") space station
SHIP_DODO (Ship blueprints V)
Ship blueprint for a Dodecahedron ("Dodo") space station
SHIP_DRAGON (Parasite)
Ship blueprint for a Dragon
SHIP_DRAGON (Ship blueprints D)
Ship blueprint for a Dragon
SHIP_DRAGON (Ship blueprints W)
Ship blueprint for a Dragon
SHIP_ESCAPE_POD (Parasite)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints A)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints B)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints C)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints D)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints E)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints F)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints G)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints H)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints I)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints J)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints K)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints L)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints M)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints N)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints O)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints P)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints Q)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints R)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints S)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints T)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints U)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints V)
Ship blueprint for an escape pod
SHIP_ESCAPE_POD (Ship blueprints W)
Ship blueprint for an escape pod
SHIP_FER_DE_LANCE (Parasite)
Ship blueprint for a Fer-de-Lance
SHIP_FER_DE_LANCE (Ship blueprints J)
Ship blueprint for a Fer-de-Lance
SHIP_FER_DE_LANCE (Ship blueprints K)
Ship blueprint for a Fer-de-Lance
SHIP_FER_DE_LANCE (Ship blueprints M)
Ship blueprint for a Fer-de-Lance
SHIP_FER_DE_LANCE (Ship blueprints W)
Ship blueprint for a Fer-de-Lance
SHIP_GECKO (Parasite)
Ship blueprint for a Gecko
SHIP_GECKO (Ship blueprints A)
Ship blueprint for a Gecko
SHIP_GECKO (Ship blueprints D)
Ship blueprint for a Gecko
SHIP_GECKO (Ship blueprints E)
Ship blueprint for a Gecko
SHIP_GECKO (Ship blueprints G)
Ship blueprint for a Gecko
SHIP_GECKO (Ship blueprints J)
Ship blueprint for a Gecko
SHIP_GECKO (Ship blueprints K)
Ship blueprint for a Gecko
SHIP_GECKO (Ship blueprints N)
Ship blueprint for a Gecko
SHIP_GECKO (Ship blueprints Q)
Ship blueprint for a Gecko
SHIP_GECKO (Ship blueprints R)
Ship blueprint for a Gecko
SHIP_GECKO (Ship blueprints S)
Ship blueprint for a Gecko
SHIP_GHAVIAL (Parasite)
Ship blueprint for a Ghavial
SHIP_GHAVIAL (Ship blueprints B)
Ship blueprint for a Ghavial
SHIP_GHAVIAL (Ship blueprints H)
Ship blueprint for a Ghavial
SHIP_GHAVIAL (Ship blueprints I)
Ship blueprint for a Ghavial
SHIP_GHAVIAL (Ship blueprints S)
Ship blueprint for a Ghavial
SHIP_GHAVIAL (Ship blueprints U)
Ship blueprint for a Ghavial
SHIP_IGUANA (Parasite)
Ship blueprint for an Iguana
SHIP_IGUANA (Ship blueprints B)
Ship blueprint for an Iguana
SHIP_IGUANA (Ship blueprints E)
Ship blueprint for an Iguana
SHIP_IGUANA (Ship blueprints F)
Ship blueprint for an Iguana
SHIP_IGUANA (Ship blueprints G)
Ship blueprint for an Iguana
SHIP_IGUANA (Ship blueprints Q)
Ship blueprint for an Iguana
SHIP_IGUANA (Ship blueprints T)
Ship blueprint for an Iguana
SHIP_KRAIT (Docked)
Ship blueprint for a Krait
SHIP_KRAIT (Parasite)
Ship blueprint for a Krait
SHIP_KRAIT (Ship blueprints I)
Ship blueprint for a Krait
SHIP_KRAIT (Ship blueprints K)
Ship blueprint for a Krait
SHIP_KRAIT (Ship blueprints L)
Ship blueprint for a Krait
SHIP_KRAIT (Ship blueprints N)
Ship blueprint for a Krait
SHIP_KRAIT (Ship blueprints T)
Ship blueprint for a Krait
SHIP_KRAIT (Ship blueprints U)
Ship blueprint for a Krait
SHIP_KRAIT (Ship blueprints W)
Ship blueprint for a Krait
ship_list (Parasite)
A list of all available ship types in Elite-A, for populating the ship blueprints table
SHIP_MAMBA (Parasite)
Ship blueprint for a Mamba
SHIP_MAMBA (Ship blueprints F)
Ship blueprint for a Mamba
SHIP_MAMBA (Ship blueprints J)
Ship blueprint for a Mamba
SHIP_MAMBA (Ship blueprints M)
Ship blueprint for a Mamba
SHIP_MAMBA (Ship blueprints P)
Ship blueprint for a Mamba
SHIP_MAMBA (Ship blueprints S)
Ship blueprint for a Mamba
SHIP_MAMBA (Ship blueprints W)
Ship blueprint for a Mamba
SHIP_MISSILE (Missile ship blueprint)
Ship blueprint for a missile
SHIP_MISSILE (Parasite)
Ship blueprint for a missile
SHIP_MONITOR (Parasite)
Ship blueprint for a Monitor
SHIP_MONITOR (Ship blueprints A)
Ship blueprint for a Monitor
SHIP_MONITOR (Ship blueprints B)
Ship blueprint for a Monitor
SHIP_MONITOR (Ship blueprints S)
Ship blueprint for a Monitor
SHIP_MORAY (Parasite)
Ship blueprint for a Moray
SHIP_MORAY (Ship blueprints A)
Ship blueprint for a Moray
SHIP_MORAY (Ship blueprints J)
Ship blueprint for a Moray
SHIP_MORAY (Ship blueprints O)
Ship blueprint for a Moray
SHIP_MORAY (Ship blueprints P)
Ship blueprint for a Moray
SHIP_MORAY (Ship blueprints Q)
Ship blueprint for a Moray
SHIP_OPHIDIAN (Parasite)
Ship blueprint for an Ophidian
SHIP_OPHIDIAN (Ship blueprints A)
Ship blueprint for an Ophidian
SHIP_OPHIDIAN (Ship blueprints F)
Ship blueprint for an Ophidian
SHIP_OPHIDIAN (Ship blueprints I)
Ship blueprint for an Ophidian
SHIP_OPHIDIAN (Ship blueprints K)
Ship blueprint for an Ophidian
SHIP_OPHIDIAN (Ship blueprints L)
Ship blueprint for an Ophidian
SHIP_OPHIDIAN (Ship blueprints M)
Ship blueprint for an Ophidian
SHIP_OPHIDIAN (Ship blueprints P)
Ship blueprint for an Ophidian
SHIP_OPHIDIAN (Ship blueprints R)
Ship blueprint for an Ophidian
SHIP_PLATE (Parasite)
Ship blueprint for an alloy plate
SHIP_PLATE (Ship blueprints A)
Ship blueprint for an alloy plate
SHIP_PLATE (Ship blueprints D)
Ship blueprint for an alloy plate
SHIP_PLATE (Ship blueprints E)
Ship blueprint for an alloy plate
SHIP_PLATE (Ship blueprints F)
Ship blueprint for an alloy plate
SHIP_PLATE (Ship blueprints H)
Ship blueprint for an alloy plate
SHIP_PLATE (Ship blueprints J)
Ship blueprint for an alloy plate
SHIP_PLATE (Ship blueprints L)
Ship blueprint for an alloy plate
SHIP_PLATE (Ship blueprints M)
Ship blueprint for an alloy plate
SHIP_PLATE (Ship blueprints R)
Ship blueprint for an alloy plate
SHIP_PLATE (Ship blueprints S)
Ship blueprint for an alloy plate
SHIP_PLATE (Ship blueprints T)
Ship blueprint for an alloy plate
SHIP_PLATE (Ship blueprints U)
Ship blueprint for an alloy plate
SHIP_PLATE (Ship blueprints V)
Ship blueprint for an alloy plate
SHIP_PYTHON (Docked)
Ship blueprint for a Python
SHIP_PYTHON (Parasite)
Ship blueprint for a Python
SHIP_PYTHON (Ship blueprints C)
Ship blueprint for a Python
SHIP_PYTHON (Ship blueprints E)
Ship blueprint for a Python
SHIP_PYTHON (Ship blueprints F)
Ship blueprint for a Python
SHIP_PYTHON (Ship blueprints N)
Ship blueprint for a Python
SHIP_PYTHON (Ship blueprints O)
Ship blueprint for a Python
SHIP_PYTHON (Ship blueprints Q)
Ship blueprint for a Python
SHIP_PYTHON (Ship blueprints U)
Ship blueprint for a Python
SHIP_RATTLER (Parasite)
Ship blueprint for a Rattler
SHIP_RATTLER (Ship blueprints C)
Ship blueprint for a Rattler
SHIP_RATTLER (Ship blueprints E)
Ship blueprint for a Rattler
SHIP_RATTLER (Ship blueprints H)
Ship blueprint for a Rattler
SHIP_RATTLER (Ship blueprints N)
Ship blueprint for a Rattler
SHIP_SHUTTLE (Docked)
Ship blueprint for a Shuttle
SHIP_SHUTTLE (Parasite)
Ship blueprint for a Shuttle
SHIP_SHUTTLE (Ship blueprints L)
Ship blueprint for a Shuttle
SHIP_SHUTTLE_MK_2 (Parasite)
Ship blueprint for a Shuttle Mk II
SHIP_SHUTTLE_MK_2 (Ship blueprints B)
Ship blueprint for a Shuttle Mk II
SHIP_SHUTTLE_MK_2 (Ship blueprints O)
Ship blueprint for a Shuttle Mk II
SHIP_SHUTTLE_MK_2 (Ship blueprints T)
Ship blueprint for a Shuttle Mk II
SHIP_SIDEWINDER (Parasite)
Ship blueprint for a Sidewinder
SHIP_SIDEWINDER (Ship blueprints D)
Ship blueprint for a Sidewinder
SHIP_SIDEWINDER (Ship blueprints J)
Ship blueprint for a Sidewinder
SHIP_SIDEWINDER (Ship blueprints L)
Ship blueprint for a Sidewinder
SHIP_SIDEWINDER (Ship blueprints R)
Ship blueprint for a Sidewinder
SHIP_SIDEWINDER (Ship blueprints S)
Ship blueprint for a Sidewinder
SHIP_SIDEWINDER (Ship blueprints V)
Ship blueprint for a Sidewinder
SHIP_SIDEWINDER (Ship blueprints W)
Ship blueprint for a Sidewinder
SHIP_SPLINTER (Parasite)
Ship blueprint for a splinter
SHIP_SPLINTER (Ship blueprints E)
Ship blueprint for a splinter
SHIP_SPLINTER (Ship blueprints G)
Ship blueprint for a splinter
SHIP_SPLINTER (Ship blueprints K)
Ship blueprint for a splinter
SHIP_SPLINTER (Ship blueprints O)
Ship blueprint for a splinter
SHIP_SPLINTER (Ship blueprints R)
Ship blueprint for a splinter
SHIP_SPLINTER (Ship blueprints U)
Ship blueprint for a splinter
SHIP_THARGOID (Parasite)
Ship blueprint for a Thargoid mothership
SHIP_THARGOID (Ship blueprints C)
Ship blueprint for a Thargoid mothership
SHIP_THARGOID (Ship blueprints D)
Ship blueprint for a Thargoid mothership
SHIP_THARGON (Parasite)
Ship blueprint for a Thargon
SHIP_THARGON (Ship blueprints C)
Ship blueprint for a Thargon
SHIP_THARGON (Ship blueprints D)
Ship blueprint for a Thargon
SHIP_TRANSPORTER (Docked)
Ship blueprint for a Transporter
SHIP_TRANSPORTER (Parasite)
Ship blueprint for a Transporter
SHIP_TRANSPORTER (Ship blueprints C)
Ship blueprint for a Transporter
SHIP_TRANSPORTER (Ship blueprints P)
Ship blueprint for a Transporter
SHIP_TRANSPORTER (Ship blueprints W)
Ship blueprint for a Transporter
SHIP_VIPER (Docked)
Ship blueprint for a Viper
SHIP_VIPER (Parasite)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints A)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints B)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints C)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints D)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints E)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints F)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints G)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints H)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints I)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints J)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints K)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints L)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints M)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints N)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints O)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints P)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints Q)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints R)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints S)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints T)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints U)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints V)
Ship blueprint for a Viper
SHIP_VIPER (Ship blueprints W)
Ship blueprint for a Viper
SHIP_WORM (Parasite)
Ship blueprint for a Worm
SHIP_WORM (Ship blueprints G)
Ship blueprint for a Worm
SHIP_WORM (Ship blueprints H)
Ship blueprint for a Worm
SHIP_WORM (Ship blueprints I)
Ship blueprint for a Worm
SHIP_WORM (Ship blueprints J)
Ship blueprint for a Worm
XX21 (Docked)
Ship blueprints lookup table for the ship hangar
XX21 (Parasite)
Ship blueprints lookup table for flight in Elite-A
XX21 (Ship blueprints A)
Ship blueprints lookup table for the S.A file
XX21 (Ship blueprints B)
Ship blueprints lookup table for the S.B file
XX21 (Ship blueprints C)
Ship blueprints lookup table for the S.C file
XX21 (Ship blueprints D)
Ship blueprints lookup table for the S.D file
XX21 (Ship blueprints E)
Ship blueprints lookup table for the S.E file
XX21 (Ship blueprints F)
Ship blueprints lookup table for the S.F file
XX21 (Ship blueprints G)
Ship blueprints lookup table for the S.G file
XX21 (Ship blueprints H)
Ship blueprints lookup table for the S.H file
XX21 (Ship blueprints I)
Ship blueprints lookup table for the S.I file
XX21 (Ship blueprints J)
Ship blueprints lookup table for the S.J file
XX21 (Ship blueprints K)
Ship blueprints lookup table for the S.K file
XX21 (Ship blueprints L)
Ship blueprints lookup table for the S.L file
XX21 (Ship blueprints M)
Ship blueprints lookup table for the S.M file
XX21 (Ship blueprints N)
Ship blueprints lookup table for the S.N file
XX21 (Ship blueprints O)
Ship blueprints lookup table for the S.O file
XX21 (Ship blueprints P)
Ship blueprints lookup table for the S.P file
XX21 (Ship blueprints Q)
Ship blueprints lookup table for the S.Q file
XX21 (Ship blueprints R)
Ship blueprints lookup table for the S.R file
XX21 (Ship blueprints S)
Ship blueprints lookup table for the S.S file
XX21 (Ship blueprints T)
Ship blueprints lookup table for the S.T file
XX21 (Ship blueprints U)
Ship blueprints lookup table for the S.U file
XX21 (Ship blueprints V)
Ship blueprints lookup table for the S.V file
XX21 (Ship blueprints W)
Ship blueprints lookup table for the S.W file
Macros
EDGE (Docked)
Macro definition for adding edges to ship blueprints
EDGE (Missile ship blueprint)
Macro definition for adding edges to ship blueprints
EDGE (Parasite)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints A)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints B)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints C)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints D)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints E)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints F)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints G)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints H)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints I)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints J)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints K)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints L)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints M)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints N)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints O)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints P)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints Q)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints R)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints S)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints T)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints U)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints V)
Macro definition for adding edges to ship blueprints
EDGE (Ship blueprints W)
Macro definition for adding edges to ship blueprints
FACE (Docked)
Macro definition for adding faces to ship blueprints
FACE (Missile ship blueprint)
Macro definition for adding faces to ship blueprints
FACE (Parasite)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints A)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints B)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints C)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints D)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints E)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints F)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints G)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints H)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints I)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints J)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints K)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints L)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints M)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints N)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints O)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints P)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints Q)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints R)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints S)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints T)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints U)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints V)
Macro definition for adding faces to ship blueprints
FACE (Ship blueprints W)
Macro definition for adding faces to ship blueprints
VERTEX (Docked)
Macro definition for adding vertices to ship blueprints
VERTEX (Missile ship blueprint)
Macro definition for adding vertices to ship blueprints
VERTEX (Parasite)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints A)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints B)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints C)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints D)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints E)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints F)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints G)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints H)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints I)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints J)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints K)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints L)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints M)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints N)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints O)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints P)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints Q)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints R)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints S)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints T)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints U)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints V)
Macro definition for adding vertices to ship blueprints
VERTEX (Ship blueprints W)
Macro definition for adding vertices to ship blueprints
Drawing suns
The epic, shimmering Elite sun
Subroutines
FLFLLS (Docked)
Reset the sun line heap
FLFLLS (Encyclopedia)
Reset the sun line heap
FLFLLS (Flight)
Reset the sun line heap
FLFLLS (Parasite)
Reset the sun line heap
SUN (Part 1 of 4) (Docked)
Draw the sun: Set up all the variables needed to draw the sun
SUN (Part 1 of 4) (Encyclopedia)
Draw the sun: Set up all the variables needed to draw the sun
SUN (Part 1 of 4) (Flight)
Draw the sun: Set up all the variables needed to draw the sun
SUN (Part 1 of 4) (Parasite)
Draw the sun: Set up all the variables needed to draw the sun
SUN (Part 2 of 4) (Docked)
Draw the sun: Start from the bottom of the screen and erase the old sun line by line
SUN (Part 2 of 4) (Encyclopedia)
Draw the sun: Start from the bottom of the screen and erase the old sun line by line
SUN (Part 2 of 4) (Flight)
Draw the sun: Start from the bottom of the screen and erase the old sun line by line
SUN (Part 2 of 4) (Parasite)
Draw the sun: Start from the bottom of the screen and erase the old sun line by line
SUN (Part 3 of 4) (Docked)
Draw the sun: Continue to move up the screen, drawing the new sun line by line
SUN (Part 3 of 4) (Encyclopedia)
Draw the sun: Continue to move up the screen, drawing the new sun line by line
SUN (Part 3 of 4) (Flight)
Draw the sun: Continue to move up the screen, drawing the new sun line by line
SUN (Part 3 of 4) (Parasite)
Draw the sun: Continue to move up the screen, drawing the new sun line by line
SUN (Part 4 of 4) (Docked)
Draw the sun: Continue to the top of the screen, erasing the old sun line by line
SUN (Part 4 of 4) (Encyclopedia)
Draw the sun: Continue to the top of the screen, erasing the old sun line by line
SUN (Part 4 of 4) (Flight)
Draw the sun: Continue to the top of the screen, erasing the old sun line by line
SUN (Part 4 of 4) (Parasite)
Draw the sun: Continue to the top of the screen, erasing the old sun line by line
WPLS (Flight)
Remove the sun from the screen
WPLS (Parasite)
Remove the sun from the screen
WPLS, Removed (Docked)
Remove the sun from the screen
Drawing the screen
The split-screen mode and different screen views
Subroutines
CLYNS (Docked)
Clear the bottom three text rows of the mode 4 screen
CLYNS (Encyclopedia)
Clear the bottom three text rows of the mode 4 screen
CLYNS (Flight)
Clear the bottom three text rows of the mode 4 screen
CLYNS (I/O processor)
Clear the bottom three text rows of the mode 4 screen
CLYNS (Parasite)
Clear the bottom three text rows of the mode 4 screen by sending a clr_line command to the I/O processor
DET1 (Flight)
Show or hide the dashboard (for when we die)
DET1 (I/O processor)
Show or hide the dashboard (for when we die)
DET1 (Parasite)
Show or hide the dashboard (for when we die) by sending a write_crtc command to the I/O processor
DET1, Removed (Docked)
Show or hide the dashboard (for when we die)
IRQ1 (Loader) *
The main screen-mode interrupt handler (IRQ1V points here)
LYN (Docked)
Clear most of a row of pixels
LYN (Encyclopedia)
Clear most of a row of pixels
LYN (Flight)
Clear most of a row of pixels
LYN (I/O processor)
Clear most of a row of pixels
sync_in (I/O processor)
Implement the sync_in command (wait for the vertical sync)
TT66 (Docked)
Clear the screen and set the current view type
TT66 (Encyclopedia)
Clear the screen and set the current view type
TT66 (Flight)
Clear the screen and set the current view type
TT66 (Parasite)
Clear the screen and set the current view type
TTX66 (Docked)
Clear the top part of the screen and draw a white border
TTX66 (Encyclopedia)
Clear the top part of the screen and draw a white border
TTX66 (Flight)
Clear the top part of the screen and draw a white border
TTX66 (Parasite)
Clear the top part of the screen and draw a white border by sending a clr_scrn command to the I/O processor
WSCAN (Docked)
Wait for the vertical sync
WSCAN (Encyclopedia)
Wait for the vertical sync
WSCAN (Flight)
Wait for the vertical sync
WSCAN (I/O processor)
Wait for the vertical sync
WSCAN (Parasite)
Wait for the vertical sync by sending a sync_in command to the I/O processor
Variables
B% (Loader)
VDU commands for setting the square mode 4 screen
TVT1 (Loader)
Palette data for space and the two dashboard colour schemes
VEC (Missile ship blueprint)
The original value of the IRQ1 vector
Encyclopedia
Elite-A contains the Encyclopedia Galactica
Subroutines
controls (Encyclopedia)
Show the Controls menu and display the chosen page
controls (Parasite)
Show the Controls menu and display the chosen page
encyclopedia (Parasite)
Show the Encyclopedia screen
equip_data (Encyclopedia)
Show the Equipment menu and display the chosen page
equip_data (Parasite)
Show the Equipment menu and display the chosen page
info_menu (Encyclopedia)
Show the Encyclopedia screen
menu (Encyclopedia)
Display a menu and ask for a choice
menu (Parasite)
Display a menu and ask for a choice
ships_ag (Encyclopedia)
Show the Ships A-G or Ships K-W menu and display the chosen ship card
ships_ag (Parasite)
Show the Ships A-G or Ships K-W menu and display the chosen ship card
trading (Encyclopedia)
Wait until a key is pressed and show the Encyclopedia screen
trading (Parasite)
Wait until a key is pressed and show the Encyclopedia screen
write_card (Encyclopedia)
Display a ship card in the encyclopedia
write_card (Parasite)
Display a ship card in the encyclopedia
Variables
adder (Encyclopedia)
Ship card data for the encyclopedia entry for the Adder
adder (Parasite)
Ship card data for the encyclopedia entry for the Adder
anaconda (Encyclopedia)
Ship card data for the encyclopedia entry for the Anaconda
anaconda (Parasite)
Ship card data for the encyclopedia entry for the Anaconda
asp_2 (Encyclopedia)
Ship card data for the encyclopedia entry for the Asp Mk II
asp_2 (Parasite)
Ship card data for the encyclopedia entry for the Asp Mk II
boa (Encyclopedia)
Ship card data for the encyclopedia entry for the Boa
boa (Parasite)
Ship card data for the encyclopedia entry for the Boa
bushmaster (Encyclopedia)
Ship card data for the encyclopedia entry for the Bushmaster
bushmaster (Parasite)
Ship card data for the encyclopedia entry for the Bushmaster
card_addr (Encyclopedia)
Lookup table for the encyclopedia's ship cards
card_addr (Parasite)
Lookup table for the encyclopedia's ship cards
card_pattern (Encyclopedia)
Layout pattern for the encyclopedia's ship cards
card_pattern (Parasite)
Layout pattern for the encyclopedia's ship cards
chameleon (Encyclopedia)
Ship card data for the encyclopedia entry for the Chameleon
chameleon (Parasite)
Ship card data for the encyclopedia entry for the Chameleon
cobra_1 (Encyclopedia)
Ship card data for the encyclopedia entry for the Cobra Mk I
cobra_1 (Parasite)
Ship card data for the encyclopedia entry for the Cobra Mk I
cobra_3 (Encyclopedia)
Ship card data for the encyclopedia entry for the Cobra Mk III
cobra_3 (Parasite)
Ship card data for the encyclopedia entry for the Cobra Mk III
coriolis (Encyclopedia)
Ship card data for the encyclopedia entry for the Coriolis station
coriolis (Parasite)
Ship card data for the encyclopedia entry for the Coriolis station
dodecagon (Encyclopedia)
Ship card data for the encyclopedia entry for the Dodo station
dodecagon (Parasite)
Ship card data for the encyclopedia entry for the Dodo station
escape_pod (Encyclopedia)
Ship card data for the encyclopedia entry for the escape pod
escape_pod (Parasite)
Ship card data for the encyclopedia entry for the escape pod
fer_de_lance (Encyclopedia)
Ship card data for the encyclopedia entry for the Fer-de-Lance
fer_de_lance (Parasite)
Ship card data for the encyclopedia entry for the Fer-de-Lance
gecko (Encyclopedia)
Ship card data for the encyclopedia entry for the Gecko
gecko (Parasite)
Ship card data for the encyclopedia entry for the Gecko
ghavial (Encyclopedia)
Ship card data for the encyclopedia entry for the Ghavial
ghavial (Parasite)
Ship card data for the encyclopedia entry for the Ghavial
iguana (Encyclopedia)
Ship card data for the encyclopedia entry for the Iguana
iguana (Parasite)
Ship card data for the encyclopedia entry for the Iguana
krait (Encyclopedia)
Ship card data for the encyclopedia entry for the Krait
krait (Parasite)
Ship card data for the encyclopedia entry for the Krait
mamba (Encyclopedia)
Ship card data for the encyclopedia entry for the Mamba
mamba (Parasite)
Ship card data for the encyclopedia entry for the Mamba
menu_entry (Encyclopedia)
Table containing the number of entries in each menu
menu_entry (Parasite)
Table containing the number of entries in each menu
menu_offset (Encyclopedia)
Table containing token numbers for the first item in each menu
menu_offset (Parasite)
Table containing token numbers for the first item in each menu
menu_query (Encyclopedia)
Table containing token numbers for each menu's query prompt
menu_query (Parasite)
Table containing token numbers for each menu's query prompt
menu_title (Encyclopedia)
Table containing text token numbers for each menu's title
menu_title (Parasite)
Table containing text token numbers for each menu's title
menu_titlex (Encyclopedia)
Table containing column positions for each menu's title
menu_titlex (Parasite)
Table containing column positions for each menu's title
monitor (Encyclopedia)
Ship card data for the encyclopedia entry for the Monitor
monitor (Parasite)
Ship card data for the encyclopedia entry for the Monitor
moray (Encyclopedia)
Ship card data for the encyclopedia entry for the Moray
moray (Parasite)
Ship card data for the encyclopedia entry for the Moray
ophidian (Encyclopedia)
Ship card data for the encyclopedia entry for the Ophidian
ophidian (Parasite)
Ship card data for the encyclopedia entry for the Ophidian
python (Encyclopedia)
Ship card data for the encyclopedia entry for the Python
python (Parasite)
Ship card data for the encyclopedia entry for the Python
ship_centre (Encyclopedia)
Table containing column positions for each ship card's title
ship_centre (Parasite)
Table containing column positions for each ship card's title
ship_dist (Encyclopedia)
Table containing the closest distance to show the ship for each ship card
ship_dist (Parasite)
Table containing the closest distance to show the ship for each ship card
ship_file (Encyclopedia)
Table containing the letter of the relevant ship blueprints file that we load for each ship card
ship_load (Encyclopedia)
The OS command string for loading a ship blueprints file
ship_posn (Encyclopedia)
Table containing the number of this ship blueprint within the ship blueprints file that we load for each ship card
ship_posn (Parasite)
Table containing the number of this ship in the ship_list table
shuttle (Encyclopedia)
Ship card data for the encyclopedia entry for the Shuttle
shuttle (Parasite)
Ship card data for the encyclopedia entry for the Shuttle
sidewinder (Encyclopedia)
Ship card data for the encyclopedia entry for the Sidewinder
sidewinder (Parasite)
Ship card data for the encyclopedia entry for the Sidewinder
thargoid (Encyclopedia)
Ship card data for the encyclopedia entry for the Thargoid
thargoid (Parasite)
Ship card data for the encyclopedia entry for the Thargoid
thargon (Encyclopedia)
Ship card data for the encyclopedia entry for the Thargon
thargon (Parasite)
Ship card data for the encyclopedia entry for the Thargon
transporter (Encyclopedia)
Ship card data for the encyclopedia entry for the Transporter
transporter (Parasite)
Ship card data for the encyclopedia entry for the Transporter
viper (Encyclopedia)
Ship card data for the encyclopedia entry for the Viper
viper (Parasite)
Ship card data for the encyclopedia entry for the Viper
worm (Encyclopedia)
Ship card data for the encyclopedia entry for the Worm
worm (Parasite)
Ship card data for the encyclopedia entry for the Worm
Equipment
Buying and selling weapons and ship upgrades
Subroutines
eq (Docked)
Subtract the price of equipment from the cash pot
eq (Parasite)
Subtract the price of equipment from the cash pot
EQSHP (Docked) *
Show the Equip Ship screen (red key f3) or Buy Ship screen (CTRL-f3)
EQSHP (Parasite) *
Show the Equip Ship screen (red key f3) or Buy Ship screen (CTRL-f3)
prx (Docked)
Return the price of a piece of equipment
prx (Parasite)
Return the price of a piece of equipment
qv (Docked)
Print a menu of the four space views, for buying lasers
qv (Parasite)
Print a menu of the four space views, for buying lasers
refund, Removed (Docked)
Install a new laser, processing a refund if applicable
sell_jump (Docked)
Show the Sell Equipment screen (CTRL-f2)
sell_jump (Parasite)
Show the Sell Equipment screen (CTRL-f2)
Variables
PRXS (Docked)
Equipment prices
PRXS (Parasite)
Equipment prices
Flight
Docking, hyperspace, views, shields and more
Subroutines
DCS1 (Flight)
Calculate the vector from the ideal docking position to the ship
DCS1 (Parasite)
Calculate the vector from the ideal docking position to the ship
DENGY (Flight)
Drain some energy from the energy banks
DENGY (Parasite)
Drain some energy from the energy banks
DENGY, Removed (Docked)
Drain some energy from the energy banks
DOCKIT (Flight)
Apply docking manoeuvres to the ship in INWK
DOCKIT (Parasite)
Apply docking manoeuvres to the ship in INWK
DOENTRY (Docked)
Dock at the space station, show the ship hangar and work out any mission progression
DOENTRY (Parasite)
Dock at the space station, show the ship hangar and work out any mission progression
ee3 (Flight)
Print the hyperspace countdown in the top-left of the screen
ee3 (Parasite)
Print the hyperspace countdown in the top-left of the screen
ESCAPE (Flight)
Launch our escape pod
ESCAPE (Parasite)
Launch our escape pod
Ghy (Flight)
Perform a galactic hyperspace jump
Ghy (Parasite)
Perform a galactic hyperspace jump
Ghy, Removed (Docked)
Perform a galactic hyperspace jump
hyp (Flight)
Start the hyperspace process
hyp (Parasite)
Start the hyperspace process
hyp, Removed (Docked)
Start the hyperspace process
LOOK1 (Flight)
Initialise the space view
LOOK1 (Parasite)
Initialise the space view
me1 (Docked)
Erase an old in-flight message and display a new one
me1 (Encyclopedia)
Erase an old in-flight message and display a new one
me1 (Flight)
Erase an old in-flight message and display a new one
me1 (Parasite)
Erase an old in-flight message and display a new one
me2 (Docked)
Remove an in-flight message from the space view
me2 (Encyclopedia)
Remove an in-flight message from the space view
me2 (Flight)
Remove an in-flight message from the space view
me2 (Parasite)
Remove an in-flight message from the space view
mes9 (Docked)
Print a text token, possibly followed by " DESTROYED"
mes9 (Encyclopedia)
Print a text token, possibly followed by " DESTROYED"
mes9 (Flight)
Print a text token, possibly followed by " DESTROYED"
mes9 (Parasite)
Print a text token, possibly followed by " DESTROYED"
MESS (Docked)
Display an in-flight message
MESS (Encyclopedia)
Display an in-flight message
MESS (Flight)
Display an in-flight message
MESS (Parasite)
Display an in-flight message
MJP (Flight)
Process a mis-jump into witchspace
MJP (Parasite)
Process a mis-jump into witchspace
n_oops (Flight)
Take some damage, taking our ship's shields into consideration
n_oops (Parasite)
Take some damage, taking our ship's shields into consideration
OOPS (Flight)
Take some damage
OOPS (Parasite)
Take some damage
ou2, Removed (Flight)
Display "E.C.M.SYSTEM DESTROYED" as an in-flight message
ou3, Removed (Flight)
Display "FUEL SCOOPS DESTROYED" as an in-flight message
OUCH (Flight)
Potentially lose cargo or equipment following damage
OUCH (Parasite)
Potentially lose cargo or equipment following damage
PU1 (Flight)
Flip the coordinate axes for the four different views
PU1 (Parasite)
Flip the coordinate axes for the four different views
SESCP (Flight)
Spawn an escape pod from the current (parent) ship
SESCP (Parasite)
Spawn an escape pod from the current (parent) ship
SHD (Flight)
Charge a shield and drain some energy from the energy banks
SHD (Parasite)
Charge a shield and drain some energy from the energy banks
SHD, Removed (Docked)
Charge a shield and drain some energy from the energy banks
SIGHT (Flight)
Draw the laser crosshairs
SIGHT (Parasite)
Draw the laser crosshairs
SIGHT, Removed (Docked)
Draw the laser crosshairs
TT110 (Docked)
Launch from a station or show the front space view
TT110 (Flight)
Launch from a station or show the front space view
TT110 (Parasite)
Launch from a station or show the front space view
TT147 (Flight)
Print an error when a system is out of hyperspace range
TT147 (Parasite)
Print an error when a system is out of hyperspace range
TT147, Removed (Docked)
Print an error when a system is out of hyperspace range
TT18 (Flight)
Try to initiate a jump into hyperspace
TT18 (Parasite)
Try to initiate a jump into hyperspace
TTX110, Removed (Docked)
Set the current system to the nearest system and return to hyp
TTX110, Removed (Flight)
Set the current system to the nearest system and return to hyp
WARP (Flight) *
Perform an in-system jump
WARP (Parasite) *
Perform an in-system jump
wW (Flight)
Start a hyperspace countdown
wW (Parasite)
Start a hyperspace countdown
wW, Removed (Docked)
Start a hyperspace countdown
Keyboard
Processing key presses and joysticks
Subroutines
b_14 (Flight)
Scan the Delta 14B joystick buttons
b_14 (I/O processor)
Scan the Delta 14B joystick buttons
check_keys (Parasite)
Wait until a key is pressed, quitting the game if the game is paused and ESCAPE is pressed
CTRL (Docked)
Scan the keyboard to see if CTRL is currently pressed
CTRL (Encyclopedia)
Scan the keyboard to see if CTRL is currently pressed
CTRL (Flight)
Scan the keyboard to see if CTRL is currently pressed
CTRL (Parasite)
Scan the keyboard to see if CTRL is currently pressed
DK4 (Docked)
Scan for pause, configuration and secondary flight keys
DK4 (Encyclopedia)
Scan for pause, configuration and secondary flight keys
DK4 (Flight)
Scan for pause, configuration and secondary flight keys
DK4 (Parasite)
Scan for pause, configuration and secondary flight keys
DK4_FLIGHT (Parasite)
Scan for pause, configuration and secondary flight keys (flight version)
DKJ1 (Flight)
Read joystick and flight controls
DKJ1 (Parasite)
Read joystick and flight controls
DKJ1, Removed (Docked)
Read joystick and flight controls
DKS1 (Flight)
Scan the keyboard for a flight key
DKS1 (Parasite)
Scan the keyboard or joystick for a flight key by sending a scan_y command to the I/O processor
DKS2 (Docked)
Read the joystick position
DKS2 (Encyclopedia)
Read the joystick position
DKS2 (Flight)
Read the joystick position
DKS2 (Parasite)
Read the joystick position
DKS3 (Docked)
Toggle a configuration setting and emit a beep
DKS3 (Encyclopedia)
Toggle a configuration setting and emit a beep
DKS3 (Flight)
Toggle a configuration setting and emit a beep
DKS3 (Parasite)
Toggle a configuration setting and emit a beep
DKS4 (Docked)
Scan the keyboard to see if a specific key is being pressed
DKS4 (Encyclopedia)
Scan the keyboard to see if a specific key is being pressed
DKS4 (Flight)
Scan the keyboard to see if a specific key is being pressed
DKS4 (I/O processor)
Scan the keyboard to see if a specific key is being pressed
DKS4 (Parasite)
Scan for a particular key press by sending a scan_xin command to the I/O processor
DOKEY (Docked) *
Scan for the joystick
DOKEY (Encyclopedia) *
Scan for the seven primary flight controls and apply the docking computer manoeuvring code
DOKEY (Flight) *
Scan for the seven primary flight controls and apply the docking computer manoeuvring code
DOKEY (Parasite) *
Scan for the seven primary flight controls and apply the docking computer manoeuvring code
DOKEY_FLIGHT (Parasite)
Scan for the seven primary flight controls (flight version)
FLKB (Docked)
Flush the keyboard buffer
FLKB (Encyclopedia)
Flush the keyboard buffer
FLKB (Parasite)
Flush the keyboard buffer
FLKB, Removed (Flight)
Flush the keyboard buffer
get_key (I/O processor)
Implement the get_key command (wait for a key press)
PAUSE2 (Docked)
Wait until a key is pressed, ignoring any existing key press
PAUSE2 (Encyclopedia)
Wait until a key is pressed, ignoring any existing key press
PAUSE2 (Parasite)
Wait until a key is pressed, ignoring any existing key press
RDKEY (Docked)
Scan the keyboard for key presses
RDKEY (Encyclopedia)
Scan the keyboard for key presses
RDKEY (Flight)
Scan the keyboard for key presses
RDKEY (I/O processor)
Scan the keyboard for key presses
RDKEY (Parasite)
Scan the keyboard for key presses by sending a scan_10in command to the I/O processor
scan_10in (I/O processor)
Implement the scan_10in command (scan the keyboard)
scan_fire (I/O processor)
Implement the scan_fire command (scan the joystick's fire button)
scan_fire (Parasite)
Check whether the joystick's fire button is being pressed by sending a scan_fire command to the I/O processor
scan_xin (I/O processor)
Implement the scan_xin command (scan the keyboard for a specific key press)
scan_y (I/O processor)
Implement the scan_y command (scan for a specific flight key or Delta 14B button press)
TT102 (Docked) *
Process function key, save key, hyperspace and chart key presses
TT102 (Encyclopedia) *
Process function key, save key, hyperspace and chart key presses
TT102 (Flight) *
Process function key, save key, hyperspace and chart key presses and update the hyperspace counter
TT102 (Parasite) *
Process function key, save key, hyperspace and chart key presses
TT17 (Docked)
Scan the keyboard for cursor key or joystick movement
TT17 (Encyclopedia)
Scan the keyboard for cursor key or joystick movement
TT17 (Flight)
Scan the keyboard for cursor key or joystick movement
TT17 (Parasite)
Scan the keyboard for cursor key or joystick movement
TT214, Removed (Docked)
Ask a question with a "Y/N?" prompt and return the response
TT217 (Docked)
Scan the keyboard until a key is pressed
TT217 (Encyclopedia)
Scan the keyboard until a key is pressed
TT217 (Parasite)
Scan the keyboard until a key is pressed by sending a get_key command to the I/O processor
U% (Flight)
Clear the key logger
U% (Parasite)
Clear the key logger
write_fe4e (I/O processor)
Implement the write_fe4e command (update the System VIA interrupt enable register)
Variables
b_table (Flight)
Lookup table for Delta 14B joystick buttons
b_table (I/O processor)
Lookup table for Delta 14B joystick buttons
func_tab (Encyclopedia)
Lookup table for internal numbers of red function keys
KYTB (Flight)
Lookup table for in-flight keyboard controls
KYTB (I/O processor)
Lookup table for in-flight keyboard controls
Loader
The loading screen and system setup
Subroutines
BEGIN (Docked)
Initialise the configuration variables and start the game
BEGIN (Parasite)
Initialise the configuration variables and start the game
boot_in (Parasite)
The entry point for the game
BRBR1 (Loader)
Loader break handler: print a newline and the error message, and then hang the computer
DEEOR, Removed (Docked)
Decrypt the main docked code between &1300 and &5FFF and the main game loop
DEEOR, Removed (Flight)
Decrypt the main flight code between &1300 and &55FF and jump into the main game loop
do_BYTEV (Loader)
The custom handler for OSBYTE calls in the BBC Master version
do_FILEV (Loader)
The custom handler for OSFILE calls in the BBC Master version
do_FSCV (Loader)
The custom handler for filing system calls in the BBC Master version
DOBEGIN (Docked)
Initialise the configuration variables and start the game
DOENTRY (Encyclopedia)
Initialise the encyclopedia and show the menu screen
DOENTRY (Flight)
Load and run the docked code
DOENTRYS (Parasite)
Dock at the space station, show the ship hangar and work out any mission progression
Elite loader (Part 1 of 3) (Loader)
Set up the split screen mode, move code around, set up the sound envelopes and configure the system
Elite loader (Part 2 of 3) (Loader)
Include binaries for recursive tokens, Missile blueprint and images
Elite loader (Part 3 of 3) (Loader)
Include binaries for the loading screen images
encyclopedia (Docked)
Load and run the encyclopedia code in 1.E
INBAY (Docked)
Set the break handler and go to the docking bay without showing the tunnel or ship hangar, or checking mission progress
INBAY (Encyclopedia)
Load and run the main docked code in 1.D
INBAY (Flight)
Load and run the main docked code in 1.D
INBAY (Parasite)
Restart the game upon death
launch (Encyclopedia)
Load and run the main docked code in 1.D
LOAD (Loader)
Load the main docked code, set up various vectors, run a checksum and start the game
LOADcode (Loader)
Encrypted LOAD routine, bundled up in the loader so it can be moved to &0B00 to be run
LOMOD (Flight)
Load a new ship blueprints file
old_BYTEV (Loader)
Call the default OSBYTE handler
restorews (Loader)
Restore the filing system workspace
RSHIPS (Flight)
Launch from the station, load a new set of ship blueprints and jump into the main game loop
RSHIPS (Parasite)
Launch from the station, load a new set of ship blueprints and jump into the main game loop
savews (Loader)
Save the filing system workspace in a safe place and replace it with the MOS character set
SCRAM (Docked)
Set the save_lock variable and break handler
SCRAM (Parasite)
Set the save_lock variable and break handler
set_vectors (Loader)
Set the FILEV, FSCV and BYTEV vectors to point to our custom handlers
to_dd00 (Loader)
BBC Master code for saving and restoring the MOS character set, bundled up in the loader so it can be moved to &DD00 to be run
TVT1code (Loader)
Code block at &1100-&11E2 that remains resident in both docked and flight mode (palettes, screen mode routine and commander data)
Variables
LTLI (Encyclopedia)
The OS command string for loading the docked code in file 1.D
LTLI (Flight)
The OS command string for loading the docked code in file 1.D
MESS1 (Loader)
The OS command string for changing the disc directory to E
mix_bits (Parasite)
Lookup table for locating a specific bit in the 32-bit word for a given ship blueprint position
RDLI (Docked)
The OS command string for running the flight code in file 1.F
SHIPI (Flight)
The OS command string for loading a ship blueprints file
Main loop
The core loop that runs Elite
Subroutines
Main flight loop (Part 1 of 16) (Flight)
Seed the random number generator
Main flight loop (Part 1 of 16) (Parasite)
Seed the random number generator
Main flight loop (Part 2 of 16) (Flight)
Calculate the alpha and beta angles from the current pitch and roll of our ship
Main flight loop (Part 2 of 16) (Parasite)
Calculate the alpha and beta angles from the current pitch and roll of our ship
Main flight loop (Part 3 of 16) (Flight)
Scan for flight keys and process the results
Main flight loop (Part 3 of 16) (Parasite)
Scan for flight keys and process the results
Main flight loop (Part 4 of 16) (Flight)
For each nearby ship: Copy the ship's data block from K% to the zero-page workspace at INWK
Main flight loop (Part 4 of 16) (Parasite)
For each nearby ship: Copy the ship's data block from K% to the zero-page workspace at INWK
Main flight loop (Part 5 of 16), Removed (Flight)
For each nearby ship: If an energy bomb has been set off, potentially kill this ship
Main flight loop (Part 6 of 16) (Flight)
For each nearby ship: Move the ship in space and copy the updated INWK data block back to K%
Main flight loop (Part 6 of 16) (Parasite)
For each nearby ship: Move the ship in space and copy the updated INWK data block back to K%
Main flight loop (Part 7 of 16) (Flight)
For each nearby ship: Check whether we are docking, scooping or colliding with it
Main flight loop (Part 7 of 16) (Parasite)
For each nearby ship: Check whether we are docking, scooping or colliding with it
Main flight loop (Part 8 of 16) (Flight)
For each nearby ship: Process us potentially scooping this item
Main flight loop (Part 8 of 16) (Parasite)
For each nearby ship: Process us potentially scooping this item
Main flight loop (Part 9 of 16) (Flight)
For each nearby ship: If it is a space station, check whether we are successfully docking with it
Main flight loop (Part 9 of 16) (Parasite)
For each nearby ship: If it is a space station, check whether we are successfully docking with it
Main flight loop (Part 10 of 16) (Flight)
For each nearby ship: Remove if scooped, or process collisions
Main flight loop (Part 10 of 16) (Parasite)
For each nearby ship: Remove if scooped, or process collisions
Main flight loop (Part 11 of 16) (Flight)
For each nearby ship: Process missile lock and firing our laser
Main flight loop (Part 11 of 16) (Parasite)
For each nearby ship: Process missile lock and firing our laser
Main flight loop (Part 12 of 16) (Flight)
For each nearby ship: Draw the ship, remove if killed, loop back
Main flight loop (Part 12 of 16) (Parasite)
For each nearby ship: Draw the ship, remove if killed, loop back
Main flight loop (Part 13 of 16) (Flight)
Charge shields and energy banks
Main flight loop (Part 13 of 16) (Parasite)
Charge shields and energy banks
Main flight loop (Part 14 of 16) (Flight)
Spawn a space station if we are close enough to the planet
Main flight loop (Part 14 of 16) (Parasite)
Spawn a space station if we are close enough to the planet
Main flight loop (Part 15 of 16) (Flight)
Perform altitude checks with the planet and sun and process fuel scooping if appropriate
Main flight loop (Part 15 of 16) (Parasite)
Perform altitude checks with the planet and sun and process fuel scooping if appropriate
Main flight loop (Part 16 of 16) (Flight)
Process laser pulsing, E.C.M. energy drain, call stardust routine
Main flight loop (Part 16 of 16) (Parasite)
Process laser pulsing, E.C.M. energy drain, call stardust routine
Main game loop (Part 1 of 6) (Flight)
Spawn a trader (a Cobra Mk III, Python, Boa or Anaconda)
Main game loop (Part 2 of 6) (Docked) *
Update the main loop counters
Main game loop (Part 2 of 6) (Encyclopedia) *
Update the main loop counters
Main game loop (Part 2 of 6) (Flight) *
Call the main flight loop, and potentially spawn a trader, an asteroid, or a cargo canister
Main game loop (Part 2 of 6) (Parasite) *
Update the main loop counters
Main game loop (Part 3 of 6) (Flight)
Potentially spawn a cop, particularly if we've been bad
Main game loop (Part 4 of 6) (Flight)
Potentially spawn a lone bounty hunter or up to four pirates
Main game loop (Part 5 of 6) (Docked)
Cool down lasers, make calls to update the dashboard
Main game loop (Part 5 of 6) (Encyclopedia)
Cool down lasers, make calls to update the dashboard
Main game loop (Part 5 of 6) (Flight)
Cool down lasers, make calls to update the dashboard
Main game loop (Part 5 of 6) (Parasite)
Cool down lasers, make calls to update the dashboard
Main game loop (Part 6 of 6) (Docked)
Process non-flight key presses (red function keys, docked keys)
Main game loop (Part 6 of 6) (Encyclopedia)
Process non-flight key presses (red function keys, docked keys)
Main game loop (Part 6 of 6) (Flight)
Process non-flight key presses (red function keys, docked keys)
Main game loop (Part 6 of 6) (Parasite)
Process non-flight key presses (red function keys, docked keys)
Main game loop for flight (Part 1 of 6) (Parasite)
Spawn a trader (a Cobra Mk III, Python, Boa or Anaconda)
Main game loop for flight (Part 2 of 6) (Parasite)
Update the main loop counters
Main game loop for flight (Part 3 of 6) (Parasite)
Potentially spawn a cop, particularly if we've been bad
Main game loop for flight (Part 4 of 6) (Parasite)
Potentially spawn a lone bounty hunter or up to four pirates
Main game loop for flight (Part 5 of 6) (Parasite)
Cool down lasers, make calls to update the dashboard
Main game loop for flight (Part 6 of 6) (Parasite)
Process non-flight key presses (red function keys, docked keys)
Market
Market prices, selling, buying and inventory
Subroutines
dn (Docked)
Print the amount of money we have left in the cash pot, then make a short, high beep and delay for 1 second
dn (Parasite)
Print the amount of money we have left in the cash pot, then make a short, high beep and delay for 1 second
gnum (Docked)
Get a number from the keyboard
gnum (Encyclopedia)
Get a number from the keyboard
gnum (Parasite)
Get a number from the keyboard
NWDAV4 (Docked)
Print an "ITEM?" error, make a beep and rejoin the TT210 routine
NWDAV4 (Parasite)
Print an "ITEM?" error, make a beep and rejoin the TT210 routine
stay_here (Docked)
Pay a docking fee and refresh the system's market prices
stay_here (Parasite)
Pay a docking fee and refresh the system's market prices
tnpr (Docked)
Work out if we have space for a specific amount of cargo
tnpr (Parasite)
Work out if we have space for a specific amount of cargo
tnpr1 (Flight)
Work out if we have space for one tonne of cargo
tnpr1 (Parasite)
Work out if we have space for one tonne of cargo
tnpr1, Removed (Flight)
Work out if we have space for one tonne of cargo
TT151 (Docked)
Print the name, price and availability of a market item
TT151 (Flight)
Print the name, price and availability of a market item
TT151 (Parasite)
Print the name, price and availability of a market item
TT152 (Docked)
Print the unit ("t", "kg" or "g") for a market item
TT152 (Flight)
Print the unit ("t", "kg" or "g") for a market item
TT152 (Parasite)
Print the unit ("t", "kg" or "g") for a market item
TT160 (Docked)
Print "t" (for tonne) and a space
TT160 (Flight)
Print "t" (for tonne) and a space
TT160 (Parasite)
Print "t" (for tonne) and a space
TT161 (Docked)
Print "kg" (for kilograms)
TT161 (Flight)
Print "kg" (for kilograms)
TT161 (Parasite)
Print "kg" (for kilograms)
TT163 (Docked)
Print the headers for the table of market prices
TT163 (Flight)
Print the headers for the table of market prices
TT163 (Parasite)
Print the headers for the table of market prices
TT167 (Docked) *
Show the Market Price screen (red key f7)
TT167 (Flight) *
Show the Market Price screen (red key f7)
TT167 (Parasite) *
Show the Market Price screen (red key f7)
TT16a (Docked)
Print "g" (for grams)
TT16a (Flight)
Print "g" (for grams)
TT16a (Parasite)
Print "g" (for grams)
TT208 (Docked) *
Show the Sell Cargo screen (red key f2) or Sell Equipment screen (CTRL-f2)
TT208 (Parasite) *
Show the Sell Cargo screen (red key f2) or Sell Equipment screen (CTRL-f2)
TT210 (Docked)
Show a list of current cargo in our hold, optionally to sell
TT210 (Flight)
Show a list of current cargo in our hold, optionally to sell
TT210 (Parasite)
Show a list of current cargo in our hold, optionally to sell
TT213 (Docked) *
Show the Inventory screen (red key f9)
TT213 (Flight) *
Show the Inventory screen (red key f9)
TT213 (Parasite) *
Show the Inventory screen (red key f9)
TT219 (Docked) *
Show the Buy Cargo screen (red key f1) or Special Cargo screen (CTRL-f1)
TT219 (Parasite) *
Show the Buy Cargo screen (red key f1) or Special Cargo screen (CTRL-f1)
var (Docked)
Calculate QQ19+3 = economy * |economic_factor|
var (Flight)
Calculate QQ19+3 = economy * |economic_factor|
var (Parasite)
Calculate QQ19+3 = economy * |economic_factor|
Variables
QQ23 (Docked)
Market prices table
QQ23 (Flight)
Market prices table
QQ23 (Parasite)
Market prices table
Macros
ITEM (Docked)
Macro definition for the market prices table
ITEM (Flight)
Macro definition for the market prices table
ITEM (Parasite)
Macro definition for the market prices table
Maths (Arithmetic)
Addition, subtraction, multiplication, division
Subroutines
ADD (Docked) *
Calculate (A X) = (A P) + (S R)
ADD (Encyclopedia) *
Calculate (A X) = (A P) + (S R)
ADD (Flight) *
Calculate (A X) = (A P) + (S R)
ADD (Parasite) *
Calculate (A X) = (A P) + (S R)
DORND (Docked) *
Generate random numbers
DORND (Encyclopedia) *
Generate random numbers
DORND (Flight) *
Generate random numbers
DORND (Loader) *
Generate random numbers
DORND (Parasite) *
Generate random numbers
DORND2 (Parasite)
Generate random numbers, making sure the C flag doesn't affect the outcome
DV41 (Flight)
Calculate (P R) = 256 * DELTA / A
DV41 (Parasite)
Calculate (P R) = 256 * DELTA / A
DV41, Removed (Docked)
Calculate (P R) = 256 * DELTA / A
DV42 (Flight)
Calculate (P R) = 256 * DELTA / z_hi
DV42 (Parasite)
Calculate (P R) = 256 * DELTA / z_hi
DV42, Removed (Docked)
Calculate (P R) = 256 * DELTA / z_hi
DVID3B2 (Flight)
Calculate K(3 2 1 0) = (A P+1 P) / (z_sign z_hi z_lo)
DVID3B2 (Parasite)
Calculate K(3 2 1 0) = (A P+1 P) / (z_sign z_hi z_lo)
DVID3B2, Removed (Docked)
Calculate K(3 2 1 0) = (A P+1 P) / (z_sign z_hi z_lo)
DVID4 (Docked) *
Calculate (P R) = 256 * A / Q
DVID4 (Flight) *
Calculate (P R) = 256 * A / Q
DVID4 (Parasite) *
Calculate (P R) = 256 * A / Q
DVIDT (Docked)
Calculate (P+1 A) = (A P) / Q
DVIDT (Encyclopedia)
Calculate (P+1 A) = (A P) / Q
DVIDT (Flight)
Calculate (P+1 A) = (A P) / Q
DVIDT (Parasite)
Calculate (P+1 A) = (A P) / Q
FMLTU (Docked)
Calculate A = A * Q / 256
FMLTU (Encyclopedia)
Calculate A = A * Q / 256
FMLTU (Flight)
Calculate A = A * Q / 256
FMLTU (Parasite)
Calculate A = A * Q / 256
FMLTU2 (Docked)
Calculate A = K * sin(A)
FMLTU2 (Encyclopedia)
Calculate A = K * sin(A)
FMLTU2 (Flight)
Calculate A = K * sin(A)
FMLTU2 (Parasite)
Calculate A = K * sin(A)
GC2 (Docked)
Calculate (Y X) = (A P) * 4
GC2 (Flight)
Calculate (Y X) = (A P) * 4
GC2 (Parasite)
Calculate (Y X) = (A P) * 4
GCASH (Docked)
Calculate (Y X) = P * Q * 4
GCASH (Parasite)
Calculate (Y X) = P * Q * 4
GCASH, Removed (Flight)
Calculate (Y X) = P * Q * 4
LCASH (Docked)
Subtract an amount of cash from the cash pot
LCASH (Parasite)
Subtract an amount of cash from the cash pot
LL120 (Docked)
Calculate (Y X) = (S x1_lo) * XX12+2 or (S x1_lo) / XX12+2
LL120 (Encyclopedia)
Calculate (Y X) = (S x1_lo) * XX12+2 or (S x1_lo) / XX12+2
LL120 (Flight)
Calculate (Y X) = (S x1_lo) * XX12+2 or (S x1_lo) / XX12+2
LL120 (Parasite)
Calculate (Y X) = (S x1_lo) * XX12+2 or (S x1_lo) / XX12+2
LL123 (Docked)
Calculate (Y X) = (S R) / XX12+2 or (S R) * XX12+2
LL123 (Encyclopedia)
Calculate (Y X) = (S R) / XX12+2 or (S R) * XX12+2
LL123 (Flight)
Calculate (Y X) = (S R) / XX12+2 or (S R) * XX12+2
LL123 (Parasite)
Calculate (Y X) = (S R) / XX12+2 or (S R) * XX12+2
LL129 (Docked)
Calculate Q = XX12+2, A = S EOR XX12+3 and (S R) = |S R|
LL129 (Encyclopedia)
Calculate Q = XX12+2, A = S EOR XX12+3 and (S R) = |S R|
LL129 (Flight)
Calculate Q = XX12+2, A = S EOR XX12+3 and (S R) = |S R|
LL129 (Parasite)
Calculate Q = XX12+2, A = S EOR XX12+3 and (S R) = |S R|
LL28 (Docked)
Calculate R = 256 * A / Q
LL28 (Encyclopedia)
Calculate R = 256 * A / Q
LL28 (Flight)
Calculate R = 256 * A / Q
LL28 (Parasite)
Calculate R = 256 * A / Q
LL38 (Docked)
Calculate (S A) = (S R) + (A Q)
LL38 (Encyclopedia)
Calculate (S A) = (S R) + (A Q)
LL38 (Flight)
Calculate (S A) = (S R) + (A Q)
LL38 (Parasite)
Calculate (S A) = (S R) + (A Q)
LL5 (Docked)
Calculate Q = SQRT(R Q)
LL5 (Encyclopedia)
Calculate Q = SQRT(R Q)
LL5 (Flight)
Calculate Q = SQRT(R Q)
LL5 (Parasite)
Calculate Q = SQRT(R Q)
LL61 (Docked)
Calculate (U R) = 256 * A / Q
LL61 (Encyclopedia)
Calculate (U R) = 256 * A / Q
LL61 (Flight)
Calculate (U R) = 256 * A / Q
LL61 (Parasite)
Calculate (U R) = 256 * A / Q
LL62 (Docked)
Calculate 128 - (U R)
LL62 (Encyclopedia)
Calculate 128 - (U R)
LL62 (Flight)
Calculate 128 - (U R)
LL62 (Parasite)
Calculate 128 - (U R)
MAD (Docked)
Calculate (A X) = Q * A + (S R)
MAD (Encyclopedia)
Calculate (A X) = Q * A + (S R)
MAD (Flight)
Calculate (A X) = Q * A + (S R)
MAD (Parasite)
Calculate (A X) = Q * A + (S R)
MAS3 (Flight)
Calculate A = x_hi^2 + y_hi^2 + z_hi^2 in the K% block
MAS3 (Parasite)
Calculate A = x_hi^2 + y_hi^2 + z_hi^2 in the K% block
MCASH (Docked)
Add an amount of cash to the cash pot
MCASH (Flight)
Add an amount of cash to the cash pot
MCASH (Parasite)
Add an amount of cash to the cash pot
MLS1 (Flight)
Calculate (A P) = ALP1 * A
MLS1 (Parasite)
Calculate (A P) = ALP1 * A
MLS2 (Flight)
Calculate (S R) = XX(1 0) and (A P) = A * ALP1
MLS2 (Parasite)
Calculate (S R) = XX(1 0) and (A P) = A * ALP1
MLS2, Removed (Docked)
Calculate (S R) = XX(1 0) and (A P) = A * ALP1
MLTU2 (Flight)
Calculate (A P+1 P) = (A ~P) * Q
MLTU2 (Parasite)
Calculate (A P+1 P) = (A ~P) * Q
MLTU2, Removed (Docked)
Calculate (A P+1 P) = (A ~P) * Q
MLU1 (Flight)
Calculate Y1 = y_hi and (A P) = |y_hi| * Q for Y-th stardust
MLU1 (Parasite)
Calculate Y1 = y_hi and (A P) = |y_hi| * Q for Y-th stardust
MLU1, Removed (Docked)
Calculate Y1 = y_hi and (A P) = |y_hi| * Q for Y-th stardust
MLU2 (Flight)
Calculate (A P) = |A| * Q
MLU2 (Parasite)
Calculate (A P) = |A| * Q
MLU2, Removed (Docked)
Calculate (A P) = |A| * Q
MU1 (Docked)
Copy X into P and A, and clear the C flag
MU1 (Encyclopedia)
Copy X into P and A, and clear the C flag
MU1 (Flight)
Copy X into P and A, and clear the C flag
MU1 (Parasite)
Copy X into P and A, and clear the C flag
MU11 (Docked)
Calculate (A P) = P * X
MU11 (Encyclopedia)
Calculate (A P) = P * X
MU11 (Flight)
Calculate (A P) = P * X
MU11 (Parasite)
Calculate (A P) = P * X
MU5 (Flight)
Set K(3 2 1 0) = (A A A A) and clear the C flag
MU5 (Parasite)
Set K(3 2 1 0) = (A A A A) and clear the C flag
MU5, Removed (Docked)
Set K(3 2 1 0) = (A A A A) and clear the C flag
MU6 (Flight)
Set P(1 0) = (A A)
MU6 (Parasite)
Set P(1 0) = (A A)
MU6, Removed (Docked)
Set P(1 0) = (A A)
MULT1 (Docked)
Calculate (A P) = Q * A
MULT1 (Encyclopedia)
Calculate (A P) = Q * A
MULT1 (Flight)
Calculate (A P) = Q * A
MULT1 (Parasite)
Calculate (A P) = Q * A
MULT12 (Docked)
Calculate (S R) = Q * A
MULT12 (Encyclopedia)
Calculate (S R) = Q * A
MULT12 (Flight)
Calculate (S R) = Q * A
MULT12 (Parasite)
Calculate (S R) = Q * A
MULT3 (Flight)
Calculate K(3 2 1 0) = (A P+1 P) * Q
MULT3 (Parasite)
Calculate K(3 2 1 0) = (A P+1 P) * Q
MULTU (Docked) *
Calculate (A P) = P * Q
MULTU (Encyclopedia) *
Calculate (A P) = P * Q
MULTU (Flight) *
Calculate (A P) = P * Q
MULTU (Parasite) *
Calculate (A P) = P * Q
MUT1 (Flight)
Calculate R = XX and (A P) = Q * A
MUT1 (Parasite)
Calculate R = XX and (A P) = Q * A
MUT1, Removed (Docked)
Calculate R = XX and (A P) = Q * A
MUT2 (Flight)
Calculate (S R) = XX(1 0) and (A P) = Q * A
MUT2 (Parasite)
Calculate (S R) = XX(1 0) and (A P) = Q * A
MUT2, Removed (Docked)
Calculate (S R) = XX(1 0) and (A P) = Q * A
MUT3, Removed (Docked)
An unused routine that does the same as MUT2
MUT3, Removed (Flight)
An unused routine that does the same as MUT2
PIX1 (Flight)
Calculate (YY+1 SYL+Y) = (A P) + (S R) and draw stardust particle
PIX1 (Parasite)
Calculate (YY+1 SYL+Y) = (A P) + (S R) and draw stardust particle
PIX1, Removed (Docked)
Calculate (YY+1 SYL+Y) = (A P) + (S R) and draw stardust particle
ROOT (Loader)
Calculate ZP = SQRT(ZP(1 0))
SPS2 (Flight)
Calculate (Y X) = A / 10
SPS2 (Parasite)
Calculate (Y X) = A / 10
SPS2, Moved (Flight)
Calculate (Y X) = A / 10
SQUA (Docked)
Clear bit 7 of A and calculate (A P) = A * A
SQUA (Encyclopedia)
Clear bit 7 of A and calculate (A P) = A * A
SQUA (Flight)
Clear bit 7 of A and calculate (A P) = A * A
SQUA (Parasite)
Clear bit 7 of A and calculate (A P) = A * A
SQUA2 (Docked)
Calculate (A P) = A * A
SQUA2 (Encyclopedia)
Calculate (A P) = A * A
SQUA2 (Flight)
Calculate (A P) = A * A
SQUA2 (Loader)
Calculate (A P) = A * A
SQUA2 (Parasite)
Calculate (A P) = A * A
TAS1 (Flight)
Calculate K3 = (x_sign x_hi x_lo) - V(1 0)
TAS1 (Parasite)
Calculate K3 = (x_sign x_hi x_lo) - V(1 0)
TIS1 (Docked)
Calculate (A ?) = (-X * A + (S R)) / 96
TIS1 (Encyclopedia)
Calculate (A ?) = (-X * A + (S R)) / 96
TIS1 (Flight)
Calculate (A ?) = (-X * A + (S R)) / 96
TIS1 (Parasite)
Calculate (A ?) = (-X * A + (S R)) / 96
TIS2 (Docked)
Calculate A = A / Q
TIS2 (Encyclopedia)
Calculate A = A / Q
TIS2 (Flight)
Calculate A = A / Q
TIS2 (Parasite)
Calculate A = A / Q
TIS3 (Docked)
Calculate -(nosev_1 * roofv_1 + nosev_2 * roofv_2) / nosev_3
TIS3 (Encyclopedia)
Calculate -(nosev_1 * roofv_1 + nosev_2 * roofv_2) / nosev_3
TIS3 (Flight)
Calculate -(nosev_1 * roofv_1 + nosev_2 * roofv_2) / nosev_3
TIS3 (Parasite)
Calculate -(nosev_1 * roofv_1 + nosev_2 * roofv_2) / nosev_3
Unused duplicate of MULTU (Flight)
An unused duplicate of the MULTU routine
Unused duplicate of MULTU (Parasite)
An unused duplicate of the MULTU routine
Unused duplicate of MULTU, Removed (Docked)
An unused duplicate of the MULTU routine
VCSU1 (Flight)
Calculate vector K3(8 0) = [x y z] - coordinates of the sun or space station
VCSU1 (Parasite)
Calculate vector K3(8 0) = [x y z] - coordinates of the sun or space station
VCSUB (Flight)
Calculate vector K3(8 0) = [x y z] - coordinates in (A V)
VCSUB (Parasite)
Calculate vector K3(8 0) = [x y z] - coordinates in (A V)
Maths (Geometry)
Vectors, coordinates, dot products and matrices
Subroutines
ARCTAN (Flight)
Calculate A = arctan(P / Q)
ARCTAN (Parasite)
Calculate A = arctan(P / Q)
FAROF (Flight)
Compare x_hi, y_hi and z_hi with 224
FAROF (Parasite)
Compare x_hi, y_hi and z_hi with 224
FAROF2 (Flight)
Compare x_hi, y_hi and z_hi with A
FAROF2 (Parasite)
Compare x_hi, y_hi and z_hi with A
LL51 (Docked)
Calculate the dot product of XX15 and XX16
LL51 (Encyclopedia)
Calculate the dot product of XX15 and XX16
LL51 (Flight)
Calculate the dot product of XX15 and XX16
LL51 (Parasite)
Calculate the dot product of XX15 and XX16
MAS1 (Flight)
Add an orientation vector coordinate to an INWK coordinate
MAS1 (Parasite)
Add an orientation vector coordinate to an INWK coordinate
MAS2 (Flight)
Calculate a cap on the maximum distance to the planet or sun
MAS2 (Parasite)
Calculate a cap on the maximum distance to the planet or sun
MAS4 (Flight)
Calculate a cap on the maximum distance to a ship
MAS4 (Parasite)
Calculate a cap on the maximum distance to a ship
NORM (Docked) *
Normalise the three-coordinate vector in XX15
NORM (Encyclopedia) *
Normalise the three-coordinate vector in XX15
NORM (Flight) *
Normalise the three-coordinate vector in XX15
NORM (Parasite) *
Normalise the three-coordinate vector in XX15
PROJ (Flight)
Project the current ship or planet onto the screen
PROJ (Parasite)
Project the current ship or planet onto the screen
SPS1 (Flight)
Calculate the vector to the planet, sun or station and store it in XX15
SPS1 (Parasite)
Calculate the vector to the planet, sun or station and store it in XX15
SPS1, Removed (Docked)
Calculate the vector to the planet, sun or station and store it in XX15
SPS3 (Flight)
Copy a space coordinate from the K% block into K3
SPS3 (Parasite)
Copy a space coordinate from the K% block into K3
SPS3, Removed (Docked)
Copy a space coordinate from the K% block into K3
SPS4, Removed (Flight)
Calculate the vector to the space station
TAS2 (Flight)
Normalise the three-coordinate vector in K3
TAS2 (Parasite)
Normalise the three-coordinate vector in K3
TAS2, Removed (Docked)
Normalise the three-coordinate vector in K3
TAS3 (Flight)
Calculate the dot product of XX15 and an orientation vector
TAS3 (Parasite)
Calculate the dot product of XX15 and an orientation vector
TAS3, Removed (Docked)
Calculate the dot product of XX15 and an orientation vector
TAS4 (Flight)
Calculate the dot product of XX15 and one of the space station's orientation vectors
TAS4 (Parasite)
Calculate the dot product of XX15 and one of the space station's orientation vectors
TAS6 (Flight)
Negate the vector in XX15 so it points in the opposite direction
TAS6 (Parasite)
Negate the vector in XX15 so it points in the opposite direction
TIDY (Docked) *
Orthonormalise the orientation vectors for a ship
TIDY (Encyclopedia) *
Orthonormalise the orientation vectors for a ship
TIDY (Flight) *
Orthonormalise the orientation vectors for a ship
TIDY (Parasite) *
Orthonormalise the orientation vectors for a ship
Variables
ACT (Parasite)
Arctan table
ACT (Text tokens)
Arctan table
SNE (Parasite)
Sine/cosine table
SNE (Text tokens)
Sine/cosine table
Missions
Hunting stolen ships and evading Thargoids
Subroutines
BRIEF (Docked)
Start mission 1 and show the mission briefing
BRIEF (Parasite)
Start mission 1 and show the mission briefing
BRIEF2 (Docked)
Start mission 2
BRIEF2 (Parasite)
Start mission 2
BRIEF3 (Docked)
Receive the briefing and plans for mission 2
BRIEF3 (Parasite)
Receive the briefing and plans for mission 2
BRIS (Docked)
Clear the screen, display "INCOMING MESSAGE" and wait for 2 seconds
BRIS (Parasite)
Clear the screen, display "INCOMING MESSAGE" and wait for 2 seconds
BRP (Docked)
Print an extended token and show the Status Mode screen
BRP (Parasite)
Print an extended token and show the Status Mode screen
cour_buy (Docked)
Show the Special Cargo screen (CTRL-f1)
cour_buy (Parasite)
Show the Special Cargo screen (CTRL-f1)
cour_count (Docked)
Generate a single special cargo mission and display its menu item
cour_count (Parasite)
Generate a single special cargo mission and display its menu item
cour_dock (Docked)
Update the current special cargo delivery mission on docking
cour_dock (Parasite)
Update the current special cargo delivery mission on docking
DEBRIEF (Docked)
Finish mission 1
DEBRIEF (Parasite)
Finish mission 1
DEBRIEF2 (Docked)
Finish mission 2
DEBRIEF2 (Parasite)
Finish mission 2
PAS1 (Docked)
Display a rotating ship at space coordinates (0, 112, 256) and scan the keyboard
PAS1 (Parasite)
Display a rotating ship at space coordinates (0, 112, 256) and scan the keyboard
PAUSE (Docked)
Display a rotating ship, waiting until a key is pressed, then remove the ship from the screen
PAUSE (Parasite)
Display a rotating ship, waiting until a key is pressed, then remove the ship from the screen
THERE (Flight)
Check whether we are in the Constrictor's system in mission 1
THERE (Parasite)
Check whether we are in the Constrictor's system in mission 1
Moving
Moving and rotating ships and planets in space
Subroutines
MV40 (Flight)
Rotate the planet or sun's location in space by the amount of pitch and roll of our ship
MV40 (Parasite)
Rotate the planet or sun's location in space by the amount of pitch and roll of our ship
MVEIT (Part 1 of 9) (Docked)
Move current ship: Tidy the orientation vectors
MVEIT (Part 1 of 9) (Encyclopedia)
Move current ship: Tidy the orientation vectors
MVEIT (Part 1 of 9) (Flight)
Move current ship: Tidy the orientation vectors
MVEIT (Part 1 of 9) (Parasite)
Move current ship: Tidy the orientation vectors
MVEIT (Part 2 of 9) (Flight)
Move current ship: Call tactics routine, remove ship from scanner
MVEIT (Part 3 of 9) (Flight)
Move current ship: Move ship forward according to its speed
MVEIT (Part 4 of 9) (Flight)
Move current ship: Apply acceleration to ship's speed as a one-off
MVEIT (Part 5 of 9) (Flight)
Move current ship: Rotate ship's location by our pitch and roll
MVEIT (Part 6 of 9) (Flight)
Move current ship: Move the ship in space according to our speed
MVEIT (Part 7 of 9) (Docked)
Move current ship: Rotate ship's orientation vectors by pitch/roll
MVEIT (Part 7 of 9) (Encyclopedia)
Move current ship: Rotate ship's orientation vectors by pitch/roll
MVEIT (Part 7 of 9) (Flight)
Move current ship: Rotate ship's orientation vectors by pitch/roll
MVEIT (Part 7 of 9) (Parasite)
Move current ship: Rotate ship's orientation vectors by pitch/roll
MVEIT (Part 8 of 9) (Docked)
Move current ship: Rotate ship about itself by its own pitch/roll
MVEIT (Part 8 of 9) (Encyclopedia)
Move current ship: Rotate ship about itself by its own pitch/roll
MVEIT (Part 8 of 9) (Flight)
Move current ship: Rotate ship about itself by its own pitch/roll
MVEIT (Part 8 of 9) (Parasite)
Move current ship: Rotate ship about itself by its own pitch/roll
MVEIT (Part 9 of 9) (Docked)
Return from the subroutine (the scanner is not used when docked)
MVEIT (Part 9 of 9) (Encyclopedia)
Move current ship: Redraw on scanner, if it hasn't been destroyed
MVEIT (Part 9 of 9) (Flight)
Move current ship: Redraw on scanner, if it hasn't been destroyed
MVEIT (Part 9 of 9) (Parasite)
Move current ship: Redraw on scanner, if it hasn't been destroyed
MVEIT_FLIGHT (Part 1 of 6) (Parasite)
Move current ship (flight version)
MVEIT_FLIGHT (Part 2 of 6) (Parasite)
Move current ship: Call tactics routine, remove ship from scanner
MVEIT_FLIGHT (Part 3 of 6) (Parasite)
Move current ship: Move ship forward according to its speed
MVEIT_FLIGHT (Part 4 of 6) (Parasite)
Move current ship: Apply acceleration to ship's speed as a one-off
MVEIT_FLIGHT (Part 5 of 6) (Parasite)
Move current ship: Rotate ship's location by our pitch and roll
MVEIT_FLIGHT (Part 6 of 6) (Parasite)
Move current ship: Move the ship in space according to our speed
MVS4 (Docked) *
Apply pitch and roll to an orientation vector
MVS4 (Encyclopedia) *
Apply pitch and roll to an orientation vector
MVS4 (Flight) *
Apply pitch and roll to an orientation vector
MVS4 (Parasite) *
Apply pitch and roll to an orientation vector
MVS5 (Docked)
Apply a 3.6 degree pitch or roll to an orientation vector
MVS5 (Encyclopedia)
Apply a 3.6 degree pitch or roll to an orientation vector
MVS5 (Flight)
Apply a 3.6 degree pitch or roll to an orientation vector
MVS5 (Parasite)
Apply a 3.6 degree pitch or roll to an orientation vector
MVT1 (Flight)
Calculate (x_sign x_hi x_lo) = (x_sign x_hi x_lo) + (A R)
MVT1 (Parasite)
Calculate (x_sign x_hi x_lo) = (x_sign x_hi x_lo) + (A R)
MVT1, Removed (Docked)
Calculate (x_sign x_hi x_lo) = (x_sign x_hi x_lo) + (A R)
MVT3 (Flight)
Calculate K(3 2 1) = (x_sign x_hi x_lo) + K(3 2 1)
MVT3 (Parasite)
Calculate K(3 2 1) = (x_sign x_hi x_lo) + K(3 2 1)
MVT3, Removed (Docked)
Calculate K(3 2 1) = (x_sign x_hi x_lo) + K(3 2 1)
MVT6 (Flight)
Calculate (A P+2 P+1) = (x_sign x_hi x_lo) + (A P+2 P+1)
MVT6 (Parasite)
Calculate (A P+2 P+1) = (x_sign x_hi x_lo) + (A P+2 P+1)
MVT6, Removed (Docked)
Calculate (A P+2 P+1) = (x_sign x_hi x_lo) + (A P+2 P+1)
SFS2 (Flight)
Move a ship in space along one of the coordinate axes
SFS2 (Parasite)
Move a ship in space along one of the coordinate axes
Save and load
Commander files and competition codes
Subroutines
BRKBK (Docked)
Set the standard BRKV handler for the game
BRKBK (Encyclopedia)
Set the standard BRKV handler for the game
BRKBK (Parasite)
Set the standard BRKV handler for the game
CAT (Docked)
Catalogue a disc, wait for a key press and display the disc access menu
CAT (Parasite)
Catalogue a disc, wait for a key press and display the disc access menu
CATS (Docked)
Ask for a disc drive number and print a catalogue of that drive
CATS (Parasite)
Ask for a disc drive number and print a catalogue of that drive
CHECK (Docked)
Calculate the checksum for the last saved commander data block
CHECK (Parasite)
Calculate the checksum for the last saved commander data block
confirm (Docked)
Print "ARE YOU SURE?" and wait for a response
confirm (Parasite)
Print "ARE YOU SURE?" and wait for a response
DELT (Docked)
Catalogue a disc, ask for a filename to delete, and delete the file
DELT (Parasite)
Catalogue a disc, ask for a filename to delete, and delete the file
GTDRV (Docked)
Get an ASCII disc drive number from the keyboard
GTDRV (Parasite)
Get an ASCII disc drive number from the keyboard
GTNMEW (Docked)
Fetch the name of a commander file to save or load
GTNMEW (Parasite)
Fetch the name of a commander file to save or load
LOD (Docked) *
Load a commander file
LOD (Parasite) *
Load a commander file
MEBRK (Docked)
The BRKV handler for disc access operations
MEBRK (Parasite)
The BRKV handler for disc access operations
QUS1 (Docked)
Save or load the commander file
QUS1 (Parasite)
Save or load the commander file
retry (Docked)
Scan the keyboard until a key is pressed and display the disc access menu
retry (Parasite)
Scan the keyboard until a key is pressed and display the disc access menu
SVE (Docked) *
Save the commander file
SVE (Parasite) *
Save the commander file
TR1 (Docked)
Copy the last saved commander's name from NA% to INWK
TR1 (Parasite)
Copy the last saved commander's name from NA% to INWK
TRNME (Docked)
Copy the last saved commander's name from INWK to NA%
TRNME (Parasite)
Copy the last saved commander's name from INWK to NA%
Variables
CHK (Loader)
First checksum byte for the saved commander data file
CHK (Parasite)
First checksum byte for the saved commander data file
CHK2 (Loader)
Second checksum byte for the saved commander data file
CHK2 (Parasite)
Second checksum byte for the saved commander data file
CTLI (Docked)
The OS command string for cataloguing a disc
CTLI (Parasite)
The OS command string for cataloguing a disc
DELI (Docked)
The OS command string for deleting a file
DELI (Parasite)
The OS command string for deleting a file
NA% (Loader)
The data block for the last saved commander
NA% (Parasite)
The data block for the last saved commander
S1% (Loader)
The drive and directory number used when saving or loading a commander file
S1% (Parasite)
The drive and directory number used when saving or loading a commander file
stack, Removed (Docked)
Temporary storage for the stack pointer when switching the BRKV handler between BRBR and MEBRK
Ship hangar
The ship hangar that's displayed on docking
Subroutines
HA2 (I/O processor)
Implement the picture_v command (draw vertical lines for the ship hangar background)
HALL (Docked)
Draw the ships in the ship hangar, then draw the hangar
HALL (Parasite)
Draw the ships in the ship hangar, then draw the hangar
HANGER (Docked)
Display the ship hangar
HANGER (I/O processor)
Implement the picture_h command (draw horizontal lines for the ship hangar floor)
HANGER (Parasite)
Display the ship hangar by sending picture_h and picture_v commands to the I/O processor
HAS1 (Docked)
Draw a ship in the ship hangar
HAS1 (Parasite)
Draw a ship in the ship hangar
HAS2 (Docked)
Draw a hangar background line from left to right
HAS2 (I/O processor)
Draw a hangar background line from left to right
HAS3 (Docked)
Draw a hangar background line from right to left
HAS3 (I/O processor)
Draw a hangar background line from right to left
UNWISE (Docked)
Switch the main line-drawing routine between EOR and OR logic
UNWISE (I/O processor)
Switch the main line-drawing routine between EOR and OR logic
UNWISE (Parasite)
Switch the main line-drawing routine between EOR and OR logic by sending a draw_mode command to the I/O processor
Variables
HATB (Docked)
Ship hangar group table
HATB (Parasite)
Ship hangar group table
Sound
Explosions, laser fire, hyperspace and more
Subroutines
BEEP (Docked)
Make a short, high beep
BEEP (Encyclopedia)
Make a short, high beep
BEEP (Flight)
Make a short, high beep
BEEP (Parasite)
Make a short, high beep
BELL (Docked)
Make a standard system beep
BELL (Encyclopedia)
Make a standard system beep
BELL (Flight)
Make a standard system beep
BELL (Parasite)
Make a standard system beep
ECMOF (Docked)
Switch off the E.C.M.
ECMOF (Encyclopedia)
Switch off the E.C.M.
ECMOF (Flight)
Switch off the E.C.M.
ECMOF (Parasite)
Switch off the E.C.M.
EXNO (Flight)
Make the sound of a laser strike or ship explosion
EXNO (Parasite)
Make the sound of a laser strike or ship explosion
EXNO, Removed (Docked)
Make the sound of a laser strike or ship explosion
EXNO3 (Flight)
Make an explosion sound
EXNO3 (Parasite)
Make an explosion sound
EXNO3, Removed (Docked)
Make an explosion sound
NO3 (Docked)
Make a sound from a prepared sound block
NO3 (Encyclopedia)
Make a sound from a prepared sound block
NO3 (Flight)
Make a sound from a prepared sound block
NO3 (Parasite)
Make a sound from a prepared sound block
NOISE (Docked) *
Make the sound whose number is in A
NOISE (Encyclopedia) *
Make the sound whose number is in A
NOISE (Flight) *
Make the sound whose number is in A
NOISE (Parasite) *
Make the sound whose number is in A
NOS1 (Docked)
Prepare a sound block
NOS1 (Encyclopedia)
Prepare a sound block
NOS1 (Flight)
Prepare a sound block
NOS1 (Parasite)
Prepare a sound block
Variables
E% (Loader)
Sound envelope definitions
SFX (Docked)
Sound data
SFX (Encyclopedia)
Sound data
SFX (Flight)
Sound data
SFX (Parasite)
Sound data
Macros
FNE (Loader)
Macro definition for defining a sound envelope
Stardust
Stardust generation and movement
Subroutines
FLIP (Flight)
Reflect the stardust particles in the screen diagonal and redraw the stardust field
FLIP (Parasite)
Reflect the stardust particles in the screen diagonal and redraw the stardust field
FLIP, Removed (Docked)
Reflect the stardust particles in the screen diagonal and redraw the stardust field
nWq (Flight)
Create a random cloud of stardust
nWq (Parasite)
Create a random cloud of stardust
NWSTARS (Flight)
Initialise the stardust field
NWSTARS (Parasite)
Initialise the stardust field
STARS (Flight) *
The main routine for processing the stardust
STARS (Parasite) *
The main routine for processing the stardust
STARS1 (Flight)
Process the stardust for the front view
STARS1 (Parasite)
Process the stardust for the front view
STARS2 (Flight)
Process the stardust for the left or right view
STARS2 (Parasite)
Process the stardust for the left or right view
STARS6 (Flight)
Process the stardust for the rear view
STARS6 (Parasite)
Process the stardust for the rear view
Start and end
The title screen... and the Game Over screen
Subroutines
BR1 (Encyclopedia)
Show the "Load New Commander (Y/N)?" screen and start the game
BR1 (Part 1 of 2) (Docked)
Show the "Load New Commander (Y/N)?" screen and start the game
BR1 (Part 1 of 2) (Parasite)
Show the "Load New Commander (Y/N)?" screen and start the game
BR1 (Part 2 of 2) (Docked)
Show the "Press Fire or Space, Commander" screen and start the game
BR1 (Part 2 of 2) (Parasite)
Show the "Press Fire or Space, Commander" screen and start the game
DEATH (Flight) *
Display the death screen
DEATH (Parasite) *
Display the death screen
DEATH2 (Docked)
Reset most of the game and restart from the title screen
DEATH2 (Encyclopedia)
Reset most of the game and restart from the title screen
DEATH2 (Flight)
Reset most of the game and restart from the title screen
DEATH2 (Parasite)
Reset most of the game and restart from the title screen
DFAULT (Docked)
Reset the current commander data block to the last saved commander
DFAULT (Parasite)
Reset the current commander data block to the last saved commander
escape (Encyclopedia)
Load the main docked code so that it shows the docking tunnel
RES2 (Docked)
Reset a number of flight variables and workspaces
RES2 (Encyclopedia)
Reset a number of flight variables and workspaces
RES2 (Flight)
Reset a number of flight variables and workspaces
RES2 (Parasite)
Reset a number of flight variables and workspaces
RESET (Docked)
Reset most variables
RESET (Flight)
Reset most variables
RESET (Parasite)
Reset most variables
TITLE (Docked) *
Display a title screen with a rotating ship and prompt
TITLE (Parasite) *
Display a title screen with a rotating ship and prompt
TT170 (Docked) *
Main entry point for the Elite game code
Status
Showing the commander's status and rank
Subroutines
BAD, Removed (Docked)
Calculate how bad we have been
BAD, Removed (Flight)
Calculate how bad we have been
BAY (Docked)
Go to the docking bay (i.e. show the Status Mode screen)
BAY (Encyclopedia)
Go to the docking bay (i.e. show the Encyclopedia screen)
BAY (Parasite)
Go to the docking bay (i.e. show the Status Mode screen)
cmn (Docked)
Print the commander's name
cmn (Encyclopedia)
Print the commander's name
cmn (Flight)
Print the commander's name
cmn (Parasite)
Print the commander's name
csh (Docked)
Print the current amount of cash
csh (Encyclopedia)
Print the current amount of cash
csh (Flight)
Print the current amount of cash
csh (Parasite)
Print the current amount of cash
EXNO2 (Flight)
Process us making a kill
EXNO2 (Parasite)
Process us making a kill
EXNO2, Removed (Docked)
Process us making a kill
fwl (Docked)
Print fuel and cash levels
fwl (Encyclopedia)
Print fuel and cash levels
fwl (Flight)
Print fuel and cash levels
fwl (Parasite)
Print fuel and cash levels
STATUS (Docked) *
Show the Status Mode screen (red key f8)
STATUS (Flight) *
Show the Status Mode screen (red key f8)
STATUS (Parasite) *
Show the Status Mode screen (red key f8)
Tactics
AI tactics for enemy ships and missiles
Subroutines
anger_8c (Flight)
Make the current ship angry
anger_8c (Parasite)
Make the current ship angry
ANGRY (Flight)
Make a ship hostile
ANGRY (Parasite)
Make a ship hostile
FR1 (Flight)
Display the "missile jammed" message
FR1 (Parasite)
Display the "missile jammed" message
FRMIS (Flight)
Fire a missile from our ship
FRMIS (Parasite)
Fire a missile from our ship
FRS1 (Flight)
Launch a ship straight ahead of us, below the laser sights
FRS1 (Parasite)
Launch a ship straight ahead of us, below the laser sights
HITCH (Flight) *
Work out if the ship in INWK is in our crosshairs
HITCH (Parasite) *
Work out if the ship in INWK is in our crosshairs
SFRMIS (Flight)
Add an enemy missile to our local bubble of universe
SFRMIS (Parasite)
Add an enemy missile to our local bubble of universe
TACTICS (Part 1 of 7) (Flight)
Apply tactics: Process missiles, both enemy missiles and our own
TACTICS (Part 1 of 7) (Parasite)
Apply tactics: Process missiles, both enemy missiles and our own
TACTICS (Part 2 of 7) (Flight) *
Apply tactics: Escape pod, station, lone Thargon, safe-zone pirate
TACTICS (Part 2 of 7) (Parasite) *
Apply tactics: Escape pod, station, lone Thargon, safe-zone pirate
TACTICS (Part 3 of 7) (Flight)
Apply tactics: Calculate dot product to determine ship's aim
TACTICS (Part 3 of 7) (Parasite)
Apply tactics: Calculate dot product to determine ship's aim
TACTICS (Part 4 of 7) (Flight)
Apply tactics: Check energy levels, maybe launch escape pod if low
TACTICS (Part 4 of 7) (Parasite)
Apply tactics: Check energy levels, maybe launch escape pod if low
TACTICS (Part 5 of 7) (Flight)
Apply tactics: Consider whether to launch a missile at us
TACTICS (Part 5 of 7) (Parasite)
Apply tactics: Consider whether to launch a missile at us
TACTICS (Part 6 of 7) (Flight)
Apply tactics: Consider firing a laser at us, if aim is true
TACTICS (Part 6 of 7) (Parasite)
Apply tactics: Consider firing a laser at us, if aim is true
TACTICS (Part 7 of 7) (Flight)
Apply tactics: Set pitch, roll, and acceleration
TACTICS (Part 7 of 7) (Parasite)
Apply tactics: Set pitch, roll, and acceleration
Text
The game's recursive text tokenisation system
Subroutines
BPRNT (Docked) *
Print a 32-bit number, left-padded to a specific number of digits, with an optional decimal point
BPRNT (Encyclopedia) *
Print a 32-bit number, left-padded to a specific number of digits, with an optional decimal point
BPRNT (Flight) *
Print a 32-bit number, left-padded to a specific number of digits, with an optional decimal point
BPRNT (Parasite) *
Print a 32-bit number, left-padded to a specific number of digits, with an optional decimal point
cargo_mtok (Flight)
Print the name of a specific cargo item
cargo_mtok (Parasite)
Print the name of a specific cargo item
CHPR (Docked)
Print a character at the text cursor by poking into screen memory
CHPR (Encyclopedia)
Print a character at the text cursor by poking into screen memory
CHPR (I/O processor)
Implement the write_xyc command (write a character to the screen)
CHPR (Parasite)
Print a character at the text cursor by sending a write_xyc command to the I/O processor
clr_vdustat (Encyclopedia)
Switch to standard tokens in lower case
column_16 (Encyclopedia)
Tab to column 16 and start a new word when printing extended tokens
crlf (Docked)
Tab to column 21 and print a colon
crlf (Encyclopedia)
Tab to column 21 and print a colon
crlf (Flight)
Tab to column 21 and print a colon
crlf (Parasite)
Tab to column 21 and print a colon
DETOK (Docked)
Print an extended recursive token from the TKN1 token table
DETOK (Encyclopedia)
Print an extended recursive token from the TKN1 token table
DETOK (Parasite)
Print an extended recursive token from the TKN1 token table
DETOK2 (Docked)
Print an extended text token (1-255)
DETOK2 (Encyclopedia)
Print an extended text token (1-255)
DETOK2 (Parasite)
Print an extended text token (1-255)
DETOK3 (Docked)
Print an extended recursive token from the RUTOK token table
DETOK3 (Parasite)
Print an extended recursive token from the RUTOK token table
DETOK3, Moved (Docked)
Print an extended recursive token from the RUTOK token table
dn2 (Docked)
Make a short, high beep and delay for 1 second
dn2 (Encyclopedia)
Make a short, high beep and delay for 1 second
dn2 (Parasite)
Make a short, high beep and delay for 1 second
ex (Docked)
Print a recursive token
ex (Encyclopedia)
Print a recursive token
ex (Flight)
Print a recursive token
ex (Parasite)
Print a recursive token
FEED (Docked)
Print a newline
FEED (Encyclopedia)
Print a newline
FEED (Parasite)
Print a newline
MT1 (Docked)
Switch to ALL CAPS when printing extended tokens
MT1 (Encyclopedia)
Switch to ALL CAPS when printing extended tokens
MT1 (Parasite)
Switch to ALL CAPS when printing extended tokens
MT13 (Docked)
Switch to lower case when printing extended tokens
MT13 (Encyclopedia)
Switch to lower case when printing extended tokens
MT13 (Parasite)
Switch to lower case when printing extended tokens
MT14 (Docked)
Switch to justified text when printing extended tokens
MT14 (Encyclopedia)
Switch to justified text when printing extended tokens
MT14 (Parasite)
Switch to justified text when printing extended tokens
MT15 (Docked)
Switch to left-aligned text when printing extended tokens
MT15 (Encyclopedia)
Switch to left-aligned text when printing extended tokens
MT15 (Parasite)
Switch to left-aligned text when printing extended tokens
MT16 (Docked)
Print the character in variable DTW7
MT16 (Encyclopedia)
Print the character in variable DTW7
MT16 (Parasite)
Print the character in variable DTW7
MT17 (Docked)
Print the selected system's adjective, e.g. Lavian for Lave
MT17 (Encyclopedia)
Print the selected system's adjective, e.g. Lavian for Lave
MT17 (Parasite)
Print the selected system's adjective, e.g. Lavian for Lave
MT18 (Docked)
Print a random 1-8 letter word in Sentence Case
MT18 (Encyclopedia)
Print a random 1-8 letter word in Sentence Case
MT18 (Parasite)
Print a random 1-8 letter word in Sentence Case
MT19 (Docked)
Capitalise the next letter
MT19 (Encyclopedia)
Capitalise the next letter
MT19 (Parasite)
Capitalise the next letter
MT2 (Docked)
Switch to Sentence Case when printing extended tokens
MT2 (Encyclopedia)
Switch to Sentence Case when printing extended tokens
MT2 (Parasite)
Switch to Sentence Case when printing extended tokens
MT23 (Docked)
Move to row 10, switch to white text, and switch to lower case when printing extended tokens
MT23 (Encyclopedia)
Move to row 10, switch to white text, and switch to lower case when printing extended tokens
MT23 (Parasite)
Move to row 10, switch to white text, and switch to lower case when printing extended tokens
MT26 (Docked)
Fetch a line of text from the keyboard
MT26 (Encyclopedia)
Fetch a line of text from the keyboard
MT26 (Parasite)
Fetch a line of text from the keyboard
MT27 (Docked)
Print the captain's name during mission briefings
MT27 (Encyclopedia)
Print the captain's name during mission briefings
MT27 (Parasite)
Print the captain's name during mission briefings
MT28 (Docked)
Print the location hint during the mission 1 briefing
MT28 (Encyclopedia)
Print the location hint during the mission 1 briefing
MT28 (Parasite)
Print the location hint during the mission 1 briefing
MT29 (Docked)
Move to row 6, switch to white text, and switch to lower case when printing extended tokens
MT29 (Encyclopedia)
Move to row 6, switch to white text, and switch to lower case when printing extended tokens
MT29 (Parasite)
Move to row 6, switch to white text, and switch to lower case when printing extended tokens
MT5 (Docked)
Switch to extended tokens
MT5 (Encyclopedia)
Switch to extended tokens
MT5 (Parasite)
Switch to extended tokens
MT6 (Docked)
Switch to standard tokens in Sentence Case
MT6 (Encyclopedia)
Switch to standard tokens in Sentence Case
MT6 (Parasite)
Switch to standard tokens in Sentence Case
MT8 (Docked)
Tab to column 6 and start a new word when printing extended tokens
MT8 (Encyclopedia)
Tab to column 6 and start a new word when printing extended tokens
MT8 (Parasite)
Tab to column 6 and start a new word when printing extended tokens
MT9 (Docked)
Clear the screen and set the current view type to 1
MT9 (Encyclopedia)
Clear the screen and set the current view type to 1
MT9 (Parasite)
Clear the screen and set the current view type to 1
n_name (Docked)
Print the type of a given ship
n_name (Parasite)
Print the type of a given ship
plf (Docked)
Print a text token followed by a newline
plf (Encyclopedia)
Print a text token followed by a newline
plf (Flight)
Print a text token followed by a newline
plf (Parasite)
Print a text token followed by a newline
plf2 (Flight)
Print text followed by a newline and indent of 6 characters
plf2, Removed (Docked)
Print text followed by a newline and indent of 6 characters
pr2 (Docked)
Print an 8-bit number, left-padded to 3 digits, and optional point
pr2 (Encyclopedia)
Print an 8-bit number, left-padded to 3 digits, and optional point
pr2 (Flight)
Print an 8-bit number, left-padded to 3 digits, and optional point
pr2 (Parasite)
Print an 8-bit number, left-padded to 3 digits, and optional point
pr5 (Docked)
Print a 16-bit number, left-padded to 5 digits, and optional point
pr5 (Encyclopedia)
Print a 16-bit number, left-padded to 5 digits, and optional point
pr5 (Flight)
Print a 16-bit number, left-padded to 5 digits, and optional point
pr5 (Parasite)
Print a 16-bit number, left-padded to 5 digits, and optional point
pr6 (Docked)
Print 16-bit number, left-padded to 5 digits, no point
pr6 (Encyclopedia)
Print 16-bit number, left-padded to 5 digits, no point
pr6 (Flight)
Print 16-bit number, left-padded to 5 digits, no point
pr6 (Parasite)
Print 16-bit number, left-padded to 5 digits, no point
print_esc (I/O processor)
Send an escape sequence to the printer
print_safe (I/O processor)
Print a character using the VDU routine in the MOS, to bypass our custom WRCHV handler
print_wrch (I/O processor)
Send a character to the printer
printer (I/O processor)
Send the screen to the printer, following a CTRL-P key press
printer (Parasite)
This routine is commented out in the original source
prq (Docked)
Print a text token followed by a question mark
prq (Flight)
Print a text token followed by a question mark
prq (Parasite)
Print a text token followed by a question mark
qw (Docked)
Print a recursive token in the range 128-145
qw (Encyclopedia)
Print a recursive token in the range 128-145
qw (Flight)
Print a recursive token in the range 128-145
qw (Parasite)
Print a recursive token in the range 128-145
sell_yn (Docked)
Print a "Sell(Y/N)?" prompt and get a number from the keyboard
sell_yn (Parasite)
Print a "Sell(Y/N)?" prompt and get a number from the keyboard
spc (Docked)
Print a text token followed by a space
spc (Encyclopedia)
Print a text token followed by a space
spc (Flight)
Print a text token followed by a space
spc (Parasite)
Print a text token followed by a space
status_equip (Docked)
Print equipment name, adding a sell prompt if appropriate
status_equip (Parasite)
Print equipment name, adding a sell prompt if appropriate
TT11 (Docked)
Print a 16-bit number, left-padded to n digits, and optional point
TT11 (Encyclopedia)
Print a 16-bit number, left-padded to n digits, and optional point
TT11 (Flight)
Print a 16-bit number, left-padded to n digits, and optional point
TT11 (Parasite)
Print a 16-bit number, left-padded to n digits, and optional point
TT162 (Docked)
Print a space
TT162 (Encyclopedia)
Print a space
TT162 (Flight)
Print a space
TT162 (Parasite)
Print a space
TT26 (Docked) *
Print a character at the text cursor, with support for verified text in extended tokens
TT26 (Encyclopedia) *
Print a character at the text cursor, with support for verified text in extended tokens
TT26 (Flight) *
Print a character at the text cursor by poking into screen memory
TT26 (Parasite) *
Print a character at the text cursor, with support for verified text in extended tokens
TT27 (Docked) *
Print a text token
TT27 (Encyclopedia) *
Print a text token
TT27 (Flight) *
Print a text token
TT27 (Parasite) *
Print a text token
TT41 (Docked)
Print a letter according to Sentence Case
TT41 (Encyclopedia)
Print a letter according to Sentence Case
TT41 (Flight)
Print a letter according to Sentence Case
TT41 (Parasite)
Print a letter according to Sentence Case
TT42 (Docked)
Print a letter in lower case
TT42 (Encyclopedia)
Print a letter in lower case
TT42 (Flight)
Print a letter in lower case
TT42 (Parasite)
Print a letter in lower case
TT43 (Docked)
Print a two-letter token or recursive token 0-95
TT43 (Encyclopedia)
Print a two-letter token or recursive token 0-95
TT43 (Flight)
Print a two-letter token or recursive token 0-95
TT43 (Parasite)
Print a two-letter token or recursive token 0-95
TT45 (Docked)
Print a letter in lower case
TT45 (Encyclopedia)
Print a letter in lower case
TT45 (Flight)
Print a letter in lower case
TT45 (Parasite)
Print a letter in lower case
TT46 (Docked)
Print a character and switch to capitals
TT46 (Encyclopedia)
Print a character and switch to capitals
TT46 (Flight)
Print a character and switch to capitals
TT46 (Parasite)
Print a character and switch to capitals
TT60 (Docked)
Print a text token and a paragraph break
TT60 (Encyclopedia)
Print a text token and a paragraph break
TT60 (Flight)
Print a text token and a paragraph break
TT60 (Parasite)
Print a text token and a paragraph break
TT67 (Docked)
Print a newline
TT67 (Encyclopedia)
Print a newline
TT67 (Flight)
Print a newline
TT67 (Parasite)
Print a newline
TT68 (Docked)
Print a text token followed by a colon
TT68 (Encyclopedia)
Print a text token followed by a colon
TT68 (Flight)
Print a text token followed by a colon
TT68 (Parasite)
Print a text token followed by a colon
TT69 (Docked)
Set Sentence Case and print a newline
TT69 (Flight)
Set Sentence Case and print a newline
TT69 (Parasite)
Set Sentence Case and print a newline
TT73 (Docked)
Print a colon
TT73 (Encyclopedia)
Print a colon
TT73 (Flight)
Print a colon
TT73 (Parasite)
Print a colon
TT74 (Docked)
Print a character
TT74 (Encyclopedia)
Print a character
TT74 (Flight)
Print a character
TT74 (Parasite)
Print a character
TTX69 (Docked)
Print a paragraph break
TTX69 (Encyclopedia)
Print a paragraph break
TTX69 (Flight)
Print a paragraph break
TTX69 (Parasite)
Print a paragraph break
tube_wrch (I/O processor)
Write characters to the screen and process Tube commands from the parasite
VOWEL (Docked)
Test whether a character is a vowel
VOWEL (Encyclopedia)
Test whether a character is a vowel
VOWEL (Parasite)
Test whether a character is a vowel
wrch_font (I/O processor)
Set the font and screen address for printing characters on-screen
write_msg3 (Encyclopedia)
Print an extended recursive token from the msg_3 token table
write_msg3 (Parasite)
Print an extended recursive token from the msg_3 token table
Variables
DTW1 (Docked)
A mask for applying the lower case part of Sentence Case to extended text tokens
DTW1 (Encyclopedia)
A mask for applying the lower case part of Sentence Case to extended text tokens
DTW1 (Parasite)
A mask for applying the lower case part of Sentence Case to extended text tokens
DTW2 (Docked)
A flag that indicates whether we are currently printing a word
DTW2 (Encyclopedia)
A flag that indicates whether we are currently printing a word
DTW2 (Parasite)
A flag that indicates whether we are currently printing a word
DTW3 (Docked)
A flag for switching between standard and extended text tokens
DTW3 (Encyclopedia)
A flag for switching between standard and extended text tokens
DTW3 (Parasite)
A flag for switching between standard and extended text tokens
DTW4 (Docked)
Flags that govern how justified extended text tokens are printed
DTW4 (Encyclopedia)
Flags that govern how justified extended text tokens are printed
DTW4 (Parasite)
Flags that govern how justified extended text tokens are printed
DTW5 (Docked)
The size of the justified text buffer at BUF
DTW5 (Encyclopedia)
The size of the justified text buffer at BUF
DTW5 (Parasite)
The size of the justified text buffer at BUF
DTW6 (Docked)
A flag to denote whether printing in lower case is enabled for extended text tokens
DTW6 (Encyclopedia)
A flag to denote whether printing in lower case is enabled for extended text tokens
DTW6 (Parasite)
A flag to denote whether printing in lower case is enabled for extended text tokens
DTW8 (Docked)
A mask for capitalising the next letter in an extended text token
DTW8 (Encyclopedia)
A mask for capitalising the next letter in an extended text token
DTW8 (Parasite)
A mask for capitalising the next letter in an extended text token
JMTB (Docked)
The extended token table for jump tokens 1-32 (DETOK)
JMTB (Encyclopedia)
The extended token table for jump tokens 1-32 (DETOK)
JMTB (Parasite)
The extended token table for jump tokens 1-32 (DETOK)
msg_3 (Encyclopedia)
The second extended token table for recursive tokens 0-255 (write_msg3)
msg_3 (Parasite)
The second extended token table for recursive tokens 0-255 (write_msg3)
MTIN (Docked)
Lookup table for random tokens in the extended token table (0-37)
MTIN (Encyclopedia)
Lookup table for random tokens in the extended token table (0-37)
MTIN (Parasite)
Lookup table for random tokens in the extended token table (0-37)
print_tone (I/O processor)
Lookup table for converting mode 5 colour pixel rows to monochrome pixel pairs
QQ16 (Docked)
The two-letter token lookup table
QQ16 (Encyclopedia)
The two-letter token lookup table
QQ16 (Parasite)
The two-letter token lookup table
QQ18 (Parasite)
The recursive token table for tokens 0-148
QQ18 (Text tokens)
The recursive token table for tokens 0-148
RLINE (Docked)
The OSWORD configuration block used to fetch a line of text from the keyboard
RLINE (Encyclopedia)
The OSWORD configuration block used to fetch a line of text from the keyboard
RLINE (Parasite)
The OSWORD configuration block used to fetch a line of text from the keyboard
RUGAL (Docked)
The criteria for systems with extended description overrides
RUGAL (Parasite)
The criteria for systems with extended description overrides
RUPLA (Docked)
System numbers that have extended description overrides
RUPLA (Parasite)
System numbers that have extended description overrides
RUTOK (Docked)
The second extended token table for recursive tokens 0-26 (DETOK3)
RUTOK (Parasite)
The second extended token table for recursive tokens 0-26 (DETOK3)
TENS (Docked)
A constant used when printing large numbers in BPRNT
TENS (Encyclopedia)
A constant used when printing large numbers in BPRNT
TENS (Flight)
A constant used when printing large numbers in BPRNT
TENS (Parasite)
A constant used when printing large numbers in BPRNT
TKN1 (Docked)
The first extended token table for recursive tokens 0-255 (DETOK)
TKN1 (Encyclopedia)
The first extended token table for recursive tokens 0-255 (DETOK)
TKN1 (Parasite)
The first extended token table for recursive tokens 0-255 (DETOK)
TKN2 (Docked)
The extended two-letter token lookup table
TKN2 (Encyclopedia)
The extended two-letter token lookup table
TKN2 (Parasite)
The extended two-letter token lookup table
Macros
CHAR (Parasite)
Macro definition for characters in the recursive token table
CHAR (Text tokens)
Macro definition for characters in the recursive token table
CONT (Parasite)
Macro definition for control codes in the recursive token table
CONT (Text tokens)
Macro definition for control codes in the recursive token table
CTOK (Encyclopedia)
Macro definition for ship data in the encyclopedia's ship cards
CTOK (Parasite)
Macro definition for ship data in the encyclopedia's ship cards
ECHR (Docked)
Macro definition for characters in the extended token table
ECHR (Encyclopedia)
Macro definition for characters in the extended token table
ECHR (Parasite)
Macro definition for characters in the extended token table
EJMP (Docked)
Macro definition for jump tokens in the extended token table
EJMP (Encyclopedia)
Macro definition for jump tokens in the extended token table
EJMP (Parasite)
Macro definition for jump tokens in the extended token table
ERND (Docked)
Macro definition for random tokens in the extended token table
ERND (Encyclopedia)
Macro definition for random tokens in the extended token table
ERND (Parasite)
Macro definition for random tokens in the extended token table
ETOK (Docked)
Macro definition for recursive tokens in the extended token table
ETOK (Encyclopedia)
Macro definition for recursive tokens in the extended token table
ETOK (Parasite)
Macro definition for recursive tokens in the extended token table
ETWO (Docked)
Macro definition for two-letter tokens in the extended token table
ETWO (Encyclopedia)
Macro definition for two-letter tokens in the extended token table
ETWO (Parasite)
Macro definition for two-letter tokens in the extended token table
RTOK (Parasite)
Macro definition for recursive tokens in the recursive token table
RTOK (Text tokens)
Macro definition for recursive tokens in the recursive token table
TOKN (Docked)
Macro definition for standard tokens in the extended token table
TOKN (Encyclopedia)
Macro definition for standard tokens in the extended token table
TOKN (Parasite)
Macro definition for standard tokens in the extended token table
TWOK (Parasite)
Macro definition for two-letter tokens in the token table
TWOK (Text tokens)
Macro definition for two-letter tokens in the token table
Tube
Communicating with the Second Processor in Elite
Subroutines
read_0346 (I/O processor)
Implement the read_0346 command (read LASCT)
read_0346 (Parasite)
Get the value of LASCT by sending a read_0346 command to the I/O processor
tube_elite (I/O processor)
Set the vectors to receive Tube communications, run the parasite code, and terminate the I/O processor's loading process
tube_func (I/O processor)
Call the corresponding routine for a Tube command
tube_get (I/O processor)
As the I/O processor, fetch a byte that's been sent over the Tube from the parasite
tube_put (I/O processor)
As the I/O processor, send a byte across the Tube to the parasite
tube_read (Parasite)
As the parasite, fetch a byte that's been sent over the Tube from the I/O processor
tube_write (Parasite)
As the parasite, send a byte across the Tube to the I/O processor
write_0346 (I/O processor)
Implement the write_0346 command (update LASCT)
write_0346 (Parasite)
Update the value of LASCT by sending a write_0346 command to the I/O processor
Variables
tube_run (I/O processor)
The OS command string for running the Tube version's parasite code in file 2.T
tube_table (I/O processor)
Lookup table for Tube commands sent from the parasite to the I/O processor
Universe
Ship spawning, local bubble, system/market data
Subroutines
cpl (Docked)
Print the selected system name
cpl (Encyclopedia)
Print the selected system name
cpl (Flight)
Print the selected system name
cpl (Parasite)
Print the selected system name
GINF (Docked)
Fetch the address of a ship's data block into INF
GINF (Encyclopedia)
Fetch the address of a ship's data block into INF
GINF (Flight)
Fetch the address of a ship's data block into INF
GINF (Parasite)
Fetch the address of a ship's data block into INF
GTHG (Flight)
Spawn a Thargoid ship and a Thargon companion
GTHG (Parasite)
Spawn a Thargoid ship and a Thargon companion
GVL (Docked)
Calculate the availability of market items
GVL (Flight)
Calculate the availability of market items
GVL (Parasite)
Calculate the availability of market items
hyp1 (Docked)
Process a jump to the system closest to (QQ9, QQ10)
hyp1 (Flight)
Process a jump to the system closest to (QQ9, QQ10)
hyp1 (Parasite)
Process a jump to the system closest to (QQ9, QQ10)
hyp1_FLIGHT (Parasite)
Process a jump to the system closest to (QQ9, QQ10) (flight version)
install_ship (Parasite)
Install a ship blueprint into the ship blueprints lookup table
jmp (Docked)
Set the current system to the selected system
jmp (Flight)
Set the current system to the selected system
jmp (Parasite)
Set the current system to the selected system
KILLSHP (Flight) *
Remove a ship from our local bubble of universe
KILLSHP (Parasite) *
Remove a ship from our local bubble of universe
KS1 (Flight)
Remove the current ship from our local bubble of universe
KS1 (Parasite)
Remove the current ship from our local bubble of universe
KS2 (Flight)
Check the local bubble for missiles with target lock
KS2 (Parasite)
Check the local bubble for missiles with target lock
KS3 (Flight)
Set the SLSP ship line heap pointer after shuffling ship slots
KS3 (Parasite)
Set the SLSP ship line heap pointer after shuffling ship slots
KS4 (Flight)
Remove the space station and replace it with the sun
KS4 (Parasite)
Remove the space station and replace it with the sun
LOMOD (Parasite)
Populate the ship blueprints table at XX21 with a random selection of ships and set the compass to point to the planet
NwS1 (Flight)
Flip the sign and double an INWK byte
NwS1 (Parasite)
Flip the sign and double an INWK byte
NwS1, Removed (Docked)
Flip the sign and double an INWK byte
NWSHP (Docked)
Add a new ship to our local bubble of universe
NWSHP (Encyclopedia)
Add a new ship to our local bubble of universe
NWSHP (Flight)
Add a new ship to our local bubble of universe
NWSHP (Parasite)
Add a new ship to our local bubble of universe
NWSPS (Flight)
Add a new space station to our local bubble of universe
NWSPS (Parasite)
Add a new space station to our local bubble of universe
PDESC (Docked)
Print the system's extended description or a mission 1 directive
PDESC (Encyclopedia)
Print the system's extended description or a mission 1 directive
PDESC (Parasite)
Print the system's extended description or a mission 1 directive
ping (Docked)
Set the selected system to the current system
ping (Encyclopedia)
Set the selected system to the current system
ping (Flight)
Set the selected system to the current system
ping (Parasite)
Set the selected system to the current system
rand_posn (Flight)
Set up the INWK workspace for a ship in a random ship position
rand_posn (Parasite)
Set up the INWK workspace for a ship in a random ship position
SFS1 (Flight) *
Spawn a child ship from the current (parent) ship
SFS1 (Parasite) *
Spawn a child ship from the current (parent) ship
SOLAR (Flight)
Set up various aspects of arriving in a new system
SOLAR (Parasite)
Set up various aspects of arriving in a new system
SOS1 (Flight)
Update the missile indicators, set up the planet data block
SOS1 (Parasite)
Update the missile indicators, set up the planet data block
SPIN (Flight)
Randomly spawn cargo from a destroyed ship
SPIN (Parasite)
Randomly spawn cargo from a destroyed ship
tal (Docked)
Print the current galaxy number
tal (Encyclopedia)
Print the current galaxy number
tal (Flight)
Print the current galaxy number
tal (Parasite)
Print the current galaxy number
TT111 (Docked)
Set the current system to the nearest system to a point
TT111 (Encyclopedia)
Set the current system to the nearest system to a point
TT111 (Flight)
Set the current system to the nearest system to a point
TT111 (Parasite)
Set the current system to the nearest system to a point
TT146 (Docked)
Print the distance to the selected system in light years
TT146 (Encyclopedia)
Print the distance to the selected system in light years
TT146 (Flight)
Print the distance to the selected system in light years
TT146 (Parasite)
Print the distance to the selected system in light years
TT20 (Docked)
Twist the selected system's seeds four times
TT20 (Encyclopedia)
Twist the selected system's seeds four times
TT20 (Flight)
Twist the selected system's seeds four times
TT20 (Parasite)
Twist the selected system's seeds four times
TT24 (Docked) *
Calculate system data from the system seeds
TT24 (Encyclopedia) *
Calculate system data from the system seeds
TT24 (Flight) *
Calculate system data from the system seeds
TT24 (Parasite) *
Calculate system data from the system seeds
TT25 (Docked) *
Show the Data on System screen (red key f6) or Encyclopedia screen (CTRL-f6)
TT25 (Encyclopedia) *
Show the Data on System screen (red key f6) or Encyclopedia screen (CTRL-f6)
TT25 (Flight) *
Show the Data on System screen (red key f6) or Encyclopedia screen (CTRL-f6)
TT25 (Parasite) *
Show the Data on System screen (red key f6) or Encyclopedia screen (CTRL-f6)
TT54 (Docked) *
Twist the selected system's seeds
TT54 (Encyclopedia) *
Twist the selected system's seeds
TT54 (Flight) *
Twist the selected system's seeds
TT54 (Parasite) *
Twist the selected system's seeds
TT70 (Docked)
Display "MAINLY " and jump to TT72
TT70 (Encyclopedia)
Display "MAINLY " and jump to TT72
TT70 (Flight)
Display "MAINLY " and jump to TT72
TT70 (Parasite)
Display "MAINLY " and jump to TT72
TT81 (Docked)
Set the selected system's seeds to those of system 0
TT81 (Encyclopedia)
Set the selected system's seeds to those of system 0
TT81 (Flight)
Set the selected system's seeds to those of system 0
TT81 (Parasite)
Set the selected system's seeds to those of system 0
ypl (Docked)
Print the current system name
ypl (Encyclopedia)
Print the current system name
ypl (Flight)
Print the current system name
ypl (Parasite)
Print the current system name
Ze (Flight)
Initialise the INWK workspace to a hostile ship
Ze (Parasite)
Initialise the INWK workspace to a hostile ship
Ze, Removed (Docked)
Initialise the INWK workspace to a hostile ship
ZINF (Docked)
Reset the INWK workspace and orientation vectors
ZINF (Encyclopedia)
Reset the INWK workspace and orientation vectors
ZINF (Flight)
Reset the INWK workspace and orientation vectors
ZINF (Parasite)
Reset the INWK workspace and orientation vectors
Variables
UNIV (Docked)
Table of pointers to the local universe's ship data blocks
UNIV (Encyclopedia)
Table of pointers to the local universe's ship data blocks
UNIV (Flight)
Table of pointers to the local universe's ship data blocks
UNIV (Parasite)
Table of pointers to the local universe's ship data blocks
Utility routines
Memory/screen clearing, delay routines
Subroutines
BRBR (Docked)
The standard BRKV handler for the game
BRBR (Encyclopedia)
The standard BRKV handler for the game
BRBR (Parasite)
The standard BRKV handler for the game
clr_scrn (I/O processor)
Clear the top part of the screen (the space view)
DELAY (Docked)
Wait for a specified time, in 1/50s of a second
DELAY (Encyclopedia)
Wait for a specified time, in 1/50s of a second
DELAY (Flight)
Wait for a specified time, in 1/50s of a second
DELAY (Parasite)
Wait for a specified time, in 1/50s of a second
FX200 (Docked)
Set the behaviour of the ESCAPE and BREAK keys
FX200 (Parasite)
Set the behaviour of the ESCAPE and BREAK keys
GTNMES, Removed (Docked)
An unused routine that fetches the name of a commander file
MVBL (Loader)
Move a multi-page block of memory
MVPG (Loader)
Move a page of memory
OSB (Loader)
A convenience routine for calling OSBYTE with Y = 0
SwitchToCharSet (Docked)
Switch the MOS character definitions into memory at &C000 on a BBC Master
SwitchToCharSet (Encyclopedia)
Switch the MOS character definitions into memory at &C000 on a BBC Master
SwitchToCharSet (I/O processor)
Switch the MOS character definitions into memory at &C000 on a BBC Master
SwitchToFileSys (Docked)
Restore the filing system workspace to &C000 on a BBC Master
SwitchToFileSys (I/O processor)
Restore the filing system workspace to &C000 on a BBC Master
ZEBC (Docked)
Zero-fill pages &B and &C
ZEBC (Parasite)
Zero-fill pages &B and &C
ZERO (Docked)
Reset the local bubble of universe and ship status
ZERO (Encyclopedia)
Reset the local bubble of universe and ship status
ZERO (Flight)
Reset the local bubble of universe and ship status
ZERO (Parasite)
Reset the local bubble of universe and ship status
ZES1 (Docked)
Zero-fill the page whose number is in X
ZES1 (Encyclopedia)
Zero-fill the page whose number is in X
ZES1 (Flight)
Zero-fill the page whose number is in X
ZES1 (I/O processor)
Zero-fill the page whose number is in X
ZES1 (Parasite)
Zero-fill the page whose number is in X
ZES2 (Docked)
Zero-fill a specific page
ZES2 (Encyclopedia)
Zero-fill a specific page
ZES2 (Flight)
Zero-fill a specific page
ZES2 (I/O processor)
Zero-fill a specific page
ZES2 (Parasite)
Zero-fill a specific page
Variables
brkd (Docked)
The brkd counter for error handling
brkd (Encyclopedia)
The brkd counter for error handling
brkd (Parasite)
The brkd counter for error handling
Unused block, Removed (Docked)
These bytes appear to be unused (the same block appears in both the flight and docked code)
Unused block, Removed (Flight)
These bytes appear to be unused (the same block appears in both the flight and docked code)
wsstate (Loader)
Flag to keep track of whether we have saved or restored the filing system workspace
Workspaces
Collections of important variables into blocks
Workspaces
K% (Docked) *
Ship data blocks and ship line heaps
K% (Encyclopedia) *
Ship data blocks and ship line heaps
K% (Flight) *
Ship data blocks and ship line heaps
K% (Parasite) *
Ship data blocks and ship line heaps
S% (Docked)
Entry points and vector addresses in the main docked code
S% (Encyclopedia)
Entry points and vector addresses in the main docked code
S% (Flight)
Entry points and vector addresses in the main flight code
UP (Docked)
Ship slots, variables
UP (Encyclopedia)
Ship slots, variables
UP (Flight)
Ship slots, variables
UP (Parasite)
Ship slots, variables
WP (Docked)
Variables
WP (Encyclopedia)
Variables
WP (Flight)
Variables
WP (Parasite)
Variables
XX3 (Docked)
Temporary storage space for complex calculations
XX3 (Encyclopedia)
Temporary storage space for complex calculations
XX3 (Flight)
Temporary storage space for complex calculations
XX3 (Parasite)
Temporary storage space for complex calculations
ZP (Docked) *
Lots of important variables are stored in the zero page workspace as it is quicker and more space-efficient to access memory here
ZP (Encyclopedia) *
Lots of important variables are stored in the zero page workspace as it is quicker and more space-efficient to access memory here
ZP (Flight) *
Lots of important variables are stored in the zero page workspace as it is quicker and more space-efficient to access memory here
ZP (I/O processor) *
Important variables used by the I/O processor
ZP (Loader) *
Important variables used by the loader
ZP (Parasite) *
Lots of important variables are stored in the zero page workspace as it is quicker and more space-efficient to access memory here
Show me a Random Routine
Or click ∞ above to jump into the source code...
Indexes and code analyses
Compare the Acornsoft versions of Elite
Feature and code differences between versions
Versions and variants
Versions of Acornsoft Elite
From the humble BBC Micro cassette to the 6502 Second Processor and beyond
Feature comparison table
A comprehensive table comparing features of the different versions of Acornsoft Elite
Different variants of each version
Bug fixes, unofficial versions and extra platforms
Explore all the code variations
How to compare different versions of Elite
A quick guide to using this section to compare the different versions of Acornsoft Elite
Code comparisons of different versions
Code-level comparisons of features that occur in multiple versions of Acornsoft Elite
Compare the main versions
Compare code for features of standard Elite
Code variations in the features that are common to all versions (BBC Micro cassette, BBC Micro disc, 6502SP, Master, Electron)
Compare code for features of enhanced Elite
Code variations in the extra features of the enhanced versions (BBC Micro disc, 6502SP, Master)
Compare code for features of advanced Elite
Code variations in the extra features of the advanced versions (6502SP, Master)
Compare code for features of BBC Micro disc Elite
Code variations that are unique to the BBC Micro disc version
Compare code for features of 6502SP Elite
Code variations that are unique to the 6502SP version
Compare code for features of Master Elite
Code variations that are unique to the Master version
Compare code for features of Electron Elite
Code variations that are unique to the Electron version
Compare other versions
Compare code in other interesting areas
Other code variations might have an impact, such as bug fixes or faster code
Minor differences between versions
Smaller differences between the versions that don't have a noticeable effect in-game
All code variations by category
Charts
Long-range and short-range galactic charts
Subroutines
hm
Select the closest system and redraw the chart crosshairs
HME2
Search the galaxy for a system
TT103
Draw a small set of crosshairs on a chart
TT105
Draw crosshairs on the Short-range Chart, with clipping
TT16
Move the crosshairs on a chart
TT22
Show the Long-range Chart (red key f4)
TT23
Show the Short-range Chart (red key f5)
Copy protection
Hiding the Elite code from prying eyes
Subroutines
doPROT1
Routine to self-modify the loader code
swine
Resets the machine if the copy protection detects a problem
Variables
Authors' names
The authors' names, buried in the code
Authors' names
The authors' names and a copyright notice, buried in the code
checksum0
Checksum for the entire main game code
David23
Address pointer to the start of the 6502 stack
Dashboard
The dials, 3D scanner and compass
Subroutines
ABORT
Disarm missiles and update the dashboard indicators
ABORT2
Set/unset the lock target for a missile and update the dashboard
BULB
Draw an indicator bulb on the dashboard
BUMP2
Bump up the value of the pitch or roll dashboard indicator
cntr
Apply damping to the pitch or roll dashboard indicator
COMPAS
Update the compass
DIALS (Part 1 of 4)
Update the dashboard: speed indicator
DIALS (Part 2 of 4)
Update the dashboard: pitch and roll indicators
DIALS (Part 3 of 4)
Update the dashboard: four energy banks
DIALS (Part 4 of 4)
Update the dashboard: shields, fuel, laser & cabin temp, altitude
DIL2
Update the roll or pitch indicator on the dashboard
DILX
Update a bar-based indicator on the dashboard
DOT
Draw a dash on the compass
ECBLB
Light up the E.C.M. indicator bulb ("E") on the dashboard
ECBLB2
Start up the E.C.M. (light up the indicator, start the countdown and make the E.C.M. sound)
MSBAR
Draw a specific indicator in the dashboard's missile bar
msblob
Display the dashboard's missile indicators in green
PZW
Fetch the current dashboard colours, to support flashing
REDU2
Reduce the value of the pitch or roll dashboard indicator
SCAN
Display the current ship on the scanner
SP2
Draw a dot on the compass, given the planet/station vector
SPBLB / DOBULB
Light up the space station indicator ("S") on the dashboard
WPSHPS
Clear the scanner, reset the ball line and sun line heaps
Variables
ECBT
The character bitmap for the E.C.M. indicator bulb
SPBT
The bitmap definition for the space station indicator bulb
Drawing circles
Hyperspace tunnels, launch rings and planets
Subroutines
BLINE
Draw a circle segment and add it to the ball line heap
CHKON
Check whether any part of a circle appears on the extended screen
CIRCLE
Draw a circle for the planet
CIRCLE2
Draw a circle (for the planet or chart)
HFS2
Draw the launch or hyperspace tunnel
LAUN
Make the launch sound and draw the launch tunnel
LL164
Make the hyperspace sound and draw the hyperspace tunnel
TT128
Draw a circle on a chart
TT14
Draw a circle with crosshairs on a chart
Drawing lines
The core line-drawing routines
Subroutines
EDGES
Draw a horizontal line given a centre and a half-width
HLOIN
Draw a horizontal line from (X1, Y1) to (X2, Y1)
HLOIN2
Remove a line from the sun line heap and draw it on-screen
LASLI
Draw the laser lines for when we fire our lasers
LL118
Move a point along a line until it is on-screen
LL145 (Part 1 of 4)
Clip line: Work out which end-points are on-screen, if any
LL30
Draw a one-segment line by sending an OSWRCH 129 command to the I/O processor
LOIN (Part 1 of 7)
Draw a line: Calculate the line gradient in the form of deltas
LOIN (Part 2 of 7)
Draw a line: Line has a shallow gradient, step right along x-axis
LOIN (Part 3 of 7)
Draw a shallow line going right and up or left and down
LOIN (Part 4 of 7)
Draw a shallow line going right and down or left and up
LOIN (Part 5 of 7)
Draw a line: Line has a steep gradient, step up along y-axis
LOIN (Part 6 of 7)
Draw a steep line going up and left or down and right
LOIN (Part 7 of 7)
Draw a steep line going up and right or down and left
NLIN
Draw a horizontal line at pixel row 23 to box in a title
NLIN2
Draw a screen-wide horizontal line at the pixel row in A
TT15
Draw a set of crosshairs
Variables
LSX2
The ball line heap for storing x-coordinates
LSY2
The ball line heap for storing y-coordinates
TWFL
Ready-made character rows for the left end of a horizontal line in mode 4
TWFR
Ready-made character rows for the right end of a horizontal line in mode 4
Drawing pixels
How to plot pixels in various colours
Subroutines
CPIX2
Draw a single-height dash on the dashboard
CPIX4
Draw a double-height dot on the dashboard
PIX
Draw a single pixel at a specific coordinate
PIXEL
Draw a 1-pixel dot, 2-pixel dash or 4-pixel square
PIXEL2
Draw a stardust particle relative to the screen centre
Variables
CTWOS
Ready-made single-pixel character row bytes for mode 5
TWOS
Ready-made single-pixel character row bytes for mode 4
TWOS
Ready-made single-pixel character row bytes for mode 4
TWOS2
Ready-made double-pixel character row bytes for mode 4
Drawing planets
Planets with meridians and craters
Subroutines
PL2
Remove the planet or sun from the screen
PL21
Return from a planet/sun-drawing routine with a failure flag
PL9 (Part 1 of 3)
Draw the planet, with either an equator and meridian, or a crater
PL9 (Part 2 of 3)
Draw the planet's equator and meridian
PL9 (Part 3 of 3)
Draw the planet's crater
PLANET
Draw the planet or sun
PLL1 (Part 1 of 3)
Draw Saturn on the loading screen (draw the planet)
PLL1 (Part 2 of 3)
Draw Saturn on the loading screen (draw the stars)
PLL1 (Part 3 of 3)
Draw Saturn on the loading screen (draw the rings)
PLS6
Calculate (X K) = (A P) / (z_sign z_hi z_lo)
Variables
CNT
A counter for use in drawing Saturn's planetary body
CNT3
A counter for use in drawing Saturn's rings
Drawing ships
The celebrated 3D ship plotting process
Subroutines
DOEXP
Draw an exploding ship
LL9 (Part 1 of 12)
Draw ship: Check if ship is exploding, check if ship is in front
LL9 (Part 8 of 12)
Draw ship: Calculate the screen coordinates of visible vertices
LL9 (Part 9 of 12)
Draw ship: Draw laser beams if the ship is firing its laser at us
LL9 (Part 10 of 12)
Draw ship: Calculate the visibility of each of the ship's edges
LL9 (Part 11 of 12)
Draw ship: Add all visible edges to the ship line heap
LL9 (Part 12 of 12)
Draw ship: Draw all the visible edges from the ship line heap
SHPPT
Draw a distant ship as a point rather than a full wireframe
Variables
E%
Ship blueprints default NEWB flags
scacol
Ship colours on the scanner
SHIP_ADDER
Ship blueprint for an Adder
SHIP_ANACONDA
Ship blueprint for an Anaconda
SHIP_ASP_MK_2
Ship blueprint for an Asp Mk II
SHIP_ASTEROID
Ship blueprint for an asteroid
SHIP_BOA
Ship blueprint for a Boa
SHIP_BOULDER
Ship blueprint for a boulder
SHIP_CANISTER
Ship blueprint for a cargo canister
SHIP_COBRA_MK_1
Ship blueprint for a Cobra Mk I
SHIP_COBRA_MK_3
Ship blueprint for a Cobra Mk III
SHIP_COBRA_MK_3_P
Ship blueprint for a Cobra Mk III (pirate)
SHIP_CONSTRICTOR
Ship blueprint for a Constrictor
SHIP_CORIOLIS
Ship blueprint for a Coriolis space station
SHIP_DODO
Ship blueprint for a Dodecahedron ("Dodo") space station
SHIP_ESCAPE_POD
Ship blueprint for an escape pod
SHIP_FER_DE_LANCE
Ship blueprint for a Fer-de-Lance
SHIP_GECKO
Ship blueprint for a Gecko
SHIP_KRAIT
Ship blueprint for a Krait
SHIP_MAMBA
Ship blueprint for a Mamba
SHIP_MISSILE
Ship blueprint for a missile
SHIP_MORAY
Ship blueprint for a Moray
SHIP_PLATE
Ship blueprint for an alloy plate
SHIP_PYTHON
Ship blueprint for a Python
SHIP_PYTHON_P
Ship blueprint for a Python (pirate)
SHIP_ROCK_HERMIT
Ship blueprint for a rock hermit (asteroid)
SHIP_SHUTTLE
Ship blueprint for a Shuttle
SHIP_SIDEWINDER
Ship blueprint for a Sidewinder
SHIP_SPLINTER
Ship blueprint for a splinter
SHIP_THARGOID
Ship blueprint for a Thargoid mothership
SHIP_THARGON
Ship blueprint for a Thargon
SHIP_TRANSPORTER
Ship blueprint for a Transporter
SHIP_VIPER
Ship blueprint for a Viper
SHIP_WORM
Ship blueprint for a Worm
shpcol
Ship colours
XX21
Ship blueprints lookup table
Drawing suns
The epic, shimmering Elite sun
Subroutines
FLFLLS
Reset the sun line heap
SUN (Part 1 of 4)
Draw the sun: Set up all the variables needed to draw the sun
SUN (Part 2 of 4)
Draw the sun: Start from the bottom of the screen and erase the old sun line by line
SUN (Part 4 of 4)
Draw the sun: Continue to the top of the screen, erasing the old sun line by line
WPLS
Remove the sun from the screen
Drawing the screen
The split-screen mode and different screen views
Subroutines
CLYNS
Clear the bottom three text rows of the mode 4 screen
DET1 / DODIALS
Show or hide the dashboard (for when we die)
IRQ1
The main screen-mode interrupt handler (IRQ1V points here)
LYN
Clear most of a row of pixels
SETVDU19 / DOVDU19
Implement the #SETVDU19
command (change mode 1 palette)
TRADEMODE
Clear the screen and set up a printable trading screen
TT66
Clear the screen and set the current view type
TTX66
Clear the top part of the screen and draw a white border
TTX66 / TTX66K
Clear the top part of the screen and draw a white border
WSCAN
Wait for the vertical sync
Variables
B%
VDU commands for setting the square mode 4 screen
TVT3
Palette data for the mode 1 part of the screen (the top part)
VEC
The original value of the IRQ1 vector
Equipment
Buying and selling weapons and ship upgrades
Subroutines
EQSHP
Show the Equip Ship screen (red key f3)
prx
Return the price of a piece of equipment
qv
Print a menu of the four space views, for buying lasers
refund
Install a new laser, processing a refund if applicable
Variables
PRXS
Equipment prices
Flight
Docking, hyperspace, views, shields and more
Subroutines
DENGY
Drain some energy from the energy banks
DOCKIT
Apply docking manoeuvres to the ship in INWK
DOENTRY
Dock at the space station, show the ship hangar and work out any mission progression
ee3
Print the hyperspace countdown in the top-left of the screen
ESCAPE
Launch our escape pod
Ghy
Perform a galactic hyperspace jump
hy6 / dockEd
Print a message to say there is no hyperspacing allowed inside the station
hyp
Start the hyperspace process
LOOK1
Initialise the space view
me1
Erase an old in-flight message and display a new one
me2
Remove an in-flight message from the space view
mes9
Print a text token, possibly followed by " DESTROYED"
MESS
Display an in-flight message
MJP
Process a mis-jump into witchspace
OOPS
Take some damage
ou2
Display "E.C.M.SYSTEM DESTROYED" as an in-flight message
ou3
Display "FUEL SCOOPS DESTROYED" as an in-flight message
OUCH
Potentially lose cargo or equipment following damage
PLUT / PU1
Flip the coordinate axes for the four different views
SIGHT
Draw the laser crosshairs
TT110
Launch from a station or show the front space view
TT18
Try to initiate a jump into hyperspace
WARP
Perform an in-system jump
wW
Start a hyperspace countdown
Keyboard
Processing key presses and joysticks
Subroutines
CTRL
Scan the keyboard to see if CTRL is currently pressed
DK4
Scan for pause, configuration and secondary flight keys
DKJ1
Read joystick and flight controls
DKS1
Scan the keyboard for a flight key
DKS2
Read the joystick position
DKS3
Toggle a configuration setting and emit a beep
DKS4 / DKS5
Scan the keyboard to see if a specific key is being pressed
DOKEY
Scan for the seven primary flight controls
FLKB
Flush the keyboard buffer
PAUSE2
Wait until a key is pressed, ignoring any existing key press
RDKEY
Scan the keyboard for key presses
TT102
Process function key, save key, hyperspace and chart key presses
TT17
Scan the keyboard for cursor key or joystick movement
TT214
Ask a question with a "Y/N?" prompt and return the response
TT217
Scan the keyboard until a key is pressed
U% / ZEKTRAN
Clear the key logger
Variables
KYTB / IKNS
Lookup table for in-flight keyboard controls
TRANTABLE / TRTB%
Translation table from internal key number to ASCII
Loader
The loading screen and system setup
Subroutines
BEGIN
Initialise the configuration variables and start the game
DEEOR
Decrypt the main flight code between &1300 and &55FF and jump into the main game loop
STARTUP / SETINTS
Set the various vectors, interrupts and timers, and terminate the loading process so the vector handlers can take over
Variables
RDLI
The OS command string for running the flight code in file D.CODE
Main loop
The core loop that runs Elite
Subroutines
Main flight loop (Part 1 of 16)
Seed the random number generator
Main flight loop (Part 2 of 16)
Calculate the alpha and beta angles from the current pitch and roll of our ship
Main flight loop (Part 3 of 16)
Scan for flight keys and process the results
Main flight loop (Part 4 of 16)
For each nearby ship: Copy the ship's data block from K% to the zero-page workspace at INWK
Main flight loop (Part 5 of 16)
For each nearby ship: If an energy bomb has been set off, potentially kill this ship
Main flight loop (Part 7 of 16)
For each nearby ship: Check whether we are docking, scooping or colliding with it
Main flight loop (Part 8 of 16)
For each nearby ship: Process us potentially scooping this item
Main flight loop (Part 9 of 16)
For each nearby ship: If it is a space station, check whether we are successfully docking with it
Main flight loop (Part 11 of 16)
For each nearby ship: Process missile lock and firing our laser
Main flight loop (Part 12 of 16)
For each nearby ship: Draw the ship, remove if killed, loop back
Main flight loop (Part 13 of 16)
Show energy bomb effect, charge shields and energy banks
Main flight loop (Part 14 of 16)
Spawn a space station if we are close enough to the planet
Main flight loop (Part 15 of 16)
Perform altitude checks with the planet and sun and process fuel scooping if appropriate
Main flight loop (Part 16 of 16)
Process laser pulsing, E.C.M. energy drain, call stardust routine
Main game loop (Part 1 of 6)
Spawn a trader (a peaceful Cobra Mk III)
Main game loop (Part 2 of 6)
Call the main flight loop, and potentially spawn a trader, an asteroid, or a cargo canister
Main game loop (Part 3 of 6)
Potentially spawn a cop, particularly if we've been bad
Main game loop (Part 4 of 6)
Potentially spawn a lone bounty hunter, a Thargoid, or up to four pirates
Main game loop (Part 5 of 6)
Cool down lasers, make calls to update the dashboard
Main game loop (Part 6 of 6)
Process non-flight key presses (red function keys, docked keys)
Market
Market prices, selling, buying and inventory
Subroutines
gnum
Get a number from the keyboard
tnpr
Work out if we have space for a specific amount of cargo
TT151
Print the name, price and availability of a market item
TT163
Print the headers for the table of market prices
TT167
Show the Market Price screen (red key f7)
TT208
Show the Sell Cargo screen (red key f2)
TT210
Show a list of current cargo in our hold, optionally to sell
TT213
Show the Inventory screen (red key f9)
TT219
Show the Buy Cargo screen (red key f1)
Variables
QQ23
Market prices table
Maths (Arithmetic)
Addition, subtraction, multiplication, division
Subroutines
DVID3B2
Calculate K(3 2 1 0) = (A P+1 P) / (z_sign z_hi z_lo)
DVID4
Calculate (P R) = 256 * A / Q
DVID4 / dvid4_duplicate
Calculate (P R) = 256 * A / Q
DVIDT
Calculate (P+1 A) = (A P) / Q
FMLTU
Calculate A = A * Q / 256
LL120
Calculate (Y X) = (S x1_lo) * XX12+2 or (S x1_lo) / XX12+2
LL123
Calculate (Y X) = (S R) / XX12+2 or (S R) * XX12+2
LL28
Calculate R = 256 * A / Q
LL38
Calculate (S A) = (S R) + (A Q)
LL5
Calculate Q = SQRT(R Q)
MLS2
Calculate (S R) = XX(1 0) and (A P) = A * ALP1
MU11
Calculate (A P) = P * X
MULT1
Calculate (A P) = Q * A
PIX1
Calculate (YY+1 SYL+Y) = (A P) + (S R) and draw stardust particle
SPS2
Calculate (Y X) = A / 10
Variables
antilog / alogh
Binary antilogarithm table
log
Binary logarithm table (high byte)
logL
Binary logarithm table (low byte)
Maths (Geometry)
Vectors, coordinates, dot products and matrices
Subroutines
ARCTAN
Calculate A = arctan(P / Q)
FAROF2
Compare x_hi, y_hi and z_hi with A
MAS2
Calculate a cap on the maximum distance to the planet or sun
PROJ
Project the current ship or planet onto the screen
TAS3
Calculate the dot product of XX15 and an orientation vector
Missions
Hunting stolen ships and evading Thargoids
Subroutines
BRIEF
Start mission 1 and show the mission briefing
BRP
Print an extended token and show the Status Mode screen
DEBRIEF
Finish mission 1
PAS1
Display a rotating ship at space coordinates (0, 112, 256) and scan the keyboard
Moving
Moving and rotating ships and planets in space
Subroutines
MV40
Rotate the planet or sun's location in space by the amount of pitch and roll of our ship
MVEIT (Part 1 of 9)
Move current ship: Tidy the orientation vectors
MVEIT (Part 2 of 9)
Move current ship: Call tactics routine, remove ship from scanner
MVEIT (Part 6 of 9)
Move current ship: Move the ship in space according to our speed
MVEIT (Part 9 of 9)
Move current ship: Redraw on scanner, if it hasn't been destroyed
Save and load
Commander files and competition codes
Subroutines
BRKBK / COLD
Set the standard BRKV handler for the game
CATS
Ask for a disc drive number and print a catalogue of that drive
CHECK
Calculate the checksum for the last saved commander data block
DELT
Catalogue a disc, ask for a filename to delete, and delete the file
GTNME / GTNMEW
Fetch the name of a commander file to save or load
LOD
Load a commander file
MEBRK
The BRKV handler for disc access operations
QUS1
Save or load the commander file
SVE
Save the commander file
TR1
Copy the last saved commander's name from NA% to INWK
TRNME
Copy the last saved commander's name from INWK to NA%
Variables
CHK
First checksum byte for the saved commander data file
CHK2
Second checksum byte for the saved commander data file
CTLI
The OS command string for cataloguing a disc
DELI
The OS command string for deleting a file
NA% / NA2%
The data block for the last saved commander
S1%
The drive and directory number used when saving or loading a commander file
stack / stackpt
Temporary storage for the stack pointer when switching the BRKV handler between BRBR and MEBRK
SVN
The "saving in progress" flag
Ship hangar
The ship hangar that's displayed on docking
Subroutines
HALL
Draw the ships in the ship hangar, then draw the hangar
HANGER
Display the ship hangar
HAS1
Draw a ship in the ship hangar
HAS2
Draw a hangar background line from left to right
HAS3
Draw a hangar background line from right to left
UNWISE
Switch the main line-drawing routine between EOR and OR logic
Variables
HATB
Ship hangar group table
Sound
Explosions, laser fire, hyperspace and more
Subroutines
BEEP
Make a short, high beep
BELL
Make a standard system beep
ECMOF
Switch off the E.C.M.
EXNO
Make the sound of a laser strike or ship explosion
EXNO3
Make an explosion sound
NO3
Make a sound from a prepared sound block
NOISE
Make the sound whose number is in A
NOS1
Prepare a sound block
Variables
E%
Sound envelope definitions
SFX
Sound data
Stardust
Stardust generation and movement
Subroutines
FLIP
Reflect the stardust particles in the screen diagonal and redraw the stardust field
nWq
Create a random cloud of stardust
NWSTARS
Initialise the stardust field
STARS
The main routine for processing the stardust
STARS1
Process the stardust for the front view
STARS2
Process the stardust for the left or right view
STARS6
Process the stardust for the rear view
Start and end
The title screen... and the Game Over screen
Subroutines
BR1 (Part 1 of 2)
Show the "Load New Commander (Y/N)?" screen and start the game
BR1 (Part 2 of 2)
Show the "Press Fire or Space, Commander" screen and start the game
DEATH
Display the death screen
DEATH2
Reset most of the game and restart from the title screen
DFAULT / QU5
Reset the current commander data block to the last saved commander
RES2
Reset a number of flight variables and workspaces
RESET
Reset most variables
TITLE
Display a title screen with a rotating ship and prompt
TT170
Main entry point for the Elite game code
Status
Showing the commander's status and rank
Subroutines
BAY
Go to the docking bay (i.e. show the Status Mode screen)
cmn
Print the commander's name
EXNO2
Process us making a kill
STATUS
Show the Status Mode screen (red key f8)
Tactics
AI tactics for enemy ships and missiles
Subroutines
ANGRY
Make a ship hostile
FRMIS
Fire a missile from our ship
HITCH
Work out if the ship in INWK is in our crosshairs
SFRMIS
Add an enemy missile to our local bubble of universe
TACTICS (Part 1 of 7)
Apply tactics: Process missiles, both enemy missiles and our own
TACTICS (Part 2 of 7)
Apply tactics: Escape pod, station, lone Thargon, safe-zone pirate
TACTICS (Part 3 of 7)
Apply tactics: Calculate dot product to determine ship's aim
TACTICS (Part 4 of 7)
Apply tactics: Check energy levels, maybe launch escape pod if low
TACTICS (Part 5 of 7)
Apply tactics: Consider whether to launch a missile at us
TACTICS (Part 6 of 7)
Apply tactics: Consider firing a laser at us, if aim is true
TACTICS (Part 7 of 7)
Apply tactics: Set pitch, roll, and acceleration
Text
The game's recursive text tokenisation system
Subroutines
BPRNT
Print a 32-bit number, left-padded to a specific number of digits, with an optional decimal point
crlf
Tab to column 21 and print a colon
dn2
Make a short, high beep and delay for 1 second
INCYC
Move the text cursor to the next row
MT26
Fetch a line of text from the keyboard
MT27
Print the captain's name during mission briefings
MT29
Move to row 6, switch to white text, and switch to lower case when
MT8
Tab to column 6 and start a new word when printing extended tokens
MT9
Clear the screen and set the current view type to 1
plf2
Print text followed by a newline and indent of 6 characters
SETXC / DOXC
Implement the #SETXC
command (move the text cursor to a specific column)
SETYC / DOYC
Implement the #SETYC
command (move the text cursor to a specific row)
TT26
Print a character at the text cursor, with support for verified text in extended tokens
TT26 / CHPR
Print a character at the text cursor by poking into screen memory
TT67
Print a newline
TT67 / TT67X
Print a newline
TTX69
Print a paragraph break
Variables
FONT%
A copy of the character definition bitmap table from the MOS ROM
JMTB
The extended token table for jump tokens 1-32 (DETOK)
QQ16
The two-letter token lookup table
QQ18
The recursive token table for tokens 0-148
RLINE
The OSWORD configuration block used to fetch a line of text from the keyboard
RUGAL
The criteria for systems with extended description overrides
RUPLA
System numbers that have extended description overrides
RUTOK
The second extended token table for recursive tokens 0-26 (DETOK3)
TKN1
The first extended token table for recursive tokens 0-255 (DETOK)
Universe
Ship spawning, local bubble, system/market data
Subroutines
hyp1
Process a jump to the system closest to (QQ9, QQ10)
KILLSHP
Remove a ship from our local bubble of universe
KS4
Remove the space station and replace it with the sun
NWSHP
Add a new ship to our local bubble of universe
NWSPS
Add a new space station to our local bubble of universe
PDESC
Print the system's extended description or a mission 1 directive
SFS1
Spawn a child ship from the current (parent) ship
SOLAR
Set up various aspects of arriving in a new system
SPIN
Randomly spawn cargo from a destroyed ship
TT111
Set the current system to the nearest system to a point
TT146
Print the distance to the selected system in light years
TT25
Show the Data on System screen (red key f6)
ypl
Print the current system name
Ze
Initialise the INWK workspace to a hostile ship
Utility routines
Memory/screen clearing, delay routines
Subroutines
BRBR / NEWBRK
The standard BRKV handler for the game
DELAY
Wait for a specified time, in 1/50s of a second
FX200
Set the behaviour of the ESCAPE and BREAK keys
ZERO
Zero-fill pages &9, &A, &B, &C and &D
ZES1
Zero-fill the page whose number is in X
ZES2
Zero-fill a specific page
Variables
F%
Denotes the end of the main game code, from Elite A to Elite J
Workspaces
Collections of important variables into blocks
Workspaces
K%
Ship data blocks and ship line heaps
T%
Current commander data and stardust data blocks
UP
Ship slots, variables
WP
Ship slots, variables
ZP
Lots of important variables are stored in the zero page workspace as it is quicker and more space-efficient to access memory here
Indexes to the source code
A-Z indexes, code usage analysis and more
Indexes to the source code
BBC Micro cassette source code indexes
A-Z indexes and indexes by category for the BBC Micro cassette version of Elite
A-Z indexes for the BBC Micro cassette version
A-Z index of the source code
An index of every subroutine, entry point, variable, workspace and macro in the source code
Source code cross-references
Every label and variable in the source code and where they are used
Indexes by category for the BBC Micro cassette version
List of all subroutines by category
Subroutines in the BBC Micro cassette version of Elite
List of all variables by category
Variables in the BBC Micro cassette version of Elite
List of all workspaces by category
Workspaces in the BBC Micro cassette version of Elite
List of all macros by category
Macros used in the BBC Micro cassette version of Elite
BBC Micro disc source code indexes
A-Z indexes and indexes by category for the BBC Micro disc version of Elite
A-Z indexes for the BBC Micro disc version
A-Z index of the source code
An index of every subroutine, entry point, variable, workspace and macro in the source code
Source code cross-references
Every label and variable in the source code and where they are used
Indexes by category for the BBC Micro disc version
List of all subroutines by category
Subroutines in the BBC Micro disc version of Elite
List of all variables by category
Variables in the BBC Micro disc version of Elite
List of all workspaces by category
Workspaces in the BBC Micro disc version of Elite
List of all macros by category
Macros used in the BBC Micro disc version of Elite
6502 Second Processor source code indexes
A-Z indexes and indexes by category for the 6502 Second Processor version of Elite
A-Z indexes for the 6502 Second Processor version
A-Z index of the source code
An index of every subroutine, entry point, variable, workspace and macro in the source code
Source code cross-references
Every label and variable in the source code and where they are used
Indexes by category for the 6502 Second Processor version
List of all subroutines by category
Subroutines in the 6502 Second Processor version of Elite
List of all variables by category
Variables in the 6502 Second Processor version of Elite
List of all workspaces by category
Workspaces in the 6502 Second Processor version of Elite
List of all macros by category
Macros used in the 6502 Second Processor version of Elite
BBC Master source code indexes
A-Z indexes and indexes by category for the BBC Master version of Elite
A-Z indexes for the BBC Master version
A-Z index of the source code
An index of every subroutine, entry point, variable, workspace and macro in the source code
Source code cross-references
Every label and variable in the source code and where they are used
Indexes by category for the BBC Master version
List of all subroutines by category
Subroutines in the BBC Master version of Elite
List of all variables by category
Variables in the BBC Master version of Elite
List of all workspaces by category
Workspaces in the BBC Master version of Elite
List of all macros by category
Macros used in the BBC Master version of Elite
Acorn Electron source code indexes
A-Z indexes and indexes by category for the Electron version of Elite
A-Z indexes for the Electron version
A-Z index of the source code
An index of every subroutine, entry point, variable, workspace and macro in the source code
Source code cross-references
Every label and variable in the source code and where they are used
Indexes by category for the Electron version
List of all subroutines by category
Subroutines in the Electron version of Elite
List of all variables by category
Variables in the Electron version of Elite
List of all workspaces by category
Workspaces in the Electron version of Elite
List of all macros by category
Macros used in the Electron version of Elite
NES source code indexes
A-Z indexes and indexes by category for the NES version of Elite
A-Z indexes for the NES version
A-Z index of the source code
An index of every subroutine, entry point, variable, workspace and macro in the source code
Source code cross-references
Every label and variable in the source code and where they are used
Indexes by category for the NES version
List of all subroutines by category
Subroutines in the NES version of Elite
List of all variables by category
Variables in the NES version of Elite
List of all workspaces by category
Workspaces in the NES version of Elite
List of all macros by category
Macros used in the NES version of Elite
Elite-A source code indexes
A-Z indexes and indexes by category for Elite-A
A-Z indexes for Elite-A
A-Z index of the source code
An index of every subroutine, entry point, variable, workspace and macro in the source code
Source code cross-references
Every label and variable in the source code and where they are used
Indexes by category for Elite-A
List of all subroutines by category
Subroutines in Elite-A
List of all variables by category
Variables in Elite-A
List of all workspaces by category
Workspaces in Elite-A
List of all macros by category
Macros used in Elite-A
Indexes of variations
Indexes of variations and code usage
How code is shared between the different versions of Elite, and how it varies between versions
Indexes of variations and code usage
All shared code that contains variations
Code that appears in multiple versions and which differs between versions
All shared code that contains no variations
Code that appears in multiple versions and which is the same in all versions
Version-specific routines
Code that appears in just one version of Elite
Source code statistics
Instruction counts and other source code stats
Source code statistics
Code statistics for the BBC Micro cassette version
A breakdown of the BBC Micro cassette source code by category, type and number of instructions
Code statistics for the BBC Micro disc version
A breakdown of the BBC Micro disc source code by category, type and number of instructions
Code statistics for the 6502 Second Processor version
A breakdown of the 6502 Second Processor source code by category, type and number of instructions
Code statistics for the BBC Master version
A breakdown of the BBC Master source code by category, type and number of instructions
Code statistics for the Electron version
A breakdown of the Electron source code by category, type and number of instructions
Code statistics for the NES version
A breakdown of the NES source code by category, type and number of instructions
Code statistics for Elite-A
A breakdown of the Elite-A source code by category, type and number of instructions
My Other Sites
Fully documented source code for Aviator
Fully documented source code for Revs
Fully documented source code for Lander
Mark Moxon's Travel Writing
Walking Land's End to John o'Groats
Tubewalker: The Tube, on Foot
Mark Moxon's Software Archaeology