This page contains a map of all the routines, variables and macros in the Apple II version of Elite. The source files are structured like this:
- The Loader, which loads the game data, game binaries and loading screen
- The main game source, which consists of Workspaces, Elite A, Elite B, Elite C, Elite D, Elite E, Elite F, Elite G, Elite H, Elite I, Elite J and Elite K
- The Game data source, which contains game images, ship blueprints and text tokens
- The Big Code File, which concatenates the files produced by the above (but which doesn't contain any code, so there is no entry below)
- The Transfer program, which wraps the game binaries up for serial transfer to an Apple II or loading from disk
You can click on the links above to jump to the relevant part of the map.
Loader
------
Category | Details |
---|---|
Workspaces | Important variables used by the loader |
Workspaces | Workspace: Disk operations workspace 1 (Loader) Variables used by the disk operations and DOS 3.3 RWTS routines |
Workspaces | Workspace: Disk operations workspace 2 (Loader) Variables used by the disk operations and DOS 3.3 RWTS routines |
Loader | Subroutine: Elite loader (Loader) Load the SCRN and ELB1 binaries and run the game |
Save and load | The filename of the second file to load |
Save and load | The filename of the first file to load, padded out with spaces to a fixed size of 30 characters for the rfile routine |
Save and load | Search the disk catalog for an existing file |
Save and load | Search the disk catalog for an existing file or an empty file entry |
Save and load | Analyse the VTOC sector to allocate one free sector |
Save and load | Read a file's track/sector list |
Save and load | Read the VTOC sector into the buffer |
Save and load | Read a specific sector from disk into the buffer |
Save and load | Write a specific sector from the buffer to disk |
Save and load | Read or write a specific sector |
Save and load | Try finding a specific track on the disk |
Save and load | Check that this is the correct track |
Save and load | Return from the RWTS code with a "Disk I/O error" |
Save and load | Read or write a sector on the current track |
Save and load | Successfully return from the RWTS code with no error reported |
Save and load | Read a sector's worth of data into the buffr2 buffer |
Save and load | Write a sector's worth of data from the buffr2 buffer to the current track and sector |
Save and load | Read a track address field |
Save and load | Fast seek routine |
Save and load | Implement the arm move delay |
Save and load | Phase-on time table in 100-usec intervals |
Save and load | Phase-off time table in 100-usec intervals |
Save and load | Convert 256 8-bit bytes in buffer into 342 6-bit nibbles in buffr2 |
Save and load | Convert 342 6-bit nibbles in buffr2 into 256 8-bit bytes in buffer |
Save and load | Write one byte to disk |
Save and load | Lookup table to translate logical (requested) sector number to physical sector number |
Save and load | 64 disk nibbles of "6-and-2" Read Translate Table |
Loader | Load a multi-sector file |
Loader | Subroutine: CopyTrackSector (Loader) Copy the track/sector list from the disk buffer to trackSector |
Loader | Subroutine: DecrementFileSize (Loader) Decrement the file size in fileSize(1 0) by 1 |
Loader | Subroutine: SetLoadVariables2 (Loader) Configure the file load variables for loading the ELB1 file |
Loader | Subroutine: SetLoadVariables1 (Loader) Configure the file load variables for loading the SCRN file |
Loader | Subroutine: SetFilename (Loader) Set the filename in comnam to ELB1 |
Loader | Subroutine: AllowJoystick (Loader) An unused routine to check the joysticks and configure the title screen to check for the joystick fire button |
Loader | The file size of the file we are loading |
Loader | The number of bytes to skip at the start of the file that we are loading |
Loader | The index of the current entry in the track/sector list, as we work our way through the list |
Loader | Variable: trackSector (Loader) The track/sector list for the file we are loading |
Loader | Subroutine: CopyCode2 (Loader) Copy CODE2 from $4000-$6FFF to $9000-$BFFF |
Workspaces
----------
Category | Details |
---|---|
Workspaces | Lots of important variables are stored in the zero page workspace as it is quicker and more space-efficient to access memory here |
Workspaces | Temporary storage space for complex calculations |
Workspaces | Ship data blocks and ship line heaps |
Workspaces | Workspace: Disk operations workspace Variables used by the disk operations and DOS 3.3 RWTS routines |
Workspaces | Configuration variables |
Workspaces | Variables |
Elite A
-------
Category | Details |
---|---|
Loader | An entry point at the start of the game binary |
Maths (Arithmetic) | Binary logarithm table (high byte) |
Maths (Arithmetic) | Binary logarithm table (low byte) |
Maths (Arithmetic) | Binary antilogarithm table |
Drawing the screen | Lookup table for converting a pixel x-coordinate to the bit number within the pixel row byte that corresponds to this pixel |
Drawing the screen | Lookup table for converting a pixel x-coordinate to the byte number in the pixel row that corresponds to this pixel |
Save and load | 6-bit to 7-bit nibble conversion table |
Workspaces | Variables that are predominantly used to store the game options |
Keyboard | The keys used to toggle configuration settings when the game is paused |
Loader | Checksum, decrypt and unscramble the main game code, and start the game |
Utility routines | Unscramble the main code |
Utility routines | Decrypt a multi-page block of memory |
Utility routines | Denotes the start of the main game code, from ELITE A to ELITE K |
Flight | Dock at the space station and work out any mission progression |
Save and load | Set the standard BRKV handler for the game |
Missions | The low byte of the four 16-bit directions in which Trumble sprites can move |
Missions | The high byte of the four 16-bit directions in which Trumble sprites can move |
Missions | Masks for updating sprite bits in VIC+$10 for the top bit of the 9-bit x-coordinates of the Trumble sprites |
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 | Randomly spawn cargo from a destroyed ship |
Drawing lines | Draw the zig-zag lightning bolt for the energy bomb |
Drawing lines | 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 |
Drawing lines | Randomise and draw the energy bomb's zig-zag lightning bolt lines |
Drawing lines | A set of x-coordinates that are used as the basis for the energy bomb's zig-zag lightning bolt |
Drawing lines | This is where we store the x-coordinates for the energy bomb's zig-zag lightning bolt |
Drawing lines | This is where we store the y-coordinates for the energy bomb's zig-zag lightning bolt |
Text | Print the captain's name during mission briefings |
Text | Print the location hint during the mission 1 briefing |
Text | Print an extended recursive token from the RUTOK token table |
Text | Print an extended recursive token from the TKN1 token table |
Text | Print an extended text token (1-255) |
Text | Switch to ALL CAPS when printing extended tokens |
Text | Switch to Sentence Case when printing extended tokens |
Text | Tab to column 6 and start a new word when printing extended tokens |
Text | Clear the screen and set the current view type to 1 |
Text | Switch to lower case when printing extended tokens |
Text | Switch to standard tokens in Sentence Case |
Text | Switch to extended tokens |
Text | Switch to justified text when printing extended tokens |
Text | Switch to left-aligned text when printing extended tokens |
Text | Print the selected system's adjective, e.g. Lavian for Lave |
Text | Print a random 1-8 letter word in Sentence Case |
Text | Capitalise the next letter |
Text | Test whether a character is a vowel |
Text | Switch to white text |
Text | The extended token table for jump tokens 1-32 (DETOK) |
Text | The extended two-letter token lookup table |
Text | The two-letter token lookup table |
Save and load | The data block for the last saved commander |
Save and load | Second checksum byte for the saved commander data file |
Save and load | Third checksum byte for the saved commander data file |
Save and load | First checksum byte for the saved commander data file |
Save and load | The drive and directory number used when saving or loading a commander file |
Save and load | The data block for the default commander |
Drawing ships | Ship colours on the scanner |
Elite B
-------
Category | Details |
---|---|
Universe | Table of pointers to the local universe's ship data blocks |
Drawing lines | Draw a line of dashes underneath a title on the text screen |
Keyboard | Flush the keyboard buffer |
Drawing lines | Print a title and draw a horizontal line at row 19 to box it in |
Drawing lines | Draw a horizontal line at pixel row 19 to box in a title |
Drawing lines | Draw a horizontal line at pixel row 23 to box in a title |
Drawing lines | Draw a screen-wide horizontal line at the pixel row in A |
Drawing lines | Remove a line from the sun line heap and draw it on-screen |
Maths (Arithmetic) | Calculate (YY+1 SYL+Y) = (A P) + (S R) and draw stardust particle |
Drawing pixels | Draw a stardust particle relative to the screen centre |
Drawing pixels | Draw a two-pixel dash, three-pixel dash or double-height three-pixel dash |
Drawing pixels | Ready-made two-pixel and three-pixel bytes in white, with an extra byte to cater for overflow into the next pixel byte |
Drawing circles | Draw a circle segment and add it to the ball line heap |
Stardust | Reflect the stardust particles in the screen diagonal and redraw the stardust field |
Stardust | The main routine for processing the stardust |
Stardust | Process the stardust for the front view |
Stardust | Process the stardust for the rear view |
Maths (Geometry) | Add an orientation vector coordinate to an INWK coordinate |
Maths (Geometry) | Calculate a cap on the maximum distance to the planet or sun |
Maths (Arithmetic) | Calculate A = x_hi^2 + y_hi^2 + z_hi^2 in the K% block |
Status | Show the Status Mode screen |
Text | Print text followed by a newline and indent of 6 characters |
Moving | Calculate K(3 2 1) = (x_sign x_hi x_lo) + K(3 2 1) |
Moving | Apply a 3.6 degree pitch or roll to an orientation vector |
Text | A constant used when printing large numbers in BPRNT |
Text | Print an 8-bit number, left-padded to 3 digits, and optional point |
Text | Print a 16-bit number, left-padded to n digits, and optional point |
Text | Print a 32-bit number, left-padded to a specific number of digits, with an optional decimal point |
Text | A mask for applying the lower case part of Sentence Case to extended text tokens |
Text | A flag that indicates whether we are currently printing a word |
Text | A flag for switching between standard and extended text tokens |
Text | Flags that govern how justified extended text tokens are printed |
Text | The size of the justified text buffer at BUF |
Text | A flag to denote whether printing in lower case is enabled for extended text tokens |
Text | A mask for capitalising the next letter in an extended text token |
Text | Print a newline |
Text | Print the character in variable DTW7 |
Text | Print a character at the text cursor, with support for verified text in extended tokens |
Sound | 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 | Update a bar-based indicator on the dashboard |
Dashboard | Update the roll or pitch indicator on the dashboard |
Dashboard | The screen y-coordinate of the top-left corner of each indicator |
Dashboard | The threshold value for each indicator that defines low and high values, and therefore the low and high colours for the indicator |
Dashboard | The colour for each indicator for values that are below the threshold in dialle |
Dashboard | The colour for each indicator for values that are on or above the threshold in dialle |
Flight | Launch our escape pod |
Charts | Search the galaxy for a system |
Elite C
-------
Category | Details |
---|---|
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 | Apply docking manoeuvres to the ship in INWK |
Maths (Arithmetic) | Calculate vector K3(8 0) = [x y z] - coordinates of the sun or space station |
Maths (Arithmetic) | Calculate vector K3(8 0) = [x y z] - coordinates in (A V) |
Maths (Arithmetic) | Calculate K3 = (x_sign x_hi x_lo) - V(1 0) |
Maths (Geometry) | Calculate the dot product of XX15 and one of the space station's orientation vectors |
Maths (Geometry) | Negate the vector in XX15 so it points in the opposite direction |
Flight | Calculate the vector from the ideal docking position to the ship |
Tactics | Work out if the ship in INWK is in our crosshairs |
Tactics | Launch a ship straight ahead of us, below the laser sights |
Tactics | Fire a missile from our ship |
Tactics | Make a ship hostile |
Tactics | Display the "missile jammed" message |
Flight | Spawn an escape pod from the current (parent) ship |
Universe | Spawn a child ship from the current (parent) ship |
Moving | Move a ship in space along one of the coordinate axes |
Drawing circles | Make the hyperspace sound and draw the hyperspace tunnel |
Drawing circles | Make the launch sound and draw the launch tunnel |
Drawing circles | Draw the launch or hyperspace tunnel |
Stardust | Process the stardust for the left or right view |
Maths (Arithmetic) | Set K(3 2 1 0) = (A A A A) and clear the C flag |
Maths (Arithmetic) | Calculate K(3 2 1 0) = (A P+1 P) * Q |
Maths (Arithmetic) | Calculate (S R) = XX(1 0) and (A P) = A * ALP1 |
Maths (Arithmetic) | Calculate (A P) = ALP1 * A |
Maths (Arithmetic) | Set P(1 0) = (A A) |
Maths (Arithmetic) | Clear bit 7 of A and calculate (A P) = A * A |
Maths (Arithmetic) | Calculate (A P) = A * A |
Maths (Arithmetic) | Copy X into P and A, and clear the C flag |
Maths (Arithmetic) | Calculate Y1 = y_hi and (A P) = |y_hi| * Q for Y-th stardust |
Maths (Arithmetic) | Calculate (A P) = |A| * Q |
Maths (Arithmetic) | Calculate (A P) = P * Q |
Maths (Arithmetic) | Calculate (A P) = P * X |
Maths (Arithmetic) | Calculate A = K * sin(A) |
Maths (Arithmetic) | Calculate A = A * Q / 256 |
Maths (Arithmetic) | Calculate (A P+1 P) = (A ~P) * Q |
Maths (Arithmetic) | An unused routine that does the same as MUT2 |
Maths (Arithmetic) | Calculate (S R) = XX(1 0) and (A P) = Q * A |
Maths (Arithmetic) | Calculate R = XX and (A P) = Q * A |
Maths (Arithmetic) | Calculate (A P) = Q * A |
Maths (Arithmetic) | Calculate (S R) = Q * A |
Maths (Geometry) | Calculate the dot product of XX15 and an orientation vector |
Maths (Arithmetic) | Calculate (A X) = Q * A + (S R) |
Maths (Arithmetic) | Calculate (A X) = (A P) + (S R) |
Maths (Arithmetic) | Calculate (A ?) = (-X * A + (S R)) / 96 |
Maths (Arithmetic) | Calculate (P R) = 256 * DELTA / z_hi |
Maths (Arithmetic) | Calculate (P R) = 256 * DELTA / A |
Maths (Arithmetic) | Calculate (P R) = 256 * A / Q |
Maths (Arithmetic) | Calculate K(3 2 1 0) = (A P+1 P) / (z_sign z_hi z_lo) |
Dashboard | Apply damping to the pitch or roll dashboard indicator |
Dashboard | Bump up the value of the pitch or roll dashboard indicator |
Dashboard | Reduce the value of the pitch or roll dashboard indicator |
Drawing lines | Draw the laser lines for when we fire our lasers |
Universe | Print the system's extended description or a mission 1 directive |
Missions | Start mission 2 |
Missions | Print an extended token and show the Status Mode screen |
Missions | Receive the briefing and plans for mission 2 |
Missions | Finish mission 2 |
Missions | Finish mission 1 |
Missions | Start mission 3 |
Missions | Start mission 1 and show the mission briefing |
Missions | Clear the screen, display "INCOMING MESSAGE" and wait for 2 seconds |
Missions | Wait until a key is pressed for the Constrictor mission briefing and then clear the text view to show the briefing text |
Missions | Change to the text view for the Constrictor mission briefing |
Text | Move to row 9 and switch to lower case when printing extended tokens |
Text | Move to row 5 and switch to lower case when printing extended tokens |
Keyboard | Wait until a key is pressed, ignoring any existing key press |
Universe | Fetch the address of a ship's data block into INF |
Universe | Set the selected system to the current system |
Utility routines | Wait for a specified time, measured in loop iterations |
Text | Lookup table for random tokens in the extended token table (0-37) |
Elite D
-------
Category | Details |
---|---|
Maths (Geometry) | Scale the y-coordinate in A to 0.375 * A |
Maths (Geometry) | Scale the y-coordinate in A to 0.75 * A |
Maths (Geometry) | Scale the x-coordinate in A to 32 + 0.75 * A |
Drawing lines | Draw a vertical line from (A, GCYT) to (A, GCYB) |
Market | Work out if we have space for one tonne of cargo |
Market | Work out if we have space for a specific amount of cargo |
Text | Move the text cursor to a specific column |
Text | Move the text cursor to a specific row |
Text | Move the text cursor to the next row |
Drawing the screen | Clear the screen and set up a trading screen |
Universe | Twist the selected system's seeds four times |
Universe | Twist the selected system's seeds |
Universe | Print the distance to the selected system in light years |
Text | Print a text token and a paragraph break |
Text | Print a paragraph break |
Text | Set Sentence Case and print a newline |
Text | Print a newline |
Universe | Display "MAINLY " and jump to TT72 |
Text | Print a text token followed by a space |
Universe | Show the Data on System screen |
Universe | Calculate system data from the system seeds |
Charts | Show the Long-range Chart |
Drawing lines | Draw a set of crosshairs |
Drawing circles | Draw a circle with crosshairs on a chart |
Drawing circles | Draw a circle on a chart |
Market | Show the Buy Cargo screen |
Market | Get a number from the keyboard |
Market | Print an "ITEM?" error, make a beep and rejoin the TT210 routine |
Market | Show the Sell Cargo screen |
Market | Show a list of current cargo in our hold, optionally to sell |
Market | Show the Inventory screen |
Keyboard | Ask a question with a "Y/N?" prompt and return the response |
Charts | Move the crosshairs on a chart |
Charts | Draw a small set of crosshairs on a chart |
Charts | Move galactic coordinates by a signed delta |
Charts | Draw crosshairs on the Short-range Chart, with clipping |
Charts | Show the Short-range Chart |
Universe | Set the selected system's seeds to those of system 0 |
Universe | Set the current system to the nearest system to a point |
Flight | Print a message to say there is no hyperspacing allowed inside the station |
Flight | Start the hyperspace process |
Flight | Start a hyperspace countdown |
Flight | Set the current system to the nearest system and return to hyp |
Flight | Perform a galactic hyperspace jump |
Universe | Set the current system to the selected system |
Flight | Print the hyperspace countdown in the top-left of the screen |
Text | Print 16-bit number, left-padded to 5 digits, no point |
Text | Print a 16-bit number, left-padded to 5 digits, and optional point |
Flight | Print an error when a system is out of hyperspace range |
Text | Print a text token followed by a question mark |
Market | Print the name, price and availability of a market item |
Market | Print the unit ("t", "kg" or "g") for a market item |
Text | Print a space |
Market | Print "t" (for tonne) and a space |
Market | Print "kg" (for kilograms) |
Market | Print "g" (for grams) |
Market | Print the headers for the table of market prices |
Market | Show the Market Price screen |
Market | Calculate QQ19+3 = economy * |economic_factor| |
Universe | Process a jump to the system closest to (QQ9, QQ10) |
Universe | Calculate the availability of market items |
Universe | Spawn a Thargoid ship and a Thargon companion |
Flight | Process a mis-jump into witchspace |
Flight | Try to initiate a jump into hyperspace |
Flight | Launch from a station or show the front space view |
Charts | Display either the Long-range or Short-range Chart |
Maths (Arithmetic) | Subtract an amount of cash from the cash pot |
Maths (Arithmetic) | Add an amount of cash to the cash pot |
Maths (Arithmetic) | Calculate (Y X) = P * Q * 4 |
Maths (Arithmetic) | Calculate (Y X) = (A P) * 4 |
Equipment | Show the Equip Ship screen |
Market | Print the amount of money we have left in the cash pot, then make a short, high beep and delay for 1 second |
Text | Make a low, long beep and delay for 0.5 seconds |
Equipment | Subtract the price of equipment from the cash pot |
Equipment | Return the price of a piece of equipment |
Equipment | Print a menu of the four space views, for buying lasers |
Charts | Select the closest system and redraw the chart crosshairs |
Equipment | Install a new laser, processing a refund if applicable |
Equipment | Equipment prices |
Elite E
-------
Category | Details |
---|---|
Universe | Print the selected system name |
Status | Print the commander's name |
Universe | Print the current system name |
Universe | Print the current galaxy number |
Status | Print fuel and cash levels |
Status | Print the current amount of cash |
Text | Print a text token followed by a newline |
Text | Print a text token followed by a colon |
Text | Print a colon |
Text | Print a text token |
Text | Print a letter in lower case |
Text | Print a letter according to Sentence Case |
Text | Print a recursive token in the range 128-145 |
Text | Tab to column 21 and print a colon |
Text | Print a letter in lower case |
Text | Print a character and switch to capitals |
Text | Print a character |
Text | Print a two-letter token or recursive token 0-95 |
Text | Print a recursive token |
Utility routines | An unused routine that swaps bytes in and out of zero page |
Drawing ships | Draw an exploding ship |
Drawing ships | A table to shift X left by one place when X is 0 or 1 |
Universe | Update the missile indicators, set up the planet data block |
Universe | Set up various aspects of arriving in a new system |
Stardust | Initialise the stardust field |
Stardust | Create a random cloud of stardust |
Dashboard | Clear the scanner, reset the ball line and sun line heaps |
Drawing suns | Reset the sun line heap |
Drawing the screen | Show or hide the dashboard (for when we die) |
Flight | Charge a shield and drain some energy from the energy banks |
Flight | Drain some energy from the energy banks |
Dashboard | Update the compass |
Maths (Arithmetic) | Calculate (Y X) = A / 10 |
Maths (Geometry) | Calculate the vector to the space station |
Dashboard | Draw the space station on the compass |
Dashboard | Draw a dot on the compass, given the planet/station vector |
Dashboard | Draw a dash on the compass |
Flight | Take some damage |
Maths (Geometry) | Copy a space coordinate from the K% block into K3 |
Universe | Add a new space station to our local bubble of universe |
Universe | Add a new ship to our local bubble of universe |
Universe | Flip the sign and double an INWK byte |
Dashboard | Disarm missiles and update the dashboard indicators |
Dashboard | Set/unset the lock target for a missile and update the dashboard |
Maths (Geometry) | Project the current ship or planet onto the screen |
Drawing planets | Remove the planet or sun from the screen |
Drawing planets | Draw the planet or sun |
Drawing planets | Draw the planet as a plain circle |
Drawing suns | Draw the sun: Set up all the variables needed to draw the sun |
Drawing suns | Draw the sun: Start from the bottom of the screen and erase the old sun line by line |
Drawing suns | Draw the sun: Continue to move up the screen, drawing the new sun line by line |
Drawing suns | Draw the sun: Continue to the top of the screen, erasing the old sun line by line |
Drawing circles | Draw a circle for the planet |
Drawing circles | Draw a circle (for the planet or chart) |
Drawing planets | Remove the planet from the screen |
Drawing planets | Reset the ball line heap |
Drawing suns | Remove the sun from the screen |
Drawing lines | Draw a horizontal line given a centre and a half-width |
Drawing circles | Check whether any part of a circle appears on the extended screen |
Drawing planets | Return from a planet/sun-drawing routine with a failure flag |
Drawing planets | Calculate (X K) = (A P+1 P) / (z_sign z_hi z_lo) |
Keyboard | Wait until either "Y" or "N" is pressed |
Keyboard | Scan the keyboard for cursor key or joystick movement |
Elite F
-------
Category | Details |
---|---|
Universe | Set the SLSP ship line heap pointer after shuffling ship slots |
Universe | Remove the current ship from our local bubble of universe |
Universe | Remove the space station and replace it with the sun |
Universe | Check the local bubble for missiles with target lock |
Universe | Remove a ship from our local bubble of universe |
Missions | Check whether we are in the Constrictor's system in mission 1 |
Start and end | Reset most variables |
Start and end | Reset a number of flight variables and workspaces |
Universe | Reset the INWK workspace and orientation vectors |
Dashboard | Display the dashboard's missile indicators in green |
Flight | Remove an in-flight message from the space view |
Universe | Initialise the INWK workspace to a hostile ship |
Maths (Arithmetic) | 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 | Process number key, save key, hyperspace and chart key presses and update the hyperspace counter |
Status | Calculate how bad we have been |
Maths (Geometry) | Compare x_hi, y_hi and z_hi with 224 |
Maths (Geometry) | Compare x_hi, y_hi and z_hi with A |
Maths (Geometry) | Calculate a cap on the maximum distance to a ship |
Utility routines | A flag that indicates whether a system error has occurred |
Utility routines | The standard BRKV handler for the game |
Start and end | Display the death screen |
Universe | Contains the address of the Coriolis space station's ship blueprint |
Loader | Initialise the configuration variables and start the game |
Start and end | Main entry point for the Elite game code |
Start and end | Reset most of the game and restart from the title screen |
Start and end | Show the "Load New Commander (Y/N)?" screen and start the game |
Start and end | Show the "Press Fire or Space, Commander" screen and start the game |
Status | Go to the docking bay (i.e. show the Status Mode screen) |
Start and end | Reset the current commander data block to the last saved commander |
Start and end | Display a title screen with a rotating ship and prompt |
Save and load | Calculate the checksum for the last saved commander data block |
Save and load | Calculate the third checksum for the last saved commander data block (Commodore 64 and Apple II versions only) |
Save and load | Restore the default JAMESON commander |
Save and load | Copy the last saved commander's name from INWK+5 to comnam and pad out the rest of comnam with spaces, so we can use it as a filename |
Save and load | Copy the last saved commander's name from INWK to NA% |
Save and load | Copy the last saved commander's name from NA% to INWK |
Save and load | Fetch the name of a commander file to save or load |
Text | Fetch a line of text from the keyboard |
Text | The OSWORD configuration block used to fetch a line of text from the keyboard |
Save and load | Display the currently selected media (disk or tape) |
Save and load | Display the non-selected media (disk or tape) |
Utility routines | Reset the local bubble of universe and ship status |
Utility routines | Zero-fill pages $B and $C |
Utility routines | Zero-fill the page whose number is in X |
Utility routines | Zero-fill a specific page |
Save and load | Display the disk access menu and process saving of commander files |
Save and load | Print a disk error, make a beep and wait for a key press |
Save and load | Contains the length of the most recently entered commander name |
Save and load | Contains the length of the last saved commander name |
Save and load | Load a commander file |
Save and load | The error message for when a disk is write protected |
Save and load | The error message for when a disk is full |
Save and load | The error message for when a disk catalog is full |
Save and load | The error message for when there is a disk I/O error |
Save and load | The error message for when a file is not found |
Save and load | A lookup table for the five disk error messages |
Utility routines | Disable the keyboard, set the SVN flag to 0, and return with A = 0 |
Utility routines | Delay by iterating through 5 * 256 (1280) empty loops |
Keyboard | Clear the key logger |
Maths (Geometry) | Calculate the vector to the planet and store it in XX15 |
Maths (Geometry) | Normalise the three-coordinate vector in K3 |
Maths (Geometry) | Normalise the three-coordinate vector in XX15 |
Keyboard | Scan one axis of the joystick and return its position |
Keyboard | Scan the keyboard for key presses and the joystick, and update the key logger |
Flight | Perform an in-system jump |
Keyboard | Lookup table for in-flight keyboard controls |
Keyboard | Scan the keyboard to detect whether any key is being pressed |
Keyboard | Read the joystick position |
Keyboard | Toggle a configuration setting and emit a beep |
Keyboard | Clear the key logger |
Keyboard | Scan for the seven primary flight controls and apply the docking computer manoeuvring code |
Keyboard | Scan for pause, configuration and secondary flight keys |
Keyboard | Scan the keyboard until a key is pressed |
Flight | Erase an old in-flight message and display a new one |
Flight | Display an in-flight message |
Flight | Print a text token, possibly followed by " DESTROYED" |
Flight | Potentially lose cargo or equipment following damage |
Flight | Display "E.C.M.SYSTEM DESTROYED" as an in-flight message |
Flight | Display "FUEL SCOOPS DESTROYED" as an in-flight message |
Market | Macro definition for the market prices table |
Market | Market prices table |
Maths (Geometry) | Orthonormalise the orientation vectors for a ship |
Maths (Arithmetic) | Calculate A = A / Q |
Maths (Arithmetic) | Calculate -(nosev_1 * roofv_1 + nosev_2 * roofv_2) / nosev_3 |
Maths (Arithmetic) | Calculate (P+1 A) = (A P) / Q |
Keyboard | An unused key logger buffer that's left over from the 6502 Second Processor version of Elite |
Elite G
-------
Category | Details |
---|---|
Drawing ships | Draw a distant ship as a point rather than a full wireframe |
Maths (Arithmetic) | Calculate Q = SQRT(R Q) |
Maths (Arithmetic) | Calculate R = 256 * A / Q |
Maths (Arithmetic) | Calculate (S A) = (S R) + (A Q) |
Maths (Geometry) | 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) | Calculate (U R) = 256 * A / Q |
Maths (Arithmetic) | 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 and draw the visible ones using flicker-free animation |
Drawing ships | Subroutine: LL9 (Part 11 of 12) Draw ship: Loop back for the next edge |
Drawing lines | Move a point along a line until it is on-screen |
Maths (Arithmetic) | Calculate (Y X) = (S x1_lo) * XX12+2 or (S x1_lo) / XX12+2 |
Maths (Arithmetic) | Calculate (Y X) = (S R) / XX12+2 or (S R) * XX12+2 |
Maths (Arithmetic) | Calculate Q = XX12+2, A = S EOR XX12+3 and (S R) = |S R| |
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 12 of 12) Draw ship: Draw all the visible edges from the ship line heap |
Drawing lines | Draw a ship line using flicker-free animation |
Elite H
-------
Category | Details |
---|---|
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 | Calculate (x_sign x_hi x_lo) = (x_sign x_hi x_lo) + (A R) |
Moving | Apply pitch and roll to an orientation vector |
Moving | Calculate (A P+2 P+1) = (x_sign x_hi x_lo) + (A P+2 P+1) |
Moving | Rotate the planet or sun's location in space by the amount of pitch and roll of our ship |
Flight | Flip the coordinate axes for the four different views |
Flight | Initialise the space view |
Flight | Draw the laser crosshairs |
Drawing lines | Colours for the crosshair sights on the different laser types |
Drawing lines | An unused table of laser colours |
Missions | A table for converting the number of Trumbles in the hold into a number of sprites in the range 0 to 6 |
Missions | 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 | Clear the screen and set the current view type |
Drawing the screen | Clear the top part of the screen, draw a border box if required and configure the specified view |
Elite I
-------
Category | Details |
---|---|
Tactics | Contains an RTS |
Sound | Switch off the E.C.M. |
Tactics | Add an enemy missile to our local bubble of universe |
Status | Process us making a kill |
Sound | Make the sound of a laser strike or ship explosion |
Sound | Make a long, low beep |
Sound | Make the sound of a launch from the station, hyperspace or missile launch |
Sound | Make the sound of a collision, or an exploding cargo canister or missile |
Sound | Make an explosion sound |
Sound | Make a short, high beep |
Sound | Make the sound of the hyperspace drive being engaged, or the sound of the E.C.M. |
Sound | Make the sound of our laser firing or the sound of us being hit by lasers |
Sound | An unused routine that makes the sound of the energy bomb going off |
Sound | Make the sound of an energy bomb going off |
Sound | Toggle the state of the speaker (i.e. move it in or out) to make a single click |
Loader | Initialise the screen mode, clear memory and set up interrupt handlers |
Loader | Acknowledge NMI interrupts and ignore them |
Elite J
-------
Category | Details |
---|---|
Save and load | Storage for the commander filename, padded out with spaces to a fixed size of 30 characters, for the rfile and wfile routines |
Save and load | Read a commander file from a DOS disk into the buffer |
Save and load | Write a commander file from the buffer to a DOS disk |
Save and load | Search the disk catalog for an existing file |
Save and load | Search the disk catalog for an empty file entry |
Save and load | Search the disk catalog for an existing file or an empty file entry |
Save and load | Analyse the VTOC sector to allocate one free sector |
Save and load | Check the disk to ensure there are least two free sectors, one for the file's track/sector list and one for the file's contents |
Save and load | Read a file's track/sector list |
Save and load | Read the VTOC sector into the buffer |
Save and load | Read a specific sector from disk into the buffer |
Save and load | Write a specific sector from the buffer to disk |
Save and load | Read or write a specific sector |
Save and load | Try finding a specific track on the disk |
Save and load | Check that this is the correct track |
Save and load | Return from the RWTS code with a "Disk write protected" error |
Save and load | Read or write a sector on the current track |
Save and load | Return from the RWTS code with a "Disk I/O error" |
Save and load | Successfully return from the RWTS code with no error reported |
Save and load | Read a sector's worth of data into the buffr2 buffer |
Save and load | Write a sector's worth of data from the buffr2 buffer to the current track and sector |
Save and load | Read a track address field |
Save and load | Fast seek routine |
Save and load | Implement the arm move delay |
Save and load | Phase-on time table in 100-usec intervals |
Save and load | Phase-off time table in 100-usec intervals |
Save and load | Convert 256 8-bit bytes in buffer into 342 6-bit nibbles in buffr2 |
Save and load | Convert 342 6-bit nibbles in buffr2 into 256 8-bit bytes in buffer |
Save and load | Write one byte to disk |
Save and load | Lookup table to translate logical (requested) sector number to physical sector number |
Save and load | 64 disk nibbles of "6-and-2" Read Translate Table |
Save and load | Encrypt the commander file in the buffer at comfil |
Save and load | Decrypt the commander file in the buffer at comfil |
Elite K
-------
Category | Details |
---|---|
Drawing pixels | Ready-made bytes for drawing one-pixel dots in the space view |
Drawing pixels | Ready-made two-bit pixel bytes for plotting colour pixels |
Drawing lines | Ready-made pixel bytes for the left end of a horizontal line |
Drawing lines | Ready-made character rows for the right end of a horizontal line in the space view |
Drawing the screen | Lookup table for converting a text row number to the address of that row in text screen memory (low byte) |
Drawing the screen | Lookup table for converting a character row number to the address of the top or bottom pixel line in that character row (low byte) |
Drawing the screen | Lookup table for converting a character row number to the address of the top pixel line in that character row (high byte) |
Drawing the screen | Lookup table for converting a character row number to the address of the bottom pixel line in that character row (high byte) |
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 |
Dashboard | Draw two horizontal lines as part of an indicator bar, from (X1, Y1+1) to (X2, Y1+1) and (X1, Y1+2) to (X2, Y1+2) |
Drawing lines | Draw a horizontal line from (X1, Y1) to (X2, Y1) |
Drawing lines | High-resolution pixel bytes for drawing continuous lines of solid colour |
Drawing lines | Draw a vertical line from (X1, Y1) to (X1, Y2) |
Drawing pixels | Draw a colour pixel |
Dashboard | Start up the E.C.M. (light up the indicator, start the countdown and make the E.C.M. sound) |
Dashboard | Light up the E.C.M. indicator bulb ("E") on the dashboard |
Dashboard | Light up the space station indicator ("S") on the dashboard |
Dashboard | Draw an indicator bulb on the dashboard |
Dashboard | The character bitmap for the E.C.M. indicator bulb |
Dashboard | The bitmap definition for the space station indicator bulb |
Dashboard | Draw a specific indicator in the dashboard's missile bar |
Dashboard | The screen x-coordinates of the four missile indicators on the dashboard |
Tube | The custom OSRDCH routine for reading characters |
Drawing the screen | Wait for 15 * 256 loop iterations |
Text | Character print vector handler |
Text | Make a beep and jump back into the character-printing routine at CHPR |
Drawing the screen | 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 | Print a character in the text screen mode |
Text | Print a newline |
Text | Print a character at the text cursor by poking into screen memory |
Text | Draw a character in the high-resolution screen mode using the game font |
Text | Draw a character or indicator bulb bitmap in the high-resolution screen mode |
Drawing the screen | Clear the whole screen or just the space view (as appropriate), and draw a border box if required |
Drawing the screen | Clear screen memory for the top part of the graphics screen mode (the space view), drawing blue borders along the sides as we do so |
Utility routines | Zero-fill the page whose number is in X |
Utility routines | Zero-fill a specific page |
Utility routines | Zero-fill memory from SC(1 0) to the end of the page |
Text | Move the text cursor to a specific column |
Text | Move the text cursor to a specific row |
Utility routines | Copy a specific number of pages in memory |
Drawing the screen | Clear two character rows near the bottom of the screen |
Drawing the screen | Clear a character row of screen memory, drawing blue borders along the left and right edges as we do so |
Dashboard | Display the current ship on the scanner |
Drawing the screen | Switch to the high-resolution graphics screen mode |
Drawing the screen | Switch to the text screen mode |
Utility routines | Denotes the end of the main game code, from ELITE A to ELITE K |
Game data
---------
Category | Details |
---|---|
Text | Macro definition for characters in the recursive token table |
Text | Macro definition for two-letter tokens in the token table |
Text | Macro definition for control codes in the recursive token table |
Text | Macro definition for recursive tokens in the recursive token table |
Text | The recursive token table for tokens 0-148 |
Maths (Geometry) | Sine/cosine table |
Text | Macro definition for jump tokens in the extended token table |
Text | Macro definition for characters in the extended token table |
Text | Macro definition for recursive tokens in the extended token table |
Text | Macro definition for two-letter tokens in the extended token table |
Text | Macro definition for random tokens in the extended token table |
Text | Macro definition for standard tokens in the extended token table |
Text | The first extended token table for recursive tokens 0-255 (DETOK) |
Text | System numbers that have extended description overrides |
Text | The criteria for systems with extended description overrides |
Text | The second extended token table for recursive tokens 0-26 (DETOK3) |
Drawing ships | Ship blueprints lookup table |
Drawing ships | Ship blueprints default NEWB flags |
Status | Fractional number of kills awarded for destroying each type of ship |
Status | Integer number of kills awarded for destroying each type of ship |
Drawing ships | Macro definition for adding vertices to ship blueprints |
Drawing ships | Macro definition for adding edges to ship blueprints |
Drawing ships | 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_DODO (Game data) Ship blueprint for a Dodecahedron ("Dodo") space station |
Transfer program
----------------
Category | Details |
---|---|
Workspaces | Workspace: ZP (Transfer program) Important variables used by the loader |
Utility routines | Subroutine: ENTRY (Transfer program) Copy the second block of the game code, between CODE2 and STORE, into bank-switched RAM at $D000 |