I have documented every byte of the Revs game code, but that doesn't mean that I've fully understood every byte (though it's close). Almost every single aspect of the code is explained, but there are a few issues that could benefit from another look.
This page lists all of the outstanding issues of which I am aware. These are the notes I made as I analysed the source, so they are fairly terse and might not be terribly clear.
3D objects
----------
- GetObjectDistance: Explain algorithm, is it a Pythagoras hack?
- BuildPlayerCar: Why build 2 car objects (segmentIndex96 for 3D coords in xPlayerCoord, next segment for YawAngle angle in playerYawAngleHi)?
- GetObjYawAngle (Part 2 of 4): Explain algorithm, use of T in Divide8x8
- GetObjYawAngle (Part 3 of 4): Explain algorithm, use of T in Divide8x8
- GetObjYawAngle (Part 4 of 4): Explain algorithm, use of T in Divide8x8
- GetObjPitchAngle: Explain algorithm, use of T in Divide8x8
- CompareSegments: Not sure what H is used for
- BuildCarObjects (Part 2 of 3): Explain algorithm better for positioning car on track
- SetObjectDetails: Explain the scaleUp/scaleDown maths
- BuildRoadSign: Explain A < 64 test for moving on to next sign in section, and A < 110 for different collision distance
Brands Hatch
------------
- HookUpdateHorizon: Explain effect on game
- HookFlattenHills: Explain effect on game
- HookFixHorizon: Explain effect on game
Car geometry
------------
- MovePlayerBack: Explain why we set resetSectionList to a non-zero value here (is it just for efficiency?)
- ProcessOvertaking (Part 1 of 3): Explain H and why it rotates left - it does nothing?
- MovePlayerOnTrack: Explain algorithm for calculating progress and racing line from angle
- GetCarInSegment: Explain algorithm
- ScaleCarInSegment: Explain algorithm, is this some kind of trigonometry approximation?
Dashboard
---------
- fillDataOffset: Could be better explained
- UpdateDashboard: Could be clearer
- DrawRevCounter: Could be clearer
- DrawDashboardLine: Could be clearer
- DrawCornerMarkers: Explain scaleUp and coordinate calculations
Drawing objects
---------------
- DrawObjectEdge (Part 1 of 5): How do we end up with double thickness and/or thin edges in final output?
- DrawObjectEdge (Part 2 of 5): And edges going higher/lower than their fills? (object 6, 7)
- DrawObjectEdge (Part 3 of 5): Unsure about the role of L and edgePixelMask in extra edges in draw12
- DrawObjectEdge (Part 4 of 5): How do fill colours in four-edge lines work? Green? %11? (object 2, 4)
- FillInsideObject: Explain why we subtract and add T to block addresses
- DrawObjectEdges: Explain initial values that are passed to DrawObjectEdge at drob1 better
Drawing the track
-----------------
- MapSegmentsToLines: Explain algorithm fully, is N about hills?
- DrawVergeEdge: Explain C flag and A values passed to DrawVergeEdge by DrawTrack for the various verge types
- DrawTrack: How do we draw *four* edges if the first call is only setting up variables and not drawing? Are we drawing spaces between edges? verge - track - verge?
- SetVergeBackground: Explain algorithm, return value of Y, X argument value
- DrawSegmentEdge (Part 1 of 7): Explain algorithm
- DrawSegmentEdge (Part 2 of 7): Explain algorithm, what is the scaling of SS and TT all about?
- DrawSegmentEdge (Part 3 of 7): Explain algorithm, modifications (which seem the wrong way round somehow as far as WW is concerned)
- DrawSegmentEdge (Part 4 of 7): Explain all the colour bits %ab etc.
- DrawSegmentEdge (Part 5 of 7): Explain setting of X (pixel number within 2 bytes), and (S R), (Q P) seem to point to the addresses of the start of the previous edge, not the end of the previous edge?
- DrawSegmentEdge (Part 6 of 7): Explain modifications to DrawGrass routines, plus mods to drawing routines; At dver22 we kick off the drawing with the opposite to the chosen INY/DEY in modifications, so is this taking a step back before charging forwards?
- DrawSegmentEdge (Part 7 of 7): Explain algorithm
- DrawSteepToLeft: Explain the need to move on by one track line for setting the background colour
- UpdateBackground: Explain algorithm
- vergePixelMask: Explain these combinations - some seem wrong
Drivers
-------
- UpdateLapTimers: Explain current lap calculation, why is firstLapStarted incremented
- UpdateLaps: Explain driverLapNumber BMI test, driver number being > current player in practice
- AwardRacePoints: Explain multi-player algorithm
- firstLapStarted: Why is this decremented in laps4?
Driving model
-------------
- ApplyElevation (Part 2 of 5): Explain playerHeading algorithm
- ApplyElevation (Part 3 of 5): Explain height calculation in A
- ApplyTyreForces: Explain algorithm
- ApplySkidForces: Explain algorithm
- ApplyGrassOrTrack: Explain brake force and wing balance
Keyboard
--------
- ProcessDrivingKeys (Part 2 of 6): Explain xTyreForce and Superior vs Acornsoft
Maths
-----
- Divide8x8: Explain effect of initial value of T on result
Screen buffer
-------------
- GetColour (Part 1 of 3): Explain algorithm, &AA markers
- GetColour (Part 2 of 3): Explain algorithm, &AA markers
- GetColour (Part 3 of 3): Explain algorithm, &AA markers
- SetMarker: Explain the whole &AA marker thing, see DrawObjectEdge (Part 4 of 5)
- GetColourSup: Explain algorithm
Text
----
- UpdatePositionInfo: Explain how positionChange works
Track geometry
--------------
- GetSegmentSteering: Explain the use of prev in this algorithm (see deep dive)
- GetSectionAngles (Part 2 of 3): Why do we want horizonSection to contain the higher index of sections with the same height? Explain prevHorizonIndex <= 7 logic
- GetVergeAndMarkers (Part 1 of 4): Why do we skip part 2 when segmentCounter >= 3 - just for efficiency?