Optimizations and fix for lonely weapon pointer

This commit is contained in:
Pecusx
2022-08-29 14:20:30 +02:00
parent 4a1c8aacda
commit 19820d7bf9
2 changed files with 10 additions and 20 deletions
BIN
View File
Binary file not shown.
+10 -20
View File
@@ -704,7 +704,7 @@ WeHaveOffset
ClearList1 ClearList1
cpw xbyte #ListOfWeapons1End cpw xbyte #ListOfWeapons1End
beq ListCleared1 beq ListCleared1
tya tya ; now there is zero here
sta (xbyte),y sta (xbyte),y
inw xbyte inw xbyte
jmp ClearList1 jmp ClearList1
@@ -724,26 +724,16 @@ ListCleared1
bne @- bne @-
; add to the address of the list ; add to the address of the list
clc adw xbyte #ListOfDefensiveWeapons
lda xbyte ldy #0
adc #<ListOfDefensiveWeapons
tay
lda xbyte+1
adc #>ListOfDefensiveWeapons
sta xbyte+1
stx xbyte
txa ; now there is zero here
ClearList2 ClearList2
cpw xbyte #ListOfDefensiveWeaponsEnd
beq ListCleared2
tya ; now there is zero here
sta (xbyte),y sta (xbyte),y
iny inw xbyte
bne DoNotIncHigher2 jmp ClearList2
inc xbyte+1 ListCleared2
DoNotIncHigher2
cpy #<ListOfDefensiveWeaponsEnd
bne ClearList2
ldx xbyte+1
cpx #>ListOfDefensiveWeaponsEnd
bne ClearList2
; here we have pretty cool lists and there is no brute force ; here we have pretty cool lists and there is no brute force
; screen clearing at each list refresh ; screen clearing at each list refresh
@@ -951,7 +941,7 @@ EraseLoop
sta (xbyte),y sta (xbyte),y
adw xbyte #32 ; narrow screen adw xbyte #32 ; narrow screen
dex dex
bne EraseLoop bpl EraseLoop
; now let's check which list is active now ; now let's check which list is active now
bit WhichList bit WhichList