FOX PLOTS FASTER

This commit is contained in:
2022-07-13 17:18:34 -04:00
parent 9806613f2f
commit 9acada4e9f
2 changed files with 43 additions and 52 deletions
+20 -29
View File
@@ -1334,8 +1334,8 @@ EndOfUnPlot
; game. If you are going to speed up the game, start with ; game. If you are going to speed up the game, start with
; plot - it is used by every single effect starting from explosions ; plot - it is used by every single effect starting from explosions
; through line drawing and small text output!!! ; through line drawing and small text output!!!
; We tried to keep it clear and therefore it is far from ;
; optimal speed. ; Optimized by 0xF (Fox) THXXXX!!!
; ----------------------------------------- ; -----------------------------------------
; is it not over the screen ??? ; is it not over the screen ???
@@ -1346,28 +1346,24 @@ CheckX02
bcs EndOfPlot ;nearest RTS bcs EndOfPlot ;nearest RTS
MakePlot MakePlot
; let's calculate coordinates from xdraw and ydraw ; let's calculate coordinates from xdraw and ydraw
mwa xdraw xbyte
lda xbyte
and #$7
sta ybit
;xbyte = xbyte/8 ;xbyte = xbyte/8
lda xbyte lda xdraw+1
lsr xbyte+1 lsr
lda xdraw
ror ;just one bit over 256. Max screenwidth = 512!!! ror ;just one bit over 256. Max screenwidth = 512!!!
lsr lsr
lsr lsr
tay ;save sta xbyte
;--- ;---
ldx ydraw ldx ydraw
lda linetableL,x ldy linetableL,x
sta xbyte
lda linetableH,x lda linetableH,x
sta xbyte+1 sta xbyte+1
ldx ybit lda xdraw
and #$7
tax
lda color lda color
bne ClearPlot bne ClearPlot
@@ -1390,35 +1386,30 @@ ClearPlot
; result is in A (zero or appropriate bit is set) ; result is in A (zero or appropriate bit is set)
; let's calculate coordinates from xdraw and ydraw ; let's calculate coordinates from xdraw and ydraw
mwa xdraw xbyte
lda xbyte
and #$7
sta ybit
;xbyte = xbyte/8 ;xbyte = xbyte/8
lda xbyte lda xdraw+1
lsr xbyte+1 lsr
lda xdraw
ror ;just one bit over 256. Max screenwidht = 512!!! ror ;just one bit over 256. Max screenwidht = 512!!!
lsr lsr
lsr lsr
tay ;save sta xbyte
;--- ;---
ldx ydraw ldx ydraw
lda linetableL,x ldy linetableL,x
sta xbyte
lda linetableH,x lda linetableH,x
sta xbyte+1 sta xbyte+1
ldx ybit lda xdraw
and #$7
tax
lda (xbyte),y lda (xbyte),y
eor #$ff
and bittable,x and bittable,x
eor bittable,x
rts rts
.endp .endp;--------------------------------------------------
;--------------------------------------------------
.proc DrawLine .proc DrawLine
;-------------------------------------------------- ;--------------------------------------------------
mva #0 ydraw+1 mva #0 ydraw+1
+3 -3
View File
@@ -10,9 +10,9 @@
dma = %100000 dma = %100000
.ende .ende
scr48 = @dmactl(wide|dma|players|missiles|lineX1) ;screen 48b scr48 = @dmactl(wide|dma|players|missiles|lineX1)
scr40 = @dmactl(standard|dma|players|missiles|lineX1) ;screen 40b scr40 = @dmactl(standard|dma|players|missiles|lineX1)
scr32 = @dmactl(narrow|dma|players|missiles|lineX1) ;screen 32b scr32 = @dmactl(narrow|dma|players|missiles|lineX1)
.enum @pmcntl .enum @pmcntl
missiles= %1 missiles= %1