Skip to navigation

Revs on the BBC Micro

Map of the source code

This page contains a map of all the routines and variables in the original version of Revs, 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

Workspaces

Workspace: Main variable workspace

The main block of game variables

Revs A
------

CategoryDetails

Setup

Subroutine: Entry

The main entry point for the game: move code into upper memory and call it

Setup

Subroutine: SwapCode

Move the track data to the right place and run a checksum on it

Setup

Subroutine: MoveCode

Move and reset various blocks around in memory

Setup

Variable: ldaZero

Contains code that's used for modifying the MoveCode routine

Setup

Variable: blockStartLo

Low byte of the start address of blocks moved by the MoveCode routine

Setup

Variable: blockStartHi

High byte of the start address of blocks moved by the MoveCode routine

Setup

Variable: blockEndLo

Low byte of the end address of blocks moved by the MoveCode routine

Setup

Variable: blockEndHi

High byte of the end address of blocks moved by the MoveCode routine

Setup

Variable: blockToLo

Low byte of the destination address of blocks moved by the MoveCode routine

Setup

Variable: blockToHi

High byte of the destination address of blocks moved by the MoveCode routine

Sound

Variable: soundData

OSWORD blocks for making the various game sounds

Sound

Variable: envelopeData

Data for the sound envelope for squealing tyres

Sound

Variable: xStoreSound

Temporary storage for X so it can be preserved through calls to the sound routines

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

Driving model

Subroutine: ScaleWingSettings

Scale the wing settings and calculate the wing balance, for use in the driving model

Driving model

Variable: wingScaleFactor

Scale factors for the wing settings

Track geometry

Subroutine: SpinTrackSection

Apply spin to a section in the track section list

Maths (Geometry)

Subroutine: AddVectors

Add two three-axis vectors together

Maths (Arithmetic)

Subroutine: Multiply8x8

Calculate (A T) = T * U

Maths (Arithmetic)

Subroutine: Divide8x8

Calculate T = 256 * A / V

3D objects

Subroutine: GetObjectDistance

Calculate the distance between an object and the player's car, for collision purposes

Maths (Geometry)

Subroutine: GetRotationMatrix (Part 1 of 5)

Calculate the rotation matrix for rotating the player's yaw angle 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)

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

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

Keyboard

Subroutine: ScanKeyboard

Scan the kayboard for a specific key press

Sound

Subroutine: FlushSoundBuffer

Flush the specified sound buffer

Sound

Subroutine: MakeDrivingSounds

Make the relevant sounds for the engine and tyres

Keyboard

Subroutine: ProcessShiftedKeys

Check for shifted keys (i.e. those that need SHIFT holding down to trigger) and process them accordingly

Drivers

Subroutine: SortDrivers

Create a sorted list of driver numbers, ordered as specified

Drivers

Subroutine: UpdateLapTimers

Update the lap timers and display timer-related messages at the top of the screen

Car geometry

Subroutine: PlaceCarsOnTrack

Position the cars on the track, ready for a race or qualifying lap

Car geometry

Subroutine: CheckForCrash

Check to see if we have crashed into the fence, and if so, display the fence and make the crash sound

Main loop

Subroutine: FinishRace

Continue running the race until all the non-player drivers have finished and we have a result

Car geometry

Subroutine: PushCarOffTrack

Push a car off the track and out of the race

Drivers

Subroutine: ClearTotalRaceTime

Clear a specified driver's total race time following the end of an incomplete race

3D objects

Subroutine: BuildPlayerCar

Build the objects for the player's car

Track geometry

Subroutine: GetSectionCoord

Copy a three-part 16-bit coordinate from the track section data

Track geometry

Subroutine: GetSectionCoords

Copy two three-part 16-bit coordinates from the track section data

Track geometry

Subroutine: CopySectionData

Copy a 16-bit y-coordinate from the track section data

Track geometry

Subroutine: GetPlayerIndex

Set the index for the player's segment in the track section buffer to be 32 segments behind the front segment

Track geometry

Subroutine: GetFirstSegment

Get the track section coordinates and flags from the track data and populate the first track segment

Track geometry

Subroutine: ShuffleSectionList

Shuffle the track section list along by one position

Track geometry

Subroutine: IncSectionPointers

Increment the track section list pointers following a shuffle

Track geometry

Subroutine: SetSectionPointers

Set the track section list pointer to a specific value and update the validity pointer accordingly

Car geometry

Subroutine: MovePlayerForward

Move the player's car forwards by one track segment and add the segment to the track segment buffer

Track geometry

Subroutine: GetTrackSegment (Part 1 of 3)

Set up the next track segment in the track segment buffer

Track geometry

Subroutine: GetTrackSegment (Part 2 of 3)

Set the flags for the new front segment in the track segment buffer

Track geometry

Subroutine: GetTrackSegment (Part 3 of 3)

Set the inner and outer track coordinates for the new track segment

Track geometry

Subroutine: UpdateCurveVector

Move to the next segment vector along in the direction we are facing, but only for curved track sections

Track geometry

Subroutine: UpdateVectorNumber

Move to the next segment vector along the track in the direction we are facing

Car geometry

Subroutine: ChangeDirection

Update the track segment buffer when the player's car spins so it changes the direction in which it is facing along the track

Car geometry

Subroutine: MovePlayerBack

Move the player's car backwards by one track segment and update the track segment buffer

Car geometry

Subroutine: TurnPlayerAround

Turn the player around and initialise the specified number of track segments in the new direction

Car geometry

Subroutine: MovePlayer

Move the player's car forwards or backwards by one segment

Track geometry

Subroutine: GetSegmentVector

Fetch a segment vector from the track data file

3D objects

Subroutine: MoveObjectForward

Move a specified object forwards along the track by one segment

3D objects

Subroutine: MoveObjectBack

Move a specified object backwards along the track by one segment

Tactics

Subroutine: GetSegmentSteering

Calculate the optimum steering to take for the current track segment

Keyboard

Subroutine: ProcessDrivingKeys (Part 1 of 6)

Process joystick steering

Keyboard

Subroutine: ProcessDrivingKeys (Part 2 of 6)

Process keyboard steering

Keyboard

Subroutine: ProcessDrivingKeys (Part 3 of 6)

Process joystick brake and throttle

Keyboard

Subroutine: ProcessDrivingKeys (Part 4 of 6)

Process keyboard brake and throttle

Keyboard

Subroutine: ProcessDrivingKeys (Part 5 of 6)

Process joystick gear change

Keyboard

Subroutine: ProcessDrivingKeys (Part 6 of 6)

Process keyboard gear change

Revs B
------

CategoryDetails

Main loop

Subroutine: MainDrivingLoop (Part 1 of 5)

Main driving loop: Switch to the track and start the main loop

Main loop

Subroutine: MainDrivingLoop (Part 2 of 5)

Main driving loop: The body of the main loop

Main loop

Subroutine: MainDrivingLoop (Part 3 of 5)

Main driving loop: Process rejoining the race or lap after a crash

Main loop

Subroutine: MainDrivingLoop (Part 4 of 5)

Main driving loop: Leave the track

Main loop

Subroutine: MainDrivingLoop (Part 5 of 5)

Main driving loop: Process driving keys, potentially leaving the track, and loop back to part 2

Drivers

Subroutine: AddTimeToTimer

Add time to the specified timer

Text

Subroutine: PrintSecondLineGap

Prints a text token on the second text line at the top of the driving screen, with an empty gap on the line above

Main Loop

Subroutine: ResetVariables

Reset a number of variables for driving, and print the top two text lines

Screen buffer

Subroutine: SetBackground

Set the background colour for any track lines that have not yet had a background colour set

Screen buffer

Subroutine: CopyDashData

Copy the dash data from the main game code to screen memory, and vice versa

Screen buffer

Variable: dashDataAddress

Addresses for copying the first block of dash data between the main game code and screen memory

Drawing the track

Subroutine: CheckVergeOnScreen

Check whether a verge coordinate is on-screen

Drawing the track

Subroutine: MapSegmentsToLines

Map verges in the track segment list to track lines in the track view

Drawing the track

Subroutine: DrawVergeEdge

Draw one of the four track verge edges into the screen buffer

Drawing the track

Subroutine: DrawTrack

Draw the track into the screen buffer

Drawing the track

Subroutine: SetVergeBackground

Update the background colour table for any verges that overlap the left edge of the screen

Drawing objects

Subroutine: DrawCornerMarkers

Draw any visible corner markers

Text

Subroutine: UpdatePositionInfo

Apply any position changes and update the position information at the top of the screen

Car geometry

Subroutine: ProcessContact

Process collosions between the player and the other cars

Driving model

Subroutine: SquealTyres

Make the tyres squeal

Drawing objects

Subroutine: DrawObjectEdge (Part 1 of 5)

Draw the specified edge of an object part

Drawing objects

Subroutine: DrawObjectEdge (Part 2 of 5)

Calculate the screen address for the edge we want to draw

Drawing objects

Subroutine: DrawObjectEdge (Part 3 of 5)

Construct a pixel byte for the edge we want to draw

Drawing objects

Subroutine: DrawObjectEdge (Part 4 of 5)

Draw the edge into the screen buffer, merging with any content already in the buffer

Drawing objects

Subroutine: DrawObjectEdge (Part 5 of 5)

Fill the object if required and loop back for the next edge

Dashboard

Subroutine: GetTyreDashEdge

Copy the pixel bytes along the tyre and dashboard edges so they can be feathered

Drawing objects

Subroutine: FillAfterObject

Fill the block to the right of an object

Dashboard

Subroutine: GetTyreDashEdgeSup

Copy the pixel bytes along the tyre and dashboard edges so they can be feathered

Drawing objects

Subroutine: FillAfterObjectSup

Fill the block to the right of an object

Drawing objects

Subroutine: DrawEdge

Draw an edge, overwriting whatever is already on-screen

Dashboard

Subroutine: GetTyreDashEdges

Fetch the pixel bytes from along the edge of the dashboard or tyre and fill the block to the right of the edge appropriately

Dashboard

Subroutine: CopyTyreDashEdges

Fetch the pixel bytes from the right edge of the left tyre and the right edge of the dashboard, and fill to the right of the edge

Drawing objects

Subroutine: FillInsideObject

Fill the object part from the previous edge to the current edge

Revs C
------

CategoryDetails

Screen buffer

Subroutine: GetColour (Part 1 of 3)

Calculate the colour of a specific pixel byte in the screen buffer

Screen buffer

Subroutine: GetColour (Part 2 of 3)

Process the left verge

Screen buffer

Subroutine: GetColour (Part 3 of 3)

Process the right verge

Screen buffer

Subroutine: SetMarker

Insert a marker value into a dash data block

Screen buffer

Subroutine: GetColourSup

Calculate the colour of a specific pixel byte in the screen buffer

Tactics

Subroutine: AssistSteering

Apply computer assisted steering (CAS) when configured

Keyboard

Subroutine: SetSteeringLimit

Apply a maximum limit to the amount of steering

Car geometry

Subroutine: SetPlayerDriftSup

Record player drift, but only if the player is not in the first three segments of a track section

Drawing objects

Subroutine: DrawObject

Draw an object of a specific type

Drawing objects

Subroutine: ScaleObject

Scale an object's scaffold by the scale factors in scaleUp and scaleDown

Drawing objects

Subroutine: DrawObjectEdges

Draw all the parts of an object by drawing edges into the screen buffer

3D objects

Subroutine: GetObjYawAngle (Part 1 of 4)

Calculate an object's yaw angle

3D objects

Subroutine: GetObjYawAngle (Part 2 of 4)

Calculate yaw angle for when |x-delta| > |z-delta|

3D objects

Subroutine: GetObjYawAngle (Part 3 of 4)

Calculate yaw angle for when |x-delta| = |z-delta|

3D objects

Subroutine: GetObjYawAngle (Part 4 of 4)

Calculate yaw angle for when |x-delta| < |z-delta|

3D objects

Subroutine: GetObjPitchAngle

Calculate an object's pitch angle

Track geometry

Subroutine: GetSectionAngles (Part 1 of 3)

Get the yaw and pitch angles for the inner and outer track sections

Track geometry

Subroutine: GetSectionAngles (Part 2 of 3)

Calculate the track section number for this track section entry

Track geometry

Subroutine: GetSectionAngles (Part 3 of 3)

Calculate the yaw and pitch angles for the track section entry that we want to update

Track geometry

Subroutine: GetSegmentYawAngle

Calculate the difference in yaw angle between a track segment and the player

Track geometry

Subroutine: GetSectionYawAngle

Calculate the difference in yaw angle between an object and the player

Track geometry

Subroutine: GetSegmentAngles (Part 1 of 3)

Get the yaw and pitch angles for the inner or outer track segments

Track geometry

Subroutine: GetSegmentAngles (Part 2 of 3)

Process a segment that is not visible by trying to process a segment that's one-quarter of the size

Track geometry

Subroutine: GetSegmentAngles (Part 3 of 3)

Process a visible segment

Car geometry

Subroutine: MovePlayerSegment

Move the player's car in the correct direction

Track geometry

Subroutine: GetTrackAndMarkers

Calculate the 3D coordinates of the track and corner markers

Track geometry

Subroutine: GetSegmentDetails

Get the details for the segment in front or behind

Track geometry

Subroutine: GetVergeAndMarkers (Part 1 of 4)

Get the details for a segment's corner markers and verge marks

Track geometry

Subroutine: GetVergeAndMarkers (Part 2 of 4)

Calculate the segment's verge width and outside verge coordinates

Track geometry

Subroutine: GetVergeAndMarkers (Part 3 of 4)

Process the segment's corner markers

Track geometry

Subroutine: GetVergeAndMarkers (Part 4 of 4)

Store details of the segment's verge marks

Car geometry

Subroutine: HideAllCars

Set all the cars to hidden

Main loop

Subroutine: Delay

Delay for a specified number of loops

Car geometry

Subroutine: MoveAndDrawCars

Move the cars around the track and draw any that are visible, up to a maximum of five

Drivers

Subroutine: SwapDriverPosition

Swap the position for two drivers (i.e. overtake)

Tactics

Subroutine: ProcessOvertaking (Part 1 of 3)

Process all cars for overtaking manoeuvres, checking first to see if the car has just finished overtaking the car in front

Tactics

Subroutine: ProcessOvertaking (Part 2 of 3)

The car we are processing has not overtaken the car in front of it, so if applicable, we can keep maneouvring into position

Tactics

Subroutine: ProcessOvertaking (Part 3 of 3)

Update the car status (if configured) and loop back for the next car

Car geometry

Subroutine: CompareCarSegments

Calculate the distance between two cars, in terms of segments and progress with the current segment

3D objects

Subroutine: CompareSegments

Calculate the distance between two objects, in terms of the difference in their segment numbers

Car geometry

Subroutine: MoveCars (Part 1 of 2)

Move the cars around the track

Car geometry

Subroutine: MoveCars (Part 2 of 2)

Move the cars forward around the track, and apply steering

3D objects

Subroutine: BuildVisibleCar

Check the distance to the specified car and build the car object if it is close enough

3D objects

Subroutine: BuildCarObjects (Part 1 of 3)

Calculate the 3D coordinate of the specified car

3D objects

Subroutine: BuildCarObjects (Part 2 of 3)

Add the racing line to the 3D coordinate of the specified car

3D objects

Subroutine: BuildCarObjects (Part 3 of 3)

Calculate the screen coordinates of all the objects in the specified car

3D objects

Subroutine: GetObjectAngles

Calculate the object's yaw and pitch angles, and set the object's visibility, scale and type

3D objects

Subroutine: SetObjectDetails

Set an object's visibility, scale and type

3D objects

Subroutine: HideObject

Set an object to be hidden

3D objects

Subroutine: SetObjectStatus

Set an object's status byte

Car geometry

Subroutine: CheckForContact

Check to see if the object is close enough to the player car to make contact

Drawing objects

Subroutine: DrawCarInPosition

Draw the car in a specified race position

Drawing objects

Subroutine: DrawCarOrSign

Draw a car or sign

Maths (Geometry)

Subroutine: HalveCoordinate

Halve a coordinate with three 16-bit axes

Drawing the track

Variable: vergeTableHi

High bytes of the addresses of the four verge tables

Drawing the track

Variable: vergeTableLo

Low bytes of the addresses of the four verge tables

Drawing the track

Subroutine: DrawSegmentEdge (Part 1 of 7)

Draw a single segment's edge as part of a whole track verge edge

Drawing the track

Subroutine: DrawSegmentEdge (Part 2 of 7)

Set up the edge's gradient

Drawing the track

Subroutine: DrawSegmentEdge (Part 3 of 7)

Modify the drawing routines according to the edge gradient

Drawing the track

Subroutine: DrawSegmentEdge (Part 4 of 7)

Set variables to use when updating the background colour

Drawing the track

Subroutine: DrawSegmentEdge (Part 5 of 7)

Calculate the dash data block and screen addresses for the edge

Drawing the track

Subroutine: DrawSegmentEdge (Part 6 of 7)

Calculate the dash data block for the edge

Drawing the track

Subroutine: DrawSegmentEdge (Part 7 of 7)

Save the angles for the next call to DrawSegmentEdge and return from the subroutine

Drawing the track

Subroutine: DrawShallowToRight

Draw a verge edge with a shallow gradient from left to right

Drawing the track

Subroutine: DrawShallowToLeft

Draw a verge edge with a shallow gradient from right to left

Drawing the track

Subroutine: DrawSteepToRight

Draw a verge edge with a steep gradient from left to right

Drawing the track

Subroutine: DrawSteepToLeft

Draw a verge edge with a steep gradient from right to left

Drawing the track

Subroutine: UpdateBackground

Update the background colour table for when we draw a verge edge off the left edge of the screen

Drawing the track

Subroutine: DrawVergeByteLeft

Draw two bytes into the screen buffer in the first and second dash data blocks for the edge

Drawing the track

Subroutine: StopDrawingEdge

Stop drawing the current segment's verge edge

Drawing the track

Subroutine: DrawVergeByteRight

Draw two bytes into the screen buffer in the second and third dash data blocks for the edge

Drawing the track

Subroutine: DrawGrassRight

Draw a green byte into the screen buffer in the second dash data block for the edge

Drawing the track

Subroutine: DrawGrassLeft

Draw a green byte into the screen buffer in the first dash data block for the edge

Screen buffer

Subroutine: CheckDashData

Check whether a dash data block index is pointing to dash data

Revs E
------

CategoryDetails

Text

Variable: token26

Text for recursive token 26

Text

Variable: token4

Text for recursive token 4

Screen buffer

Variable: dashData0

Contains code that gets moved into screen memory

Dashboard

Variable: tyreEdgeIndex

Index of the mask and pixel bytes for the tyre edges on a specific track line

Track geometry

Variable: segmentFlagMask

A mask for extracting bits from the segment flag byte when processing the track verge and corner markers

Track geometry

Variable: vergeColour

Lookup table for converting bits 0-2 of the segment flag byte into the verge colour scheme

Track geometry

Variable: vergeScale

Scale factors for the track verge width for different types of verge (larger value = smaller verge width)

Screen buffer

Variable: staDrawByteTyre

Low address bytes of the STA instructions in the DRAW_BYTE macros, for use when drawing track lines around the tyres

Screen buffer

Variable: dashData1

Contains code that gets moved into screen memory

Screen buffer

Variable: ldaDrawByte

Low address bytes of the LDA #0 instructions in the DRAW_BYTE macros, for use when drawing track lines around the dashboard

Drawing the track

Variable: vergeEdgeInOut

Table for mapping the verge tables to the outer and inner edges of the verge marks

Dashboard

Variable: handPixels

The number of pixels in the longest axis for the rev counter hand at various points in a half-quadrant

Screen buffer

Variable: dashData2

Contains code that gets moved into screen memory

Screen buffer

Variable: staDrawByte

Low address bytes of the STA instructions in the DRAW_BYTE macros, for use when drawing track lines around the dashboard

Screen buffer

Variable: dashData3

Contains code that gets moved into screen memory

Screen buffer

Subroutine: DrawFence (Part 2 of 2)

Draw the fence that we crash into when running off the track

Text

Variable: token18

Text for recursive token 18

Screen buffer

Variable: dashData4

Contains code that gets moved into screen memory

Text

Subroutine: PrintDriverName

Print a driver's name

Keyboard

Subroutine: CheckRestartKeys

If the restart keys are being pressed, restart the game

Text

Variable: token19

Text for recursive token 19

Screen buffer

Variable: dashData5

Contains code that gets moved into screen memory

Text

Subroutine: GetNumberFromText

Convert a two-digit string into a number

Drawing pixels

Variable: startDialLo

The low byte of the screen address of the start of the dial hand on the rev counter

Text

Variable: token20

Text for recursive token 20

Screen buffer

Variable: dashData6

Contains code that gets moved into screen memory

Dashboard

Variable: leftDashPixels

Pixels along the left edge of the dashboard

Drawing pixels

Variable: pixelsToLeft

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

Screen buffer

Variable: dashData7

Contains code that gets moved into screen memory

Dashboard

Variable: rightDashPixels

Pixels along the right edge of the dashboard

Drawing pixels

Variable: pixelsEdgeRight

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

Text

Variable: token11

Text for recursive token 11

Screen buffer

Variable: dashData8

Contains code that gets moved into screen memory

Maths (Arithmetic)

Subroutine: Absolute8Bit

Calculate the absolute value (modulus) of an 8-bit number

Screen mode

Variable: paletteSection2

Colour palette for screen section 2 in the custom screen mode (part of the mode 5 portion)

Screen mode

Variable: paletteSection0

Colour palette for screen section 0 in the custom screen mode (the mode 4 portion)

Screen mode

Variable: paletteSection3

Colour palette for screen section 3 in the custom screen mode (part of the mode 5 portion)

Screen mode

Variable: paletteSection4

Colour palette for screen section 4 in the custom screen mode (part of the mode 5 portion)

Text

Variable: token25

Text for recursive token 25

Screen buffer

Variable: dashData9

Contains code that gets moved into screen memory

Keyboard

Subroutine: WaitForSpace

Print a prompt, wait for the SPACE key to be released, and wait for SPACE to be pressed

Keyboard

Subroutine: WaitForSpaceReturn

Print a prompt, wait for the SPACE key to be released, and wait for either SPACE or RETURN to be pressed

Drawing pixels

Variable: pixelByte

A table of pixel bytes with individual pixels set

Text

Variable: token8

Text for recursive token 8

Text

Variable: token51

Text for recursive token 51

Screen buffer

Variable: dashData10

Contains code that gets moved into screen memory

3D objects

Variable: objectTop

Scaffold measurements for the top of each object part

Dashboard

Variable: leftTyrePixels

Pixels along the edge of the left tyre

Text

Variable: token31

Text for recursive token 31

Text

Variable: token3

Text for recursive token 3

Screen buffer

Variable: dashData11

Contains code that gets moved into screen memory

3D objects

Variable: objectBottom

Scaffold measurements for the bottom of each object part

Dashboard

Variable: rightTyrePixels

Pixels along the edge of the right tyre

Text

Variable: token0

Text for recursive token 0

Screen buffer

Variable: dashData12

Contains code that gets moved into screen memory

3D objects

Variable: objectLeft

Scaffold measurements for the left of each object part

Dashboard

Variable: leftTyreMask

Pixel mask for the edge of the left tyre

Text

Variable: token42

Text for recursive token 42

Text

Variable: token17

Text for recursive token 17

Screen buffer

Variable: dashData13

Contains code that gets moved into screen memory

3D objects

Variable: objectRight

Scaffold measurements for the right of each object part

Dashboard

Variable: rightTyreMask

Pixel mask for the edge of the right tyre

Text

Variable: token23

Text for recursive token 23

Text

Variable: token35

Text for recursive token 35

Screen buffer

Variable: dashData14

Contains code that gets moved into screen memory

3D objects

Variable: objectColour

Data for the colour of each object part

Text

Variable: gearNumberText

The character to print on the gear stick for each gear

Text

Variable: token43

Text for recursive token 43

Text

Variable: token44

Text for recursive token 44

Text

Variable: token45

Text for recursive token 45

Screen buffer

Variable: dashData15

Contains code that gets moved into screen memory

Text

Subroutine: Print2DigitBCD

Print a binary coded decimal (BCD) number in the specified format

Text

Variable: token22

Text for recursive token 22

Text

Variable: token16

Text for recursive token 16

Screen buffer

Variable: dashData16

Contains code that gets moved into screen memory

Car geometry

Variable: carSpeedLo

Low byte of each car's forward speed

Drivers

Variable: totalPointsLo

Low byte of total accumulated points for each driver

Drivers

Variable: racePointsLo

Used to store the low byte of the race points being awarded to the driver in race position X

Text

Variable: token39

Text for recursive token 39

Text

Variable: token48

Text for recursive token 48

Text

Variable: token49

Text for recursive token 49

Screen buffer

Variable: dashData17

Contains code that gets moved into screen memory

Dashboard

Variable: leftDashMask

Pixel mask for the left edge of the dashboard

Drawing pixels

Variable: colourPalette

The main colour palette that maps logical colours 0 to 3 to physical colours

Screen buffer

Variable: dashDataOffset

Offset of the dash data within each dash data block

Screen buffer

Variable: dashData18

Contains code that gets moved into screen memory

Dashboard

Variable: rightDashMask

Pixel mask for the right edge of the dashboard

Drawing pixels

Variable: startDialHi

The high byte of the screen address of the start of the dial hand on the rev counter

Dashboard

Variable: wheelPixels

The number of pixels in the longest axis for the steering wheel line at various points in a quadrant

Text

Variable: token32

Text for recursive token 32

Screen buffer

Variable: dashData19

Contains code that gets moved into screen memory

Drawing pixels

Variable: pixelsToRight

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

Keyboard

Variable: configKeys

Details of the configuration settings that are set by the shifted configuration keys

Keyboard

Variable: menuKeysSup

Negative inkey values for the menu keys (SPACE, "1", "2" and "3") for the Superior Software release

Drivers

Variable: totalPointsHi

High byte of total accumulated points for each driver

Drivers

Variable: racePointsHi

High byte of race points calculated for each position

Text

Variable: token30

Text for recursive token 30

Text

Variable: token2

Text for recursive token 2

Screen buffer

Variable: dashData20

Contains code that gets moved into screen memory

Text

Subroutine: PrintHeaderChecks

Print chequered lines above and below the header

Text

Variable: startChecks

The screen address offset of the start of each chequered header line

Text

Variable: endChecks

The screen address offset of the end of each chequered header line

Text

Variable: token53

Text for recursive token 53

Text

Variable: token41

Text for recursive token 41

Text

Variable: token38

Text for recursive token 38

Screen buffer

Variable: dashData21

Contains code that gets moved into screen memory

Text

Variable: tokenLo

Low byte of the token address lookup table

Drawing pixels

Variable: yLookupHi

Lookup table for converting pixel y-coordinate to high byte of screen address

Dashboard

Variable: mirrorAddressLo

The low byte of the base screen address of each mirror segment

Screen buffer

Variable: dashData22

Contains code that gets moved into screen memory

Text

Variable: tokenHi

high byte of the token address lookup table

Dashboard

Variable: shortAxis

Code modifications for the DrawDashboardLine line-drawing routine

Dashboard

Variable: stepAxis

Code modifications for the DrawDashboardLine line-drawing routine

Dashboard

Variable: mirrorAddressHi

The high byte of the base screen address of each mirror segment

Dashboard

Variable: mirrorSegment

Lookup table for working out which mirror segment a car should appear in

Screen buffer

Variable: dashData23

Contains code that gets moved into screen memory

Text

Variable: xHeader

Column number for printing mode 7 headers

Text

Variable: yHeader

Row number for printing mode 7 headers

Text

Variable: headerSpaces

Number of spaces for printing mode 7 headers

Text

Variable: headerBackground

Background colour for printing mode 7 headers

Text

Variable: headerForeground

Foreground colour for printing mode 7 headers

Text

Variable: token46

Text for recursive token 46

Text

Variable: token24

Text for recursive token 24

Screen buffer

Variable: dashData24

Contains code that gets moved into screen memory

Revs F
------

CategoryDetails

Keyboard

Subroutine: GetWingSettings

Get the front and rear wing settings from the player

Text

Subroutine: PrintRaceClass

Print the race class

Text

Variable: token50

Text for recursive token 50

Text

Variable: token6

Text for recursive token 6

Text

Variable: token13

Text for recursive token 13

Text

Variable: token14

Text for recursive token 14

Text

Variable: token15

Text for recursive token 15

Screen buffer

Variable: dashData25

Contains code and part of the dashboard image that gets moved into screen memory

3D objects

Variable: objectIndex

Index range of an object's data in the object data tables

3D objects

Variable: scaffoldIndex

Index of an object's scaffold in the objectScaffold table

Text

Subroutine: GetDriverAddress

Get the address of the specified driver's name

Text

Variable: token27

Text for recursive token 27

Text

Variable: token34

Text for recursive token 34

Screen buffer

Variable: dashData26

Contains part of the dashboard image that gets moved into screen memory

Text

Subroutine: PrintSpaces

Print the specified number of spaces

Screen buffer

Subroutine: DrawFence (Part 1 of 2)

Draw the fence that we crash into when running off the track

Screen buffer

Variable: fencePixelsGrass

Pixel bytes for the fence with green grass behind it

Screen buffer

Variable: fencePixelsSky

Pixel bytes for the fence with blue sky behind it

Text

Variable: token21

Text for recursive token 21

Screen buffer

Variable: dashData27

Contains part of the dashboard image that gets moved into screen memory

Track geometry

Variable: segmentStep

The number of segments we step over when working backwards through the track segment buffer in GetSegmentAngles

Keyboard

Variable: shiftedKeys

Negative inkey values for the configuration keys that are pressed in combination with SHIFT

Keyboard

Variable: menuKeys

Negative inkey values for the menu keys (SPACE, "1", "2" and "3") for the Acornsoft release

Keyboard

Variable: timeFromOption

Table to convert from the option numbers in the qualifying lap duration menu to the actual number of minutes

Keyboard

Variable: lapsFromOption

Table to convert from the option numbers in the laps menu to the actual number of laps

Drivers

Variable: pointsForPlace

The points awarded for the top six places, plus the fastest lap

Text

Variable: token29

Text for recursive token 29

Text

Variable: token9

Text for recursive token 9

Screen buffer

Variable: dashData28

Contains part of the dashboard image that gets moved into screen memory

Drawing the track

Variable: jumpShallowRight

Branch labels for self-modifying code in the DrawShallowToRight routine

Text

Subroutine: SetRowColours

Set the foreground and background colorus for a table row

Text

Variable: rowColours

Three different palettes for displaying even-odd rows in tables

Text

Variable: token10

Text for recursive token 10

Text

Variable: token12

Text for recursive token 12

Screen buffer

Variable: dashData29

Contains part of the dashboard image that gets moved into screen memory

Drawing the track

Variable: jumpSteepRight

Branch labels for self-modifying code in the DrawSteepToRight routine

Drawing the track

Variable: jumpSteepLeft

Branch labels for self-modifying code in the DrawSteepToLeft routine

Keyboard

Subroutine: GetNumberInput

Fetch a number between 0 and 40 from the keyboard

Dashboard

Variable: startMirror

The offset from mirrorAddress for the start of each mirror segment

Text

Variable: token37

Text for recursive token 37

Screen buffer

Variable: dashData30

Contains part of the dashboard image that gets moved into screen memory

Dashboard

Variable: fillDataOffset

Dash data offsets, tweaked to give bottom line values that are compatible with the process of filling blocks to the left

Text

Variable: token7

Text for recursive token 7

Screen buffer

Variable: dashData31

Contains part of the dashboard image that gets moved into screen memory

Drawing pixels

Variable: yLookupLo

Lookup table for converting pixel y-coordinate to low byte of screen address

Screen buffer

Variable: dashData32

Contains part of the dashboard image that gets moved into screen memory

Text

Variable: driverNames1

The first batch of driver names (1 of 5)

Screen buffer

Variable: dashData33

Contains part of the dashboard image that gets moved into screen memory

Drawing the track

Variable: jumpShallowLeft

Branch labels for self-modifying code in the DrawShallowToLeft routine

Text

Variable: token33

Text for recursive token 33

Drivers

Subroutine: ResetBestLapTime

Reset the best lap time to 10:00.0 for a specific driver

Dashboard

Variable: endMirror

The offset from mirrorAddress for the end of each mirror segment

Screen buffer

Variable: dashData34

Contains part of the dashboard image that gets moved into screen memory

Text

Variable: driverNames2

The second batch of driver names (2 of 5)

Screen buffer

Variable: dashData35

Contains part of the dashboard image that gets moved into screen memory

Text

Subroutine: PrintHeader

Configure and print a double-height header in screen mode 7

Text

Variable: token1

Text for recursive token 1

Screen buffer

Variable: dashData36

Contains part of the dashboard image that gets moved into screen memory

Text

Variable: driverNames3

The third batch of driver names (3 of 5)

Text

Variable: token40

Text for recursive token 40

Screen buffer

Variable: dashData37

Contains part of the dashboard image that gets moved into screen memory

Text

Subroutine: PrintGearNumber

Print the number of the current gear in double-width characters on the gear stick

Drivers

Subroutine: ResetBestLapTimes

Reset the best lap times to 10:00.0 for all drivers

Text

Variable: token52

Text for recursive token 52

Text

Variable: token28

Text for recursive token 28

Screen buffer

Variable: dashData38

Contains part of the dashboard image that gets moved into screen memory

Text

Variable: driverNames4

The fourth batch of driver names (4 of 5)

Text

Variable: token5

Text for recursive token 5

Text

Variable: token36

Text for recursive token 36

Screen buffer

Variable: dashData39

Contains part of the dashboard image that gets moved into screen memory

Text

Subroutine: Print234DigitBCD

Print a specific driver's accumulated points as a padded two-, three- or four-digit number

Text

Subroutine: Print4DigitBCD

Print a specific driver's accumulated points as a four-digit number

Sound

Subroutine: FlushSoundBuffers

Flush all four specified sound buffers

Dashboard

Variable: dashRightEdge

Storage for the first track pixel byte along the right edge of the dashboard

Screen buffer

Variable: dashData40

Contains part of the dashboard image that gets moved into screen memory

Text

Variable: driverNames5

The fifth batch of driver names (5 of 5)

3D objects

Variable: objectScaffold

The scaffold used to construct each object, in a scalable format

Tactics

Subroutine: GetSectionSteering

Calculate the optimum steering for each track section

Driving model

Subroutine: ApplyElevation (Part 1 of 5)

Calculate changes in the car's elevation

Driving model

Subroutine: ApplyElevation (Part 2 of 5)

Calculate the player's heading and sideways flag

Driving model

Subroutine: ApplyElevation (Part 3 of 5)

Calculate player's elevation above the track

Driving model

Subroutine: ApplyElevation (Part 4 of 5)

Calculate the height of the car above the track

Driving model

Subroutine: ApplyElevation (Part 5 of 5)

Calculate the player's 3D y-coordinate and progress speed

Track geometry

Subroutine: MultiplyHeight

Multiply the height above ground of a specified track segment by A

Car geometry

Subroutine: MovePlayerOnTrack

Update the position of the player's car within the current track segment

Car geometry

Subroutine: GetCarInSegment

Calculate the player car's position within the current segment

Car geometry

Subroutine: ScaleCarInSegment

Work out how far a car is within a segment by scaling the angle in which the car is pointing

Driving model

Subroutine: ApplyDrivingModel

Apply the driving model to the player's car

Driving model

Subroutine: ApplySpinYaw

Calculate variables based on the spin yaw angle

Maths (Arithmetic)

Subroutine: Multiply8x16Signed

Multiply an 8-bit and a 16-bit number and apply a sign to the result

Maths (Arithmetic)

Subroutine: MultiplyBy1Point5

Multiply a 16-bit signed number by 1.5

Driving model

Subroutine: ApplyTyresAndSkids

Calculate the forces on the front or rear tyres and apply skid forces and sound effects where applicable

Driving model

Subroutine: ApplySteeringSpeed

Apply steering to the car's speed in xVelocity and zVelocity

Driving model

Subroutine: ApplySteeringForce

Apply steering to xTyreForceNose and zTyreForceNose

Driving model

Subroutine: AddSteeringForce

Add the steering force to xVelocity or xTyreForceNose

Driving model

Subroutine: ScaleTyreForces

Scale the tyre forces and calculate the combined tyre force on the player

Revs G
------

CategoryDetails

Maths (Arithmetic)

Subroutine: MultiplyCoords

Multiply a 16-bit coordinate value and a 16-bit factor, optionally tallying or changing the sign of the result

Maths (Geometry)

Subroutine: SubtractCoords

Subtract from a specified coordinate variable

Maths (Geometry)

Subroutine: AddCoords

Add to a specified coordinate variable

Maths (Geometry)

Subroutine: RotateCoordToCar

Rotate a vector from the 3D world coordinate system into the frame of reference of the player's car

Maths (Geometry)

Subroutine: RotateCarToCoord

Rotate a vector from the frame of reference of the player's car into the 3D world coordinate system

Maths (Geometry)

Subroutine: RotateVector

Rotate a vector by a rotation matrix

Driving model

Subroutine: ApplyDeltas

Apply the deltas in the x-axis and z-axis to the player's coordinates

Driving model

Subroutine: UpdateVelocity

Update the player's velocity and spin yaw angle

Driving model

Subroutine: ProcessEngineStart

Process the key press for starting the engine

Driving model

Subroutine: CalcRevsNoTorque

Calculate the value of the rev counter according to the throttle being applied and zero the engine torque

Driving model

Subroutine: ThrobRevsNoTorque

Set the rev counter after adding a random throb and zero the engine torque

Driving model

Subroutine: SetRevsNoTorque

Set the rev counter and zero the engine torque

Driving model

Subroutine: ZeroEngineTorque

Zero engineTorque

Driving model

Subroutine: ApplyEngine

Apply the effects of the engine

Driving model

Subroutine: SetEngineTorque

Set engineTorque and soundRevTarget

Driving model

Subroutine: ApplyTyreForces

Calculate the tyre forces on the car

Driving model

Subroutine: ApplySkidForces

Calculate the tyre forces when the car is skidding

Driving model

Subroutine: ApplyLimitThrottle

Apply a maximum limit to a 16-bit number, unless the throttle is being applied

Driving model

Subroutine: ApplyLimitAndSign

Apply a maximum limit and a sign to a 16-bit number

Maths (Arithmetic)

Subroutine: Scale16Bit

Scale up a 16-bit value by 2^5

Driving model

Subroutine: GetTyreForces

Calculate the tyre forces due to the throttle or brakes

Driving model

Subroutine: ApplyGrassOrTrack

Apply the effects of driving or braking on grass

Driving model

Variable: wingForceTrack

The base downward force from the weight of the car when on the track, to which the downward force from the wings is added

Driving model

Variable: wingForceGrass

The base downward force from the weight of the car when on grass, to which the downward force from the wings is added

Driving model

Subroutine: ApplyWingBalance

Apply the effect of the wing settings

3D objects

Subroutine: BuildRoadSign

Create an object for the road sign

Maths (Geometry)

Subroutine: AddScaledVector

Add a scaled vector to another vector, one axis at a time

Drivers

Subroutine: InitialiseDrivers

Initialise all 20 drivers on the starting grid

Text

Subroutine: PrintSecondLine

Prints a text token on the second text line at the top of the driving screen

Text

Subroutine: PrintFirstLine

Prints a text token on the first text line at the top of the driving screen

Text

Subroutine: PrintToken

Print a recursive token

Driving model

Subroutine: ApplyVergeJump

Apply a jump to the player's car when hitting the track verge

Driving model

Subroutine: ApplyBounce

Apply a bounce to the player's car when it hits the ground

Screen mode

Subroutine: SetCustomScreen

Switch to the custom screen mode

Screen mode

Subroutine: ScreenHandler

The IRQ handler for the custom screen mode

Screen mode

Variable: screenRegisters

The 6845 registers for the custom screen mode

Screen mode

Variable: irq1Address

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

Screen mode

Variable: screenTimer1

The screen timer offset between the start of section 2 and the start of section 3

Screen mode

Variable: screenTimer2

The screen timer offset between the start of section 3 and the start of section 4

Screen mode

Subroutine: KillCustomScreen

Disable the custom screen mode and switch to mode 7

Screen mode

Subroutine: SetScreenMode7

Change to screen mode 7 and hide the cursor

Screen mode

Variable: screenSection

The section of the screen that is currently being drawn by the custom screen interrupt handler (0 to 4)

Screen mode

Subroutine: MoveHorizon

Move the position of the horizon palette switch up or down, depending on the current track pitch angle

Drivers

Subroutine: UpdateLaps

Increment the lap number and lap times for a specific driver

Drivers

Subroutine: ZeroTimer

Zero the specified timer

Text

Subroutine: PrintBestLapTime

Print the best lap time and the current lap time at the top of the screen

Text

Subroutine: PrintLapTime

Print the current lap time at the top of the screen

Keyboard

Subroutine: GetADCChannel

Read the value of an ADC channel (used to read the joystick)

Main loop

Subroutine: ProcessTime

Increment the timers and the main loop counter

Drivers

Subroutine: GetPositionAhead

Decrement X to the previous position number (from 19 to 0 and round again), which gives the position ahead of X

Drivers

Subroutine: GetPositionBehind

Increment X to the next position number (from 0 to 19 and round again), which gives the position behind X

Text

Subroutine: PrintCharacter

Print a character on-screen

Drawing pixels

Subroutine: GetScreenAddress

Return the screen address for a specified screen coordinate

Dashboard

Subroutine: EraseRevCounter

Erase a line by replacing each pixel in the line with its original contents

Dashboard

Subroutine: UpdateDashboard

Update the rev counter and steering wheel lines on the dashboard

Dashboard

Subroutine: DrawRevCounter

Draw the hand on the rev counter

Dashboard

Subroutine: DrawDashboardLine

Draw a hand on the rev counter or a line on the steering wheel

Dashboard

Subroutine: AnimateTyres

Update screen memory to animate the tyres

Dashboard

Variable: tyreTreadLeft

Tyre tread pattern for the left tyre

Dashboard

Variable: tyreTreadRight

Tyre tread pattern for the right tyre

Track data

Workspace: trackData

This is where the track data gets loaded

Screen buffer

Variable: dashData41

Contains part of the dashboard image that gets moved into screen memory

Setup

Subroutine: CallTrackHook

The track file's hook code

Drivers

Subroutine: AwardRacePoints

Award points following a race

Revs H
------

CategoryDetails

Track geometry

Variable: xVergeRightLo

Low byte of segment yaw angles along the right track verge in front of the player (i.e. along the x-axis)

Track geometry

Variable: xVergeLeftLo

Low byte of segment yaw angles along the left track verge in front of the player (i.e. along the x-axis)

Track geometry

Variable: xVergeRightHi

High byte of segment yaw angles along the right track verge in front of the player (i.e. along the x-axis)

Track geometry

Variable: xVergeLeftHi

High byte of segment yaw angles along the left track verge in front of the player (i.e. along the x-axis)

Track geometry

Variable: vergeDataRight

Data (such as colour) for the verge marks on the right side of the track

3D objects

Variable: scaledScaffold

Storage for an object's scaled scaffold

Track geometry

Variable: vergeDataLeft

Data (such as colour) for the verge marks on the left side of the track

Track geometry

Variable: yVergeRight

Segment pitch angles along the right track verge in front of the player (i.e. along the up-down y-axis)

Drivers

Variable: numberOfPlayers

The number of players

Drivers

Variable: lowestPlayerNumber

The number of the player with the lowest player number

Drivers

Variable: raceClass

The class of the current race

Drivers

Variable: qualifyingTime

The number of minutes of qualifying lap time

Drivers

Variable: competitionStarted

A flag to indicate whether or not the competition has started

Driving model

Variable: frontWingSetting

The front wing setting, as entered by the player

Driving model

Variable: rearWingSetting

The rear wing setting, as entered by the player

Drivers

Variable: lapsMenuOption

The menu option chosen from the laps menu (0 to 2)

Drivers

Variable: baseSpeed

The base speed for each car, copied from the track data

Track geometry

Variable: yVergeLeft

Segment pitch angles along the left track verge in front of the player (i.e. along the up-down y-axis)

Screen buffer

Variable: backgroundColour

The background colour for each track line

Tactics

Variable: sectionSteering

The optimum steering for each section

Drawing the track

Variable: vergePixelMask

Pixel bytes for drawing track verge edges

3D objects

Variable: scaleRange

Storage for scale factors when scaling objects

Screen buffer

Variable: zeroIfYIs55

A lookup table for zeroing Y if and only if it is &55

Maths (Geometry)

Variable: arctanY

Table for arctan values when calculating yaw angles

Maths (Geometry)

Variable: arctanP

Table for arctan values when calculating pitch angles

Car geometry

Variable: xPlayerCoordHi

The high byte of the x-coordinate of the player's 3D coordinates

Car geometry

Variable: yPlayerCoordHi

The high byte of the y-coordinate of the player's 3D coordinates

Car geometry

Variable: zPlayerCoordHi

The high byte of the z-coordinate of the player's 3D coordinates

Car geometry

Variable: xPlayerCoordTop

The top byte of the x-coordinate of the player's 3D coordinates

Car geometry

Variable: yPlayerCoordTop

The top byte of the y-coordinate of the player's 3D coordinates

Car geometry

Variable: zPlayerCoordTop

The top byte of the z-coordinate of the player's 3D coordinates

3D objects

Variable: xRoadSignCoordLo

The low byte of the x-coordinate of the road sign's 3D coordinates

3D objects

Variable: yRoadSignCoordLo

The low byte of the y-coordinate of the road sign's 3D coordinates

3D objects

Variable: zRoadSignCoordLo

The low byte of the z-coordinate of the road sign's 3D coordinates

3D objects

Variable: xRoadSignCoordHi

The high byte of the x-coordinate of the road sign's 3D coordinates

3D objects

Variable: yRoadSignCoordHi

The high byte of the y-coordinate of the road sign's 3D coordinates

3D objects

Variable: zRoadSignCoordHi

The high byte of the z-coordinate of the road sign's 3D coordinates

3D objects

Variable: objectPalette

The object colour palette that maps logical colours 0 to 3 to physical colours

Dashboard

Variable: mirrorContents

Contains the size of the car in each mirror segment

Track geometry

Variable: markerData

The segment flags for each of the three corner markers

Drawing the track

Variable: vergeEdgeRight

Contain the four pixel bytes for the verge edge we are drawing, masked to only include the rightmost 4, 3, 2 and 1 pixels

Driving model

Variable: sinYawAngleLo

Low byte of the sine of the player's yaw angle

Driving model

Variable: cosYawAngleLo

Low byte of the cosine of the player's yaw angle

Dashboard

Variable: steeringLo

The low byte of the steering wheel position

Driving model

Variable: sinYawAngleHi

High byte of the sine of the player's yaw angle

Driving model

Variable: cosYawAngleHi

High byte of the cosine of the player's yaw angle

Dashboard

Variable: steeringHi

The high byte of the steering wheel position

Driving model

Variable: tyreSqueal

A flag to determine whether the front or rear tyres are squealing

Driving model

Variable: wingSetting

Contains the scaled wing settings

Driving model

Variable: wingForce

The downward force from the front and rear wings

Driving model

Variable: wingForce95

95% of the downward force from the front and rear wings

Driving model

Variable: xPlayerSpeedLo

Low byte of the x-coordinate of the velocity vector (i.e. x-axis speed) for the player's car during this main loop iteration

Driving model

Variable: zPlayerSpeedLo

Low byte of the z-coordinate of the velocity vector (i.e. z-axis speed) for the player's car during this main loop iteration

Car geometry

Variable: spinYawAngleLo

Low byte of the amount of yaw angle spin that is being applied to the player's car

Car geometry

Variable: xPlayerCoordLo

The low byte of the x-coordinate of the player's 3D coordinates

Car geometry

Variable: yPlayerCoordLo

The low byte of the y-coordinate of the player's 3D coordinates

Car geometry

Variable: zPlayerCoordLo

The low byte of the z-coordinate of the player's 3D coordinates

Track geometry

Variable: markerListIndex

The index of the corresponding entry in the track segment list for each of the three corner markers

Track geometry

Variable: xMarkerLo

Low byte of the x-axis distance between the track edge and the three corner markers

Track geometry

Variable: xMarkerHi

High byte of the x-axis distance between the track edge and the three corner markers

Sound

Variable: soundBuffer

Details of each sound channel's buffer status

Text

Variable: characterDef

Storage for a character definition when printing characters

Text

Variable: xCursor

The cursor's x-coordinate, which can either be a pixel coordinate or a character row

Text

Variable: yCursor

The cursor's pixel y-coordinate

Driving model

Variable: xPlayerSpeedHi

High byte of the x-coordinate of the velocity vector (i.e. x-axis speed) for the player's car during this main loop iteration

Driving model

Variable: zPlayerSpeedHi

High byte of the z-coordinate of the velocity vector (i.e. z-axis speed) for the player's car during this main loop iteration

Car geometry

Variable: spinYawAngleHi

High byte of the amount of yaw angle spin that is being applied to the player's car

Driving model

Variable: xAccelerationLo

Low byte of the x-coordinate of the change in velocity of the player's car in terms of 3D world coordinates

Driving model

Variable: zAccelerationLo

Low byte of the z-coordinate of the change in velocity of the player's car in terms of 3D world coordinates

Driving model

Variable: spinYawDeltaLo

Low byte of the change in the spin yaw angle for the player's car

Driving model

Variable: xPlayerAccelLo

Low byte of the x-coordinate of the change in velocity of the player's car in the player's frame of reference

Driving model

Variable: zPlayerAccelLo

Low byte of the z-coordinate of the change in velocity of the player's car in the player's frame of reference

Driving model

Variable: xVelocityLo

Low byte of the x-coordinate of the player's velocity vector, from the player's frame of reference

Driving model

Variable: zVelocityLo

Low byte of the z-coordinate of the player's velocity vector, from the player's frame of reference

Driving model

Variable: xTyreForceNoseLo

Low byte of the x-coordinate of the force vector produced by the front tyres in the nose of the car

Driving model

Variable: xTyreForceRearLo

Low byte of the x-coordinate of the force vector produced by the rear tyres of the car

Driving model

Variable: zTyreForceNoseLo

Low byte of the z-coordinate of the force vector produced by the front tyres in the nose of the car

Driving model

Variable: zTyreForceRearLo

Low byte of the z-coordinate of the force vector produced by the rear tyres

Driving model

Variable: xSteeringForceLo

Low byte of the sideways force applied by steering

Main loop

Variable: mainLoopCounterHi

High byte of the main loop counter, which increments on each iteration of the main driving loop

Driving model

Variable: xPlayerSpeedTop

Top byte of the x-coordinate of the velocity vector (i.e. x-axis speed) for the player's car during this main loop iteration

Driving model

Variable: zPlayerSpeedTop

Top byte of the z-coordinate of the velocity vector (i.e. z-axis speed) for the player's car during this main loop iteration

Car geometry

Variable: spinYawAngleTop

Top byte of the amount of yaw angle spin that is being applied to the player's car

Driving model

Variable: xAccelerationHi

High byte of the x-coordinate of the change in velocity of the player's car in terms of 3D world coordinates

Driving model

Variable: zAccelerationHi

High byte of the z-coordinate of the change in velocity of the player's car in terms of 3D world coordinates

Driving model

Variable: spinYawDeltaHi

High byte of the change in the spin yaw angle for the player's car

Driving model

Variable: xPlayerAccelHi

High byte of the x-coordinate of the change in velocity of the player's car in the player's frame of reference

Driving model

Variable: zPlayerAccelHi

High byte of the z-coordinate of the change in velocity of the player's car in the player's frame of reference

Driving model

Variable: xVelocityHi

High byte of the x-coordinate of the player's velocity vector, from the player's frame of reference

Driving model

Variable: zVelocityHi

High byte of the z-coordinate of the player's velocity vector, from the player's frame of reference

Driving model

Variable: xTyreForceNoseHi

High byte of the x-coordinate of the force vector produced by the front tyres in the nose of the car

Driving model

Variable: xTyreForceRearHi

High byte of the x-coordinate of the force vector produced by the rear tyres of the car

Driving model

Variable: zTyreForceNoseHi

High byte of the z-coordinate of the force vector produced by the front tyres in the nose of the car

Driving model

Variable: zTyreForceRearHi

High byte of the z-coordinate of the force vector produced by the rear tyres

Driving model

Variable: xSteeringForceHi

High byte of the sideways force applied by steering

Drivers

Variable: firstLapStarted

Flag to keep track of whether we have started the first lap of practice or qualifying

Driving model

Variable: liftFromTorque

The lift of the front of the car caused by acceleration or braking

Driving model

Variable: wingBalance

Value used in the driving model when calculating the effect of the two wing settings

Car geometry

Variable: playerSideways

Contains the player's heading, for testing whether the car is pointing sideways

3D objects

Variable: thisObjectType

The type of object we are currently drawing

Drawing objects

Variable: thisDriverNumber

The number of the current driver when drawing cars

Track geometry

Variable: newSectionFetched

Flag that determines whether a new track section has been fetched

Car geometry

Variable: crashedIntoFence

Flag that records whether we have crashed into the fence

Screen mode

Variable: irqCounter

Counter that gets incremented every time the IRQ routine reaches section 4 of the custom screen

Drivers

Variable: updateLapTimes

Controls whether moving the car forward updates the lap number and lap times

Track geometry

Variable: previousSignNumber

Stores the number of the sign from the previous call to the BuildRoadSign routine

Dashboard

Variable: tyreTravel

Keeps track of how far we have travelled so we know when to animate the tyres

Driving model

Variable: playerDrift

Records whether the player's car is moving sideways by a significant amount

Track geometry

Variable: horizonTrackWidth

The arc of the track at the horizon (i.e. the track width at the horizon), halved

Screen buffer

Variable: lowestTrackLine

Used to prevent objects from being drawn below the horizon line

Text

Variable: updateDriverInfo

Flag that controls whether the driver names are updated in the information block at the top of the screen

Driving model

Variable: zTyreForceBoth

High byte of the z-coordinate of the force vector produced by the front and tyres combined

Revs I
------

CategoryDetails

Keyboard

Subroutine: GetTextInput

Fetch a string from the keyboard, padded with spaces if required

Drivers

Subroutine: SetDriverSpeed

Set the speed for a specific driver

Drivers

Subroutine: SetPlayerPositions

Set the current player's position, plus the positions behind and in front

Setup

Subroutine: Protect

Decrypt or unprotect the game code (disabled)

Tactics

Subroutine: GetSteeringAssist

Fetch the current computer assisted steering (CAS) status and show or hide the CAS indicator

Setup

Subroutine: SetupGame

Decrypt or unprotect the game code (disabled)

Main loop

Subroutine: MainLoop (Part 1 of 6)

The main game loop: practice laps

Main loop

Subroutine: MainLoop (Part 2 of 6)

The main game loop: competition setup

Main loop

Subroutine: MainLoop (Part 3 of 6)

The main game loop: qualifying laps

Main loop

Subroutine: MainLoop (Part 4 of 6)

The main game loop: the competition race

Main loop

Subroutine: MainLoop (Part 5 of 6)

The main game loop: the competition race

Main loop

Subroutine: MainLoop (Part 6 of 6)

The main game loop: race points and competition results

Main Loop

Subroutine: HeadToTrack

Get the wing settings and start a race, practice or qualifying lap

Keyboard

Subroutine: GetMenuOption

Scan the keyboard for a menu entry number, highlight the choice, show the SPACE bar message and return the choice number

Maths (Arithmetic)

Subroutine: ConvertNumberToBCD

Convert a number into binary coded decimal (BCD), for printing

Text

Subroutine: PrintDriverTable

Print the table of drivers

Text

Subroutine: PrintNearestDriver

Print a driver's name in the "In front" or "Behind" slot in the header

Text

Subroutine: PrintPositionName

Print the name of the driver in a specific position in the driver position list

Text

Subroutine: PrintDriverPrompt

Print the "DRIVER ->" prompt and a driver's name, to show whose turn it is next when playing a multi-player game

Drivers

Subroutine: AddRacePoints

Add the race points to the driver's total points

Screen buffer

Subroutine: ResetTrackLines

Reset the track lines below the horizon in the track view

Keyboard

Subroutine: GetDriverName

Fetch a player's name from the keyboard

Drawing objects

Subroutine: DrawCars

Draw all the car objects, with four objects for the closest car in front of us

Screen buffer

Variable: dashData42

Contains part of the dashboard image that gets moved into screen memory

Dashboard

Subroutine: UpdateMirrors

Update the wing mirrors to show any cars behind us

Dashboard

Subroutine: ShowStartingLights

Show the lights at the start of the race

Text

Subroutine: PrintTimer

Print the specified timer

Screen buffer

Subroutine: DrawTrackView (Part 4 of 4)

Revert all the code modifications made by the DrawTrackView routine

Screen buffer

Subroutine: DrawTrackView (Part 1 of 4)

Draw the top part of the track view using the data in the dash data blocks

Screen buffer

Subroutine: DrawTrackLine (Part 2 of 2)

Draw a pixel line across the screen in the track view

Screen buffer

Macro: DRAW_BYTE

Draw a pixel byte as part of a horizontal line when drawing the track view

Screen buffer

Subroutine: DrawTrackBytes (Part 1 of 3)

Draw the pixel bytes that make up the track view (0 to 15)

Screen buffer

Subroutine: DrawTrackView (Part 2 of 4)

Draw the part of the track view that fits around the dashboard

Screen buffer

Subroutine: DrawTrackBytes (Part 2 of 3)

Draw the pixel bytes that make up the track view (16 to 39)

Screen buffer

Subroutine: DrawTrackLine (Part 1 of 2)

Draw a pixel line across the screen in the track view, broken up into bytes

Screen buffer

Subroutine: DrawTrackBytes (Part 3 of 3)

Return from the subroutine

Screen buffer

Subroutine: DrawTrackView (Part 3 of 4)

Draw the part of the track view that fits around the dashboard and tyres

Dashboard

Subroutine: DrawCarInMirror

Draw a car in a specified segment of one of the wing mirrors, or clear a specified segment

Silverstone track data file
---------------------------

CategoryDetails

Track data

Variable: Track section data (Part 1 of 2) (Silverstone)

Data for the track sections

Track data

Variable: xTrackSignVector (Silverstone)

The x-coordinate of the track sign vector for each sign, to be scaled and added to the inner track section vector for the sign

Track data

Variable: zTrackSignVector (Silverstone)

The z-coordinate of the track sign vector for each sign, to be scaled and added to the inner track section vector for the sign

Track data

Variable: yTrackSignVector (Silverstone)

The y-coordinate of the track sign vector for each sign, to be scaled and added to the inner track section vector for the sign

Track data

Variable: xTrackSegmentI (Silverstone)

Vector x-coordinates between two consecutive segments on the inside of the track

Track data

Variable: yTrackSegmentI (Silverstone)

Vector y-coordinates between two consecutive segments on the inside of the track

Track data

Variable: zTrackSegmentI (Silverstone)

Vector z-coordinates between two consecutive segments on the inside of the track

Track data

Variable: xTrackSegmentO (Silverstone)

Vector x-coordinates from the inside to the outside of the track for each segment

Track data

Variable: zTrackSegmentO (Silverstone)

Vector z-coordinates from the inside to the outside of the track for each segment

Track data

Variable: Track section data (Part 2 of 2) (Silverstone)

Data for the track sections

Track data

Variable: trackSteering (Silverstone)

The optimum steering for non-player drivers on each track section

Track data

Variable: trackSignData (Silverstone)

Base coordinates and object types for 16 road signs

Track data

Variable: trackSectionCount (Silverstone)

The total number of track sections * 8

Track data

Variable: trackVectorCount (Silverstone)

The total number of segment vectors in the segment vector tables

Track data

Variable: trackLength (Silverstone)

The length of the full track in terms of segments

Track data

Variable: trackStartLine (Silverstone)

The segment number of the starting line

Track data

Variable: trackLapTimeSec (Silverstone)

Lap times for adjusting the race class (seconds)

Track data

Variable: trackLapTimeMin (Silverstone)

Lap times for adjusting the race class (minutes)

Track data

Variable: trackGearRatio (Silverstone)

The gear ratio for each gear

Track data

Variable: trackGearPower (Silverstone)

The power for each gear

Track data

Variable: trackBaseSpeed (Silverstone)

The base speed for each race class, used when generating the best racing lines and non-player driver speeds

Track data

Variable: trackStartPosition (Silverstone)

The starting race position of the player during a practice or qualifying lap

Track data

Variable: trackCarSpacing (Silverstone)

The spacing between the cars at the start of a qualifying lap, in segments

Track data

Variable: trackTimerAdjust (Silverstone)

Adjustment factor for the speed of the timers to allow for fine-tuning of time on a per-track basis

Track data

Variable: trackRaceSlowdown (Silverstone)

Slowdown factor for non-player drivers in the race

Track data

Subroutine: CallTrackHook (Silverstone)

The track file's hook code

Track data

Variable: trackChecksum (Silverstone)

The track file's checksum

Track data

Variable: trackGameName (Silverstone)

The game name

Track data

Variable: trackName (Silverstone)

The track name

Brands Hatch track data file
----------------------------

CategoryDetails

Extra tracks

Variable: Track section data (Part 1 of 2) (Brands Hatch)

Data for the track sections

Extra tracks

Subroutine: Hook80Percent (Brands Hatch)

Set the horizonTrackWidth to 80% of the width of the track on the horizon

Extra tracks

Variable: subSection (Brands Hatch)

The number of the current sub-section

Extra tracks

Variable: trackSubCount (Brands Hatch)

The total number of sub-sections in the track

Extra tracks

Variable: yawAngleLo (Brands Hatch)

Low byte of the current yaw angle of the track, i.e. the angle at which the track is pointing along the ground

Extra tracks

Variable: yawAngleHi (Brands Hatch)

High byte of the current yaw angle of the track, i.e. the angle at which the track is pointing along the ground

Extra tracks

Variable: segmentSlope (Brands Hatch)

The height above ground of the current track sub-section

Extra tracks

Variable: subSectionSegment (Brands Hatch)

The number of the segment within the current sub-section, counting from the start of the sub-section

Extra tracks

Variable: modifyAddressLo (Brands Hatch)

Low byte of the location in the main game code where we modify a two-byte address

Extra tracks

Variable: modifyAddressHi (Brands Hatch)

High byte of the location in the main game code where we modify a two-byte address

Extra tracks

Variable: trackYawDeltaHi (Brands Hatch)

High byte of the change in yaw angle that we apply to each segment in the specified sub-section when building the track

Track data

Variable: trackSignData (Brands Hatch)

Base coordinates and object types for 16 road signs

Extra tracks

Subroutine: CalcSegmentVector (Brands Hatch)

Calculate the segment vector for the current segment

Extra tracks

Subroutine: HookFlipAbsolute (Brands Hatch)

Set the sign of A according to the direction we are facing along the track

Extra tracks

Subroutine: HookDataPointers (Brands Hatch)

If the current section is dynamically generated, update the data pointers

Extra tracks

Variable: newContentLo (Brands Hatch)

Low byte of the two-byte address that we want to poke into the main game code at the modify location

Extra tracks

Variable: newContentHi (Brands Hatch)

High byte of the two-byte address that we want to poke into the main game code at the modify location

Extra tracks

Variable: trackYawDeltaLo (Brands Hatch)

Low byte of the change in yaw angle that we apply to each segment in the specified sub-section when building the track

Extra tracks

Variable: xTrackSignVector (Brands Hatch)

The x-coordinate of the track sign vector for each sign, to be scaled and added to the inner track section vector for the sign

Extra tracks

Subroutine: HookSegmentVector (Brands Hatch)

If the current section is dynamically generated, move to the next segment vector, calculate it and store it

Extra tracks

Subroutine: MoveToNextVector (Brands Hatch)

Move to the next to the next segment vector along the track and update the pointers

Extra tracks

Subroutine: UpdateDataPointers (Brands Hatch)

Update the sub-section and segment numbers to point to the next segment along the track in the correct direction

Extra tracks

Subroutine: HookMoveBack (Brands Hatch)

Only move the player backwards if the player has not yet driven past the segment

Extra tracks

Subroutine: SetSegmentVector (Brands Hatch)

Add the yaw angle and height deltas to the yaw angle and height (for curved sections) and calculate the segment vector

Extra tracks

Subroutine: ModifyGameCode (Part 3 of 3) (Brands Hatch)

Modify the game code to support the extra track data

Extra tracks

Variable: trackSlopeDelta (Brands Hatch)

The change in the slope (i.e. the change in the gradient) over the course of each segment for each sub-section of the track

Extra tracks

Variable: yTrackSignVector (Brands Hatch)

The y-coordinate of the track sign vector for each sign, to be scaled and added to the inner track section vector for the sign

Extra tracks

Subroutine: HookSectionFrom (Brands Hatch)

Initialise and calculate the current segment vector

Extra tracks

Subroutine: HookUpdateHorizon (Brands Hatch)

Only update the horizon if we have found fewer than 12 visible segments

Extra tracks

Subroutine: HookFieldOfView (Brands Hatch)

When populating the verge buffer in GetSegmentAngles, don't give up so easily when we get segments outside the field of view

Extra tracks

Subroutine: HookFlattenHills (Brands Hatch)

Flatten any hills in the verge buffer, calculate the hill height and track width, cut objects off at the hill height

Extra tracks

Subroutine: ModifyGameCode (Part 1 of 3) (Brands Hatch)

Modify the game code to support the extra track data

Extra tracks

Variable: trackSubSize (Brands Hatch)

The size of each sub-section, i.e. the number of segments in each sub-section

Extra tracks

Variable: zTrackSignVector (Brands Hatch)

The z-coordinate of the track sign vector for each sign, to be scaled and added to the inner track section vector for the sign

Extra tracks

Subroutine: HookFixHorizon (Brands Hatch)

Apply the horizon line in A instead of horizonLine

Extra tracks

Subroutine: HookJoystick (Brands Hatch)

Apply enhanced joystick steering to specific track sections

Extra tracks

Subroutine: Multiply8x8Signed (Brands Hatch)

Multiply two 8-bit numbers, one of which is signed

Extra tracks

Variable: xTrackCurve (Brands Hatch)

The x-coordinate of the tangent vector (i.e. the curve direction) at 64 points on a one-eighth circle covering 0 to 45 degrees

Extra tracks

Subroutine: ModifyGameCode (Part 2 of 3) (Brands Hatch)

Modify the game code to support the extra track data

Extra tracks

Variable: trackSlope (Brands Hatch)

The slope at the start of each track section

Extra tracks

Variable: trackYawAngleLo (Brands Hatch)

The low byte of the yaw angle of the start of each track section (i.e. the direction of the track at that point)

Extra tracks

Variable: trackYawAngleHi (Brands Hatch)

The high byte of the yaw angle of the start of each track section (i.e. the direction of the track at that point)

Extra tracks

Variable: trackSubConfig (Brands Hatch)

Configuration data for each section that defines the sub-section numbers, and horizon calculations

Extra tracks

Variable: trackSteering (Brands Hatch)

The optimum steering for non-player drivers on each track section

Extra tracks

Variable: zTrackCurve (Brands Hatch)

The z-coordinate of the tangent vector (i.e. the curve direction) at 64 points on a one-eighth circle covering 0 to 45 degrees

Extra tracks

Variable: Track section data (Part 2 of 2) (Brands Hatch)

Data for the track sections

Extra tracks

Subroutine: HookSlopeJump (Brands Hatch)

Jump the car when driving fast over sloping segments

Extra tracks

Variable: trackSectionCount (Brands Hatch)

The total number of track sections * 8

Track data

Variable: trackVectorCount (Brands Hatch)

The total number of segment vectors in the segment vector tables

Track data

Variable: trackLength (Brands Hatch)

The length of the full track in terms of segments

Track data

Variable: trackStartLine (Brands Hatch)

The segment number of the starting line

Extra tracks

Variable: trackLapTimeSec (Brands Hatch)

Lap times for adjusting the race class (seconds)

Extra tracks

Variable: trackLapTimeMin (Brands Hatch)

Lap times for adjusting the race class (minutes)

Extra tracks

Variable: trackGearRatio (Brands Hatch)

The gear ratio for each gear

Extra tracks

Variable: trackGearPower (Brands Hatch)

The power for each gear

Extra tracks

Variable: trackBaseSpeed (Brands Hatch)

The base speed for each race class, used when generating the best racing lines and non-player driver speeds

Extra tracks

Variable: trackStartPosition (Brands Hatch)

The starting race position of the player during a practice or qualifying lap

Extra tracks

Variable: trackCarSpacing (Brands Hatch)

The spacing between the cars at the start of a qualifying lap, in segments

Extra tracks

Variable: trackTimerAdjust (Brands Hatch)

Adjustment factor for the speed of the timers to allow for fine-tuning of time on a per-track basis

Extra tracks

Variable: trackRaceSlowdown (Brands Hatch)

Slowdown factor for non-player drivers in the race

Extra tracks

Subroutine: HookFirstSegment (Brands Hatch)

Move to the next to the next segment vector along the track and calculate the segment vector

Extra tracks

Subroutine: CallTrackHook (Brands Hatch)

The track file's hook code

Extra tracks

Variable: trackChecksum (Brands Hatch)

The track file's checksum

Extra tracks

Variable: trackGameName (Brands Hatch)

The game name

Extra tracks

Variable: trackName (Brands Hatch)

The track name

Donington Park track data file
------------------------------

CategoryDetails

Extra tracks

Variable: Track section data (Part 1 of 2) (Donington Park)

Data for the track sections

Extra tracks

Subroutine: Multiply80Percent (Donington Park)

Calculate (A T) = 0.80 * A

Extra tracks

Subroutine: HookFlipAbsolute (Donington Park)

Set the sign of A according to the direction we are facing along the track

Extra tracks

Subroutine: HookJoystick (Part 3 of 3) (Donington Park)

Apply enhanced joystick steering to specific track sections

Extra tracks

Subroutine: HookForward (Donington Park)

Move the player forward by an extra segment when edgeSegmentNumber is 10

Extra tracks

Subroutine: ModifyGameCode (Part 4 of 4) (Donington Park)

Modify the game code to support the extra track data

Extra tracks

Variable: subSection (Donington Park)

The number of the current sub-section

Extra tracks

Variable: trackSubCount (Donington Park)

The total number of sub-sections in the track

Extra tracks

Variable: yawAngleLo (Donington Park)

Low byte of the current yaw angle of the track, i.e. the angle at which the track is pointing along the ground

Extra tracks

Variable: yawAngleHi (Donington Park)

High byte of the current yaw angle of the track, i.e. the angle at which the track is pointing along the ground

Extra tracks

Variable: segmentSlope (Donington Park)

The height above ground of the current track sub-section

Extra tracks

Variable: subSectionSegment (Donington Park)

The number of the segment within the current sub-section, counting from the start of the sub-section

Extra tracks

Variable: modifyAddressLo (Donington Park)

Low byte of the location in the main game code where we modify a two-byte address

Extra tracks

Variable: modifyAddressHi (Donington Park)

High byte of the location in the main game code where we modify a two-byte address

Extra tracks

Variable: trackYawDeltaHi (Donington Park)

High byte of the change in yaw angle that we apply to each segment in the specified sub-section when building the track

Track data

Variable: trackSignData (Donington Park)

Base coordinates and object types for 16 road signs

Extra tracks

Subroutine: CalcSegmentVector (Donington Park)

Calculate the segment vector for the current segment

Extra tracks

Subroutine: Multiply8x8Signed (Donington Park)

Multiply two 8-bit numbers, one of which is signed

Extra tracks

Subroutine: HookDataPointers (Donington Park)

If the current section is dynamically generated, update the data pointers

Extra tracks

Variable: newContentLo (Donington Park)

Low byte of the two-byte address that we want to poke into the main game code at the modify location

Extra tracks

Variable: newContentHi (Donington Park)

High byte of the two-byte address that we want to poke into the main game code at the modify location

Extra tracks

Variable: trackYawDeltaLo (Donington Park)

Low byte of the change in yaw angle that we apply to each segment in the specified sub-section when building the track

Extra tracks

Variable: xTrackSignVector (Donington Park)

The x-coordinate of the track sign vector for each sign, to be scaled and added to the inner track section vector for the sign

Extra tracks

Subroutine: HookSegmentVector (Donington Park)

If the current section is dynamically generated, move to the next segment vector, calculate it and store it

Extra tracks

Subroutine: MoveToNextVector (Donington Park)

Move to the next to the next segment vector along the track and update the pointers

Extra tracks

Subroutine: UpdateDataPointers (Donington Park)

Update the sub-section and segment numbers to point to the next segment along the track in the correct direction

Extra tracks

Subroutine: HookMoveBack (Donington Park)

Only move the player backwards if the player has not yet driven past the segment

Extra tracks

Subroutine: SetSegmentVector (Donington Park)

Add the yaw angle and height deltas to the yaw angle and height (for curved sections) and calculate the segment vector

Extra tracks

Subroutine: ModifyGameCode (Part 3 of 4) (Donington Park)

Modify the game code to support the extra track data

Extra tracks

Variable: trackSlopeDelta (Donington Park)

The change in the slope (i.e. the change in the gradient) over the course of each segment for each sub-section of the track

Extra tracks

Variable: yTrackSignVector (Donington Park)

The y-coordinate of the track sign vector for each sign, to be scaled and added to the inner track section vector for the sign

Extra tracks

Subroutine: HookSectionFrom (Donington Park)

Initialise and calculate the current segment vector

Extra tracks

Subroutine: HookUpdateHorizon (Donington Park)

Only update the horizon if we have found fewer than 12 visible segments

Extra tracks

Subroutine: HookFieldOfView (Donington Park)

When populating the verge buffer in GetSegmentAngles, don't give up so easily when we get segments outside the field of view

Extra tracks

Subroutine: HookFlattenHills (Donington Park)

Flatten any hills in the verge buffer, calculate the hill height and track width, cut objects off at the hill height

Extra tracks

Subroutine: ModifyGameCode (Part 1 of 4) (Donington Park)

Modify the game code to support the extra track data

Extra tracks

Variable: trackSubSize (Donington Park)

The size of each sub-section, i.e. the number of segments in each sub-section

Extra tracks

Variable: zTrackSignVector (Donington Park)

The z-coordinate of the track sign vector for each sign, to be scaled and added to the inner track section vector for the sign

Extra tracks

Subroutine: HookFixHorizon (Donington Park)

Apply the horizon line in A instead of horizonLine

Extra tracks

Subroutine: HookJoystick (Part 1 of 3) (Donington Park)

Apply enhanced joystick steering to specific track sections

Extra tracks

Subroutine: Hook80Percent (Donington Park)

Set the horizonTrackWidth to 80% of the width of the track on the horizon

Extra tracks

Variable: xTrackCurve (Donington Park)

The x-coordinate of the tangent vector (i.e. the curve direction) at 64 points on a one-eighth circle covering 0 to 45 degrees

Extra tracks

Subroutine: ModifyGameCode (Part 2 of 4) (Donington Park)

Modify the game code to support the extra track data

Extra tracks

Variable: trackSlope (Donington Park)

The slope at the start of each track section

Extra tracks

Variable: trackYawAngleLo (Donington Park)

The low byte of the yaw angle of the start of each track section (i.e. the direction of the track at that point)

Extra tracks

Variable: trackYawAngleHi (Donington Park)

The high byte of the yaw angle of the start of each track section (i.e. the direction of the track at that point)

Extra tracks

Variable: trackSubConfig (Donington Park)

Configuration data for each section that defines the sub-section numbers, and horizon calculations

Extra tracks

Variable: trackSteering (Donington Park)

The optimum steering for non-player drivers on each track section

Extra tracks

Variable: zTrackCurve (Donington Park)

The z-coordinate of the tangent vector (i.e. the curve direction) at 64 points on a one-eighth circle covering 0 to 45 degrees

Extra tracks

Variable: Track section data (Part 2 of 2) (Donington Park)

Data for the track sections

Extra tracks

Subroutine: HookSlopeJump (Donington Park)

Jump the car when driving fast over sloping segments

Extra tracks

Subroutine: HookJoystick (Part 2 of 3) (Donington Park)

Apply enhanced joystick steering to specific track sections

Extra tracks

Subroutine: HookBackground (Donington Park)

Do not update the background colour when the track line above is showing green for the leftTrackStart verge

Extra tracks

Variable: trackSectionCount (Donington Park)

The total number of track sections * 8

Track data

Variable: trackVectorCount (Donington Park)

The total number of segment vectors in the segment vector tables

Track data

Variable: trackLength (Donington Park)

The length of the full track in terms of segments

Track data

Variable: trackStartLine (Donington Park)

The segment number of the starting line

Extra tracks

Variable: trackLapTimeSec (Donington Park)

Lap times for adjusting the race class (seconds)

Extra tracks

Variable: trackLapTimeMin (Donington Park)

Lap times for adjusting the race class (minutes)

Extra tracks

Variable: trackGearRatio (Donington Park)

The gear ratio for each gear

Extra tracks

Variable: trackGearPower (Donington Park)

The power for each gear

Extra tracks

Variable: trackBaseSpeed (Donington Park)

The base speed for each race class, used when generating the best racing lines and non-player driver speeds

Extra tracks

Variable: trackStartPosition (Donington Park)

The starting race position of the player during a practice or qualifying lap

Extra tracks

Variable: trackCarSpacing (Donington Park)

The spacing between the cars at the start of a qualifying lap, in segments

Extra tracks

Variable: trackTimerAdjust (Donington Park)

Adjustment factor for the speed of the timers to allow for fine-tuning of time on a per-track basis

Extra tracks

Variable: trackRaceSlowdown (Donington Park)

Slowdown factor for non-player drivers in the race

Extra tracks

Subroutine: HookFirstSegment (Donington Park)

Move to the next to the next segment vector along the track and calculate the segment vector

Extra tracks

Subroutine: CallTrackHook (Donington Park)

The track file's hook code

Extra tracks

Variable: trackChecksum (Donington Park)

The track file's checksum

Extra tracks

Variable: trackGameName (Donington Park)

The game name

Extra tracks

Variable: trackName (Donington Park)

The track name

Oulton Park track data file
---------------------------

CategoryDetails

Extra tracks

Variable: Track section data (Part 1 of 2) (Oulton Park)

Data for the track sections

Extra tracks

Subroutine: Hook80Percent (Oulton Park)

Set the horizonTrackWidth to 80% of the width of the track on the horizon

Extra tracks

Subroutine: HookJoystick (Part 2 of 2) (Oulton Park)

Apply enhanced joystick steering to specific track sections

Extra tracks

Variable: subSection (Oulton Park)

The number of the current sub-section

Extra tracks

Variable: trackSubCount (Oulton Park)

The total number of sub-sections in the track

Extra tracks

Variable: yawAngleLo (Oulton Park)

Low byte of the current yaw angle of the track, i.e. the angle at which the track is pointing along the ground

Extra tracks

Variable: yawAngleHi (Oulton Park)

High byte of the current yaw angle of the track, i.e. the angle at which the track is pointing along the ground

Extra tracks

Variable: segmentSlope (Oulton Park)

The height above ground of the current track sub-section

Extra tracks

Variable: subSectionSegment (Oulton Park)

The number of the segment within the current sub-section, counting from the start of the sub-section

Extra tracks

Variable: modifyAddressLo (Oulton Park)

Low byte of the location in the main game code where we modify a two-byte address

Extra tracks

Variable: modifyAddressHi (Oulton Park)

High byte of the location in the main game code where we modify a two-byte address

Extra tracks

Variable: trackYawDeltaHi (Oulton Park)

High byte of the change in yaw angle that we apply to each segment in the specified sub-section when building the track

Track data

Variable: trackSignData (Oulton Park)

Base coordinates and object types for 16 road signs

Extra tracks

Subroutine: CalcSegmentVector (Oulton Park)

Calculate the segment vector for the current segment

Extra tracks

Subroutine: Multiply8x8Signed (Oulton Park)

Multiply two 8-bit numbers, one of which is signed

Extra tracks

Subroutine: HookDataPointers (Oulton Park)

If the current section is dynamically generated, update the data pointers

Extra tracks

Variable: newContentLo (Oulton Park)

Low byte of the two-byte address that we want to poke into the main game code at the modify location

Extra tracks

Variable: newContentHi (Oulton Park)

High byte of the two-byte address that we want to poke into the main game code at the modify location

Extra tracks

Variable: trackYawDeltaLo (Oulton Park)

Low byte of the change in yaw angle that we apply to each segment in the specified sub-section when building the track

Extra tracks

Variable: xTrackSignVector (Oulton Park)

The x-coordinate of the track sign vector for each sign, to be scaled and added to the inner track section vector for the sign

Extra tracks

Subroutine: HookSegmentVector (Oulton Park)

If the current section is dynamically generated, move to the next segment vector, calculate it and store it

Extra tracks

Subroutine: MoveToNextVector (Oulton Park)

Move to the next to the next segment vector along the track and update the pointers

Extra tracks

Subroutine: UpdateDataPointers (Oulton Park)

Update the sub-section and segment numbers to point to the next segment along the track in the correct direction

Extra tracks

Subroutine: HookMoveBack (Oulton Park)

Only move the player backwards if the player has not yet driven past the segment

Extra tracks

Subroutine: SetSegmentVector (Oulton Park)

Add the yaw angle and height deltas to the yaw angle and height (for curved sections) and calculate the segment vector

Extra tracks

Subroutine: ModifyGameCode (Part 3 of 3) (Oulton Park)

Modify the game code to support the extra track data

Extra tracks

Variable: trackSlopeDelta (Oulton Park)

The change in the slope (i.e. the change in the gradient) over the course of each segment for each sub-section of the track

Extra tracks

Variable: yTrackSignVector (Oulton Park)

The y-coordinate of the track sign vector for each sign, to be scaled and added to the inner track section vector for the sign

Extra tracks

Subroutine: HookSectionFrom (Oulton Park)

Initialise and calculate the current segment vector

Extra tracks

Subroutine: HookUpdateHorizon (Oulton Park)

Only update the horizon if we have found fewer than 12 visible segments

Extra tracks

Subroutine: HookFieldOfView (Oulton Park)

When populating the verge buffer in GetSegmentAngles, don't give up so easily when we get segments outside the field of view

Extra tracks

Subroutine: HookFlattenHills (Oulton Park)

Flatten any hills in the verge buffer, calculate the hill height and track width, cut objects off at the hill height

Extra tracks

Subroutine: ModifyGameCode (Part 1 of 3) (Oulton Park)

Modify the game code to support the extra track data

Extra tracks

Variable: trackSubSize (Oulton Park)

The size of each sub-section, i.e. the number of segments in each sub-section

Extra tracks

Variable: zTrackSignVector (Oulton Park)

The z-coordinate of the track sign vector for each sign, to be scaled and added to the inner track section vector for the sign

Extra tracks

Subroutine: HookFixHorizon (Oulton Park)

Apply the horizon line in A instead of horizonLine

Extra tracks

Subroutine: HookJoystick (Part 1 of 2) (Oulton Park)

Apply enhanced joystick steering to specific track sections

Extra tracks

Variable: xTrackCurve (Oulton Park)

The x-coordinate of the tangent vector (i.e. the curve direction) at 64 points on a one-eighth circle covering 0 to 45 degrees

Extra tracks

Subroutine: ModifyGameCode (Part 2 of 3) (Oulton Park)

Modify the game code to support the extra track data

Extra tracks

Variable: trackSlope (Oulton Park)

The slope at the start of each track section

Extra tracks

Variable: trackYawAngleLo (Oulton Park)

The low byte of the yaw angle of the start of each track section (i.e. the direction of the track at that point)

Extra tracks

Variable: trackYawAngleHi (Oulton Park)

The high byte of the yaw angle of the start of each track section (i.e. the direction of the track at that point)

Extra tracks

Variable: trackSubConfig (Oulton Park)

Configuration data for each section that defines the sub-section numbers, and horizon calculations

Extra tracks

Variable: trackSteering (Oulton Park)

The optimum steering for non-player drivers on each track section

Extra tracks

Variable: zTrackCurve (Oulton Park)

The z-coordinate of the tangent vector (i.e. the curve direction) at 64 points on a one-eighth circle covering 0 to 45 degrees

Extra tracks

Variable: Track section data (Part 2 of 2) (Oulton Park)

Data for the track sections

Extra tracks

Subroutine: HookFlipAbsolute (Oulton Park)

Set the sign of A according to the direction we are facing along the track

Extra tracks

Subroutine: HookSlopeJump (Oulton Park)

Jump the car when driving fast over sloping segments

Extra tracks

Variable: trackSectionCount (Oulton Park)

The total number of track sections * 8

Track data

Variable: trackVectorCount (Oulton Park)

The total number of segment vectors in the segment vector tables

Track data

Variable: trackLength (Oulton Park)

The length of the full track in terms of segments

Track data

Variable: trackStartLine (Oulton Park)

The segment number of the starting line

Extra tracks

Variable: trackLapTimeSec (Oulton Park)

Lap times for adjusting the race class (seconds)

Extra tracks

Variable: trackLapTimeMin (Oulton Park)

Lap times for adjusting the race class (minutes)

Extra tracks

Variable: trackGearRatio (Oulton Park)

The gear ratio for each gear

Extra tracks

Variable: trackGearPower (Oulton Park)

The power for each gear

Extra tracks

Variable: trackBaseSpeed (Oulton Park)

The base speed for each race class, used when generating the best racing lines and non-player driver speeds

Extra tracks

Variable: trackStartPosition (Oulton Park)

The starting race position of the player during a practice or qualifying lap

Extra tracks

Variable: trackCarSpacing (Oulton Park)

The spacing between the cars at the start of a qualifying lap, in segments

Extra tracks

Variable: trackTimerAdjust (Oulton Park)

Adjustment factor for the speed of the timers to allow for fine-tuning of time on a per-track basis

Extra tracks

Variable: trackRaceSlowdown (Oulton Park)

Slowdown factor for non-player drivers in the race

Extra tracks

Subroutine: HookFirstSegment (Oulton Park)

Move to the next to the next segment vector along the track and calculate the segment vector

Extra tracks

Subroutine: CallTrackHook (Oulton Park)

The track file's hook code

Extra tracks

Variable: trackChecksum (Oulton Park)

The track file's checksum

Extra tracks

Variable: trackGameName (Oulton Park)

The game name

Extra tracks

Variable: trackName (Oulton Park)

The track name

Snetterton track data file
--------------------------

CategoryDetails

Extra tracks

Variable: Track section data (Part 1 of 2) (Snetterton)

Data for the track sections

Extra tracks

Subroutine: Hook80Percent (Snetterton)

Set the horizonTrackWidth to 80% of the width of the track on the horizon

Extra tracks

Subroutine: HookJoystick (Part 3 of 3) (Snetterton)

Apply enhanced joystick steering to specific track sections

Extra tracks

Subroutine: HookFlattenHills (Part 2 of 2) (Snetterton)

Flatten any hills in the verge buffer, calculate the hill height and track width, cut objects off at the hill height

Extra tracks

Variable: subSection (Snetterton)

The number of the current sub-section

Extra tracks

Variable: trackSubCount (Snetterton)

The total number of sub-sections in the track

Extra tracks

Variable: yawAngleLo (Snetterton)

Low byte of the current yaw angle of the track, i.e. the angle at which the track is pointing along the ground

Extra tracks

Variable: yawAngleHi (Snetterton)

High byte of the current yaw angle of the track, i.e. the angle at which the track is pointing along the ground

Extra tracks

Variable: segmentSlope (Snetterton)

The height above ground of the current track sub-section

Extra tracks

Variable: subSectionSegment (Snetterton)

The number of the segment within the current sub-section, counting from the start of the sub-section

Extra tracks

Variable: modifyAddressLo (Snetterton)

Low byte of the location in the main game code where we modify a two-byte address

Extra tracks

Variable: modifyAddressHi (Snetterton)

High byte of the location in the main game code where we modify a two-byte address

Extra tracks

Variable: trackYawDeltaHi (Snetterton)

High byte of the change in yaw angle that we apply to each segment in the specified sub-section when building the track

Track data

Variable: trackSignData (Snetterton)

Base coordinates and object types for 16 road signs

Extra tracks

Subroutine: CalcSegmentVector (Snetterton)

Calculate the segment vector for the current segment

Extra tracks

Subroutine: Multiply8x8Signed (Snetterton)

Multiply two 8-bit numbers, one of which is signed

Extra tracks

Subroutine: HookDataPointers (Snetterton)

If the current section is dynamically generated, update the data pointers

Extra tracks

Variable: newContentLo (Snetterton)

Low byte of the two-byte address that we want to poke into the main game code at the modify location

Extra tracks

Variable: newContentHi (Snetterton)

High byte of the two-byte address that we want to poke into the main game code at the modify location

Extra tracks

Variable: trackYawDeltaLo (Snetterton)

Low byte of the change in yaw angle that we apply to each segment in the specified sub-section when building the track

Extra tracks

Variable: xTrackSignVector (Snetterton)

The x-coordinate of the track sign vector for each sign, to be scaled and added to the inner track section vector for the sign

Extra tracks

Subroutine: HookSegmentVector (Snetterton)

If the current section is dynamically generated, move to the next segment vector, calculate it and store it

Extra tracks

Subroutine: MoveToNextVector (Snetterton)

Move to the next to the next segment vector along the track and update the pointers

Extra tracks

Subroutine: UpdateDataPointers (Snetterton)

Update the sub-section and segment numbers to point to the next segment along the track in the correct direction

Extra tracks

Subroutine: HookMoveBack (Snetterton)

Only move the player backwards if the player has not yet driven past the segment

Extra tracks

Subroutine: SetSegmentVector (Snetterton)

Add the yaw angle and height deltas to the yaw angle and height (for curved sections) and calculate the segment vector

Extra tracks

Subroutine: ModifyGameCode (Part 3 of 3) (Snetterton)

Modify the game code to support the extra track data

Extra tracks

Variable: trackSlopeDelta (Snetterton)

The change in the slope (i.e. the change in the gradient) over the course of each segment for each sub-section of the track

Extra tracks

Variable: yTrackSignVector (Snetterton)

The y-coordinate of the track sign vector for each sign, to be scaled and added to the inner track section vector for the sign

Extra tracks

Subroutine: HookSectionFrom (Snetterton)

Initialise and calculate the current segment vector

Extra tracks

Subroutine: HookUpdateHorizon (Snetterton)

Only update the horizon if we have found fewer than 12 visible segments

Extra tracks

Subroutine: HookFieldOfView (Snetterton)

When populating the verge buffer in GetSegmentAngles, don't give up so easily when we get segments outside the field of view

Extra tracks

Subroutine: HookFlattenHills (Part 1 of 2) (Snetterton)

Flatten any hills in the verge buffer, calculate the hill height and track width, cut objects off at the hill height

Extra tracks

Subroutine: ModifyGameCode (Part 1 of 3) (Snetterton)

Modify the game code to support the extra track data

Extra tracks

Variable: trackSubSize (Snetterton)

The size of each sub-section, i.e. the number of segments in each sub-section

Extra tracks

Variable: zTrackSignVector (Snetterton)

The z-coordinate of the track sign vector for each sign, to be scaled and added to the inner track section vector for the sign

Extra tracks

Subroutine: HookFixHorizon (Snetterton)

Apply the horizon line in A instead of horizonLine

Extra tracks

Subroutine: HookJoystick (Part 1 of 3) (Snetterton)

Apply enhanced joystick steering to specific track sections

Extra tracks

Variable: xTrackCurve (Snetterton)

The x-coordinate of the tangent vector (i.e. the curve direction) at 64 points on a one-eighth circle covering 0 to 45 degrees

Extra tracks

Subroutine: ModifyGameCode (Part 2 of 3) (Snetterton)

Modify the game code to support the extra track data

Extra tracks

Variable: trackSlope (Snetterton)

The slope at the start of each track section

Extra tracks

Variable: trackYawAngleLo (Snetterton)

The low byte of the yaw angle of the start of each track section (i.e. the direction of the track at that point)

Extra tracks

Variable: trackYawAngleHi (Snetterton)

The high byte of the yaw angle of the start of each track section (i.e. the direction of the track at that point)

Extra tracks

Variable: trackSubConfig (Snetterton)

Configuration data for each section that defines the sub-section numbers, and horizon calculations

Extra tracks

Variable: trackSteering (Snetterton)

The optimum steering for non-player drivers on each track section

Extra tracks

Variable: zTrackCurve (Snetterton)

The z-coordinate of the tangent vector (i.e. the curve direction) at 64 points on a one-eighth circle covering 0 to 45 degrees

Extra tracks

Variable: Track section data (Part 2 of 2) (Snetterton)

Data for the track sections

Extra tracks

Subroutine: HookFlipAbsolute (Snetterton)

Set the sign of A according to the direction we are facing along the track

Extra tracks

Subroutine: HookSlopeJump (Snetterton)

Jump the car when driving fast over sloping segments

Extra tracks

Subroutine: HookJoystick (Part 2 of 3) (Snetterton)

Apply enhanced joystick steering to specific track sections

Extra tracks

Subroutine: HookBackground (Snetterton)

Do not update the background colour when the track line above is showing green for the leftTrackStart verge

Extra tracks

Variable: trackSectionCount (Snetterton)

The total number of track sections * 8

Track data

Variable: trackVectorCount (Snetterton)

The total number of segment vectors in the segment vector tables

Track data

Variable: trackLength (Snetterton)

The length of the full track in terms of segments

Track data

Variable: trackStartLine (Snetterton)

The segment number of the starting line

Extra tracks

Variable: trackLapTimeSec (Snetterton)

Lap times for adjusting the race class (seconds)

Extra tracks

Variable: trackLapTimeMin (Snetterton)

Lap times for adjusting the race class (minutes)

Extra tracks

Variable: trackGearRatio (Snetterton)

The gear ratio for each gear

Extra tracks

Variable: trackGearPower (Snetterton)

The power for each gear

Extra tracks

Variable: trackBaseSpeed (Snetterton)

The base speed for each race class, used when generating the best racing lines and non-player driver speeds

Extra tracks

Variable: trackStartPosition (Snetterton)

The starting race position of the player during a practice or qualifying lap

Extra tracks

Variable: trackCarSpacing (Snetterton)

The spacing between the cars at the start of a qualifying lap, in segments

Extra tracks

Variable: trackTimerAdjust (Snetterton)

Adjustment factor for the speed of the timers to allow for fine-tuning of time on a per-track basis

Extra tracks

Variable: trackRaceSlowdown (Snetterton)

Slowdown factor for non-player drivers in the race

Extra tracks

Subroutine: HookFirstSegment (Snetterton)

Move to the next to the next segment vector along the track and calculate the segment vector

Extra tracks

Subroutine: CallTrackHook (Snetterton)

The track file's hook code

Extra tracks

Variable: trackChecksum (Snetterton)

The track file's checksum

Extra tracks

Variable: trackGameName (Snetterton)

The game name

Extra tracks

Variable: trackName (Snetterton)

The track name

Nürburgring track data file
---------------------------

CategoryDetails

Extra tracks

Variable: Track section data (Part 1 of 2) (Nürburgring)

Data for the track sections

Extra tracks

Subroutine: HookFlattenHills (Part 2 of 3) (Nürburgring)

Flatten any hills in the verge buffer, calculate the hill height and track width, cut objects off at the hill height

Extra tracks

Subroutine: HookMoveBack (Nürburgring)

Only move the player backwards if the player has not yet driven past the segment

Extra tracks

Variable: subSection (Nürburgring)

The number of the current sub-section

Extra tracks

Variable: trackSubCount (Nürburgring)

The total number of sub-sections in the track

Extra tracks

Variable: yawAngleLo (Nürburgring)

Low byte of the current yaw angle of the track, i.e. the angle at which the track is pointing along the ground

Extra tracks

Variable: yawAngleHi (Nürburgring)

High byte of the current yaw angle of the track, i.e. the angle at which the track is pointing along the ground

Extra tracks

Variable: segmentSlope (Nürburgring)

The height above ground of the current track sub-section

Extra tracks

Variable: subSectionSegment (Nürburgring)

The number of the segment within the current sub-section, counting from the start of the sub-section

Extra tracks

Variable: modifyAddressLo (Nürburgring)

Low byte of the location in the main game code where we modify a two-byte address

Extra tracks

Variable: modifyAddressHi (Nürburgring)

High byte of the location in the main game code where we modify a two-byte address

Extra tracks

Variable: trackYawDeltaHi (Nürburgring)

High byte of the change in yaw angle that we apply to each segment in the specified sub-section when building the track

Extra tracks

Subroutine: HookFieldOfView (Nürburgring)

When populating the verge buffer in GetSegmentAngles, don't give up so easily when we get segments outside the field of view

Track data

Variable: trackSignData (Nürburgring)

Base coordinates and object types for 16 road signs

Extra tracks

Subroutine: CalcSegmentVector (Nürburgring)

Calculate the segment vector for the current segment

Extra tracks

Subroutine: HookDataPointers (Nürburgring)

If the current section is dynamically generated, update the data pointers

Extra tracks

Subroutine: HookFlipAbsolute (Nürburgring)

Set the sign of A according to the direction we are facing along the track

Extra tracks

Variable: newContentLo (Nürburgring)

Low byte of the two-byte address that we want to poke into the main game code at the modify location

Extra tracks

Variable: newContentHi (Nürburgring)

High byte of the two-byte address that we want to poke into the main game code at the modify location

Extra tracks

Variable: trackYawDeltaLo (Nürburgring)

Low byte of the change in yaw angle that we apply to each segment in the specified sub-section when building the track

Extra tracks

Subroutine: Hook80Percent (Nürburgring)

Set the horizonTrackWidth to 80% of the width of the track on the horizon

Extra tracks

Subroutine: Multiply8x8Signed (Nürburgring)

Multiply two 8-bit numbers, one of which is signed

Extra tracks

Variable: xTrackSignVector (Nürburgring)

The x-coordinate of the track sign vector for each sign, to be scaled and added to the inner track section vector for the sign

Extra tracks

Subroutine: HookSegmentVector (Nürburgring)

If the current section is dynamically generated, move to the next segment vector, calculate it and store it

Extra tracks

Subroutine: MoveToNextVector (Nürburgring)

Move to the next to the next segment vector along the track and update the pointers

Extra tracks

Subroutine: UpdateDataPointers (Nürburgring)

Update the sub-section and segment numbers to point to the next segment along the track in the correct direction

Extra tracks

Subroutine: SetSegmentVector (Nürburgring)

Add the yaw angle and height deltas to the yaw angle and height (for curved sections) and calculate the segment vector

Extra tracks

Subroutine: ModifyGameCode (Part 3 of 3) (Nürburgring)

Modify the game code to support the extra track data

Extra tracks

Variable: trackSlopeDelta (Nürburgring)

The change in the slope (i.e. the change in the gradient) over the course of each segment for each sub-section of the track

Extra tracks

Subroutine: HookFlattenHills (Part 3 of 3) (Nürburgring)

Flatten any hills in the verge buffer, calculate the hill height and track width, cut objects off at the hill height

Extra tracks

Variable: yTrackSignVector (Nürburgring)

The y-coordinate of the track sign vector for each sign, to be scaled and added to the inner track section vector for the sign

Extra tracks

Subroutine: HookSectionFrom (Nürburgring)

Initialise and calculate the current segment vector

Extra tracks

Subroutine: HookJoystick (Part 2 of 2) (Nürburgring)

Apply enhanced joystick steering to specific track sections

Extra tracks

Subroutine: HookFlattenHills (Part 1 of 3) (Nürburgring)

Flatten any hills in the verge buffer, calculate the hill height and track width, cut objects off at the hill height

Extra tracks

Subroutine: ModifyGameCode (Part 1 of 4) (Nürburgring)

Modify the game code to support the extra track data

Extra tracks

Variable: trackSubSize (Nürburgring)

The size of each sub-section, i.e. the number of segments in each sub-section

Extra tracks

Subroutine: HookUpdateHorizon (Nürburgring)

Only update the horizon if we have found fewer than 12 visible segments

Extra tracks

Variable: zTrackSignVector (Nürburgring)

The z-coordinate of the track sign vector for each sign, to be scaled and added to the inner track section vector for the sign

Extra tracks

Subroutine: HookFixHorizon (Nürburgring)

Apply the horizon line in A instead of horizonLine

Extra tracks

Subroutine: HookSlopeJump (Nürburgring)

Jump the car when driving fast over sloping segments

Extra tracks

Variable: xTrackCurve (Nürburgring)

The x-coordinate of the tangent vector (i.e. the curve direction) at 64 points on a one-eighth circle covering 0 to 45 degrees

Extra tracks

Subroutine: ModifyGameCode (Part 2 of 3) (Nürburgring)

Modify the game code to support the extra track data

Extra tracks

Variable: trackSlope (Nürburgring)

The slope at the start of each track section

Extra tracks

Variable: trackYawAngleLo (Nürburgring)

The low byte of the yaw angle of the start of each track section (i.e. the direction of the track at that point)

Extra tracks

Variable: trackYawAngleHi (Nürburgring)

The high byte of the yaw angle of the start of each track section (i.e. the direction of the track at that point)

Extra tracks

Variable: trackSubConfig (Nürburgring)

Configuration data for each section that defines the sub-section numbers, and horizon calculations

Extra tracks

Variable: trackSteering (Nürburgring)

The optimum steering for non-player drivers on each track section

Extra tracks

Variable: zTrackCurve (Nürburgring)

The z-coordinate of the tangent vector (i.e. the curve direction) at 64 points on a one-eighth circle covering 0 to 45 degrees

Extra tracks

Variable: Track section data (Part 2 of 2) (Nürburgring)

Data for the track sections

Extra tracks

Subroutine: HookJoystick (Part 1 of 2) (Nürburgring)

Apply enhanced joystick steering to specific track sections

Extra tracks

Variable: trackSectionCount (Nürburgring)

The total number of track sections * 8

Track data

Variable: trackVectorCount (Nürburgring)

The total number of segment vectors in the segment vector tables

Track data

Variable: trackLength (Nürburgring)

The length of the full track in terms of segments

Track data

Variable: trackStartLine (Nürburgring)

The segment number of the starting line

Extra tracks

Variable: trackLapTimeSec (Nürburgring)

Lap times for adjusting the race class (seconds)

Extra tracks

Variable: trackLapTimeMin (Nürburgring)

Lap times for adjusting the race class (minutes)

Extra tracks

Variable: trackGearRatio (Nürburgring)

The gear ratio for each gear

Extra tracks

Variable: trackGearPower (Nürburgring)

The power for each gear

Extra tracks

Variable: trackBaseSpeed (Nürburgring)

The base speed for each race class, used when generating the best racing lines and non-player driver speeds

Extra tracks

Variable: trackStartPosition (Nürburgring)

The starting race position of the player during a practice or qualifying lap

Extra tracks

Variable: trackCarSpacing (Nürburgring)

The spacing between the cars at the start of a qualifying lap, in segments

Extra tracks

Variable: trackTimerAdjust (Nürburgring)

Adjustment factor for the speed of the timers to allow for fine-tuning of time on a per-track basis

Extra tracks

Variable: trackRaceSlowdown (Nürburgring)

Slowdown factor for non-player drivers in the race

Extra tracks

Subroutine: HookFirstSegment (Nürburgring)

Move to the next to the next segment vector along the track and calculate the segment vector

Extra tracks

Subroutine: CallTrackHook (Nürburgring)

The track file's hook code

Extra tracks

Variable: trackChecksum (Nürburgring)

The track file's checksum

Extra tracks

Variable: trackGameName (Nürburgring)

The game name

Extra tracks

Variable: trackName (Nürburgring)

The track name