mirror of
https://github.com/Pecusx/scorch_src.git
synced 2026-05-21 21:34:20 +02:00
wip: inventory shows weapons #26
This commit is contained in:
BIN
Binary file not shown.
+33
-45
@@ -244,8 +244,6 @@ AfterManualPurchase
|
|||||||
ldx tankNr
|
ldx tankNr
|
||||||
lda TankStatusColoursTable,x
|
lda TankStatusColoursTable,x
|
||||||
sta colpf2s
|
sta colpf2s
|
||||||
lda activeWeapon,x
|
|
||||||
sta PositionOnTheList
|
|
||||||
|
|
||||||
; we are clearing list of the weapons
|
; we are clearing list of the weapons
|
||||||
mva #$ff LastWeapon
|
mva #$ff LastWeapon
|
||||||
@@ -284,24 +282,27 @@ AfterPurchase
|
|||||||
; in xbyte there is the address of the line that
|
; in xbyte there is the address of the line that
|
||||||
; is being processed now
|
; is being processed now
|
||||||
mwa #ListOfWeapons xbyte
|
mwa #ListOfWeapons xbyte
|
||||||
ldx #$00 ; number of the checked weapon
|
ldx #$00 ; index of the checked weapon
|
||||||
stx HowManyOnTheList1 ; amounts of weapons (shells, bullets) in both lists
|
stx HowManyOnTheList1 ; amounts of weapons (shells, bullets) in both lists
|
||||||
stx HowManyOnTheList2
|
stx HowManyOnTheList2
|
||||||
|
|
||||||
; Creating full list of the available weapons for displaying
|
; Creating full list of the available weapons for displaying
|
||||||
; in X there is a number of the weapon to be checked,
|
; in X there is an index of the weapon to be checked,
|
||||||
; in 'Xbyte' address of the first char in filled screen line
|
; in 'Xbyte' address of the first char in filled screen line
|
||||||
|
|
||||||
CreateList
|
CreateList
|
||||||
|
stx temp ; number of weapon will be necessary later
|
||||||
; checking if the weapon of the given number is present
|
; checking if the weapon of the given number is present
|
||||||
lda WeaponUnits,x
|
lda WeaponUnits,x
|
||||||
jeq NoWeapon
|
jeq NoWeapon
|
||||||
|
|
||||||
|
ldy tanknr
|
||||||
|
|
||||||
bit isInventory
|
bit isInventory
|
||||||
;bmi itIsInventory
|
bmi itIsInventory
|
||||||
|
|
||||||
; checking if we can afford buying this weapon
|
; checking if we can afford buying this weapon
|
||||||
ldy tanknr
|
|
||||||
lda moneyH,y
|
lda moneyH,y
|
||||||
cmp WeaponPriceH,x
|
cmp WeaponPriceH,x
|
||||||
bne @+
|
bne @+
|
||||||
@@ -312,11 +313,23 @@ CreateList
|
|||||||
bcs notInventory
|
bcs notInventory
|
||||||
|
|
||||||
itIsInventory
|
itIsInventory
|
||||||
|
lda TanksWeaponsTableL,y
|
||||||
|
sta temp2
|
||||||
|
lda TanksWeaponsTableH,y
|
||||||
|
sta temp2+1
|
||||||
|
ldy temp
|
||||||
|
lda (temp2),y
|
||||||
|
jeq noWeapon
|
||||||
|
|
||||||
|
txa ; lda weapon index
|
||||||
|
cmp activeWeapon,y
|
||||||
|
sne:sta PositionOnTheList
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
notInventory
|
notInventory
|
||||||
; we have enough cash and the weapon can be
|
; we have enough cash and the weapon can be
|
||||||
; added to the list
|
; added to the list
|
||||||
stx temp ; number of weapon will be necessary later
|
|
||||||
|
|
||||||
; first parentheses and other special chars
|
; first parentheses and other special chars
|
||||||
; (it's easier this way)
|
; (it's easier this way)
|
||||||
@@ -341,53 +354,31 @@ notInventory
|
|||||||
ldy #$4 ; 4 chars from the beginning of the line
|
ldy #$4 ; 4 chars from the beginning of the line
|
||||||
sta (xbyte),y
|
sta (xbyte),y
|
||||||
|
|
||||||
;now number of purchased units (shells)
|
;now number of units (shells) to be purchased
|
||||||
clc
|
|
||||||
lda xbyte
|
adw xbyte #23 displayposition ; 23 chars from the beginning of the line
|
||||||
adc #23 ; 23 chars from the beginning of the line
|
|
||||||
sta displayposition
|
|
||||||
lda xbyte+1
|
|
||||||
adc #$00
|
|
||||||
sta displayposition+1
|
|
||||||
lda WeaponUnits,x
|
lda WeaponUnits,x
|
||||||
sta decimal
|
sta decimal
|
||||||
jsr displaybyte
|
jsr displaybyte
|
||||||
ldx temp ;getting back number of the weapon
|
ldx temp ;getting back number of the weapon
|
||||||
|
|
||||||
; and now price of the weapon
|
; and now price of the weapon
|
||||||
clc
|
adw xbyte #27 displayposition ; 27 chars from the beginning of the line
|
||||||
lda xbyte
|
|
||||||
adc #27 ; 27 chars from the beginning of the line
|
|
||||||
sta displayposition
|
|
||||||
lda xbyte+1
|
|
||||||
adc #$00
|
|
||||||
sta displayposition+1
|
|
||||||
lda WeaponPriceL,x
|
lda WeaponPriceL,x
|
||||||
sta decimal
|
sta decimal
|
||||||
lda WeaponPriceH,x
|
lda WeaponPriceH,x
|
||||||
sta decimal+1
|
sta decimal+1
|
||||||
jsr displaydec
|
jsr displaydec
|
||||||
|
|
||||||
lda temp ;getting back number of the weapon
|
lda temp ; weapon number again
|
||||||
pha ;and saving it on the stack
|
|
||||||
|
|
||||||
jsr HowManyBullets
|
jsr HowManyBullets
|
||||||
sta decimal
|
sta decimal
|
||||||
|
|
||||||
pla
|
adw xbyte #1 displayposition
|
||||||
sta temp ; let's store weapon number again
|
|
||||||
|
|
||||||
clc
|
|
||||||
lda xbyte
|
|
||||||
adc #1 ; 1 char from the beginning of the screen
|
|
||||||
sta displayposition
|
|
||||||
lda xbyte+1
|
|
||||||
adc #$00
|
|
||||||
sta displayposition+1
|
|
||||||
jsr displaybyte
|
jsr displaybyte
|
||||||
|
|
||||||
; and now name of the weapon and finisheeeedd !!!!
|
; and now name of the weapon and finisheeeedd !!!!
|
||||||
ldx temp ;weapon number
|
ldx temp ;weapon index
|
||||||
mva #0 temp+1 ; this number is only in X
|
mva #0 temp+1 ; this number is only in X
|
||||||
; times 16 (it's length of the names of weapons)
|
; times 16 (it's length of the names of weapons)
|
||||||
ldy #3 ; Rotate 4 times
|
ldy #3 ; Rotate 4 times
|
||||||
@@ -399,7 +390,7 @@ notInventory
|
|||||||
|
|
||||||
adw temp #NamesOfWeapons-6 modify
|
adw temp #NamesOfWeapons-6 modify
|
||||||
|
|
||||||
ldy #6 ; from 6th char
|
ldy #6 ; from 6th char on screen
|
||||||
|
|
||||||
@
|
@
|
||||||
lda (modify),y
|
lda (modify),y
|
||||||
@@ -409,7 +400,7 @@ notInventory
|
|||||||
bne @-
|
bne @-
|
||||||
|
|
||||||
|
|
||||||
; in X there is what we need
|
; in X there is what we need (weapon index)
|
||||||
|
|
||||||
; If on screen after the purchase there is still
|
; If on screen after the purchase there is still
|
||||||
; present the weapon purchased recently,
|
; present the weapon purchased recently,
|
||||||
@@ -440,12 +431,7 @@ SecondList
|
|||||||
inc HowManyOnTheList2
|
inc HowManyOnTheList2
|
||||||
; If everything is copied then next line
|
; If everything is copied then next line
|
||||||
NextLineOfTheList
|
NextLineOfTheList
|
||||||
clc
|
adw xbyte #40
|
||||||
lda xbyte
|
|
||||||
adc #40
|
|
||||||
sta xbyte
|
|
||||||
bcc TooLittleCash
|
|
||||||
inc xbyte+1
|
|
||||||
TooLittleCash
|
TooLittleCash
|
||||||
NoWeapon
|
NoWeapon
|
||||||
|
|
||||||
@@ -671,6 +657,8 @@ SecondSelected
|
|||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
weaponPtr = temp
|
weaponPtr = temp
|
||||||
isPriceZero = tempXRoller
|
isPriceZero = tempXRoller
|
||||||
|
bit isInventory
|
||||||
|
bmi @+
|
||||||
|
|
||||||
lda WhichList
|
lda WhichList
|
||||||
bne PurchaseDeffensive
|
bne PurchaseDeffensive
|
||||||
|
|||||||
Reference in New Issue
Block a user