Skip to content

Commit

Permalink
sensible angles work!
Browse files Browse the repository at this point in the history
  • Loading branch information
pkali committed Jul 3, 2022
1 parent 6ece262 commit e9a59b1
Show file tree
Hide file tree
Showing 6 changed files with 161 additions and 169 deletions.
156 changes: 76 additions & 80 deletions constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -70,32 +70,6 @@ pmtableH
.by >(pmgraph+$700)
.by >(pmgraph+$300)
;-----------
; this table changes Angle to the appropriate tank character
BarrelTableL
.by $02,$02,$02,$02,$02,$02,$02,$02
.by $04,$04,$04,$04,$04,$04,$04,$04
.by $06,$06,$06,$06,$06,$06,$06,$06,$06
.by $08,$08,$08,$08,$08,$08,$08,$08
.by $0a,$0a,$0a,$0a,$0a,$0a,$0a,$0a
.by $0c,$0c,$0c,$0c,$0c,$0c,$0c,$0c,$0c
.by $0e,$0e,$0e,$0e,$0e,$0e,$0e,$0e
.by $10,$10,$10,$10,$10,$10,$10,$10
.by $12,$12,$12,$12,$12,$12,$12,$12,$12
.by $14,$14,$14,$14,$14,$14,$14,$14
.by $16,$16,$16,$16,$16,$16,$16,$16
BarrelTableR
.by $2c,$2c,$2c,$2c,$2c,$2c,$2c,$2c
.by $2a,$2a,$2a,$2a,$2a,$2a,$2a,$2a
.by $28,$28,$28,$28,$28,$28,$28,$28,$28
.by $26,$26,$26,$26,$26,$26,$26,$26
.by $24,$24,$24,$24,$24,$24,$24,$24
.by $22,$22,$22,$22,$22,$22,$22,$22,$22
.by $20,$20,$20,$20,$20,$20,$20,$20
.by $1e,$1e,$1e,$1e,$1e,$1e,$1e,$1e
.by $1c,$1c,$1c,$1c,$1c,$1c,$1c,$1c,$1c
.by $1a,$1a,$1a,$1a,$1a,$1a,$1a,$1a
.by $18,$18,$18,$18,$18,$18,$18,$18

sintable
.by 0
.by 4
Expand Down Expand Up @@ -221,67 +195,89 @@ SlideLeftTable
.BY %00000111
.BY %00001100

;-----------------------------------------------------------
; this table changes Angle to the appropriate tank character
BarrelTable

.by $2C,$2C,$2C,$2C,$2C,$2C,$2C,$2C,$2A,$2A,
.by $2A,$2A,$2A,$2A,$2A,$2A,$28,$28,$28,$28,
.by $28,$28,$28,$28,$28,$26,$26,$26,$26,$26,
.by $26,$26,$26,$24,$24,$24,$24,$24,$24,$24,
.by $24,$22,$22,$22,$22,$22,$22,$22,$22,$22,
.by $20,$20,$20,$20,$20,$20,$20,$20,$1E,$1E,
.by $1E,$1E,$1E,$1E,$1E,$1E,$1C,$1C,$1C,$1C,
.by $1C,$1C,$1C,$1C,$1C,$1A,$1A,$1A,$1A,$1A,
.by $1A,$1A,$1A,$18,$18,$18,$18,$18,$18,$18,
;.by $18,

.by $16,$16,$16,$16,$16,$16,$16,$16,$14,$14,
.by $14,$14,$14,$14,$14,$14,$12,$12,$12,$12,
.by $12,$12,$12,$12,$12,$10,$10,$10,$10,$10,
.by $10,$10,$10,$0E,$0E,$0E,$0E,$0E,$0E,$0E,
.by $0E,$0C,$0C,$0C,$0C,$0C,$0C,$0C,$0C,$0C,
.by $0A,$0A,$0A,$0A,$0A,$0A,$0A,$0A,$08,$08,
.by $08,$08,$08,$08,$08,$08,$06,$06,$06,$06,
.by $06,$06,$06,$06,$06,$04,$04,$04,$04,$04,
.by $04,$04,$04,$02,$02,$02,$02,$02,$02,$02,
.by $02,

EndOfTheBarrelX
; right angles from 0 (vertically up) to 90 (horizontally to the right)
.by 4,4,4,4,4,4,4,4,4,4,4
.by 5,5,5,5,5,5,5,5,5,5
.by 6,6,6,6,6,6,6,6,6
.by 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
.by 7,7,7,7,7,7,7,7,7
.by 7,7,7,7,7,7,7,7,7,7
.by 7,7,7,7,7,7,7,7,7,7,7,7,7
.by 7,7,7,7,7,7,7,7,7,7,7,7,7,7
; right angles from 0 (horizontally right) to 90 (up)

.by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0 ; not used
.by 7,7,7,7,7,7,7,7,7,7,
.by 7,7,7,7,7,7,7,7,7,7,
.by 7,7,7,7,7,7,7,7,7,7,
.by 7,7,7,7,7,7,7,7,7,7,
.by 7,7,7,7,7,7,7,7,7,7,
.by 7,7,7,7,7,7,7,7,7,7,
.by 7,6,6,6,6,6,6,6,6,6,
.by 5,5,5,5,5,5,5,5,5,5,
.by 4,4,4,4,4,4,4,4,4,4,
;.by 4,

; left angles from 90 (horizontally to the left) to 1 (vertically up)
.by 0,0,0,0,0,0,0,0,0,0,0,0,0,0
.by 0,0,0,0,0,0,0,0,0,0,0,0,0
.by 0,0,0,0,0,0,0,0,0,0
.by 0,0,0,0,0,0,0,0,0
.by 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.by 1,1,1,1,1,1,1,1,1
.by 2,2,2,2,2,2,2,2,2,2
.by 3,3,3,3,3,3,3,3,3,3,3
; left angles from 90 (vertical) to 180 (horizontally left)
.by 3,3,3,3,3,3,3,3,3,3,
.by 3,2,2,2,2,2,2,2,2,2,
.by 2,1,1,1,1,1,1,1,1,1,
.by 0,0,0,0,0,0,0,0,0,0,
.by 0,0,0,0,0,0,0,0,0,0,
.by 0,0,0,0,0,0,0,0,0,0,
.by 0,0,0,0,0,0,0,0,0,0,
.by 0,0,0,0,0,0,0,0,0,0,
.by 0,0,0,0,0,0,0,0,0,0,
.by 0

EndOfTheBarrelY
; right angles from 0 (vertically up) to 90 (horizontally to the right)
.by 7,7,7,7,7,7,7,7,7,7,7
.by 7,7,7,7,7,7,7,7,7,7
.by 7,7,7,7,7,7,7,7,7
.by 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
.by 6,6,6,6,6,6,6,6,6
.by 5,5,5,5,5,5,5,5,5,5
.by 4,4,4,4,4,4,4,4,4,4,4,4,4
.by 4,4,4,4,4,4,4,4,4,4,4,4,4,4 ; one pixel Up for fix problems with colision check
; .by 3,3,3,3,3,3,3,3,3,3,3,3,3,3
; right angles from 0 (horizontally right) to 90 (up)

; one pixel Up for fix problems with colision check
;.by 3,3,3,3,3,3,3,3,3,3,3,3,3,3
.by 4,4,4,4,4,4,4,4,4,4,
.by 4,4,4,4,4,4,4,4,4,4,
.by 4,4,4,4,4,4,4,5,5,5,
.by 5,5,5,5,5,5,5,6,6,6,
.by 6,6,6,6,6,6,7,7,7,7,
.by 7,7,7,7,7,7,7,7,7,7,
.by 7,7,7,7,7,7,7,7,7,7,
.by 7,7,7,7,7,7,7,7,7,7,
.by 7,7,7,7,7,7,7,7,7,7,
;.by 7,

; left angles from 90 (vertical) to 180 (horizontally left)

.by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0 ; not used
.by 7,7,7,7,7,7,7,7,7,7,
.by 7,7,7,7,7,7,7,7,7,7,
.by 7,7,7,7,7,7,7,7,7,7,
.by 7,7,7,7,7,7,7,7,7,7,
.by 7,7,7,7,7,6,6,6,6,6,
.by 6,6,6,6,5,5,5,5,5,5,
.by 5,5,5,5,4,4,4,4,4,4,
.by 4,4,4,4,4,4,4,4,4,4,
.by 4,4,4,4,4,4,4,4,4,4,
.by 4,
; one pixel Up for fix problems with colision check
;.by 3,3,3,3,3,3,3,3,3,3,3,3,3,3

; left angles from 90 (horizontally to the left) to 1 (vertically up)
; .by 3,3,3,3,3,3,3,3,3,3,3,3,3,3
.by 4,4,4,4,4,4,4,4,4,4,4,4,4,4 ; one pixel Up for fix problems with colision check
.by 4,4,4,4,4,4,4,4,4,4,4,4,4
.by 5,5,5,5,5,5,5,5,5,5
.by 6,6,6,6,6,6,6,6,6
.by 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
.by 7,7,7,7,7,7,7,7,7
.by 7,7,7,7,7,7,7,7,7,7
.by 7,7,7,7,7,7,7,7,7,7,7

;-------------------------------------------------
TanksNamesDefault
Expand Down
13 changes: 1 addition & 12 deletions grafproc.asm
Original file line number Diff line number Diff line change
Expand Up @@ -619,19 +619,8 @@ SkipRemovigPM


lda AngleTable,x
bmi AngleToLeft01
lda #90
sec
sbc AngleTable,x
tay
lda BarrelTableR,y
jmp CharacterAlreadyKnown
AngleToLeft01
sec
sbc #(255-90)
tay
lda BarrelTableL,y
CharacterAlreadyKnown
lda BarrelTable,y
sta CharCode
DrawTankNrX
ldx tanknr
Expand Down
8 changes: 4 additions & 4 deletions scorch.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1079,9 +1079,9 @@ UsageLoop
bcs RandomizeAngle


sta temp
lda #90 ; CARRY=0 here
sbc temp
;sta temp
;lda #90 ; CARRY=0 here
;sbc temp

rts
.endp
Expand Down Expand Up @@ -1347,7 +1347,7 @@ font4x4
ins 'artwork/font4x4s.bmp',+62
;----------------------------------------------
TankFont
ins 'artwork/tanks.fnt'
ins 'artwork/tanksv2.fnt'
;----------------------------------------------
icl 'variables.asm'
;----------------------------------------------
Expand Down
Binary file modified scorch.xex
Binary file not shown.
39 changes: 21 additions & 18 deletions textproc.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,7 @@ CheckNextLevel
.proc displaydec ;decimal (word), displayposition (word)
;--------------------------------------------------
; displays decimal number as in parameters (in text mode)
; leading zeores are removed
; leading zeroes are removed
; the range is (0000..9999 - two bytes)

ldy #3 ; there will be 4 digits
Expand Down Expand Up @@ -1907,33 +1907,36 @@ NoShieldEnergy
ldx TankNr
lda AngleTable,x
bmi AngleToLeft
lda #$7f ; (tab) character
sta textbuffer+40+25
lda #0 ;space
sta textbuffer+40+22
lda #90
sec
sbc AngleTable,x

lda AngleTable,x
sta decimal
;lda #$7f ; (tab) character
;sta textbuffer+40+25
lda #0 ;space
;sta textbuffer+40+22
sta decimal+1 ; angle is single byte, but displayed with displaydec (word) routine
;lda #90
;sec
;sbc AngleTable,x
tay
lda BarrelTableR,y
lda BarrelTable,y
sta CharCode
bne AngleDisplay ;like jmp, because code always <>0
AngleToLeft
sec
sbc #(255-90)
;sec
;sbc #(255-90)
sta decimal
tay
lda BarrelTableL,y
lda BarrelTable,y
sta CharCode
lda #$7e ;(del) char
sta textbuffer+40+22
lda #0 ;space
sta textbuffer+40+25
;lda #$7e ;(del) char
;sta textbuffer+40+22
;lda #0 ;space
;sta textbuffer+40+25

AngleDisplay
mwa #textbuffer+40+23 displayposition
jsr displaybyte
mwa #textbuffer+40+21 displayposition
jsr displaydec

;=========================
;display Wind
Expand Down
Loading

0 comments on commit e9a59b1

Please sign in to comment.