PM code optimisation

This commit is contained in:
Pecusx
2022-07-14 00:13:36 +02:00
parent 9acada4e9f
commit 99d08367c4
2 changed files with 11 additions and 24 deletions
+11 -24
View File
@@ -689,51 +689,37 @@ NoMissile
cpx #$5 cpx #$5
bcs PMForTank6 bcs PMForTank6
; clear sprite and put 3 lines on the tank at the same time ; clear sprite and put 3 lines on the tank at the same time
ldx #3 ; three lines of PM
ClearPM ClearPM
cpy temp cpy temp
bne ZeroesToGo bne ZeroesToGo
lda (xbyte),y @ lda (xbyte),y
and #%11110000 ; only for equal speeds and #%11110000
ora #%00001111 ; (2 bits set) we set on two pixels in three lines
sta (xbyte),y
dey
lda (xbyte),y
and #%11110000 ; only for equal speeds
ora #%00001111 ; (2 bits set) we set on two pixels in three lines
sta (xbyte),y
dey
lda (xbyte),y
and #%11110000 ; only for equal speeds
ora #%00001111 ; (2 bits set) we set on two pixels in three lines ora #%00001111 ; (2 bits set) we set on two pixels in three lines
sta (xbyte),y sta (xbyte),y
dey dey
dex
bne @-
ZeroesToGo ZeroesToGo
lda (xbyte),y lda (xbyte),y
and #%11110000 ; only for equal speeds and #%11110000
sta (xbyte),y sta (xbyte),y
dey dey
bne ClearPM bne ClearPM
beq NoPlayerMissile beq NoPlayerMissile
PMForTank6 PMForTank6
; clear sprite and put 3 lines on the tank at the same time ; clear sprite and put 3 lines on the tank at the same time
ldx #3 ; three lines of PM
ClearPM6 ClearPM6
cpy temp cpy temp
bne ZeroesToGo6 bne ZeroesToGo6
lda (xbyte),y @ lda (xbyte),y
and #%00001111
ora #%11110000 ; (2 bits set) we set on two pixels in three lines
sta (xbyte),y
dey
lda (xbyte),y
and #%00001111
ora #%11110000 ; (2 bits set) we set on two pixels in three lines
sta (xbyte),y
dey
lda (xbyte),y
and #%00001111 and #%00001111
ora #%11110000 ; (2 bits set) we set on two pixels in three lines ora #%11110000 ; (2 bits set) we set on two pixels in three lines
sta (xbyte),y sta (xbyte),y
dey dey
dex
bne @-
ZeroesToGo6 ZeroesToGo6
lda (xbyte),y lda (xbyte),y
and #%00001111 and #%00001111
@@ -744,6 +730,7 @@ ZeroesToGo6
NoPlayerMissile NoPlayerMissile
; draw defensive weapons like shield ( tank number in X ) ; draw defensive weapons like shield ( tank number in X )
; in xdraw, ydraw we have coordinates left LOWER corner of Tank char ; in xdraw, ydraw we have coordinates left LOWER corner of Tank char
ldx TankNr
lda ActiveDefenceWeapon,x lda ActiveDefenceWeapon,x
cmp #ind_Shield_________ ; one shot shield cmp #ind_Shield_________ ; one shot shield
beq DrawTankShield beq DrawTankShield
BIN
View File
Binary file not shown.