Statusbar display improvements - robo-tanks.

This commit is contained in:
Pecusx
2022-07-05 15:02:52 +02:00
parent a353e3bdb9
commit d0838fa163
3 changed files with 52 additions and 53 deletions
+50 -51
View File
@@ -1887,57 +1887,6 @@ ActiveDefence
NoDefenceWeapon
NoShieldEnergy
;=========================
;display Force
;=========================
ldx TankNr
lda ForceTableL,x
sta decimal
lda ForceTableH,x
sta decimal+1
mwa #textbuffer+40+36 displayposition
jsr displaydec
;=========================
;display Angle
;=========================
; additionally we are getting charcode of the tank
; (for future display)
ldx TankNr
lda AngleTable,x
cmp #90
beq VerticallyUp
bcs AngleToLeft
AngleToRight
; now we have values from 0 to 89 and right angle
sta decimal
lda #$7f ; (tab) character
sta textbuffer+40+25
lda #0 ;space
sta textbuffer+40+22
beq AngleDisplay
AngleToLeft
sec
lda #180
sbc AngleTable,x
; angles 180 - 91 converted to 0 - 89
sta decimal
lda #$7e ;(del) char
sta textbuffer+40+22
lda #0 ;space
sta textbuffer+40+25
beq AngleDisplay
VerticallyUp
; now we have value 90
sta decimal
lda #0 ;space
sta textbuffer+40+25
sta textbuffer+40+22
AngleDisplay
mwa #textbuffer+40+23 displayposition
jsr displaybyte
;=========================
;display Wind
;=========================
@@ -1975,6 +1924,56 @@ DisplayWindValue
sta decimal
mwa #textbuffer+80+7 displayposition
jsr displaybyte ;decimal (byte), displayposition (word)
;=========================
;display Force
;=========================
ldx TankNr
lda ForceTableL,x
sta decimal
lda ForceTableH,x
sta decimal+1
mwa #textbuffer+40+36 displayposition
jsr displaydec
;=========================
;display Angle
;=========================
displayAngle
ldx TankNr
lda AngleTable,x
cmp #90
beq VerticallyUp
bcs AngleToLeft
AngleToRight
; now we have values from 0 to 89 and right angle
sta decimal
lda #$7f ; (tab) character
sta textbuffer+40+25
lda #0 ;space
sta textbuffer+40+22
beq AngleDisplay
AngleToLeft
sec
lda #180
sbc AngleTable,x
; angles 180 - 91 converted to 0 - 89
sta decimal
lda #$7e ;(del) char
sta textbuffer+40+22
lda #0 ;space
sta textbuffer+40+25
beq AngleDisplay
VerticallyUp
; now we have value 90
sta decimal
lda #0 ;space
sta textbuffer+40+25
sta textbuffer+40+22
AngleDisplay
mwa #textbuffer+40+23 displayposition
jsr displaybyte
rts
.endp