IA code optimisation

and "better" shields shapes.
This commit is contained in:
Pecusx
2022-07-13 09:06:37 +02:00
parent 6868eb8626
commit 9ece051472
3 changed files with 14 additions and 16 deletions
+10 -12
View File
@@ -186,16 +186,15 @@ EnoughEnergy
beq NoUseDefensive beq NoUseDefensive
lda (temp),y ; has address of TanksWeaponsTable lda (temp),y ; has address of TanksWeaponsTable
beq @- beq @-
tya ; decrease in inventory
clc
sbc #1
sta (temp),y ; has address of TanksWeaponsTable
; activate defensive weapon ; activate defensive weapon
tya ; number of selectet defensive weapon
sta ActiveDefenceWeapon,x sta ActiveDefenceWeapon,x
lda DefensiveEnergy,y lda DefensiveEnergy,y
sta ShieldEnergy,x sta ShieldEnergy,x
; decrease in inventory
clc
lda (temp),y
sbc #1
sta (temp),y ; has address of TanksWeaponsTable
NoUseDefensive NoUseDefensive
DefensiveInUse DefensiveInUse
firstShoot firstShoot
@@ -300,16 +299,15 @@ AngleTable ; 16 bytes ;ba w $348b L$3350
beq NoUseDefensive beq NoUseDefensive
lda (temp),y ; has address of TanksWeaponsTable lda (temp),y ; has address of TanksWeaponsTable
beq @- beq @-
tya ; decrease in inventory
clc
sbc #1
sta (temp),y ; has address of TanksWeaponsTable
; activate defensive weapon ; activate defensive weapon
tya ; number of selectet defensive weapon
sta ActiveDefenceWeapon,x sta ActiveDefenceWeapon,x
lda DefensiveEnergy,y lda DefensiveEnergy,y
sta ShieldEnergy,x sta ShieldEnergy,x
; decrease in inventory
clc
lda (temp),y
sbc #1
sta (temp),y
DefensiveInUse DefensiveInUse
NoUseDefensive NoUseDefensive
; Toosser is like Poolshark but allways uses defensives ; Toosser is like Poolshark but allways uses defensives
+4 -4
View File
@@ -774,7 +774,7 @@ ShieldVisible
dec temp dec temp
bne @- bne @-
; draw left oblique line of shield ( / ) ; draw left oblique line of shield ( / )
mva #4 temp mva #3 temp
@ @
jsr plot jsr plot
.nowarn dew ydraw .nowarn dew ydraw
@@ -782,14 +782,14 @@ ShieldVisible
dec temp dec temp
bne @- bne @-
; draw top horizontal line of shield ( _ ) ; draw top horizontal line of shield ( _ )
mva #5 temp mva #7 temp
@ @
jsr plot jsr plot
inw xdraw inw xdraw
dec temp dec temp
bne @- bne @-
; draw right oblique line of shield ( \ ) ; draw right oblique line of shield ( \ )
mva #4 temp mva #3 temp
@ @
jsr plot jsr plot
inw ydraw inw ydraw
@@ -831,7 +831,7 @@ ShieldVisible
; Symbol of ablative shield ? :) ; Symbol of ablative shield ? :)
;-------------------------------------------------- ;--------------------------------------------------
sbw xdraw #$04 ; 5 pixels left sbw xdraw #$04 ; 5 pixels left
sbw ydraw #$0a ; 10 pixels up sbw ydraw #$0b ; 11 pixels up
; draw additional top horizontal line of shield ( _ ) ; draw additional top horizontal line of shield ( _ )
mva #6 temp mva #6 temp
@ @
BIN
View File
Binary file not shown.