This index contains every subroutine and entry point that appears in the source code for Revs, grouped by category. An entry points is a label within a subroutine that is called from outside the subroutine, which typically implements a subset or variation of the functionality of the parent subroutine.
- 3D objects
- Car geometry
- Dashboard
- Drawing objects
- Drawing pixels
- Drawing the track
- Drivers
- Driving model
- Extra tracks
- Keyboard
- Main loop
- Maths (Arithmetic)
- Maths (Geometry)
- Screen buffer
- Screen mode
- Setup
- Sound
- Tactics
- Text
- Track data
- Track geometry
3D objects
| |
BuildCarObjects (Part 1 of 3) | Calculate the 3D coordinate of the specified car |
BuildCarObjects (Part 2 of 3) | Add the racing line to the 3D coordinate of the specified car |
BuildCarObjects (Part 3 of 3) | Calculate the screen coordinates of all the objects in the specified car |
BuildPlayerCar | Build the objects for the player's car |
BuildPlayerCar-1 | Contains an RTS |
BuildRoadSign | Create an object for the road sign |
BuildVisibleCar | Check the distance to the specified car and build the car object if it is close enough |
CompareSegments | Calculate the distance between two objects, in terms of the difference in their segment numbers |
GetObjectAngles | Calculate the object's yaw and pitch angles, and set the object's visibility, scale and type |
GetObjectAngles-2 | Use xCoord2 for the object's 3D coordinates in the call to GetObjYawAngle |
GetObjectDistance | Calculate the distance between an object and the player's car, for collision purposes |
GetObjPitchAngle | Calculate an object's pitch angle |
GetObjPitchAngle-2 | Use yPlayerCoord (Y = 0) |
GetObjYawAngle (Part 1 of 4) | Calculate an object's yaw angle |
GetObjYawAngle (Part 2 of 4) | Calculate yaw angle for when |x-delta| > |z-delta| |
GetObjYawAngle (Part 3 of 4) | Calculate yaw angle for when |x-delta| = |z-delta| |
GetObjYawAngle (Part 4 of 4) | Calculate yaw angle for when |x-delta| < |z-delta| |
GetObjYawAngle-2 | Use xPlayerCoord (Y = 0) |
HideObject | Set an object to be hidden |
MoveObjectBack | Move a specified object backwards along the track by one segment |
MoveObjectForward | Move a specified object forwards along the track by one segment |
SetObjectDetails | Set an object's visibility, scale and type |
SetObjectStatus | Set an object's status byte |
Car geometry
| |
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 |
ChangeDirection-1 | Contains an RTS |
CheckForContact | Check to see if the object is close enough to the player car to make contact |
CheckForContact-2 | Set Y = 37, so we make contact if (L K) <= 37 |
CheckForCrash | Check to see if we have crashed into the fence, and if so, display the fence and make the crash sound |
CompareCarSegments | Calculate the distance between two cars, in terms of segments and progress with the current segment |
GetCarInSegment | Calculate the player car's position within the current segment |
HideAllCars | Set all the cars to hidden |
MoveAndDrawCars | Move the cars around the track and draw any that are visible, up to a maximum of five |
MoveCars (Part 1 of 2) | Move the cars around the track |
MoveCars (Part 2 of 2) | Move the cars forward around the track, and apply steering |
MoveCars-1 | Contains an RTS |
MovePlayer | Move the player's car forwards or backwards by one segment |
MovePlayerBack | Move the player's car backwards by one track segment and update the track segment buffer |
MovePlayerForward | Move the player's car forwards by one track segment and add the segment to the track segment buffer |
MovePlayerOnTrack | Update the position of the player's car within the current track segment |
MovePlayerSegment | Move the player's car in the correct direction |
PlaceCarsOnTrack | Position the cars on the track, ready for a race or qualifying lap |
ProcessContact | Process collisions between the player and the other cars |
PushCarOffTrack | Push a car off the track and out of the race |
ScaleCarInSegment | Work out how far a car is within a segment by scaling the angle in which the car is pointing |
SetPlayerDriftSup | Record player drift, but only if the player is not in the first three segments of a track section |
TurnPlayerAround | Turn the player around and initialise the specified number of track segments in the new direction |
Dashboard
| |
AnimateTyres | Update screen memory to animate the tyres |
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 |
DrawCarInMirror | Draw a car in a specified segment of one of the wing mirrors, or clear a specified segment |
DrawDashboardLine | Draw a hand on the rev counter or a line on the steering wheel |
DrawRevCounter | Draw the hand on the rev counter |
EraseRevCounter | Erase a line by replacing each pixel in the line with its original contents |
GetTyreDashEdge | Copy the pixel bytes along the tyre and dashboard edges so they can be feathered |
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 |
GetTyreDashEdgeSup | Copy the pixel bytes along the tyre and dashboard edges so they can be feathered |
ShowStartingLights | Show the lights at the start of the race |
UpdateDashboard | Update the rev counter and steering wheel lines on the dashboard |
UpdateMirrors | Update the wing mirrors to show any cars behind us |
Drawing objects
| |
draw29 | Fill the inside of the object part from the previous block to the current one |
DrawCarInPosition | Draw the car in a specified race position |
DrawCarOrSign | Draw a car or sign |
DrawCars | Draw all the car objects, with four objects for the closest car in front of us |
DrawCornerMarkers | Draw any visible corner markers |
DrawEdge | Draw an edge, overwriting whatever is already on-screen |
DrawObject | Draw an object of a specific type |
DrawObjectEdge (Part 1 of 5) | Draw the specified edge of an object part |
DrawObjectEdge (Part 2 of 5) | Calculate the screen address for the edge we want to draw |
DrawObjectEdge (Part 3 of 5) | Construct a pixel byte for the edge we want to draw |
DrawObjectEdge (Part 4 of 5) | Draw the edge into the screen buffer, merging with any content already in the buffer |
DrawObjectEdge (Part 5 of 5) | Fill the object if required and loop back for the next edge |
DrawObjectEdge-1 | Contains an RTS |
DrawObjectEdges | Draw all the parts of an object by drawing edges into the screen buffer |
FillAfterObject | Fill the block to the right of an object |
FillAfterObjectSup | Fill the block to the right of an object |
FillInsideObject | Fill the object part from the previous edge to the current edge |
ScaleObject | Scale an object's scaffold by the scale factors in scaleUp and scaleDown |
Drawing pixels
| |
GetScreenAddress | Return the screen address for a specified screen coordinate |
GetScreenAddress-2 | Treat the x-coordinate as a character column number rather than a pixel coordinate (0 to 39) |
Drawing the track
| |
CheckVergeOnScreen | Check whether a verge coordinate is on-screen |
DrawGrassLeft | Draw a green byte into the screen buffer in the first dash data block for the edge |
DrawGrassRight | Draw a green byte into the screen buffer in the second dash data block for the edge |
DrawSegmentEdge (Part 1 of 7) | Draw a single segment's edge as part of a whole track verge edge |
DrawSegmentEdge (Part 2 of 7) | Set up the edge's gradient |
DrawSegmentEdge (Part 3 of 7) | Modify the drawing routines according to the edge gradient |
DrawSegmentEdge (Part 4 of 7) | Set variables to use when updating the background colour |
DrawSegmentEdge (Part 5 of 7) | Calculate the dash data block and screen addresses for the edge |
DrawSegmentEdge (Part 6 of 7) | Calculate the dash data block for the edge |
DrawSegmentEdge (Part 7 of 7) | Save the angles for the next call to DrawSegmentEdge and return from the subroutine |
DrawShallowToLeft | Draw a verge edge with a shallow gradient from right to left |
DrawShallowToRight | Draw a verge edge with a shallow gradient from left to right |
DrawSteepToLeft | Draw a verge edge with a steep gradient from right to left |
DrawSteepToRight | Draw a verge edge with a steep gradient from left to right |
DrawTrack | Draw the track into the screen buffer |
DrawVergeByteLeft | Draw two bytes into the screen buffer in the first and second dash data blocks for the edge |
DrawVergeByteRight | Draw two bytes into the screen buffer in the second and third dash data blocks for the edge |
DrawVergeEdge | Draw one of the four track verge edges into the screen buffer |
MapSegmentsToLines | Map verges in the track segment list to track lines in the track view |
SetVergeBackground | Update the background colour table for any verges that overlap the left edge of the screen |
StopDrawingEdge | Stop drawing the current segment's verge edge |
strl10 | Finish drawing the verge edge by updating the background table for this track line |
UpdateBackground | Update the background colour table for when we draw a verge edge off the left edge of the screen |
Drivers
| |
AddRacePoints | Add the race points to the driver's total points |
AddTimeToTimer | Add time to the specified timer |
AwardRacePoints | Award points following a race |
ClearTotalRaceTime | Clear a specified driver's total race time following the end of an incomplete race |
GetPositionAhead | Decrement X to the previous position number (from 19 to 0 and round again), which gives the position ahead of X |
GetPositionBehind | Increment X to the next position number (from 0 to 19 and round again), which gives the position behind X |
InitialiseDrivers | Initialise all 20 drivers on the starting grid |
ResetBestLapTime | Reset the best lap time to 10:00.0 for a specific driver |
ResetBestLapTimes | Reset the best lap times to 10:00.0 for all drivers |
SetDriverSpeed | Set the speed for a specific driver |
SetPlayerPositions | Set the current player's position, plus the positions behind and in front |
SortDrivers | Create a sorted list of driver numbers, ordered as specified |
SwapDriverPosition | Swap the position for two drivers (i.e. overtake) |
UpdateLaps | Increment the lap number and lap times for a specific driver |
UpdateLapTimers | Update the lap timers and display timer-related messages at the top of the screen |
ZeroTimer | Zero the specified timer |
Driving model
| |
AddSteeringForce | Add the steering force to xVelocity or xTyreForceNose |
ApplyBounce | Apply a bounce to the player's car when it hits the ground |
ApplyDeltas | Apply the deltas in the x-axis and z-axis to the player's coordinates |
ApplyDrivingModel | Apply the driving model to the player's car |
ApplyElevation (Part 1 of 5) | Calculate changes in the car's elevation |
ApplyElevation (Part 2 of 5) | Calculate the player's heading and sideways flag |
ApplyElevation (Part 3 of 5) | Calculate player's elevation above the track |
ApplyElevation (Part 4 of 5) | Calculate the height of the car above the track |
ApplyElevation (Part 5 of 5) | Calculate the player's 3D y-coordinate and progress speed |
ApplyEngine | Apply the effects of the engine |
ApplyGrassOrTrack | Apply the effects of driving or braking on grass |
ApplyLimitAndSign | Apply a maximum limit and a sign to a 16-bit number |
ApplyLimitThrottle | Apply a maximum limit to a 16-bit number, unless the throttle is being applied |
ApplySkidForces | Calculate the tyre forces when the car is skidding |
ApplySpinYaw | Calculate variables based on the spin yaw angle |
ApplySteeringForce | Apply steering to xTyreForceNose and zTyreForceNose |
ApplySteeringSpeed | Apply steering to the car's speed in xVelocity and zVelocity |
ApplyTyreForces | Calculate the tyre forces on the car |
ApplyTyresAndSkids | Calculate the forces on the front or rear tyres and apply skid forces and sound effects where applicable |
ApplyVergeJump | Apply a jump to the player's car when hitting the track verge |
ApplyWingBalance | Apply the effect of the wing settings |
CalcRevsNoTorque | Calculate the value of the rev counter according to the throttle being applied and zero the engine torque |
CalcRevsNoTorque-2 | Set clutchEngaged to A before running the routine |
GetTyreForces | Calculate the tyre forces due to the throttle or brakes |
lims1 | Skip applying the maximum value to variableG, so we set: variableG = (A T) * abs(H) |
ProcessEngineStart | Process the key press for starting the engine |
ScaleTyreForces | Scale the tyre forces and calculate the combined tyre force on the player |
ScaleWingSettings | Scale the wing settings and calculate the wing balance, for use in the driving model |
SetEngineTorque | Set engineTorque and soundRevTarget |
SetRevsNoTorque | Set the rev counter and zero the engine torque |
SquealTyres | Make the tyres squeal |
ThrobRevsNoTorque | Set the rev counter after adding a random throb and zero the engine torque |
UpdateVelocity | Update the player's velocity and spin yaw angle |
ZeroEngineTorque | Zero engineTorque |
Extra tracks
| |
CalcSegmentVector (Brands Hatch) | Calculate the segment vector for the current segment |
CalcSegmentVector (Donington Park) | Calculate the segment vector for the current segment |
CalcSegmentVector (Nürburgring) | Calculate the segment vector for the current segment |
CalcSegmentVector (Oulton Park) | Calculate the segment vector for the current segment |
CalcSegmentVector (Snetterton) | Calculate the segment vector for the current segment |
CallTrackHook (Brands Hatch) | The track file's hook code |
CallTrackHook (Donington Park) | The track file's hook code |
CallTrackHook (Nürburgring) | The track file's hook code |
CallTrackHook (Oulton Park) | The track file's hook code |
CallTrackHook (Snetterton) | The track file's hook code |
fovw1-1 (Nürburgring) | Contains an RTS |
Hook80Percent (Brands Hatch) | Set the horizonTrackWidth to 80% of the width of the track on the horizon |
Hook80Percent (Donington Park) | Set the horizonTrackWidth to 80% of the width of the track on the horizon |
Hook80Percent (Nürburgring) | Set the horizonTrackWidth to 80% of the width of the track on the horizon |
Hook80Percent (Oulton Park) | Set the horizonTrackWidth to 80% of the width of the track on the horizon |
Hook80Percent (Snetterton) | Set the horizonTrackWidth to 80% of the width of the track on the horizon |
HookBackground (Donington Park) | Do not update the background colour when the track line above is showing green for the leftTrackStart verge |
HookBackground (Snetterton) | Do not update the background colour when the track line above is showing green for the leftTrackStart verge |
HookDataPointers (Brands Hatch) | If the current section is dynamically generated, update the data pointers |
HookDataPointers (Donington Park) | If the current section is dynamically generated, update the data pointers |
HookDataPointers (Nürburgring) | If the current section is dynamically generated, update the data pointers |
HookDataPointers (Oulton Park) | If the current section is dynamically generated, update the data pointers |
HookDataPointers (Snetterton) | If the current section is dynamically generated, update the data pointers |
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 |
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 |
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 |
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 |
HookFieldOfView (Snetterton) | When populating the verge buffer in GetSegmentAngles, don't give up so easily when we get segments outside the field of view |
HookFirstSegment (Brands Hatch) | Move to the next to the next segment vector along the track and calculate the segment vector |
HookFirstSegment (Donington Park) | Move to the next to the next segment vector along the track and calculate the segment vector |
HookFirstSegment (Nürburgring) | Move to the next to the next segment vector along the track and calculate the segment vector |
HookFirstSegment (Oulton Park) | Move to the next to the next segment vector along the track and calculate the segment vector |
HookFirstSegment (Snetterton) | Move to the next to the next segment vector along the track and calculate the segment vector |
HookFixHorizon (Brands Hatch) | Apply the horizon line in A instead of horizonLine |
HookFixHorizon (Donington Park) | Apply the horizon line in A instead of horizonLine |
HookFixHorizon (Nürburgring) | Apply the horizon line in A instead of horizonLine |
HookFixHorizon (Oulton Park) | Apply the horizon line in A instead of horizonLine |
HookFixHorizon (Snetterton) | Apply the horizon line in A instead of horizonLine |
HookFlattenHills (Brands Hatch) | Flatten any hills in the verge buffer, calculate the hill height and track width, cut objects off at the hill height |
HookFlattenHills (Donington Park) | Flatten any hills in the verge buffer, calculate the hill height and track width, cut objects off at the hill height |
HookFlattenHills (Oulton Park) | Flatten any hills in the verge buffer, calculate the hill height and track width, cut objects off at the hill height |
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 |
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 |
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 |
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 |
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 |
HookFlipAbsolute (Brands Hatch) | Set the sign of A according to the direction we are facing along the track |
HookFlipAbsolute (Donington Park) | Set the sign of A according to the direction we are facing along the track |
HookFlipAbsolute (Nürburgring) | Set the sign of A according to the direction we are facing along the track |
HookFlipAbsolute (Oulton Park) | Set the sign of A according to the direction we are facing along the track |
HookFlipAbsolute (Snetterton) | Set the sign of A according to the direction we are facing along the track |
HookForward (Donington Park) | Move the player forward by an extra segment when edgeSegmentNumber is 10 |
HookJoystick (Brands Hatch) | Apply enhanced joystick steering to specific track sections |
HookJoystick (Part 1 of 2) (Nürburgring) | Apply enhanced joystick steering to specific track sections |
HookJoystick (Part 1 of 2) (Oulton Park) | Apply enhanced joystick steering to specific track sections |
HookJoystick (Part 1 of 3) (Donington Park) | Apply enhanced joystick steering to specific track sections |
HookJoystick (Part 1 of 3) (Snetterton) | Apply enhanced joystick steering to specific track sections |
HookJoystick (Part 2 of 2) (Nürburgring) | Apply enhanced joystick steering to specific track sections |
HookJoystick (Part 2 of 2) (Oulton Park) | Apply enhanced joystick steering to specific track sections |
HookJoystick (Part 2 of 3) (Donington Park) | Apply enhanced joystick steering to specific track sections |
HookJoystick (Part 2 of 3) (Snetterton) | Apply enhanced joystick steering to specific track sections |
HookJoystick (Part 3 of 3) (Donington Park) | Apply enhanced joystick steering to specific track sections |
HookJoystick (Part 3 of 3) (Snetterton) | Apply enhanced joystick steering to specific track sections |
HookMoveBack (Brands Hatch) | Only move the player backwards if the player has not yet driven past the segment |
HookMoveBack (Donington Park) | Only move the player backwards if the player has not yet driven past the segment |
HookMoveBack (Nürburgring) | Only move the player backwards if the player has not yet driven past the segment |
HookMoveBack (Oulton Park) | Only move the player backwards if the player has not yet driven past the segment |
HookMoveBack (Snetterton) | Only move the player backwards if the player has not yet driven past the segment |
HookSectionFrom (Brands Hatch) | Initialise and calculate the current segment vector |
HookSectionFrom (Donington Park) | Initialise and calculate the current segment vector |
HookSectionFrom (Nürburgring) | Initialise and calculate the current segment vector |
HookSectionFrom (Oulton Park) | Initialise and calculate the current segment vector |
HookSectionFrom (Snetterton) | Initialise and calculate the current segment vector |
HookSegmentVector (Brands Hatch) | If the current section is dynamically generated, move to the next segment vector, calculate it and store it |
HookSegmentVector (Donington Park) | If the current section is dynamically generated, move to the next segment vector, calculate it and store it |
HookSegmentVector (Nürburgring) | If the current section is dynamically generated, move to the next segment vector, calculate it and store it |
HookSegmentVector (Oulton Park) | If the current section is dynamically generated, move to the next segment vector, calculate it and store it |
HookSegmentVector (Snetterton) | If the current section is dynamically generated, move to the next segment vector, calculate it and store it |
HookSlopeJump (Brands Hatch) | Jump the car when driving fast over sloping segments |
HookSlopeJump (Donington Park) | Jump the car when driving fast over sloping segments |
HookSlopeJump (Nürburgring) | Jump the car when driving fast over sloping segments |
HookSlopeJump (Oulton Park) | Jump the car when driving fast over sloping segments |
HookSlopeJump (Snetterton) | Jump the car when driving fast over sloping segments |
HookUpdateHorizon (Brands Hatch) | Only update the horizon if we have found fewer than 12 visible segments |
HookUpdateHorizon (Donington Park) | Only update the horizon if we have found fewer than 12 visible segments |
HookUpdateHorizon (Nürburgring) | Only update the horizon if we have found fewer than 12 visible segments |
HookUpdateHorizon (Oulton Park) | Only update the horizon if we have found fewer than 12 visible segments |
HookUpdateHorizon (Snetterton) | Only update the horizon if we have found fewer than 12 visible segments |
ModifyGameCode (Part 1 of 3) (Brands Hatch) | Modify the game code to support the extra track data |
ModifyGameCode (Part 1 of 3) (Oulton Park) | Modify the game code to support the extra track data |
ModifyGameCode (Part 1 of 3) (Snetterton) | Modify the game code to support the extra track data |
ModifyGameCode (Part 1 of 4) (Donington Park) | Modify the game code to support the extra track data |
ModifyGameCode (Part 1 of 4) (Nürburgring) | Modify the game code to support the extra track data |
ModifyGameCode (Part 2 of 3) (Brands Hatch) | Modify the game code to support the extra track data |
ModifyGameCode (Part 2 of 3) (Nürburgring) | Modify the game code to support the extra track data |
ModifyGameCode (Part 2 of 3) (Oulton Park) | Modify the game code to support the extra track data |
ModifyGameCode (Part 2 of 3) (Snetterton) | Modify the game code to support the extra track data |
ModifyGameCode (Part 2 of 4) (Donington Park) | Modify the game code to support the extra track data |
ModifyGameCode (Part 3 of 3) (Brands Hatch) | Modify the game code to support the extra track data |
ModifyGameCode (Part 3 of 3) (Nürburgring) | Modify the game code to support the extra track data |
ModifyGameCode (Part 3 of 3) (Oulton Park) | Modify the game code to support the extra track data |
ModifyGameCode (Part 3 of 3) (Snetterton) | Modify the game code to support the extra track data |
ModifyGameCode (Part 3 of 4) (Donington Park) | Modify the game code to support the extra track data |
ModifyGameCode (Part 4 of 4) (Donington Park) | Modify the game code to support the extra track data |
MoveToNextVector (Brands Hatch) | Move to the next to the next segment vector along the track and update the pointers |
MoveToNextVector (Donington Park) | Move to the next to the next segment vector along the track and update the pointers |
MoveToNextVector (Nürburgring) | Move to the next to the next segment vector along the track and update the pointers |
MoveToNextVector (Oulton Park) | Move to the next to the next segment vector along the track and update the pointers |
MoveToNextVector (Snetterton) | Move to the next to the next segment vector along the track and update the pointers |
Multiply80Percent (Donington Park) | Calculate (A T) = 0.80 * A |
Multiply8x8Signed (Brands Hatch) | Multiply two 8-bit numbers, one of which is signed |
Multiply8x8Signed (Donington Park) | Multiply two 8-bit numbers, one of which is signed |
Multiply8x8Signed (Nürburgring) | Multiply two 8-bit numbers, one of which is signed |
Multiply8x8Signed (Oulton Park) | Multiply two 8-bit numbers, one of which is signed |
Multiply8x8Signed (Snetterton) | Multiply two 8-bit numbers, one of which is signed |
SetSegmentVector (Brands Hatch) | Add the yaw angle and height deltas to the yaw angle and height (for curved sections) and calculate the segment vector |
SetSegmentVector (Donington Park) | Add the yaw angle and height deltas to the yaw angle and height (for curved sections) and calculate the segment vector |
SetSegmentVector (Nürburgring) | Add the yaw angle and height deltas to the yaw angle and height (for curved sections) and calculate the segment vector |
SetSegmentVector (Oulton Park) | Add the yaw angle and height deltas to the yaw angle and height (for curved sections) and calculate the segment vector |
SetSegmentVector (Snetterton) | Add the yaw angle and height deltas to the yaw angle and height (for curved sections) and calculate the segment vector |
UpdateDataPointers (Brands Hatch) | Update the sub-section and segment numbers to point to the next segment along the track in the correct direction |
UpdateDataPointers (Donington Park) | Update the sub-section and segment numbers to point to the next segment along the track in the correct direction |
UpdateDataPointers (Nürburgring) | Update the sub-section and segment numbers to point to the next segment along the track in the correct direction |
UpdateDataPointers (Oulton Park) | Update the sub-section and segment numbers to point to the next segment along the track in the correct direction |
UpdateDataPointers (Snetterton) | Update the sub-section and segment numbers to point to the next segment along the track in the correct direction |
Keyboard
| |
CheckRestartKeys | If the restart keys are being pressed, restart the game |
GetADCChannel | Read the value of an ADC channel (used to read the joystick) |
GetDriverName | Fetch a player's name from the keyboard |
GetMenuOption | Scan the keyboard for a menu entry number, highlight the choice, show the SPACE bar message and return the choice number |
GetNumberInput | Fetch a number between 0 and 40 from the keyboard |
GetTextInput | Fetch a string from the keyboard, padded with spaces if required |
GetWingSettings | Get the front and rear wing settings from the player |
keys10 | Re-entry point for the AssistSteering routine when CAS is being applied to the steering |
keys11 | Re-entry point for the AssistSteering routine if CAS is not enabled or the car is facing backwards |
keys7 | Re-entry point for the AssistSteering routine when no joystick steering is being applied |
ProcessDrivingKeys (Part 1 of 6) | Process joystick steering |
ProcessDrivingKeys (Part 2 of 6) | Process keyboard steering |
ProcessDrivingKeys (Part 3 of 6) | Process joystick brake and throttle |
ProcessDrivingKeys (Part 4 of 6) | Process keyboard brake and throttle |
ProcessDrivingKeys (Part 5 of 6) | Process joystick gear change |
ProcessDrivingKeys (Part 6 of 6) | Process keyboard gear change |
ProcessShiftedKeys | Check for shifted keys (i.e. those that need SHIFT holding down to trigger) and process them accordingly |
RestartGame | Restart the game, putting the C flag into bit 7 of pressingShiftArrow |
ScanKeyboard | Scan the keyboard for a specific key press |
ScanKeyboard-1 | Contains an RTS |
SetSteeringLimit | Apply a maximum limit to the amount of steering |
WaitForSpace | Print a prompt, wait for the SPACE key to be released, and wait for SPACE to be pressed |
WaitForSpaceReturn | Print a prompt, wait for the SPACE key to be released, and wait for either SPACE or RETURN to be pressed |
Main loop
| |
Delay | Delay for a specified number of loops |
FinishRace | Continue running the race until all the non-player drivers have finished and we have a result |
HeadToTrack | Get the wing settings and start a race, practice or qualifying lap |
HeadToTrack+2 | Called with A = %10000000 to start a race, as opposed to practice or a qualifying lap |
MainDrivingLoop (Part 1 of 5) | Main driving loop: Switch to the track and start the main loop |
MainDrivingLoop (Part 2 of 5) | Main driving loop: The body of the main loop |
MainDrivingLoop (Part 3 of 5) | Main driving loop: Process rejoining the race or lap after a crash |
MainDrivingLoop (Part 4 of 5) | Main driving loop: Leave the track |
MainDrivingLoop (Part 5 of 5) | Main driving loop: Process driving keys, potentially leaving the track, and loop back to part 2 |
MainLoop (Part 1 of 6) | The main game loop: practice laps |
MainLoop (Part 2 of 6) | The main game loop: competition setup |
MainLoop (Part 3 of 6) | The main game loop: qualifying laps |
MainLoop (Part 4 of 6) | The main game loop: the competition race |
MainLoop (Part 5 of 6) | The main game loop: the competition race |
MainLoop (Part 6 of 6) | The main game loop: race points and competition results |
ProcessTime | Increment the timers and the main loop counter |
ResetVariables | Reset a number of variables for driving, and print the top two text lines |
Maths (Arithmetic)
| |
Absolute16Bit | Calculate the absolute value (modulus) of a 16-bit number |
Absolute8Bit | Calculate the absolute value (modulus) of an 8-bit number |
ConvertNumberToBCD | Convert a number into binary coded decimal (BCD), for printing |
Divide8x8 | Calculate T = 256 * A / V |
Multiply16x16 | Multiply a sign-magnitude 16-bit number and a signed 16-bit number |
Multiply8x16 | Multiply an 8-bit and a 16-bit number |
Multiply8x16Signed | Multiply an 8-bit and a 16-bit number and apply a sign to the result |
Multiply8x8 | Calculate (A T) = T * U |
Multiply8x8+2 | Calculate (A T) = T * U |
MultiplyBy1Point5 | Multiply a 16-bit signed number by 1.5 |
MultiplyCoords | Multiply a 16-bit coordinate value and a 16-bit factor, optionally tallying or changing the sign of the result |
MultiplyCoords+7 | Use the following variables instead of the above: * Y = Offset of the 16-bit signed number to multiply (instead of N) |
Negate16Bit | Negate a 16-bit number |
Negate16Bit+2 | Set (A T) = -(U T) |
Scale16Bit | Scale up a 16-bit value by 2^5 |
Maths (Geometry)
| |
AddCoords | Add to a specified coordinate variable |
AddScaledVector | Add a scaled vector to another vector, one axis at a time |
AddVectors | Add two three-axis vectors together |
GetAngleInRadians | Convert a 16-bit angle into radians, restricted to a quarter circle |
GetRotationMatrix (Part 1 of 5) | Calculate the rotation matrix for rotating the player's yaw angle into the global 3D coordinate system |
GetRotationMatrix (Part 2 of 5) | Calculate sin(H G) for smaller angles |
GetRotationMatrix (Part 3 of 5) | Calculate sin(H G) for bigger angles |
GetRotationMatrix (Part 4 of 5) | Loop back to calculate cos instead of sin |
GetRotationMatrix (Part 5 of 5) | Apply the correct signs to the result |
HalveCoordinate | Halve a coordinate with three 16-bit axes |
RotateCarToCoord | Rotate a vector from the frame of reference of the player's car into the 3D world coordinate system |
RotateCoordToCar | Rotate a vector from the 3D world coordinate system into the frame of reference of the player's car |
RotateVector | Rotate a vector by a rotation matrix |
SubtractCoords | Subtract from a specified coordinate variable |
Screen buffer
| |
byte2 | Only draw pixel bytes 26 to 39 |
CheckDashData | Check whether a dash data block index is pointing to dash data |
CopyDashData | Copy the dash data from the main game code to screen memory, and vice versa |
DrawFence (Part 1 of 2) | Draw the fence that we crash into when running off the track |
DrawFence (Part 2 of 2) | Draw the fence that we crash into when running off the track |
DrawFence-1 | Contains an RTS |
DrawTrackBytes (Part 1 of 3) | Draw the pixel bytes that make up the track view (0 to 15) |
DrawTrackBytes (Part 2 of 3) | Draw the pixel bytes that make up the track view (16 to 39) |
DrawTrackBytes (Part 3 of 3) | Return from the subroutine |
DrawTrackLine (Part 1 of 2) | Draw a pixel line across the screen in the track view, broken up into bytes |
DrawTrackLine (Part 2 of 2) | Draw a pixel line across the screen in the track view |
DrawTrackView (Part 1 of 4) | Draw the top part of the track view using the data in the dash data blocks |
DrawTrackView (Part 2 of 4) | Draw the part of the track view that fits around the dashboard |
DrawTrackView (Part 3 of 4) | Draw the part of the track view that fits around the dashboard and tyres |
DrawTrackView (Part 4 of 4) | Revert all the code modifications made by the DrawTrackView routine |
GetColour (Part 1 of 3) | Calculate the colour of a specific pixel byte in the screen buffer |
GetColour (Part 2 of 3) | Process the left verge |
GetColour (Part 3 of 3) | Process the right verge |
GetColourSup | Calculate the colour of a specific pixel byte in the screen buffer |
ResetTrackLines | Reset the track lines below the horizon in the track view |
SetBackground | Set the background colour for any track lines that have not yet had a background colour set |
SetMarker | Insert a marker value into a dash data block |
SetMarker+3 | Use the value of A passed to the routine SetMarker+6 Use Y and V in place of A and Y |
SetMarker+6 | Use Y and V in place of A and Y |
Screen mode
| |
KillCustomScreen | Disable the custom screen mode and switch to mode 7 |
MoveHorizon | Move the position of the horizon palette switch up or down, depending on the current track pitch angle |
ScreenHandler | The IRQ handler for the custom screen mode |
ScreenHandler-3 | Jump to the original IRQ handler |
SetCustomScreen | Switch to the custom screen mode |
SetScreenMode7 | Change to screen mode 7 and hide the cursor |
Setup
| |
CallTrackHook | The track file's hook code |
Entry | The main entry point for the game: move code into upper memory and call it |
MoveCode | Move and reset various blocks around in memory |
Protect | Decrypt or unprotect the game code (disabled) |
SetupGame | Decrypt or unprotect the game code (disabled) |
SwapCode | Move the track data to the right place and run a checksum on it |
Sound
| |
DefineEnvelope | Define a sound envelope |
FlushSoundBuffer | Flush the specified sound buffer |
FlushSoundBuffers | Flush all four specified sound buffers |
MakeDrivingSounds | Make the relevant sounds for the engine and tyres |
MakeSound | Make a sound |
MakeSound-3 | Make the sound at the current volume level |
MakeSoundEnvelope | Either make a sound or set up an envelope |
Tactics
| |
AssistSteering | Apply computer assisted steering (CAS) when configured |
AssistSteeringKeys | For keyboard-controlled steering |
GetSectionSteering | Calculate the optimum steering for each track section |
GetSegmentSteering | Calculate the optimum steering to take for the current track segment |
GetSteeringAssist | Fetch the current computer assisted steering (CAS) status and show or hide the CAS indicator |
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 |
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 manoeuvring into position |
ProcessOvertaking (Part 3 of 3) | Update the car status (if configured) and loop back for the next car |
Text
| |
GetDriverAddress | Get the address of the specified driver's name |
GetNumberFromText | Convert a two-digit string into a number |
Print234DigitBCD | Print a specific driver's accumulated points as a padded two-, three- or four-digit number |
Print2DigitBCD | Print a binary coded decimal (BCD) number in the specified format |
Print2DigitBCD-6 | Print the number at screen coordinate (X, Y), where X is the character column and Y is the pixel row of the bottom of the character |
Print4DigitBCD | Print a specific driver's accumulated points as a four-digit number |
Print4DigitBCD+3 | Do not print the first two digits (i.e. omit printing A) |
PrintBestLapTime | Print the best lap time and the current lap time at the top of the screen |
PrintCharacter | Print a character on-screen |
PrintCharacter-6 | Print double-width character (this is used to print the double-width number on the gear stick) |
PrintDriverName | Print a driver's name |
PrintDriverPrompt | Print the "DRIVER ->" prompt and a driver's name, to show whose turn it is next when playing a multi-player game |
PrintDriverTable | Print the table of drivers |
PrintFirstLine | Prints a text token on the first text line at the top of the driving screen |
PrintFirstLine+2 | Print the token on the second text line at the top of the driving screen |
PrintGearNumber | Print the number of the current gear in double-width characters on the gear stick |
PrintHeader | Configure and print a double-height header in screen mode 7 |
PrintHeaderChecks | Print chequered lines above and below the header |
PrintLapTime | Print the current lap time at the top of the screen |
PrintLapTime+2 | Format the lap time using the format value in A (see PrintTimer for details) |
PrintNearestDriver | Print a driver's name in the "In front" or "Behind" slot in the header |
PrintPositionName | Print the name of the driver in a specific position in the driver position list |
PrintRaceClass | Print the race class |
PrintSecondLine | Prints a text token on the second text line at the top of the driving screen |
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 |
PrintSpaces | Print the specified number of spaces |
PrintTimer | Print the specified timer |
PrintToken | Print a recursive token |
SetRowColours | Set the foreground and background colours for a table row |
UpdatePositionInfo | Apply any position changes and update the position information at the top of the screen |
Track data
| |
CallTrackHook (Silverstone) | The track file's hook code |
Track geometry
| |
CopySectionData | Copy a 16-bit y-coordinate from the track section data |
GetFirstSegment | Get the track section coordinates and flags from the track data and populate the first track segment |
GetPlayerIndex | Set the index for the player's segment in the track section buffer to be 32 segments behind the front segment |
GetSectionAngles (Part 1 of 3) | Get the yaw and pitch angles for the inner and outer track sections |
GetSectionAngles (Part 2 of 3) | Calculate the track section number for this track section entry |
GetSectionAngles (Part 3 of 3) | Calculate the yaw and pitch angles for the track section entry that we want to update |
GetSectionAngles-1 | Contains an RTS |
GetSectionCoord | Copy a three-part 16-bit coordinate from the track section data |
GetSectionCoords | Copy two three-part 16-bit coordinates from the track section data |
GetSectionYawAngle | Calculate the difference in yaw angle between an object and the player |
GetSegmentAngles (Part 1 of 3) | Get the yaw and pitch angles for the inner or outer track segments |
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 |
GetSegmentAngles (Part 3 of 3) | Process a visible segment |
GetSegmentDetails | Get the details for the segment in front or behind |
GetSegmentVector | Fetch a segment vector from the track data file |
GetSegmentYawAngle | Calculate the difference in yaw angle between a track segment and the player |
GetTrackAndMarkers | Calculate the 3D coordinates of the track and corner markers |
GetTrackSegment (Part 1 of 3) | Set up the next track segment in the track segment buffer |
GetTrackSegment (Part 2 of 3) | Set the flags for the new front segment in the track segment buffer |
GetTrackSegment (Part 3 of 3) | Set the inner and outer track coordinates for the new track segment |
GetVergeAndMarkers (Part 1 of 4) | Get the details for a segment's corner markers and verge marks |
GetVergeAndMarkers (Part 2 of 4) | Calculate the segment's verge width and outside verge coordinates |
GetVergeAndMarkers (Part 3 of 4) | Process the segment's corner markers |
GetVergeAndMarkers (Part 4 of 4) | Store details of the segment's verge marks |
gtrm2+6 | Calculate the following for segment Y: horizonTrackWidth = |xVergeRightHi - xVergeLeftHi| / 2 |
IncSectionPointers | Increment the track section list pointers following a shuffle |
MultiplyHeight | Multiply the height above ground of a specified track segment by A |
MultiplyHeight+11 | Set A = A * U while retaining the sign in A (the sign of A must be on the stack before calling this entry point) |
SetSectionPointers | Set the track section list pointer to a specific value and update the validity pointer accordingly |
ShuffleSectionList | Shuffle the track section list along by one position |
SpinTrackSection | Apply spin to a section in the track section list |
UpdateCurveVector | Move to the next segment vector along in the direction we are facing, but only for curved track sections |
UpdateVectorNumber | Move to the next segment vector along the track in the direction we are facing |