Skip to navigation

Revs on the BBC Micro

Workspaces: Main variable workspace

Name: Main variable workspace [Show more] Type: Workspace Address: &0380 to &07F8 and &0880 to &0AFF Category: Workspaces Summary: The main block of game variables
Context: See this workspace in context in the source code References: No direct references to this workspace in this source file
ORG &0380 .objYawAngleLo SKIP 24 \ Low byte of each object's yaw angle \ \ Stored as a 16-bit value (objYawAngleHi objYawAngleLo) .objYawAngleHi SKIP 24 \ High byte of each object's yaw angle \ \ Stored as a 16-bit value (objYawAngleHi objYawAngleLo) .objectPitchAngle SKIP 24 \ Each object's pitch angle .objectSize SKIP 24 \ The size of each of the objects (i.e. the scaled value \ of scaleUp for the object) SKIP 32 \ These bytes appear to be unused .leftSegment SKIP 80 \ For each track line, the index of the segment within \ the track segment list for the left verge .rightSegment SKIP 80 \ For each track line, the index of the segment within \ the track segment list for the right verge .driverGridRow SKIP 20 \ The grid row for each driver (0 to 9) \ \ There are two cars per grid row, with grid row 0 at \ the front including the car in pole position \ \ There are 20 cars, in rows 0 to 9 \ \ Indexed by driver number (0 to 19) \ \ Gets set in InitialiseDrivers .driverLapNumber SKIP 20 \ The current lap number for each driver \ \ Indexed by driver number (0 to 19) .driversInOrder2 SKIP 20 \ Used to store a copy of the driversInOrder list .totalRaceMinutes SKIP 20 \ Minutes of each driver's total race time, stored in \ BCD \ \ Set to &80 in ResetVariables .totalPointsTop SKIP 20 \ Top byte of total accumulated points for each driver \ \ Indexed by driver number (0 to 19) \ \ Gets set to 0 in InitialiseDrivers \ \ Stored as a 24-bit value (totalPointsTop totalPointsHi \ totalPointsLo) .tyreRightEdge SKIP 80 \ Storage for the first track pixel byte along the right \ edge of the left tyre \ \ This table is used to store the track pixel byte that \ would be shown along the edge of the left tyre, but \ which is partially obscured by the edge \ \ This is stored so we can retrieve it when masking the \ pixel byte with the tyre edge when we draw the track \ line that starts at the edge of the left tyre \ \ There is a byte for each track line from 43 (the track \ line at the top of the dashboard) down to line 3 (the \ lowest track line, just above where the wing mirror \ joins the car body) \ \ Lines 0 to 2 are not used .rightGrassStart SKIP 80 \ For each track line, the block number where the grass \ starts to the right of the track .leftVergeStart SKIP 80 \ For each track line, the block number where the left \ track verge starts .configStop SKIP 1 \ A key has been pressed that stops the race \ \ * Bit 5 set = retire from race/lap \ (SHIFT-f7 pressed) \ \ * Bit 7 and bit 6 set = pit stop \ (SHIFT-f0 pressed) \ \ * Bit 7 set and bit 6 clear = restart game \ (SHIFT and right arrow pressed) \ \ Zeroed in SetupGame .configJoystick SKIP 1 \ A key has been pressed to set joystick or keyboard \ \ * No bits set = keyboard \ (SHIFT-f1 pressed) \ \ * Bit 7 set = joystick \ (SHIFT-f2 pressed) \ \ Zeroed in SetupGame .configVolume SKIP 1 \ A key has been pressed to change the volume \ \ * Bit 7 and bit 6 set = volume down \ (SHIFT-f4 pressed) \ \ * Bit 7 clear and bit 6 set = volume up \ (SHIFT-f5 pressed) \ \ Zeroed in SetupGame .configPause SKIP 1 \ A key has been pressed to pause the game \ \ * Bit 7 set = pause game \ (COPY pressed) \ \ * Bit 6 set = unpause game \ (DELETE pressed) \ \ Zeroed in SetupGame .configAssist SKIP 1 \ A key has been pressed to toggle computer assisted \ steering (CAS) \ \ * No bits set = disable computer assisted steering \ (SHIFT-f3 pressed) \ \ * Bit 7 set = enable computer assisted steering \ (SHIFT-f6 pressed) \ \ Zeroed in SetupGame SKIP 5 \ These bytes appear to be unused .volumeLevel SKIP 1 \ The game's volume level \ \ This uses the operating system's volume scale, with \ -15 being full volume and 0 being silent \ \ Set to -10 (246) in SetupGame SKIP 1 \ This byte appears to be unused .rightVergeStart SKIP 80 \ For each track line, the block number where the right \ track verge starts .leftTrackStart SKIP 80 \ For each track line, the block number where the track \ starts (i.e. the left edge of the black track) .bestLapTenths SKIP 20 \ Tenths of seconds of each driver's best lap time, \ stored in BCD \ \ Indexed by driver number (0 to 19) .clockTenths SKIP 1 \ Tenths of seconds for the clock timer \ \ The clock timer counts the time spent on the track, so \ that's the total amount of qualifying time, or the \ time spent throughout an entire race .lapTenths SKIP 1 \ Tenths of seconds for the lap timer \ \ The lap timer counts the time spent on the current lap SKIP 2 \ These bytes appear to be unused .bestLapSeconds SKIP 20 \ Seconds of each driver's best lap time, stored in BCD \ \ Indexed by driver number (0 to 19) .clockSeconds SKIP 1 \ Seconds for the clock timer \ \ The clock timer counts the time spent on the track, so \ that's the total amount of qualifying time, or the \ time spent throughout an entire race .lapSeconds SKIP 1 \ Seconds for the lap timer \ \ The lap timer counts the time spent on the current lap SKIP 2 \ These bytes appear to be unused .bestLapMinutes SKIP 20 \ Minutes of each driver's best lap time, stored in BCD \ \ Indexed by driver number (0 to 19) .clockMinutes SKIP 1 \ Minutes for the clock timer \ \ The clock timer counts the time spent on the track, so \ that's the total amount of qualifying time, or the \ time spent throughout an entire race .lapMinutes SKIP 1 \ Minutes for the lap timer \ \ The lap timer counts the time spent on the current lap SKIP 2 \ These bytes appear to be unused .objTrackSection SKIP 24 \ The number of the track section * 8 for each object \ \ In the Silverstone track there are 24 track sections \ numbered from 0 to 23, so this ranges from 0 to 184 .segmentVector SKIP 1 \ The segment vector number for a track segment in the \ track segment buffer .segmentSteering SKIP 1 \ The carSteering value to steer round the corner for a \ track segment in the track segment buffer \ \ The various bits are as for carSteering: \ \ * Bits 0-5 = the amount of steering as a positive \ value (0 to 31) \ \ * Bit 6 = controls whether to apply steering in the \ MoveCars routine \ \ * Clear = always apply steering \ \ * Set = only apply steering if there is enough \ room on the track \ \ * Bit 7 = the direction of the steering \ \ * Clear = steer left \ \ * Set = steer right .segmentFlags SKIP 1 \ Flags for a track segment in the track segment buffer \ \ Based on the track section flags for the track section \ containing the segment, but updated for each segment SKIP 39 * 3 \ The track segment buffer contains data for 40 track \ segments, with three bytes per segment, so this \ reserves space for the other 39 SKIP 8 \ These bytes appear to be unused .lineBufferPixel SKIP 40 \ The original screen contents of each pixel in the line \ buffer .lineBufferAddrLo SKIP 40 \ The low byte of the screen address of each pixel in \ the line buffer \ \ Stored as a 16-bit value (lineBufferAddrHi \ lineBufferAddrLo) .lineBufferAddrHi SKIP 40 \ The low byte of the screen address of each pixel in \ the line buffer \ \ Stored as a 16-bit value (lineBufferAddrHi \ lineBufferAddrLo) ORG &0880 .objSectionSegmt SKIP 24 \ Each object's segment number within the current track \ section, counting from the start of the section \ \ This value increments along with objectSegment as the \ object moves through each segment along the track, \ until it reaches the section's trackSectionSize (the \ section's length in terms of segments), at which point \ it resets to zero for the next section \ \ So while objectSegment is the object's segment number \ when looking at the entire track, objSectionSegmt is \ the object's segment number within the current track \ section only .totalRaceTenths SKIP 20 \ Tenths of seconds of each driver's total race time, \ stored in BCD \ \ Indexed by driver number (0 to 19) .totalRaceSeconds SKIP 20 \ Seconds of each driver's total race time, stored in \ BCD \ \ Indexed by driver number (0 to 19) SKIP 16 \ These bytes appear to be unused .objectSegmentLo SKIP 24 \ Low byte of each object's segment, i.e. its position \ around on the track \ \ Segment 0 is on the starting line, and segment numbers \ go from 0 to trackLength as we move along the track, \ before wrapping back to zero again at the end of the \ lap \ \ Set to the value of trackStartLine in ResetVariables \ \ The Silverstone track has a total of 1024 segments \ \ Stored as a 16-bit value (objectSegmentHi \ objectSegmentLo) .objectSegmentHi SKIP 24 \ High byte of each object's segment, i.e. its position \ around on the track \ \ Segment 0 is on the starting line, and segment numbers \ go from 0 to trackLength as we move along the track, \ before wrapping back to zero again at the end of the \ lap \ \ Set to the value of trackStartLine in ResetVariables \ \ The Silverstone track has a total of 1024 segments \ \ Stored as a 16-bit value (objectSegmentHi \ objectSegmentLo) .xSegmentCoordILo SKIP 1 \ The low byte of the 3D x-coordinate for an inner track \ segment in the track segment buffer \ \ Stored as a 16-bit value (xSegmentCoordIHi \ xSegmentCoordILo) .ySegmentCoordILo SKIP 1 \ The low byte of the 3D y-coordinate for an inner track \ segment in the track segment buffer \ \ Stored as a 16-bit value (ySegmentCoordIHi \ ySegmentCoordILo) .zSegmentCoordILo SKIP 1 \ The low byte of the 3D z-coordinate for an inner track \ segment in the track segment buffer \ \ Stored as a 16-bit value (zSegmentCoordIHi \ zSegmentCoordILo) SKIP 39 * 3 \ The track segment buffer contains data for 40 track \ segments, with three bytes per segment, so this \ reserves space for the other 39 .xSegmentCoordOLo SKIP 1 \ The low byte of the 3D x-coordinate for an outer track \ segment in the track segment buffer \ \ Stored as a 16-bit value (xSegmentCoordOHi \ xSegmentCoordOLo) .ySegmentCoordOLo SKIP 1 \ The low byte of the 3D y-coordinate for an outer track \ segment in the track segment buffer \ \ Stored as a 16-bit value (ySegmentCoordOHi \ ySegmentCoordOLo) .zSegmentCoordOLo SKIP 1 \ The low byte of the 3D z-coordinate for an outer track \ segment in the track segment buffer \ \ Stored as a 16-bit value (zSegmentCoordOHi \ zSegmentCoordOLo) SKIP 39 * 3 \ The track segment buffer contains data for 40 track \ segments, with three bytes per segment, so this \ reserves space for the other 39 SKIP 4 \ These bytes appear to be unused .xHelmetCoordLo SKIP 1 \ Low byte of the x-coordinate of the body/helmet object \ in the four-object car \ \ Stored as a 16-bit value (xHelmetCoordHi \ xHelmetCoordLo) .yHelmetCoordLo SKIP 1 \ Low byte of the y-coordinate of the body/helmet object \ in the four-object car \ \ Stored as a 16-bit value (yHelmetCoordHi \ yHelmetCoordLo) .zHelmetCoordLo SKIP 1 \ Low byte of the z-coordinate of the body/helmet object \ in the four-object car \ \ Stored as a 16-bit value (zHelmetCoordHi \ zHelmetCoordLo) SKIP 3 \ These bytes appear to be unused .xCoord1Lo SKIP 1 \ The low byte of the x-coordinate of the temporary \ coordinate variable (xCoord1, yCoord1, zCoord1) \ \ Stored as a 16-bit value (xCoord1Hi xCoord1Lo) .yCoord1Lo SKIP 1 \ The low byte of the y-coordinate of the temporary \ coordinate variable (xCoord1, yCoord1, zCoord1) \ \ Stored as a 16-bit value (yCoord1Hi yCoord1Lo) .zCoord1Lo SKIP 1 \ The low byte of the z-coordinate of the temporary \ coordinate variable (xCoord1, yCoord1, zCoord1) \ \ Stored as a 16-bit value (zCoord1Hi zCoord1Lo) .xCoord2Lo SKIP 1 \ The low byte of the x-coordinate of the temporary \ coordinate variable (xCoord2, yCoord2, zCoord2) \ \ Stored as a 16-bit value (xCoord2Hi xCoord2Lo) .yCoord2Lo SKIP 1 \ The low byte of the y-coordinate of the temporary \ coordinate variable (xCoord2, yCoord2, zCoord2) \ \ Stored as a 16-bit value (yCoord2Hi yCoord2Lo) .zCoord2Lo SKIP 1 \ The low byte of the z-coordinate of the temporary \ coordinate variable (xCoord2, yCoord2, zCoord2) \ \ Stored as a 16-bit value (zCoord2Hi zCoord2Lo) .xSegmentCoordIHi SKIP 1 \ The high byte of the 3D x-coordinate for an inner \ track segment in the track segment buffer \ \ Stored as a 16-bit value (xSegmentCoordIHi \ xSegmentCoordILo) .ySegmentCoordIHi SKIP 1 \ The high byte of the 3D y-coordinate for an inner \ track segment in the track segment buffer \ \ Stored as a 16-bit value (ySegmentCoordIHi \ ySegmentCoordILo) .zSegmentCoordIHi SKIP 1 \ The high byte of the 3D z-coordinate for an inner \ track segment in the track segment buffer \ \ Stored as a 16-bit value (zSegmentCoordIHi \ zSegmentCoordILo) SKIP 39 * 3 \ The track segment buffer contains data for 40 track \ segments, with three bytes per segment, so this \ reserves space for the other 39 .xSegmentCoordOHi SKIP 1 \ The high byte of the 3D x-coordinate for an outer \ track segment in the track segment buffer \ \ Stored as a 16-bit value (xSegmentCoordOHi \ xSegmentCoordOLo) .ySegmentCoordOHi SKIP 1 \ The high byte of the 3D y-coordinate for an outer \ track segment in the track segment buffer \ \ Stored as a 16-bit value (ySegmentCoordOHi \ ySegmentCoordOLo) .zSegmentCoordOHi SKIP 1 \ The high byte of the 3D z-coordinate for an outer \ track segment in the track segment buffer \ \ Stored as a 16-bit value (zSegmentCoordOHi \ zSegmentCoordOLo) SKIP 39 * 3 \ The track segment buffer contains data for 40 track \ segments, with three bytes per segment, so this \ reserves space for the other 39 SKIP 4 \ These bytes appear to be unused .xHelmetCoordHi SKIP 1 \ High byte of the x-coordinate of the body/helmet \ object in the four-object car \ \ Stored as a 16-bit value (xHelmetCoordHi \ xHelmetCoordLo) .yHelmetCoordHi SKIP 1 \ High byte of the y-coordinate of the body/helmet \ object in the four-object car \ \ Stored as a 16-bit value (yHelmetCoordHi \ yHelmetCoordLo) .zHelmetCoordHi SKIP 1 \ High byte of the z-coordinate of the body/helmet \ object in the four-object car \ \ Stored as a 16-bit value (yHelmetCoordHi \ yHelmetCoordLo) SKIP 3 \ These bytes appear to be unused .xCoord1Hi SKIP 1 \ The high byte of the x-coordinate of the temporary \ coordinate variable (xCoord1, yCoord1, zCoord1) \ \ Stored as a 16-bit value (xCoord1Hi xCoord1Lo) .yCoord1Hi SKIP 1 \ The high byte of the y-coordinate of the temporary \ coordinate variable (xCoord1, yCoord1, zCoord1) \ \ Stored as a 16-bit value (yCoord1Hi yCoord1Lo) .zCoord1Hi SKIP 1 \ The high byte of the z-coordinate of the temporary \ coordinate variable (xCoord1, yCoord1, zCoord1) \ \ Stored as a 16-bit value (zCoord1Hi zCoord1Lo) .xCoord2Hi SKIP 1 \ The high byte of the x-coordinate of the temporary \ coordinate variable (xCoord2, yCoord2, zCoord2) \ \ Stored as a 16-bit value (xCoord2Hi xCoord2Lo) .yCoord2Hi SKIP 1 \ The high byte of the y-coordinate of the temporary \ coordinate variable (xCoord2, yCoord2, zCoord2) \ \ Stored as a 16-bit value (yCoord2Hi yCoord2Lo) .zCoord2Hi SKIP 1 \ The high byte of the z-coordinate of the temporary \ coordinate variable (xCoord2, yCoord2, zCoord2) \ \ Stored as a 16-bit value (zCoord2Hi zCoord2Lo)