Skip to navigation

Aviator on the BBC Micro

Workspaces

AVIATOR SOURCE Aviator was written by Geoffrey J Crammond and is copyright Acornsoft 1983 The code on this site has been reconstructed from a disassembly of the original game binaries The commentary is copyright Mark Moxon, and any misunderstandings or mistakes in the documentation are entirely my fault The terminology and notations used in this commentary are explained at https://aviator.bbcelite.com/about_site/terminology_used_in_this_commentary The deep dive articles referred to in this commentary can be found at https://aviator.bbcelite.com/deep_dives
This source file produces the following binary file: * AVIA.bin
GUARD &6000 \ Guard against assembling over screen memory
Configuration variables
LOAD% = &1100 \ The load address of the main code binary CODE% = &0B00 \ The address of the main game code once the code has \ been rearranged. The code starts off at &1100-&5EFF \ and is moved in three stages: \ \ * &5800-&5BFF is copied to &0400-&07FF \ * &5C00-&5DFF is copied to &0B00-&0CFF \ * &0400-&07FF is copied to &0D00-&10FF \ \ This address points to the start of the executable \ code after all these moves, which is at &0B00 nextAxis = 40 \ The xObject, yObject and zObject tables each contain \ 40 bytes, and they are positioned one after the other \ in memory, so if we access, say, the x-coordinate for \ object Y at xObjectHi+Y, then adding #nextAxis to Y \ will point xObjectHi+Y to the y-coordinate, and adding \ it again will point it to the z-coordinate \ The following configuration variables represent screen \ addresses, with names in the following format: \ \ row1_block2_3 = Row 1, block 2, byte 3 \ \ The first batch refers to screen addresses in the \ canopy (character rows 0 to 19) row1_block1_0 = &5948 \ Second block on second row row1_block38_0 = &5A68 \ Last block but one on second row row1_block39_0 = &5A70 \ Last block on second row row3_block1_0 = &5BC8 \ Top-left corner of the on-screen score display row6_block1_0 = &5F88 \ Top-left corner of the canopy-wide rectangle \ containing the gun sights on rows 6, 7 and 8 row6_block20_0 = &6020 \ Top block of the vertical line in the gun sights row7_block20_0 = &6160 \ Bottom block of the vertical line in the gun sights row8_block11_0 = &6258 \ Left end of horizontal bar in the gun sights \ The second batch refers to screen addresses in the \ dashboard (character rows 20 to 31) row21_block20_7 = &72E7 \ Top block of joystick position display y-axis row22_block20_7 = &7427 \ Second block of joystick position display y-axis row23_block20_7 = &7567 \ Third block of joystick position display y-axis row24_block20_7 = &76A7 \ Fourth block of joystick position display y-axis and \ right-middle block of joystick position display x-axis row25_block20_7 = &77E7 \ Fifth block of joystick position display y-axis row26_block20_7 = &7927 \ Sixth block of joystick position display y-axis row27_block20_7 = &7A67 \ Bottom block of joystick position display y-axis row24_block18_7 = &7697 \ Left block of joystick position display x-axis row24_block19_7 = &769F \ Left-middle block of joystick position display x-axis row24_block21_7 = &76AF \ Right block of joystick position display x-axis row23_block12_4 = &7524 \ Left block of artificial horizon centre marker row23_block13_2 = &752A \ Middle block of artificial horizon centre marker row23_block14_4 = &7534 \ Right block of artificial horizon centre marker row25_block13_1 = &77A9 \ Bottom middle block of artificial horizon row25_block34_7 = &7857 \ Left spur of the radar's cross row25_block35_6 = &785E \ Bottom pixel of the top spur of the radar's cross row25_block35_7 = &785F \ Centre and right spur of the radar's cross row26_block35_0 = &7998 \ Top pixel of the bottom spur of the radar's cross row26_block35_1 = &7999 \ Bottom pixel of the bottom spur of the radar's cross row28_block26_5 = &7BD5 \ Centre block of the slip-and-turn indicator row29_block20_4 = &7CE4 \ Joystick indicator block (above middle of rudder) row30_block0_2 = &7D82 \ Theme indicator row30_block32_2 = &7E82 \ Undercarriage indicator row30_block35_2 = &7E9A \ Flaps indicator row30_block37_2 = &7EAA \ Brakes indicator VIA = &FE00 \ Memory-mapped space for accessing internal hardware, \ such as the video ULA, 6845 CRTC and 6522 VIAs (also \ known as SHEILA) OSBYTE = &FFF4 \ The address for the OSBYTE routine OSWORD = &FFF1 \ The address for the OSWORD routine OSWRCH = &FFEE \ The address for the OSWRCH routine OSCLI = &FFF7 \ The address for the OSCLI routine
Name: Zero page [Show more] Type: Workspace Address: &0070 to &008F Category: Workspaces Summary: Mainly temporary variables that are used a lot
Context: See this workspace on its own page References: No direct references to this workspace in this source file
ORG &0070 .P SKIP 1 \ Temporary storage, used in a number of places .Q SKIP 1 \ Temporary storage, used in a number of places \ \ This is called DTIP in the original source code .R SKIP 1 \ Temporary storage, used in a number of places .S SKIP 1 \ Temporary storage, used in a number of places .T SKIP 1 \ Temporary storage, used in a number of places .U SKIP 1 \ Temporary storage, used in a number of places .V SKIP 1 \ Temporary storage, used in a number of places .W SKIP 1 \ Temporary storage, used in a number of places .G SKIP 1 \ Temporary storage, used in a number of places .H SKIP 1 \ Temporary storage, used in a number of places .I SKIP 1 \ Temporary storage, used in a number of places .J SKIP 1 \ Temporary storage, used in a number of places .K SKIP 1 \ Temporary storage, used in a number of places .L SKIP 1 \ Temporary storage, used in a number of places .M SKIP 1 \ Temporary storage, used in a number of places .N SKIP 1 \ Temporary storage, used in a number of places .PP SKIP 1 \ Temporary storage, used in a number of places .QQ SKIP 1 \ Temporary storage, used in a number of places .RR SKIP 1 \ Temporary storage, used in a number of places .SS SKIP 1 \ Temporary storage, used in a number of places .TT SKIP 1 \ Temporary storage, used in a number of places .UU SKIP 1 \ Temporary storage, used in a number of places .VV SKIP 1 \ Temporary storage, used in a number of places .WW SKIP 1 \ Temporary storage, used in a number of places .GG SKIP 1 \ Temporary storage, used in a number of places \ \ This is called PP in the original source code .HH SKIP 1 \ Temporary storage, used in a number of places .linesToShowEnd SKIP 1 \ The index of the first empty entry in the linesToShow \ list \ \ Set to 0 in ResetLineLists .lineId SKIP 1 \ The line ID, used to pass lines to routines \ \ Line 0 is the horizon \ Lines 1-11 are the runway \ Lines 12-15 are bullets .lineCounter SKIP 1 \ Temporary storage, typically used to loop through \ lines .linesToShowPointer SKIP 1 \ A pointer into the linesToShow list to keep track of \ where we have processed up to \ \ Set to 255 in ResetLineLists .linesToHidePointer SKIP 1 \ A pointer into the linesToHide list to keep track of \ where we have processed up to \ \ Set to 255 in ResetLineLists .linesToHideEnd SKIP 1 \ The index of the last entry in the linesToHide list \ \ Set to 255 in ResetLineLists
Name: Stack variables [Show more] Type: Workspace Address: &0100 to &0175 Category: Workspaces Summary: Variables that share page 1 with the stack
Context: See this workspace on its own page References: No direct references to this workspace in this source file
ORG &0100 .lineBufferU SKIP 96 \ Line buffer storage for the line's |y-delta| (U) \ \ Stores information about lines that are drawn \ on-screen, so they can be quickly erased without \ having to spend precious time recalculating the line \ coordinates. The information is stored when a line is \ drawn by the DrawClippedLine routine, and is read by \ the EraseCanopyLines routine when the line is erased \ \ We can buffer up to 96 lines, with 48 in each of the \ two line buffers, so the maximum number of lines on \ screen at any one time is 48 lines out of the 193 \ lines defined in the world ORG &0160 .mx1Lo SKIP 1 \ The value of mx1, used when constructing the rotation \ matrices (low byte) \ \ Stored as a 16-bit value (mx1Hi mx1Lo) .my1Lo SKIP 1 \ The value of my1, used when constructing the rotation \ matrices (low byte) \ \ Stored as a 16-bit value (my1Hi my1Lo) .mz1Lo SKIP 1 \ The value of mz1, used when constructing the rotation \ matrices (low byte) \ \ Stored as a 16-bit value (mz1Hi mz1Lo) .mx2Lo SKIP 1 \ The value of mx2, used when constructing the rotation \ matrices (low byte) \ \ Stored as a 16-bit value (mx2Hi mx2Lo) .my2Lo SKIP 1 \ The value of my2, used when constructing the rotation \ matrices (low byte) \ \ Stored as a 16-bit value (my2Hi my2Lo) .mz2Lo SKIP 1 \ The value of mz2, used when constructing the rotation \ matrices (low byte) \ \ Stored as a 16-bit value (mz2Hi mz2Lo) ORG &0170 .mx1Hi SKIP 1 \ The value of mx1, used when constructing the rotation \ matrices (high byte) \ \ Stored as a 16-bit value (mx1Hi mx1Lo) .my1Hi SKIP 1 \ The value of my1, used when constructing the rotation \ matrices (high byte) \ \ Stored as a 16-bit value (my1Hi my1Lo) .mz1Hi SKIP 1 \ The value of mz1, used when constructing the rotation \ matrices (high byte) \ \ Stored as a 16-bit value (mz1Hi mz1Lo) .mx2Hi SKIP 1 \ The value of mx2, used when constructing the rotation \ matrices (high byte) \ \ Stored as a 16-bit value (mx2Hi mx2Lo) .my2Hi SKIP 1 \ The value of my2, used when constructing the rotation \ matrices (high byte) \ \ Stored as a 16-bit value (my2Hi my2Lo) .mz2Hi SKIP 1 \ The value of mz2, used when constructing the rotation \ matrices (high byte) \ \ Stored as a 16-bit value (mz2Hi mz2Lo)
Name: Main variable workspace [Show more] Type: Workspace Address: &0400 to &07FF and &0900 to &0CFF Category: Workspaces Summary: The main block of game variables
Context: See this workspace on its own page References: No direct references to this workspace in this source file
ORG &0400 .pointStatus SKIP 216 \ Each point's status byte \ \ * Bit 0: \ \ * 0 = we have not yet projected this point \ \ * 1 = we have already projected this point \ \ * Bit 2: \ \ * 0 = yPoint is positive \ \ * 1 = yPoint is negative \ \ * Bit 3: \ \ * 0 = xPoint is positive \ \ * 1 = xPoint is negative \ \ * Bit 4: \ \ * 0 = |yPoint| * 2 < |zPoint| \ \ * 1 = |yPoint| * 2 >= |zPoint| \ \ * Bit 5: \ \ * 0 = |xPoint| < |zPoint| \ \ * 1 = |xPoint| >= |zPoint| \ \ * Bit 7: \ \ * 0 = the point's coordinates and visibility have \ not been calculated \ \ * 1 = the point's coordinates and visibility have \ already been calculated \ \ Zeroed in ResetVariables .objectStatus SKIP 40 \ Each object's status byte \ \ * Bit 6: \ \ * 0 = the object's coordinates and visibility have \ not been calculated in this iteration of the \ main loop \ \ * 1 = the object's coordinates and visibility have \ already been calculated in this iteration of \ the main loop \ \ * Bit 7: \ \ * 0 = the object is not visible \ \ * 1 = the object is visible \ \ Zeroed in ResetVariables and in part 2 of the main \ loop .linesToShow SKIP 200 \ A list of line IDs for lines that are visible .relatedPoints SKIP 56 \ Contains a list, from relatedPoints+1 onwards, with \ the list size in relatedPoints \ \ Point IDs get added in part 3 of ProcessLine when \ those points are part of an object - only points \ that we haven't already processed are added \ \ The maximum size of the list is 49 \ \ Zeroed in ResetVariables .linesToHide SKIP 256 \ A list of line IDs for lines that are not visible .zPointLo SKIP 252 \ The low byte of the z-coordinate for the point with \ ID X is at zPointLo,X \ \ Stored as a 16-bit value (zPointHi zPointLo) .zLinearLo SKIP 1 \ Low byte of point 252 (z-coordinate) \ \ Point 252 is used to store the sum of all the forces \ on the plane when calculating the flight model \ \ Stored as a 16-bit value (zLinearHi zLinearLo) .zGravityLo SKIP 1 \ Low byte of point 253 (z-coordinate) \ \ Point 253 is used to store the gravity vector when \ calculating the flight model \ \ Stored as a 16-bit value (zGravityHi zGravityLo) .zTempPoint1Lo SKIP 1 \ Low byte of point 254 (z-coordinate) \ \ Used as temporary point storage when rotating points \ in space \ \ Stored as a 16-bit value (zTempPoint1Hi zTempPoint1Lo) .zTempPoint2Lo SKIP 1 \ Low byte of point 255 (z-coordinate) \ \ Used as temporary point storage when rotating points \ in space \ \ Stored as a 16-bit value (zTempPoint2Hi zTempPoint2Lo) ORG &0900 .xPointLo SKIP 252 \ The low byte of the x-coordinate for the point with \ ID X is at xPointLo,X \ \ Stored as a 16-bit value (xPointHi xPointLo) .xLinearLo SKIP 1 \ Low byte of point 252 (x-coordinate) \ \ Point 252 is used to store the sum of all the forces \ on the plane when calculating the flight model \ \ Stored as a 16-bit value (xLinearHi xLinearLo) .xGravityLo SKIP 1 \ Low byte of point 253 (x-coordinate) \ \ Point 253 is used to store the gravity vector when \ calculating the flight model \ \ Stored as a 16-bit value (xGravityHi xGravityLo) .xTempPoint1Lo SKIP 1 \ Low byte of point 254 (x-coordinate) \ \ Used as temporary point storage when rotating points \ in space \ \ Stored as a 16-bit value (xTempPoint1Hi xTempPoint1Lo) .xTempPoint2Lo SKIP 1 \ Low byte of point 255 (x-coordinate) \ \ Used as temporary point storage when rotating points \ in space \ \ Stored as a 16-bit value (xTempPoint2Hi xTempPoint2Lo) .yPointLo SKIP 252 \ The low byte of the y-coordinate for the point with \ ID X is at yPointLo,X \ \ Stored as a 16-bit value (yPointHi yPointLo) .yLinearLo SKIP 1 \ Low byte of point 252 (y-coordinate) \ \ Point 252 is used to store the sum of all the forces \ on the plane when calculating the flight model \ \ Stored as a 16-bit value (yLinearHi yLinearLo) .yGravityLo SKIP 1 \ Low byte of point 253 (y-coordinate) \ \ Point 253 is used to store the gravity vector when \ calculating the flight model \ \ Stored as a 16-bit value (yGravityHi yGravityLo) .yTempPoint1Lo SKIP 1 \ Low byte of point 254 (y-coordinate) \ \ Used as temporary point storage when rotating points \ in space \ \ Stored as a 16-bit value (yTempPoint1Hi yTempPoint1Lo) .yTempPoint2Lo SKIP 1 \ Low byte of point 255 (z-coordinate) \ \ Used as temporary point storage when rotating points \ in space \ \ Stored as a 16-bit value (yTempPoint2Hi yTempPoint2Lo) .yPointHi SKIP 252 \ The high byte of the y-coordinate for the point with \ ID X is at yPointHi,X \ \ Stored as a 16-bit value (yPointHi yPointLo) .yLinearHi SKIP 1 \ High byte of point 252 (y-coordinate) \ \ Point 252 is used to store the sum of all the forces \ on the plane when calculating the flight model \ \ Stored as a 16-bit value (yLinearHi yLinearLo) .yGravityHi SKIP 1 \ High byte of point 253 (y-coordinate) \ \ Point 253 is used to store the gravity vector when \ calculating the flight model \ \ Stored as a 16-bit value (yGravityHi yGravityLo) .yTempPoint1Hi SKIP 1 \ High byte of point 254 (y-coordinate) \ \ Used as temporary point storage when rotating points \ in space \ \ Stored as a 16-bit value (yTempPoint1Hi yTempPoint1Lo) .yTempPoint2Hi SKIP 1 \ High byte of point 255 (y-coordinate) \ \ Used as temporary point storage when rotating points \ in space \ \ Stored as a 16-bit value (yTempPoint2Hi yTempPoint2Lo) .xTurnHi SKIP 1 \ Turn rate around the x-axis (high byte) \ \ Stored as a 24-bit value (xTurnTop xTurnHi xTurnLo) .yTurnHi SKIP 1 \ Turn rate around the y-axis (high byte) \ \ Stored as 35 * the turn rate in 180 degrees per minute \ \ Shown on indicator 5 \ \ Stored as a 24-bit value (yTurnTop yTurnHi yTurnLo) .zTurnHi SKIP 1 \ Turn rate around the z-axis (high byte) \ \ Stored as a 24-bit value (zTurnTop zTurnHi zTurnLo) .xVelocityPLo SKIP 1 \ Plane velocity along the x-axis from the perspective \ of the pilot (low byte) \ \ Stored as a 16-bit value (xVelocityPHi xVelocityPLo) .yVelocityPLo SKIP 1 \ Plane velocity along the y-axis from the perspective \ of the pilot (low byte) \ \ Stored as a 16-bit value (yVelocityPHi yVelocityPLo) .zVelocityPLo SKIP 1 \ Plane velocity along the a-axis from the perspective \ of the pilot (low byte) \ \ This is the same as the forward airspeed \ \ 100 mph is stored as 9.25 * 256 = 2368 \ \ so 50 mph = 0.5 * 2368 = 1184 = (4 160) \ so 70 mph = 0.7 * 2368 = 1658 = (6 122) \ so 100 mph = 1 * 2368 = 2368 = (9 64) \ so 400 mph = 4 * 2368 = 9472 = (37 00) \ \ Shown on indicator 1 \ \ Stored as a 16-bit value (zVelocityPHi zVelocityPLo) .xTemp3Lo SKIP 1 \ The low byte of the xTemp3 temporary variable \ \ Stored as a 16-bit value (xTemp3Hi xTemp3Lo) .yTemp3Lo SKIP 1 \ The low byte of the yTemp3 temporary variable \ \ Stored as a 16-bit value (yTemp3Hi yTemp3Lo) .zTemp3Lo SKIP 1 \ The low byte of the zTemp3 temporary variable \ \ Stored as a 16-bit value (zTemp3Hi zTemp3Lo) .xPlaneBot SKIP 1 \ The bottom byte of the plane's coordinate (x-axis) \ \ Stored as a 32-bit value (xPlaneTop xPlaneHi xPlaneLo \ xPlaneBot) .yPlaneBot SKIP 1 \ The bottom byte of the plane's coordinate (y-axis) \ \ Stored as a 32-bit value (yPlaneTop yPlaneHi yPlaneLo \ yPlaneBot) .zPlaneBot SKIP 1 \ The bottom byte of the plane's coordinate (z-axis) \ \ Stored as a 32-bit value (zPlaneTop zPlaneHi zPlaneLo \ zPlaneBot) .elevatorPosition SKIP 1 \ Elevator position (pitch) \ \ The controls that affect rotation around the x-axis \ \ Shown on indicator 8 or 10 as the joystick y-position .rudderPosition SKIP 1 \ Rudder position (yaw) \ \ The controls that affect rotation around the y-axis \ \ Shown on indicator 9 .aileronPosition SKIP 1 \ Aileron position (roll) \ \ The controls that affect rotation around the z-axis \ \ Shown on indicator 8 or 10 as the joystick x-position .thrustLo SKIP 1 \ Thrust (low byte) \ \ Thrust is in the range 0 to 1280 \ \ Shown on indicator 11 \ \ Stored as a 16-bit value (thrustHi thrustLo) .xTurnTop SKIP 1 \ Turn rate around the x-axis (top byte) \ \ Stored as a 24-bit value (xTurnTop xTurnHi xTurnLo) .yTurnTop SKIP 1 \ Turn rate around the y-axis (top byte) \ \ Stored as 35 * the turn rate in 180 degrees per minute \ \ Shown on indicator 5 \ \ Stored as a 24-bit value (yTurnTop yTurnHi yTurnLo) .zTurnTop SKIP 1 \ Turn rate around the z-axis (top byte) \ \ Stored as a 24-bit value (zTurnTop zTurnHi zTurnLo) .xVelocityPHi SKIP 1 \ Plane velocity along the x-axis from the perspective \ of the pilot (high byte) \ \ Stored as a 16-bit value (xVelocityPHi xVelocityPLo) .yVelocityPHi SKIP 1 \ Plane velocity along the y-axis from the perspective \ of the pilot (high byte) \ \ Stored as a 16-bit value (yVelocityPHi yVelocityPLo) .zVelocityPHi SKIP 1 \ Plane velocity along the z-axis from the perspective \ of the pilot (high byte) \ \ This is the same as the forward airspeed \ \ 100 mph is stored as 9.25 * 256 = 2368 \ \ so 50 mph = 0.5 * 2368 = 1184 = (4 160) \ so 70 mph = 0.7 * 2368 = 1658 = (6 122) \ so 100 mph = 1 * 2368 = 2368 = (9 64) \ so 400 mph = 4 * 2368 = 9472 = (37 00) \ \ Shown on indicator 1 \ \ Stored as a 16-bit value (zVelocityPHi zVelocityPLo) .xTemp3Hi SKIP 1 \ The high byte of the xTemp3 temporary variable \ \ Stored as a 16-bit value (xTemp3Hi xTemp3Lo) .yTemp3Hi SKIP 1 \ The high byte of the yTemp3 temporary variable \ \ Stored as a 16-bit value (yTemp3Hi yTemp3Lo) .zTemp3Hi SKIP 1 \ The high byte of the zTemp3 temporary variable \ \ Stored as a 16-bit value (zTemp3Hi zTemp3Lo) .xTurnLo SKIP 1 \ Turn rate around the x-axis (low byte) \ \ Stored as a 24-bit value (xTurnTop xTurnHi xTurnLo) .yTurnLo SKIP 1 \ Turn rate around the y-axis (low byte) \ \ Stored as a 24-bit value (yTurnTop yTurnHi yTurnLo) .zTurnLo SKIP 1 \ Turn rate around the z-axis (low byte) \ \ Stored as a 24-bit value (zTurnTop zTurnHi zTurnLo) SKIP 3 \ These bytes appear to be unused .thrustHi SKIP 1 \ Thrust (high byte) \ \ Thrust is in the range 0 to 1280 \ \ Shown on indicator 11 \ \ Stored as a 16-bit value (thrustHi thrustLo) .xMomentsScLo SKIP 1 \ Scaled angular force due to forces on the plane in \ the x-axis (low byte) \ \ Stored as a 24-bit value (xMomentsScTop xMomentsScHi \ xMomentsScLo) .yMomentsScLo SKIP 1 \ Scaled angular force due to forces on the plane in \ the y-axis (low byte) \ \ Stored as a 24-bit value (yMomentsScTop yMomentsScHi \ yMomentsScLo) .zMomentsScLo SKIP 1 \ Scaled angular force due to forces on the plane in \ the z-axis (low byte) \ \ Stored as a 24-bit value (zMomentsScTop zMomentsScHi \ zMomentsScLo) .xLiftDragScLo SKIP 1 \ Scaled linear force due to lift in the x-axis (low \ byte) \ \ Stored as a 24-bit value (xLiftDragScTop xLiftDragScHi \ xLiftDragScLo) .yLiftDragScLo SKIP 1 \ Scaled linear force due to side forces in the y-axis \ (low byte) \ \ Stored as a 24-bit value (yLiftDragScTop yLiftDragScHi \ yLiftDragScLo) .zLiftDragScLo SKIP 1 \ Scaled linear force due to drag in the z-axis (low \ byte) \ \ Stored as a 24-bit value (zLiftDragScTop zLiftDragScHi \ zLiftDragScLo) .zSlipMomentScLo SKIP 1 \ Scaled angular force in the z-axis due to aircraft \ slip (low byte) \ \ Stored as a 24-bit value (zSlipMomentScTop \ zSlipMomentScHi zSlipMomentScLo) .yFlapsLiftScLo SKIP 1 \ Scaled linear force in the y-axis due to lift from the \ flaps (low byte) \ \ Stored as a 24-bit value (yFlapsLiftScTop \ yFlapsLiftScHi yFlapsLiftScLo) SKIP 2 \ These bytes appear to be unused .xControlsScLo SKIP 1 \ Scaled angular force due to the plane's controls in \ the x-axis (low byte) \ \ Stored as a 24-bit value (xControlsScTop xControlsScHi \ xControlsScLo) .yControlsScLo SKIP 1 \ Scaled angular force due to the plane's controls in \ the y-axis (low byte) \ \ Stored as a 24-bit value (yControlsScTop yControlsScHi \ yControlsScLo) .zControlsScLo SKIP 1 \ Scaled angular force due to the plane's controls in \ the z-axis (low byte) \ \ Stored as a 24-bit value (zControlsScTop zControlsScHi \ zControlsScLo) .axisKeyUsage SKIP 3 \ The following locations are updated when keys are \ pressed in UpdateFlightModel: \ \ * axisKeyUsage = elevator \ \ * axisKeyUsage+1 = rudder \ \ * axisKeyUsage+2 = aileron \ \ In each case, the value is updated by adding the \ relevant keyLoggerLo value, which is 1 in each case, \ so these count up by 1 every time a relevant axis \ control key is pressed (in any direction), so they \ measure "axis control key usage" .dxTurnLo SKIP 1 \ Rate of change of the plane's turn rate in the x-axis \ (low byte) \ \ Stored as a 24-bit value (dxTurnTop dxTurnHi dxTurnLo) .dyTurnLo SKIP 1 \ Rate of change of the plane's turn rate in the y-axis \ (low byte) \ \ Stored as a 24-bit value (dyTurnTop dyTurnHi dyTurnLo) .dzTurnLo SKIP 1 \ Rate of change of the plane's turn rate in the z-axis \ (low byte) \ \ Stored as a 24-bit value (dzTurnTop dzTurnHi dzTurnLo) SKIP 13 \ These bytes appear to be unused .xMomentsLo SKIP 1 \ Angular force due to airflow over the plane in the \ x-axis (low byte) \ \ Stored as a 16-bit value (xMomentsHi xMomentsLo) .yMomentsLo SKIP 1 \ Angular force due to airflow over the plane in the \ y-axis (low byte) \ \ Stored as a 16-bit value (yMomentsHi yMomentsLo) .zMomentsLo SKIP 1 \ Angular force due to airflow over the plane in the \ z-axis (low byte) \ \ Stored as a 16-bit value (zMomentsHi zMomentsLo) .xLiftDragLo SKIP 1 \ Linear force due to lift in the x-axis (low byte) \ \ Stored as a 16-bit value (xLiftDragHi xLiftDragLo) .yLiftDragLo SKIP 1 \ Linear force due to side forces in the y-axis (low \ byte) \ \ Stored as a 16-bit value (yLiftDragHi yLiftDragLo) .zLiftDragLo SKIP 1 \ Linear force due to drag in the z-axis (low byte) \ \ Stored as a 16-bit value (zLiftDragHi zLiftDragLo) .zSlipMomentLo SKIP 1 \ Angular force in the z-axis due to aircraft slip (low \ byte) \ \ Stored as a 16-bit value (zSlipMomentHi zSlipMomentLo) .yFlapsLiftLo SKIP 1 \ Linear force in the y-axis due to lift from the flaps \ (low byte) \ \ Stored as a 16-bit value (yFlapsLiftHi yFlapsLiftLo) SKIP 2 \ These bytes appear to be unused .xControlsLo SKIP 1 \ Angular force due to the plane's controls in the \ x-axis (low byte) \ \ Stored as a 16-bit value (xControlsHi xControlsLo) .yControlsLo SKIP 1 \ Angular force due to the plane's controls in the \ y-axis (low byte) \ \ Stored as a 16-bit value (yControlsHi yControlsLo) .zControlsLo SKIP 1 \ Angular force due to the plane's controls in the \ z-axis (low byte) \ \ Stored as a 16-bit value (zControlsHi zControlsLo) SKIP 3 \ These bytes appear to be unused .xMomentsHi SKIP 1 \ Angular force due to airflow over the plane in the \ x-axis (high byte) \ \ Stored as a 16-bit value (xMomentsHi xMomentsLo) .yMomentsHi SKIP 1 \ Angular force due to airflow over the plane in the \ y-axis (high byte) \ \ Stored as a 16-bit value (yMomentsHi yMomentsLo) .zMomentsHi SKIP 1 \ Angular force due to airflow over the plane in the \ z-axis (high byte) \ \ Stored as a 16-bit value (zMomentsHi zMomentsLo) .xLiftDragHi SKIP 1 \ Linear force due to lift in the x-axis (high byte) \ \ Stored as a 16-bit value (xLiftDragHi xLiftDragLo) .yLiftDragHi SKIP 1 \ Linear force due to side forces in the y-axis (high \ byte) \ \ Stored as a 16-bit value (yLiftDragHi yLiftDragLo) .zLiftDragHi SKIP 1 \ Linear force due to drag in the z-axis (high byte) \ \ Stored as a 16-bit value (zLiftDragHi zLiftDragLo) .zSlipMomentHi SKIP 1 \ Angular force in the z-axis due to aircraft slip (high \ byte) \ \ Stored as a 16-bit value (zSlipMomentHi zSlipMomentLo) .yFlapsLiftHi SKIP 1 \ Linear force in the y-axis due to lift from the flaps \ (high byte) \ \ Stored as a 16-bit value (yFlapsLiftHi yFlapsLiftLo) SKIP 2 \ These bytes appear to be unused .xControlsHi SKIP 1 \ Angular force due to the plane's controls in the \ x-axis (high byte) \ \ Stored as a 16-bit value (xControlsHi xControlsLo) .yControlsHi SKIP 1 \ Angular force due to the plane's controls in the \ y-axis (high byte) \ \ Stored as a 16-bit value (yControlsHi yControlsLo) .zControlsHi SKIP 1 \ Angular force due to the plane's controls in the \ z-axis (high byte) \ \ Stored as a 16-bit value (zControlsHi zControlsLo) SKIP 3 \ These bytes appear to be unused .xMomentsScHi SKIP 1 \ Scaled angular force due to forces on the plane in \ the x-axis (high byte) \ \ Stored as a 24-bit value (xMomentsScTop xMomentsScHi \ xMomentsScLo) .yMomentsScHi SKIP 1 \ Scaled angular force due to forces on the plane in \ the y-axis (high byte) \ \ Stored as a 24-bit value (yMomentsScTop yMomentsScHi \ yMomentsScLo) .zMomentsScHi SKIP 1 \ Scaled angular force due to forces on the plane in \ the z-axis (high byte) \ \ Stored as a 24-bit value (zMomentsScTop zMomentsScHi \ zMomentsScLo) .xLiftDragScHi SKIP 1 \ Scaled linear force due to lift in the x-axis (high \ byte) \ \ Stored as a 24-bit value (xLiftDragScTop xLiftDragScHi \ xLiftDragScLo) .yLiftDragScHi SKIP 1 \ Scaled linear force due to side forces in the y-axis \ (high byte) \ \ Stored as a 24-bit value (yLiftDragScTop yLiftDragScHi \ yLiftDragScLo) .zLiftDragScHi SKIP 1 \ Scaled linear force due to drag in the z-axis (high \ byte) \ \ Stored as a 24-bit value (zLiftDragScTop zLiftDragScHi \ zLiftDragScLo) .zSlipMomentScHi SKIP 1 \ Scaled angular force in the z-axis due to aircraft \ slip (high byte) \ \ Stored as a 24-bit value (zSlipMomentScTop \ zSlipMomentScHi zSlipMomentScLo) .yFlapsLiftScHi SKIP 1 \ Scaled linear force in the y-axis due to lift from the \ flaps (high byte) \ \ Stored as a 24-bit value (yFlapsLiftScTop \ yFlapsLiftScHi yFlapsLiftScLo) SKIP 2 \ These bytes appear to be unused .xControlsScHi SKIP 1 \ Scaled angular force due to the plane's controls in \ the x-axis (high byte) \ \ Stored as a 24-bit value (xControlsScTop xControlsScHi \ xControlsScLo) .yControlsScHi SKIP 1 \ Scaled angular force due to the plane's controls in \ the y-axis (high byte) \ \ Stored as a 24-bit value (yControlsScTop yControlsScHi \ yControlsScLo) .zControlsScHi SKIP 1 \ Scaled angular force due to the plane's controls in \ the z-axis (high byte) \ \ Stored as a 24-bit value (zControlsScTop zControlsScHi \ zControlsScLo) .xPlaneTop SKIP 1 \ The top byte of the plane's location, which is the \ byte above the high byte in xPlaneHi \ \ Stored as a 32-bit value (xPlaneTop xPlaneHi xPlaneLo \ xPlaneBot) .yPlaneTop SKIP 1 \ The top byte of the plane's location, which is the \ byte above the high byte in yPlaneHi \ \ Stored as a 32-bit value (yPlaneTop yPlaneHi yPlaneLo \ yPlaneBot) .zPlaneTop SKIP 1 \ The top byte of the plane's location, which is the \ byte above the high byte in zPlaneHi \ \ Stored as a 32-bit value (zPlaneTop zPlaneHi zPlaneLo \ zPlaneBot) .xMomentsScTop SKIP 1 \ Scaled angular force due to forces on the plane in \ the x-axis (top byte) \ \ Stored as a 24-bit value (xMomentsScTop xMomentsScHi \ xMomentsScLo) .yMomentsScTop SKIP 1 \ Scaled angular force due to forces on the plane in \ the y-axis (top byte) \ \ Stored as a 24-bit value (yMomentsScTop yMomentsScHi \ yMomentsScLo) .zMomentsScTop SKIP 1 \ Scaled angular force due to forces on the plane in \ the z-axis (top byte) \ \ Stored as a 24-bit value (zMomentsScTop zMomentsScHi \ zMomentsScLo) .xLiftDragScTop SKIP 1 \ Scaled linear force due to lift in the x-axis (top \ byte) \ \ Stored as a 24-bit value (xLiftDragScTop xLiftDragScHi \ xLiftDragScLo) .yLiftDragScTop SKIP 1 \ Scaled linear force due to side forces in the y-axis \ (top byte) \ \ Stored as a 24-bit value (yLiftDragScTop yLiftDragScHi \ yLiftDragScLo) .zLiftDragScTop SKIP 1 \ Scaled linear force due to drag in the z-axis (top \ byte) \ \ Stored as a 24-bit value (zLiftDragScTop zLiftDragScHi \ zLiftDragScLo) .zSlipMomentScTop SKIP 1 \ Scaled angular force in the z-axis due to aircraft \ slip (top byte) \ \ Stored as a 24-bit value (zSlipMomentScTop \ zSlipMomentScHi zSlipMomentScLo) .yFlapsLiftScTop SKIP 1 \ Scaled linear force in the y-axis due to lift from the \ flaps (top byte) \ \ Stored as a 24-bit value (yFlapsLiftScTop \ yFlapsLiftScHi yFlapsLiftScLo) SKIP 2 \ These bytes appear to be unused .xControlsScTop SKIP 1 \ Scaled angular force due to the plane's controls in \ the x-axis (top byte) \ \ Stored as a 24-bit value (xControlsScTop xControlsScHi \ xControlsScLo) .yControlsScTop SKIP 1 \ Scaled angular force due to the plane's controls in \ the y-axis (top byte) \ \ Stored as a 24-bit value (yControlsScTop yControlsScHi \ yControlsScLo) .zControlsScTop SKIP 1 \ Scaled angular force due to the plane's controls in \ the z-axis (top byte) \ \ Stored as a 24-bit value (zControlsScTop zControlsScHi \ zControlsScLo) SKIP 3 \ These bytes appear to be unused .dxTurnHi SKIP 1 \ Rate of change of the plane's turn rate in the x-axis \ (high byte) \ \ Stored as a 24-bit value (dxTurnTop dxTurnHi dxTurnLo) .dyTurnHi SKIP 1 \ Rate of change of the plane's rate turn in the y-axis \ (high byte) \ \ Stored as a 24-bit value (dyTurnTop dyTurnHi dyTurnLo) .dzTurnHi SKIP 1 \ Rate of change of the plane's rate turn in the z-axis \ (high byte) \ \ Stored as a 24-bit value (dzTurnTop dzTurnHi dzTurnLo) .dxVelocityLo SKIP 1 \ Rate of change of the plane's velocity in the x-axis \ (low byte) \ \ Stored as a 16-bit value (dxVelocityHi dxVelocityLo) .dyVelocityLo SKIP 1 \ Rate of change of the plane's velocity in the y-axis \ (low byte) \ \ Stored as a 16-bit value (dxVelocityHi dxVelocityLo) .dzVelocityLo SKIP 1 \ Rate of change of the plane's velocity in the z-axis \ (low byte) \ \ Stored as a 16-bit value (dxVelocityHi dxVelocityLo) .dxRotationLo SKIP 1 \ Rate of change of the plane's rotation in the x-axis \ (low byte) \ \ Stored as a 16-bit value (dxVelocityHi dxVelocityLo) .dyRotationLo SKIP 1 \ Rate of change of the plane's rotation in the y-axis \ (low byte) \ \ Stored as a 16-bit value (dyVelocityHi dyVelocityLo) .dzRotationLo SKIP 1 \ Rate of change of the plane's rotation in the z-axis \ (low byte) \ \ Stored as a 16-bit value (dzVelocityHi dzVelocityLo) .xVelocityHi SKIP 1 \ Plane velocity in the x-axis from the perspective \ of the outside world (high byte) \ \ Stored as a 24-bit value (xVelocityTop xVelocityHi \ xVelocityLo) .yVelocityHi SKIP 1 \ Plane velocity in the y-axis from the perspective \ of the outside world (high byte) \ \ This is the same as the vertical speed, and is from \ the perspective of the world outside the plane, so \ yVelocity is the vertical speed of the plane, \ irrespective of how the plane is orientated \ \ For the plane's speed from the point of view of the \ plane, see (xVelocityP yVelocityP zVelocityP) \ \ Stored as 128/425 * vertical speed in feet per minute, \ so: \ \ 1000 feet/minute is stored as 128/425 * 1000 = 301 \ \ 4000 feet/minute is stored as 128/425 * 4000 = 1205 \ \ Shown on indicator 4 \ \ Stored as a 24-bit value (yVelocityTop yVelocityHi \ yVelocityLo) .zVelocityHi SKIP 1 \ Plane velocity in the z-axis from the perspective \ of the outside world (high byte) \ \ Stored as a 24-bit value (zVelocityTop zVelocityHi \ zVelocityLo) .xVelocityLo SKIP 1 \ Plane velocity in the x-axis from the perspective \ of the outside world (low byte) \ \ Stored as a 24-bit value (xVelocityTop xVelocityHi \ xVelocityLo) .yVelocityLo SKIP 1 \ Plane velocity in the y-axis from the perspective \ of the outside world (low byte) \ \ This is the same as the vertical speed, and is from \ the perspective of the world outside the plane, so \ yVelocity is the vertical speed of the plane, \ irrespective of how the plane is orientated \ \ For the plane's speed from the point of view of the \ plane, see (xVelocityP yVelocityP zVelocityP) \ \ Stored as 128/425 * vertical speed in feet per minute, \ so: \ \ 1000 feet/minute is stored as 128/425 * 1000 = 301 \ \ 4000 feet/minute is stored as 128/425 * 4000 = 1205 \ \ Shown on indicator 4 \ \ Stored as a 24-bit value (yVelocityTop yVelocityHi \ yVelocityLo) .zVelocityLo SKIP 1 \ Plane velocity in the z-axis from the perspective \ of the outside world (low byte) \ \ Stored as a 24-bit value (zVelocityTop zVelocityHi \ zVelocityLo) SKIP 1 \ This byte appears to be unused .dxTurnTop SKIP 1 \ Rate of change of the plane's turn rate in the x-axis \ (top byte) \ \ Stored as a 24-bit value (dxTurnTop dxTurnHi dxTurnLo) .dyTurnTop SKIP 1 \ Rate of change of the plane's turn rate in the y-axis \ (top byte) \ \ Stored as a 24-bit value (dyTurnTop dyTurnHi dyTurnLo) .dzTurnTop SKIP 1 \ Rate of change of the plane's turn rate in the z-axis \ (top byte) \ \ Stored as a 24-bit value (dzTurnTop dzTurnHi dzTurnLo) .dxVelocityHi SKIP 1 \ Rate of change of the plane's velocity in the x-axis \ (high byte) \ \ Stored as a 16-bit value (dxVelocityHi dxVelocityLo) .dyVelocityHi SKIP 1 \ Rate of change of the plane's velocity in the y-axis \ (high byte) \ \ Stored as a 16-bit value (dxVelocityHi dxVelocityLo) .dzVelocityHi SKIP 1 \ Rate of change of the plane's velocity in the z-axis \ (high byte) \ \ Stored as a 16-bit value (dxVelocityHi dxVelocityLo) .dxRotationHi SKIP 1 \ Rate of change of the plane's rotation in the x-axis \ (high byte) \ \ Stored as a 16-bit value (dxVelocityHi dxVelocityLo) .dyRotationHi SKIP 1 \ Rate of change of the plane's rotation in the y-axis \ (high byte) \ \ Stored as a 16-bit value (dyVelocityHi dyVelocityLo) .dzRotationHi SKIP 1 \ Rate of change of the plane's rotation in the z-axis \ (high byte) \ \ Stored as a 16-bit value (dzVelocityHi dzVelocityLo) .xVelocityTop SKIP 1 \ Plane velocity in the x-axis from the perspective \ of the outside world (top byte) \ \ Stored as a 24-bit value (xVelocityTop xVelocityHi \ xVelocityLo) .yVelocityTop SKIP 1 \ Plane velocity in the y-axis from the perspective \ of the outside world (top byte) \ \ This is the same as the vertical speed, and is from \ the perspective of the world outside the plane, so \ yVelocity is the vertical speed of the plane, \ irrespective of how the plane is orientated \ \ For the plane's speed from the point of view of the \ plane, see (xVelocityP yVelocityP zVelocityP) \ \ Stored as 128/425 * vertical speed in feet per minute, \ so: \ \ 1000 feet/minute is stored as 128/425 * 1000 = 301 \ \ 4000 feet/minute is stored as 128/425 * 4000 = 1205 \ \ Shown on indicator 4 \ \ Stored as a 24-bit value (yVelocityTop yVelocityHi \ yVelocityLo) .zVelocityTop SKIP 1 \ Plane velocity in the z-axis from the perspective \ of the outside world (top byte) \ \ Stored as a 24-bit value (zVelocityTop zVelocityHi \ zVelocityLo) .slipRate SKIP 1 \ Slip rate \ \ Shown on indicator 6 SKIP 3 \ These bytes appear to be unused .keyLoggerLo SKIP 6 \ Key logger (low byte) \ \ Populated with values from keyTable1Lo or keyTable2Lo \ when a key is pressed, or 0 if neither is pressed: \ \ L or < (elevator dive/pitch) = -1 or 1 \ A or + (rudder yaw left/right) = -1 or 1 \ S or D (aileron bank left/right) = -1 or 1 \ W or E (throttle down/up) = -15 or 15 \ U or B (undercarriage, brakes) = 4 or 7 \ F or SHIFT (flaps, fire) = 5 or 8 SKIP 2 \ These bytes appear to be unused .xTemp2Lo SKIP 1 \ The low byte of the xTemp2 temporary variable \ \ Stored as a 24-bit value (xTemp2Top xTemp2Hi xTemp2Lo) .yTemp2Lo SKIP 1 \ The low byte of the yTemp2 temporary variable \ \ Stored as a 24-bit value (yTemp2Top yTemp2Hi yTemp2Lo) .zTemp2Lo SKIP 1 \ The low byte of the zTemp2 temporary variable \ \ Stored as a 24-bit value (zTemp2Top zTemp2Hi zTemp2Lo) SKIP 5 \ These bytes appear to be unused .keyLoggerHi SKIP 6 \ Key logger (high byte) \ \ Populated with values from keyTable1Hi or keyTable2Hi \ when a key is pressed, or 0 if neither is pressed: \ \ L or < (elevator dive/pitch) = -1 or 1 \ A or + (rudder yaw left/right) = -1 or 1 \ S or D (aileron bank left/right) = -1 or 1 \ W or E (throttle down/up) = -15 or 15 \ U or B (undercarriage, brakes) = 4 or 7 \ F or SHIFT (flaps, fire) = 5 or 8 SKIP 2 \ These bytes appear to be unused .xTemp2Hi SKIP 1 \ The high byte of the xTemp2 temporary variable \ \ Stored as a 24-bit value (xTemp2Top xTemp2Hi xTemp2Lo) .yTemp2Hi SKIP 1 \ The high byte of the yTemp2 temporary variable \ \ Stored as a 24-bit value (yTemp2Top yTemp2Hi yTemp2Lo) .zTemp2Hi SKIP 1 \ The high byte of the zTemp2 temporary variable \ \ Stored as a 24-bit value (zTemp2Top zTemp2Hi zTemp2Lo) .xTemp2Top SKIP 1 \ The top byte of the xTemp2 temporary variable \ \ Stored as a 24-bit value (xTemp2Top xTemp2Hi xTemp2Lo) .yTemp2Top SKIP 1 \ The top byte of the yTemp2 temporary variable \ \ Stored as a 24-bit value (yTemp2Top yTemp2Hi yTemp2Lo) .zTemp2Top SKIP 1 \ The top byte of the zTemp2 temporary variable \ \ Stored as a 24-bit value (zTemp2Top zTemp2Hi zTemp2Lo) .gunSights SKIP 1 \ Gun sights status \ \ * Bit 6 = 1 while "I" is being held down \ \ * Bit 7 = 1 when sights are being shown \ 0 when sights are not being shown .isObject SKIP 1 \ Temporary storage, used to store the object ID when we \ check the visibility of an object in ProcessLine and \ call SetObjectCoords to set its coordinates .pointId SKIP 1 \ Temporary storage, used to store the ID of the current \ point when checking a line's visibility in the \ ProcessLine routine .maxCoord SKIP 1 \ Temporary storage, used to store the maximum start \ point coordinate when clipping lines .colourLogic SKIP 1 \ Determines the logic and bit patterns used to draw the \ canopy view: \ \ * %00000000 = erase lines \ Gets set to this value after each screen flip \ Sets AND logic for screen writing \ Sets bit patterns to erase the screen \ See EraseCanopyLines \ \ * %01000000 when colourCycle is %11110000 \ Sets ORA logic for screen writing \ See FlipColours \ \ * %10000000 when colourCycle is %00001111 \ Sets ORA logic for screen writing \ See ResetLineLists, FlipColours \ \ Set to %10000000 for each new game .colourCycle SKIP 1 \ Determines which of the two canopy screens we are \ showing, so we can use colour cycling for smooth \ animation \ \ * %00001111 = show colour 1, hide colour 2 \ \ * %11110000 = show colour 2, hide colour 1 \ \ We show a colour by mapping it to white, and hide a \ colour by mapping it to black \ \ Set to %00001111 for each new game .matrixAxis SKIP 1 \ The axis to be processed by the matrix routines, \ specifically those that populate the matrices \ \ * 0 = x-axis \ \ * 1 = y-axis \ \ * 2 = z-axis .onGround SKIP 1 \ "On the ground" status \ \ * 0 = we are not on the ground \ \ * 1 = we are on the ground \ \ Set to 1 in ResetVariables (on the ground) .previousListEnd SKIP 1 \ Used to store the value of linesToHideEnd at the \ start of each iteration of the main loop, so we can \ refer to it at the end of the main loop to see if \ we have added anything to the list during the main \ loop .startStatus SKIP 1 \ Temporary storage, used to store the point status byte \ for the start point of a projected line .pointCount SKIP 1 \ Temporary storage, used as a counter in ProcessLine \ to check the start and end points of the line .pressingT SKIP 1 \ Set to 0 in the main loop if "T" is not being pressed, \ otherwise set to 1, to prevent holding down "T" from \ constantly switching the engine on and off .showRunwayDashes SKIP 1 \ Determines whether the dashes down the middle of the \ runway are close enough to be visible: \ \ * Bit 7: \ \ * 0 = the runway dashes are visible \ \ * 1 = the runway dashes are not visible .matrixNumber SKIP 1 \ The matrix used in matrix operations: \ \ * 0 = matrix 1 \ * 9 = matrix 2 \ * 18 = matrix 3 \ * 27 = matrix 4 .objectId SKIP 1 \ Temporary storage for an object ID (0 to 39) \ \ This is called OB in the original source code .pressingTab SKIP 1 \ Bit 7 determines whether TAB is being pressed \ \ * 0 = not being pressed \ \ * 128 = being pressed \ \ This value is set in the ToggleJoystick routine .showLine SKIP 1 \ Determines whether a line is visible: \ \ * Bit 6: \ \ * 0 = the line fits into Aviator's 3D world \ \ * 1 = the line calculations overflowed, so the \ line does not fit into Aviator's 3D world \ \ * Bit 7: \ \ * 0 = the line is visible \ \ * 1 = the line is not visible .objectAnchorPoint SKIP 1 \ Used to store the anchor point of the current object \ \ This is the point to which all the other points in \ the object, i.e. those in xObjectPoint, yObjectPoint \ and zObjectPoint, are relative \ \ In other words, this is effectively the object's \ coordinate .lineBuffer1Count SKIP 1 \ Offset of the last line stored in buffer 1 \ \ * -1 = buffer 1 is empty \ \ * 0 to 46 = buffer 1 contains lineBuffer1Count + 1 \ lines but is not full \ \ * 47 = buffer 1 is full and contains 48 lines \ \ We can buffer up to 96 lines, with 48 in each of the \ two line buffers, so the maximum number of lines on \ screen at any one time is 48 lines out of the 193 \ lines defined in the world \ \ Set to -1 in ResetVariables (buffer 1 empty) .lineBuffer2Count SKIP 1 \ Offset of the last line stored in buffer 2 \ \ * 47 = buffer 2 is empty \ \ * 48 to 94 = buffer 2 contains lineBuffer2Count + 1 \ lines but is not full \ \ * 95 = buffer 2 is full, contains 48 lines \ \ We can buffer up to 96 lines, with 48 in each of the \ two line buffers, so the maximum number of lines on \ screen at any one time is 48 lines out of the 193 \ lines defined in the world \ \ Set to 47 in ResetVariables (buffer 2 empty) .pressingUFBS SKIP 5 \ Determines whether any of the following keys are \ being pressed: \ \ * pressingUFBS = 1 while the undercarriage key "U" \ is being pressed, 0 otherwise \ \ * pressingUFBS+1 = 1 while the flaps key "F" is \ being pressed, 0 otherwise \ \ * pressingUFBS+2 is not used \ \ * pressingUFBS+3 = 1 while the brake key "B" is \ being pressed, 0 otherwise \ \ * pressingUFBS+4 = 1 while the fire key SHIFT is \ being pressed, 0 otherwise .pointsToAward SKIP 1 \ Used to store the points scored from flying skills, so \ they can be added to the score once the task has been \ completed .scoreDisplayTimer SKIP 1 \ Counter for removing the score after displaying it \ for a fixed amount of time .gunSoundCounter SKIP 1 \ Counter for the number of firing sounds we make when \ firing our guns (which makes the sound of two shots) .xDashesVectorLo SKIP 1 \ The low byte of the xDashesVector temporary variable \ \ Stored as a 16-bit value (xDashesVectorHi \ xDashesVectorLo) .yDashesVectorLo SKIP 1 \ The low byte of the yDashesVector temporary variable \ \ Stored as a 16-bit value (yDashesVectorHi \ yDashesVectorLo) .zDashesVectorLo SKIP 1 \ The low byte of the yDashesVector temporary variable \ \ Stored as a 16-bit value (zDashesVectorHi \ zDashesVectorLo) .xDashesVectorHi SKIP 1 \ The high byte of the xDashesVector temporary variable \ \ Stored as a 16-bit value (xDashesVectorHi \ xDashesVectorLo) .yDashesVectorHi SKIP 1 \ The high byte of the yDashesVector temporary variable \ \ Stored as a 16-bit value (yDashesVectorHi \ yDashesVectorLo) .zDashesVectorHi SKIP 1 \ The high byte of the yDashesVector temporary variable \ \ Stored as a 16-bit value (zDashesVectorHi \ zDashesVectorLo) .xTemp1Lo SKIP 1 \ The low byte of the xTemp1 temporary variable \ \ Stored as a 16-bit value (xTemp1Hi xTemp1Lo) .yTemp1Lo SKIP 1 \ The low byte of the yTemp1 temporary variable \ \ Stored as a 16-bit value (yTemp1Hi yTemp1Lo) .zTemp1Lo SKIP 1 \ The low byte of the zTemp1 temporary variable \ \ Stored as a 16-bit value (zTemp1Hi zTemp1Lo) .xTemp1Hi SKIP 1 \ The high byte of the xTemp1 temporary variable \ \ Stored as a 16-bit value (xTemp1Hi xTemp1Lo) .yTemp1Hi SKIP 1 \ The high byte of the yTemp1 temporary variable \ \ Stored as a 16-bit value (yTemp1Hi yTemp1Lo) .zTemp1Hi SKIP 1 \ The high byte of the zTemp1 temporary variable \ \ Stored as a 16-bit value (zTemp1Hi zTemp1Lo) .alien SKIP 0 \ Temporary storage, used as a flag to indicate the \ alien when updating the radar (shares a memory \ location with the objCount variable) .objCount SKIP 1 \ Temporary storage, used as a loop counter in the \ object group visibility checks (shares a memory \ location with the alien variable) .themeStatus SKIP 1 \ Theme status \ \ * Positive (bit 7 = 0) = the Theme is enabled and \ the value is the number of aliens we still have \ to add to the current wave (this starts at 8 and \ decreases down to 0 as each new alien is added) \ \ * Negative (bit 7 = 1) = the Theme is not enabled \ \ Set to 255 (Theme not enabled) in ResetVariables .landingStatus SKIP 1 \ The current landing status \ \ A flag that determines whether we have landed safely \ on the runway, and therefore whether we fill up with \ fuel and so on \ \ * Positive = do all the landing-based tasks \ mentioned below \ \ * 0 = do not enable the Theme on firing \ do not fill up with fuel \ do not award points for landing \ \ * Negative = do not enable the Theme on firing \ do not fill up with fuel \ \ Set to 1 in ResetVariables (do all landing tasks) \ \ Set to %01000000 when speed is 0 in ApplyFlightModel \ \ Gets shifted left with a 1 inserted in bit 0 in \ ProcessLanding if we are doing an emergency landing .engineStatus SKIP 1 \ Engine status \ \ * 0 = engine is off \ \ * Non-zero = engine is on .xRotationLo SKIP 1 \ Plane rotation angle around the x-axis (low byte) \ \ Same as the plane's pitch angle \ \ Stored as a 16-bit value (xRotationHi xRotationLo) .yRotationLo SKIP 1 \ Plane rotation angle around the y-axis (low byte) \ \ Same as the plane's yaw angle, which is also the \ direction of the compass (i.e. the plane's heading) \ \ Stored as a 16-bit value (yRotationHi yRotationLo) .zRotationLo SKIP 1 \ Plane rotation angle around the z-axis (low byte) \ \ Same as the plane's roll angle \ \ Stored as a 16-bit value (zRotationHi zRotationLo) .xPlaneLo SKIP 1 \ Plane longitude/x-coordinate (low byte) \ \ Set to &C6E5 in ResetVariables \ \ Stored as a 32-bit value (xPlaneTop xPlaneHi xPlaneLo \ xPlaneBot) .yPlaneLo SKIP 1 \ Plane altitude/y-coordinate (low byte) \ \ Stored as the altitude in feet x 4 \ \ Shown on indicator 2 \ \ Set to (0 10) in ResetVariables \ \ Stored as a 32-bit value (yPlaneTop yPlaneHi yPlaneLo \ yPlaneBot) .zPlaneLo SKIP 1 \ Plane latitude/z-coordinate (low byte) \ \ Set to &485C in ResetVariables \ \ Stored as a 32-bit value (zPlaneTop zPlaneHi zPlaneLo \ zPlaneBot) .yLandingGear SKIP 1 \ The vertical distance between the cockpit and the \ lowest part of the plane \ \ * 5 when undercarriage is up \ \ * 10 when undercarriage is down .firingStatus SKIP 1 \ Firing status \ \ * 0 = no bullets in the air \ \ * Non-zero = guns fired, bullets in the air \ \ This is called FRFLAG in the original source code .ucStatus SKIP 1 \ Undercarriage status \ \ * 0 = undercarriage is up \ \ * Non-zero = undercarriage is down \ \ Set to 1 (undercarriage is down) in ResetVariables .flapsStatus SKIP 1 \ Flaps status \ \ * 0 = flaps are off (raised) \ \ * Non-zero = flaps are on (dropped) \ \ Set to 0 (flaps are off) in ResetVariables SKIP 1 \ This byte appears to be unused .brakesStatus SKIP 1 \ Brakes status \ \ * 0 = brakes are off \ \ * Non-zero = brakes are on \ \ Set to 1 (brakes are on) in ResetVariables SKIP 1 \ This byte appears to be unused .propellorStatus SKIP 1 \ Propellor status \ \ * 0 = propellor is working \ \ * Non-zero = propellor is broken \ \ If we make a crash landing with the undercarriage up, \ the propellor breaks and we can't turn the engine on .alienSpeed SKIP 1 \ The speed at which the aliens move, which starts at 10 \ for the first wave, then 14 for the second, 18 for the \ third, and 22 for all subsequent waves \ \ Set to 10 in ResetVariables .reached512ft SKIP 1 \ Have we reached 512 feet in altitude since taking off? \ \ * 0 = no \ \ * Non-zero = yes \ \ The height measured is 512 feet, rather than the 500 \ feet mentioned in the maunal, as this is set to \ non-zero when the plane's altitude in yPlaneHi >= 2 .xRotationHi SKIP 1 \ Plane rotation angle around the x-axis (high byte) \ \ Same as the plane's pitch angle \ \ * 0 = straight ahead (bit 6 clear, bit 7 clear) \ * 64 = vertical up (bit 6 set, bit 7 clear) \ * 128 = backwards (bit 6 clear, bit 7 set) \ * 192 = nosedive (bit 6 set, bit 7 set) \ \ Set to 7 in ResetVariables \ \ Stored as a 16-bit value (xRotationHi xRotationLo) .yRotationHi SKIP 1 \ Plane rotation angle around the y-axis (high byte) \ \ Same as the plane's yaw angle, which is also the \ direction of the compass (i.e. the plane's heading) \ \ * 0 = north (bit 6 clear, bit 7 clear) \ * 64 = east (bit 6 set, bit 7 clear) \ * 128 = south (bit 6 clear, bit 7 set) \ * 192 = west (bit 6 set, bit 7 set) \ \ Shown on indicator 0 \ \ Stored as a 16-bit value (yRotationHi yRotationLo) .zRotationHi SKIP 1 \ Plane rotation angle around the z-axis (high byte) \ \ Same as the plane's roll angle \ \ * 0 = horizontal (bit 6 clear, bit 7 clear) \ * 64 = vertical right (bit 6 set, bit 7 clear) \ * 128 = upside down (bit 6 clear, bit 7 set) \ * 192 = vertical left (bit 6 set, bit 7 set) \ \ Stored as a 16-bit value (zRotationHi zRotationLo) .xPlaneHi SKIP 1 \ Plane longitude/x-coordinate (high byte) \ \ Set to &C6E5 in ResetVariables \ \ Stored as a 32-bit value (xPlaneTop xPlaneHi xPlaneLo \ xPlaneBot) .yPlaneHi SKIP 1 \ Plane altitude/y-coordinate (high byte) \ \ Stored as the altitude in feet x 4 \ \ Shown on indicator 2 \ \ Set to (0 10) in ResetVariables \ \ Stored as a 32-bit value (yPlaneTop yPlaneHi yPlaneLo \ yPlaneBot) .zPlaneHi SKIP 1 \ Plane latitude/z-coordinate (high byte) \ \ Set to &485C in ResetVariables \ \ Stored as a 32-bit value (zPlaneTop zPlaneHi zPlaneLo \ zPlaneBot)