wrong inventory position fix

This commit is contained in:
2022-06-25 10:29:12 -04:00
parent 2c98d73877
commit 42facad64e
4 changed files with 23 additions and 22 deletions
BIN
View File
Binary file not shown.
+19 -15
View File
@@ -287,8 +287,8 @@ AfterPurchase
; is being processed now ; is being processed now
mwa #ListOfWeapons xbyte mwa #ListOfWeapons xbyte
ldx #$00 ; index of the checked weapon ldx #$00 ; index of the checked weapon
stx HowManyOnTheList1 ; amounts of weapons (shells, bullets) in both lists stx HowManyOnTheListOff ; amounts of weapons (shells, bullets) in both lists
stx HowManyOnTheList2 stx HowManyOnTheListDef
; Creating full list of the available weapons for displaying ; Creating full list of the available weapons for displaying
; in X there is an index of the weapon to be checked, ; in X there is an index of the weapon to be checked,
@@ -437,25 +437,25 @@ notInventory
bne NotTheSameAsLastTime bne NotTheSameAsLastTime
lda WhichList lda WhichList
bne @+ bne @+
lda HowManyOnTheList1 lda HowManyOnTheListOff
sta PositionOnTheList sta PositionOnTheList
jmp NotTheSameAsLastTime jmp NotTheSameAsLastTime
@ @
lda HowManyOnTheList2 lda HowManyOnTheListDef
sta PositionOnTheList sta PositionOnTheList
NotTheSameAsLastTime NotTheSameAsLastTime
; increase appropriate counter ; increase appropriate counter
txa txa
cpx #$30 cpx #$30
bcs DefenceList bcs DefenceList
ldy HowManyOnTheList1 ldy HowManyOnTheListOff
sta IndexesOfWeaponsL1,y sta IndexesOfWeaponsL1,y
inc HowManyOnTheList1 inc HowManyOnTheListOff
bne NextLineOfTheList bne NextLineOfTheList
DefenceList DefenceList
ldy HowManyOnTheList2 ldy HowManyOnTheListDef
sta IndexesOfWeaponsL2,y sta IndexesOfWeaponsL2,y
inc HowManyOnTheList2 inc HowManyOnTheListDef
; If everything is copied then next line ; If everything is copied then next line
NextLineOfTheList NextLineOfTheList
adw xbyte #40 adw xbyte #40
@@ -491,7 +491,7 @@ WeHaveOffset
; of the first erased char. ; of the first erased char.
; (multiplying taken from book of Ruszczyc 'Assembler 6502' ; (multiplying taken from book of Ruszczyc 'Assembler 6502'
lda HowManyOnTheList1 lda HowManyOnTheListOff
sta xbyte+1 ; multiplier (temporarily here, it will be erased anyway) sta xbyte+1 ; multiplier (temporarily here, it will be erased anyway)
lda #$00 ; higher byte of the Result lda #$00 ; higher byte of the Result
sta xbyte ; lower byte of the Result sta xbyte ; lower byte of the Result
@@ -534,7 +534,7 @@ DoNotIncHigher1
; Multiply number on list 1 by 40 and set address ; Multiply number on list 1 by 40 and set address
; of the first erased char. ; of the first erased char.
lda HowManyOnTheList2 lda HowManyOnTheListDef
sta xbyte+1 ; multiplier sta xbyte+1 ; multiplier
lda #$00 ; higher byte of the Result lda #$00 ; higher byte of the Result
sta xbyte ; lower byte of the Result sta xbyte ; lower byte of the Result
@@ -658,17 +658,17 @@ PurchaseKeyDown
lda WhichList lda WhichList
beq GoDown1 beq GoDown1
inc:lda PositionOnTheList inc:lda PositionOnTheList
cmp HowManyOnTheList2 cmp HowManyOnTheListDef
bne EndGoDownX bne EndGoDownX
ldy HowManyOnTheList2 ldy HowManyOnTheListDef
dey dey
sty PositionOnTheList sty PositionOnTheList
jmp ChoosingItemForPurchase jmp ChoosingItemForPurchase
GoDown1 GoDown1
inc:lda PositionOnTheList inc:lda PositionOnTheList
cmp HowManyOnTheList1 cmp HowManyOnTheListOff
bne MakeOffsetDown bne MakeOffsetDown
ldy HowManyOnTheList1 ldy HowManyOnTheListOff
dey dey
sty PositionOnTheList sty PositionOnTheList
MakeOffsetDown MakeOffsetDown
@@ -837,6 +837,8 @@ DefActivationEnd
?noWeaponActive ?noWeaponActive
ldy #0 ldy #0
?weaponFound ?weaponFound
cpy howManyOnTheListDef
bcs ?noWeaponActive
sty positionOnTheList sty positionOnTheList
rts rts
.endp .endp
@@ -858,6 +860,8 @@ DefActivationEnd
?noWeaponActive ?noWeaponActive
ldy #0 ldy #0
?weaponFound ?weaponFound
cpy howManyOnTheListOff
bcs ?noWeaponActive
sty positionOnTheList sty positionOnTheList
rts rts
.endp .endp
@@ -934,7 +938,7 @@ NoArrowUp
stx MoreUpdl stx MoreUpdl
sty MoreUpdl+1 sty MoreUpdl+1
; the same, bu scrolling down ; the same, bu scrolling down
lda HowManyOnTheList1 lda HowManyOnTheListOff
ldx #<EmptyLine ldx #<EmptyLine
ldy #>EmptyLine ldy #>EmptyLine
sec sec
+2 -2
View File
@@ -256,9 +256,9 @@ IndexesOfWeaponsL2
; variables storing amount of weapons on the first and second ; variables storing amount of weapons on the first and second
; list and pointer position ; list and pointer position
HowManyOnTheList1 HowManyOnTheListOff
.DS 1 .DS 1
HowManyOnTheList2 HowManyOnTheListDef
.DS 1 .DS 1
PositionOnTheList ; pointer position on the list being displayed PositionOnTheList ; pointer position on the list being displayed
.DS 1 .DS 1
+2 -5
View File
@@ -33,7 +33,7 @@ ExplosionRoutines
.word VOID-1 ;napalm .word VOID-1 ;napalm
.word VOID-1 ;hotnapalm .word VOID-1 ;hotnapalm
.word tracer-1 .word tracer-1
.word VOID-1 ;smoketracer .word tracer-1 ;smoketracer
.word babyroller-1 .word babyroller-1
.word roller-1 .word roller-1
.word heavyroller-1 .word heavyroller-1
@@ -57,6 +57,7 @@ ExplosionRoutines
.word laser-1 .word laser-1
VOID VOID
tracer
rts rts
.endp .endp
; ------------------------ ; ------------------------
@@ -264,10 +265,6 @@ NoLowerCircle
rts rts
.endp .endp
; ------------------------ ; ------------------------
.proc tracer
rts
.endp
; ------------------------
.proc babyroller .proc babyroller
inc FallDown2 inc FallDown2
mva #11 ExplosionRadius mva #11 ExplosionRadius