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
|
||||
cp empty.dsk plasma.dsk
|
||||
$(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
|
||||
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
|
||||
|
||||
###
|
||||
|
@ -1,6 +1,7 @@
|
||||
; do a (hopefully fast) plasma
|
||||
|
||||
; 151
|
||||
; 151 -- original
|
||||
; 137 -- optimize generation
|
||||
|
||||
.include "zp.inc"
|
||||
.include "hardware.inc"
|
||||
@ -22,34 +23,36 @@ SAVEY = $FF
|
||||
sta DRAW_PAGE
|
||||
|
||||
;col = ( 8.0 + (sintable[xx&0xf])
|
||||
; + 8.0 + (sintable[yy&0xf])
|
||||
; ) / 2;
|
||||
; + 8.0 + (sintable[yy&0xf])
|
||||
; ) / 2;
|
||||
|
||||
|
||||
|
||||
ldy #0
|
||||
sty SAVEOFF
|
||||
create_yloop:
|
||||
ldx #0
|
||||
create_xloop:
|
||||
; lda SAVEOFF
|
||||
; and #$f
|
||||
; tax
|
||||
|
||||
clc
|
||||
lda #15
|
||||
adc sinetable,X
|
||||
adc sinetable,Y
|
||||
lsr
|
||||
lookup_smc:
|
||||
stx SAVEX
|
||||
ldx SAVEOFF
|
||||
sta lookup,X
|
||||
ldx SAVEX
|
||||
|
||||
inc SAVEOFF
|
||||
inx
|
||||
cpx #16
|
||||
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
|
||||
cpy #16
|
||||
bne create_yloop
|
||||
@ -89,6 +92,7 @@ plot_xloop:
|
||||
tax
|
||||
lda lookup,X
|
||||
and #$f
|
||||
lsr
|
||||
tax
|
||||
lda colorlookup,X
|
||||
|
||||
@ -116,7 +120,8 @@ sinetable:
|
||||
.byte $00,$FD,$FB,$F9,$F8,$F9,$FB,$FD
|
||||
|
||||
colorlookup:
|
||||
.byte $00,$00,$05,$05,$07,$07,$0f,$0f
|
||||
.byte $07,$07,$06,$06,$02,$02,$05,$05
|
||||
;.byte $00,$00,$05,$05,$07,$07,$0f,$0f
|
||||
;.byte $07,$07,$06,$06,$02,$02,$05,$05
|
||||
.byte $00,$05,$07,$0f,$07,$06,$02,$05
|
||||
|
||||
lookup:
|
||||
|
Loading…
x
Reference in New Issue
Block a user