Better laser timing

This commit is contained in:
Pecusx
2022-07-16 21:10:45 +02:00
parent 6b0d8aa287
commit 738faec7e2
2 changed files with 18 additions and 7 deletions
BIN
View File
Binary file not shown.
+16 -5
View File
@@ -675,18 +675,29 @@ DiggerCharacter
sbc #$00
sta ybyte+1
mva #0 drawFunction
mwa xdraw LaserCoordinate
mwa ydraw LaserCoordinate+2
mwa xbyte LaserCoordinate+4
mwa ybyte LaserCoordinate+6
mva #sfx_lightning sfx_effect
mva #51 yc ; laser blink counter
mva #%10000000 drawFunction
;the above switches Draw to measuring length
jsr draw
mva #0 drawFunction
lsr LineLength+1 ; LineLength / 8
ror LineLength
lsr LineLength ; max line lenght is about 380 (9 bits)
lsr LineLength
sec
lda #60
sbc LineLength
sta yc ; laser blink counter 60-(LineLength/8)
@
lda yc
and #$01
eor #$01
sta color
mwa LaserCoordinate xdraw
mwa LaserCoordinate+2 ydraw
@@ -695,8 +706,8 @@ DiggerCharacter
mva #sfx_lightning sfx_effect
jsr draw
dec:lda yc
bpl @-
dec yc
bne @-
mva #1 color
mwa LaserCoordinate xdraw