Clear weapon list before redraw

Better descriptions of new procedures and fix for bug in drawmountains (C64)
This commit is contained in:
Pecusx
2023-06-13 10:56:52 +02:00
parent acec79fee7
commit 54c627b3b5
7 changed files with 57 additions and 17 deletions
+23 -7
View File
@@ -193,13 +193,13 @@ ClearPlot
.proc drawmountains .proc drawmountains
;-------------------------------------------------- ;--------------------------------------------------
mwa #0 xdraw mwa #0 xdraw
mwa #mountaintable modify mwa #mountaintable modify ; mountaintable pointer
mva #1 color mva #1 color
drawmountainsloop drawmountainsloop
jsr DrawMountainLine jsr DrawMountainLine ; draws column of mountains (one pixel wide)
inw modify inw modify
inw xdraw inw xdraw ; naxt column
cpw xdraw #screenwidth cpw xdraw #screenwidth
bne drawmountainsloop bne drawmountainsloop
rts rts
@@ -217,20 +217,20 @@ NotLower
dey dey
bpl @- bpl @-
sta temp2 sta temp2
inc temp2 ; this is our minimum inc temp2 ; this is our minimum (in one byte wide - 8 columns)
bit ClearSky bit ClearSky
bpl NoClearSky bpl NoClearSky
; Clear Sky ; Clear Sky
mwa #0 ydraw mwa #0 ydraw
jsr plot.MakePlot jsr plot.MakePlot ; after plot we have: (xbyte),y - addres of screen byte
@ lda #$ff @ lda #$ff
sta (xbyte),y sta (xbyte),y
adw xbyte #screenBytes adw xbyte #screenBytes ; next line
inc ydraw inc ydraw
lda ydraw lda ydraw
cmp #screenheight cmp #screenheight
beq NoClearSky beq NoClearSky
cmp temp2 cmp temp2 ; our minimum height od sky
bne @- bne @-
NoClearSky NoClearSky
MinCalculated MinCalculated
@@ -274,6 +274,22 @@ MinCalculated
bne @- bne @-
NotFillBytes NotFillBytes
.ELSE .ELSE
bit ClearSky
bpl NoClearSky
; Clear Sky
ldy #0
lda (modify),y
sta ydraw
sty ydraw+1
sty color
clearline
jsr plot.MakePlot
dec ydraw
lda ydraw
cmp #$ff
bne clearline
mva #1 color
NoClearSky
ldy #0 ldy #0
lda (modify),y lda (modify),y
cmp #screenheight cmp #screenheight
+21
View File
@@ -343,6 +343,7 @@ AfterPurchase
; in xbyte there is the address of the line that ; in xbyte there is the address of the line that
; is being processed now ; is being processed now
mwa #ListOfWeapons xbyte mwa #ListOfWeapons xbyte
jsr ClearLists ; fast lists clear
ldx #$00 ; index of the checked weapon ldx #$00 ; index of the checked weapon
stx HowManyOnTheListOff ; amounts of weapons (shells, bullets) in both lists stx HowManyOnTheListOff ; amounts of weapons (shells, bullets) in both lists
stx HowManyOnTheListDef stx HowManyOnTheListDef
@@ -1015,6 +1016,26 @@ NoArrowDown
sty MoreDowndl+1 sty MoreDowndl+1
rts rts
.endp .endp
;--------------------------------------------------
.proc ClearLists
;--------------------------------------------------
ldy #<ListOfWeapons
lda #0
sta temp2
lda #>ListOfWeapons
sta temp2+1
Go lda #$0
loop sta (temp2),y
iny
bne @+
inc temp2+1
@ cpy #<ListOfDefensiveWeaponsEnd
bne loop
ldx temp2+1
cpx #>ListOfDefensiveWeaponsEnd
bne loop
rts
.endp
; ----------------------------------------------------- ; -----------------------------------------------------
.proc EnterPlayerNames .proc EnterPlayerNames
;entering names of players ;entering names of players
+13 -6
View File
@@ -184,6 +184,13 @@ ClearPlot
mva #1 color mva #1 color
drawmountainsloop drawmountainsloop
jsr DrawMountainLine
inw modify
inw xdraw
cpw xdraw #screenwidth
jne drawmountainsloop
rts
DrawMountainLine
.IF FASTER_GRAF_PROCS = 1 .IF FASTER_GRAF_PROCS = 1
; calculate lower point in one screen byte ; calculate lower point in one screen byte
lda xdraw lda xdraw
@@ -200,14 +207,12 @@ NotLower
sta temp2 sta temp2
inc temp2 ; this is our minimum inc temp2 ; this is our minimum
MinCalculated MinCalculated
.ENDIF
ldy #0 ldy #0
lda (modify),y lda (modify),y
cmp #screenheight cmp #screenheight
beq NoMountain beq NoMountain
sta ydraw sta ydraw
sty ydraw+1 sty ydraw+1
.IF FASTER_GRAF_PROCS = 1
; there was Drawline proc ; there was Drawline proc
lda #screenheight lda #screenheight
sec sec
@@ -274,6 +279,12 @@ MinCalculated
bne @- bne @-
NotFillBytes NotFillBytes
.ELSE .ELSE
ldy #0
lda (modify),y
cmp #screenheight
beq NoMountain
sta ydraw
sty ydraw+1
; there was Drawline proc ; there was Drawline proc
drawline drawline
jsr plot.MakePlot jsr plot.MakePlot
@@ -284,10 +295,6 @@ drawline
; end of Drawline proc ; end of Drawline proc
.ENDIF .ENDIF
NoMountain NoMountain
inw modify
inw xdraw
cpw xdraw #screenwidth
jne drawmountainsloop
rts rts
.endp .endp
;-------------------------------------------------- ;--------------------------------------------------
-4
View File
@@ -1328,13 +1328,11 @@ NoClearTanks
jsr plot jsr plot
.IF TARGET >= 800 .IF TARGET >= 800
.IF FASTER_GRAF_PROCS = 1
lda FastSoilDown lda FastSoilDown
beq @+ beq @+
jmp SoilDownTurbo.NoClearTanks jmp SoilDownTurbo.NoClearTanks
@ @
.ENDIF .ENDIF
.ENDIF
; First we look for highest pixels and fill with their coordinates ; First we look for highest pixels and fill with their coordinates
; both tables ; both tables
@@ -1378,13 +1376,11 @@ FoundPeek1
; main loop starts here ; main loop starts here
MainFallout2 MainFallout2
.IF TARGET = 800 .IF TARGET = 800
.IF FASTER_GRAF_PROCS = 1
lda CONSOL lda CONSOL
and #%00000001 ; START KEY and #%00000001 ; START KEY
bne NoFastDown bne NoFastDown
jmp SoilDownTurbo.NoClearTanks jmp SoilDownTurbo.NoClearTanks
NoFastDown NoFastDown
.ENDIF
.ENDIF .ENDIF
mwa RangeLeft xdraw mwa RangeLeft xdraw
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.