.SIGHT LDY VIEW \ Fetch the laser power for our new view LDA LASER,Y BEQ LO2 \ If it is zero (i.e. there is no laser fitted to this \ view), jump to LO2 to return from the subroutine (as \ LO2 contains an RTS) LDY #0 \ Set Y to 0, to represent a pulse laser CMP #POW \ If the laser power in A is equal to a pulse laser, BEQ SIG1 \ jump to SIG1 with Y = 0 INY \ Increment Y to 1, to represent a beam laser CMP #POW+128 \ If the laser power in A is equal to a beam laser, BEQ SIG1 \ jump to SIG1 with Y = 1 INY \ Increment Y to 2, to represent a military laser CMP #Armlas \ If the laser power in A is equal to a military laser, BEQ SIG1 \ jump to SIG1 with Y = 2 INY \ Increment Y to 3, to represent a mining laser .SIG1 LDA SIGHTCOL,Y \ Set the colour from the SIGHTCOL table STA COL LDA #128 \ Set QQ19 to the x-coordinate of the centre of the STA QQ19 \ screen LDA #Y-24 \ Set QQ19+1 to the y-coordinate of the centre of the STA QQ19+1 \ screen, minus 24 (because TT15 will add 24 to the \ coordinate when it draws the crosshairs) LDA #20 \ Set QQ19+2 to size 20 for the crosshairs size STA QQ19+2 JSR TT15 \ Call TT15 to draw crosshairs of size 20 just to the \ left of the middle of the screen LDA #10 \ Set QQ19+2 to size 10 for the crosshairs size STA QQ19+2 JMP TT15 \ Call TT15 to draw crosshairs of size 10 at the same \ location, which will remove the centre part from the \ laser crosshairs, leaving a gap in the middle, and \ return from the subroutine using a tail callName: SIGHT [Show more] Type: Subroutine Category: Flight Summary: Draw the laser crosshairsContext: See this subroutine in context in the source code Variations: See code variations for this subroutine in the different versions References: This subroutine is called as follows: * LOOK1 calls SIGHT
[X]
Configuration variable Armlas = INT(128.5 + 1.5*POW)
Military laser power
[X]
Configuration variable POW = 15
Pulse laser power
[X]
Label SIG1 is local to this routine
[X]
Variable SIGHTCOL (category: Drawing lines)
Colours for the crosshair sights on the different laser types
[X]
Subroutine TT15 (category: Drawing lines)
Draw a set of crosshairs
[X]
Configuration variable Y = 96
The centre y-coordinate of the 256 x 192 space view