New (drawto) barrels finished

This commit is contained in:
Pecusx
2022-07-27 20:55:14 +02:00
parent 47dcfa1af4
commit a01af2a608
4 changed files with 31 additions and 31 deletions
Binary file not shown.
+21 -21
View File
@@ -203,29 +203,29 @@ SlideLeftTable
;----------------------------------------------------------- ;-----------------------------------------------------------
; this table changes Angle to the appropriate tank character ; this table changes Angle to the appropriate tank character
BarrelTable ;BarrelTable
;
.by $2C,$2C,$2C,$2C,$2C,$2C,$2C,$2C,$2A,$2A, ; .by $2C,$2C,$2C,$2C,$2C,$2C,$2C,$2C,$2A,$2A,
.by $2A,$2A,$2A,$2A,$2A,$2A,$28,$28,$28,$28, ; .by $2A,$2A,$2A,$2A,$2A,$2A,$28,$28,$28,$28,
.by $28,$28,$28,$28,$28,$26,$26,$26,$26,$26, ; .by $28,$28,$28,$28,$28,$26,$26,$26,$26,$26,
.by $26,$26,$26,$24,$24,$24,$24,$24,$24,$24, ; .by $26,$26,$26,$24,$24,$24,$24,$24,$24,$24,
.by $24,$22,$22,$22,$22,$22,$22,$22,$22,$22, ; .by $24,$22,$22,$22,$22,$22,$22,$22,$22,$22,
.by $20,$20,$20,$20,$20,$20,$20,$20,$1E,$1E, ; .by $20,$20,$20,$20,$20,$20,$20,$20,$1E,$1E,
.by $1E,$1E,$1E,$1E,$1E,$1E,$1C,$1C,$1C,$1C, ; .by $1E,$1E,$1E,$1E,$1E,$1E,$1C,$1C,$1C,$1C,
.by $1C,$1C,$1C,$1C,$1C,$1A,$1A,$1A,$1A,$1A, ; .by $1C,$1C,$1C,$1C,$1C,$1A,$1A,$1A,$1A,$1A,
.by $1A,$1A,$1A,$18,$18,$18,$18,$18,$18,$18, ; .by $1A,$1A,$1A,$18,$18,$18,$18,$18,$18,$18,
;.by $18, ;.by $18,
.by $16,$16,$16,$16,$16,$16,$16,$16,$14,$14, ; .by $16,$16,$16,$16,$16,$16,$16,$16,$14,$14,
.by $14,$14,$14,$14,$14,$14,$12,$12,$12,$12, ; .by $14,$14,$14,$14,$14,$14,$12,$12,$12,$12,
.by $12,$12,$12,$12,$12,$10,$10,$10,$10,$10, ; .by $12,$12,$12,$12,$12,$10,$10,$10,$10,$10,
.by $10,$10,$10,$0E,$0E,$0E,$0E,$0E,$0E,$0E, ; .by $10,$10,$10,$0E,$0E,$0E,$0E,$0E,$0E,$0E,
.by $0E,$0C,$0C,$0C,$0C,$0C,$0C,$0C,$0C,$0C, ; .by $0E,$0C,$0C,$0C,$0C,$0C,$0C,$0C,$0C,$0C,
.by $0A,$0A,$0A,$0A,$0A,$0A,$0A,$0A,$08,$08, ; .by $0A,$0A,$0A,$0A,$0A,$0A,$0A,$0A,$08,$08,
.by $08,$08,$08,$08,$08,$08,$06,$06,$06,$06, ; .by $08,$08,$08,$08,$08,$08,$06,$06,$06,$06,
.by $06,$06,$06,$06,$06,$04,$04,$04,$04,$04, ; .by $06,$06,$06,$06,$06,$04,$04,$04,$04,$04,
.by $04,$04,$04,$02,$02,$02,$02,$02,$02,$02, ; .by $04,$04,$04,$02,$02,$02,$02,$02,$02,$02,
.by $02, ; .by $02,
;EndOfTheBarrelX ;EndOfTheBarrelX
; ; right angles from 0 (horizontally right) to 90 (up) ; ; right angles from 0 (horizontally right) to 90 (up)
+10 -10
View File
@@ -632,9 +632,12 @@ SkipHidingPM
lda AngleTable,x lda AngleTable,x
tay ldy #$50 ; left tank
lda BarrelTable,y cmp #91 ; left or right tank shape
sta CharCode bcs LeftTank
ldy #$52 ; right tank
LeftTank
sty CharCode
DrawTankNrX DrawTankNrX
ldx tanknr ldx tanknr
jsr SetupXYdraw jsr SetupXYdraw
@@ -1912,7 +1915,6 @@ X lda XtanksTableL,x
; X - tankNr ; X - tankNr
; changes xdraw, ydraw, fx, fy ; changes xdraw, ydraw, fx, fy
;-------------------------------------------------- ;--------------------------------------------------
jsr SetupXYdraw
;vx calculation ;vx calculation
;vx = sin(90-Angle) for Angle <=90 ;vx = sin(90-Angle) for Angle <=90
;vx = -sin(Angle-90) for 90 < Angle <= 180 ;vx = -sin(Angle-90) for 90 < Angle <= 180
@@ -1946,8 +1948,7 @@ X lda XtanksTableL,x
sbc #90 sbc #90
tax tax
; barrel start offset over 90deg ; barrel start offset over 90deg
adw xdraw #6 xdraw adw xdraw #5 xdraw
sbw ydraw #2 ydraw
mva #1 goleft mva #1 goleft
bpl @+ ; jmp @+ bpl @+ ; jmp @+
@@ -1957,11 +1958,10 @@ angleUnder90
sbc Angle sbc Angle
tax tax
; barrel start offset under 90deg ; barrel start offset under 90deg
adw xdraw #1 xdraw adw xdraw #3 xdraw
sbw ydraw #2 ydraw
@ @
sbw ydraw #3 ydraw
lda sintable,x ; cos(X) lda sintable,x ; cos(X)
sta vx sta vx
@@ -1994,7 +1994,7 @@ YangleUnder90
; 2. add vx and vy to 3 byte variables xdraw.fx, ydraw.fy ; 2. add vx and vy to 3 byte variables xdraw.fx, ydraw.fy
; 3 check length, if shorter, go to 1. ; 3 check length, if shorter, go to 1.
mva #20 yc ; barrel length mva #5 yc ; barrel length
barrelLoop barrelLoop
lda goleft lda goleft
BIN
View File
Binary file not shown.