Skip to navigation


Map of the source code

[Commodore 64 version]

This page contains a map of all the routines, variables and macros in the Commodore 64 version of Elite. The source files are structured like this:

You can click on the links above to jump to the relevant part of the map.

Disk Loader 1
-------------

CategoryDetails

Loader

Variable: basicBootstrap (Disk Loader 1)

Call the RelocateLoader routine even if the firebird file is loaded as a BASIC program

Loader

Subroutine: RelocateLoader (Disk Loader 1)

Load and run the GMA1 loader file

Loader

Subroutine: filename (Disk Loader 1)

A wildcarded filename that matches the first GMA file on disk

Loader

Subroutine: RunGMA (Disk Loader 1)

Load and run the GMA1 loader file

Loader

Variable: basicVectors (Disk Loader 1)

Addresses that override the BASIC vectors for when the loader file is loaded at the address in its PRG header, $02A7

Disk Loader 2
-------------

CategoryDetails

Loader

Subroutine: Elite GMA loader (Part 1 of 4) (Disk Loader 2)

Skip past the table of track and sector numbers if present

Loader

Variable: trackSector (Disk Loader 2)

Track and sector numbers for all the files on the disk, for use in the fast loader

Loader

Subroutine: Elite GMA loader (Part 2 of 4) (Disk Loader 2)

Offer the option of a fast loader and run the disk protection code in the GMA3 file

Loader

Subroutine: Elite GMA loader (Part 3 of 4) (Disk Loader 2)

Run the Elite loader in the GMA4 file

Loader

Subroutine: Elite GMA loader (Part 4 of 4) (Disk Loader 2)

Load the GMA5 and GMA6 binaries and start the game

Loader

Subroutine: LoadGMAFile (Disk Loader 2)

Load a specific GMA file

Loader

Subroutine: SetUpGMAFile (Disk Loader 2)

Configure the filename parameters to load a specific GMA file

Loader

Variable: filename (Disk Loader 2)

The GMA filename used to load the game files, buried in a message from GMA, the author of the loader

Loader

Subroutine: SetUpFastLoader (Disk Loader 2)

Set up the fast loader so that calls to the Kernal's file functions use the fast loader routines instead

Loader

Variable: fastTrackSector (Disk Loader 2)

A track and sector table for use by the fast loader

Loader

Subroutine: CopyZeroPage (Disk Loader 2)

Copy a page of data in a specified direction between zero page and the page at $CE00, omitting the first two bytes

Loader

Subroutine: OfferFastLoader (Disk Loader 2)

Offer the option of using the fast loader, if we haven't already, and set up the fast loader if it is chosen

Loader

Subroutine: PrintString (Disk Loader 2)

Print the null-terminated string at offset X in loaderScreens

Loader

Variable: fastLoaderOffered (Disk Loader 2)

A flag to record whether we have already asked whether to use the fast loader, so we don't ask twice

Loader

Variable: loaderScreens (Disk Loader 2)

PETSCII codes for clearing the screen and displaying the fast loader prompt and loading screens

Game Loader
-----------

CategoryDetails

Workspaces

Workspace: ZP (Game Loader)

Important variables used by the loader

Utility routines

Variable: W% (Game Loader)

Denotes the start of the first block of loader code, as used in the encryption/decryption process

Loader

Subroutine: LODATA (Game Loader)

The binaries for recursive tokens and the game font

Loader

Subroutine: SHIPS (Game Loader)

The binaries for the ship blueprints

Utility routines

Variable: X% (Game Loader)

Denotes the end of the first block of loader code, as used in the encryption/decryption process

Loader

Variable: FRIN (Game Loader)

A temporary variable that's used for storing addresses

Loader

Subroutine: Elite loader (Part 1 of 7) (Game Loader)

Unscramble the loader code and game data

Loader

Subroutine: DEEORS (Game Loader)

Decrypt a multi-page block of memory

Loader

Subroutine: Elite loader (Part 2 of 7) (Game Loader)

Copy the game data to their correct locations

Loader

Subroutine: Elite loader (Part 3 of 7) (Game Loader)

Configure the memory layout and the CIA chips

Loader

Subroutine: Elite loader (Part 4 of 7) (Game Loader)

Configure the VIC-II for screen memory and sprites

Loader

Subroutine: Elite loader (Part 5 of 7) (Game Loader)

Configure the screen bitmap and copy colour data into screen RAM

Loader

Subroutine: Elite loader (Part 6 of 7) (Game Loader)

Copy colour data into colour RAM and configure more screen RAM

Loader

Subroutine: Elite loader (Part 7 of 7) (Game Loader)

Set up the sprite pointers, make a copy of the dashboard bitmap in DSTORE% and copy the sprite definitions to SPRITELOC%

Loader

Subroutine: mvblock (Game Loader)

Copy a number of pages in memory

Loader

Subroutine: mvsm (Game Loader)

Copy 280 bytes in memory

Drawing the screen

Variable: sdump (Game Loader)

Screen RAM colour data for the dashboard

Drawing the screen

Variable: cdump (Game Loader)

Colour RAM colour data for the dashboard

Drawing the screen

Variable: spritp (Game Loader)

Sprite definitions

Loader

Variable: date (Game Loader)

A date image that is included into the source disk binaries (this is just random noise in the released game)

Drawing the screen

Variable: DIALS (Game Loader)

The dashboard bitmap and colour data for screen RAM

Utility routines

Variable: V% (Game Loader)

Denotes the end of the second block of loader code, as used in the encryption/decryption process

Workspaces
----------

CategoryDetails

Workspaces

Workspace: ZP

Lots of important variables are stored in the zero page workspace as it is quicker and more space-efficient to access memory here

Workspaces

Workspace: XX3

Temporary storage space for complex calculations

Workspaces

Workspace: K%

Ship data blocks and ship line heaps

Workspaces

Workspace: UP

Configuration variables

Workspaces

Workspace: WP

Variables

Elite A
-------

CategoryDetails

Workspaces

Workspace: Option variables

Variables that are predominantly used to store the game options

Keyboard

Variable: TGINT

The keys used to toggle configuration settings when the game is paused

Loader

Subroutine: S%

Checksum, decrypt and unscramble the main game code, and start the game

Utility routines

Subroutine: DEEOR

Unscramble the main code

Utility routines

Subroutine: DEEORS

Decrypt a multi-page block of memory

Utility routines

Variable: G%

Denotes the start of the main game code, from ELITE A to ELITE K

Flight

Subroutine: DOENTRY

Dock at the space station, show the ship hangar and work out any mission progression

Save and load

Subroutine: BRKBK

Set the standard BRKV handler for the game

Missions

Variable: TRIBDIR

The low byte of the four 16-bit directions in which Trumble sprites can move

Missions

Variable: TRIBDIRH

The high byte of the four 16-bit directions in which Trumble sprites can move

Missions

Variable: SPMASK

Masks for updating sprite bits in VIC+$10 for the top bit of the 9-bit x-coordinates of the Trumble sprites

Missions

Subroutine: MVTRIBS

Move the Trumble sprites around on-screen

Main loop

Subroutine: Main flight loop (Part 1 of 16)

Seed the random number generator

Main loop

Subroutine: Main flight loop (Part 2 of 16)

Calculate the alpha and beta angles from the current pitch and roll of our ship

Main loop

Subroutine: Main flight loop (Part 3 of 16)

Scan for flight keys and process the results

Main loop

Subroutine: 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 loop

Subroutine: Main flight loop (Part 5 of 16)

For each nearby ship: If an energy bomb has been set off, potentially kill this ship

Main loop

Subroutine: 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 loop

Subroutine: Main flight loop (Part 7 of 16)

For each nearby ship: Check whether we are docking, scooping or colliding with it

Main loop

Subroutine: Main flight loop (Part 8 of 16)

For each nearby ship: Process us potentially scooping this item

Main loop

Subroutine: 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 loop

Subroutine: Main flight loop (Part 10 of 16)

For each nearby ship: Remove if scooped, or process collisions

Main loop

Subroutine: Main flight loop (Part 11 of 16)

For each nearby ship: Process missile lock and firing our laser

Main loop

Subroutine: Main flight loop (Part 12 of 16)

For each nearby ship: Draw the ship, remove if killed, loop back

Main loop

Subroutine: Main flight loop (Part 13 of 16)

Show energy bomb effect, charge shields and energy banks

Main loop

Subroutine: Main flight loop (Part 14 of 16)

Spawn a space station if we are close enough to the planet

Main loop

Subroutine: Main flight loop (Part 15 of 16)

Perform altitude checks with the planet and sun and process fuel scooping if appropriate

Main loop

Subroutine: Main flight loop (Part 16 of 16)

Process laser pulsing, E.C.M. energy drain, call stardust routine

Universe

Subroutine: SPIN

Randomly spawn cargo from a destroyed ship

Drawing the screen

Subroutine: BOMBOFF

Switch off the energy bomb effect

Text

Subroutine: MT27

Print the captain's name during mission briefings

Text

Subroutine: MT28

Print the location hint during the mission 1 briefing

Text

Subroutine: DETOK3

Print an extended recursive token from the RUTOK token table

Text

Subroutine: DETOK

Print an extended recursive token from the TKN1 token table

Text

Subroutine: DETOK2

Print an extended text token (1-255)

Text

Subroutine: MT1

Switch to ALL CAPS when printing extended tokens

Text

Subroutine: MT2

Switch to Sentence Case when printing extended tokens

Text

Subroutine: MT8

Tab to column 6 and start a new word when printing extended tokens

Text

Subroutine: MT9

Clear the screen and set the current view type to 1

Text

Subroutine: MT13

Switch to lower case when printing extended tokens

Text

Subroutine: MT6

Switch to standard tokens in Sentence Case

Text

Subroutine: MT5

Switch to extended tokens

Text

Subroutine: MT14

Switch to justified text when printing extended tokens

Text

Subroutine: MT15

Switch to left-aligned text when printing extended tokens

Text

Subroutine: MT17

Print the selected system's adjective, e.g. Lavian for Lave

Text

Subroutine: MT18

Print a random 1-8 letter word in Sentence Case

Text

Subroutine: MT19

Capitalise the next letter

Text

Subroutine: VOWEL

Test whether a character is a vowel

Text

Subroutine: WHITETEXT

Switch to white text

Text

Variable: JMTB

The extended token table for jump tokens 1-32 (DETOK)

Text

Variable: TKN2

The extended two-letter token lookup table

Text

Variable: QQ16

The two-letter token lookup table

Save and load

Variable: NA%

The data block for the last saved commander

Save and load

Variable: CHK2

Second checksum byte for the saved commander data file

Save and load

Variable: CHK3

Third checksum byte for the saved commander data file

Save and load

Variable: CHK

First checksum byte for the saved commander data file

Save and load

Variable: S1%

The drive and directory number used when saving or loading a commander file

Save and load

Variable: NA2%

The data block for the default commander

Drawing ships

Variable: scacol

Ship colours on the scanner

Drawing lines

Variable: LSX2

The ball line heap for storing x-coordinates

Drawing lines

Variable: LSY2

The ball line heap for storing y-coordinates

Elite B
-------

CategoryDetails

Universe

Variable: UNIV

Table of pointers to the local universe's ship data blocks

Drawing pixels

Variable: TWOS2

Ready-made double-pixel character row bytes for mode 4

Drawing pixels

Variable: CTWOS

Ready-made double-pixel character row bytes for the dashboard

Keyboard

Subroutine: FLKB

Flush the keyboard buffer

Drawing lines

Subroutine: NLIN3

Print a title and draw a horizontal line at row 19 to box it in

Drawing lines

Subroutine: NLIN4

Draw a horizontal line at pixel row 19 to box in a title

Drawing lines

Subroutine: NLIN

Draw a horizontal line at pixel row 23 to box in a title

Drawing lines

Subroutine: NLIN2

Draw a screen-wide horizontal line at the pixel row in A

Drawing lines

Subroutine: HLOIN2

Remove a line from the sun line heap and draw it on-screen

Drawing lines

Variable: TWFL

Ready-made character rows for the left end of a horizontal line in the space view

Drawing lines

Variable: TWFR

Ready-made character rows for the right end of a horizontal line in mode 4

Maths (Arithmetic)

Subroutine: PIX1

Calculate (YY+1 SYL+Y) = (A P) + (S R) and draw stardust particle

Drawing pixels

Subroutine: PIXEL2

Draw a stardust particle relative to the screen centre

Drawing pixels

Subroutine: PIXEL

Draw a 1-pixel dot, 2-pixel dash or 4-pixel square

Drawing circles

Subroutine: BLINE

Draw a circle segment and add it to the ball line heap

Stardust

Subroutine: FLIP

Reflect the stardust particles in the screen diagonal and redraw the stardust field

Stardust

Subroutine: STARS

The main routine for processing the stardust

Stardust

Subroutine: STARS1

Process the stardust for the front view

Stardust

Subroutine: STARS6

Process the stardust for the rear view

Maths (Geometry)

Subroutine: MAS1

Add an orientation vector coordinate to an INWK coordinate

Maths (Geometry)

Subroutine: MAS2

Calculate a cap on the maximum distance to the planet or sun

Maths (Arithmetic)

Subroutine: MAS3

Calculate A = x_hi^2 + y_hi^2 + z_hi^2 in the K% block

Status

Subroutine: STATUS

Show the Status Mode screen

Text

Subroutine: plf2

Print text followed by a newline and indent of 6 characters

Moving

Subroutine: MVT3

Calculate K(3 2 1) = (x_sign x_hi x_lo) + K(3 2 1)

Moving

Subroutine: MVS5

Apply a 3.6 degree pitch or roll to an orientation vector

Text

Variable: TENS

A constant used when printing large numbers in BPRNT

Text

Subroutine: pr2

Print an 8-bit number, left-padded to 3 digits, and optional point

Text

Subroutine: TT11

Print a 16-bit number, left-padded to n digits, and optional point

Text

Subroutine: BPRNT

Print a 32-bit number, left-padded to a specific number of digits, with an optional decimal point

Text

Variable: DTW1

A mask for applying the lower case part of Sentence Case to extended text tokens

Text

Variable: DTW2

A flag that indicates whether we are currently printing a word

Text

Variable: DTW3

A flag for switching between standard and extended text tokens

Text

Variable: DTW4

Flags that govern how justified extended text tokens are printed

Text

Variable: DTW5

The size of the justified text buffer at BUF

Text

Variable: DTW6

A flag to denote whether printing in lower case is enabled for extended text tokens

Text

Variable: DTW8

A mask for capitalising the next letter in an extended text token

Text

Subroutine: FEED

Print a newline

Text

Subroutine: MT16

Print the character in variable DTW7

Text

Subroutine: TT26

Print a character at the text cursor, with support for verified text in extended tokens

Sound

Subroutine: BELL

Make a standard system beep

Dashboard

Subroutine: DIALS (Part 1 of 4)

Update the dashboard: speed indicator

Dashboard

Subroutine: DIALS (Part 2 of 4)

Update the dashboard: pitch and roll indicators

Dashboard

Subroutine: DIALS (Part 3 of 4)

Update the dashboard: four energy banks

Dashboard

Subroutine: DIALS (Part 4 of 4)

Update the dashboard: shields, fuel, laser & cabin temp, altitude

Dashboard

Subroutine: PZW

Fetch the current dashboard colours, to support flashing

Dashboard

Subroutine: DILX

Update a bar-based indicator on the dashboard

Dashboard

Subroutine: DIL2

Update the roll or pitch indicator on the dashboard

Flight

Subroutine: ESCAPE

Launch our escape pod

Charts

Subroutine: HME2

Search the galaxy for a system

Elite C
-------

CategoryDetails

Tactics

Subroutine: TACTICS (Part 1 of 7)

Apply tactics: Process missiles, both enemy missiles and our own

Tactics

Subroutine: TACTICS (Part 2 of 7)

Apply tactics: Escape pod, station, lone Thargon, safe-zone pirate

Tactics

Subroutine: TACTICS (Part 3 of 7)

Apply tactics: Calculate dot product to determine ship's aim

Tactics

Subroutine: TACTICS (Part 4 of 7)

Apply tactics: Check energy levels, maybe launch escape pod if low

Tactics

Subroutine: TACTICS (Part 5 of 7)

Apply tactics: Consider whether to launch a missile at us

Tactics

Subroutine: TACTICS (Part 6 of 7)

Apply tactics: Consider firing a laser at us, if aim is true

Tactics

Subroutine: TACTICS (Part 7 of 7)

Apply tactics: Set pitch, roll, and acceleration

Flight

Subroutine: DOCKIT

Apply docking manoeuvres to the ship in INWK

Maths (Arithmetic)

Subroutine: VCSU1

Calculate vector K3(8 0) = [x y z] - coordinates of the sun or space station

Maths (Arithmetic)

Subroutine: VCSUB

Calculate vector K3(8 0) = [x y z] - coordinates in (A V)

Maths (Arithmetic)

Subroutine: TAS1

Calculate K3 = (x_sign x_hi x_lo) - V(1 0)

Maths (Geometry)

Subroutine: TAS4

Calculate the dot product of XX15 and one of the space station's orientation vectors

Maths (Geometry)

Subroutine: TAS6

Negate the vector in XX15 so it points in the opposite direction

Flight

Subroutine: DCS1

Calculate the vector from the ideal docking position to the ship

Tactics

Subroutine: HITCH

Work out if the ship in INWK is in our crosshairs

Tactics

Subroutine: FRS1

Launch a ship straight ahead of us, below the laser sights

Tactics

Subroutine: FRMIS

Fire a missile from our ship

Tactics

Subroutine: ANGRY

Make a ship hostile

Tactics

Subroutine: FR1

Display the "missile jammed" message

Flight

Subroutine: SESCP

Spawn an escape pod from the current (parent) ship

Universe

Subroutine: SFS1

Spawn a child ship from the current (parent) ship

Moving

Subroutine: SFS2

Move a ship in space along one of the coordinate axes

Drawing circles

Subroutine: LL164

Make the hyperspace sound and draw the hyperspace tunnel

Drawing circles

Subroutine: LAUN

Make the launch sound and draw the launch tunnel

Drawing circles

Subroutine: HFS2

Draw the launch or hyperspace tunnel

Stardust

Subroutine: STARS2

Process the stardust for the left or right view

Maths (Arithmetic)

Subroutine: MU5

Set K(3 2 1 0) = (A A A A) and clear the C flag

Maths (Arithmetic)

Subroutine: MULT3

Calculate K(3 2 1 0) = (A P+1 P) * Q

Maths (Arithmetic)

Subroutine: MLS2

Calculate (S R) = XX(1 0) and (A P) = A * ALP1

Maths (Arithmetic)

Subroutine: MLS1

Calculate (A P) = ALP1 * A

Maths (Arithmetic)

Subroutine: MU6

Set P(1 0) = (A A)

Maths (Arithmetic)

Subroutine: SQUA

Clear bit 7 of A and calculate (A P) = A * A

Maths (Arithmetic)

Subroutine: SQUA2

Calculate (A P) = A * A

Maths (Arithmetic)

Subroutine: MU1

Copy X into P and A, and clear the C flag

Maths (Arithmetic)

Subroutine: MLU1

Calculate Y1 = y_hi and (A P) = |y_hi| * Q for Y-th stardust

Maths (Arithmetic)

Subroutine: MLU2

Calculate (A P) = |A| * Q

Maths (Arithmetic)

Subroutine: MULTU

Calculate (A P) = P * Q

Maths (Arithmetic)

Subroutine: MU11

Calculate (A P) = P * X

Maths (Arithmetic)

Subroutine: FMLTU2

Calculate A = K * sin(A)

Maths (Arithmetic)

Subroutine: FMLTU

Calculate A = A * Q / 256

Maths (Arithmetic)

Subroutine: MLTU2

Calculate (A P+1 P) = (A ~P) * Q

Maths (Arithmetic)

Subroutine: MUT3

An unused routine that does the same as MUT2

Maths (Arithmetic)

Subroutine: MUT2

Calculate (S R) = XX(1 0) and (A P) = Q * A

Maths (Arithmetic)

Subroutine: MUT1

Calculate R = XX and (A P) = Q * A

Maths (Arithmetic)

Subroutine: MULT1

Calculate (A P) = Q * A

Maths (Arithmetic)

Subroutine: MULT12

Calculate (S R) = Q * A

Maths (Geometry)

Subroutine: TAS3

Calculate the dot product of XX15 and an orientation vector

Maths (Arithmetic)

Subroutine: MAD

Calculate (A X) = Q * A + (S R)

Maths (Arithmetic)

Subroutine: ADD

Calculate (A X) = (A P) + (S R)

Maths (Arithmetic)

Subroutine: TIS1

Calculate (A ?) = (-X * A + (S R)) / 96

Maths (Arithmetic)

Subroutine: DV42

Calculate (P R) = 256 * DELTA / z_hi

Maths (Arithmetic)

Subroutine: DV41

Calculate (P R) = 256 * DELTA / A

Maths (Arithmetic)

Subroutine: DVID4

Calculate (P R) = 256 * A / Q

Maths (Arithmetic)

Subroutine: DVID3B2

Calculate K(3 2 1 0) = (A P+1 P) / (z_sign z_hi z_lo)

Dashboard

Subroutine: cntr

Apply damping to the pitch or roll dashboard indicator

Dashboard

Subroutine: BUMP2

Bump up the value of the pitch or roll dashboard indicator

Dashboard

Subroutine: REDU2

Reduce the value of the pitch or roll dashboard indicator

Maths (Geometry)

Subroutine: ARCTAN

Calculate A = arctan(P / Q)

Drawing lines

Subroutine: LASLI

Draw the laser lines for when we fire our lasers

Universe

Subroutine: PDESC

Print the system's extended description or a mission 1 directive

Missions

Subroutine: BRIEF2

Start mission 2

Missions

Subroutine: BRP

Print an extended token and show the Status Mode screen

Missions

Subroutine: BRIEF3

Receive the briefing and plans for mission 2

Missions

Subroutine: DEBRIEF2

Finish mission 2

Missions

Subroutine: DEBRIEF

Finish mission 1

Missions

Subroutine: TBRIEF

Start mission 3

Missions

Subroutine: BRIEF

Start mission 1 and show the mission briefing

Missions

Subroutine: BRIS

Clear the screen, display "INCOMING MESSAGE" and wait for 2 seconds

Missions

Subroutine: PAUSE

Display a rotating ship, waiting until a key is pressed, then remove the ship from the screen

Text

Subroutine: MT23

Move to row 10, switch to white text, and switch to lower case when printing extended tokens

Text

Subroutine: MT29

Move to row 6 and switch to lower case when printing extended tokens

Missions

Subroutine: PAS1

Display a rotating ship at space coordinates (0, conhieght, 256) and scan the keyboard

Keyboard

Subroutine: PAUSE2

Wait until a key is pressed, ignoring any existing key press

Universe

Subroutine: GINF

Fetch the address of a ship's data block into INF

Universe

Subroutine: ping

Set the selected system to the current system

Utility routines

Subroutine: DELAY

Wait for a specified time, in either 1/50s of a second (on PAL systems) or 1/60s of a second (on NTSC systems)

Drawing lines

Variable: sightcol

Colours for the crosshair sights on the different laser types

Text

Variable: MTIN

Lookup table for random tokens in the extended token table (0-37)

Utility routines

Variable: R%

Denotes the end of the first part of the main game code (CODE1), from ELITE A to ELITE C

Elite D
-------

CategoryDetails

Market

Subroutine: tnpr1

Work out if we have space for one tonne of cargo

Market

Subroutine: tnpr

Work out if we have space for a specific amount of cargo

Text

Subroutine: DOXC

Move the text cursor to a specific column

Text

Subroutine: DOYC

Move the text cursor to a specific row

Text

Subroutine: INCYC

Move the text cursor to the next row

Drawing the screen

Subroutine: DOVDU19

Implement the #SETVDU19 command (change mode 1 palette)

Drawing the screen

Subroutine: TRADEMODE

Clear the screen and set up a trading screen

Universe

Subroutine: TT20

Twist the selected system's seeds four times

Universe

Subroutine: TT54

Twist the selected system's seeds

Universe

Subroutine: TT146

Print the distance to the selected system in light years

Text

Subroutine: TT60

Print a text token and a paragraph break

Text

Subroutine: TTX69

Print a paragraph break

Text

Subroutine: TT69

Set Sentence Case and print a newline

Text

Subroutine: TT67

Print a newline

Universe

Subroutine: TT70

Display "MAINLY " and jump to TT72

Text

Subroutine: spc

Print a text token followed by a space

Universe

Subroutine: TT25

Show the Data on System screen

Universe

Subroutine: TT24

Calculate system data from the system seeds

Charts

Subroutine: TT22

Show the Long-range Chart

Drawing lines

Subroutine: TT15

Draw a set of crosshairs

Drawing circles

Subroutine: TT14

Draw a circle with crosshairs on a chart

Drawing circles

Subroutine: TT128

Draw a circle on a chart

Market

Subroutine: TT219

Show the Buy Cargo screen

Market

Subroutine: gnum

Get a number from the keyboard

Market

Subroutine: NWDAV4

Print an "ITEM?" error, make a beep and rejoin the TT210 routine

Market

Subroutine: TT208

Show the Sell Cargo screen

Market

Subroutine: TT210

Show a list of current cargo in our hold, optionally to sell

Market

Subroutine: TT213

Show the Inventory screen

Keyboard

Subroutine: TT214

Ask a question with a "Y/N?" prompt and return the response

Charts

Subroutine: TT16

Move the crosshairs on a chart

Charts

Subroutine: TT103

Draw a small set of crosshairs on a chart

Charts

Subroutine: TT123

Move galactic coordinates by a signed delta

Charts

Subroutine: TT105

Draw crosshairs on the Short-range Chart, with clipping

Charts

Subroutine: TT23

Show the Short-range Chart

Universe

Subroutine: TT81

Set the selected system's seeds to those of system 0

Universe

Subroutine: TT111

Set the current system to the nearest system to a point

Flight

Subroutine: dockEd

Print a message to say there is no hyperspacing allowed inside the station

Flight

Subroutine: hyp

Start the hyperspace process

Flight

Subroutine: wW

Start a hyperspace countdown

Flight

Subroutine: TTX110

Set the current system to the nearest system and return to hyp

Flight

Subroutine: Ghy

Perform a galactic hyperspace jump

Universe

Subroutine: jmp

Set the current system to the selected system

Flight

Subroutine: ee3

Print the hyperspace countdown in the top-left of the screen

Text

Subroutine: pr6

Print 16-bit number, left-padded to 5 digits, no point

Text

Subroutine: pr5

Print a 16-bit number, left-padded to 5 digits, and optional point

Flight

Subroutine: TT147

Print an error when a system is out of hyperspace range

Text

Subroutine: prq

Print a text token followed by a question mark

Market

Subroutine: TT151

Print the name, price and availability of a market item

Market

Subroutine: TT152

Print the unit ("t", "kg" or "g") for a market item

Text

Subroutine: TT162

Print a space

Market

Subroutine: TT160

Print "t" (for tonne) and a space

Market

Subroutine: TT161

Print "kg" (for kilograms)

Market

Subroutine: TT16a

Print "g" (for grams)

Market

Subroutine: TT163

Print the headers for the table of market prices

Market

Subroutine: TT167

Show the Market Price screen

Market

Subroutine: var

Calculate QQ19+3 = economy * |economic_factor|

Universe

Subroutine: hyp1

Process a jump to the system closest to (QQ9, QQ10)

Universe

Subroutine: GVL

Calculate the availability of market items

Universe

Subroutine: GTHG

Spawn a Thargoid ship and a Thargon companion

Flight

Subroutine: MJP

Process a mis-jump into witchspace

Flight

Subroutine: TT18

Try to initiate a jump into hyperspace

Flight

Subroutine: TT110

Launch from a station or show the front space view

Charts

Subroutine: TT114

Display either the Long-range or Short-range Chart

Maths (Arithmetic)

Subroutine: LCASH

Subtract an amount of cash from the cash pot

Maths (Arithmetic)

Subroutine: MCASH

Add an amount of cash to the cash pot

Maths (Arithmetic)

Subroutine: GCASH

Calculate (Y X) = P * Q * 4

Maths (Arithmetic)

Subroutine: GC2

Calculate (Y X) = (A P) * 4

Loader

Variable: RDLI

The OS command string for running the flight code in file D.CODE in the disc version of Elite

Equipment

Subroutine: EQSHP

Show the Equip Ship screen

Market

Subroutine: dn

Print the amount of money we have left in the cash pot, then make a short, high beep and delay for 1 second

Text

Subroutine: dn2

Make a short, high beep and delay for 1 second

Equipment

Subroutine: eq

Subtract the price of equipment from the cash pot

Equipment

Subroutine: prx

Return the price of a piece of equipment

Equipment

Subroutine: qv

Print a menu of the four space views, for buying lasers

Charts

Subroutine: hm

Select the closest system and redraw the chart crosshairs

Equipment

Subroutine: refund

Install a new laser, processing a refund if applicable

Equipment

Variable: PRXS

Equipment prices

Elite E
-------

CategoryDetails

Universe

Subroutine: cpl

Print the selected system name

Status

Subroutine: cmn

Print the commander's name

Universe

Subroutine: ypl

Print the current system name

Universe

Subroutine: tal

Print the current galaxy number

Status

Subroutine: fwl

Print fuel and cash levels

Status

Subroutine: csh

Print the current amount of cash

Text

Subroutine: plf

Print a text token followed by a newline

Text

Subroutine: TT68

Print a text token followed by a colon

Text

Subroutine: TT73

Print a colon

Text

Subroutine: TT27

Print a text token

Text

Subroutine: TT42

Print a letter in lower case

Text

Subroutine: TT41

Print a letter according to Sentence Case

Text

Subroutine: qw

Print a recursive token in the range 128-145

Text

Subroutine: crlf

Tab to column 21 and print a colon

Text

Subroutine: TT45

Print a letter in lower case

Text

Subroutine: TT46

Print a character and switch to capitals

Text

Subroutine: TT74

Print a character

Text

Subroutine: TT43

Print a two-letter token or recursive token 0-95

Text

Subroutine: ex

Print a recursive token

Utility routines

Subroutine: SWAPPZERO

A routine that swaps zero page with the page at $CE00, so that zero page changes made by Kernal functions can be reversed

Drawing ships

Subroutine: DOEXP

Draw an exploding ship

Drawing ships

Variable: exlook

A table to shift X left by one place when X is 0 or 1

Drawing ships

Subroutine: PTCLS2

Draw the explosion along with an explosion sprite

Universe

Subroutine: SOS1

Update the missile indicators, set up the planet data block

Universe

Subroutine: SOLAR

Set up various aspects of arriving in a new system

Stardust

Subroutine: NWSTARS

Initialise the stardust field

Stardust

Subroutine: nWq

Create a random cloud of stardust

Dashboard

Subroutine: WPSHPS

Clear the scanner, reset the ball line and sun line heaps

Drawing suns

Subroutine: FLFLLS

Reset the sun line heap

Drawing the screen

Subroutine: DET1

Show or hide the dashboard (for when we die)

Flight

Subroutine: SHD

Charge a shield and drain some energy from the energy banks

Flight

Subroutine: DENGY

Drain some energy from the energy banks

Dashboard

Subroutine: COMPAS

Update the compass

Maths (Arithmetic)

Subroutine: SPS2

Calculate (Y X) = A / 10

Maths (Geometry)

Subroutine: SPS4

Calculate the vector to the space station

Dashboard

Subroutine: SP1

Draw the space station on the compass

Dashboard

Subroutine: SP2

Draw a dot on the compass, given the planet/station vector

Flight

Subroutine: OOPS

Take some damage

Maths (Geometry)

Subroutine: SPS3

Copy a space coordinate from the K% block into K3

Universe

Subroutine: NWSPS

Add a new space station to our local bubble of universe

Universe

Subroutine: NWSHP

Add a new ship to our local bubble of universe

Universe

Subroutine: NwS1

Flip the sign and double an INWK byte

Dashboard

Subroutine: ABORT

Disarm missiles and update the dashboard indicators

Dashboard

Subroutine: ABORT2

Set/unset the lock target for a missile and update the dashboard

Maths (Geometry)

Subroutine: PROJ

Project the current ship or planet onto the screen

Drawing planets

Subroutine: PL2

Remove the planet or sun from the screen

Drawing planets

Subroutine: PLANET

Draw the planet or sun

Drawing planets

Subroutine: PL9 (Part 1 of 3)

Draw the planet, with either an equator and meridian, or a crater

Drawing planets

Subroutine: PL9 (Part 2 of 3)

Draw the planet's equator and meridian

Drawing planets

Subroutine: PL9 (Part 3 of 3)

Draw the planet's crater

Drawing planets

Subroutine: PLS1

Calculate (Y A) = nosev_x / z

Drawing planets

Subroutine: PLS2

Draw a half-ellipse

Drawing planets

Subroutine: PLS22

Draw an ellipse or half-ellipse

Drawing suns

Subroutine: SUN (Part 1 of 4)

Draw the sun: Set up all the variables needed to draw the sun

Drawing suns

Subroutine: SUN (Part 2 of 4)

Draw the sun: Start from the bottom of the screen and erase the old sun line by line

Drawing suns

Subroutine: SUN (Part 3 of 4)

Draw the sun: Continue to move up the screen, drawing the new sun line by line

Drawing suns

Subroutine: SUN (Part 4 of 4)

Draw the sun: Continue to the top of the screen, erasing the old sun line by line

Drawing circles

Subroutine: CIRCLE

Draw a circle for the planet

Drawing circles

Subroutine: CIRCLE2

Draw a circle (for the planet or chart)

Drawing planets

Subroutine: WPLS2

Remove the planet from the screen

Drawing planets

Subroutine: WP1

Reset the ball line heap

Drawing suns

Subroutine: WPLS

Remove the sun from the screen

Drawing lines

Subroutine: EDGES

Draw a horizontal line given a centre and a half-width

Drawing circles

Subroutine: CHKON

Check whether any part of a circle appears on the extended screen

Drawing planets

Subroutine: PL21

Return from a planet/sun-drawing routine with a failure flag

Drawing planets

Subroutine: PLS3

Calculate (Y A P) = 222 * roofv_x / z

Drawing planets

Subroutine: PLS4

Calculate CNT2 = arctan(P / A) / 4

Drawing planets

Subroutine: PLS5

Calculate roofv_x / z and roofv_y / z

Drawing planets

Subroutine: PLS6

Calculate (X K) = (A P+1 P) / (z_sign z_hi z_lo)

Keyboard

Subroutine: YESNO

Wait until either "Y" or "N" is pressed

Keyboard

Subroutine: TT17

Scan the keyboard for cursor key or joystick movement

Elite F
-------

CategoryDetails

Utility routines

Subroutine: SWAPPZERO (source disk variant)

A routine that swaps zero page with the page at $CE00, so that zero page changes made by Kernal functions can be reversed

Missions

Subroutine: NOSPRITES

Disable all sprites and remove them from the screen

Utility routines

Subroutine: SETL1

Set the 6510 input/output port register to control the memory map

Utility routines

Variable: L1M

Temporary storage for the new value of the 6510 input/output port register

Universe

Subroutine: KS3

Set the SLSP ship line heap pointer after shuffling ship slots

Universe

Subroutine: KS1

Remove the current ship from our local bubble of universe

Universe

Subroutine: KS4

Remove the space station and replace it with the sun

Universe

Subroutine: KS2

Check the local bubble for missiles with target lock

Universe

Subroutine: KILLSHP

Remove a ship from our local bubble of universe

Missions

Subroutine: THERE

Check whether we are in the Constrictor's system in mission 1

Start and end

Subroutine: RESET

Reset most variables

Start and end

Subroutine: RES2

Reset a number of flight variables and workspaces

Universe

Subroutine: ZINF

Reset the INWK workspace and orientation vectors

Dashboard

Subroutine: msblob

Display the dashboard's missile indicators in green

Flight

Subroutine: me2

Remove an in-flight message from the space view

Universe

Subroutine: Ze

Initialise the INWK workspace to a hostile ship

Maths (Arithmetic)

Subroutine: DORND

Generate random numbers

Main loop

Subroutine: Main game loop (Part 1 of 6)

Spawn a trader (a Cobra Mk III, Python, Boa or Anaconda)

Main loop

Subroutine: Main game loop (Part 2 of 6)

Call the main flight loop, and potentially spawn a trader, an asteroid, or a cargo canister

Main loop

Subroutine: Main game loop (Part 3 of 6)

Potentially spawn a cop, particularly if we've been bad

Main loop

Subroutine: Main game loop (Part 4 of 6)

Potentially spawn a lone bounty hunter, a Thargoid, or up to four pirates

Main loop

Subroutine: Main game loop (Part 5 of 6)

Cool down lasers, make calls to update the dashboard

Main loop

Subroutine: Main game loop (Part 6 of 6)

Process non-flight key presses (docked keys)

Keyboard

Subroutine: TT102

Process function key, save key, hyperspace and chart key presses and update the hyperspace counter

Status

Subroutine: BAD

Calculate how bad we have been

Maths (Geometry)

Subroutine: FAROF

Compare x_hi, y_hi and z_hi with 224

Maths (Geometry)

Subroutine: FAROF2

Compare x_hi, y_hi and z_hi with A

Maths (Geometry)

Subroutine: MAS4

Calculate a cap on the maximum distance to a ship

Utility routines

Variable: brkd

The brkd counter for error handling

Utility routines

Subroutine: BRBR

The standard BRKV handler for the game

Start and end

Subroutine: DEATH

Display the death screen

Universe

Variable: spasto

Contains the address of the Coriolis space station's ship blueprint

Loader

Subroutine: BEGIN

Initialise the configuration variables and start the game

Start and end

Subroutine: TT170

Main entry point for the Elite game code

Start and end

Subroutine: DEATH2

Reset most of the game and restart from the title screen

Start and end

Subroutine: BR1 (Part 1 of 2)

Show the "Load New Commander (Y/N)?" screen and start the game

Start and end

Subroutine: BR1 (Part 2 of 2)

Show the "Press Fire or Space, Commander" screen and start the game

Status

Subroutine: BAY

Go to the docking bay (i.e. show the Status Mode screen)

Start and end

Subroutine: DFAULT

Reset the current commander data block to the last saved commander

Start and end

Subroutine: TITLE

Display a title screen with a rotating ship and prompt

Save and load

Subroutine: CHECK

Calculate the checksum for the last saved commander data block

Save and load

Subroutine: CHECK2

Calculate the third checksum for the last saved commander data block (Commodore 64 and Apple II versions only)

Save and load

Subroutine: JAMESON

Restore the default JAMESON commander

Save and load

Subroutine: TRNME

Copy the last saved commander's name from INWK to NA%

Save and load

Subroutine: TR1

Copy the last saved commander's name from NA% to INWK

Save and load

Subroutine: GTNMEW

Fetch the name of a commander file to save or load

Text

Subroutine: MT26

Fetch a line of text from the keyboard

Text

Variable: RLINE

The OSWORD configuration block used to fetch a line of text from the keyboard

Save and load

Subroutine: FILEPR

Display the currently selected media (disk or tape)

Save and load

Subroutine: OTHERFILEPR

Display the non-selected media (disk or tape)

Utility routines

Subroutine: ZERO

Reset the local bubble of universe and ship status

Utility routines

Subroutine: ZEBC

Zero-fill pages $B and $C

Utility routines

Subroutine: ZES1

Zero-fill the page whose number is in X

Utility routines

Subroutine: ZES2

Zero-fill a specific page

Save and load

Subroutine: SVE

Display the disk access menu and process saving of commander files

Save and load

Variable: thislong

Contains the length of the most recently entered commander name

Save and load

Variable: oldlong

Contains the length of the last saved commander name

Save and load

Subroutine: KERNALSETUP

Set up memory and interrupts so we can use the Kernal functions and configure the file system device number and filename

Save and load

Subroutine: GTDRV

Get an ASCII disk drive number from the keyboard

Save and load

Variable: filesys

A lookup table containing the device numbers for tape and disk

Save and load

Subroutine: LOD

Load a commander file

Utility routines

Subroutine: backtonormal

Disable the keyboard, set the SVN flag to 0, and return with A = 0

Save and load

Subroutine: tapeerror

Print either "TAPE ERROR" or "DISK ERROR"

Utility routines

Subroutine: CLDELAY

Delay by iterating through 5 * 256 (1280) empty loops

Keyboard

Subroutine: ZEKTRAN

Clear the key logger

Maths (Geometry)

Subroutine: SPS1

Calculate the vector to the planet and store it in XX15

Maths (Geometry)

Subroutine: TAS2

Normalise the three-coordinate vector in K3

Maths (Geometry)

Subroutine: NORM

Normalise the three-coordinate vector in XX15

Keyboard

Workspace: KEYLOOK

The key logger

Keyboard

Subroutine: RDKEY

Scan the keyboard for key presses

Flight

Subroutine: WARP

Perform an in-system jump

Keyboard

Variable: KYTB

Lookup table for in-flight keyboard controls

Keyboard

Subroutine: CTRL

Scan the keyboard to see if CTRL is currently pressed

Keyboard

Subroutine: DKS4

Scan the keyboard to see if a specific key is being pressed

Keyboard

Subroutine: DKSANYKEY

Scan a specific column in the keyboard matrix for a key press

Keyboard

Subroutine: DKS2

Read the joystick position

Keyboard

Subroutine: DKS3

Toggle a configuration setting and emit a beep

Keyboard

Subroutine: DKJ1

Read joystick and flight controls

Keyboard

Subroutine: U%

Clear the key logger and reset a number of flight variables

Keyboard

Subroutine: DOKEY

Scan for the seven primary flight controls and apply the docking computer manoeuvring code

Keyboard

Subroutine: DK4

Scan for pause, configuration and secondary flight keys

Keyboard

Subroutine: TT217

Scan the keyboard until a key is pressed

Flight

Subroutine: me1

Erase an old in-flight message and display a new one

Flight

Subroutine: MESS

Display an in-flight message

Flight

Subroutine: mes9

Print a text token, possibly followed by " DESTROYED"

Flight

Subroutine: OUCH

Potentially lose cargo or equipment following damage

Flight

Subroutine: ou2

Display "E.C.M.SYSTEM DESTROYED" as an in-flight message

Flight

Subroutine: ou3

Display "FUEL SCOOPS DESTROYED" as an in-flight message

Market

Macro: ITEM

Macro definition for the market prices table

Market

Variable: QQ23

Market prices table

Maths (Geometry)

Subroutine: TIDY

Orthonormalise the orientation vectors for a ship

Maths (Arithmetic)

Subroutine: TIS2

Calculate A = A / Q

Maths (Arithmetic)

Subroutine: TIS3

Calculate -(nosev_1 * roofv_1 + nosev_2 * roofv_2) / nosev_3

Maths (Arithmetic)

Subroutine: DVIDT

Calculate (P+1 A) = (A P) / Q

Sound

Subroutine: startat

Start playing the title music, if configured

Sound

Subroutine: startbd

Start playing the docking music, if configured

Sound

Subroutine: MUTOKCH

Process a change in the docking music configuration setting

Sound

Subroutine: stopbd

Stop playing the docking music

Keyboard

Variable: KTRAN

An unused key logger buffer that's left over from the 6502 Second Processor version of Elite

Keyboard

Variable: TRANTABLE

Translation table from internal key number to ASCII

Elite G
-------

CategoryDetails

Maths (Arithmetic)

Variable: log

Binary logarithm table (high byte)

Maths (Arithmetic)

Variable: logL

Binary logarithm table (low byte)

Maths (Arithmetic)

Variable: antilog

Binary antilogarithm table

Maths (Arithmetic)

Variable: antilogODD

Binary antilogarithm table

Drawing pixels

Variable: ylookupl

Lookup table for converting a pixel y-coordinate to the low byte of a screen address (within the 256-pixel-wide game screen)

Drawing pixels

Variable: ylookuph

Lookup table for converting a pixel y-coordinate to the high byte of a screen address (within the 256-pixel-wide game screen)

Drawing pixels

Variable: celllookl

Lookup table for converting a text y-coordinate to the low byte of the address of the start of the character row

Drawing pixels

Variable: celllookh

Lookup table for converting a text y-coordinate to the high byte of the address of the start of the character row in screen RAM

Drawing ships

Subroutine: SHPPT

Draw a distant ship as a point rather than a full wireframe

Maths (Arithmetic)

Subroutine: LL5

Calculate Q = SQRT(R Q)

Maths (Arithmetic)

Subroutine: LL28

Calculate R = 256 * A / Q

Maths (Arithmetic)

Subroutine: LL38

Calculate (S A) = (S R) + (A Q)

Maths (Geometry)

Subroutine: LL51

Calculate the dot product of XX15 and XX16

Drawing ships

Subroutine: LL9 (Part 1 of 12)

Draw ship: Check if ship is exploding, check if ship is in front

Drawing ships

Subroutine: LL9 (Part 2 of 12)

Draw ship: Check if ship is in field of view, close enough to draw

Drawing ships

Subroutine: LL9 (Part 3 of 12)

Draw ship: Set up orientation vector, ship coordinate variables

Drawing ships

Subroutine: LL9 (Part 4 of 12)

Draw ship: Set visibility for exploding ship (all faces visible)

Drawing ships

Subroutine: LL9 (Part 5 of 12)

Draw ship: Calculate the visibility of each of the ship's faces

Drawing ships

Subroutine: LL9 (Part 6 of 12)

Draw ship: Calculate the visibility of each of the ship's vertices

Maths (Arithmetic)

Subroutine: LL61

Calculate (U R) = 256 * A / Q

Maths (Arithmetic)

Subroutine: LL62

Calculate 128 - (U R)

Drawing ships

Subroutine: LL9 (Part 7 of 12)

Draw ship: Calculate the visibility of each of the ship's vertices

Drawing ships

Subroutine: LL9 (Part 8 of 12)

Draw ship: Calculate the screen coordinates of visible vertices

Drawing ships

Subroutine: LL9 (Part 9 of 12)

Draw ship: Draw laser beams if the ship is firing its laser at us

Drawing ships

Subroutine: LL9 (Part 10 of 12)

Draw ship: Calculate the visibility of each of the ship's edges

Drawing lines

Subroutine: LL145 (Part 1 of 4)

Clip line: Work out which end-points are on-screen, if any

Drawing lines

Subroutine: LL145 (Part 2 of 4)

Clip line: Work out if any part of the line is on-screen

Drawing lines

Subroutine: LL145 (Part 3 of 4)

Clip line: Calculate the line's gradient

Drawing lines

Subroutine: LL145 (Part 4 of 4)

Clip line: Call the routine in LL188 to do the actual clipping

Drawing ships

Subroutine: LL9 (Part 11 of 12)

Draw ship: Add all visible edges to the ship line heap

Drawing ships

Subroutine: LL9 (Part 12 of 12)

Draw ship: Draw all the visible edges from the ship line heap

Drawing lines

Subroutine: LL118

Move a point along a line until it is on-screen

Maths (Arithmetic)

Subroutine: LL120

Calculate (Y X) = (S x1_lo) * XX12+2 or (S x1_lo) / XX12+2

Maths (Arithmetic)

Subroutine: LL123

Calculate (Y X) = (S R) / XX12+2 or (S R) * XX12+2

Maths (Arithmetic)

Subroutine: LL129

Calculate Q = XX12+2, A = S EOR XX12+3 and (S R) = |S R|

Elite H
-------

CategoryDetails

Moving

Subroutine: MVEIT (Part 1 of 9)

Move current ship: Tidy the orientation vectors

Moving

Subroutine: MVEIT (Part 2 of 9)

Move current ship: Call tactics routine, remove ship from scanner

Moving

Subroutine: MVEIT (Part 3 of 9)

Move current ship: Move ship forward according to its speed

Moving

Subroutine: MVEIT (Part 4 of 9)

Move current ship: Apply acceleration to ship's speed as a one-off

Moving

Subroutine: MVEIT (Part 5 of 9)

Move current ship: Rotate ship's location by our pitch and roll

Moving

Subroutine: MVEIT (Part 6 of 9)

Move current ship: Move the ship in space according to our speed

Moving

Subroutine: MVEIT (Part 7 of 9)

Move current ship: Rotate ship's orientation vectors by pitch/roll

Moving

Subroutine: MVEIT (Part 8 of 9)

Move current ship: Rotate ship about itself by its own pitch/roll

Moving

Subroutine: MVEIT (Part 9 of 9)

Move current ship: Redraw on scanner, if it hasn't been destroyed

Moving

Subroutine: MVT1

Calculate (x_sign x_hi x_lo) = (x_sign x_hi x_lo) + (A R)

Moving

Subroutine: MVS4

Apply pitch and roll to an orientation vector

Moving

Subroutine: MVT6

Calculate (A P+2 P+1) = (x_sign x_hi x_lo) + (A P+2 P+1)

Moving

Subroutine: MV40

Rotate the planet or sun's location in space by the amount of pitch and roll of our ship

Copy protection

Subroutine: Checksum

Checksum the code from $1000 to $9FFF and check against S%-1

Flight

Subroutine: PLUT

Flip the coordinate axes for the four different views

Flight

Subroutine: LOOK1

Initialise the space view

Flight

Subroutine: SIGHT

Draw the laser crosshairs

Missions

Variable: TRIBTA

A table for converting the number of Trumbles in the hold into a number of sprites in the range 0 to 6

Missions

Variable: TRIBMA

A table for converting the number of Trumbles in the hold into a sprite-enable flag to use with VIC register $15

Drawing the screen

Subroutine: TT66

Clear the screen and set the current view type

Drawing the screen

Subroutine: TTX66

Clear the top part of the screen and draw a border box

Elite I
-------

CategoryDetails

Tactics

Subroutine: yetanotherrts

Contains an RTS

Sound

Subroutine: ECMOF

Switch off the E.C.M.

Tactics

Subroutine: SFRMIS

Add an enemy missile to our local bubble of universe

Status

Subroutine: EXNO2

Process us making a kill

Sound

Subroutine: EXNO

Make the sound of a laser strike or ship explosion

Sound

Subroutine: BEEP

Make a short, high beep

Sound

Subroutine: EXNO3

Make an explosion sound

Sound

Subroutine: SOFLUSH

Reset the sound buffers and turn off all sound channels

Sound

Subroutine: NOISEOFF

Turn off a specific sound effect in whichever voice it is currently playing in

Sound

Subroutine: HYPNOISE

Make the sound of the hyperspace drive being engaged

Sound

Subroutine: NOISE2

Make a sound effect with a specific volume and release length

Sound

Subroutine: NOISE

Make the sound whose number is in Y

Drawing the screen

Variable: RASTCT

The current raster count, which flips between 0 and 1 on each call to the COMIRQ1 interrupt handler (0 = space view, 1 = dashboard)

Drawing the screen

Variable: zebop

The value for VIC register $18 to set the screen RAM address for a raster count of 0 in the interrupt routine (i.e. the space view)

Drawing the screen

Variable: abraxas

The value for VIC register $18 to set the screen RAM address for a raster count of 1 in the interrupt routine (i.e. the dashboard)

Drawing the screen

Variable: innersec

A table for converting the value of X from 0 to 1 or from 1 to 0, for use when flipping RASCT between 0 and 1 on each interrupt

Drawing the screen

Variable: shango

The raster lines that fire the raster interrupt, so it fires at the top of the screen (51) and the top of the dashboard (51 + 143)

Drawing the screen

Variable: moonflower

Controls the energy bomb effect by switching between multicolour and standard mode

Drawing the screen

Variable: caravanserai

Controls whether multicolour or standard bitmap mode is used for the lower part of the screen (i.e. the dashboard)

Drawing the screen

Variable: santana

Controls whether sprite 1 (the explosion sprite) is drawn in single colour or multicolour mode

Drawing the screen

Variable: lotus

The colour of the explosion sprite in the upper and lower parts of the screen

Drawing the screen

Variable: welcome

The background colour for the upper and lower parts of the screen, used by the energy bomb to flash the screen's background colour

Sound

Subroutine: SOUL3b

Check whether this is the last voice when making sound effects in the interrupt routine, and return from the interrupt if it is

Drawing the screen

Subroutine: COMIRQ1

The split screen and sound interrupt handler (the IRQ interrupt service hardware vector at $FFFE points here)

Sound

Subroutine: SOINT

Process the contents of the sound buffer and send it to the sound chip, to make sound effects as part of the interrupt routine

Sound

Subroutine: coffee

Return from the interrupt routine, for when we are making sound effects

Sound

Workspace: Sound variables

The sound buffer where the data to be sent to the sound chip is processed

Sound

Variable: SEVENS

A table for converting the value of Y to 7 * Y

Sound

Variable: SFXPR

The priority level for each sound effect

Sound

Variable: SFXCNT

The counter for each sound effect, which defines the duration of the effect in frames

Sound

Variable: SFXFQ

The frequency (SID+$5) for each sound effect

Sound

Variable: SFXCR

The voice control register (SID+$4) for each sound effect

Sound

Variable: SFXATK

The attack and decay length (SID+$5) for each sound effect

Sound

Variable: SFXSUS

The release length and sustain volume (SID+$6) for each sound effect

Sound

Variable: SFXFRCH

The frequency change to be applied to each sound effect in each frame (as a signed number)

Sound

Variable: SFXVCH

The volume change rate for each sound effect, i.e. how many frames need to pass before the sound effect's volume is reduced by one

Loader

Subroutine: COLD

Configure memory, set up interrupt handlers and configure the VIC-II, SID and CIA chips

Loader

Subroutine: NMIpissoff

Acknowledge NMI interrupts and ignore them

Elite J
-------

CategoryDetails

Loader

Subroutine: STARTUP

Set the various vectors, interrupts and timers

Tube

Subroutine: PUTBACK

Reset the OSWRCH vector in WRCHV to point to USOSWRCH

Drawing circles

Subroutine: DOHFX

Implement the #DOHFX command (update the hyperspace effect flag)

Text

Subroutine: DOCOL

Implement the #SETCOL command (set the current colour)

Save and load

Subroutine: DOSVN

Implement the #DOSVN command (update the "save in progress" flag)

Drawing pixels

Variable: TWOS

Ready-made single-pixel character row bytes for mode 4

Drawing pixels

Variable: DTWOS

An unused table of ready-made double-pixel character row bytes for the dashboard

Drawing pixels

Variable: CTWOS2

Ready-made single-pixel character row bytes for multicolour bitmap mode

Drawing lines

Variable: LIJT1

Addresses for modifying the low byte of the JMP instruction at LI71 to support the unrolled algorithm in part 3 of LOIN

Drawing lines

Variable: LIJT2

Addresses for modifying the high byte of the JMP instruction at LI71 to support the unrolled algorithm in part 3 of LOIN

Drawing lines

Variable: LIJT3

Addresses for modifying the low byte of the JMP instruction at LI72 to support the unrolled algorithm in part 3 of LOIN

Drawing lines

Variable: LIJT4

Addresses for modifying the high byte of the JMP instruction at LI72 to support the unrolled algorithm in part 3 of LOIN

Drawing lines

Variable: LIJT5

Addresses for modifying the low byte of the JMP instruction at LI91 to support the unrolled algorithm in part 4 of LOIN

Drawing lines

Variable: LIJT6

Addresses for modifying the high byte of the JMP instruction at LI91 to support the unrolled algorithm in part 4 of LOIN

Drawing lines

Variable: LIJT7

Addresses for modifying the low byte of the JMP instruction at LI92 to support the unrolled algorithm in part 4 of LOIN

Drawing lines

Variable: LIJT8

Addresses for modifying the high byte of the JMP instruction at LI92 to support the unrolled algorithm in part 4 of LOIN

Drawing lines

Subroutine: LOIN (Part 1 of 7)

Draw a line: Calculate the line gradient in the form of deltas

Drawing lines

Subroutine: LOIN (Part 2 of 7)

Draw a line: Line has a shallow gradient, step right along x-axis

Drawing lines

Subroutine: LOIN (Part 3 of 7)

Draw a shallow line going right and up or left and down

Drawing lines

Subroutine: LOIN (Part 4 of 7)

Draw a shallow line going right and down or left and up

Drawing lines

Subroutine: LOIN (Part 5 of 7)

Draw a line: Line has a steep gradient, step up along y-axis

Drawing lines

Subroutine: LOIN (Part 6 of 7)

Draw a steep line going up and left or down and right

Drawing lines

Subroutine: LOIN (Part 7 of 7)

Draw a steep line going up and right or down and left

Drawing lines

Subroutine: HLOIN

Draw a horizontal line from (X1, Y1) to (X2, Y1)

Dashboard

Subroutine: DOT

Draw a dash on the compass

Drawing pixels

Subroutine: CPIX4

Draw a double-height dot on the dashboard

Drawing pixels

Subroutine: CPIX2

Draw a single-height dash on the dashboard

Dashboard

Subroutine: ECBLB2

Start up the E.C.M. (light up the indicator, start the countdown and make the E.C.M. sound)

Dashboard

Subroutine: ECBLB

Light up the E.C.M. indicator bulb ("E") on the dashboard

Dashboard

Subroutine: SPBLB

Light up the space station indicator ("S") on the dashboard

Dashboard

Subroutine: MSBAR

Draw a specific indicator in the dashboard's missile bar

Tube

Subroutine: newosrdch

The custom OSRDCH routine for reading characters

Drawing the screen

Subroutine: WSCAN

Wait for the vertical sync

Text

Subroutine: CHPR2

Character print vector handler

Text

Subroutine: R5

Make a beep and jump back into the character-printing routine at CHPR

Drawing the screen

Subroutine: clss

Clear the screen, move the text cursor to the top-left corner and jump back into the CHPR routine to print the next character

Text

Subroutine: RR4S

A jump point that restores the registers and returns from the CHPR subroutine (so we can use a branch instruction to jump to RR4)

Text

Subroutine: TT67X

Print a newline

Text

Subroutine: CHPR

Print a character at the text cursor by poking into screen memory

Drawing the screen

Subroutine: TTX66K

Clear the whole screen or just the space view (as appropriate), draw a border box, and if required, show the dashboard

Drawing the screen

Subroutine: BOX2

Draw the left and right edges of the border box for the space view

Drawing the screen

Subroutine: BOXS

Draw a horizontal line across the screen at pixel y-coordinate X

Drawing the screen

Subroutine: BOXS2

Draw a vertical line for the left or right border box edge

Drawing the screen

Subroutine: wantdials

Show the dashboard on-screen

Drawing the screen

Subroutine: zonkscanners

Hide all ships on the scanner

Drawing the screen

Subroutine: BLUEBAND

Clear two four-character borders along each side of the space view

Drawing the screen

Subroutine: BLUEBANDS

Clear a four-character border along one side of the space view

Drawing the screen

Subroutine: TT66simp

Clear the whole screen inside the border box, and move the text cursor to the top-left corner

Utility routines

Subroutine: ZES1k

Zero-fill the page whose number is in X

Utility routines

Subroutine: ZES2k

Zero-fill a specific page

Utility routines

Subroutine: ZESNEW

Zero-fill memory from SC(1 0) to the end of the page

Text

Subroutine: SETXC

An unused routine to move the text cursor to a specific column

Text

Subroutine: SETYC

An unused routine to move the text cursor to a specific row

Utility routines

Subroutine: mvblockK

Copy a specific number of pages in memory

Drawing the screen

Subroutine: CLYNS

Clear the bottom three text rows of the space view

Dashboard

Subroutine: SCAN

Display the current ship on the scanner

Elite K
-------

CategoryDetails

Sound

Workspace: Music variables

Variables that are used by the music player

Sound

Subroutine: BDirqhere

The interrupt routine for playing background music

Sound

Subroutine: BDRO1

Process music command <#1 fh1 fl1> to set the frequency for voice 1 to (fh1 fl1) and the control register for voice 1 to value1

Sound

Subroutine: BDRO2

Process music command <#2 fh1 fl1> to set the frequency for voice 2 to (fh2 fl2) and the control register for voice 2 to value2

Sound

Subroutine: BDRO3

Process music command <#3 fh1 fl1> to set the frequency for voice 3 to (fh3 fl3) and the control register for voice 3 to value3

Sound

Subroutine: BDRO4

Process music command <#4 fh1 fl1 fh2 fl2> to set the frequencies and voice control registers for voices 1 and 2

Sound

Subroutine: BDRO5

Process music command <#5 fh1 fl1 fh2 fl2 fh3 fl3> to set the frequencies and voice control registers for voices 1, 2 and 3

Sound

Subroutine: BDRO6

Process music command <#6> to increment value0 and move on to the next nibble of music data

Sound

Subroutine: BDRO15

Process music command <#15> to rest for 2 * value4 interrupts

Sound

Subroutine: BDRO8

Process music command <#8> to rest for value4 interrupts

Sound

Subroutine: BDRO7

Process music command <#7 ad1 ad2 ad3 sr1 sr2 sr3> to set three voices' attack and decay length, sustain volume and release length

Sound

Subroutine: BDRO9

Process music command <#9> to restart the current tune

Sound

Subroutine: BDRO10

Process music command <#10 h1 l1 h2 l2 h3 l3> to set the pulse width to all three voices

Sound

Subroutine: BDRO11

Process music command <#11>, which does the same as command <#9> and restarts the current tune

Sound

Subroutine: BDRO12

Process music command <#12 n> to set value4 = n, which sets the rest length for commands #8 and #15

Sound

Subroutine: BDRO13

Process music command <#13 v1 v2 v3> to set value1, value2, value3 to the voice control register values for commands <#1> to <#3>

Sound

Subroutine: BDRO14

Process music command <#14 vf fc cf> to set the volume and filter modes, filter control and filter cut-off frequency

Sound

Subroutine: BDlab4

Set the voice control register for voice 1 to value1

Sound

Subroutine: BDlab6

Set the voice control register for voice 2 to value2

Sound

Subroutine: BDlab8

Set the voice control register for voice 3 to value3

Sound

Subroutine: BDlab19

Increment the music data pointer in BDdataptr1(1 0) and fetch the next data byte into A

Sound

Subroutine: BDlab3

Fetch the next two music data bytes and set the frequency of voice 1 (high byte then low byte)

Sound

Subroutine: BDlab5

Fetch the next two music data bytes and set the frequency of voice 2 (high byte then low byte) and the vibrato variables

Sound

Subroutine: BDlab7

Fetch the next two music data bytes and set the frequency of voice 3 (high byte then low byte) and the vibrato variables

Sound

Subroutine: BDENTRY

Start playing a new tune as background music

Sound

Subroutine: BDlab24

Apply a vibrato frequency change to voice 2

Sound

Subroutine: BDlab23

Apply a vibrato frequency change to voice 3

Sound

Subroutine: BDlab1

Apply vibrato before cleaning up and returning from the interrupt routine

Sound

Subroutine: BDlab21

Clean up and return from the interrupt routine

Sound

Variable: BDJMPTBL

A jump table containing addresses for processing music commands 1 through 15 (low bytes)

Sound

Variable: BDJMPTBH

A jump table containing addresses for processing music commands 1 through 15 (high bytes)

Sound

Variable: COMUDAT

Music data from the C.COMUDAT file

Utility routines

Variable: F%

Denotes the end of the main game code, from ELITE A to ELITE K

Game data
---------

CategoryDetails

Text

Macro: CHAR (Game data)

Macro definition for characters in the recursive token table

Text

Macro: TWOK (Game data)

Macro definition for two-letter tokens in the token table

Text

Macro: CONT (Game data)

Macro definition for control codes in the recursive token table

Text

Macro: RTOK (Game data)

Macro definition for recursive tokens in the recursive token table

Text

Variable: QQ18 (Game data)

The recursive token table for tokens 0-148

Maths (Geometry)

Variable: SNE (Game data)

Sine/cosine table

Maths (Geometry)

Variable: ACT (Game data)

Arctan table

Text

Macro: EJMP (Game data)

Macro definition for jump tokens in the extended token table

Text

Macro: ECHR (Game data)

Macro definition for characters in the extended token table

Text

Macro: ETOK (Game data)

Macro definition for recursive tokens in the extended token table

Text

Macro: ETWO (Game data)

Macro definition for two-letter tokens in the extended token table

Text

Macro: ERND (Game data)

Macro definition for random tokens in the extended token table

Text

Macro: TOKN (Game data)

Macro definition for standard tokens in the extended token table

Text

Variable: TKN1 (Game data)

The first extended token table for recursive tokens 0-255 (DETOK)

Text

Variable: RUPLA (Game data)

System numbers that have extended description overrides

Text

Variable: RUGAL (Game data)

The criteria for systems with extended description overrides

Text

Variable: RUTOK (Game data)

The second extended token table for recursive tokens 0-26 (DETOK3)

Drawing ships

Variable: XX21 (Game data)

Ship blueprints lookup table

Drawing ships

Variable: E% (Game data)

Ship blueprints default NEWB flags

Status

Variable: KWL% (Game data)

Fractional number of kills awarded for destroying each type of ship

Status

Variable: KWH% (Game data)

Integer number of kills awarded for destroying each type of ship

Drawing ships

Macro: VERTEX (Game data)

Macro definition for adding vertices to ship blueprints

Drawing ships

Macro: EDGE (Game data)

Macro definition for adding edges to ship blueprints

Drawing ships

Macro: FACE (Game data)

Macro definition for adding faces to ship blueprints

Drawing ships

Variable: SHIP_MISSILE (Game data)

Ship blueprint for a missile

Drawing ships

Variable: SHIP_CORIOLIS (Game data)

Ship blueprint for a Coriolis space station

Drawing ships

Variable: SHIP_ESCAPE_POD (Game data)

Ship blueprint for an escape pod

Drawing ships

Variable: SHIP_PLATE (Game data)

Ship blueprint for an alloy plate

Drawing ships

Variable: SHIP_CANISTER (Game data)

Ship blueprint for a cargo canister

Drawing ships

Variable: SHIP_BOULDER (Game data)

Ship blueprint for a boulder

Drawing ships

Variable: SHIP_ASTEROID (Game data)

Ship blueprint for an asteroid

Drawing ships

Variable: SHIP_SPLINTER (Game data)

Ship blueprint for a splinter

Drawing ships

Variable: SHIP_SHUTTLE (Game data)

Ship blueprint for a Shuttle

Drawing ships

Variable: SHIP_TRANSPORTER (Game data)

Ship blueprint for a Transporter

Drawing ships

Variable: SHIP_COBRA_MK_3 (Game data)

Ship blueprint for a Cobra Mk III

Drawing ships

Variable: SHIP_PYTHON (Game data)

Ship blueprint for a Python

Drawing ships

Variable: SHIP_BOA (Game data)

Ship blueprint for a Boa

Drawing ships

Variable: SHIP_ANACONDA (Game data)

Ship blueprint for an Anaconda

Drawing ships

Variable: SHIP_ROCK_HERMIT (Game data)

Ship blueprint for a rock hermit (asteroid)

Drawing ships

Variable: SHIP_VIPER (Game data)

Ship blueprint for a Viper

Drawing ships

Variable: SHIP_SIDEWINDER (Game data)

Ship blueprint for a Sidewinder

Drawing ships

Variable: SHIP_MAMBA (Game data)

Ship blueprint for a Mamba

Drawing ships

Variable: SHIP_KRAIT (Game data)

Ship blueprint for a Krait

Drawing ships

Variable: SHIP_ADDER (Game data)

Ship blueprint for an Adder

Drawing ships

Variable: SHIP_GECKO (Game data)

Ship blueprint for a Gecko

Drawing ships

Variable: SHIP_COBRA_MK_1 (Game data)

Ship blueprint for a Cobra Mk I

Drawing ships

Variable: SHIP_WORM (Game data)

Ship blueprint for a Worm

Drawing ships

Variable: SHIP_COBRA_MK_3_P (Game data)

Ship blueprint for a Cobra Mk III (pirate)

Drawing ships

Variable: SHIP_ASP_MK_2 (Game data)

Ship blueprint for an Asp Mk II

Drawing ships

Variable: SHIP_PYTHON_P (Game data)

Ship blueprint for a Python (pirate)

Drawing ships

Variable: SHIP_FER_DE_LANCE (Game data)

Ship blueprint for a Fer-de-Lance

Drawing ships

Variable: SHIP_MORAY (Game data)

Ship blueprint for a Moray

Drawing ships

Variable: SHIP_THARGOID (Game data)

Ship blueprint for a Thargoid mothership

Drawing ships

Variable: SHIP_THARGON (Game data)

Ship blueprint for a Thargon

Drawing ships

Variable: SHIP_CONSTRICTOR (Game data)

Ship blueprint for a Constrictor

Drawing ships

Variable: SHIP_COUGAR (Game data)

Ship blueprint for a Cougar

Drawing ships

Variable: SHIP_DODO (Game data)

Ship blueprint for a Dodecahedron ("Dodo") space station

Sprites
-------

CategoryDetails

Sprites

Macro: SPRITE2 (Sprites)

Macro definition for a two-colour sprite pixel row

Sprites

Macro: SPRITE2_BYTE (Sprites)

Macro definition for a two-colour sprite pixel byte

Sprites

Macro: SPRITE4 (Sprites)

Macro definition for a four-colour sprite pixel row

Sprites

Macro: SPRITE4_BYTE (Sprites)

Macro definition for a four-colour sprite pixel byte

Sprites

Variable: spritp (Sprites)

Sprite definitions for four laser sights, the explosion sprite and two Trumbles