This index contains every subroutine and entry point that appears in the source code for The Sentinel, 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.
- 3D objects
- Cracker protection
- Drawing objects
- Drawing polygons
- Drawing the landscape
- Gameplay
- Graphics
- Keyboard
- Landscape
- Main game loop
- Main title loop
- Maths (Arithmetic)
- Maths (Geometry)
- Scanner/energy row
- Screen buffer
- Setup
- Sights
- Sound
- Text
- Title screen
3D objects | |
| DeleteObject | Delete an object, removing it from the landscape and vacating its object number |
| GetObjectAngles | Calculate the angles and distances of the vector from the viewer to a specific object |
| GetObjectCoords | Get an object's coordinates |
| PlaceObjectBelow | Attempt to place an object on a tile that is below the maximum altitude specified in A |
| PlaceObjectOnTile | Place an object on a tile, putting it on top of any existing boulders or towers |
| SpawnObject | Add a new object of the specified type to the objectTypes table |
| SpawnObject+3 | Spawn an object of the type specified in keyPress |
Cracker protection | |
| AlterCrackerSeed | Create an altered version of the anti-cracker seed-related data, as part of the anti-cracker code |
| CheckCrackerSeed | Check whether the anti-cracker seed-related data is correctly set up, as part of the anti-cracker code |
| CheckSecretStash | Check whether the secret code stash is correctly set up, as part of the anti-cracker code |
| CorruptSecretCode | Corrupt the generation process for the landscape's secret code by fetching one more seed number than necessary |
| CrackerSeed | Obfuscated storage for the high byte of the landscape number as part of the anti-cracker code |
| JumpToPreview | An intentionally confusing jump point for controlling the main title loop flow when returning from the GenerateLandscape routine |
| SetCrackerSeed | Set up anti-cracker tile-related data that can be checked in the CheckCrackerSeed routine |
| SetPlayerIsOnTower | Set up the playerIsOnTower value for checking the game is won, as part of the anti-cracker code |
| SetSecretStash | Alter the secret code stash, as part of the anti-cracker code |
Drawing objects | |
| CheckObjVisibility | Check whether an object is visible on-screen and should therefore not be changed if a pan operation is about to happen |
| cvis1 | Contains an RTS |
| DrawObject | Draw a 3D object |
| DrawObjectStack | Draw an entire stack of objects |
| DrawUpdatedObject | Draw an updated object on-screen, optionally with a dithered effect, and with or without the surrounding landscape |
| GetObjPointAngles | Calculate the view-relative pitch and yaw angles of all the points in an object |
Drawing polygons | |
| DrawPolygon | Draw a polygon |
| DrawPolygonLines (Part 1 of 4) | Draw an analysed polygon into the screen buffer |
| 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 |
| 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 |
| DrawPolygonLines (Part 4 of 4) | Draw a horizontal pixel line of a specific length in character columns |
| GetPolygonLines (Part 1 of 6) | Calculate the points in a two-face tile polygon when it consists of a pair of triangles |
| 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 |
| 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) |
| 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) |
| 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 |
| GetPolygonLines (Part 6 of 6) | Split polygon edges whose coordinates are stored in two-byte numbers into smaller sections for processing |
| ModifyStoringCode | Modify the code in TracePolygonEdge that stores the coordinates of the polygon edge that is being traced |
| TracePolygonEdge (Part 1 of 8) | Trace a polygon edge, populating xPolygonRight or xPolygonLeft with the x-coordinate of the edge for each y-coordinate |
| TracePolygonEdge (Part 2 of 8) | Trace a polygon edge with a steep gradient by stepping along the y-axis |
| TracePolygonEdge (Part 3 of 8) | Trace a polygon edge with a shallow gradient by stepping along the x-axis |
| 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 |
| 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 |
| TracePolygonEdge (Part 6 of 8) | Trace a polygon edge where the start or end point x-coordinates are two-byte numbers |
| TracePolygonEdge (Part 7 of 8) | Trace a polygon edge with a steep gradient by stepping along the y-axis (for two-byte x-coordinates) |
| TracePolygonEdge (Part 8 of 8) | Trace a polygon edge with a shallow gradient by stepping along the x-axis (for two-byte x-coordinates) |
Drawing the landscape | |
| DrawFlatTile | Draw a flat tile in the correct colour for the chess board effect that we use to draw the landscape |
| DrawLandscapeRow | Draw a row of tiles between the left visible edge and the right visible, in two parts towards each side of the viewer |
| DrawLandscapeView (Part 1 of 3) | Set up a number of variables for drawing the landscape view |
| 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 |
| DrawLandscapeView (Part 3 of 3) | Draw a tile row in two parts, one on either side of the viewer |
| DrawOneFaceTile | Draw a tile with one quadrilateral (four-sided) face |
| DrawSlopingTile | Draw a sloping tile that is not shape 4 or 12 |
| DrawTileAndObjects | Draw a tile and any objects stacked on it |
| DrawTwoFaceTile | Draw a tile with two triangular (three-sided) faces |
| 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 |
| GetRowVisibility (Part 2 of 2) | Calculate whether each tile corner in a tile row is obscured from the player by any intervening landscape |
| GetTileAltitudes | Calculate tile corner altitudes and maximum tile corner altitudes for each tile in the landscape |
| GetTileEdgeToLeft | Move one tile to the left along the tile row that we are analysing for view edges and tile angles |
| GetTileEdgeToRight | Move one tile to the right along the tile row that we are analysing for view edges and tile angles |
| 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 |
| GetTileViewAngles (Part 2 of 4) | Fetch the tile data for the tile corner we are analysing |
| GetTileViewAngles (Part 3 of 4) | Calculate the pitch angle for the tile corner |
| GetTileViewAngles (Part 4 of 4) | Calculate how much of the tile is on-screen |
| 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 |
| GetTileVisibility | For each tile in the landscape, calculate whether the player can see that tile, to speed up the process of drawing the landscape |
| PanLandscapeView | Pan the landscape and update the landscape view |
| prev1 | Return from the subroutine with the C flag set |
| talt2 | Jump to MainTitleLoop via game10 |
Gameplay | |
| AbortWhenVisible | Abort applying the tactics for this gameplay loop if updating the object on-screen will corrupt a screen pan |
| ApplyEnemyTactics | Apply tactics to an enemy object, setting things up so the next call applies tactics to the next enemy object |
| ApplyTactics (Part 1 of 8) | Apply tactics to the Sentinel or a sentry |
| ApplyTactics (Part 2 of 8) | Process the tactics for a meanie |
| 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) |
| ApplyTactics (Part 4 of 8) | If configured, search the landscape for a suitable target for the enemy to drain of energy |
| 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 |
| ApplyTactics (Part 6 of 8) | Rotate the enemy and make a rotation sound |
| 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 |
| ApplyTactics (Part 8 of 8) | Redraw the object on the screen, optionally with a dithered effect |
| CheckEnemyGaze (Part 1 of 2) | Check to see whether the current enemy can see a specific target object of a specific type |
| CheckEnemyGaze (Part 2 of 2) | Calculate whether the current enemy can see the specified object |
| DrainObjectEnergy | Drain energy from an object into an enemy, transforming it into an object with an energy level of one unit less (if applicable) |
| ExpendEnemyEnergy | Drain one unit of energy from an enemy and expend it onto the landscape by spawning a tree, if possible |
| FindObjectToDrain | Find a suitable target object for an enemy to drain |
| FinishEnemyTactics | Stop applying tactics to the current enemy and return to the ProcessGameplay routine to continue with the gameplay loop |
| GetObjVisibility | Calculate whether any part of an object is visible on-screen, and if so, which character columns it spans on the screen |
| GetPlayerDrain | Calculate whether the player is being scanned by an enemy and whether the enemy can see the player's tile |
| MoveOnToNextEnemy | Update enemyObject so the next time we consider applying enemy tactics, we apply them to the next enemy, looping from 7 to 0 |
| PerformHyperspace | Hyperspace the player to a brand new tile, ideally at the same altitude as the current tile |
| ProcessGameplay | A gameplay loop that processes all game key presses, returning to the main game loop when the player moves, quits, loses or pans |
| 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 |
| ScanForMeanieTree | Scan through the objects in the landscape to see if any of them are trees that are suitable for turning into a meanie |
| tact25 | Dither the updated object #X onto the screen, with bit 7 of drawLandscape determining whether the object is drawn on its own (bit 7 set) or with the surrounding landscape (bit 7 clear) |
| UpdateEnemyTimers | Update the timers that control the enemy tactics |
| UpdatePlayerEnergy | Update the player's energy levels by adding or subtracting the amount of energy in a specific object |
Graphics | |
| ClearScreen | Clear the screen to a specified background |
| DecayScreenToBlack | Smother the screen with randomly placed black dots to decay the screen to black |
| DrawBlackDots | Draw 80 randomly positioned dots on the screen in colour 1 (black) |
| DrawRandomDots | Draw 80 randomly positioned dots on the screen |
| DrawStars | Draw 80 randomly positioned stars on the screen in colour 2 (white, yellow, cyan or red) |
| FillScreen | Fill a rectangular in screen memory or the screen buffer with the specified background |
| ResetScreenAddress | Reset the address of the start of screen memory |
| ScrollPlayerView | Scroll the screen and copy data from the screen buffer into screen memory to implement the player's scrolling landscape view |
| SetColourPalette | Set the logical colours for each of the four physical colours in screen mode 5 |
Keyboard | |
| CheckForKeyPresses | Check for various game key presses and update the key logger and relevant variables (during the interrupt handler) |
| CheckForSamePanKey | Check to see whether the same pan key is being held down compared to the last time we checked |
| EnableKeyboard | Select the keyboard as the input stream and flush the keyboard buffer |
| FlushBuffer | Flush the specified buffer |
| focu1 | Store the current setting of focusOnKeyAction in the previousFocus variable so we can detect (in the ProcessGameplay routine) whether the player is still holding down a pan key after we finish scrolling the screen for the previous pan... and then return from the 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. |
| ProcessActionKeys (Part 1 of 2) | Process an action key press from key logger entry 1 (absorb, transfer, create, hyperspace, U-turn) |
| ProcessActionKeys (Part 2 of 2) | Process an action key press from key logger entry 1 (absorb, transfer, create, hyperspace, U-turn) |
| ProcessPauseKeys | Pause or unpause the game when COPY or DELETE are pressed |
| ReadCharacter | Read a character from the currently selected input stream |
| ReadKeyboard | Enable the keyboard and read a character from it |
| ReadNumber | Read a number from the keyboard into the input buffer |
| ScanForGameKeys | Scan for game key presses and update the key logger |
| ScanKeyboard | Scan the keyboard for a specific key press |
Landscape | |
| AddEnemiesToTiles | Add the required number of enemies to the landscape, starting from the highest altitude and working down, with one enemy per contour |
| 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 |
| 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 |
| GenerateLandscape | Generate tile data for the landscape |
| GetEnemyCount | Calculate the number of enemies for the current landscape |
| 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 |
| GetTileAltitude | Calculate the altitude of a tile, optionally including platform objects and trees in the calculation |
| GetTileData | Get the tile data and tile data address for a specific tile |
| GetTilesAtAltitude | Return a list of tile blocks at a specified altitude |
| GetTileShape | Calculate the shape of the tile anchored at (xTile, zTile) |
| InitialiseSeeds | Initialise the seed number generator so it generates the sequence of seed numbers for a specific landscape number |
| PreviewLandscape | Draw an aerial preview of the landscape |
| ProcessTileData | Process the tile data for all tiles in the landscape |
| secretCodeStash | A stash for calculated values for each iteration in the CheckSecretCode routine |
| SmoothTileCorners (Part 1 of 4) | Smooth a row or column of tile corners (a "strip of tiles") |
| 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) |
| 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 |
| SmoothTileCorners (Part 4 of 4) | Copy the smoothed strip data back into the tileData table |
| SmoothTileData | Smooth the entire landscape |
| SpawnEnemies | Calculate the number of enemies for this landscape, add them to the landscape and set the palette accordingly |
| SpawnPlayer | Add the player object to the landscape, ideally placing it below all the enemies and in the bottom half of the landscape |
| SpawnTrees | Add trees to the landscape, ideally placing them below all the enemies in the landscape |
Main game loop | |
| 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 |
| game10 | Jump to MainTitleLoop to restart the game |
| IRQHandler | The main interrupt handler, which gets run 50 times a second to update the game state and check for game key presses |
| MainGameLoop | The main game loop for playing a landscape |
| PlayGame | Start playing the generated landscape |
| SetScannerAndPause | Set the scanner update status and delay for 40 empty loops of 256 iterations each (i.e. 10,240 loops) |
Main title loop | |
| main1 | The entry point for rejoining the main title loop after the player enters an incorrect secret code |
| main4 | The entry point for restarting a landscape after dying, so the player doesn't have to enter the landscape's secret code again |
| MainTitleLoop | The main title loop: display the title screen, fetch the landscape number/code, preview the landscape and jump to the main game loop |
| MainTitleLoop-1 | Contains an RTS |
| ResetTilesObjects | Reset the tile visibility table and deallocate all object numbers |
| ResetVariables | Reset all the game's main variables |
| SecretCodeError | Display the "WRONG SECRET CODE" error, wait for a key press and rejoin the main title loop |
Maths (Arithmetic) | |
| Absolute16Bit | Calculate the absolute value (modulus) of a 16-bit number |
| DivideBy16 | Divide a 16-bit sign-magnitude number by 16 |
| GetNextSeed0To22 | Set A to the next number from the landscape's sequence of seed numbers, converted to the range 0 to 22 |
| GetNextSeed0To30 | Set A to the next number from the landscape's sequence of seed numbers, converted to the range 0 to 30 |
| GetNextSeedAsBCD | Set A to the next number from the landscape's sequence of seed numbers, converted to a binary coded decimal (BCD) number |
| GetNextSeedNumber | Set A to a seed number |
| GetPlayerEnergyBCD | Fetch the player's energy in binary coded decimal (BCD) |
| GetRandomNumber | Set A to a random number |
| Multiply16x16 | Multiply a sign-magnitude 16-bit number and a signed 16-bit number |
| Multiply8x16 | Multiply an 8-bit and a 16-bit number |
| Multiply8x8 | Calculate (A T) = T * U |
| Multiply8x8+2 | Calculate (A T) = T * U |
| MultiplyCoords | Multiply a 16-bit signed number and a 16-bit sign-magnitude value |
| Negate16Bit | Negate a 16-bit number |
| Negate16Bit+2 | Set (A T) = -(U T) |
Maths (Geometry) | |
| AddVectorToCoord | Add a vector to a coordinate |
| CheckForTileCentre | Calculate max(|xCoordLo - 128|, |zCoordLo - 128|) |
| 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) |
| FollowGazeVector (Part 2 of 5) | Calculate the altitudes of the four corners in a non-flat tile |
| 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) |
| 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 |
| FollowGazeVector (Part 5 of 5) | For non-flat tiles with two horizontal edges, work out whether the tile edge obstructs the gaze vector |
| GetAngleFromCoords (Part 1 of 3) | Given the coordinates along two axes, calculate the pitch or yaw angle to those coordinates |
| GetAngleFromCoords (Part 2 of 3) | Overflow and accuracy calculations |
| GetAngleFromCoords (Part 3 of 3) | Calculate the arctangent to get the angle |
| GetAngleInRadians | Convert a 16-bit angle into radians, restricted to a quarter circle |
| GetHorizontalDelta | Calculate the difference in the x-axis and z-axis between two objects, as both signed and absolute deltas |
| GetHypotenuse | Calculate the hypotenuse from an angle and two triangle sides with one lookup and one multiplication (so without a square root) |
| GetHypotenuseAngle | Calculate the angle of the hypotenuse in a right-angle triangle given the two non-hypotenuse sides (i.e. two orthogonal axes) |
| GetPitchAngleDelta | Calculate the pitch angle of a vector relative to an object's pitch angle |
| 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 |
| GetRotationMatrix (Part 2 of 5) | Calculate sin(H G) for smaller angles |
| GetRotationMatrix (Part 3 of 5) | Calculate sin(H G) for bigger angles |
| GetRotationMatrix (Part 4 of 5) | Loop back to calculate cos instead of sin |
| GetRotationMatrix (Part 5 of 5) | Apply the correct signs to the result |
| GetSightsVector | Calculate the angles of the vector from the player's eyes to the sights |
| GetSineAndCosine | Calculate the sine and the cosine of an angle |
| GetVectorForAngles | Convert a vector from pitch and yaw angles into a 3D cartesian vector |
| GetVerticalDelta | Calculate the difference in the y-axis between two objects as a signed delta |
Scanner/energy row | |
| ClearIconsScanner | Clear the energy icon and scanner row at the top of the screen |
| 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 |
| GetIconRowAddress | Calculate the address in screen memory of the icon and scanner row at the top of the screen |
| scan6 | Contains an RTS |
| 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 |
| UpdateScanner | Update the scanner, if required |
| UpdateScannerNow | Update the scanner to a new state |
Screen buffer | |
| buff1 | Contains an RTS |
| ConfigureBuffer | Set up the variables required to configure the screen buffer to a specific buffer type |
| ConfigureObjBuffer | Set up the variables required to configure the screen buffer for updating an object |
| DitherScreenBuffer | Dither the contents of the screen buffer onto the screen |
| drow3 | Contains an RTS |
| FlipBufferType | Flip the buffer type between buffer type 0 (left row buffer) and buffer type 1 (right row buffer) |
| rbuf1 | Set the minimum and maximum pitch angled for the buffer type specified in Y (0 = row buffer, 1 = column buffer) |
| screenBufferRow0 | The screen buffer for character row 0 |
| screenBufferRow1 | The screen buffer for character row 1 |
| screenBufferRow10 | The screen buffer for character row 10 |
| screenBufferRow11 | The screen buffer for character row 11 |
| screenBufferRow12 | The screen buffer for character row 12 |
| screenBufferRow13 | The screen buffer for character row 13 |
| screenBufferRow14 | The screen buffer for character row 14 |
| screenBufferRow15 | The screen buffer for character row 15 |
| screenBufferRow16 | The screen buffer for character row 16 (as part of a column buffer) |
| screenBufferRow17 | The screen buffer for character row 17 (as part of a column buffer) |
| screenBufferRow18 | The screen buffer for character row 18 (as part of a column buffer) |
| screenBufferRow19 | The screen buffer for character row 19 (as part of a column buffer) |
| screenBufferRow2 | The screen buffer for character row 2 |
| screenBufferRow20 | The screen buffer for character row 20 (as part of a column buffer) |
| screenBufferRow21 | The screen buffer for character row 21 (as part of a column buffer) |
| screenBufferRow22 | The screen buffer for character row 22 (as part of a column buffer) |
| screenBufferRow23 | The screen buffer for character row 23 (as part of a column buffer) |
| screenBufferRow3 | The screen buffer for character row 3 |
| screenBufferRow4 | The screen buffer for character row 4 |
| screenBufferRow5 | The screen buffer for character row 5 |
| screenBufferRow6 | The screen buffer for character row 6 |
| screenBufferRow7 | The screen buffer for character row 7 |
| screenBufferRow8 | The screen buffer for character row 8 |
| screenBufferRow9 | The screen buffer for character row 9 |
| SetBufferAddress | Set screenBufferAddr(1 0) to the address from which the interrupt handler should fetch new content to scroll onto the screen |
| SetColumnBufferMax | Set the maximum and minimum pitch angles for the column buffer |
| ShowBufferBlock | Update the player's scrolling landscape view by copying an 8-byte character block from the screen buffer into screen memory |
| ShowBufferColumn | Update the player's scrolling landscape view by copying a 2-pixel wide column from the screen buffer into screen memory |
| ShowBufferRow | Update the player's scrolling landscape view by copying an 8-pixel high character row from the screen buffer into screen memory |
| ShowIconBuffer | Display the redrawn icon and scanner row by copying the contents of the icon screen buffer into screen memory |
| ShowScreenBuffer | Update the player's scrolling landscape view by copying the relevant parts of the screen buffer into screen memory |
| StartScrollingView | Start a scroll process in the background by setting the number of scroll steps and the address to start copying new content from |
| UseColumnBuffer | Configure the column buffer for use |
| UseRowBuffer | Configure the row buffer for use |
Setup | |
| ClearMemory | Clear game memory, so that the BREAK key can remove all trace of the game code in early versions of the operating system |
| ConfigureMachine | Configure the custom screen mode, set the break handler to clear memory, move code, reset timers and set the interrupt handler |
| Entry | The main entry point for the game |
| NMIHandler | The NMI handler at the start of the NMI workspace |
Sights | |
| DrawSights | Draw the sights on the screen, saving the existing screen contents in the sights pixel byte stash |
| InitialiseSights | Initialise the variables used to manage the sights, so the sights appear in the middle of the screen |
| MoveSights | Check for up/down/left/right key presses and move the sights accordingly, panning the screen if they go past the screen edges |
| 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 |
| MoveSightsUpDown | Check for the up/down keys and move the sights accordingly, panning up or down if they go past the screen edges |
| RemoveSights | Remove the sights from the screen |
| sadr3 | Contains an RTS |
| SetSightsAddress | Update the address variables for the sights when they move into a new character block or row |
Sound | |
| DefineEnvelope | Define a sound envelope |
| FlushSoundBuffer0 | Flush the sound channel 0 buffer |
| FlushSoundBuffers | Flush all four sound channel buffers |
| MakeSound | Make a sound |
| MakeSound-6 | Make a two-part sound at the pitches defined in X and Y, where X is the pitch for sound data block #0 and Y is the pitch for sound data block #1 |
| MakeSoundEnvelope | Either make a sound or set up an envelope |
| PlayMusic | Play a piece of music |
| ProcessMusic | Play the configured music in the background |
| ProcessSound | Process any sound effects that have been configured so they play in the background (this is called regularly throughout gameplay) |
| ProcessVolumeKeys | Adjust the volume of the sound envelopes when the volume keys are pressed |
Text | |
| DigitToNumber | Convert a digit from the input buffer into a number |
| Print2DigitBCD | Print a binary coded decimal (BCD) number using two digits |
| PrintCharacter | Print a single-byte VDU command or character from a text token, optionally printing a drop shadow if the character is alphanumeric |
| PrintDigit | Print a numerical digit, printing zero as a capital "O" |
| PrintInputBuffer | Print the contents of the keyboard input buffer |
| PrintLandscapeNum | Print the four-digit landscape number (0000 to 9999) |
| PrintNumber | Print a number as a single digit, printing zero as a capital "O" |
| PrintTextToken | Print a recursive text token |
| PrintVduCharacter | Print a one-byte character from a text token or a multi-byte VDU 25 command |
| 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 |
| StringToNumber | Convert a string of ASCII digits in the input buffer in-place into a multi-byte BCD number |
Title screen | |
| DrawTitleObject | Draw an object on the title screen |
| DrawTitleObjects | Draw an object on top of a tower on the title screen |
| DrawTitleScreen | Draw the title screen or the screen showing the secret code |
| DrawTitleView | Draw the main title screen, the secret code screen or the landscape preview |
| ShowGameOverScreen | Display the game over screen |
| 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 |
| SpawnCharacter3D (Part 2 of 2) | Spawn large 3D blocks for the extracted character definition |
| SpawnSecretCode3D | Draw the landscape's secret code by spawning a set of large 3D text block objects |
| SpawnTitleObject | Spawn the title object (robot or the Sentinel) as object #1 |