Purchase AI uses bit tables instead bytes

This commit is contained in:
Pecusx
2022-08-07 13:50:38 +02:00
parent c1b16cd1d1
commit 5b90bc571e
3 changed files with 61 additions and 130 deletions
+19 -2
View File
@@ -858,7 +858,15 @@ PurchaseAIRoutines
; TankNr in X
; DOES NOT CHANGE X
tay
lda PurchaseMeTable2,y
sta temp+1
:3 lsr ; A=A/8
sta temp
tya
and #%00000111
tay
lda bittable,y
ldy temp
and PurchaseMeTable2,y
beq TryToPurchaseOnePiece.SorryNoPurchase
jmp TryToPurchaseOnePiece.PurchaseIt
.endp
@@ -868,9 +876,18 @@ PurchaseAIRoutines
; TankNr in X
; DOES NOT CHANGE X
tay
lda PurchaseMeTable,y
sta temp+1
:3 lsr ; A=A/8
sta temp
tya
and #%00000111
tay
lda bittable,y
ldy temp
and PurchaseMeTable,y
beq SorryNoPurchase
PurchaseIt
ldy temp+1
lda WeaponPriceL,y
sta temp
lda WeaponPriceH,y