.GetLaserPattern LDA #0 ; Set A to the return value for pattern 140 (for the ; mining laser) CPX #Armlas ; If the laser power in X is equal to a military laser, BEQ glsp3 ; jump to glsp3 to the return value for pattern 152 CPX #POW+128 ; If the laser power in X is equal to a beam laser, BEQ glsp2 ; jump to glsp2 to the return value for pattern 144 CPX #Mlas ; If the laser power in X is equal to a mining laser, BNE glsp1 ; jump to glsp2 to the return value for pattern 140 LDA #8 ; If we get here then this must be a pulse laser, so ; set A to the return value for pattern 148 .glsp1 RTS ; Return from the subroutine .glsp2 LDA #4 ; This is a beam laser, so set A to the return value for ; pattern 145 RTS ; Return from the subroutine .glsp3 LDA #12 ; This is a military laser, so set A to the return value ; for pattern 152 RTS ; Return from the subroutineName: GetLaserPattern [Show more] Type: Subroutine Category: Equipment Summary: Get the pattern number for a specific laser's equipment spriteContext: See this subroutine in context in the source code References: This subroutine is called as follows: * DrawEquipment calls GetLaserPattern
Arguments: X The laser power
Returns: A The pattern number for the first sprite for this type of laser, minus 140, so we return: * 0 (for pattern 140) for the mining laser * 4 (for pattern 144) for the beam laser * 8 (for pattern 148) for the pulse laser * 12 (for pattern 152) for the military laser
[X]
Configuration variable Armlas = INT(128.5 + 1.5*POW)
Military laser power
[X]
Configuration variable Mlas = 50
Mining laser power
[X]
Configuration variable POW = 15
Pulse laser power in the NES version is POW + 9, rather than just POW in the other versions (all other lasers are the same)
[X]
Label glsp1 is local to this routine
[X]
Label glsp2 is local to this routine
[X]
Label glsp3 is local to this routine