This index contains every subroutine and entry point that appears in the source code for the NES version of Elite, grouped by category. An entry points is a label within a subroutine that is called from outside the subroutine, which typically implements a subset or variation of the functionality of the parent subroutine.
- Charts
- Combat demo
- Controllers
- Dashboard
- Drawing circles
- Drawing lines
- Drawing pixels
- Drawing planets
- Drawing ships
- Drawing sprites
- Drawing suns
- Drawing the screen
- Equipment
- Flight
- Icon bar
- Main loop
- Market
- Maths (Arithmetic)
- Maths (Geometry)
- Missions
- Moving
- PPU
- Save and load
- Ship hangar
- Sound
- Stardust
- Start and end
- Status
- Tactics
- Text
- Universe
- Utility routines
Charts
| |
DrawChartSystem (Bank 0) | Draw system blobs on short-range chart |
DrawCrosshairs (Bank 0) | Draw a set of moveable crosshairs as a square reticle |
HideCrosshairs (Bank 0) | Hide the moveable crosshairs (i.e. the square reticle) |
HME2 (Bank 0) | Search the galaxy for a system |
TT103 (Bank 0) | Draw a small set of crosshairs on a chart |
TT105 (Bank 0) | Draw crosshairs on the Short-range Chart, with clipping |
TT114 (Bank 0) | Display either the Long-range or Short-range Chart |
TT123 (Bank 0) | Move galactic coordinates by a signed delta |
TT16 (Bank 0) | Move the crosshairs on a chart |
TT180 (Bank 0) | Contains an RTS |
TT22 (Bank 0) | Show the Long-range Chart |
TT23 (Bank 0) | Show the Short-range Chart |
Combat demo
| |
AutoPlayDemo (Bank 7) | Automatically play the demo using the auto-play commands from the autoplayKeys tables |
CalculateGridLines (Bank 6) | Reset the line coordinate tables and populate them with the characters for a specified scroll text |
DrawScrollFrame (Bank 6) | Draw one frame of the scroll text |
DrawScrollFrames (Bank 6) | Draw a scroll text over multiple frames |
DrawScrollInNMI (Bank 6) | Configure the NMI handler to draw the scroll text screen |
DrawScrollText (Bank 6) | Display a Star Wars scroll text |
FixRandomNumbers (Bank 7) | Fix the random number seeds to a known value so the random numbers generated are always the same when we run the demo |
GetScrollDivisions (Bank 6) | Set up the division calculations for the scroll text |
GRIDSET (Bank 6) | Populate the line coordinate tables with the pixel lines for one 21-character line of scroll text |
GRIDSET+5 (Bank 6) | Use the y-coordinate in YP so the scroll text starts at (0, YP) rather than (0, 6) |
GRS1 (Bank 6) | Populate the line coordinate tables with the lines for a single scroll text character |
PlayDemo (Bank 0) | Play the combat demo |
PlayDemo_b0 (Bank 7) | Call the PlayDemo routine in ROM bank 0 |
ProjectScrollText (Bank 6) | Project a scroll text coordinate onto the screen |
RTS10 (Bank 6) | Contains an RTS |
RunDemoFlightLoop (Bank 0) | Run a fixed number of iterations of the main flight loop for the combat demo |
ScrollTextUpScreen (Bank 6) | Go through the line y-coordinate table at Y1TB, moving each line coordinate up the screen by W2Y (i.e. by one full line of text) |
SetDemoAutoPlay (Bank 5) | Set up the NMI handler to automatically play the demo using the controller key presses in the autoPlayKeys table |
SetDemoAutoPlay_b5 (Bank 7) | Call the SetDemoAutoPlay routine in ROM bank 5 |
SetupDemoShip (Bank 0) | Set up the ship workspace for a new ship in the combat demo |
SetupDemoUniverse (Bank 7) | Initialise the local bubble of universe for the demo |
ShowScrollText (Bank 6) | Show a scroll text and start the combat demo |
ShowScrollText_b6 (Bank 7) | Call the ShowScrollText routine in ROM bank 6 |
Controllers
| |
ChangeLetter (Bank 6) | Choose a letter using the up and down buttons |
decj2 (Bank 7) | Return a value of X = 128, for the centre of the indicator |
DecreaseJoystick (Bank 7) | Decrease a joystick value by a specific amount, jumping straight to the indicator centre if we decrease from the right-hand side |
DOKEY (Bank 0) | Scan for the seven primary flight controls and apply the docking computer manoeuvring code |
IncreaseJoystick (Bank 7) | Increase a joystick value by a specific amount, jumping straight to the indicator centre if we increase from the left-hand side |
InputName (Bank 6) | Get a name from the controller for searching the galaxy or changing commander name |
InputName_b6 (Bank 7) | Call the InputName routine in ROM bank 6 |
PAUSE2 (Bank 2) | Wait until a key is pressed, ignoring any existing key press |
ReadControllers (Bank 7) | Read the buttons on the controllers and update the control variables |
RTS3 (Bank 7) | Contains an RTS |
ScanButtons (Bank 7) | Scan a specific controller and update the control variables |
SetControllerPast (Bank 7) | Set the controller history variables to the values from four VBlanks ago |
SetKeyLogger (Bank 6) | Populate the key logger table with the controller button presses |
SetKeyLogger_b6 (Bank 7) | Call the SetKeyLogger routine in ROM bank 6 |
TT17 (Bank 0) | Scan the key logger for the directional pad buttons |
U% (Bank 0) | Clear the key logger |
UpdateJoystick (Bank 7) | Update the values of JSTX and JSTY with the values from the controller |
WaitForNoDirection (Bank 6) | Wait until the left and right buttons on controller 1 have been released and remain released for at least four VBlanks |
YESNO (Bank 0) | Display "YES" or "NO" and wait until one is chosen |
Dashboard
| |
ABORT (Bank 0) | Disarm missiles and update the dashboard indicators |
ABORT2 (Bank 0) | Set/unset the lock target for a missile and update the dashboard |
BUMP2 (Bank 7) | Bump up the value of the pitch or roll dashboard indicator |
ClearScanner (Bank 7) | Remove all ships from the scanner and hide the scanner sprites |
cntr (Bank 7) | Apply damping to the pitch or roll dashboard indicator |
COMPAS (Bank 0) | Update the compass |
DIALS (Bank 6) | Update the dashboard |
DIALS_b6 (Bank 7) | Call the DIALS routine in ROM bank 6 |
DILX (Bank 6) | Update a bar-based indicator on the dashboard |
DILX+2 (Bank 6) | The range of the indicator is 0-64 (for the fuel and speed indicators) |
djd1 (Bank 7) | Auto-recentre the value in X, if keyboard auto-recentre is configured |
DrawDashNames (Bank 3) | Draw the dashboard into both the nametable buffers |
DrawDashNames_b3 (Bank 7) | Call the DrawDashNames routine in ROM bank 3 |
DrawPitchRollBars (Bank 0) | Update the pitch and roll bars on the dashboard |
ECBLB2 (Bank 7) | Start up the E.C.M. (start the countdown and make the E.C.M. sound) |
ECMOF (Bank 0) | Switch off the E.C.M. and turn off the dashboard bulb |
HideFromScanner (Bank 1) | Hide the current ship from the scanner |
HideFromScanner_b1 (Bank 7) | Call the HideFromScanner routine in ROM bank 1 |
HideShip (Bank 1) | Update the current ship so it is no longer shown on the scanner |
HideShip_b1 (Bank 7) | Update the current ship so it is no longer shown on the scanner |
MSBAR (Bank 7) | Draw a specific indicator in the dashboard's missile bar |
MSBAR_b6 (Bank 6) | Draw a specific indicator in the dashboard's missile bar |
msblob (Bank 0) | Display the dashboard's missile indicators in black or grey |
RE2+2 (Bank 7) | Restore A from T and return from the subroutine |
REDU2 (Bank 7) | Reduce the value of the pitch or roll dashboard indicator |
ResetScanner (Bank 3) | Reset the sprites used for drawing ships on the scanner |
ResetScanner_b3 (Bank 7) | Call the ResetScanner routine in ROM bank 3 |
SCAN (Bank 1) | Display the current ship on the scanner |
SCAN_b1 (Bank 7) | Call the SCAN routine in ROM bank 1 |
SP1 (Bank 0) | Draw the space station on the compass |
SP2 (Bank 0) | Draw a dot on the compass, given the planet/station vector |
WPSHPS (Bank 0) | Set all ships to be hidden from the screen |
Drawing circles
| |
BLINE (Bank 1) | Draw a circle segment and add it to the ball line heap |
CHKON (Bank 1) | Check whether any part of a circle appears on the extended screen |
CIRCLE (Bank 1) | Draw a circle for the planet |
CIRCLE2 (Bank 1) | Draw a circle (for the planet or chart) |
CIRCLE2_b1 (Bank 7) | Call the CIRCLE2 routine in ROM bank 1 |
TT128 (Bank 0) | Draw a circle on a chart |
TT14 (Bank 0) | Draw a circle with crosshairs on a chart |
Drawing lines
| |
CLIP (Bank 1) | Another name for LL145 CLIP2 Don't initialise the values in SWAP or A |
CLIP2 (Bank 1) | Don't initialise the values in SWAP or A |
CLIP_b1 (Bank 7) | Call the CLIP routine in ROM bank 1, drawing the clipped line if it fits on-screen |
DrawVerticalLine (Part 1 of 3) (Bank 7) | Draw a vertical line from (X1, Y1) to (X1, Y2) |
DrawVerticalLine (Part 2 of 3) (Bank 7) | Draw the top end or bottom end of the line |
DrawVerticalLine (Part 3 of 3) (Bank 7) | Draw the middle portion of the line from full-height blocks |
EDGES (Bank 1) | Draw a horizontal line given a centre and a half-width |
EDGES-2 (Bank 1) | Return the C flag set if argument A is 0 |
HLOIN (Part 1 of 5) (Bank 7) | Draw a horizontal line from (X1, Y) to (X2, Y) using EOR logic |
HLOIN (Part 2 of 5) (Bank 7) | Draw the left end of the line |
HLOIN (Part 3 of 5) (Bank 7) | Draw the middle part of the line |
HLOIN (Part 4 of 5) (Bank 7) | Draw the right end of the line |
HLOIN (Part 5 of 5) (Bank 7) | Draw the line when it's all within one character block |
LASLI (Bank 0) | Draw the laser lines for when we fire our lasers |
LASLI-1 (Bank 0) | Contains an RTS |
LL118 (Bank 1) | Move a point along a line until it is on-screen |
LL118-1 (Bank 1) | Contains an RTS |
LL145 (Part 1 of 4) (Bank 1) | Clip line: Work out which end-points are on-screen, if any |
LL145 (Part 2 of 4) (Bank 1) | Clip line: Work out if any part of the line is on-screen |
LL145 (Part 3 of 4) (Bank 1) | Clip line: Calculate the line's gradient |
LL145 (Part 4 of 4) (Bank 1) | Clip line: Call the routine in LL188 to do the actual clipping |
LOIN (Part 1 of 7) (Bank 7) | Draw a line: Calculate the line gradient in the form of deltas |
LOIN (Part 2 of 7) (Bank 7) | Draw a line: Line has a shallow gradient, step right along x-axis |
LOIN (Part 3 of 7) (Bank 7) | Draw a shallow line going right and up or left and down |
LOIN (Part 4 of 7) (Bank 7) | Draw a shallow line going right and down or left and up |
LOIN (Part 5 of 7) (Bank 7) | Draw a line: Line has a steep gradient, step up along y-axis |
LOIN (Part 6 of 7) (Bank 7) | Draw a steep line going up and left or down and right |
LOIN (Part 7 of 7) (Bank 7) | Draw a steep line going up and right or down and left |
NLIN2 (Bank 7) | Draw a horizontal line on tile row 2 to box in a title |
NLIN3 (Bank 7) | Print a title and draw a screen-wide horizontal line on tile row 2 to box it in |
NLIN4 (Bank 7) | Draw a horizontal line on tile row 2 to box in a title |
TT15 (Bank 0) | Draw a set of crosshairs |
Drawing pixels
| |
DrawDash (Bank 7) | Draw a two-pixel dash |
PIXEL (Bank 7) | Draw a one-pixel dot |
PIXEL2 (Bank 1) | Draw a stardust particle relative to the screen centre |
pixl2 (Bank 7) | Restore the value of Y and return from the subroutine |
Drawing planets
| |
PL21 (Bank 1) | Return from a planet/sun-drawing routine with a failure flag |
PL21S-1 (Bank 7) | Set the C flag and return from the subroutine |
PL40 (Bank 1) | Contains an RTS |
PL44 (Bank 1) | Return from a planet/sun-drawing routine with a success flag |
PL9 (Part 1 of 3) (Bank 1) | Draw the planet, with either an equator and meridian, or a crater |
PL9 (Part 2 of 3) (Bank 1) | Draw the planet's equator and meridian |
PL9 (Part 3 of 3) (Bank 1) | Draw the planet's crater |
PLANET (Bank 1) | Draw the planet or sun |
PLS1 (Bank 1) | Calculate (Y A) = nosev_x / z |
PLS2 (Bank 1) | Draw a half-ellipse |
PLS22 (Bank 1) | Draw an ellipse or half-ellipse |
PLS3 (Bank 1) | Calculate (Y A P) = 222 * roofv_x / z |
PLS4 (Bank 1) | Calculate CNT2 = arctan(P / A) / 4 |
PLS5 (Bank 1) | Calculate roofv_x / z and roofv_y / z |
PLS6 (Bank 7) | Calculate (X K) = (A P+1 P) / (z_sign z_hi z_lo) |
Drawing ships
| |
DOEXP (Bank 1) | Draw an exploding ship |
DrawExplosionBurst (Bank 1) | Draw an exploding ship along with an explosion burst made up of colourful sprites |
DrawShipInBitplane (Bank 7) | Flip the drawing bitplane and draw the current ship in the newly flipped bitplane |
EE51 (Bank 1) | Remove the current ship from the screen, called from SHPPT before drawing the ship as a point |
EXS1 (Bank 1) | Set (A X) = (A R) +/- random * cloud size |
GetDefaultNEWB (Bank 7) | Fetch the default NEWB flags for a specified ship type |
GetShipBlueprint (Bank 7) | Fetch a specified byte from the current ship blueprint |
HideExplosionBurst (Bank 7) | Hide the four sprites that make up the explosion burst that flashes up when a ship explodes |
LL10-1 (Bank 1) | Contains an RTS |
LL66 (Bank 1) | A re-entry point into the ship-drawing routine, used by the LL62 routine to store 128 - (U R) on the XX3 heap |
LL70+1 (Bank 1) | Contains an RTS (as the first byte of an LDA instruction) |
LL9 (Part 1 of 12) (Bank 1) | Draw ship: Check if ship is exploding, check if ship is in front |
LL9 (Part 2 of 12) (Bank 1) | Draw ship: Check if ship is in field of view, close enough to draw |
LL9 (Part 3 of 12) (Bank 1) | Draw ship: Set up orientation vector, ship coordinate variables |
LL9 (Part 4 of 12) (Bank 1) | Draw ship: Set visibility for exploding ship (all faces visible) |
LL9 (Part 5 of 12) (Bank 1) | Draw ship: Calculate the visibility of each of the ship's faces |
LL9 (Part 6 of 12) (Bank 1) | Draw ship: Calculate the visibility of each of the ship's vertices |
LL9 (Part 7 of 12) (Bank 1) | Draw ship: Calculate the visibility of each of the ship's vertices |
LL9 (Part 8 of 12) (Bank 1) | Draw ship: Calculate the screen coordinates of visible vertices |
LL9 (Part 9 of 12) (Bank 1) | Draw ship: Draw laser beams if the ship is firing its laser at us |
LL9 (Part 10 of 12) (Bank 1) | Draw ship: Calculate the visibility of each of the ship's edges |
LL9 (Part 11 of 12) (Bank 1) | Draw ship: Loop back for the next edge |
LL9 (Part 12 of 12) (Bank 1) | Does nothing in the NES version |
LL9_b1 (Bank 7) | Call the LL9 routine in ROM bank 1 |
SHPPT (Bank 1) | Draw a distant ship as a point rather than a full wireframe |
Drawing sprites
| |
DrawSpriteImage (Bank 6) | Draw an image out of sprites using patterns in sequential tiles in the pattern buffer |
DrawSpriteImage+2 (Bank 6) | Set the attributes for the sprites in the image to A |
DrawSpriteImage_b6 (Bank 7) | Call the DrawSpriteImage routine in ROM bank 6 |
FadeAndHideSprites (Bank 7) | Fade the screen to black and hide all sprites |
HideMoreSprites (Bank 7) | Hide X + 1 sprites from sprite Y / 4 onwards |
HideMostSprites (Bank 7) | Hide all sprites except for sprite 0 and the icon bar pointer |
HideSprites (Bank 7) | Hide X sprites from sprite Y / 4 onwards |
SendPaletteSprites (Bank 7) | Send the current palette and sprite data to the PPU |
SetScreenForUpdate (Bank 7) | Get the screen ready for updating by hiding all sprites, after fading the screen to black if we are changing view |
Drawing suns
| |
DrawSunEdge (Bank 1) | Draw a sun line from (X1, Y) to (X2, Y) |
DrawSunEdgeLeft (Bank 1) | Draw a sun line in the tile on the left end of a sun row |
DrawSunEdgeRight (Bank 1) | Draw a sun line in the tile on the right end of a sun row |
DrawSunRowOfBlocks (Bank 7) | Draw a row of character blocks that contain sunlight, silhouetting any existing content against the sun |
PLFL (Bank 1) | Calculate the sun's width on a given pixel row |
RTS2 (Bank 1) | Contains an RTS |
RTS7 (Bank 1) | Contains an RTS DrawSunEdge Draw a sun line from (X1, Y) to (X2, Y) |
SUN (Part 1 of 2) (Bank 1) | Draw the sun: Set up all the variables needed to draw the sun |
SUN (Part 2 of 2) (Bank 1) | Draw the sun: Starting from the bottom of the sun, draw the new sun line by line |
SUN_b1 (Bank 7) | Call the SUN routine in ROM bank 1 |
Drawing the screen
| |
ChangeToView (Bank 0) | Clear the screen and set a new view type |
ChangeToView_b0 (Bank 7) | Call the ChangeToView routine in ROM bank 0 |
ClearBuffers (Bank 7) | If there are enough free cycles, clear down the nametable and pattern buffers for both bitplanes |
ClearDashEdge (Bank 6) | Clear the right edge of the dashboard |
ClearDashEdge_b6 (Bank 7) | Call the ClearDashEdge routine in ROM bank 6 |
ClearDrawingPlane (Part 1 of 3) (Bank 7) | Clear the nametable and pattern buffers for the newly flipped drawing plane |
ClearDrawingPlane (Part 2 of 3) (Bank 7) | Clear the nametable buffers for the newly flipped drawing plane |
ClearDrawingPlane (Part 3 of 3) (Bank 7) | Clear the pattern buffers for the newly flipped drawing plane |
ClearPlaneBuffers (Part 1 of 2) (Bank 7) | Clear the nametable and pattern buffers of data that has already been sent to the PPU, starting with the nametable buffer |
ClearPlaneBuffers (Part 2 of 2) (Bank 7) | Clear the pattern buffer of data that has already been sent to the PPU for the current bitplane |
ClearScreen (Bank 3) | Clear the screen by clearing patterns 66 to 255 in both pattern buffers, and clearing both nametable buffers to the background |
ClearScreen_b3 (Bank 7) | Call the ClearScreen routine in ROM bank 3 |
CLYNS (Bank 7) | Clear the bottom two text rows of the visible screen |
CLYNS+8 (Bank 7) | Don't zero DLY and de |
CopyNameBuffer0To1 (Bank 7) | Copy the contents of nametable buffer 0 to nametable buffer 1 |
DrawBackground (Bank 3) | Draw the background of a system or commander image into the nametable buffer |
DrawBackground_b3 (Bank 7) | Call the DrawBackground routine in ROM bank 3 |
DrawBitplaneInNMI (Bank 7) | Configure the NMI to send the drawing bitplane to the PPU after drawing the box edges and setting the next free tile number |
DrawBoxEdges (Bank 7) | Draw the left and right edges of the box along the sides of the screen, drawing into the nametable buffer for the drawing bitplane |
DrawBoxTop (Bank 7) | Draw the top edge of the box along the top of the screen in nametable buffer 0 |
DrawImageFrame (Bank 3) | Draw a frame around the system image or commander headshot |
DrawImageFrame_b3 (Bank 7) | Call the DrawImageFrame routine in ROM bank 3 |
DrawImageNames (Bank 4) | Set the nametable buffer entries for the specified image |
DrawImageNames_b4 (Bank 7) | Call the DrawImageNames routine in ROM bank 4 |
DrawMessageInNMI (Bank 7) | Configure the NMI to send the portion of the screen that contains the in-flight message to the PPU (i.e. tile rows 22 to 24) |
DrawRowOfTiles (Bank 3) | Draw a row of tiles into the nametable buffer |
DrawScreenInNMI (Bank 0) | Configure the NMI handler to draw the screen |
DrawScreenInNMI_b0 (Bank 7) | Call the DrawScreenInNMI routine in ROM bank 0 |
DrawSmallBox (Bank 3) | Draw a small box, typically used for popups or outlines |
DrawSmallBox_b3 (Bank 7) | Call the DrawSmallBox routine in ROM bank 3 |
DrawSpaceViewInNMI (Bank 0) | Configure the NMI handler to draw the space view |
FadeColours (Bank 3) | Fade the screen colours towards black |
FadeColoursTwice (Bank 3) | Fade the screen colours towards black twice |
FadeToBlack (Bank 3) | Fade the screen to black over the next four VBlanks |
FadeToBlack_b3 (Bank 7) | Call the FadeToBlack routine in ROM bank 3 |
FadeToColour (Bank 3) | Reverse-fade the screen from black to full colour over the next four VBlanks |
FadeToColour_b3 (Bank 7) | Call the FadeToColour routine in ROM bank 3 |
FlipDrawingPlane (Bank 7) | Flip the drawing bitplane |
GetNameAddress (Bank 3) | Get the addresses in the nametable buffers for a given tile |
GetRowNameAddress (Bank 7) | Get the addresses in the nametable buffers for the start of a given character row |
GetViewPalettes (Bank 3) | Get the palette for the view type in QQ11a and store it in a table at XX3 |
HideHiddenColour (Bank 0) | Set the hidden colour to black, so that pixels in this colour in palette 0 are invisible |
oh (Bank 0) | Contains an RTS |
RedrawCurrentView (Bank 0) | Update the current view when we arrive in a new system |
ResetBuffers (Bank 7) | Reset the pattern and nametable buffers |
SetDrawingBitplane (Bank 7) | Set the drawing bitplane to a specified value |
SetDrawingPlaneTo0 (Bank 7) | Set the drawing bitplane to 0 |
SetDrawPlaneFlags (Bank 7) | Set the drawing bitplane flags to the specified value, draw the box edges and set the next free tile number |
SetLinePatterns (Bank 3) | Copy the patterns for horizontal line, vertical line and block images into the pattern buffers, depending on the view |
SetLinePatterns_b3 (Bank 7) | Call the SetLinePatterns routine in ROM bank 3 |
SetNewViewType (Bank 0) | Clear the screen, set the current view type and move the cursor to row 0 |
SetPaletteColours (Bank 3) | Set the view's palette from the entries in the XX3 palette table |
SetPaletteForView (Bank 7) | Send palette 0 for the current view to the PPU |
SetPatternBuffer (Bank 7) | Set the high byte of the pattern buffer address variables |
SetScreenHeight (Bank 0) | Set the screen height variables to the specified height |
SetSpaceViewInNMI (Bank 0) | Change the current space view and configure the NMI to send both bitplanes to the PPU during VBlank |
SetupFullViewInNMI (Bank 7) | Configure the PPU to send tiles for the full screen during VBlank |
SetupSpaceView (Bank 0) | Set up the NMI variables for the space view |
SetupViewInNMI (Bank 3) | Setup the view and configure the NMI to send both bitplanes to the PPU during VBlank |
SetupViewInNMI_b3 (Bank 7) | Call the SetupViewInNMI routine in ROM bank 3 |
SetViewAttrs (Bank 3) | Set up attribute buffer 0 for the chosen view |
SetViewAttrs_b3 (Bank 7) | Call the SetViewAttrs routine in ROM bank 3 |
TT66 (Bank 0) | Clear the screen and set the new view type |
TT66_b0 (Bank 7) | Call the TT66 routine in ROM bank 0 |
UpdateView (Bank 0) | Update the view |
UpdateView_b0 (Bank 7) | Call the UpdateView routine in ROM bank 0 |
UpdateViewWithFade (Bank 7) | Fade the screen to black, if required, hide all sprites and update the view |
Equipment
| |
c (Bank 0) | Contains an RTS |
DrawCobraMkIII (Bank 0) | Draw the Cobra Mk III on the Equip Ship screen |
DrawEquipment (Bank 6) | Draw the currently fitted equipment onto the Cobra Mk III image on the Equip Ship screen |
DrawEquipment_b6 (Bank 7) | Call the DrawEquipment routine in ROM bank 6 |
eq (Bank 0) | Subtract the price of equipment from the cash pot |
EQSHP (Bank 0) | Show the Equip Ship screen |
equi1 (Bank 0) | A re-entry point into the key-pressing loop, used when processing key presses in subroutines |
GetLaserPattern (Bank 6) | Get the pattern number for a specific laser's equipment sprite |
HighlightEquipment (Bank 0) | Highlight an item of equipment on the Equip Ship screen |
HighlightLaserView (Bank 0) | Highlight the laser view name in the popup menu |
MoveEquipmentDown (Bank 0) | Move the currently selected item down the list of equipment |
MoveEquipmentUp (Bank 0) | Move the currently selected item up the list of equipment |
pres (Bank 0) | Given an item number A with the item name in recursive token Y, show an error to say that the item is already present, refund the cost of the item, and then beep and exit to the docking bay (i.e. show the Status Mode screen) |
PrintEquipment (Bank 0) | Print the name and price for a specified item of equipment |
PrintEquipment+2 (Bank 0) | Print the item number in X |
PrintLaserView (Bank 0) | Print the name of a laser view in the laser-buying popup, filled to the right by the correct number of spaces to fill the popup |
prx (Bank 0) | Return the price of a piece of equipment |
prx-3 (Bank 0) | Return the price of the item with number A - 1 c Contains an RTS |
qv (Bank 0) | Print a popup menu of the four space views, for buying lasers |
refund (Bank 0) | Install a new laser, processing a refund if applicable |
SetEquipmentSprite (Bank 6) | Set up the sprites in the sprite buffer for a specific bit of equipment to show on our Cobra Mk III on the Equip Ship screen |
SetLaserSprite (Bank 6) | Set up the sprites in the sprite buffer for a specific laser to show on our Cobra Mk III on the Equip Ship screen |
UpdateEquipment (Bank 0) | Highlight the newly chosen item of equipment, update the Cobra Mk III, redraw the screen and rejoin the main EQSHP routine |
Flight
| |
ChargeShields (Bank 0) | Charge the shields and energy banks |
CheckAltitude (Bank 0) | Perform an altitude check with the planet, ending the game if we hit the ground |
CheckJumpSafety (Bank 0) | Check whether we are far enough away from the planet and sun to be able to do an in-system (fast-forward) jump |
CheckJumpSafety+2 (Bank 0) | Check the distances against the value of 0.5 * A |
DCS1 (Bank 0) | Calculate the vector from the ideal docking position to the ship |
DENGY (Bank 0) | Drain some energy from the energy banks |
dockEd (Bank 0) | Print a message to say there is no hyperspacing allowed inside the station |
DOCKIT (Bank 0) | Apply docking manoeuvres to the ship in INWK |
DOENTRY (Bank 0) | Dock at the space station, show the ship hangar and work out any mission progression |
DrawLaunchBox (Bank 6) | Draw a box as part of the launch tunnel animation |
DrawLaunchBox_b6 (Bank 7) | Call the DrawLaunchBox routine in ROM bank 6 |
DrawLightning (Bank 6) | Draw a lightning effect for the launch tunnel and E.C.M. that consists of two random lightning bolts, one above the other |
DrawLightning_b6 (Bank 7) | Call the DrawLightning routine in ROM bank 6 |
ESCAPE (Bank 0) | Launch our escape pod |
FastForwardJump (Bank 0) | Perform an in-system jump |
GalacticHyperdrive (Bank 0) | If we are in space and the countdown has ended, activate the galactic hyperdrive |
Ghy (Bank 0) | Perform a galactic hyperspace jump |
HideSightSprites (Bank 3) | Hide the sprites for the laser sights in the space view |
hyp (Bank 0) | Start the hyperspace process |
InSystemJump (Bank 0) | Perform an in-system (fast-forward) jump |
LAUN (Bank 0) | Make the launch sound and draw the launch tunnel |
LL164 (Bank 6) | Make the hyperspace sound and draw the hyperspace tunnel |
LL164_b6 (Bank 7) | Call the LL164 routine in ROM bank 6 |
LO2 (Bank 0) | Contains an RTS |
LOOK1 (Bank 0) | Initialise the space view |
MA232 (Bank 0) | Contains an RTS |
mes9 (Bank 0) | Print a text token, possibly followed by " DESTROYED" |
mes9+3 (Bank 0) | Don't print the text token, just print " DESTROYED" where applicable |
MESS (Bank 0) | Display an in-flight message |
MJP (Bank 0) | Process a mis-jump into witchspace |
OOPS (Bank 0) | Take some damage |
ou2 (Bank 0) | Display "E.C.M.SYSTEM DESTROYED" as an in-flight message |
ou3 (Bank 0) | Display "FUEL SCOOPS DESTROYED" as an in-flight message |
OUCH (Bank 0) | Potentially lose cargo or equipment following damage |
ouch1 (Bank 0) | Print the token in A as an in-flight message |
PLUT (Bank 0) | Flip the coordinate axes for the four different views |
ResetShipStatus (Bank 0) | Reset the ship's speed, hyperspace counter, laser temperature, shields and energy banks |
SESCP (Bank 0) | Spawn an escape pod from the current (parent) ship |
SHD (Bank 0) | Charge a shield and drain some energy from the energy banks |
SIGHT (Bank 3) | Draw the laser crosshairs |
SIGHT_b3 (Bank 7) | Call the SIGHT routine in ROM bank 3 |
TT110 (Bank 0) | Launch from a station or show the front space view |
TT147 (Bank 0) | Print an error when a system is out of hyperspace range |
TT18 (Bank 0) | Try to initiate a jump into hyperspace |
WARP (Bank 0) | Process the fast-forward button to end the demo, dock instantly or perform an in-system jump |
wW (Bank 0) | Start a hyperspace countdown |
wW2 (Bank 0) | Start the hyperspace countdown, starting the countdown from the value in A |
zZ+1 (Bank 0) | Contains an RTS |
Icon bar
| |
BlankAllButtons (Bank 3) | Blank all the buttons on the icon bar |
BlankButtons6To11 (Bank 3) | Blank from the sixth to the eleventh button on the icon bar |
BlankButtons8To11 (Bank 3) | Blank from the eighth to the eleventh button on the icon bar |
CheckForPause (Bank 0) | Pause the game if the pause button (Start) is pressed |
CheckForPause-3 (Bank 0) | Set A to the number of the icon bar button in iconBarChoice so we check whether the pause button is being pressed |
CheckForPause_b0 (Bank 7) | Call the CheckForPause routine in ROM bank 0 |
CheckPauseButton (Bank 7) | Check whether the pause button has been pressed or an icon bar button has been chosen, and process pause/unpause if required |
dock2 (Bank 3) | Process the second button on the Docked or Flight icon bars |
Draw2OptionTiles (Bank 3) | Draw a top and bottom tile over the top of an icon bar button in the Pause icon bar to change an option icon to a non-default state |
Draw4OptionTiles (Bank 3) | Draw four tiles over the top of an icon bar button in the Pause icon bar to change an option icon to a non-default state |
Draw6OptionTiles (Bank 3) | Draw six tiles over the top of an icon bar button in the Pause icon bar to change an option icon to a non-default state |
DrawBlankButton2x2 (Bank 3) | Draw a blank icon bar button as a 2x2 tile block |
DrawBlankButton3x2 (Bank 3) | Draw a blank icon bar button as a 3x2 tile block |
DrawIconBar (Bank 3) | Draw the icon bar into the nametable buffers for both bitplanes |
DrawInventoryIcon (Bank 7) | Draw the inventory icon on top of the second button in the icon bar |
fbar11 (Bank 3) | Process the fast-forward and Market Price buttons |
fbar8 (Bank 3) | Process the escape pod, fast-forward and Market Price buttons |
HideIconBar (Bank 3) | Remove the icon bar from the screen by replacing it with background tiles |
HideIconBarPointer (Bank 7) | Clear the icon bar choice and hide the icon bar pointer |
hipo2 (Bank 7) | Clear the icon button choice and hide the icon bar pointer |
MoveIconBarPointer (Bank 7) | Move the sprites that make up the icon bar pointer and record any choices |
PauseGame (Bank 6) | Pause the game and process choices from the pause menu until the game is unpaused by another press of Start |
PauseGame_b6 (Bank 7) | Call the PauseGame routine in ROM bank 6 |
ReturnFromSearch (Bank 0) | Re-entry point following a system search in HME2 |
RTS9 (Bank 3) | Contains an RTS |
SetIconBarButtons (Bank 3) | Set the correct list of button numbers for the icon bar |
SetIconBarButtonsS (Bank 3) | Set the correct list of button numbers for the icon bar (this is a jump so we can call this routine using a branch instruction) |
SetIconBarPointer (Bank 7) | Set the icon bar pointer to a specific position |
SetIconBarRow (Bank 3) | Set the row on which the icon bar appears, which depends on the view type |
SetupIconBar (Bank 3) | Set up the icons on the icon bar to show all available options |
SetupIconBar_b3 (Bank 7) | Call the SetupIconBar routine in ROM bank 3 |
SetupIconBarCharts (Bank 3) | Set up the Charts icon bar |
SetupIconBarDocked (Bank 3) | Set up the Docked icon bar |
SetupIconBarFlight (Bank 3) | Set up the Flight icon bar |
SetupIconBarPause (Bank 3) | Set up the game options shown on the icon bar when the game is paused |
ShowIconBar (Bank 3) | Show a specified icon bar on-screen |
ShowIconBar_b3 (Bank 7) | Call the ShowIconBar routine in ROM bank 3 |
TT102 (Bank 0) | Process icon bar controller choices |
UpdateIconBar (Bank 3) | Update the icon bar |
UpdateIconBar_b3 (Bank 7) | Call the UpdateIconBar routine in ROM bank 3 |
Main loop
| |
FlightLoop4To16 (Bank 0) | Display in-flight messages, call parts 4 to 12 of the main flight loop for each slot, and fall through into parts 13 to 16 |
FRCE (Bank 0) | The entry point for the main game loop if we want to jump straight to a specific screen, by pretending to "press" a key, in which case A contains the internal key number of the key we want to "press" |
GOIN (Bank 0) | We jump here from part 3 of the main flight loop if the docking computer is activated by pressing "C" |
M% (Bank 0) | The entry point for the main flight loop |
MA18 (Bank 0) | Entry point for part 13 of the main flight loop |
Main flight loop (Part 1 of 16) (Bank 0) | Seed the random number generator |
Main flight loop (Part 2 of 16) (Bank 0) | Calculate the alpha and beta angles from the current pitch and roll of our ship |
Main flight loop (Part 3 of 16) (Bank 0) | Scan for flight keys and process the results |
Main flight loop (Part 4 of 16) (Bank 0) | For each nearby ship: Copy the ship's data block from K% to the zero-page workspace at INWK |
Main flight loop (Part 5 of 16) (Bank 0) | For each nearby ship: If an energy bomb has been set off, potentially kill this ship |
Main flight loop (Part 6 of 16) (Bank 0) | For each nearby ship: Move the ship in space and copy the updated INWK data block back to K% |
Main flight loop (Part 7 of 16) (Bank 0) | For each nearby ship: Check whether we are docking, scooping or colliding with it |
Main flight loop (Part 8 of 16) (Bank 0) | For each nearby ship: Process us potentially scooping this item |
Main flight loop (Part 9 of 16) (Bank 0) | For each nearby ship: If it is a space station, check whether we are successfully docking with it |
Main flight loop (Part 10 of 16) (Bank 0) | For each nearby ship: Remove if scooped, or process collisions |
Main flight loop (Part 11 of 16) (Bank 0) | For each nearby ship: Process missile lock and firing our laser |
Main flight loop (Part 12 of 16) (Bank 0) | For each nearby ship: Draw the ship, remove if killed, loop back |
Main flight loop (Part 13 of 16) (Bank 0) | Show energy bomb effect, charge shields and energy banks |
Main flight loop (Part 14 of 16) (Bank 0) | Spawn a space station if we are close enough to the planet |
Main flight loop (Part 15 of 16) (Bank 0) | Perform altitude checks with the planet and sun and process fuel scooping if appropriate |
Main flight loop (Part 16 of 16) (Bank 0) | Call stardust routine |
Main game loop (Part 1 of 6) (Bank 0) | Spawn a trader (a Cobra Mk III, Python, Boa or Anaconda) |
Main game loop (Part 2 of 6) (Bank 0) | Call the main flight loop, and potentially spawn a trader, an asteroid, or a cargo canister |
Main game loop (Part 3 of 6) (Bank 0) | Potentially spawn a cop, particularly if we've been bad |
Main game loop (Part 4 of 6) (Bank 0) | Potentially spawn a lone bounty hunter, a Thargoid, or up to four pirates |
Main game loop (Part 5 of 6) (Bank 0) | Cool down lasers, make calls to update the dashboard |
Main game loop (Part 6 of 6) (Bank 0) | Process non-flight key presses (icon bar selections) |
MAL1 (Bank 0) | Marks the beginning of the ship analysis loop, so we can jump back here from part 12 of the main flight loop to work our way through each ship in the local bubble. We also jump back here when a ship is removed from the bubble, so we can continue processing from the next ship |
MLOOP (Bank 0) | The entry point for the main game loop. This entry point comes after the call to the main flight loop and spawning routines, so it marks the start of the main game loop for when we are docked (as we don't need to call the main flight loop or spawning routines if we aren't in space) |
TT100 (Bank 0) | The entry point for the start of the main game loop, which calls the main flight loop and the moves into the spawning routine |
Market
| |
BuyAndSellCargo (Bank 0) | Process the buying and selling of cargo on the Market Price screen |
dn (Bank 0) | Print the amount of money we have left in the cash pot |
HighlightSaleItem (Bank 0) | Highlight the name, price and availability of a market item on the correct row for the chosen language |
PrintCash (Bank 0) | Print our cash levels in the correct place for the chosen language |
PrintMarketItem (Bank 0) | Print the name, price and availability of a market item on the correct row for the chosen language |
PrintNumberInHold (Bank 0) | Print the number of units of a specified item that we have in the hold |
tnpr (Bank 0) | Work out if we have space for a specific amount of cargo |
tnpr1 (Bank 0) | Work out if we have space for one tonne of cargo |
TT151 (Bank 0) | Print the name, price and availability of a market item |
TT152 (Bank 0) | Print the unit ("t", "kg" or "g") for a market item |
TT160 (Bank 0) | Print "t" (for tonne) and a space |
TT161 (Bank 0) | Print "kg" (for kilograms) |
TT163 (Bank 0) | Print the headers for the table of market prices |
TT167 (Bank 0) | Show the Market Price screen |
TT16a (Bank 0) | Print "g" (for grams) |
TT210 (Bank 0) | Show a list of current cargo in our hold, optionally to sell |
TT213 (Bank 0) | Show the Inventory screen |
var (Bank 0) | Calculate QQ19+3 = economy * |economic_factor| |
Maths (Arithmetic)
| |
ADD (Bank 7) | Calculate (A X) = (A P) + (S R) |
DORND (Bank 7) | Generate random numbers |
DORND2 (Bank 7) | Make sure the C flag doesn't affect the outcome |
DV41 (Bank 7) | Calculate (P R) = 256 * DELTA / A |
DV42 (Bank 7) | Calculate (P R) = 256 * DELTA / z_hi |
DVID3B2 (Bank 7) | Calculate K(3 2 1 0) = (A P+1 P) / (z_sign z_hi z_lo) |
DVID4 (Bank 7) | Calculate (P R) = 256 * A / Q |
DVIDT (Bank 1) | Calculate (P+1 A) = (A P) / Q |
FMLTU (Bank 7) | Calculate A = A * Q / 256 |
FMLTU2 (Bank 7) | Calculate A = K * sin(A) |
GC2 (Bank 0) | Calculate (Y X) = (A P) * 4 |
LCASH (Bank 0) | Subtract an amount of cash from the cash pot |
LL120 (Bank 1) | Calculate (Y X) = (S x1_lo) * XX12+2 or (S x1_lo) / XX12+2 |
LL121 (Bank 1) | Calculate (Y X) = (S R) / Q and set the sign to the opposite of the top byte on the stack |
LL122 (Bank 1) | Calculate (Y X) = (S R) * Q and set the sign to the opposite of the top byte on the stack |
LL123 (Bank 1) | Calculate (Y X) = (S R) / XX12+2 or (S R) * XX12+2 |
LL128 (Bank 1) | Contains an RTS |
LL129 (Bank 1) | Calculate Q = XX12+2, A = S EOR XX12+3 and (S R) = |S R| |
LL133 (Bank 1) | Negate (Y X) and return from the subroutine LL128 Contains an RTS |
LL28 (Bank 7) | Calculate R = 256 * A / Q |
LL28+4 (Bank 7) | Skips the A >= Q check and always returns with C flag cleared, so this can be called if we know the division will work |
LL38 (Bank 1) | Calculate (S A) = (S R) + (A Q) |
LL5 (Bank 7) | Calculate Q = SQRT(R Q) |
LL61 (Bank 1) | Calculate (U R) = 256 * A / Q |
LL62 (Bank 1) | Calculate 128 - (U R) |
MAD (Bank 7) | Calculate (A X) = Q * A + (S R) |
MAS3 (Bank 0) | Calculate A = x_hi^2 + y_hi^2 + z_hi^2 in the K% block |
MCASH (Bank 0) | Add an amount of cash to the cash pot |
MLS1 (Bank 7) | Calculate (A P) = ALP1 * A |
MLS2 (Bank 7) | Calculate (S R) = XX(1 0) and (A P) = A * ALP1 |
MLTU2 (Bank 7) | Calculate (A P+1 P) = (A ~P) * Q |
MLTU2-2 (Bank 7) | Set Q to X, so this calculates (A P+1 P) = (A ~P) * X |
MLU1 (Bank 7) | Calculate Y1 = y_hi and (A P) = |y_hi| * Q for Y-th stardust |
MLU2 (Bank 7) | Calculate (A P) = |A| * Q |
MU1 (Bank 7) | Copy X into P and A, and clear the C flag |
MU11 (Bank 7) | Calculate (A P) = P * X |
MU5 (Bank 7) | Set K(3 2 1 0) = (A A A A) and clear the C flag |
MU6 (Bank 7) | Set P(1 0) = (A A) |
MULT1 (Bank 7) | Calculate (A P) = Q * A |
MULT12 (Bank 7) | Calculate (S R) = Q * A |
MULT3 (Bank 7) | Calculate K(3 2 1 0) = (A P+1 P) * Q |
MULTS-2 (Bank 7) | Calculate (A P) = X * A |
MULTU (Bank 7) | Calculate (A P) = P * Q |
MUT1 (Bank 7) | Calculate R = XX and (A P) = Q * A |
MUT2 (Bank 7) | Calculate (S R) = XX(1 0) and (A P) = Q * A |
MUT3 (Bank 7) | An unused routine that does the same as MUT2 |
SPS2 (Bank 0) | Calculate X = A / 16 |
SQUA (Bank 7) | Clear bit 7 of A and calculate (A P) = A * A |
SQUA2 (Bank 7) | Calculate (A P) = A * A |
TAS1 (Bank 0) | Calculate K3 = (x_sign x_hi x_lo) - V(1 0) |
TIS1 (Bank 7) | Calculate (A ?) = (-X * A + (S R)) / 96 |
TIS2 (Bank 7) | Calculate A = A / Q |
TIS3 (Bank 1) | Calculate -(nosev_1 * roofv_1 + nosev_2 * roofv_2) / nosev_3 |
TT113 (Bank 0) | Contains an RTS |
VCSU1 (Bank 0) | Calculate vector K3(8 0) = [x y z] - coordinates of the sun or space station |
VCSUB (Bank 0) | Calculate vector K3(8 0) = [x y z] - coordinates in (A V) |
Maths (Geometry)
| |
ARCTAN (Bank 1) | Calculate A = arctan(P / Q) |
FAROF (Bank 0) | Compare x_hi, y_hi and z_hi with 224 |
FAROF2 (Bank 7) | Compare x_hi, y_hi and z_hi with A |
LL51 (Bank 1) | Calculate the dot product of XX15 and XX16 |
m (Bank 0) | Do not include A in the calculation |
MA9 (Bank 0) | Contains an RTS |
MAS1 (Bank 0) | Add an orientation vector coordinate to an INWK coordinate |
MAS2 (Bank 0) | Calculate a cap on the maximum distance to the planet or sun |
MAS4 (Bank 0) | Calculate a cap on the maximum distance to a ship |
NO1 (Bank 7) | Contains an RTS |
NORM (Bank 7) | Normalise the three-coordinate vector in XX15 |
PROJ (Bank 7) | Project the current ship or planet onto the screen |
SPS1 (Bank 0) | Calculate the vector to the planet and store it in XX15 |
SPS1+1 (Bank 0) | A BRK instruction |
SPS3 (Bank 0) | Copy a space coordinate from the K% block into K3 |
SPS4 (Bank 0) | Calculate the vector to the space station |
TA2 (Bank 0) | Calculate the length of the vector in XX15 (ignoring the low coordinates), returning it in Q |
TAS2 (Bank 0) | Normalise the three-coordinate vector in K3 |
TAS3 (Bank 7) | Calculate the dot product of XX15 and an orientation vector |
TAS4 (Bank 0) | Calculate the dot product of XX15 and one of the space station's orientation vectors |
TAS6 (Bank 0) | Negate the vector in XX15 so it points in the opposite direction |
TIDY (Bank 1) | Orthonormalise the orientation vectors for a ship |
TIDY_b1 (Bank 7) | Call the TIDY routine in ROM bank 1 |
Missions
| |
BAYSTEP (Bank 0) | Go to the docking bay (i.e. show the Status Mode screen) |
BRIEF (Bank 0) | Start mission 1 and show the mission briefing |
BRIEF2 (Bank 0) | Start mission 2 |
BRIEF3 (Bank 0) | Receive the briefing and plans for mission 2 |
BRIS (Bank 2) | Clear the screen, display "INCOMING MESSAGE" and wait for 2 seconds |
BRIS_b0 (Bank 0) | Clear the screen, display "INCOMING MESSAGE" and wait for 2 seconds |
BRP (Bank 0) | Print an extended token and show the Status Mode screen |
BRPS (Bank 0) | Print the extended token in A, show the Status Mode screen and return from the subroutine |
DEBRIEF (Bank 0) | Finish mission 1 |
DEBRIEF2 (Bank 0) | Finish mission 2 |
PAS1 (Bank 0) | Display a rotating ship at space coordinates (0, 100, 256) and scan the controllers |
PAS1_b0 (Bank 7) | Call the PAS1 routine in ROM bank 0 |
PAUSE (Bank 2) | Display a rotating ship, waiting until a key is pressed, then remove the ship from the screen |
TBRIEF (Bank 0) | Start mission 3 |
THERE (Bank 0) | Check whether we are in the Constrictor's system in mission 1 |
Moving
| |
MV30 (Bank 0) | Move the ship in space but without tidying the orientation vectors or applying tactics |
MV40 (Bank 0) | Rotate the planet or sun's location in space by the amount of pitch and roll of our ship |
MV45 (Bank 0) | Rejoin the MVEIT routine after the rotation, tactics and scanner code |
MVEIT (Part 1 of 9) (Bank 0) | Move current ship: Tidy the orientation vectors |
MVEIT (Part 2 of 9) (Bank 0) | Move current ship: Call tactics routine, remove ship from scanner |
MVEIT (Part 3 of 9) (Bank 0) | Move current ship: Move ship forward according to its speed |
MVEIT (Part 4 of 9) (Bank 0) | Move current ship: Apply acceleration to ship's speed as a one-off |
MVEIT (Part 5 of 9) (Bank 0) | Move current ship: Rotate ship's location by our pitch and roll |
MVEIT (Part 6 of 9) (Bank 0) | Move current ship: Move the ship in space according to our speed |
MVEIT (Part 7 of 9) (Bank 0) | Move current ship: Rotate ship's orientation vectors by pitch/roll |
MVEIT (Part 8 of 9) (Bank 0) | Move current ship: Rotate ship about itself by its own pitch/roll |
MVEIT (Part 9 of 9) (Bank 0) | Move current ship: Redraw on scanner, if it hasn't been destroyed |
MVS4 (Bank 0) | Apply pitch and roll to an orientation vector |
MVS5 (Bank 0) | Apply a 3.6 degree pitch or roll to an orientation vector |
MVS5_b0 (Bank 7) | Call the MVS5 routine in ROM bank 0 |
MVT1 (Bank 0) | Calculate (x_sign x_hi x_lo) = (x_sign x_hi x_lo) + (A R) |
MVT1-2 (Bank 0) | Clear bits 0-6 of A before entering MVT1 |
MVT3 (Bank 0) | Calculate K(3 2 1) = (x_sign x_hi x_lo) + K(3 2 1) |
MVT6 (Bank 0) | Calculate (A P+2 P+1) = (x_sign x_hi x_lo) + (A P+2 P+1) |
SFS2 (Bank 0) | Move a ship in space along one of the coordinate axes |
PPU
| |
ConsiderSendTiles (Bank 7) | If there are enough free cycles, move on to the next stage of sending patterns to the PPU |
RTS1 (Bank 7) | Contains an RTS |
SendBarNamesToPPU (Bank 7) | Send the nametable entries for the icon bar to the PPU |
SendBarNamesToPPUS (Bank 7) | Send the nametable entries for the icon bar to the PPU (this is a jump so we can call this routine using a branch instruction) |
SendBarPatts2ToPPU (Bank 7) | Send pattern data for tiles 64-127 for the icon bar to the PPU, split across multiple calls to the NMI handler if required |
SendBarPattsToPPU (Bank 7) | Send pattern data for tiles 0-127 for the icon bar to the PPU, split across multiple calls to the NMI handler if required |
SendBarPattsToPPUS (Bank 7) | Send the pattern data for the icon bar to the PPU (this is a jump so we can call this routine using a branch instruction) |
SendBitplaneToPPU (Bank 3) | Send a bitplane to the PPU immediately |
SendBitplaneToPPU_b3 (Bank 7) | Call the SendBitplaneToPPU routine in ROM bank 3 |
SendBuffersToPPU (Part 1 of 3) (Bank 7) | Send the icon bar nametable and palette data to the PPU, if it has changed, before moving on to tile data in part 2 |
SendBuffersToPPU (Part 2 of 3) (Bank 7) | If we are already sending tile data to the PPU, pick up where we left off, otherwise jump to part 3 to check for new data to send |
SendBuffersToPPU (Part 3 of 3) (Bank 7) | If we need to send tile nametable and pattern data to the PPU for either bitplane, start doing just that |
SendDashImageToPPU (Bank 3) | Unpack the dashboard image and send it to patterns 69 to 255 in pattern table 0 in the PPU |
SendDataNowToPPU (Bank 3) | Send the specified bitplane buffers to the PPU immediately, without trying to squeeze it into VBlanks |
SendFontImageToPPU (Bank 3) | Send a font to the PPU as a colour 1 font on a colour 0 background (i.e. colour 1 on black) |
SendInventoryToPPU (Bank 7) | Send X batches of 16 bytes from SC(1 0) to the PPU, for sending the inventory icon bar image |
SendNametableNow (Bank 7) | Send the nametable without checking the cycle count |
SendNametableToPPU (Bank 7) | Send the tile nametable to the PPU if there are enough cycles left in the current VBlank |
SendOtherBitplane (Bank 7) | Check whether we should send another bitplane to the PPU |
SendPalettesToPPU (Bank 7) | Send the palette data from XX3 to the PPU |
SendPatternsToPPU (Part 1 of 6) (Bank 7) | Calculate how many patterns we need to send and jump to the most efficient routine for sending them |
SendPatternsToPPU (Part 2 of 6) (Bank 7) | Configure variables for sending data to the PPU one pattern at a time with checks |
SendPatternsToPPU (Part 3 of 6) (Bank 7) | Send pattern data to the PPU for one pattern at a time, checking after each one to see if is the last one |
SendPatternsToPPU (Part 4 of 6) (Bank 7) | Configure variables for sending data to the PPU until we run out of cycles |
SendPatternsToPPU (Part 5 of 6) (Bank 7) | Send pattern data to the PPU for two patterns at a time, until we run out of cycles (and without checking for the last pattern) |
SendPatternsToPPU (Part 6 of 6) (Bank 7) | Save progress for use in the next VBlank and return from the subroutine |
SendScreenToPPU (Bank 7) | Update the screen with the contents of the buffers |
SendScreenToPPU+4 (Bank 7) | Re-entry point following the call to SendPalettesToPPU at the start of the routine |
SendSpaceViewToPPU (Bank 0) | Set a new space view, clear the screen, copy the nametable buffers and configure the PPU for the new view |
SendTilesToPPU (Bank 7) | Set up the variables needed to send the tile nametable and pattern data to the PPU, and then send them |
SendViewToPPU (Bank 3) | Configure the PPU for the view type in QQ11 |
SendViewToPPU_b3 (Bank 7) | Call the SendViewToPPU routine in ROM bank 3 |
SetPPURegisters (Bank 7) | Set PPU_CTRL, PPU_ADDR and PPU_SCROLL for the current hidden bitplane |
SetPPUTablesTo0 (Bank 7) | Set nametable 0 and pattern table 0 for drawing the icon bar |
SetupPPUForIconBar (Bank 7) | If the PPU has started drawing the icon bar, configure the PPU to use nametable 0 and pattern table 0, while preserving A |
SetupSprite0 (Bank 3) | Set the coordinates of sprite 0 so we can detect when the PPU starts to draw the icon bar |
UpdateHangarView (Bank 7) | Update the hangar view on-screen by sending the data to the PPU, either immediately or during VBlank |
UpdateScreen (Bank 7) | Update the screen by sending data to the PPU, either immediately or during VBlank, depending on whether the screen is visible |
WaitForIconBarPPU (Bank 7) | Wait until the PPU starts drawing the icon bar |
WaitForPPUToFinish (Bank 7) | Wait until the NMI handler has finished updating both bitplanes, so the screen is no longer refreshing |
Save and load
| |
ChangeCmdrName (Bank 6) | Process changing the commander name |
ChangeCmdrName_b6 (Bank 7) | Call the ChangeCmdrName routine in ROM bank 6 |
CheckSaveLoadBar (Bank 6) | Check the icon bar buttons on the Save and Load icon bar and process any choices |
CheckSaveSlots (Bank 6) | Load the commanders for all eight save slots, one after the other, to check their integrity and reset any that fail their checksums |
CheckSaveSlots_b6 (Bank 7) | Call the CheckSaveSlots routine in ROM bank 6 |
ClearNameInMiddle (Bank 6) | Remove the commander name from the middle column |
CopyCommanderToBuf (Bank 6) | Copy a commander file in the BUF buffer, either from a save slot or from the currently active commander in-game |
DrawSaveSlotMark (Bank 6) | Draw a slot mark (a dash) next to a saved slot |
DrawSmallLogo (Bank 4) | Set the sprite buffer entries for the small Elite logo on the Save and Load screen |
DrawSmallLogo_b4 (Bank 7) | Call the DrawSmallLogo routine in ROM bank 4 |
FILEPR (Bank 2) | Display the currently selected media (disk or tape) |
GetSaveAddresses (Bank 6) | Fetch the addresses of the three saved parts for a specific save slot |
HighlightSaveName (Bank 6) | Highlight the name of a specific save slot |
JAMESON (Bank 6) | Copy the default "JAMESON" commander to the buffer at currentSlot |
JAMESON_b6 (Bank 7) | Call the JAMESON routine in ROM bank 6 |
MoveInLeftColumn (Bank 6) | Process moving the highlight when it's in the left column (the current commander) |
MoveInMiddleColumn (Bank 6) | Process moving the highlight when it's in the middle column |
MoveInRightColumn (Bank 6) | Process moving the highlight when it's in the right column (the save slots) |
MoveToLeftColumn (Bank 6) | Move the highlight to the left column (the current commander) |
OTHERFILEPR (Bank 2) | Display the non-selected media (disk or tape) |
PrintCommanderName (Bank 6) | Print the commander name from the commander file in BUF, with the save count added to the end |
PrintNameInMiddle (Bank 6) | Print the commander name in the middle column using the highlight font |
PrintSaveHeader (Bank 6) | Print header text for the Save and Load screen |
PrintSaveName (Bank 6) | Print the name of a specific save slot |
ResetCommander (Bank 6) | Reset the current commander to the default "JAMESON" commander |
ResetCommander_b6 (Bank 7) | Call the ResetCommander routine in ROM bank 6 |
ResetSaveBuffer (Bank 6) | Reset the commander file buffer at BUF to the default commander |
ResetSaveBuffer+1 (Bank 6) | Omit the initial PHA (so we can jump here if the value of the preserved A is already on the stack from another routine) |
ResetSaveSlots (Bank 6) | Reset the save slots for all eight save slots, so they will fail their checksums and get reset when they are next checked |
saveHeader1_DE (Bank 6) | The Save and Load screen title in German |
saveHeader1_EN (Bank 6) | The Save and Load screen title in English |
saveHeader1_FR (Bank 6) | The Save and Load screen title in French |
saveHeader2_DE (Bank 6) | The subheaders for the Save and Load screen title in German |
saveHeader2_EN (Bank 6) | The subheaders for the Save and Load screen title in English |
saveHeader2_FR (Bank 6) | The subheaders for the Save and Load screen title in French |
SaveLoadCommander (Bank 6) | Either save the commander from BUF into a save slot, or load the commander from BUF into the game and start the game |
SVE (Bank 6) | Display the Save and Load screen and process saving and loading of commander files |
SVE_b6 (Bank 7) | Call the SVE routine in ROM bank 6 |
UpdateSaveCount (Bank 7) | Update the save counter for the current commander |
UpdateSaveScreen (Bank 6) | Update the Save and Load screen |
Ship hangar
| |
DrawHangarWallLine (Bank 1) | Draw a vertical hangar wall line from top to bottom, stopping when it bumps into existing on-screen content |
HAL3 (Bank 1) | Draw a hangar background line from left to right, stopping when it bumps into existing on-screen content |
HALL (Bank 1) | Draw the ships in the ship hangar, then draw the hangar |
HALL_b1 (Bank 7) | Call the HALL routine in ROM bank 1 |
HANGER (Bank 1) | Display the ship hangar |
HAS1 (Bank 1) | Draw a ship in the ship hangar |
HAS3 (Bank 1) | Draw a hangar background line from right to left |
Sound
| |
ApplyEnvelopeNOISE (Bank 6) | Apply volume and pitch changes to the NOISE channel |
ApplyEnvelopeSQ1 (Bank 6) | Apply volume and pitch changes to the SQ1 channel |
ApplyEnvelopeSQ2 (Bank 6) | Apply volume and pitch changes to the SQ2 channel |
ApplyEnvelopeTRI (Bank 6) | Apply volume and pitch changes to the TRI channel |
BEEP (Bank 7) | Make a short, high beep |
BEEP_b7 (Bank 7) | Call the BEEP routine in ROM bank 7 |
BELL (Bank 2) | Make a standard system beep |
BOOP (Bank 7) | Make a long, low beep |
ChooseMusic (Bank 6) | Set the tune for the background music |
ChooseMusic_b6 (Bank 7) | Call the ChooseMusic routine in ROM bank 6 |
ChooseMusicS (Bank 6) | A jump table entry at the start of bank 6 for the ChooseMusic routine |
EnableSound (Bank 6) | Enable sounds (music and sound effects) |
EnableSoundS (Bank 6) | A jump table entry at the start of bank 6 for the EnableSound routine |
EXNO (Bank 0) | Make the sound of a laser strike on another ship |
EXNO3 (Bank 7) | Make an explosion sound |
FlushSoundChannel (Bank 7) | Flush a specific sound channel |
FlushSoundChannels (Bank 7) | Flush the SQ1, SQ2 and NOISE sound channels |
FlushSpecificSound (Bank 7) | Flush the channels used by a specific sound |
FlushSQ2AndNOISE (Bank 7) | Flush the SQ2 and NOISE sound channels |
MakeHyperSound (Bank 7) | Make the hyperspace sound |
MakeMusic (Bank 6) | Play the current music on the SQ1, SQ2, TRI and NOISE channels |
MakeMusicOnNOISE (Bank 6) | Play the current music on the NOISE channel |
MakeMusicOnSQ1 (Bank 6) | Play the current music on the SQ1 channel |
MakeMusicOnSQ2 (Bank 6) | Play the current music on the SQ2 channel |
MakeMusicOnTRI (Bank 6) | Play the current music on the TRI channel |
MakeScoopSound (Bank 7) | Make the sound of the fuel scoops working |
MakeSound (Bank 6) | Make the current sound effects on the SQ1, SQ2 and NOISE channels |
MakeSoundOnNOISE (Bank 6) | Make the current sound effect on the NOISE channel |
MakeSoundOnSQ1 (Bank 6) | Make the current sound effect on the SQ1 channel |
MakeSoundOnSQ2 (Bank 6) | Make the current sound effect on the SQ2 channel |
MakeSounds (Bank 6) | Make the current sounds (music and sound effects) |
MakeSounds_b6 (Bank 7) | Call the MakeSounds routine in ROM bank 6 |
MakeSoundsAtVBlank (Bank 7) | Wait for the next VBlank and make the current sounds (music and sound effects) |
MakeSoundsS (Bank 6) | A jump table entry at the start of bank 6 for the MakeSounds routine |
NOISE (Bank 7) | Make the sound effect whose number is in Y |
ResetMusic (Bank 7) | Reset the current tune to the default and stop all sounds (music and sound effects) |
ResetMusicAfterNMI (Bank 7) | Wait for the next NMI before resetting the current tune to 0 and stopping the music |
RTS8 (Bank 7) | Contains an RTS |
StartEffect (Bank 6) | Start making a sound effect on the specified channel |
StartEffect_b6 (Bank 7) | Call the StartEffect routine in ROM bank 6 |
StartEffect_b7 (Bank 7) | Call the StartEffect routine |
StartEffectOnNOISE (Bank 6) | Make a sound effect on the NOISE channel |
StartEffectOnNOISES (Bank 6) | A jump table entry at the start of bank 6 for the StartEffectOnNOISE routine |
StartEffectOnSQ1 (Bank 6) | Make a sound effect on the SQ1 channel |
StartEffectOnSQ1S (Bank 6) | A jump table entry at the start of bank 6 for the StartEffectOnSQ1 routine |
StartEffectOnSQ2 (Bank 6) | Make a sound effect on the SQ2 channel |
StartEffectOnSQ2S (Bank 6) | A jump table entry at the start of bank 6 for the StartEffectOnSQ2 routine |
StopSounds (Bank 6) | Stop all sounds (music and sound effects) |
StopSounds_b6 (Bank 7) | Call the StopSounds routine in ROM bank 6 |
StopSoundsS (Bank 6) | A jump table entry at the start of bank 6 for the StopSounds routine |
UpdateVibratoSeeds (Bank 6) | Update the sound seeds that are used to randomise the vibrato effect |
Stardust
| |
FLIP (Bank 0) | Reflect the stardust particles in the screen diagonal |
HideStardust (Bank 7) | Hide the stardust sprites |
nWq (Bank 0) | Create a random cloud of stardust |
NWSTARS (Bank 0) | Initialise the stardust field |
ResetStardust (Bank 0) | Hide the sprites for the stardust |
STARS (Bank 1) | The main routine for processing the stardust |
STARS1 (Bank 1) | Process the stardust for the front view |
STARS2 (Bank 1) | Process the stardust for the left or right view |
STARS6 (Bank 1) | Process the stardust for the rear view |
STARS_b1 (Bank 7) | Call the STARS routine in ROM bank 1 |
Start and end
| |
BEGIN (Bank 7) | Run through the NES initialisation process, reset the variables and start the game |
BR1 (Bank 0) | Reset a number of variables, ready to start a new game |
ChooseLanguage (Bank 6) | Draw the Start screen and process the language choice |
ChooseLanguage_b6 (Bank 7) | Call the ChooseLanguage routine in ROM bank 6 |
DEATH (Bank 0) | Display the death screen |
DEATH2 (Bank 0) | Reset most of the game and restart from the title screen |
DEATH2_b0 (Bank 7) | Switch to ROM bank 0 and call the DEATH2 routine |
DrawBigLogo (Bank 4) | Set the pattern and nametable buffer entries for the big Elite logo on the Start screen |
DrawBigLogo_b4 (Bank 7) | Call the DrawBigLogo routine in ROM bank 4 |
DrawTitleScreen (Bank 7) | Draw a sequence of rotating ships on-screen while checking for button presses on the controllers |
Interrupts_b0 (Bank 0) | The IRQ and NMI handler while the MMC1 mapper reset routine is still running |
Interrupts_b1 (Bank 1) | The IRQ and NMI handler while the MMC1 mapper reset routine is still running |
Interrupts_b2 (Bank 2) | The IRQ and NMI handler while the MMC1 mapper reset routine is still running |
Interrupts_b3 (Bank 3) | The IRQ and NMI handler while the MMC1 mapper reset routine is still running |
Interrupts_b4 (Bank 4) | The IRQ and NMI handler while the MMC1 mapper reset routine is still running |
Interrupts_b5 (Bank 5) | The IRQ and NMI handler while the MMC1 mapper reset routine is still running |
Interrupts_b6 (Bank 6) | The IRQ and NMI handler while the MMC1 mapper reset routine is still running |
RES2 (Bank 0) | Reset a number of flight variables and workspaces |
RESET (Bank 0) | Reset most variables |
ResetMMC1_b0 (Bank 0) | The MMC1 mapper reset routine at the start of the ROM bank |
ResetMMC1_b1 (Bank 1) | The MMC1 mapper reset routine at the start of the ROM bank |
ResetMMC1_b2 (Bank 2) | The MMC1 mapper reset routine at the start of the ROM bank |
ResetMMC1_b3 (Bank 3) | The MMC1 mapper reset routine at the start of the ROM bank |
ResetMMC1_b4 (Bank 4) | The MMC1 mapper reset routine at the start of the ROM bank |
ResetMMC1_b5 (Bank 5) | The MMC1 mapper reset routine at the start of the ROM bank |
ResetMMC1_b6 (Bank 6) | The MMC1 mapper reset routine at the start of the ROM bank |
ResetOptions (Bank 7) | Reset the game options to their default values |
ResetScreen (Bank 3) | Reset the screen by clearing down the PPU, setting all colours to black, and resetting the screen-related variables |
ResetScreen_b3 (Bank 7) | Call the ResetScreen routine in ROM bank 3 |
ResetToStartScreen (Bank 7) | Reset the stack and the game's variables and show the Start screen |
ResetVariables (Bank 7) | Reset all the RAM (in both the NES and cartridge), initialise all the game's variables, and switch to ROM bank 0 |
SetChosenLanguage (Bank 6) | Set the language-related variables according to the language chosen on the Start screen |
SetLanguage (Bank 6) | Set the language-related variables for a specific language |
SetupAfterLoad (Bank 0) | Configure the game following a commander file load |
SetupAfterLoad_b0 (Bank 7) | Call the SetupAfterLoad routine in ROM bank 0 |
ShowStartScreen (Bank 0) | Show the start screen and start the game |
StartGame (Bank 0) | Reset the stack and game variables, and start the game by going to the docking bay |
StartGame_b0 (Bank 7) | Switch to ROM bank 0 and call the StartGame routine |
TITLE (Bank 0) | Display a title screen with a rotating ship and prompt |
Status
| |
BAD (Bank 0) | Calculate how bad we have been |
BAY (Bank 0) | Go to the docking bay (i.e. show the Status Mode screen) |
cmn (Bank 0) | Print the commander's name |
cmn-1 (Bank 0) | Contains an RTS |
csh (Bank 0) | Print the current amount of cash |
DrawCmdrImage (Bank 6) | Draw the commander image as a coloured face image in front of a greyscale headshot image, with optional embellishments |
DrawCmdrImage_b6 (Bank 7) | Call the DrawCmdrImage routine in ROM bank 6 |
DrawGlasses (Bank 6) | Draw a pair of dark glasses on the commander image |
DrawLeftEarring (Bank 6) | Draw an earring in the commander's left ear (i.e. on the right side of the commander image |
DrawMedallion (Bank 6) | Draw a medallion on the commander image |
DrawRightEarring (Bank 6) | Draw an earring in the commander's right ear (i.e. on the left side of the commander image |
EXNO2 (Bank 0) | Process us making a kill |
fwl (Bank 0) | Print fuel and cash levels |
GetCmdrImage (Bank 4) | Fetch the headshot image for the commander and store it in the pattern buffers, and send the face and glasses images to the PPU |
GetCmdrImage_b4 (Bank 7) | Call the GetCmdrImage routine in ROM bank 4 |
GetHeadshot (Bank 4) | Fetch the headshot image for the commander and store it in the pattern buffers, starting at pattern number picturePattern |
GetHeadshot_b4 (Bank 7) | Call the GetHeadshot routine in ROM bank 4 |
GetHeadshotType (Bank 4) | Get the correct headshot number for the current combat rank and status condition |
GetHeadshotType_b4 (Bank 7) | Call the GetHeadshotType routine in ROM bank 4 |
GetStatusCondition (Bank 7) | Calculate our ship's status condition |
IncreaseTally (Bank 7) | Add the kill count to the fractional and low bytes of our combat rank tally following a kill |
PCASH (Bank 0) | Print the amount of cash only |
PrintCombatRank (Bank 0) | Print the current combat rank |
PrintLegalStatus (Bank 0) | Print the current legal status (clean, offender or fugitive) |
STATUS (Bank 0) | Show the Status Mode screen |
Tactics
| |
ANGRY (Bank 0) | Make a ship hostile |
fq1 (Bank 0) | Used to add a cargo canister to the universe |
FR1 (Bank 0) | Display the "missile jammed" message |
FR1-2 (Bank 0) | Clear the C flag and return from the subroutine |
FRMIS (Bank 0) | Fire a missile from our ship |
FRS1 (Bank 0) | Launch a ship straight ahead of us, below the laser sights |
GOPL (Bank 0) | Make the ship head towards the planet |
HI1 (Bank 0) | Contains an RTS |
HITCH (Bank 0) | Work out if the ship in INWK is in our crosshairs |
SFRMIS (Bank 0) | Add an enemy missile to our local bubble of universe |
TA151 (Bank 0) | Make the ship head towards the planet |
TACTICS (Part 1 of 7) (Bank 0) | Apply tactics: Process missiles, both enemy missiles and our own |
TACTICS (Part 2 of 7) (Bank 0) | Apply tactics: Escape pod, station, lone Thargon, safe-zone pirate |
TACTICS (Part 3 of 7) (Bank 0) | Apply tactics: Calculate dot product to determine ship's aim |
TACTICS (Part 4 of 7) (Bank 0) | Apply tactics: Check energy levels, maybe launch escape pod if low |
TACTICS (Part 5 of 7) (Bank 0) | Apply tactics: Consider whether to launch a missile at us |
TACTICS (Part 6 of 7) (Bank 0) | Apply tactics: Consider firing a laser at us, if aim is true |
TACTICS (Part 7 of 7) (Bank 0) | Apply tactics: Set pitch, roll, and acceleration |
Text
| |
BPRNT (Bank 0) | Print a 32-bit number, left-padded to a specific number of digits, with an optional decimal point |
CHPR (Part 1 of 6) (Bank 2) | Print a character at the text cursor by poking into screen memory |
CHPR (Part 2 of 6) (Bank 2) | Jump to the right part of the routine depending on whether the font pattern we need is already loaded |
CHPR (Part 3 of 6) (Bank 2) | Draw a character into the pattern buffers to show the character on-screen |
CHPR (Part 4 of 6) (Bank 2) | Process the delete character |
CHPR (Part 5 of 6) (Bank 2) | Print the character using a font that has already been loaded |
CHPR (Part 6 of 6) (Bank 2) | Print a character in the space view when the relevant font is not loaded, merging the text with whatever is already on-screen |
CHPR_b2 (Bank 7) | Call the CHPR routine in ROM bank 2 |
DASC (Bank 2) | DASC does exactly the same as TT26 and prints a character at the text cursor, with support for verified text in extended tokens |
DASC_b2 (Bank 7) | Call the DASC routine in ROM bank 2 |
DETOK (Bank 2) | Print an extended recursive token from the TKN1 token table |
DETOK2 (Bank 2) | Print an extended text token (1-255) |
DETOK3 (Bank 2) | Print an extended recursive token from the RUTOK token table |
DETOK_b2 (Bank 7) | Call the DETOK routine in ROM bank 2 |
DisableJustifyText (Bank 0) | Turn off justified text and reset the justified text buffer |
DTEN (Bank 2) | Print recursive token number X from the token table pointed to by (A V), used to print tokens from the RUTOK table via calls to DETOK3 |
DTS (Bank 2) | Print a single letter in the correct case |
DTS_b2 (Bank 7) | Call the DTS routine in ROM bank 2 |
ex (Bank 2) | Print a recursive token |
ex_b2 (Bank 7) | Call the ex routine in ROM bank 2 |
fwls (Bank 0) | Print fuel and cash levels |
LoadHighFont (Bank 3) | Load the highlight font into the pattern buffer from pattern 161 to 255 |
LoadHighFont_b3 (Bank 7) | Call the LoadHighFont routine in ROM bank 3 |
LoadNormalFont (Bank 3) | Load the normal font into the pattern buffer from pattern 66 to 160 |
LoadNormalFont_b3 (Bank 7) | Call the LoadNormalFont routine in ROM bank 3 |
MT1 (Bank 2) | Switch to ALL CAPS when printing extended tokens |
MT13 (Bank 2) | Switch to lower case when printing extended tokens |
MT14 (Bank 2) | Switch to justified text when printing extended tokens |
MT15 (Bank 2) | Switch to left-aligned text when printing extended tokens |
MT16 (Bank 2) | Print the character in variable DTW7 |
MT17 (Bank 2) | Print the selected system's adjective, e.g. Lavian for Lave |
MT18 (Bank 2) | Print a random 1-8 letter word in Sentence Case |
MT19 (Bank 2) | Capitalise the next letter |
MT2 (Bank 2) | Switch to Sentence Case when printing extended tokens |
MT23 (Bank 2) | Move to row 9 and switch to lower case when printing extended tokens |
MT26 (Bank 2) | Print a space and capitalise the next letter |
MT27 (Bank 2) | Print the captain's name during mission briefings |
MT28 (Bank 2) | Print the location hint during the mission 1 briefing |
MT29 (Bank 2) | Move to row 7 and switch to lower case when printing extended tokens |
MT5 (Bank 2) | Switch to extended tokens |
MT6 (Bank 2) | Switch to standard tokens in Sentence Case |
MT8 (Bank 2) | Tab to column 6 and start a new word when printing extended tokens |
MT9 (Bank 2) | Clear the screen and set the view type for a text-based mission briefing |
PDESC_b2 (Bank 7) | Call the PDESC routine in ROM bank 2 |
plf (Bank 0) | Print a text token followed by a newline |
pr2 (Bank 0) | Print an 8-bit number, left-padded to 3 digits, and optional point |
pr2+2 (Bank 0) | Print the 8-bit number in X to the number of digits in A |
pr5 (Bank 0) | Print a 16-bit number, left-padded to 5 digits, and optional point |
pr6 (Bank 0) | Print 16-bit number, left-padded to 5 digits, no point |
Print2Spaces (Bank 0) | Print two spaces |
Print4Spaces (Bank 0) | An unused routine that prints four spaces |
PrintCharacter (Bank 0) | An unused routine that prints a character and sets the C flag |
PrintCrTab (Bank 0) | Print a newline and the correct indent for Status Mode entries in the chosen language |
PrintCtrlCode (Bank 0) | Print a control code (in the range 0 to 9) |
PrintCtrlCode_b0 (Bank 7) | Call the PrintCtrlCode routine in ROM bank 0 |
PrintFlightMessage (Bank 0) | Print an in-flight message |
PrintMessage (Bank 0) | Print a message in the middle of the screen (used for "GAME OVER" and demo missile messages only) |
PrintSpaceAndToken (Bank 0) | Print a space followed by a text token |
PrintSpacedHyphen (Bank 0) | Print two spaces, then a "-", and then another two spaces |
PrintSpaceViewName (Bank 0) | Print the name of the current space view |
PrintTokenAndColon (Bank 0) | Print a character followed by a colon, ensuring that the colon is always drawn in colour 3 on a black background |
PrintTokenCrTab (Bank 0) | Print a token, a newline and the correct indent for Status Mode entries in the chosen language |
prq (Bank 0) | Print a text token followed by a question mark |
prq+3 (Bank 0) | Print a question mark |
qw (Bank 2) | Print a recursive token in the range 128-145 |
RTS5 (Bank 0) | Contains an RTS |
spc (Bank 0) | Print a text token followed by a space |
StoreMessage (Bank 0) | Copy a message from the justified text buffer at BUF into the message buffer |
tals (Bank 0) | Print the current galaxy number |
TT11 (Bank 0) | Print a 16-bit number, left-padded to n digits, and optional point |
TT162 (Bank 0) | Print a space |
TT162+2 (Bank 0) | Jump to TT27 to print the text token in A |
TT26 (Bank 2) | Print a character at the text cursor, with support for verified text in extended tokens |
TT27 (Bank 2) | Print a text token |
TT27_b2 (Bank 7) | Call the TT27 routine in ROM bank 2 |
TT41 (Bank 2) | Print a letter according to Sentence Case |
TT42 (Bank 2) | Print a letter in lower case |
TT43 (Bank 2) | Print a two-letter token or recursive token 0-95 |
TT44 (Bank 2) | Jumps to TT26 to print the character in A (used to enable us to use a branch instruction to jump to TT26) |
TT45 (Bank 2) | Print a letter in lower case |
TT48 (Bank 2) | Contains an RTS |
TT60 (Bank 0) | Print a text token and a paragraph break |
TT67 (Bank 0) | Print a newline |
TT68 (Bank 0) | Print a text token followed by a colon |
TT69 (Bank 0) | Set Sentence Case and print a newline |
TT73 (Bank 0) | Print a colon |
TTX69 (Bank 0) | Print a paragraph break |
VOWEL (Bank 2) | Test whether a character is a vowel |
ypls (Bank 0) | Print the current system name |
Universe
| |
cpl (Bank 0) | Print the selected system name |
DrawSystemImage (Bank 3) | Draw the system image as a coloured foreground in front of a greyscale background |
DrawSystemImage_b3 (Bank 7) | Call the DrawSystemImage routine in ROM bank 3 |
GetSystemBack (Bank 5) | Fetch the background image for the current system and store it in the pattern buffers |
GetSystemBack_b5 (Bank 7) | Call the GetSystemBack routine in ROM bank 5 |
GetSystemImage (Bank 5) | Fetch the background image and foreground sprite for the current system image and send them to the pattern buffers and PPU |
GetSystemImage_b5 (Bank 7) | Call the GetSystemImage routine in ROM bank 5 |
GINF (Bank 7) | Fetch the address of a ship's data block into INF |
GTHG (Bank 0) | Spawn a Thargoid ship and a Thargon companion |
GTHG+15 (Bank 0) | Spawn a lone Thargoid, without a Thargon companion and with slightly less aggression than normal |
GVL (Bank 0) | Calculate the availability of market items |
hy5 (Bank 0) | Contains an RTS |
hyp1 (Bank 0) | Process a jump to the system closest to (QQ9, QQ10) |
hyp1+3 (Bank 0) | Jump straight to the system at (QQ9, QQ10) without first calculating which system is closest. We do this if we already know that (QQ9, QQ10) points to a system |
hyR (Bank 0) | Contains an RTS |
jmp (Bank 0) | Set the current system to the selected system |
KILLSHP (Bank 0) | Remove a ship from our local bubble of universe |
KS1 (Bank 0) | Remove the current ship from our local bubble of universe |
KS2 (Bank 0) | Check the local bubble for missiles with target lock |
KS3 (Bank 0) | Contains an RTS |
KS4 (Bank 0) | Remove the space station and replace it with the sun |
NwS1 (Bank 0) | Flip the sign and double an INWK byte |
NWSHP (Bank 0) | Add a new ship to our local bubble of universe |
NWSPS (Bank 0) | Add a new space station to our local bubble of universe |
PDESC (Bank 2) | Print the system's extended description or a mission 1 directive |
ping (Bank 0) | Set the selected system to the current system |
RemoveShip (Bank 0) | Fetch a ship data block and remove that ship from our local bubble of universe |
RTS6 (Bank 0) | Contains an RTS |
SelectNearbySystem (Bank 0) | Set the current system to the nearest system and update the selected system flags accordingly |
SetCurrentSystem (Bank 0) | Set the seeds for the selected system to the system that we last snapped the crosshairs to |
SetSelectedSeeds (Bank 0) | Set the seeds for the selected system in QQ15 to the seeds in the safehouse |
SetSelectedSystem (Bank 0) | Set the selected system to the nearest system, if we don't already have a selected system |
SetSelectionFlags (Bank 0) | Set the selected system flags for the currently selected system and update the icon bar if required |
SFS1 (Bank 0) | Spawn a child ship from the current (parent) ship |
SFS1-2 (Bank 0) | Add a missile to the local bubble that has AI enabled, is hostile, but has no E.C.M. |
SOLAR (Bank 0) | Set up various aspects of arriving in a new system |
SOS1 (Bank 0) | Update the missile indicators, set up the planet data block |
SpawnSpaceStation (Bank 0) | Add a space station to the local bubble of universe if we are close enough to the station's orbit |
SPIN (Bank 0) | Randomly spawn cargo from a destroyed ship |
SPIN2 (Bank 0) | Remove any randomness: spawn cargo of a specific type (given in X), and always spawn the number given in A |
tal (Bank 0) | Print the current galaxy number |
TT111 (Bank 0) | Set the current system to the nearest system to a point |
TT111-1 (Bank 0) | Contains an RTS |
TT146 (Bank 0) | Print the distance to the selected system in light years |
TT20 (Bank 0) | Twist the selected system's seeds four times |
TT24 (Bank 6) | Calculate system data from the system seeds |
TT24_b6 (Bank 7) | Call the TT24 routine in ROM bank 6 |
TT25 (Bank 0) | Show the Data on System screen |
TT54 (Bank 0) | Twist the selected system's seeds |
TT70 (Bank 0) | Display "MAINLY " and jump to TT72 |
TT72 (Bank 0) | Used by TT70 to re-enter the routine after displaying "MAINLY" for the economy type |
TT81 (Bank 0) | Set the selected system's seeds to those of system 0 |
ypl (Bank 0) | Print the current system name |
ypl-1 (Bank 0) | Contains an RTS |
Ze (Bank 7) | Initialise the INWK workspace to a hostile ship |
ZINF (Bank 0) | Reset the INWK workspace and orientation vectors |
ZINF_b1 (Bank 1) | Reset the INWK workspace and orientation vectors |
Utility routines
| |
ClearMemory (Bank 7) | Clear a block of memory, split across multiple calls if required |
CopyLargeBlock (Bank 7) | An unused routine that copies a large number of pages in memory |
CopySmallBlock (Bank 7) | An unused routine that copies a small number of pages in memory |
DELAY (Bank 7) | Wait until a specified number of NMI interrupts have passed (i.e. a specified number of VBlanks) |
FillMemory (Bank 7) | Fill a block of memory with a specified value |
FillMemory32Bytes (Bank 7) | Fill a 32-byte block of memory with a specified value |
IRQ (Bank 7) | Handle IRQ interrupts by doing nothing |
NMI (Bank 7) | The NMI interrupt handler that gets called every VBlank and which updates the screen, reads the controllers and plays music |
ResetBank (Bank 7) | Retrieve a ROM bank number from the stack and page that bank into memory at $8000 |
ResetBankA (Bank 7) | Page a specified bank into memory at $8000 while preserving the value of A |
ResetBankP (Bank 7) | Page a specified bank into memory at $8000 while preserving the value of A and the processor flags |
RTS4 (Bank 7) | Contains an RTS |
SetAXTo15 (Bank 0) | An unused routine that sets A and X to 15 |
SetBank (Bank 7) | Page a specified ROM bank into memory at $8000 |
SetBank0 (Bank 7) | Page ROM bank 0 into memory at $8000 |
SetNonZeroBank (Bank 7) | An unused routine that pages a specified ROM bank into memory at $8000, but only if it is non-zero |
SetupMMC1 (Bank 7) | Configure the MMC1 mapper and page ROM bank 0 into memory at $8000 |
UnpackToPPU (Bank 7) | Unpack compressed image data and send it to the PPU |
UnpackToPPU+2 (Bank 7) | Unpack data from offset Y onwards |
UnpackToRAM (Bank 7) | Unpack compressed image data to RAM |
UpdateNMITimer (Bank 7) | Update the NMI timer, which we can use to keep track of time for places like the combat demo |
WaitFor2NMIs (Bank 7) | Wait until two NMI interrupts have passed (i.e. the next two VBlanks) |
WaitFor3xVBlank (Bank 7) | Wait for three VBlanks to pass |
WaitForNextNMI (Bank 7) | An unused routine that waits until the NMI counter increments (i.e. the next VBlank) |
WaitForNMI (Bank 7) | Wait until the next NMI interrupt has passed (i.e. the next VBlank) |
WaitForVBlank (Bank 7) | Wait for the next VBlank to pass |
ZERO (Bank 0) | Reset the local bubble of universe and ship status |