Revs C sourceRevs E source Revs C sourceRevs E source Home page Using this site Home page Start at the very beginning Quick start guide All you need to know to start exploring this site All about this project Project history, building the source and more All about this project About this project The story of how this project came to be Terminology used in this commentary Read this before you explore the source code Building Revs from the source How to build your own working copy of Revs Useful links A collection of links to pages I've found useful during this project Acknowledgements The giants on whose shoulders this project stands Site history A short history of this site's development Site map A top-level map of this website Understanding the source code Deep dive articles Over 45 articles on how Revs weaves its magic Index Index of all deep dive articlesDiscover how Revs works under the hood Deep dives Memory maps Memory maps and unpacking binary files Memory maps The Revs memory map Memory usage is really tight in BBC Micro Revs The jigsaw puzzle binary Exploring the mind-bending way that Revs is packed into memory Major variable blocks A summary of the major variable blocks in Revs, of which there are quite a few Main loop The main game loop and task scheduler Main loop Program flow of the main game loop The sequence of events in the main game loop Scheduling tasks in the main loop How Revs does the right thing at the right time Graphics Custom screen modes and sky-blue hidden codes Graphics Hidden secrets of the custom screen mode Revs has a custom screen mode that conceals working code in a lush blue sky Drawing the track view How Revs uses its screen buffer to produce smooth and speedy graphics Drawing around the dashboard Revs is literally sculpted in the shape of a Forumla 3 racing car; here's why 3D geometry Pitch angles, yaw angles and car placement 3D geometry Pitch and yaw angles Pitch and yaw angles are fundamental to the way Revs stores object positions Placing cars on the track Pinpointing the positions of cars on the track by progress and racing line Trigonometry A look at the various ways in which Revs implements trigonometry 3D objects Drawing and scaling vector-based 3D objects 3D objects Object definitions Details of the 13 objects that make up the signs, flags, markers and cars Drawing a 3D car from 2D parts Using a paper-cut shadow-box effect to conjure 3D cars from 2D objects Scaling objects with scaffolds Scaling the vector-based objects in Revs using scaffolds Creating objects from edges How Revs draws on-screen objects using nothing but vertical edges The track Track data, signs, markers, verges and more The track The track data file format Every byte in the Revs track data file, explained Building a 3D track from sections and segments How Revs constructs such a detailed simulation of the track The track verges How Revs calculates track verges in the track section and track segment lists Road signs Each track supports up to 16 road signs, from starting flags to chicanes Corner markers What the little markers by the trackside tell us about driving around corners Data structures for the track calculations Details of the buffers and lists where the track calculations are stored Drawing the track verges How Revs calculates track verges in the track section and track segment lists The extra tracks The tracks of Revs 4 Tracks and Revs+ The extra tracks Secrets of the extra tracks How the extra track files modify the main game code using code hooks Code hooks in the extra tracks Documentation on every modification and code hook in the extra tracks Dynamic track generation in the extra tracks How Revs squeezes complex track layouts into extremely small data files The extra tracks data file format Differences between the standard Silverstone track and the extra track files Backporting the Nürburgring track Porting the Nürburgring track from the Commodore 64 to the BBC Micro Track maps and statistics Comparing all six of the tracks in Revs Track maps and statistics Comparing the tracks How the six different tracks in Revs compare to each other The Brands Hatch track One of the four extra tracks in the Revs 4 Tracks expansion The Donington Park track One of the four extra tracks in the Revs 4 Tracks expansion The Nürburgring track The last track to be released, as part of the Commodore 64 version of Revs+ The Oulton Park track One of the four extra tracks in the Revs 4 Tracks expansion The Silverstone track The original track that came with the first release of Revs The Snetterton track One of the four extra tracks in the Revs 4 Tracks expansion The driving model The physics behind the driving in Revs The driving model An overview of the driving model Secrets of the sophisticated driving simulation that powers Revs The core driving model The maths and physics behind the main part of the driving model Driving on grass What happens when you spill off the track into the lush green grass Skidding The calculations behind losing grip and squealing tyres Jumps and drops Jumping over the verge and dropping down from the retrieval crane Modelling the engine The maths behind engine torque, gear ratios and power transmission Matching the code to the driving model Tracking down the driving model features that are mentioned in the manual Driver tactics Non-player drivers and steering assistants Driver tactics Tactics of the non-player drivers How the computer-controlled drivers deal with corners, crashes and competitors Computer assisted steering (CAS) The algorithm behind the steering assistant in the Superior Software release The dashboard Wing mirrors and starting lights The dashboard Wing mirrors How Revs shows what's behind you, with a dash of shudder from the engines Starting lights All about the starting lights schedule, and how they use the screen buffer Miscellaneous Text tokenisation, sound and random numbers Miscellaneous Text tokens How the game text in Revs is tokenised to save space The engine sounds Creating a realistic three-tone engine sound Random numbers How Revs generates random numbers Exploring the source code Revs source code Annotated source of BBC Micro Revs Version information About the version of Revs on this siteDetails of the different versions of Revs Revs source code by file Map of the source code An overview of how the source code for Aviator is structured Annotated source files The fully commented source files Revs source files Workspaces The main variable workspaces used in Revs Revs A source Part 1 of the main game code Revs B source Part 2 of the main game code Revs C source Part 3 of the main game code Revs D source Part 4 of the main game code Revs E source Part 5 of the main game code Revs F source Part 6 of the main game code Revs G source Part 7 of the main game code Revs H source Part 8 of the main game code Revs I source Part 9 of the main game code Track data files Silverstone track data file Data for the Silverstone track Brands Hatch track data file Data for the Brands Hatch track Donington Park track data file Data for the Donington Park track Oulton Park track data file Data for the Oulton Park track Snetterton track data file Data for the Snetterton track Nürburgring track data file Data for the Nürburgring track Revs source code by category 3D objects Building 3D objects such as cars, signs and corner markers Subroutines 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 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 GetObjectDistance Calculate the distance between an object and the player's car, for collision purposes GetObjPitchAngle Calculate an object's pitch angle 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| 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 Variables objectBottom Scaffold measurements for the bottom of each object part objectColour Data for the colour of each object part objectIndex Index range of an object's data in the object data tables objectLeft Scaffold measurements for the left of each object part objectPalette The object colour palette that maps logical colours 0 to 3 to physical colours objectRight Scaffold measurements for the right of each object part objectScaffold The scaffold used to construct each object, in a scalable format objectTop Scaffold measurements for the top of each object part scaffoldIndex Index of an object's scaffold in the objectScaffold table scaledScaffold Storage for an object's scaled scaffold scaleRange Storage for scale factors when scaling objects thisObjectType The type of object we are currently drawing xRoadSignCoordHi The high byte of the x-coordinate of the road sign's 3D coordinates xRoadSignCoordLo The low byte of the x-coordinate of the road sign's 3D coordinates yRoadSignCoordHi The high byte of the y-coordinate of the road sign's 3D coordinates yRoadSignCoordLo The low byte of the y-coordinate of the road sign's 3D coordinates zRoadSignCoordHi The high byte of the z-coordinate of the road sign's 3D coordinates zRoadSignCoordLo The low byte of the z-coordinate of the road sign's 3D coordinates Car geometry Placing and moving cars on the track, and applying tactics to the other drivers Subroutines 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 CheckForContact Check to see if the object is close enough to the player car to make contact 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 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 collosions 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 Variables carSpeedLo Low byte of each car's forward speed crashedIntoFence Flag that records whether we have crashed into the fence playerSideways Contains the player's heading, for testing whether the car is pointing sideways spinYawAngleHi High byte of the amount of yaw angle spin that is being applied to the player's car spinYawAngleLo Low byte of the amount of yaw angle spin that is being applied to the player's car spinYawAngleTop Top byte of the amount of yaw angle spin that is being applied to the player's car xPlayerCoordHi The high byte of the x-coordinate of the player's 3D coordinates xPlayerCoordLo The low byte of the x-coordinate of the player's 3D coordinates xPlayerCoordTop The top byte of the x-coordinate of the player's 3D coordinates yPlayerCoordHi The high byte of the y-coordinate of the player's 3D coordinates yPlayerCoordLo The low byte of the y-coordinate of the player's 3D coordinates yPlayerCoordTop The top byte of the y-coordinate of the player's 3D coordinates zPlayerCoordHi The high byte of the z-coordinate of the player's 3D coordinates zPlayerCoordLo The low byte of the z-coordinate of the player's 3D coordinates zPlayerCoordTop The top byte of the z-coordinate of the player's 3D coordinates Dashboard Wing mirrors, rev counters, tyre treads and starting lights Subroutines 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 Variables dashRightEdge Storage for the first track pixel byte along the right edge of the dashboard endMirror The offset from mirrorAddress for the end of each mirror segment fillDataOffset Dash data offsets, tweaked to give bottom line values that are compatible with the process of filling blocks to the left handPixels The number of pixels in the longest axis for the rev counter hand at various points in a half-quadrant leftDashMask Pixel mask for the left edge of the dashboard leftDashPixels Pixels along the left edge of the dashboard leftTyreMask Pixel mask for the edge of the left tyre leftTyrePixels Pixels along the edge of the left tyre mirrorAddressHi The high byte of the base screen address of each mirror segment mirrorAddressLo The low byte of the base screen address of each mirror segment mirrorContents Contains the size of the car in each mirror segment mirrorSegment Lookup table for working out which mirror segment a car should appear in rightDashMask Pixel mask for the right edge of the dashboard rightDashPixels Pixels along the right edge of the dashboard rightTyreMask Pixel mask for the edge of the right tyre rightTyrePixels Pixels along the edge of the right tyre shortAxis Code modifications for the DrawDashboardLine line-drawing routine startMirror The offset from mirrorAddress for the start of each mirror segment steeringHi The high byte of the steering wheel position steeringLo The low byte of the steering wheel position stepAxis Code modifications for the DrawDashboardLine line-drawing routine tyreEdgeIndex Index of the mask and pixel bytes for the tyre edges on a specific track line tyreTravel Keeps track of how far we have travelled so we know when to animate the tyres tyreTreadLeft Tyre tread pattern for the left tyre tyreTreadRight Tyre tread pattern for the right tyre wheelPixels The number of pixels in the longest axis for the steering wheel line at various points in a quadrant Drawing objects Drawing 3D objects using scaffolded definitions and multiple 2D objects Subroutines 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 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 Variables thisDriverNumber The number of the current driver when drawing cars Drawing pixels Tables and routines to support drawing pixels directly onto the screen Subroutines GetScreenAddress Return the screen address for a specified screen coordinate Variables colourPalette The main colour palette that maps logical colours 0 to 3 to physical colours pixelByte A table of pixel bytes with individual pixels set pixelsEdgeRight Pixel byte with all the pixels to the right of position X set, plus pixel X pixelsToLeft Pixel byte with all the pixels to the left of position X set pixelsToRight Pixel byte with all the pixels to the right of position X set startDialHi The high byte of the screen address of the start of the dial hand on the rev counter startDialLo The low byte of the screen address of the start of the dial hand on the rev counter yLookupHi Lookup table for converting pixel y-coordinate to high byte of screen address yLookupLo Lookup table for converting pixel y-coordinate to low byte of screen address Drawing the track The complex maths behind drawing the track and its coloured verges Subroutines 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 UpdateBackground Update the background colour table for when we draw a verge edge off the left edge of the screen Variables jumpShallowLeft Branch labels for self-modifying code in the DrawShallowToLeft routine jumpShallowRight Branch labels for self-modifying code in the DrawShallowToRight routine jumpSteepLeft Branch labels for self-modifying code in the DrawSteepToLeft routine jumpSteepRight Branch labels for self-modifying code in the DrawSteepToRight routine vergeEdgeInOut Table for mapping the verge tables to the outer and inner edges of the verge marks 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 vergePixelMask Pixel bytes for drawing track verge edges vergeTableHi High bytes of the addresses of the four verge tables vergeTableLo Low bytes of the addresses of the four verge tables Drivers The championship table, awarding race points, lap timers and driver speeds Subroutines 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 Variables baseSpeed The base speed for each car, copied from the track data competitionStarted A flag to indicate whether or not the competition has started firstLapStarted Flag to keep track of whether we have started the first lap of practice or qualifying lapsMenuOption The menu option chosen from the laps menu (0 to 2) lowestPlayerNumber The number of the player with the lowest player number numberOfPlayers The number of players pointsForPlace The points awarded for the top six places, plus the fastest lap qualifyingTime The number of minutes of qualifying lap time raceClass The class of the current race racePointsHi High byte of race points calculated for each position racePointsLo Used to store the low byte of the race points being awarded to the driver in race position X totalPointsHi High byte of total accumulated points for each driver totalPointsLo Low byte of total accumulated points for each driver updateLapTimes Controls whether moving the car forward updates the lap number and lap times Driving model The sophisticated physics engine behing the first real racing simulation Subroutines 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 GetTyreForces Calculate the tyre forces due to the throttle or brakes 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 Variables cosYawAngleHi High byte of the cosine of the player's yaw angle cosYawAngleLo Low byte of the cosine of the player's yaw angle frontWingSetting The front wing setting, as entered by the player liftFromTorque The lift of the front of the car caused by acceleration or braking playerDrift Records whether the player's car is moving sideways by a significant amount rearWingSetting The rear wing setting, as entered by the player sinYawAngleHi High byte of the sine of the player's yaw angle sinYawAngleLo Low byte of the sine of the player's yaw angle spinYawDeltaHi High byte of the change in the spin yaw angle for the player's car spinYawDeltaLo Low byte of the change in the spin yaw angle for the player's car tyreSqueal A flag to determine whether the front or rear tyres are squealing wingBalance Value used in the driving model when calculating the effect of the two wing settings wingForce The downward force from the front and rear wings wingForce95 95% of the downward force from the front and rear wings wingForceGrass The base downward force from the weight of the car when on grass, to which the downward force from the wings is added 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 wingScaleFactor Scale factors for the wing settings wingSetting Contains the scaled wing settings xAccelerationHi High byte of the x-coordinate of the change in velocity of the player's car in terms of 3D world coordinates xAccelerationLo Low byte of the x-coordinate of the change in velocity of the player's car in terms of 3D world coordinates xPlayerAccelHi High byte of the x-coordinate of the change in velocity of the player's car in the player's frame of reference xPlayerAccelLo Low byte of the x-coordinate of the change in velocity of the player's car in the player's frame of reference 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 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 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 xSteeringForceHi High byte of the sideways force applied by steering xSteeringForceLo Low byte of the sideways force applied by steering xTyreForceNoseHi High byte of the x-coordinate of the force vector produced by the front tyres in the nose of the car xTyreForceNoseLo Low byte of the x-coordinate of the force vector produced by the front tyres in the nose of the car xTyreForceRearHi High byte of the x-coordinate of the force vector produced by the rear tyres of the car xTyreForceRearLo Low byte of the x-coordinate of the force vector produced by the rear tyres of the car xVelocityHi High byte of the x-coordinate of the player's velocity vector, from the player's frame of reference xVelocityLo Low byte of the x-coordinate of the player's velocity vector, from the player's frame of reference zAccelerationHi High byte of the z-coordinate of the change in velocity of the player's car in terms of 3D world coordinates zAccelerationLo Low byte of the z-coordinate of the change in velocity of the player's car in terms of 3D world coordinates zPlayerAccelHi High byte of the z-coordinate of the change in velocity of the player's car in the player's frame of reference zPlayerAccelLo Low byte of the z-coordinate of the change in velocity of the player's car in the player's frame of reference 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 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 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 zTyreForceBoth High byte of the z-coordinate of the force vector produced by the front and tyres combined zTyreForceNoseHi High byte of the z-coordinate of the force vector produced by the front tyres in the nose of the car zTyreForceNoseLo Low byte of the z-coordinate of the force vector produced by the front tyres in the nose of the car zTyreForceRearHi High byte of the z-coordinate of the force vector produced by the rear tyres zTyreForceRearLo Low byte of the z-coordinate of the force vector produced by the rear tyres zVelocityHi High byte of the z-coordinate of the player's velocity vector, from the player's frame of reference zVelocityLo Low byte of the z-coordinate of the player's velocity vector, from the player's frame of reference Extra tracks Data and routines from the extra track files in Revs 4 Tracks and Revs+ Subroutines 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 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 Variables modifyAddressHi (Brands Hatch) High byte of the location in the main game code where we modify a two-byte address modifyAddressHi (Donington Park) High byte of the location in the main game code where we modify a two-byte address modifyAddressHi (Nürburgring) High byte of the location in the main game code where we modify a two-byte address modifyAddressHi (Oulton Park) High byte of the location in the main game code where we modify a two-byte address modifyAddressHi (Snetterton) High byte of the location in the main game code where we modify a two-byte address modifyAddressLo (Brands Hatch) Low byte of the location in the main game code where we modify a two-byte address modifyAddressLo (Donington Park) Low byte of the location in the main game code where we modify a two-byte address modifyAddressLo (Nürburgring) Low byte of the location in the main game code where we modify a two-byte address modifyAddressLo (Oulton Park) Low byte of the location in the main game code where we modify a two-byte address modifyAddressLo (Snetterton) Low byte of the location in the main game code where we modify a two-byte address newContentHi (Brands Hatch) High byte of the two-byte address that we want to poke into the main game code at the modify location newContentHi (Donington Park) High byte of the two-byte address that we want to poke into the main game code at the modify location newContentHi (Nürburgring) High byte of the two-byte address that we want to poke into the main game code at the modify location newContentHi (Oulton Park) High byte of the two-byte address that we want to poke into the main game code at the modify location newContentHi (Snetterton) High byte of the two-byte address that we want to poke into the main game code at the modify location newContentLo (Brands Hatch) Low byte of the two-byte address that we want to poke into the main game code at the modify location newContentLo (Donington Park) Low byte of the two-byte address that we want to poke into the main game code at the modify location newContentLo (Nürburgring) Low byte of the two-byte address that we want to poke into the main game code at the modify location newContentLo (Oulton Park) Low byte of the two-byte address that we want to poke into the main game code at the modify location newContentLo (Snetterton) Low byte of the two-byte address that we want to poke into the main game code at the modify location segmentSlope (Brands Hatch) The height above ground of the current track sub-section segmentSlope (Donington Park) The height above ground of the current track sub-section segmentSlope (Nürburgring) The height above ground of the current track sub-section segmentSlope (Oulton Park) The height above ground of the current track sub-section segmentSlope (Snetterton) The height above ground of the current track sub-section subSection (Brands Hatch) The number of the current sub-section subSection (Donington Park) The number of the current sub-section subSection (Nürburgring) The number of the current sub-section subSection (Oulton Park) The number of the current sub-section subSection (Snetterton) The number of the current sub-section subSectionSegment (Brands Hatch) The number of the segment within the current sub-section, counting from the start of the sub-section subSectionSegment (Donington Park) The number of the segment within the current sub-section, counting from the start of the sub-section subSectionSegment (Nürburgring) The number of the segment within the current sub-section, counting from the start of the sub-section subSectionSegment (Oulton Park) The number of the segment within the current sub-section, counting from the start of the sub-section subSectionSegment (Snetterton) The number of the segment within the current sub-section, counting from the start of the sub-section Track section data (Part 1 of 2) (Brands Hatch) Data for the track sections Track section data (Part 1 of 2) (Donington Park) Data for the track sections Track section data (Part 1 of 2) (Nürburgring) Data for the track sections Track section data (Part 1 of 2) (Oulton Park) Data for the track sections Track section data (Part 1 of 2) (Snetterton) Data for the track sections Track section data (Part 2 of 2) (Brands Hatch) Data for the track sections Track section data (Part 2 of 2) (Donington Park) Data for the track sections Track section data (Part 2 of 2) (Nürburgring) Data for the track sections Track section data (Part 2 of 2) (Oulton Park) Data for the track sections Track section data (Part 2 of 2) (Snetterton) Data for the track sections trackBaseSpeed (Brands Hatch) The base speed for each race class, used when generating the best racing lines and non-player driver speeds trackBaseSpeed (Donington Park) The base speed for each race class, used when generating the best racing lines and non-player driver speeds trackBaseSpeed (Nürburgring) The base speed for each race class, used when generating the best racing lines and non-player driver speeds trackBaseSpeed (Oulton Park) The base speed for each race class, used when generating the best racing lines and non-player driver speeds trackBaseSpeed (Snetterton) The base speed for each race class, used when generating the best racing lines and non-player driver speeds trackCarSpacing (Brands Hatch) The spacing between the cars at the start of a qualifying lap, in segments trackCarSpacing (Donington Park) The spacing between the cars at the start of a qualifying lap, in segments trackCarSpacing (Nürburgring) The spacing between the cars at the start of a qualifying lap, in segments trackCarSpacing (Oulton Park) The spacing between the cars at the start of a qualifying lap, in segments trackCarSpacing (Snetterton) The spacing between the cars at the start of a qualifying lap, in segments trackChecksum (Brands Hatch) The track file's checksum trackChecksum (Donington Park) The track file's checksum trackChecksum (Nürburgring) The track file's checksum trackChecksum (Oulton Park) The track file's checksum trackChecksum (Snetterton) The track file's checksum trackGameName (Brands Hatch) The game name trackGameName (Donington Park) The game name trackGameName (Nürburgring) The game name trackGameName (Oulton Park) The game name trackGameName (Snetterton) The game name trackGearPower (Brands Hatch) The power for each gear trackGearPower (Donington Park) The power for each gear trackGearPower (Nürburgring) The power for each gear trackGearPower (Oulton Park) The power for each gear trackGearPower (Snetterton) The power for each gear trackGearRatio (Brands Hatch) The gear ratio for each gear trackGearRatio (Donington Park) The gear ratio for each gear trackGearRatio (Nürburgring) The gear ratio for each gear trackGearRatio (Oulton Park) The gear ratio for each gear trackGearRatio (Snetterton) The gear ratio for each gear trackLapTimeMin (Brands Hatch) Lap times for adjusting the race class (minutes) trackLapTimeMin (Donington Park) Lap times for adjusting the race class (minutes) trackLapTimeMin (Nürburgring) Lap times for adjusting the race class (minutes) trackLapTimeMin (Oulton Park) Lap times for adjusting the race class (minutes) trackLapTimeMin (Snetterton) Lap times for adjusting the race class (minutes) trackLapTimeSec (Brands Hatch) Lap times for adjusting the race class (seconds) trackLapTimeSec (Donington Park) Lap times for adjusting the race class (seconds) trackLapTimeSec (Nürburgring) Lap times for adjusting the race class (seconds) trackLapTimeSec (Oulton Park) Lap times for adjusting the race class (seconds) trackLapTimeSec (Snetterton) Lap times for adjusting the race class (seconds) trackName (Brands Hatch) The track name trackName (Donington Park) The track name trackName (Nürburgring) The track name trackName (Oulton Park) The track name trackName (Snetterton) The track name trackRaceSlowdown (Brands Hatch) Slowdown factor for non-player drivers in the race trackRaceSlowdown (Donington Park) Slowdown factor for non-player drivers in the race trackRaceSlowdown (Nürburgring) Slowdown factor for non-player drivers in the race trackRaceSlowdown (Oulton Park) Slowdown factor for non-player drivers in the race trackRaceSlowdown (Snetterton) Slowdown factor for non-player drivers in the race trackSectionCount (Brands Hatch) The total number of track sections * 8 trackSectionCount (Donington Park) The total number of track sections * 8 trackSectionCount (Nürburgring) The total number of track sections * 8 trackSectionCount (Oulton Park) The total number of track sections * 8 trackSectionCount (Snetterton) The total number of track sections * 8 trackSlope (Brands Hatch) The slope at the start of each track section trackSlope (Donington Park) The slope at the start of each track section trackSlope (Nürburgring) The slope at the start of each track section trackSlope (Oulton Park) The slope at the start of each track section trackSlope (Snetterton) The slope at the start of each track section 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 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 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 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 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 trackStartPosition (Brands Hatch) The starting race position of the player during a practice or qualifying lap trackStartPosition (Donington Park) The starting race position of the player during a practice or qualifying lap trackStartPosition (Nürburgring) The starting race position of the player during a practice or qualifying lap trackStartPosition (Oulton Park) The starting race position of the player during a practice or qualifying lap trackStartPosition (Snetterton) The starting race position of the player during a practice or qualifying lap trackSteering (Brands Hatch) The optimum steering for non-player drivers on each track section trackSteering (Donington Park) The optimum steering for non-player drivers on each track section trackSteering (Nürburgring) The optimum steering for non-player drivers on each track section trackSteering (Oulton Park) The optimum steering for non-player drivers on each track section trackSteering (Snetterton) The optimum steering for non-player drivers on each track section trackSubConfig (Brands Hatch) Configuration data for each section that defines the sub-section numbers, and horizon calculations trackSubConfig (Donington Park) Configuration data for each section that defines the sub-section numbers, and horizon calculations trackSubConfig (Nürburgring) Configuration data for each section that defines the sub-section numbers, and horizon calculations trackSubConfig (Oulton Park) Configuration data for each section that defines the sub-section numbers, and horizon calculations trackSubConfig (Snetterton) Configuration data for each section that defines the sub-section numbers, and horizon calculations trackSubCount (Brands Hatch) The total number of sub-sections in the track trackSubCount (Donington Park) The total number of sub-sections in the track trackSubCount (Nürburgring) The total number of sub-sections in the track trackSubCount (Oulton Park) The total number of sub-sections in the track trackSubCount (Snetterton) The total number of sub-sections in the track trackSubSize (Brands Hatch) The size of each sub-section, i.e. the number of segments in each sub-section trackSubSize (Donington Park) The size of each sub-section, i.e. the number of segments in each sub-section trackSubSize (Nürburgring) The size of each sub-section, i.e. the number of segments in each sub-section trackSubSize (Oulton Park) The size of each sub-section, i.e. the number of segments in each sub-section trackSubSize (Snetterton) The size of each sub-section, i.e. the number of segments in each sub-section trackTimerAdjust (Brands Hatch) Adjustment factor for the speed of the timers to allow for fine-tuning of time on a per-track basis trackTimerAdjust (Donington Park) Adjustment factor for the speed of the timers to allow for fine-tuning of time on a per-track basis trackTimerAdjust (Nürburgring) Adjustment factor for the speed of the timers to allow for fine-tuning of time on a per-track basis trackTimerAdjust (Oulton Park) Adjustment factor for the speed of the timers to allow for fine-tuning of time on a per-track basis trackTimerAdjust (Snetterton) Adjustment factor for the speed of the timers to allow for fine-tuning of time on a per-track basis 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) 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) 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) 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) 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) 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) 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) 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) 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) 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) 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 Keyboard Control keys, joysticks, menu choices and fetching various types of input Subroutines 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 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 ScanKeyboard Scan the kayboard for a specific key press 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 Variables configKeys Details of the configuration settings that are set by the shifted configuration keys lapsFromOption Table to convert from the option numbers in the laps menu to the actual number of laps menuKeys Negative inkey values for the menu keys (SPACE, "1", "2" and "3") for the Acornsoft release menuKeysSup Negative inkey values for the menu keys (SPACE, "1", "2" and "3") for the Superior Software release shiftedKeys Negative inkey values for the configuration keys that are pressed in combination with SHIFT timeFromOption Table to convert from the option numbers in the qualifying lap duration menu to the actual number of minutes Main loop The main game loop and the main driving loop that together run Revs Subroutines 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 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 Variables mainLoopCounterHi High byte of the main loop counter, which increments on each iteration of the main driving loop Maths (Arithmetic) Signs, scaling, multiplication, division Subroutines 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 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 Negate16Bit Negate a 16-bit number Scale16Bit Scale up a 16-bit value by 2^5 Maths (Geometry) Vectors, coordinates matrices Subroutines 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 Variables arctanP Table for arctan values when calculating pitch angles arctanY Table for arctan values when calculating yaw angles Screen buffer The convoluted block-based screen buffer that powers the game's graphics Subroutines 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 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 Variables backgroundColour The background colour for each track line dashData0 Contains code that gets moved into screen memory dashData1 Contains code that gets moved into screen memory dashData2 Contains code that gets moved into screen memory dashData3 Contains code that gets moved into screen memory dashData4 Contains code that gets moved into screen memory dashData5 Contains code that gets moved into screen memory dashData6 Contains code that gets moved into screen memory dashData7 Contains code that gets moved into screen memory dashData8 Contains code that gets moved into screen memory dashData9 Contains code that gets moved into screen memory dashData10 Contains code that gets moved into screen memory dashData11 Contains code that gets moved into screen memory dashData12 Contains code that gets moved into screen memory dashData13 Contains code that gets moved into screen memory dashData14 Contains code that gets moved into screen memory dashData15 Contains code that gets moved into screen memory dashData16 Contains code that gets moved into screen memory dashData17 Contains code that gets moved into screen memory dashData18 Contains code that gets moved into screen memory dashData19 Contains code that gets moved into screen memory dashData20 Contains code that gets moved into screen memory dashData21 Contains code that gets moved into screen memory dashData22 Contains code that gets moved into screen memory dashData23 Contains code that gets moved into screen memory dashData24 Contains code that gets moved into screen memory dashData25 Contains code and part of the dashboard image that gets moved into screen memory dashData26 Contains part of the dashboard image that gets moved into screen memory dashData27 Contains part of the dashboard image that gets moved into screen memory dashData28 Contains part of the dashboard image that gets moved into screen memory dashData29 Contains part of the dashboard image that gets moved into screen memory dashData30 Contains part of the dashboard image that gets moved into screen memory dashData31 Contains part of the dashboard image that gets moved into screen memory dashData32 Contains part of the dashboard image that gets moved into screen memory dashData33 Contains part of the dashboard image that gets moved into screen memory dashData34 Contains part of the dashboard image that gets moved into screen memory dashData35 Contains part of the dashboard image that gets moved into screen memory dashData36 Contains part of the dashboard image that gets moved into screen memory dashData37 Contains part of the dashboard image that gets moved into screen memory dashData38 Contains part of the dashboard image that gets moved into screen memory dashData39 Contains part of the dashboard image that gets moved into screen memory dashData40 Contains part of the dashboard image that gets moved into screen memory dashData41 Contains part of the dashboard image that gets moved into screen memory dashData42 Contains part of the dashboard image that gets moved into screen memory dashDataAddress Addresses for copying the first block of dash data between the main game code and screen memory dashDataOffset Offset of the dash data within each dash data block fencePixelsGrass Pixel bytes for the fence with green grass behind it fencePixelsSky Pixel bytes for the fence with blue sky behind it ldaDrawByte Low address bytes of the LDA #0 instructions in the DRAW_BYTE macros, for use when drawing track lines around the dashboard lowestTrackLine Used to prevent objects from being drawn below the horizon line staDrawByte Low address bytes of the STA instructions in the DRAW_BYTE macros, for use when drawing track lines around the dashboard staDrawByteTyre Low address bytes of the STA instructions in the DRAW_BYTE macros, for use when drawing track lines around the tyres zeroIfYIs55 A lookup table for zeroing Y if and only if it is &55 Macros DRAW_BYTE Draw a pixel byte as part of a horizontal line when drawing the track view Screen mode The interrupt handler and configuration behind the custom Revs screen mode Subroutines 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 SetCustomScreen * Switch to the custom screen mode SetScreenMode7 Change to screen mode 7 and hide the cursor Variables irq1Address Stores the previous value of IRQ1V before we install our custom IRQ handler irqCounter Counter that gets incremented every time the IRQ routine reaches section 4 of the custom screen paletteSection0 Colour palette for screen section 0 in the custom screen mode (the mode 4 portion) paletteSection2 Colour palette for screen section 2 in the custom screen mode (part of the mode 5 portion) paletteSection3 Colour palette for screen section 3 in the custom screen mode (part of the mode 5 portion) paletteSection4 Colour palette for screen section 4 in the custom screen mode (part of the mode 5 portion) screenRegisters The 6845 registers for the custom screen mode screenSection The section of the screen that is currently being drawn by the custom screen interrupt handler (0 to 4) screenTimer1 The screen timer offset between the start of section 2 and the start of section 3 screenTimer2 The screen timer offset between the start of section 3 and the start of section 4 Setup Loading the game, running the checksums, unpacking the code and starting it up Subroutines 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 Variables blockEndHi High byte of the end address of blocks moved by the MoveCode routine blockEndLo Low byte of the end address of blocks moved by the MoveCode routine blockStartHi High byte of the start address of blocks moved by the MoveCode routine blockStartLo Low byte of the start address of blocks moved by the MoveCode routine blockToHi High byte of the destination address of blocks moved by the MoveCode routine blockToLo Low byte of the destination address of blocks moved by the MoveCode routine ldaZero Contains code that's used for modifying the MoveCode routine Sound Car collisions, two-tone engines and the sweet sound of squealing tyres Subroutines 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 MakeSoundEnvelope Either make a sound or set up an envelope Variables envelopeData Data for the sound envelope for squealing tyres soundBuffer Details of each sound channel's buffer status soundData OSWORD blocks for making the various game sounds xStoreSound Temporary storage for X so it can be preserved through calls to the sound routines Tactics AI tactics for computer-controlled drivers and computer assisted steering (CAS) Subroutines AssistSteering Apply computer assisted steering (CAS) when configured 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 maneouvring into position ProcessOvertaking (Part 3 of 3) Update the car status (if configured) and loop back for the next car Variables sectionSteering The optimum steering for each section Text How Revs packs all the game text into a small memory footprint Subroutines 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 Print4DigitBCD Print a specific driver's accumulated points as a four-digit number PrintBestLapTime Print the best lap time and the current lap time at the top of the screen PrintCharacter Print a character on-screen 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 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 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 colorus for a table row UpdatePositionInfo Apply any position changes and update the position information at the top of the screen Variables characterDef Storage for a character definition when printing characters driverNames1 The first batch of driver names (1 of 5) driverNames2 The second batch of driver names (2 of 5) driverNames3 The third batch of driver names (3 of 5) driverNames4 The fourth batch of driver names (4 of 5) driverNames5 The fifth batch of driver names (5 of 5) endChecks The screen address offset of the end of each chequered header line gearNumberText The character to print on the gear stick for each gear headerBackground Background colour for printing mode 7 headers headerForeground Foreground colour for printing mode 7 headers headerSpaces Number of spaces for printing mode 7 headers rowColours Three different palettes for displaying even-odd rows in tables startChecks The screen address offset of the start of each chequered header line token0 Text for recursive token 0 token1 Text for recursive token 1 token2 Text for recursive token 2 token3 Text for recursive token 3 token4 Text for recursive token 4 token5 Text for recursive token 5 token6 Text for recursive token 6 token7 Text for recursive token 7 token8 Text for recursive token 8 token9 Text for recursive token 9 token10 Text for recursive token 10 token11 Text for recursive token 11 token12 Text for recursive token 12 token13 Text for recursive token 13 token14 Text for recursive token 14 token15 Text for recursive token 15 token16 Text for recursive token 16 token17 Text for recursive token 17 token18 Text for recursive token 18 token19 Text for recursive token 19 token20 Text for recursive token 20 token21 Text for recursive token 21 token22 Text for recursive token 22 token23 Text for recursive token 23 token24 Text for recursive token 24 token25 Text for recursive token 25 token26 Text for recursive token 26 token27 Text for recursive token 27 token28 Text for recursive token 28 token29 Text for recursive token 29 token30 Text for recursive token 30 token31 Text for recursive token 31 token32 Text for recursive token 32 token33 Text for recursive token 33 token34 Text for recursive token 34 token35 Text for recursive token 35 token36 Text for recursive token 36 token37 Text for recursive token 37 token38 Text for recursive token 38 token39 Text for recursive token 39 token40 Text for recursive token 40 token41 Text for recursive token 41 token42 Text for recursive token 42 token43 Text for recursive token 43 token44 Text for recursive token 44 token45 Text for recursive token 45 token46 Text for recursive token 46 token48 Text for recursive token 48 token49 Text for recursive token 49 token50 Text for recursive token 50 token51 Text for recursive token 51 token52 Text for recursive token 52 token53 Text for recursive token 53 tokenHi high byte of the token address lookup table tokenLo Low byte of the token address lookup table updateDriverInfo Flag that controls whether the driver names are updated in the information block at the top of the screen xCursor The cursor's x-coordinate, which can either be a pixel coordinate or a character row xHeader Column number for printing mode 7 headers yCursor The cursor's pixel y-coordinate yHeader Row number for printing mode 7 headers Track data Details of the different racing tracks that Revs supports Subroutines CallTrackHook (Silverstone) The track file's hook code Workspaces trackData This is where the track data gets loaded Variables Track section data (Part 1 of 2) (Silverstone) * Data for the track sections Track section data (Part 2 of 2) (Silverstone) * Data for the track sections trackBaseSpeed (Silverstone) The base speed for each race class, used when generating the best racing lines and non-player driver speeds trackCarSpacing (Silverstone) The spacing between the cars at the start of a qualifying lap, in segments trackChecksum (Silverstone) The track file's checksum trackGameName (Silverstone) The game name trackGearPower (Silverstone) The power for each gear trackGearRatio (Silverstone) The gear ratio for each gear trackLapTimeMin (Silverstone) Lap times for adjusting the race class (minutes) trackLapTimeSec (Silverstone) Lap times for adjusting the race class (seconds) trackLength (Brands Hatch) The length of the full track in terms of segments trackLength (Donington Park) The length of the full track in terms of segments trackLength (Nürburgring) The length of the full track in terms of segments trackLength (Oulton Park) The length of the full track in terms of segments trackLength (Silverstone) The length of the full track in terms of segments trackLength (Snetterton) The length of the full track in terms of segments trackName (Silverstone) The track name trackRaceSlowdown (Silverstone) Slowdown factor for non-player drivers in the race trackSectionCount (Silverstone) The total number of track sections * 8 trackSignData (Brands Hatch) Base coordinates and object types for 16 road signs trackSignData (Donington Park) Base coordinates and object types for 16 road signs trackSignData (Nürburgring) Base coordinates and object types for 16 road signs trackSignData (Oulton Park) Base coordinates and object types for 16 road signs trackSignData (Silverstone) Base coordinates and object types for 16 road signs trackSignData (Snetterton) Base coordinates and object types for 16 road signs trackStartLine (Brands Hatch) The segment number of the starting line trackStartLine (Donington Park) The segment number of the starting line trackStartLine (Nürburgring) The segment number of the starting line trackStartLine (Oulton Park) The segment number of the starting line trackStartLine (Silverstone) The segment number of the starting line trackStartLine (Snetterton) The segment number of the starting line trackStartPosition (Silverstone) The starting race position of the player during a practice or qualifying lap trackSteering (Silverstone) The optimum steering for non-player drivers on each track section trackTimerAdjust (Silverstone) Adjustment factor for the speed of the timers to allow for fine-tuning of time on a per-track basis trackVectorCount (Brands Hatch) The total number of segment vectors in the segment vector tables trackVectorCount (Donington Park) The total number of segment vectors in the segment vector tables trackVectorCount (Nürburgring) The total number of segment vectors in the segment vector tables trackVectorCount (Oulton Park) The total number of segment vectors in the segment vector tables trackVectorCount (Silverstone) The total number of segment vectors in the segment vector tables trackVectorCount (Snetterton) The total number of segment vectors in the segment vector tables xTrackSegmentI (Silverstone) * Vector x-coordinates between two consecutive segments on the inside of the track xTrackSegmentO (Silverstone) Vector x-coordinates from the inside to the outside of the track for each segment 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 yTrackSegmentI (Silverstone) * Vector y-coordinates between two consecutive segments on the inside of the track 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 zTrackSegmentI (Silverstone) * Vector z-coordinates between two consecutive segments on the inside of the track zTrackSegmentO (Silverstone) Vector z-coordinates from the inside to the outside of the track for each segment 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 geometry The complex world of track sections, segments, verges and markers Subroutines 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 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 IncSectionPointers Increment the track section list pointers following a shuffle MultiplyHeight Multiply the height above ground of a specified track segment by A 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 Variables horizonTrackWidth The arc of the track at the horizon (i.e. the track width at the horizon), halved markerData The segment flags for each of the three corner markers markerListIndex The index of the corresponding entry in the track segment list for each of the three corner markers newSectionFetched Flag that determines whether a new track section has been fetched previousSignNumber Stores the number of the sign from the previous call to the BuildRoadSign routine segmentFlagMask A mask for extracting bits from the segment flag byte when processing the track verge and corner markers segmentStep The number of segments we step over when working backwards through the track segment buffer in GetSegmentAngles vergeColour Lookup table for converting bits 0-2 of the segment flag byte into the verge colour scheme vergeDataLeft Data (such as colour) for the verge marks on the left side of the track vergeDataRight Data (such as colour) for the verge marks on the right side of the track vergeScale Scale factors for the track verge width for different types of verge (larger value = smaller verge width) xMarkerHi High byte of the x-axis distance between the track edge and the three corner markers xMarkerLo Low byte of the x-axis distance between the track edge and the three corner markers xVergeLeftHi High byte of segment yaw angles along the left track verge in front of the player (i.e. along the x-axis) xVergeLeftLo Low byte of segment yaw angles along the left track verge in front of the player (i.e. along the x-axis) xVergeRightHi High byte of segment yaw angles along the right track verge in front of the player (i.e. along the x-axis) xVergeRightLo Low byte of segment yaw angles along the right track verge in front of the player (i.e. along the x-axis) yVergeLeft Segment pitch angles along the left track verge in front of the player (i.e. along the up-down y-axis) yVergeRight Segment pitch angles along the right track verge in front of the player (i.e. along the up-down y-axis) Workspaces Collections of important variables into blocks Workspaces Main variable workspace * The main block of game variables Stack variables Variables that share page 1 with the stack Zero page Mainly temporary variables that are used a lot Show me a Random Routine Or click ∞ above to jump into the source code... Indexes and code analyses Indexes to the source code A-Z indexes, statistics, code usage and more A-Z indexes A-Z index of the source code An index of every subroutine, entry point, variable and workspace in the source code Source code cross-references Every label and variable in the source code and where they are used Indexes by category List of all subroutines by category Subroutines in Revs List of all variables by category Variables in Revs List of all workspaces by category Workspaces in Revs List of all macros by category Macros in Revs Source code statistics Code statistics for Revs A breakdown of the Revs source code by category, type and number of instructions My Other Sites Fully documented source code for Elite Fully documented source code for Aviator Mark Moxon's Travel Writing Walking Land's End to John o'Groats Tubewalker: The Tube, on Foot Mark Moxon, Web Developer