plasma: add qkumba optimization
This commit is contained in:
parent
5e8f8881ab
commit
47dfd72f21
|
@ -1,2 +1,2 @@
|
|||
1FORI=0TO143:POKE872+I,4*PEEK(2125+I)-192+(PEEK(2269+I/3)-35)/4^(I-INT(I/3)*3):NEXT
|
||||
2&",=n9D`M1X/5Z.Ni+Mi*AS'1kD.b3kR4jjk/3bbnLX0k0j_E`>0SP.X1P2(02ImRB28=mY8J0N9:W3T/JhO;X/OoI73)mZ[/3/1BQ]g/Q<63nWoR,gb1`<QC8:JoLE0#.1+01,/omnngmo7G0S+O6::>GP'#5C`'#4RNMD%6*00),NWD4PI*+-C/Ia*Z?6*@S
|
||||
1FORI=0TO140:POKE875+I,4*PEEK(2125+I)-192+(PEEK(2266+I/3)-35)/4^(I-INT(I/3)*3):NEXT
|
||||
2&",=n9D`M1X/5Z.Ni+Mi*AS'1kE.b3kR4jjk/3bbnM[0k0j_E`>0SS.X9RB(021QoPBX+R0XlQ/5AaV9F/Q-U9I73)mZ[/3/1BQ]g/Q<63nR4j@Xb2a<VD4-[o]E0#.1+01,/omnngmo4G0S+O6::>GO'#5C\'#4Q.M)-F#UW4VWD4PI*+#K+8b*Z?6*@_
|
||||
|
|
|
@ -11,7 +11,7 @@ plasma.dsk: HELLO PLASMA PLASMA_TINY PLASMA_BOT
|
|||
$(DOS33) -y plasma.dsk SAVE A HELLO
|
||||
$(DOS33) -y plasma.dsk BSAVE -a 0x300 PLASMA
|
||||
$(DOS33) -y plasma.dsk BSAVE -a 0xC00 PLASMA_TINY
|
||||
$(DOS33) -y plasma.dsk BSAVE -a 0x368 PLASMA_BOT
|
||||
$(DOS33) -y plasma.dsk BSAVE -a 0x36B PLASMA_BOT
|
||||
|
||||
###
|
||||
|
||||
|
@ -29,7 +29,7 @@ plasma.o: plasma.s
|
|||
###
|
||||
|
||||
PLASMA_BOT: plasma_bot.o
|
||||
ld65 -o PLASMA_BOT plasma_bot.o -C ./apple2_368.inc
|
||||
ld65 -o PLASMA_BOT plasma_bot.o -C ./apple2_36b.inc
|
||||
|
||||
plasma_bot.o: plasma_bot.s
|
||||
ca65 -o plasma_bot.o plasma_bot.s -l plasma_bot.lst
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
MEMORY {
|
||||
ZP: start = $00, size = $1A, type = rw;
|
||||
RAM: start = $368, size = $8E00, file = %O;
|
||||
RAM: start = $36B, size = $8E00, file = %O;
|
||||
}
|
||||
|
||||
SEGMENTS {
|
|
@ -16,6 +16,8 @@
|
|||
; 149 -- add page flipping
|
||||
; 144 -- optimize a bit
|
||||
; 141 -- smc DRAW_PAGE
|
||||
; 139 -- from qkumba, remove php/plp
|
||||
; 138 -- from qkumba, remove SAVEX
|
||||
|
||||
; goal=135
|
||||
|
||||
|
@ -23,9 +25,6 @@
|
|||
.include "hardware.inc"
|
||||
|
||||
CTEMP = $FC
|
||||
SAVEOFF = $FD
|
||||
SAVEX = $FE
|
||||
SAVEY = $FF
|
||||
|
||||
;================================
|
||||
; Clear screen and setup graphics
|
||||
|
@ -114,6 +113,7 @@ plot_frame:
|
|||
plot_yloop:
|
||||
|
||||
txa ; get (y&0xf)<<4
|
||||
pha ; save YY
|
||||
asl
|
||||
asl
|
||||
asl
|
||||
|
@ -123,7 +123,12 @@ plot_yloop:
|
|||
txa ; get Y in accumulator
|
||||
lsr ; call actually wants Ycoord/2
|
||||
|
||||
php ; save shifted-off low bit in C for later
|
||||
|
||||
ldy #$0f ; setup mask for odd/even line
|
||||
bcc plot_mask
|
||||
ldy #$f0 ; needlessly clever, from monitor rom src
|
||||
plot_mask:
|
||||
sty MASK
|
||||
|
||||
jsr GBASCALC ; point GBASL/H to address in (A is ycoord/2)
|
||||
; after, A is GBASL, C is clear
|
||||
|
@ -133,13 +138,7 @@ draw_page_smc:
|
|||
adc #0
|
||||
sta GBASH
|
||||
|
||||
plp ; restore C, indicating odd/even row
|
||||
|
||||
lda #$0f ; setup mask for odd/even line
|
||||
bcc plot_mask
|
||||
adc #$e0 ; needlessly clever, from monitor rom src
|
||||
plot_mask:
|
||||
sta MASK
|
||||
|
||||
;==========
|
||||
|
||||
|
@ -147,8 +146,6 @@ plot_mask:
|
|||
|
||||
plot_xloop:
|
||||
|
||||
stx SAVEX ; SAVE YY
|
||||
|
||||
tya ; get x&0xf
|
||||
and #$f
|
||||
ora CTEMP ; combine with val from earlier
|
||||
|
@ -173,18 +170,22 @@ plot_lookup_smc:
|
|||
|
||||
jsr PLOT1 ; plot at GBASL,Y (x co-ord goes in Y)
|
||||
|
||||
ldx SAVEX ; restore YY
|
||||
|
||||
dey
|
||||
bpl plot_xloop
|
||||
|
||||
pla ; restore YY
|
||||
tax
|
||||
|
||||
dex
|
||||
bpl plot_yloop
|
||||
bmi forever_loop
|
||||
|
||||
colorlookup:
|
||||
bw_color_lookup:
|
||||
; blue
|
||||
.byte $55,$22,$66,$77,$ff,$77,$55 ; ,$00 shared w sin table
|
||||
; pink
|
||||
;.byte $55,$11,$33,$bb,$ff,$bb,$55 ; ,$00 shared w sin table
|
||||
|
||||
; this is actually 8*sin(x)
|
||||
sinetable:
|
||||
|
|
|
@ -17,15 +17,19 @@
|
|||
; 144 -- optimize a bit
|
||||
; 141 -- smc DRAW_PAGE
|
||||
|
||||
; 144 -- for bot, backwards jump
|
||||
; 142 -- from qkumba, remove php/plp
|
||||
; 141 -- from qkumba, remove SAVEX
|
||||
|
||||
; goal=135
|
||||
|
||||
.include "zp.inc"
|
||||
.include "hardware.inc"
|
||||
|
||||
CTEMP = $FC
|
||||
SAVEOFF = $FD
|
||||
SAVEX = $FE
|
||||
SAVEY = $FF
|
||||
;SAVEOFF = $FD
|
||||
;SAVEX = $FE
|
||||
;SAVEY = $FF
|
||||
|
||||
;================================
|
||||
; Clear screen and setup graphics
|
||||
|
@ -114,6 +118,8 @@ plot_frame:
|
|||
plot_yloop:
|
||||
|
||||
txa ; get (y&0xf)<<4
|
||||
pha ; save YY / SAVEX
|
||||
|
||||
asl
|
||||
asl
|
||||
asl
|
||||
|
@ -123,7 +129,12 @@ plot_yloop:
|
|||
txa ; get Y in accumulator
|
||||
lsr ; call actually wants Ycoord/2
|
||||
|
||||
php ; save shifted-off low bit in C for later
|
||||
|
||||
ldy #$0f ; setup mask for odd/even line
|
||||
bcc plot_mask
|
||||
ldy #$f0
|
||||
plot_mask:
|
||||
sty MASK
|
||||
|
||||
jsr GBASCALC ; point GBASL/H to address in (A is ycoord/2)
|
||||
; after, A is GBASL, C is clear
|
||||
|
@ -133,21 +144,13 @@ draw_page_smc:
|
|||
adc #0
|
||||
sta GBASH
|
||||
|
||||
plp ; restore C, indicating odd/even row
|
||||
|
||||
lda #$0f ; setup mask for odd/even line
|
||||
bcc plot_mask
|
||||
adc #$e0 ; needlessly clever, from monitor rom src
|
||||
plot_mask:
|
||||
sta MASK
|
||||
|
||||
;==========
|
||||
|
||||
ldy #39 ; XX = 39 (countdown)
|
||||
|
||||
plot_xloop:
|
||||
|
||||
stx SAVEX ; SAVE YY
|
||||
; stx SAVEX ; SAVE YY
|
||||
|
||||
tya ; get x&0xf
|
||||
and #$f
|
||||
|
@ -173,18 +176,27 @@ plot_lookup_smc:
|
|||
|
||||
jsr PLOT1 ; plot at GBASL,Y (x co-ord goes in Y)
|
||||
|
||||
ldx SAVEX ; restore YY
|
||||
; ldx SAVEX ; restore YY
|
||||
|
||||
|
||||
dey
|
||||
bpl plot_xloop
|
||||
|
||||
pla
|
||||
tax
|
||||
|
||||
dex
|
||||
bpl plot_yloop
|
||||
bmi forever_loop
|
||||
|
||||
colorlookup:
|
||||
bw_color_lookup:
|
||||
.byte $55,$22,$66,$77,$ff,$77,$55 ; ,$00 shared w sin table
|
||||
|
||||
; blue
|
||||
;.byte $55,$22,$66,$77,$ff,$77,$55 ; ,$00 shared w sin table
|
||||
|
||||
; pink
|
||||
.byte $55,$11,$33,$bb,$ff,$bb,$55
|
||||
|
||||
; this is actually 8*sin(x)
|
||||
sinetable:
|
||||
|
@ -197,8 +209,8 @@ sinetable:
|
|||
;.byte $00,$55,$77,$ff,$77,$66,$22,$55
|
||||
|
||||
; want this to be at 3f5
|
||||
; Lenth is 144 so start at $3f4 -
|
||||
; 1013 - 144 + 3 = 872 = $368
|
||||
; Length is 141 so start at $3f4 -
|
||||
; 1013 - 141 + 3 = 875 = $36B
|
||||
|
||||
jmp plasma
|
||||
|
||||
|
|
|
@ -12,14 +12,13 @@
|
|||
; 127 -- overlap color lookup with sine table
|
||||
; 119 -- forgot to comment out unused
|
||||
; 121 -- make full screen
|
||||
; 119 -- from qkumba, remove php/plp
|
||||
; 118 -- from qkumba, remove SAVEX
|
||||
|
||||
.include "zp.inc"
|
||||
.include "hardware.inc"
|
||||
|
||||
CTEMP = $FC
|
||||
SAVEOFF = $FD
|
||||
SAVEX = $FE
|
||||
SAVEY = $FF
|
||||
|
||||
;================================
|
||||
; Clear screen and setup graphics
|
||||
|
@ -28,10 +27,6 @@ SAVEY = $FF
|
|||
jsr SETGR
|
||||
bit FULLGR ; full screen
|
||||
|
||||
; lda #0
|
||||
; sta DISP_PAGE
|
||||
; lda #4
|
||||
; sta DRAW_PAGE
|
||||
|
||||
;col = ( 8.0 + (sintable[xx&0xf])
|
||||
; + 8.0 + (sintable[yy&0xf])
|
||||
|
@ -86,6 +81,7 @@ plot_frame:
|
|||
plot_yloop:
|
||||
|
||||
txa ; get (y&0xf)<<4
|
||||
pha ; save YY
|
||||
asl
|
||||
asl
|
||||
asl
|
||||
|
@ -95,17 +91,17 @@ plot_yloop:
|
|||
txa
|
||||
lsr
|
||||
|
||||
php
|
||||
jsr GBASCALC ; point GBASL/H to address in A
|
||||
; after, A trashed, C is clear
|
||||
plp
|
||||
|
||||
lda #$0f ; setup mask
|
||||
ldy #$0f ; setup mask
|
||||
bcc plot_mask
|
||||
adc #$e0
|
||||
ldy #$f0
|
||||
|
||||
plot_mask:
|
||||
sta MASK
|
||||
sty MASK
|
||||
|
||||
|
||||
|
||||
jsr GBASCALC ; point GBASL/H to address in A
|
||||
; after, A trashed, C is clear
|
||||
|
||||
;==========
|
||||
|
||||
|
@ -113,8 +109,6 @@ plot_mask:
|
|||
|
||||
plot_xloop:
|
||||
|
||||
stx SAVEX ; SAVE YY
|
||||
|
||||
tya ; get x&0xf
|
||||
and #$f
|
||||
ora CTEMP ; get ((y&0xf)*16)+x
|
||||
|
@ -137,29 +131,25 @@ plot_lookup_smc:
|
|||
|
||||
jsr PLOT1 ; plot at GBASL,Y (x co-ord in Y)
|
||||
|
||||
ldx SAVEX ; restore YY
|
||||
|
||||
dey
|
||||
bpl plot_xloop
|
||||
|
||||
pla
|
||||
tax ; restore YY
|
||||
|
||||
dex
|
||||
bpl plot_yloop
|
||||
bmi forever_loop
|
||||
|
||||
; iny
|
||||
; cpy #40
|
||||
; bne plot_xloop
|
||||
|
||||
; inx
|
||||
; cpx #40
|
||||
; bne plot_yloop
|
||||
; beq forever_loop
|
||||
|
||||
|
||||
colorlookup:
|
||||
bw_color_lookup:
|
||||
|
||||
; blue
|
||||
.byte $55,$22,$66,$77,$ff,$77,$55 ; ,$00 shared w sin table
|
||||
|
||||
; pink
|
||||
;.byte $55,$11,$33,$bb,$ff,$bb,$55 ; ,$00 shared w sin table
|
||||
|
||||
sinetable:
|
||||
.byte $00,$03,$05,$07,$08,$07,$05,$03
|
||||
.byte $00,$FD,$FB,$F9,$F8,$F9,$FB,$FD
|
||||
|
|
Loading…
Reference in New Issue