Hovercraft texts display optimization

This commit is contained in:
Pecusx
2023-05-20 12:58:42 +02:00
parent ff465e11f0
commit 0becca7a87
3 changed files with 22 additions and 29 deletions
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+22 -29
View File
@@ -2498,14 +2498,7 @@ StoreMaxAlt
mva #sfx_plasma_2_2 sfx_effect mva #sfx_plasma_2_2 sfx_effect
; display text 4x4 - fuel full ; display text 4x4 - fuel full
jsr SetFuelFullText
mwa #hoverFull LineAddress4x4
mwa #((ScreenWidth/2)-((hoverFullEnd-hoverFull)*2)) LineXdraw ; centering
mva #hoverFullEnd-hoverFull fx ; length
sec
lda FloatingAlt
sbc #12
sta LineYdraw
jsr TypeLine4x4.variableLength jsr TypeLine4x4.variableLength
ldx TankNr ldx TankNr
@@ -2546,13 +2539,7 @@ ReachSky
jsr DrawTankRocketEngine jsr DrawTankRocketEngine
; display text 4x4 - fuel full (clear text) ; display text 4x4 - fuel full (clear text)
mwa #hoverFull LineAddress4x4 jsr SetFuelFullText
mwa #((ScreenWidth/2)-((hoverFullEnd-hoverFull)*2)) LineXdraw ; centering
mva #(hoverFullEnd-hoverFull) fx ; length
sec
lda FloatingAlt
sbc #12
sta LineYdraw
lda #$00 lda #$00
jsr TypeLine4x4.staplot4x4color jsr TypeLine4x4.staplot4x4color
; and Soildown at the start (for correct mountaintable if tank was buried) ; and Soildown at the start (for correct mountaintable if tank was buried)
@@ -2591,13 +2578,7 @@ KeyboardAndJoyCheck
bne LotOfFuel bne LotOfFuel
; display text 4x4 - low fuel ; display text 4x4 - low fuel
mwa #hoverEmpty LineAddress4x4 jsr SetLowFuelText
mwa #((ScreenWidth/2)-((hoverEmptyEnd-hoverEmpty)*2)) LineXdraw ; centering
mva #hoverEmptyEnd-hoverEmpty fx ; length
sec
lda FloatingAlt
sbc #12
sta LineYdraw
jsr TypeLine4x4.variableLength jsr TypeLine4x4.variableLength
LotOfFuel LotOfFuel
@@ -2700,13 +2681,7 @@ DrawFloatingTank
pressedSpace pressedSpace
; display text 4x4 - low fuel (clear text) ; display text 4x4 - low fuel (clear text)
mwa #hoverEmpty LineAddress4x4 jsr SetLowFuelText
mwa #((ScreenWidth/2)-((hoverEmptyEnd-hoverEmpty)*2)) LineXdraw ; centering
mva #hoverEmptyEnd-hoverEmpty fx ; length
sec
lda FloatingAlt
sbc #12
sta LineYdraw
lda #$00 lda #$00
jsr TypeLine4x4.staplot4x4color jsr TypeLine4x4.staplot4x4color
ldx TankNr ldx TankNr
@@ -2866,6 +2841,24 @@ CalculateSoildown
mva #$04 ExplosionRadius mva #$04 ExplosionRadius
jsr CalculateExplosionRange jsr CalculateExplosionRange
rts rts
SetFuelFullText
mwa #hoverFull LineAddress4x4
mwa #((ScreenWidth/2)-((hoverFullEnd-hoverFull)*2)) LineXdraw ; centering
mva #hoverFullEnd-hoverFull fx ; length
bne SetTextLevel ; !! length<>0
sec
SetLowFuelText
mwa #hoverEmpty LineAddress4x4
mwa #((ScreenWidth/2)-((hoverEmptyEnd-hoverEmpty)*2)) LineXdraw ; centering
mva #hoverEmptyEnd-hoverEmpty fx ; length
SetTextLevel
sec
lda FloatingAlt
sbc #12
sta LineYdraw
rts
.endp .endp
; ------------------------------------------------- ; -------------------------------------------------