mirror of
https://github.com/pkali/scorch_src.git
synced 2026-05-20 22:34:21 +02:00
Significant acceleration of drawing mountains on C64 :)
This commit is contained in:
+1
-1
@@ -204,7 +204,7 @@ drawmountainsloop
|
|||||||
sta ydraw
|
sta ydraw
|
||||||
sty ydraw+1
|
sty ydraw+1
|
||||||
.IF FASTER_GRAF_PROCS = 1
|
.IF FASTER_GRAF_PROCS = 1
|
||||||
; calculate lower opoint in one screen byte
|
; calculate lower point in one screen byte
|
||||||
lda xdraw
|
lda xdraw
|
||||||
and #%00000111 ; only every 8th pixel
|
and #%00000111 ; only every 8th pixel
|
||||||
bne MinCalculated
|
bne MinCalculated
|
||||||
|
|||||||
+45
-2
@@ -191,6 +191,22 @@ drawmountainsloop
|
|||||||
sta ydraw
|
sta ydraw
|
||||||
sty ydraw+1
|
sty ydraw+1
|
||||||
.IF FASTER_GRAF_PROCS = 1
|
.IF FASTER_GRAF_PROCS = 1
|
||||||
|
; calculate lower point in one screen byte
|
||||||
|
lda xdraw
|
||||||
|
and #%00000111 ; only every 8th pixel
|
||||||
|
bne MinCalculated
|
||||||
|
; A=0
|
||||||
|
ldy #7
|
||||||
|
@ cmp (modify),y
|
||||||
|
bcs NotLower
|
||||||
|
lda (modify),y
|
||||||
|
NotLower
|
||||||
|
dey
|
||||||
|
bpl @-
|
||||||
|
sta temp2
|
||||||
|
inc temp2 ; this is our minimum
|
||||||
|
iny
|
||||||
|
MinCalculated
|
||||||
; there was Drawline proc
|
; there was Drawline proc
|
||||||
lda #screenheight
|
lda #screenheight
|
||||||
sec
|
sec
|
||||||
@@ -222,10 +238,37 @@ drawmountainsloop
|
|||||||
lda linetableH,y
|
lda linetableH,y
|
||||||
adc xdraw+1
|
adc xdraw+1
|
||||||
sta xbyte+1
|
sta xbyte+1
|
||||||
|
tya
|
||||||
ldy #0
|
ldy #0
|
||||||
dec tempbyte01
|
cmp temp2 ; this is our minimum
|
||||||
bne @-
|
bne @-
|
||||||
; end of Drawline proc
|
; end of Drawline proc
|
||||||
|
; and now fill bytes!
|
||||||
|
lda xdraw
|
||||||
|
and #%00000111 ; only every 8th pixel
|
||||||
|
bne NotFillBytes
|
||||||
|
; A=0 is here
|
||||||
|
dec ydraw ; protection if temp2=screenheight
|
||||||
|
@ lda #0
|
||||||
|
tay
|
||||||
|
sta (xbyte),y
|
||||||
|
inc ydraw
|
||||||
|
lda xdraw
|
||||||
|
; lda xdraw
|
||||||
|
; and #%11111000
|
||||||
|
;sta xbyte
|
||||||
|
;---
|
||||||
|
ldy ydraw
|
||||||
|
clc
|
||||||
|
adc linetableL,y
|
||||||
|
sta xbyte
|
||||||
|
lda linetableH,y
|
||||||
|
adc xdraw+1
|
||||||
|
sta xbyte+1
|
||||||
|
tya
|
||||||
|
cmp #screenheight
|
||||||
|
bne @-
|
||||||
|
NotFillBytes
|
||||||
.ELSE
|
.ELSE
|
||||||
; there was Drawline proc
|
; there was Drawline proc
|
||||||
drawline
|
drawline
|
||||||
@@ -240,7 +283,7 @@ NoMountain
|
|||||||
inw modify
|
inw modify
|
||||||
inw xdraw
|
inw xdraw
|
||||||
cpw xdraw #screenwidth
|
cpw xdraw #screenwidth
|
||||||
bne drawmountainsloop
|
jne drawmountainsloop
|
||||||
rts
|
rts
|
||||||
.endp
|
.endp
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user