.AddTempToPoint LDA xTemp1Lo \ Set point X's x-coordinate to the following: CLC \ ADC xPointLo,Y \ (xTemp1Hi xTemp1Lo) + (xPointHi+Y xPointLo+Y) STA xPointLo,X \ LDA xTemp1Hi \ i.e. we add xTemp1 and point Y's x-coordinate ADC xPointHi,Y STA xPointHi,X PHP \ Store the flags for the x-axis addition on the stack, \ so we can check them in part 2 CLC \ Set point X's y-coordinate to the following: LDA yTemp1Lo \ ADC yPointLo,Y \ (yTemp1Hi yTemp1Lo) + (yPointHi+Y yPointLo+Y) STA yPointLo,X \ LDA yTemp1Hi \ i.e. we add yTemp1 and point Y's y-coordinate ADC yPointHi,Y STA yPointHi,X PHP \ Store the flags for the y-axis addition on the stack, \ so we can check them in part 2 CLC \ Set point X's z-coordinate to the following: LDA zTemp1Lo \ ADC zPointLo,Y \ (zTemp1Hi zTemp1Lo) + (zPointHi+Y zPointLo+Y) STA zPointLo,X \ LDA zTemp1Hi \ i.e. we add zTemp1 and point Y's z-coordinate ADC zPointHi,Y STA zPointHi,X JMP addv1 \ Jump to part 2 to set showLine according to the \ overflow flag from each of the results (so if any axes \ overflow, we hide the line containing the point) NOP \ This instruction is not used; perhaps at one point the \ JMP above was a JSR instruction, and this was an RTS?Name: AddTempToPoint (Part 1 of 2) [Show more] Type: Subroutine Category: 3D geometry Summary: Add the xTemp1 vector to a point, store the result in another point, and set the result to hidden if it overflowsContext: See this subroutine in context in the source code References: This subroutine is called as follows: * FireGuns calls AddTempToPoint * ProcessRunwayLine (Part 2 of 5) calls AddTempToPoint * ProcessRunwayLine (Part 4 of 5) calls AddTempToPoint * ProcessRunwayLine (Part 5 of 5) calls AddTempToPoint
Set point X to the sum of the xTemp1 vector and point Y. In other words, add the following: (xTemp1 yTemp1 zTemp1) + point Y's coordinate in (xPoint, yPoint, zPoint) and store the results in point X's coordinate in (xPoint, yPoint, zPoint). We also set showLine to "hidden" if the addition overflows in any of the axes.
Arguments: X The ID of the point in which to store the result Y The ID of the point to add to the xTemp1 vector
Returns: showLine If the calculation overflows, then the coordinate does not fit within the boundaries of Aviator's 3D world, so bit 6 is set to indicate that the line containing this point should not be shown
[X]
Label addv1 in subroutine AddTempToPoint (Part 2 of 2)
[X]
Variable xPointHi (category: 3D geometry)
High byte of the x-coordinate for a point
[X]
Variable xPointLo in workspace Main variable workspace
The low byte of the x-coordinate for the point with ID X is at xPointLo,X
[X]
Variable xTemp1Hi in workspace Main variable workspace
The high byte of the xTemp1 temporary variable
[X]
Variable xTemp1Lo in workspace Main variable workspace
The low byte of the xTemp1 temporary variable
[X]
Variable yPointHi in workspace Main variable workspace
The high byte of the y-coordinate for the point with ID X is at yPointHi,X
[X]
Variable yPointLo in workspace Main variable workspace
The low byte of the y-coordinate for the point with ID X is at yPointLo,X
[X]
Variable yTemp1Hi in workspace Main variable workspace
The high byte of the yTemp1 temporary variable
[X]
Variable yTemp1Lo in workspace Main variable workspace
The low byte of the yTemp1 temporary variable
[X]
Variable zPointHi (category: 3D geometry)
High byte of the z-coordinate for a point
[X]
Variable zPointLo in workspace Main variable workspace
The low byte of the z-coordinate for the point with ID X is at zPointLo,X
[X]
Variable zTemp1Hi in workspace Main variable workspace
The high byte of the zTemp1 temporary variable
[X]
Variable zTemp1Lo in workspace Main variable workspace
The low byte of the zTemp1 temporary variable