diff --git a/Atari/textproc.asm b/Atari/textproc.asm index 79bae28..09814c9 100644 --- a/Atari/textproc.asm +++ b/Atari/textproc.asm @@ -339,28 +339,12 @@ AfterPurchase lda whichList bne PositionDefensive - -; calculate positionOnTheList from the activeWeapon (offensives) - ldx tankNr - lda activeWeapon,x - ldy #0 -@ - cmp IndexesOfWeaponsL1,y - beq ?weaponfound - iny - cpy #(last_offensive - first_offensive )+1 ; maxOffensiveWeapons - bne @- - ; not found apparently? - ; TODO: check border case (the last weapon) - ldy #0 - beq ?weaponFound ; jmp + jsr calcPosOffensive + jmp ?weaponFound PositionDefensive jsr calcPosDefensive - ?weaponFound - ; weapon index in Y - sty positionOnTheList jsr _MakeOffsetDown ; set list screen offset ; Here we have all we need @@ -914,7 +898,7 @@ DefActivationEnd cmp IndexesOfWeaponsL2,y beq ?weaponfound iny - cpy #(last_defensive - first_defensive )+1 ; maxDefensiveWeapon + cpy #number_of_defensives ; maxDefensiveWeapon bne @- ; not found apparently? ; TODO: check border case (the last weapon) @@ -927,8 +911,10 @@ DefActivationEnd rts .endp +;-------------------------------------------------- .proc calcPosOffensive ; calculate positionOnTheList from the activeWeapon (defensives) +;-------------------------------------------------- ldx tankNr lda ActiveWeapon,x beq ?noWeaponActive @@ -937,7 +923,7 @@ DefActivationEnd cmp IndexesOfWeaponsL1,y beq ?weaponfound iny - cpy #(last_offensive - first_offensive ) ; maxOffensiveWeapon + cpy #number_of_offensives ; maxOffensiveWeapon bne @- ; not found apparently? ; TODO: check border case (the last weapon) diff --git a/scorch.bin b/scorch.bin index b5193bb..9491f30 100644 Binary files a/scorch.bin and b/scorch.bin differ diff --git a/scorch.xex b/scorch.xex index 6a1331a..45c8e66 100644 Binary files a/scorch.xex and b/scorch.xex differ