mirror of
https://github.com/pkali/scorch_src.git
synced 2026-05-20 22:34:21 +02:00
infinite purchases fix #26
This commit is contained in:
+1
-1
@@ -169,7 +169,7 @@ textbuffer
|
|||||||
dta d"Energy: Angle: Force: "
|
dta d"Energy: Angle: Force: "
|
||||||
dta d"Round: Wind: "
|
dta d"Round: Wind: "
|
||||||
textbuffer2
|
textbuffer2
|
||||||
dta d"Player: Cash: "
|
dta d"Player: Cash: 0 " ; ZERO TO MAKE YOU RICHER ON THE SCREEN
|
||||||
dta d"----------------------------------------"
|
dta d"----------------------------------------"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
BIN
Binary file not shown.
+18
-29
@@ -297,10 +297,10 @@ CreateList
|
|||||||
ldy tanknr
|
ldy tanknr
|
||||||
lda moneyH,y
|
lda moneyH,y
|
||||||
cmp WeaponPriceH,x
|
cmp WeaponPriceH,x
|
||||||
bne CheckWeapon01
|
bcc @+
|
||||||
lda moneyL,y
|
lda moneyL,y
|
||||||
cmp WeaponPriceL,x
|
cmp WeaponPriceL,x
|
||||||
CheckWeapon01
|
@
|
||||||
jcc TooLittleCash
|
jcc TooLittleCash
|
||||||
|
|
||||||
; we have enough cash and the weapon can be
|
; we have enough cash and the weapon can be
|
||||||
@@ -675,7 +675,7 @@ PurchaseAll
|
|||||||
; after getting weapon number the routine is common for all
|
; after getting weapon number the routine is common for all
|
||||||
ldx tanknr
|
ldx tanknr
|
||||||
tay ; weapon number is in Y
|
tay ; weapon number is in Y
|
||||||
beq @+
|
beq @+ ; baby missile skips all
|
||||||
sec
|
sec
|
||||||
lda moneyL,x ; substracting from posessed money
|
lda moneyL,x ; substracting from posessed money
|
||||||
sbc WeaponPriceL,y ; of price of the given weapon
|
sbc WeaponPriceL,y ; of price of the given weapon
|
||||||
@@ -683,7 +683,13 @@ PurchaseAll
|
|||||||
lda moneyH,x
|
lda moneyH,x
|
||||||
sbc WeaponPriceH,y
|
sbc WeaponPriceH,y
|
||||||
sta moneyH,x
|
sta moneyH,x
|
||||||
|
bpl positiveMoney
|
||||||
|
; zero money if money negative... not the fix you are looking for
|
||||||
|
lda #0
|
||||||
|
sta moneyL,x
|
||||||
|
sta moneyH,x
|
||||||
|
|
||||||
|
positiveMoney
|
||||||
; save info about price == 0
|
; save info about price == 0
|
||||||
lda WeaponPriceL,y
|
lda WeaponPriceL,y
|
||||||
ora WeaponPriceH,y
|
ora WeaponPriceH,y
|
||||||
@@ -719,6 +725,7 @@ LessThan100
|
|||||||
lda #0
|
lda #0
|
||||||
sta (weaponPtr),y
|
sta (weaponPtr),y
|
||||||
@
|
@
|
||||||
|
mva #0 PositionOnTheList ; to move the pointer to the top
|
||||||
jmp Purchase.AfterPurchase
|
jmp Purchase.AfterPurchase
|
||||||
.endp
|
.endp
|
||||||
|
|
||||||
@@ -730,7 +737,7 @@ LessThan100
|
|||||||
EraseLoop
|
EraseLoop
|
||||||
lda #$00
|
lda #$00
|
||||||
sta (xbyte),y
|
sta (xbyte),y
|
||||||
adw xbyte #40 xbyte
|
adw xbyte #40
|
||||||
dex
|
dex
|
||||||
bpl EraseLoop
|
bpl EraseLoop
|
||||||
|
|
||||||
@@ -743,13 +750,7 @@ EraseLoop
|
|||||||
ldx PositionOnTheList
|
ldx PositionOnTheList
|
||||||
beq SelectList2 ; if there is 0 we add nothing
|
beq SelectList2 ; if there is 0 we add nothing
|
||||||
AddLoop2
|
AddLoop2
|
||||||
clc
|
adw xbyte #40
|
||||||
lda xbyte
|
|
||||||
adc #40
|
|
||||||
sta xbyte
|
|
||||||
bcc ominx03
|
|
||||||
inc xbyte+1
|
|
||||||
ominx03
|
|
||||||
dex
|
dex
|
||||||
bne AddLoop2
|
bne AddLoop2
|
||||||
SelectList2
|
SelectList2
|
||||||
@@ -771,13 +772,7 @@ CharToList1
|
|||||||
ldx PositionOnTheList
|
ldx PositionOnTheList
|
||||||
beq SelectList1 ; if there is 0 we add nothing
|
beq SelectList1 ; if there is 0 we add nothing
|
||||||
AddLoop1
|
AddLoop1
|
||||||
clc
|
adw xbyte #40
|
||||||
lda xbyte
|
|
||||||
adc #40
|
|
||||||
sta xbyte
|
|
||||||
bcc ominx04
|
|
||||||
inc xbyte+1
|
|
||||||
ominx04
|
|
||||||
dex
|
dex
|
||||||
bne AddLoop1
|
bne AddLoop1
|
||||||
SelectList1
|
SelectList1
|
||||||
@@ -788,13 +783,7 @@ SelectList1
|
|||||||
ldx OffsetDL1
|
ldx OffsetDL1
|
||||||
beq SetWindowList1 ; if zero then add nothing
|
beq SetWindowList1 ; if zero then add nothing
|
||||||
LoopWindow1
|
LoopWindow1
|
||||||
clc
|
adw xbyte #40
|
||||||
lda xbyte
|
|
||||||
adc #40
|
|
||||||
sta xbyte
|
|
||||||
bcc ominx05
|
|
||||||
inc xbyte+1
|
|
||||||
ominx05
|
|
||||||
dex
|
dex
|
||||||
bne LoopWindow1
|
bne LoopWindow1
|
||||||
SetWindowList1
|
SetWindowList1
|
||||||
@@ -806,8 +795,8 @@ SetWindowList1
|
|||||||
ldy #>EmptyLine
|
ldy #>EmptyLine
|
||||||
lda OffsetDL1
|
lda OffsetDL1
|
||||||
beq NoArrowUp
|
beq NoArrowUp
|
||||||
ldx #<MoreUp
|
ldx #<MoreUp
|
||||||
ldy #>MoreUp
|
ldy #>MoreUp
|
||||||
NoArrowUp
|
NoArrowUp
|
||||||
stx MoreUpdl
|
stx MoreUpdl
|
||||||
sty MoreUpdl+1
|
sty MoreUpdl+1
|
||||||
@@ -820,8 +809,8 @@ NoArrowUp
|
|||||||
bmi NoArrowDown
|
bmi NoArrowDown
|
||||||
cmp OffsetDL1
|
cmp OffsetDL1
|
||||||
bcc NoArrowDown
|
bcc NoArrowDown
|
||||||
ldx #<MoreDown
|
ldx #<MoreDown
|
||||||
ldy #>MoreDown
|
ldy #>MoreDown
|
||||||
NoArrowDown
|
NoArrowDown
|
||||||
stx MoreDowndl
|
stx MoreDowndl
|
||||||
sty MoreDowndl+1
|
sty MoreDowndl+1
|
||||||
|
|||||||
Reference in New Issue
Block a user