Skip to navigation

Map of the source code

This page contains a map of all the routines and variables in the original version of The Sentinel, in the order in which they appear in the original source. The source files are structured like this:

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

Workspaces
----------

CategoryDetails

Workspaces

Workspace: Zero page

Mainly temporary variables that are used a lot

Workspaces

Workspace: Stack variables

Variables that share page 1 with the stack

The Sentinel A
--------------

CategoryDetails

Landscape

Variable: tileData

Altitude and shape data for landscape tiles

3D objects

Variable: xObject

The x-coordinates in 3D space for the 3D objects

3D objects

Variable: yObjectHi

The y-coordinates in 3D space for the 3D objects (high byte)

3D objects

Variable: zObject

The z-coordinates in 3D space for the 3D objects

3D objects

Variable: objectYawAngle

The yaw angle for each object (i.e. the horizontal direction in which they are facing)

3D objects

Variable: yObjectLo

The y-coordinates in 3D space for the 3D objects (low byte)

3D objects

Variable: objectTypes

The object types table for up to 64 objects

Drawing the landscape

Variable: drawViewPitchLo

Storage for the pitch angles of tiles and object points for drawing the current landscape view (low bytes)

Drawing the landscape

Variable: drawViewPitchHi

Storage for the pitch angles of tiles and object points for drawing the current landscape view (high bytes)

Drawing polygons

Variable: xPolygonPointHi

Pixel x-coordinates for all the points in the polygon that we are currently drawing (high bytes)

Drawing the landscape

Variable: drawViewYawLo

Storage for the yaw angles of tiles and object points for drawing the current landscape view (low bytes)

Workspaces

Workspace: Main variable workspace

The main block of game variables

Setup

Subroutine: NMIHandler

The NMI handler at the start of the NMI workspace

Main game loop

Variable: irq1Address

Stores the previous value of IRQ1V before we install our custom IRQ handler

Maths (Arithmetic)

Subroutine: Multiply8x8

Calculate (A T) = T * U

Maths (Geometry)

Subroutine: GetAngleFromCoords (Part 1 of 3)

Given the coordinates along two axes, calculate the pitch or yaw angle to those coordinates

Maths (Geometry)

Subroutine: GetAngleFromCoords (Part 2 of 3)

Overflow and accuracy calculations

Maths (Geometry)

Subroutine: GetAngleFromCoords (Part 3 of 3)

Calculate the arctangent to get the angle

Maths (Geometry)

Subroutine: GetRotationMatrix (Part 1 of 5)

Calculate the rotation matrix for rotating the pitch or yaw angle for the sights into the global 3D coordinate system

Maths (Geometry)

Subroutine: GetRotationMatrix (Part 2 of 5)

Calculate sin(H G) for smaller angles

Maths (Geometry)

Subroutine: GetRotationMatrix (Part 3 of 5)

Calculate sin(H G) for bigger angles

Maths (Geometry)

Subroutine: GetRotationMatrix (Part 4 of 5)

Loop back to calculate cos instead of sin

Maths (Geometry)

Subroutine: GetRotationMatrix (Part 5 of 5)

Apply the correct signs to the result

Maths (Geometry)

Variable: xStoreMatrix

Temporary storage for X so it can be preserved through calls to GetRotationMatrix

Cracker protection

Subroutine: CrackerSeed

Obfuscated storage for the high byte of the landscape number as part of the anti-cracker code

Maths (Geometry)

Subroutine: GetAngleInRadians

Convert a 16-bit angle into radians, restricted to a quarter circle

Maths (Arithmetic)

Subroutine: Multiply8x16

Multiply an 8-bit and a 16-bit number

Keyboard

Subroutine: ScanKeyboard

Scan the keyboard for a specific key press

Maths (Geometry)

Subroutine: GetSineAndCosine

Calculate the sine and the cosine of an angle

Maths (Arithmetic)

Subroutine: Multiply16x16

Multiply a sign-magnitude 16-bit number and a signed 16-bit number

Maths (Arithmetic)

Subroutine: Absolute16Bit

Calculate the absolute value (modulus) of a 16-bit number

Maths (Arithmetic)

Subroutine: Negate16Bit

Negate a 16-bit number

Main title loop

Subroutine: MainTitleLoop

The main title loop: display the title screen, fetch the landscape number/code, preview the landscape and jump to the main game loop

Main title loop

Subroutine: SecretCodeError

Display the "WRONG SECRET CODE" error, wait for a key press and rejoin the main title loop

Landscape

Variable: secretCode0000

The secret entry code for landscape 0000 (06045387)

Graphics

Subroutine: ClearScreen

Clear the screen to a specified background

The Sentinel B
--------------

CategoryDetails

Drawing the landscape

Subroutine: PanLandscapeView

Pan the landscape and update the landscape view

Sights

Variable: highestPitchAngle

The pitch angle of the highest point that the player can look at with the sights

Sights

Variable: lowestPitchAngle

The pitch angle of the lowest point that the player can look at with the sights

Main title Loop

Subroutine: ResetVariables

Reset all the game's main variables

Main title Loop

Subroutine: ResetTilesObjects

Reset the tile visibility table and deallocate all object numbers

Keyboard

Subroutine: CheckForKeyPresses

Check for various game key presses and update the key logger and relevant variables (during the interrupt handler)

Keyboard

Subroutine: FocusOnKeyAction

Tell the game to start focusing effort on the action that has been initiated, such as a pan of the landscape, absorb, transfer etc.

Keyboard

Subroutine: CheckForSamePanKey

Check to see whether the same pan key is being held down compared to the last time we checked

Keyboard

Variable: spaceKeyDebounce

A variable to flag whether the SPACE key has been pressed, so we can implement debounce

3D objects

Subroutine: PlaceObjectBelow

Attempt to place an object on a tile that is below the maximum altitude specified in A

Maths (Arithmetic)

Subroutine: GetNextSeed0To30

Set A to the next number from the landscape's sequence of seed numbers, converted to the range 0 to 30

Gameplay

Subroutine: ProcessGameplay

A gameplay loop that processes all game key presses, returning to the main game loop when the player moves, quits, loses or pans

Gameplay

Subroutine: UpdateEnemyTimers

Update the timers that control the enemy tactics

Graphics

Subroutine: ResetScreenAddress

Reset the address of the start of screen memory

Sights

Subroutine: InitialiseSights

Initialise the variables used to manage the sights, so the sights appear in the middle of the screen

Keyboard

Subroutine: ScanForGameKeys

Scan for game key presses and update the key logger

Keyboard

Variable: gameKeys

Negative inkey values for the game keys

Keyboard

Variable: keyLoggerConfig

The configuration table for storing keys the key logger

Title screen

Subroutine: DrawTitleView

Draw the main title screen, the secret code screen or the landscape preview

Title screen

Variable: yTextViewer

The y-coordinate of the viewer for the large 3D text on the title screen

Title screen

Variable: textViewerPitch

The pitch angle of the viewer for the large 3D text on the title screen

Title screen

Variable: xTextViewer

The x-coordinate of the viewer for the large 3D text on the title screen

Title screen

Variable: titleOffset

An offset to apply to the large 3D text for the title screen

Title screen

Variable: zTextViewer

The z-coordinate of the viewer for the large 3D text on the title screen

Title screen

Variable: textViewerYaw

The yaw angle of the viewer for the large 3D text on the title screen

Title screen

Variable: viewType

Storage for the type of title view we are drawing in DrawTitleView (title screen or landscape preview)

Landscape

Subroutine: SpawnEnemies

Calculate the number of enemies for this landscape, add them to the landscape and set the palette accordingly

Landscape

Subroutine: SpawnPlayer

Add the player object to the landscape, ideally placing it below all the enemies and in the bottom half of the landscape

Landscape

Subroutine: SpawnTrees

Add trees to the landscape, ideally placing them below all the enemies in the landscape

Landscape

Subroutine: CheckSecretCode (Part 1 of 2)

Generate the secret code for this landscape and optionally check it against the entered code in the keyboard input buffer

Landscape

Variable: landscapeColour3

Physical colours for colour 3 in the game palette for the different numbers of enemies

Landscape

Subroutine: CheckSecretCode (Part 2 of 2)

Check the results of the secret code matching process, and if the secret codes match, jump to PlayGame to play the game

Landscape

Variable: landscapeColour2

Physical colours for colour 2 in the game palette for the different numbers of enemies

Landscape

Subroutine: AddEnemiesToTiles

Add the required number of enemies to the landscape, starting from the highest altitude and working down, with one enemy per contour

Landscape

Subroutine: GetTilesAtAltitude

Return a list of tile blocks at a specified altitude

Landscape

Variable: leadingBitMask

A table for converting the number of leading clear bits in a number into a bit mask with the same number of leading zeroes

Landscape

Subroutine: GetHighestTiles

Calculate both the highest tiles in each 4x4 block of tiles in the landscape and the altitude of the highest tile in the landscape

Scanner/energy row

Subroutine: UpdateScanner

Update the scanner, if required

Scanner/energy row

Subroutine: UpdateScannerNow

Update the scanner to a new state

Scanner/energy row

Variable: scannerStatic

Storage for a random number that's used to generate static in the scanner

Scanner/energy row

Variable: scannerBlock

A counter for the eight character blocks that make up the scanner

Scanner/energy row

Variable: scannerState

The current state of the scanner (black, static or green)

Scanner/energy row

Variable: scannerPixelByte

Pixel bytes for the three states of the scanner (black, static and green)

Gameplay

Subroutine: ApplyEnemyTactics

Apply tactics to an enemy object, setting things up so the next call applies tactics to the next enemy object

Gameplay

Subroutine: MoveOnToNextEnemy

Update enemyObject so the next time we consider applying enemy tactics, we apply them to the next enemy, looping from 7 to 0

Gameplay

Subroutine: ApplyTactics (Part 1 of 8)

Apply tactics to the Sentinel or a sentry

Gameplay

Subroutine: ApplyTactics (Part 2 of 8)

Process the tactics for a meanie

Gameplay

Subroutine: ApplyTactics (Part 3 of 8)

If the enemy has any residual energy, try expending it onto the landscape in the form of a tree (and end tactics if successful)

Gameplay

Subroutine: ApplyTactics (Part 4 of 8)

If configured, search the landscape for a suitable target for the enemy to drain of energy

Gameplay

Subroutine: ApplyTactics (Part 5 of 8)

Look for a suitable robot to drain of energy, or look for a drainable tree or boulder if there are no suitable robots

Gameplay

Subroutine: ApplyTactics (Part 6 of 8)

Rotate the enemy and make a rotation sound

Gameplay

Subroutine: ApplyTactics (Part 7 of 8)

Drain energy from the enemy's target object, or try scanning for a tree to turn into a meanie if the target's tile is obscured

Gameplay

Subroutine: ApplyTactics (Part 8 of 8)

Redraw the object on the screen, optionally with a dithered effect

The Sentinel C
--------------

CategoryDetails

Gameplay

Subroutine: CheckEnemyGaze (Part 1 of 2)

Check to see whether the current enemy can see a specific target object of a specific type

Cracker protection

Subroutine: AlterCrackerSeed

Create an altered version of the anti-cracker seed-related data, as part of the anti-cracker code

Gameplay

Subroutine: CheckEnemyGaze (Part 2 of 2)

Calculate whether the current enemy can see the specified object

Gameplay

Variable: xStoreEnemyGaze

Temporary storage for X so it can be preserved through calls to CheckEnemyGaze

Gameplay

Subroutine: GetPlayerDrain

Calculate whether the player is being scanned by an enemy and whether the enemy can see the player's tile

Gameplay

Subroutine: ResetMeanieScan

Reset the data stored for any meanie scans that the enemy has tried in the past, so we can start looking with a clean slate

Gameplay

Subroutine: ScanForMeanieTree

Scan through the objects in the landscape to see if any of them are trees that are suitable for turning into a meanie

Gameplay

Subroutine: DrainObjectEnergy

Drain energy from an object into an enemy, transforming it into an object with an energy level of one unit less (if applicable)

Gameplay

Subroutine: ExpendEnemyEnergy

Drain one unit of energy from an enemy and expend it onto the landscape by spawning a tree, if possible

Main game loop

Subroutine: FinishLandscape

Add the player's energy to the landscape number to get the number of the next landscape and display that landscape's secret code

Gameplay

Subroutine: FindObjectToDrain

Find a suitable target object for an enemy to drain

Gameplay

Subroutine: AbortWhenVisible

Abort applying the tactics for this gameplay loop if updating the object on-screen will corrupt a screen pan

Gameplay

Subroutine: FinishEnemyTactics

Stop applying tactics to the current enemy and return to the ProcessGameplay routine to continue with the gameplay loop

Drawing objects

Subroutine: CheckObjVisibility

Check whether an object is visible on-screen and should therefore not be changed if a pan operation is about to happen

Keyboard

Subroutine: ProcessActionKeys (Part 1 of 2)

Process an action key press from key logger entry 1 (absorb, transfer, create, hyperspace, U-turn)

Cracker protection

Subroutine: SetPlayerIsOnTower

Set up the playerIsOnTower value for checking the game is won, as part of the anti-cracker code

Keyboard

Subroutine: ProcessActionKeys (Part 2 of 2)

Process an action key press from key logger entry 1 (absorb, transfer, create, hyperspace, U-turn)

Maths (Geometry)

Subroutine: GetSightsVector

Calculate the angles of the vector from the player's eyes to the sights

Maths (Geometry)

Subroutine: GetVectorForAngles

Convert a vector from pitch and yaw angles into a 3D cartesian vector

Maths (Arithmetic)

Subroutine: MultiplyCoords

Multiply a 16-bit signed number and a 16-bit sign-magnitude value

Maths (Arithmetic)

Subroutine: DivideBy16

Divide a 16-bit sign-magnitude number by 16

Maths (Geometry)

Subroutine: AddVectorToCoord

Add a vector to a coordinate

Maths (Geometry)

Subroutine: FollowGazeVector (Part 1 of 5)

Follow a gaze vector from a viewing object to determine whether the viewer can see a flat tile or platform (i.e. boulder or tower)

Maths (Geometry)

Subroutine: FollowGazeVector (Part 2 of 5)

Calculate the altitudes of the four corners in a non-flat tile

Maths (Geometry)

Subroutine: FollowGazeVector (Part 3 of 5)

Calculate whether the viewing object's gaze is obstructed by a tile of shape 4 or 12 (i.e. a tile with one horizontal edge)

Maths (Geometry)

Subroutine: FollowGazeVector (Part 4 of 5)

For non-flat tiles with two horizontal edges, work out which tile edge to use when checking for obstruction of the gaze vector

Maths (Geometry)

Subroutine: FollowGazeVector (Part 5 of 5)

For non-flat tiles with two horizontal edges, work out whether the tile edge obstructs the gaze vector

Landscape

Variable: tileEdges

A table to map tile shapes and gaze vector direction to tile edges

Landscape

Subroutine: GetTileAltitude

Calculate the altitude of a tile, optionally including platform objects and trees in the calculation

The Sentinel D
--------------

CategoryDetails

Maths (Geometry)

Subroutine: CheckForTileCentre

Calculate max(|xCoordLo - 128|, |zCoordLo - 128|)

3D objects

Subroutine: GetObjectCoords

Get an object's coordinates

3D objects

Subroutine: DeleteObject

Delete an object, removing it from the landscape and vacating its object number

3D objects

Subroutine: PlaceObjectOnTile

Place an object on a tile, putting it on top of any existing boulders or towers

3D objects

Variable: tileNumber

The tile number to which we are adding an object in the PlaceObjectOnTile routine

Drawing objects

Subroutine: DrawUpdatedObject

Draw an updated object on-screen, optionally with a dithered effect, and with or without the surrounding landscape

Screen buffer

Variable: screenBufferAddr

Storage for the address for the current drawing operation in the screen buffer

Screen buffer

Variable: objScreenAddr

The screen address of the object we are updating

Screen buffer

Variable: ditherOuterLoop

A counter for the inner loop when dithering objects to the screen in the DitherScreenBuffer routine

Screen buffer

Variable: yawAdjustmentHi

The yaw offset of the left edge of the object being updated, relative to the left edge of the screen, in yaw angles

Gameplay

Subroutine: GetObjVisibility

Calculate whether any part of an object is visible on-screen, and if so, which character columns it spans on the screen

Gameplay

Variable: objectHalfWidth

Each object's width in terms of tile widths, for half the object

3D objects

Subroutine: SpawnObject

Add a new object of the specified type to the objectTypes table

Gameplay

Subroutine: UpdatePlayerEnergy

Update the player's energy levels by adding or subtracting the amount of energy in a specific object

3D objects

Variable: objectTypeEnergy

The amount of energy required to create each object or the amount energy acquired when absorbing each object

Gameplay

Subroutine: PerformHyperspace

Hyperspace the player to a brand new tile, ideally at the same altitude as the current tile

Drawing objects

Subroutine: DrawObjectStack

Draw an entire stack of objects

Graphics

Subroutine: FillScreen

Fill a rectangular in screen memory or the screen buffer with the specified background

Graphics

Variable: backgroundEven

Pixel bytes for even pixel rows in the screen background

Graphics

Variable: backgroundOdd

Pixel bytes for odd pixel rows in the screen background

Graphics

Variable: pixelBitMask

A table for converting a pixel number in the range 0 to 3 into a screen mode 5 bit mask with that pixel's bits set and others clear

Graphics

Variable: colourPixels

A table that maps logical colours 0 to 3 to a four-pixel byte in that colour

Graphics

Variable: pixelsToLeft

Pixel byte with all the pixels to the left of position X set

Graphics

Variable: pixelsToRight

Pixel byte with all the pixels to the right of position X set

Graphics

Variable: leftPixels

Pixel byte with all the pixels to the right of position X + 1 set, to give the complementary pixel byte to pixelsToRight

Screen buffer

Variable: buffersOffsetLo

An offset to add to the address of the right column screen buffer (low byte)

Screen buffer

Variable: buffersOffsetHi

An offset to add to the address of the right column screen buffer (low byte)

Drawing polygons

Subroutine: DrawPolygonLines (Part 1 of 4)

Draw an analysed polygon into the screen buffer

Drawing polygons

Subroutine: DrawPolygonLines (Part 2 of 4)

Process the line overflowing the sides of the buffer, or fitting into one pixel byte, and loop on to the next polygon pixel line

Drawing polygons

Subroutine: DrawPolygonLines (Part 3 of 4)

Draw the left and right edges of the polygon line and fall into part 4 to draw the line in between

Drawing polygons

Subroutine: DrawPolygonLines (Part 4 of 4)

Draw a horizontal pixel line of a specific length in character columns

Drawing the landscape

Subroutine: GetTileVisibility

For each tile in the landscape, calculate whether the player can see that tile, to speed up the process of drawing the landscape

Drawing the landscape

Variable: visibileBitMask

A table for converting a number in the range 0 to 7 into a bit mask with only that bit set, when counting from the left

Drawing the landscape

Subroutine: GetRowVisibility (Part 1 of 2)

Set up the calculations to determine whether each tile corner in a tile row is obscured from the player by any intervening landscape

Cracker protection

Subroutine: CheckSecretStash

Check whether the secret code stash is correctly set up, as part of the anti-cracker code

Drawing the landscape

Subroutine: GetRowVisibility (Part 2 of 2)

Calculate whether each tile corner in a tile row is obscured from the player by any intervening landscape

The Sentinel E
--------------

CategoryDetails

Drawing the landscape

Subroutine: GetTileAltitudes

Calculate tile corner altitudes and maximum tile corner altitudes for each tile in the landscape

Drawing the landscape

Subroutine: DrawLandscapeView (Part 1 of 3)

Set up a number of variables for drawing the landscape view

Drawing the landscape

Subroutine: DrawLandscapeView (Part 2 of 3)

Work through the landscape, drawing one row of tiles/objects at a time, from the back row to the front row

Drawing the landscape

Subroutine: DrawLandscapeView (Part 3 of 3)

Draw a tile row in two parts, one on either side of the viewer

Drawing the landscape

Variable: quadrantOffsets

Offsets into the tile view data tables for the four different viewing directions

Drawing the landscape

Subroutine: GetTileViewEdges

For a given tile row, work out the edges of the visible portion of the row in the current player view, as left to right tile numbers

Drawing the landscape

Subroutine: GetTileEdgeToLeft

Move one tile to the left along the tile row that we are analysing for view edges and tile angles

Drawing the landscape

Subroutine: GetTileEdgeToRight

Move one tile to the right along the tile row that we are analysing for view edges and tile angles

Drawing the landscape

Subroutine: GetTileViewAngles (Part 1 of 4)

Calculate the pitch and yaw angles for a tile corner, relative to a viewer object (e.g. the player), and whether it is on-screen

Drawing the landscape

Subroutine: GetTileViewAngles (Part 2 of 4)

Fetch the tile data for the tile corner we are analysing

Drawing the landscape

Subroutine: GetTileViewAngles (Part 3 of 4)

Calculate the pitch angle for the tile corner

Drawing the landscape

Subroutine: GetTileViewAngles (Part 4 of 4)

Calculate how much of the tile is on-screen

Drawing the landscape

Subroutine: DrawLandscapeRow

Draw a row of tiles between the left visible edge and the right visible, in two parts towards each side of the viewer

Screen buffer

Subroutine: FlipBufferType

Flip the buffer type between buffer type 0 (left row buffer) and buffer type 1 (right row buffer)

Screen buffer

Subroutine: ConfigureBuffer

Set up the variables required to configure the screen buffer to a specific buffer type

Screen buffer

Variable: buffersOrigin

The offset to add to yaw angles for each screen buffer to convert from the origin in the buffer centre to the origin on the left

Screen buffer

Variable: xBuffersLeft

The left edge of each screen buffer in pixels

Screen buffer

Variable: xBuffersWidth

The width of each screen buffer in pixels

Screen buffer

Variable: buffersMinYaw

Minimum allowed yaw angles for points in the screen buffer

Screen buffer

Subroutine: ConfigureObjBuffer

Set up the variables required to configure the screen buffer for updating an object

Drawing the landscape

Subroutine: DrawTileAndObjects

Draw a tile and any objects stacked on it

Drawing the landscape

Subroutine: DrawFlatTile

Draw a flat tile in the correct colour for the chess board effect that we use to draw the landscape

Cracker protection

Subroutine: SetSecretStash

Alter the secret code stash, as part of the anti-cracker code

Drawing the landscape

Subroutine: DrawOneFaceTile

Draw a tile with one quadrilateral (four-sided) face

Drawing the landscape

Subroutine: DrawSlopingTile

Draw a sloping tile that is not shape 4 or 12

Drawing the landscape

Subroutine: DrawTwoFaceTile

Draw a tile with two triangular (three-sided) faces

Drawing polygons

Subroutine: DrawPolygon

Draw a polygon

Landscape

Subroutine: GenerateLandscape

Generate tile data for the landscape

Landscape

Subroutine: ProcessTileData

Process the tile data for all tiles in the landscape

Landscape

Subroutine: SmoothTileData

Smooth the entire landscape

Landscape

Subroutine: GetTileData

Get the tile data and tile data address for a specific tile

The Sentinel F
--------------

CategoryDetails

Landscape

Subroutine: SmoothTileCorners (Part 1 of 4)

Smooth a row or column of tile corners (a "strip of tiles")

Landscape

Subroutine: SmoothTileCorners (Part 2 of 4)

Smooth a strip by moving each outlier tile corner to the altitude of its closest immediate neighbour (in terms of altitude)

Landscape

Subroutine: SmoothTileCorners (Part 3 of 4)

Smooth a strip by setting the tile corner altitudes to the average of the current tile corner altitude and three following corners

Cracker protection

Subroutine: SetCrackerSeed

Set up anti-cracker tile-related data that can be checked in the CheckCrackerSeed routine

Landscape

Subroutine: SmoothTileCorners (Part 4 of 4)

Copy the smoothed strip data back into the tileData table

Landscape

Subroutine: GetTileShape

Calculate the shape of the tile anchored at (xTile, zTile)

Drawing polygons

Variable: trianglePointAdd

The value to add to the second point number to get the third point number when drawing a tile face as two triangles

Drawing the landscape

Variable: tileShapeColour

Tile colours by shape and the orientation of the viewer

Drawing polygons

Variable: triangleStart

The number of the first point in each two-face shape that is drawn as a pair of triangles

Drawing polygons

Subroutine: GetPolygonLines (Part 1 of 6)

Calculate the points in a two-face tile polygon when it consists of a pair of triangles

Drawing polygons

Subroutine: GetPolygonLines (Part 2 of 6)

The main entry point for the routine to calculate the horizontal lines in filled polygon and prepare them for drawing on-screen

Drawing polygons

Subroutine: GetPolygonLines (Part 3 of 6)

Convert all the polygon point yaw angles into pixel x-coordinates (for larger yaw angles that convert into a 16-bit x-coordinate)

Drawing polygons

Subroutine: GetPolygonLines (Part 4 of 6)

Convert all the polygon point yaw angles into pixel x-coordinates (for smaller yaw angles that convert into an 8-bit x-coordinate)

Drawing polygons

Subroutine: GetPolygonLines (Part 5 of 6)

Loop through all the edges in the polygon and call the correct routines to process one-byte, two-byte or horizontal edges

Drawing polygons

Subroutine: TracePolygonEdge (Part 1 of 8)

Trace a polygon edge, populating xPolygonRight or xPolygonLeft with the x-coordinate of the edge for each y-coordinate

Drawing polygons

Subroutine: TracePolygonEdge (Part 2 of 8)

Trace a polygon edge with a steep gradient by stepping along the y-axis

Drawing polygons

Subroutine: TracePolygonEdge (Part 3 of 8)

Trace a polygon edge with a shallow gradient by stepping along the x-axis

Drawing polygons

Subroutine: TracePolygonEdge (Part 4 of 8)

Trace a steep edge that starts off-screen, without storing the coordinates, until we reach the screen and return to part 2

Drawing polygons

Subroutine: TracePolygonEdge (Part 5 of 8)

Trace a shallow edge that starts off-screen, without storing the coordinates, until we reach the screen and return to part 3

Drawing polygons

Subroutine: GetPolygonLines (Part 6 of 6)

Split polygon edges whose coordinates are stored in two-byte numbers into smaller sections for processing

Drawing polygons

Subroutine: TracePolygonEdge (Part 6 of 8)

Trace a polygon edge where the start or end point x-coordinates are two-byte numbers

Drawing polygons

Subroutine: TracePolygonEdge (Part 7 of 8)

Trace a polygon edge with a steep gradient by stepping along the y-axis (for two-byte x-coordinates)

Drawing polygons

Subroutine: TracePolygonEdge (Part 8 of 8)

Trace a polygon edge with a shallow gradient by stepping along the x-axis (for two-byte x-coordinates)

Cracker protection

Subroutine: CorruptSecretCode

Corrupt the generation process for the landscape's secret code by fetching one more seed number than necessary

Drawing polygons

Subroutine: ModifyStoringCode

Modify the code in TracePolygonEdge that stores the coordinates of the polygon edge that is being traced

Maths (Arithmetic)

Subroutine: GetNextSeedNumber

Set A to a seed number

Maths (Arithmetic)

Variable: yStoreNextSeed

Temporary storage for Y so it can be preserved through calls to GetNextSeedNumber

Text

Subroutine: PrintNumber

Print a number as a single digit, printing zero as a capital "O"

Text

Subroutine: PrintDigit

Print a numerical digit, printing zero as a capital "O"

Title screen

Subroutine: SpawnCharacter3D (Part 1 of 2)

Spawn a character on the landscape in large 3D blocks for drawing on the main title screen or secret code screen

Cracker protection

Subroutine: CheckCrackerSeed

Check whether the anti-cracker seed-related data is correctly set up, as part of the anti-cracker code

Title screen

Subroutine: SpawnCharacter3D (Part 2 of 2)

Spawn large 3D blocks for the extracted character definition

Title screen

Variable: objBlockNumber

A lookup table to convert bit pairs into object numbers for spawning 3D text blocks on the landscape

Title screen

Subroutine: DrawTitleScreen

Draw the title screen or the screen showing the secret code

Title screen

Variable: screenType

A variable that determines whether we are drawing the title screen or the secret code screen in the DrawTitleScreen routine

Title screen

Variable: titleText

The text to draw on the title screen

Keyboard

Subroutine: ReadNumber

Read a number from the keyboard into the input buffer

Text

Subroutine: PrintInputBuffer

Print the contents of the keyboard input buffer

The Sentinel G
--------------

CategoryDetails

Text

Subroutine: StringToNumber

Convert a string of ASCII digits in the input buffer in-place into a multi-byte BCD number

Text

Subroutine: DigitToNumber

Convert a digit from the input buffer into a number

Text

Subroutine: Print2DigitBCD

Print a binary coded decimal (BCD) number using two digits

Maths (Arithmetic)

Subroutine: GetNextSeedAsBCD

Set A to the next number from the landscape's sequence of seed numbers, converted to a binary coded decimal (BCD) number

Maths (Arithmetic)

Variable: lowNibbleBCD

Storage for the low nibble when constructing a BCD seed number in the GetNextSeedAsBCD routine

Title screen

Subroutine: SpawnSecretCode3D

Draw the landscape's secret code by spawning a set of large 3D text block objects

Text

Subroutine: PrintLandscapeNum

Print the four-digit landscape number (0000 to 9999)

Landscape

Subroutine: InitialiseSeeds

Initialise the seed number generator so it generates the sequence of seed numbers for a specific landscape number

Text

Subroutine: ProcessCharacter

Process and print a character from a text token, which can encode another text token or be a one-byte character or VDU command

Landscape

Subroutine: GetEnemyCount

Calculate the number of enemies for the current landscape

Maths (Arithmetic)

Subroutine: GetNextSeed0To22

Set A to the next number from the landscape's sequence of seed numbers, converted to the range 0 to 22

Maths (Arithmetic)

Subroutine: GetPlayerEnergyBCD

Fetch the player's energy in binary coded decimal (BCD)

Sound

Subroutine: MakeSound

Make a sound

Sound

Subroutine: DefineEnvelope

Define a sound envelope

Sound

Subroutine: MakeSoundEnvelope

Either make a sound or set up an envelope

Sound

Variable: aStoreEnvelope

Temporary storage for use in the DefineEnvelope routine

Sound

Variable: soundNumberData

A table to map a sound number (0 to 6) to the sound data block(s) that are used to make the sound

Sound

Subroutine: ProcessVolumeKeys

Adjust the volume of the sound envelopes when the volume keys are pressed

Sound

Variable: volumeLevel

The volume level, which can be changed by pressing "7" and "8"

Sound

Variable: envelopeVolumes

A table of offsets into the envelope data for bytes that control the volume of each envelope, so we can change their volume levels

Keyboard

Subroutine: ProcessPauseKeys

Pause or unpause the game when COPY or DELETE are pressed

Sound

Subroutine: ProcessMusic

Play the configured music in the background

Sound

Subroutine: FlushSoundBuffers

Flush all four sound channel buffers

Sound

Subroutine: FlushSoundBuffer0

Flush the sound channel 0 buffer

Keyboard

Subroutine: FlushBuffer

Flush the specified buffer

Sound

Subroutine: ProcessSound

Process any sound effects that have been configured so they play in the background (this is called regularly throughout gameplay)

Main game loop

Subroutine: PlayGame

Start playing the generated landscape

Main game loop

Subroutine: MainGameLoop

The main game loop for playing a landscape

Scanner/energy row

Subroutine: ClearIconsScanner

Clear the energy icon and scanner row at the top of the screen

Text

Subroutine: PrintTextToken

Print a recursive text token

Graphics

Variable: clearPixelMask

A table for converting a pixel number in the range 0 to 3 into a screen mode 5 bit mask with that pixel's bits clear and others set

Scanner/energy row

Subroutine: UpdateIconsScanner

Update the icons in the top-left corner of the screen to show the player's current energy level and redraw the scanner box

Scanner/energy row

Subroutine: DrawIcon

Draw a single icon in the top-left corner of the screen (via the icon screen buffer at iconBuffer) and move along to the right

Main game loop

Subroutine: IRQHandler

The main interrupt handler, which gets run 50 times a second to update the game state and check for game key presses

Graphics

Subroutine: ScrollPlayerView

Scroll the screen and copy data from the screen buffer into screen memory to implement the player's scrolling landscape view

Screen buffer

Subroutine: ShowScreenBuffer

Update the player's scrolling landscape view by copying the relevant parts of the screen buffer into screen memory

Screen buffer

Subroutine: ShowBufferColumn

Update the player's scrolling landscape view by copying a 2-pixel wide column from the screen buffer into screen memory

Screen buffer

Subroutine: ShowBufferRow

Update the player's scrolling landscape view by copying an 8-pixel high character row from the screen buffer into screen memory

Screen buffer

Subroutine: ShowBufferBlock

Update the player's scrolling landscape view by copying an 8-byte character block from the screen buffer into screen memory

Screen buffer

Variable: updateOffsetLo

The offset within screen memory for the player's landscape view of the area to update following a scroll (low byte)

Screen buffer

Variable: updateOffsetHi

The offset within screen memory for the player's landscape view of the area to update following a scroll (high byte)

Screen buffer

Variable: scrollScreenLo

The amount to change the start of screen memory in order to scroll the player's landscape view through each direction (low byte)

Screen buffer

Variable: scrollScreenHi

The amount to change the start of screen memory in order to scroll the player's landscape view through each direction (high byte)

Screen buffer

Variable: screenBufferHi

The value to add to scrollScreenHi for each direction to get the high byte of the screen buffer address of the content to scroll in

Screen buffer

Variable: screenBufferLo

The value to add to scrollScreenLo for each direction to get the low byte of the screen buffer address of the content to scroll in

Drawing the landscape

Variable: panAngleToUpdate

Pitch and yaw angles for panning the landscape view, so the output of DrawLandscapeView will be the bit we add when updating the view

Screen buffer

Subroutine: StartScrollingView

Start a scroll process in the background by setting the number of scroll steps and the address to start copying new content from

Screen buffer

Subroutine: SetBufferAddress

Set screenBufferAddr(1 0) to the address from which the interrupt handler should fetch new content to scroll onto the screen

Screen buffer

Subroutine: UseRowBuffer

Configure the row buffer for use

Screen buffer

Variable: bufferMaxPitch

Maximum allowed pitch angles for points in the screen buffer

Screen buffer

Variable: bufferMinPitch

Minimum allowed pitch angles for points in the screen buffer

Screen buffer

Subroutine: UseColumnBuffer

Configure the column buffer for use

Screen buffer

Subroutine: SetColumnBufferMax

Set the maximum and minimum pitch angles for the column buffer

The Sentinel H
--------------

CategoryDetails

Sights

Subroutine: MoveSights

Check for up/down/left/right key presses and move the sights accordingly, panning the screen if they go past the screen edges

Sights

Subroutine: MoveSightsSideways

Check for the left/right keys and move the sights accordingly, panning to the left or right if they go past the screen edges

Sights

Subroutine: MoveSightsUpDown

Check for the up/down keys and move the sights accordingly, panning up or down if they go past the screen edges

Sights

Subroutine: SetSightsAddress

Update the address variables for the sights when they move into a new character block or row

Sights

Subroutine: DrawSights

Draw the sights on the screen, saving the existing screen contents in the sights pixel byte stash

Graphics

Variable: pixelByteColour2

A table for converting a pixel number in the range 0 to 3 into a screen mode 5 pixel byte with that pixel set to colour 2 (%10)

Sights

Variable: xSightsStep

Steps to take along the x-axis when drawing the sights

Sights

Variable: ySightsStep

Steps to take along the y-axis when drawing the sights

Sights

Subroutine: RemoveSights

Remove the sights from the screen

Sights

Variable: sightsMoveAddrLo

The change to apply to the screen address of the sights when they move into a new character block or row (low byte)

Sights

Variable: sightsMoveAddrHi

The change to apply to the screen address of the sights when they move into a new character block or row (high byte)

Scanner/energy row

Subroutine: GetIconRowAddress

Calculate the address in screen memory of the icon and scanner row at the top of the screen

Screen buffer

Subroutine: ShowIconBuffer

Display the redrawn icon and scanner row by copying the contents of the icon screen buffer into screen memory

Maths (Geometry)

Variable: arctanLo

Table for arctan values when calculating yaw angles (low byte)

Maths (Geometry)

Variable: arctanHi

Table for arctan values when calculating yaw angles (high byte)

Maths (Geometry)

Variable: tanHalfAngle

Table for hypotenuse lengths given the tangent of an angle

Screen buffer

Variable: screenRowAddrLo

Address lookup table for character rows in screen memory (low byte)

Screen buffer

Variable: bufferRowAddrLo

Address lookup table for character rows in the screen buffer (low byte)

Graphics

Variable: screenRowAddrHi

Address lookup table for character rows in screen memory (high byte)

Screen buffer

Variable: bufferRowAddrHi

Address lookup table for character rows in the screen buffer (high byte)

Sights

Variable: sightsByte

The sights pixel byte stash, which contains the screen pixel bytes behind the sights, so they can be restored to remove the sights

Sights

Variable: sightsByteAddrHi

The screen addresses of the bytes in the sights pixel byte stash, to which they can be restored to remove the sights (high byte)

Drawing polygons

Variable: edgePixelsLeft

Table to convert a polygon colours byte and a pixel offset (0-3) into a pixel byte for the left edge of the polygon pixel line

Drawing polygons

Variable: edgePixelsRight

Table to convert a polygon colours byte and a pixel offset (0-3) into a pixel byte for the right edge of the polygon pixel line

Drawing the landscape

Variable: tileVisibility

A table for storing the visibility of each tile from the player's point of view, with one bit per tile (1 = visible, 0 = hidden)

Landscape

Subroutine: secretCodeStash

A stash for calculated values for each iteration in the CheckSecretCode routine

Screen buffer

Subroutine: screenBufferRow0

The screen buffer for character row 0

Screen buffer

Subroutine: screenBufferRow16

The screen buffer for character row 16 (as part of a column buffer)

Screen buffer

Subroutine: screenBufferRow1

The screen buffer for character row 1

Screen buffer

Subroutine: screenBufferRow17

The screen buffer for character row 17 (as part of a column buffer)

Screen buffer

Subroutine: screenBufferRow2

The screen buffer for character row 2

Screen buffer

Subroutine: screenBufferRow18

The screen buffer for character row 18 (as part of a column buffer)

Screen buffer

Subroutine: screenBufferRow3

The screen buffer for character row 3

Screen buffer

Subroutine: screenBufferRow19

The screen buffer for character row 19 (as part of a column buffer)

Screen buffer

Subroutine: screenBufferRow4

The screen buffer for character row 4

Screen buffer

Subroutine: screenBufferRow20

The screen buffer for character row 20 (as part of a column buffer)

Screen buffer

Subroutine: screenBufferRow5

The screen buffer for character row 5

Screen buffer

Subroutine: screenBufferRow21

The screen buffer for character row 21 (as part of a column buffer)

Screen buffer

Subroutine: screenBufferRow6

The screen buffer for character row 6

Screen buffer

Subroutine: screenBufferRow22

The screen buffer for character row 22 (as part of a column buffer)

Screen buffer

Subroutine: screenBufferRow7

The screen buffer for character row 7

Screen buffer

Subroutine: screenBufferRow23

The screen buffer for character row 23 (as part of a column buffer)

Screen buffer

Subroutine: screenBufferRow8

The screen buffer for character row 8

Drawing objects

Variable: objPointRange

The first and last point numbers for each object

Drawing objects

Variable: objPolygonRange

The first and last polygon numbers for each object

Drawing objects

Variable: objPolygonPhases

The phase configuration for each object

Sights

Variable: sightsByteAddrLo

The screen addresses of the bytes in the sights pixel byte stash, to which they can be restored to remove the sights (low byte)

Drawing objects

Variable: objMeanie

The list of polygons and points for the meanie object (polygons 77 to 101, using points 76 to 93)

3D objects

Variable: enemyYawStep

The yaw angle through which each enemy rotates on each scheduled rotation

Screen buffer

Subroutine: screenBufferRow9

The screen buffer for character row 9

Drawing objects

Variable: objPointYaw

Polar yaw angles for each of the points in each of the objects

Screen buffer

Subroutine: screenBufferRow10

The screen buffer for character row 10

Drawing objects

Variable: objPointHeight

The height of each of the points in each of the objects, relative to the object's origin

Screen buffer

Subroutine: screenBufferRow11

The screen buffer for character row 11

Drawing objects

Variable: objPointDistance

Polar distances for each of the points in each of the objects

Screen buffer

Subroutine: screenBufferRow12

The screen buffer for character row 12

Drawing objects

Variable: objPolygonData

Various data for object polygons (colour, drawing phase)

The Sentinel I
--------------

CategoryDetails

Screen buffer

Subroutine: screenBufferRow13

The screen buffer for character row 13

Drawing objects

Variable: objPolygonAddrLo

Addresses for the list of polygons and points for each object (low byte)

Screen buffer

Subroutine: screenBufferRow14

The screen buffer for character row 14

Drawing objects

Variable: objPolygonAddrHi

Addresses for the list of polygons and points for each object (high byte)

Screen buffer

Subroutine: screenBufferRow15

The screen buffer for character row 15

Drawing objects

Variable: objSentinel

The list of polygons and points for the Sentinel object (polygons 102 to 136, using points 94 to 123)

Drawing objects

Variable: objTree

The list of polygons and points for the tree object (polygons 52 to 66, using points 51 to 67)

Drawing objects

Variable: objBoulder

The list of polygons and points for the boulder object (polygons 67 to 76, using points 68 to 75)

Drawing objects

Variable: objTower

The list of polygons and points for the Sentinel's tower object (polygons 137 to 147, using points 124 to 135)

Drawing objects

Variable: objTextBlock

The list of polygons and points for the 3D text block object (polygons 148 to 151, using points 136 to 143)

Drawing objects

Variable: objRobot

The list of polygons and points for the robot object (polygons 0 to 26, using points 0 to 28)

Drawing objects

Variable: objSentry

The list of polygons and points for the sentry object (polygons 27 to 51, using points 29 to 50)

Drawing polygons

Variable: xPolygonPointLo

Pixel x-coordinates for all the points in the polygon that we are currently drawing (low bytes)

Drawing the landscape

Variable: drawViewYawHi

Storage for the yaw angles of tiles and object points for drawing the current landscape view (high bytes)

Maths (Geometry)

Subroutine: GetHypotenuseAngle

Calculate the angle of the hypotenuse in a right-angle triangle given the two non-hypotenuse sides (i.e. two orthogonal axes)

Maths (Geometry)

Subroutine: GetPitchAngleDelta

Calculate the pitch angle of a vector relative to an object's pitch angle

Maths (Geometry)

Subroutine: GetHypotenuse

Calculate the hypotenuse from an angle and two triangle sides with one lookup and one multiplication (so without a square root)

Maths (Geometry)

Variable: yStoreHypotenuse

Temporary storage for Y so it can be preserved through calls to GetHypotenuse

Maths (Arithmetic)

Subroutine: GetRandomNumber

Set A to a random number

Maths (Arithmetic)

Variable: randomGenerator

A 24-bit random number generator that works independently from the landscape seeds and with a much simpler generation algorithm

Maths (Arithmetic)

Variable: shiftGenerator

Storage for randomGenerator(2 1 0) while we shift it left by two places

Graphics

Subroutine: DrawStars

Draw 80 randomly positioned stars on the screen in colour 2 (white, yellow, cyan or red)

Graphics

Subroutine: DrawBlackDots

Draw 80 randomly positioned dots on the screen in colour 1 (black)

Graphics

Subroutine: DrawRandomDots

Draw 80 randomly positioned dots on the screen

Graphics

Variable: dotCounter

A counter for the number of dots drawn in the DrawRandomDots routine

Graphics

Variable: dotColour

A flag that determines the colour of the dots drawn by the DrawRandomDots routine

Sights

Variable: pixelByteColour1

A table for converting a pixel number in the range 0 to 3 into a screen mode 5 pixel byte with that pixel set to colour 1 (%01)

Main game loop

Subroutine: SetScannerAndPause

Set the scanner update status and delay for 40 empty loops of 256 iterations each (i.e. 10,240 loops)

Text

Subroutine: PrintCharacter

Print a single-byte VDU command or character from a text token, optionally printing a drop shadow if the character is alphanumeric

Text

Subroutine: PrintVduCharacter

Print a one-byte character from a text token or a multi-byte VDU 25 command

Text

Variable: vduCounter

The number of bytes in a VDU 25, n, x; y; command

Text

Variable: tokenOffset

Address offsets for the text tokens (each offset in the table is the offset of the token from tokenBase)

Text

Variable: vduShadowFront

VDU commands for printing the front character of a drop shadow

Text

Variable: vduShadowRear

VDU commands for printing the rear character of a drop shadow

Text

Variable: token0

Background colour blue, print "PRESS ANY KEY" at (64, 100), set text background to black

Text

Variable: token1

Print 13 spaces at (64, 100), print "LANDSCAPE NUMBER?" at (64, 768), switch to text cursor, move text cursor to (5, 27)

Text

Variable: token2

Background colour blue, print "SECRET ENTRY CODE?" at (64, 768), switch to text cursor, move text cursor to (2, 27)

Text

Variable: token3

Background colour blue, print "WRONG SECRET CODE" at (64, 768), print "PRESS ANY KEY" at (64, 100), set text background to black

Text

Variable: token4

Background colour black, print "PRESS ANY KEY" at (192, 64), print "LANDSCAPE" two chars right of (64, 768), move cursor right

Text

Variable: token5

Text token 5: Print "SECRET ENTRY CODE" at (64, 768), "LANDSCAPE" at (192, 704), move cursor right

Text

Variable: token6

Text token 6: Print "PRESS ANY KEY" at (64, 100)

Text

Variable: token7

Text token 7: Move the graphics cursor to (64, 768)

Text

Variable: token8

Text token 8: Move the graphics cursor to (192, 704)

Text

Variable: token9

Text token 9: Move the graphics cursor to (192, 64)

Text

Variable: token10

Text token 10: Configure text to be printed at the graphics cursor and set the background colour to colour 0 (blue)

Text

Variable: token11

Text token 11: Configure text to be printed at the graphics cursor and set the background colour to colour 1 (black)

Text

Variable: token12

Text token 12: Move graphics cursor to (64, 100)

Text

Variable: token13

Text token 13: Print "LANDSCAPE"

Text

Variable: token14

Text token 14: Print "SECRET ENTRY CODE"

Text

Variable: token15

Text token 15: Print five spaces

Text

Variable: token16

Text token 16: Print three spaces

Text

Variable: token17

Text token 17: Print "PRESS ANY KEY"

Sound

Variable: musicData

Data for the game's music

Graphics

Variable: iconData

Screen mode 5 bitmap data for the ten icons that make up the energy icon and scanner row at the top of the screen

Sound

Variable: soundData

OSWORD blocks for making the various game sounds

Sound

Variable: envelopeData

Data for the six sound envelopes

Maths (Geometry)

Variable: sin

Table for sine values

Graphics

Variable: iconBuffer

The icon screen buffer, which is used to buffer the energy icon and scanner row before writing to screen memory

Drawing polygons

Variable: xPolygonLeft

The pixel x-coordinate of the left edge of each pixel line in the polygon being drawn

Drawing polygons

Variable: xPolygonRight

The pixel x-coordinate of the right edge of each pixel line in the polygon being drawn

Landscape

Variable: stripData

Storage for tile data when smoothing strips of tiles during the landscape generation process

Landscape

Variable: tilesAtAltitude

Storage for tile blocks at specific altitudes for placing enemies on the landscape

Landscape

Variable: maxAltitude

The maximum tile altitude for each 4x4 block of tiles

Landscape

Variable: xTileMaxAltitude

The tile x-coordinate of the highest tile within each 4x4 block of tiles

Landscape

Variable: zTileMaxAltitude

The tile z-coordinate of the highest tile within each 4x4 block of tiles

The Sentinel J
--------------

CategoryDetails

3D objects

Subroutine: GetObjectAngles

Calculate the angles and distances of the vector from the viewer to a specific object

Drawing objects

Subroutine: GetObjPointAngles

Calculate the view-relative pitch and yaw angles of all the points in an object

Drawing objects

Subroutine: DrawObject

Draw a 3D object

Maths (Geometry)

Subroutine: GetHorizontalDelta

Calculate the difference in the x-axis and z-axis between two objects, as both signed and absolute deltas

Maths (Geometry)

Subroutine: GetVerticalDelta

Calculate the difference in the y-axis between two objects as a signed delta

Keyboard

Subroutine: ReadKeyboard

Enable the keyboard and read a character from it

Keyboard

Subroutine: ReadCharacter

Read a character from the currently selected input stream

Keyboard

Subroutine: EnableKeyboard

Select the keyboard as the input stream and flush the keyboard buffer

Graphics

Subroutine: SetColourPalette

Set the logical colours for each of the four physical colours in screen mode 5

Graphics

Variable: colourPalettes

The logical colours for two mode 5 palettes

Screen buffer

Subroutine: DitherScreenBuffer

Dither the contents of the screen buffer onto the screen

Title screen

Subroutine: ShowGameOverScreen

Display the game over screen

Graphics

Subroutine: DecayScreenToBlack

Smother the screen with randomly placed black dots to decay the screen to black

Cracker protection

Subroutine: JumpToPreview

An intentionally confusing jump point for controlling the main title loop flow when returning from the GenerateLandscape routine

Title screen

Subroutine: SpawnTitleObject

Spawn the title object (robot or the Sentinel) as object #1

Title screen

Variable: zTitleObject

The z-coordinate of an object on the title screen, as a delta from the z-coordinate of the viewing object

Landscape

Subroutine: PreviewLandscape

Draw an aerial preview of the landscape

Title screen

Variable: titleViewerPitch

The pitch angle of the viewer for objects on the title screen

Title screen

Variable: yTitleObject

The y-coordinate of an object on the title screen, as a delta from the y-coordinate of the viewing object

Title screen

Variable: titleObjectYaw

The yaw angle of an object on the title screen

Title screen

Variable: titleViewerYaw

The yaw angle of the viewer for objects on the title screen

Title screen

Subroutine: DrawTitleObjects

Draw an object on top of a tower on the title screen

Title screen

Subroutine: DrawTitleObject

Draw an object on the title screen

Sound

Subroutine: PlayMusic

Play a piece of music

Setup

Subroutine: ConfigureMachine

Configure the custom screen mode, set the break handler to clear memory, move code, reset timers and set the interrupt handler

Setup

Subroutine: ClearMemory

Clear game memory, so that the BREAK key can remove all trace of the game code in early versions of the operating system

Setup

Subroutine: Entry

The main entry point for the game