mirror of
https://github.com/deater/dos33fsprogs.git
synced 2025-01-12 00:30:31 +00:00
plasma: optimizing
This commit is contained in:
parent
07b1effec2
commit
fbc5c1fdb0
@ -9,7 +9,7 @@ all: plasma.dsk
|
|||||||
plasma.dsk: HELLO PLASMA
|
plasma.dsk: HELLO PLASMA
|
||||||
cp empty.dsk plasma.dsk
|
cp empty.dsk plasma.dsk
|
||||||
$(DOS33) -y plasma.dsk SAVE A HELLO
|
$(DOS33) -y plasma.dsk SAVE A HELLO
|
||||||
$(DOS33) -y plasma.dsk BSAVE -a 0x1000 PLASMA
|
$(DOS33) -y plasma.dsk BSAVE -a 0xC00 PLASMA
|
||||||
|
|
||||||
###
|
###
|
||||||
|
|
||||||
@ -19,9 +19,9 @@ HELLO: hello.bas
|
|||||||
###
|
###
|
||||||
|
|
||||||
PLASMA: plasma.o
|
PLASMA: plasma.o
|
||||||
ld65 -o PLASMA plasma.o -C $(LINKERSCRIPTS)/apple2_1000.inc
|
ld65 -o PLASMA plasma.o -C $(LINKERSCRIPTS)/apple2_c00.inc
|
||||||
|
|
||||||
plasma.o: plasma.s gr_plot.s gr_scrn.s
|
plasma.o: plasma.s
|
||||||
ca65 -o plasma.o plasma.s -l plasma.lst
|
ca65 -o plasma.o plasma.s -l plasma.lst
|
||||||
|
|
||||||
###
|
###
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
; do a (hopefully fast) plasma
|
; do a (hopefully fast) plasma
|
||||||
|
|
||||||
; 151
|
; 151 -- original
|
||||||
|
; 137 -- optimize generation
|
||||||
|
|
||||||
.include "zp.inc"
|
.include "zp.inc"
|
||||||
.include "hardware.inc"
|
.include "hardware.inc"
|
||||||
@ -22,34 +23,36 @@ SAVEY = $FF
|
|||||||
sta DRAW_PAGE
|
sta DRAW_PAGE
|
||||||
|
|
||||||
;col = ( 8.0 + (sintable[xx&0xf])
|
;col = ( 8.0 + (sintable[xx&0xf])
|
||||||
; + 8.0 + (sintable[yy&0xf])
|
; + 8.0 + (sintable[yy&0xf])
|
||||||
; ) / 2;
|
; ) / 2;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ldy #0
|
ldy #0
|
||||||
|
sty SAVEOFF
|
||||||
create_yloop:
|
create_yloop:
|
||||||
ldx #0
|
ldx #0
|
||||||
create_xloop:
|
create_xloop:
|
||||||
|
; lda SAVEOFF
|
||||||
|
; and #$f
|
||||||
|
; tax
|
||||||
|
|
||||||
clc
|
clc
|
||||||
lda #15
|
lda #15
|
||||||
adc sinetable,X
|
adc sinetable,X
|
||||||
adc sinetable,Y
|
adc sinetable,Y
|
||||||
lsr
|
lsr
|
||||||
lookup_smc:
|
lookup_smc:
|
||||||
|
stx SAVEX
|
||||||
|
ldx SAVEOFF
|
||||||
sta lookup,X
|
sta lookup,X
|
||||||
|
ldx SAVEX
|
||||||
|
|
||||||
|
inc SAVEOFF
|
||||||
inx
|
inx
|
||||||
cpx #16
|
cpx #16
|
||||||
bne create_xloop
|
bne create_xloop
|
||||||
|
|
||||||
clc
|
|
||||||
lda lookup_smc+1
|
|
||||||
adc #16
|
|
||||||
sta lookup_smc+1
|
|
||||||
lda #0
|
|
||||||
adc lookup_smc+2
|
|
||||||
sta lookup_smc+2
|
|
||||||
|
|
||||||
iny
|
iny
|
||||||
cpy #16
|
cpy #16
|
||||||
bne create_yloop
|
bne create_yloop
|
||||||
@ -89,6 +92,7 @@ plot_xloop:
|
|||||||
tax
|
tax
|
||||||
lda lookup,X
|
lda lookup,X
|
||||||
and #$f
|
and #$f
|
||||||
|
lsr
|
||||||
tax
|
tax
|
||||||
lda colorlookup,X
|
lda colorlookup,X
|
||||||
|
|
||||||
@ -116,7 +120,8 @@ sinetable:
|
|||||||
.byte $00,$FD,$FB,$F9,$F8,$F9,$FB,$FD
|
.byte $00,$FD,$FB,$F9,$F8,$F9,$FB,$FD
|
||||||
|
|
||||||
colorlookup:
|
colorlookup:
|
||||||
.byte $00,$00,$05,$05,$07,$07,$0f,$0f
|
;.byte $00,$00,$05,$05,$07,$07,$0f,$0f
|
||||||
.byte $07,$07,$06,$06,$02,$02,$05,$05
|
;.byte $07,$07,$06,$06,$02,$02,$05,$05
|
||||||
|
.byte $00,$05,$07,$0f,$07,$06,$02,$05
|
||||||
|
|
||||||
lookup:
|
lookup:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user