Corrected offset at the long list of weapons.

This commit is contained in:
Pecusx
2022-11-16 22:38:54 +01:00
parent b6dd5a9902
commit 1bc3b3b72f
3 changed files with 10 additions and 3 deletions
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+10 -3
View File
@@ -377,6 +377,7 @@ PositionDefensive
?weaponFound ?weaponFound
; weapon index in Y ; weapon index in Y
sty positionOnTheList sty positionOnTheList
jsr _MakeOffsetDown ; set list screen offset
; Here we have all we need ; Here we have all we need
; So choose the weapon for purchase ...... ; So choose the weapon for purchase ......
@@ -449,18 +450,23 @@ GoDownOffensive
sty PositionOnTheList sty PositionOnTheList
beq MakeOffsetUp beq MakeOffsetUp
MakeOffsetDown MakeOffsetDown
jsr _MakeOffsetDown
EndGoDownX
jmp ChoosingItemForPurchase
_MakeOffsetDown
lda OffsetDL1 lda OffsetDL1
clc clc
adc #15 adc #15
;if offset+16 is lower than the position then it must =16 ;if offset+16 is lower than the position then it must =16
cmp PositionOnTheList cmp PositionOnTheList
bcs EndGoDownX bcs _EndGoDownX
sec sec
lda PositionOnTheList lda PositionOnTheList
sbc #15 sbc #15
sta OffsetDL1 sta OffsetDL1
EndGoDownX _EndGoDownX
jmp ChoosingItemForPurchase rts
; swapping the displayed list and setting pointer to position 0 ; swapping the displayed list and setting pointer to position 0
ListChange ListChange
@@ -476,6 +482,7 @@ ListChange
beq @+ beq @+
; inventory ; inventory
jsr calcPosOffensive jsr calcPosOffensive
jsr _MakeOffsetDown ; set list screen offset
jmp ChoosingItemForPurchase jmp ChoosingItemForPurchase
@ @
mva #0 PositionOnTheList mva #0 PositionOnTheList