base:colorcycleplasma
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | base:colorcycleplasma [2015-04-17 04:30] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== ColorCyclePlasma ====== | ||
+ | |||
+ | Source code for the end part of [[http:// | ||
+ | |||
+ | {{ccplasma.gif|}} | ||
+ | |||
+ | < | ||
+ | ; | ||
+ | ; ColorCyclePlasma | ||
+ | ; | ||
+ | ; Coded by Cruzer/CML 2002-2004 | ||
+ | ; Released in "You Know The Routine"/ | ||
+ | ; Compiled with mxass | ||
+ | ; | ||
+ | ; CONCEPT: | ||
+ | ; A bunch of different " | ||
+ | ; and switched between on each rasterline in realtime, creating a plasmatic effect... | ||
+ | ; | ||
+ | ;0200-05ff * | ||
+ | ;0600-07ff * pointer-restore | ||
+ | ;0800-08ff * basic | ||
+ | ;0900-0d7f * generated data | ||
+ | ; | ||
+ | ;2280-35ff * shower | ||
+ | ;3400-3cff * plasmer | ||
+ | ; | ||
+ | ;4000-7fff * sprites/ | ||
+ | ; | ||
+ | ; | ||
+ | ; | ||
+ | ;b000-xxxx * mcpixel LUTs | ||
+ | ;b800-xxxx * logo screens | ||
+ | ;c000-ffff * more pointer-screens | ||
+ | ;e000-ffff * more sprites/ | ||
+ | ; | ||
+ | .la pointerrestore = $0600 | ||
+ | .la mod15 = $0900 | ||
+ | .la mod15d018 = $0a00 | ||
+ | .la mul4 = $0b00 | ||
+ | .la line = $0c00 | ||
+ | .la mul3 = $0d00 | ||
+ | .la xpointers1 = $0e00 | ||
+ | .la xpointers2 = $0e60 | ||
+ | .la xpointers3 = $0ec0 | ||
+ | .la xpointers4 = $0f20 | ||
+ | .la shower = $2280 | ||
+ | .la plasmer = $3400 | ||
+ | .la sine = $3d00 | ||
+ | .la div2mod15d018 = $3f00 ;* | ||
+ | .la sprites = $4000 | ||
+ | .ba $7fc0 | ||
+ | .la mcpixels = $b000 | ||
+ | |||
+ | .la border=$d0ff | ||
+ | |||
+ | .la width=96 | ||
+ | .la height=63 | ||
+ | .la cycles=15 | ||
+ | |||
+ | |||
+ | ;colors ... | ||
+ | |||
+ | .la purple1 = 0 | ||
+ | .la blue1 = 1 | ||
+ | .la mixed1 | ||
+ | .la blue2 = 3 | ||
+ | .la skummel1= 4 | ||
+ | .la green1 | ||
+ | .la brown1 | ||
+ | .la red1 = 7 | ||
+ | .la purple2 = 8 | ||
+ | .la grey2 = 9 | ||
+ | .la black = 10 | ||
+ | |||
+ | ; | ||
+ | ;bytes | ||
+ | .la mcl1=$c0 ;2 | ||
+ | .la mcl2=$c2 ;2 | ||
+ | .la mcl3=$c4 ;2 | ||
+ | .la mcl4=$c6 ;2 | ||
+ | .la sprs=$c8 ;2 | ||
+ | .la tmp =$d0 ;2 | ||
+ | .la cycle=$dd ; | ||
+ | .la x= $de ;1 | ||
+ | .la y= $df ;1 | ||
+ | .la xps= $e0 ;8 | ||
+ | .la yps= $e8 ;8 | ||
+ | |||
+ | ; | ||
+ | |||
+ | sei | ||
+ | |||
+ | lda #$36 | ||
+ | sta $01 | ||
+ | |||
+ | jsr vicinit | ||
+ | |||
+ | lda #$00 | ||
+ | jsr $1000 | ||
+ | |||
+ | |||
+ | cli | ||
+ | sei | ||
+ | lda #<irq1 | ||
+ | sta $0314 | ||
+ | lda #>irq1 | ||
+ | sta $0315 | ||
+ | asl $d019 | ||
+ | lda #$7b | ||
+ | sta $dc0d | ||
+ | lda #$81 | ||
+ | sta $d01a | ||
+ | lda #$0b | ||
+ | sta $d011 | ||
+ | lda #$3c | ||
+ | sta $d012 | ||
+ | cli | ||
+ | |||
+ | |||
+ | jsr fetchfx | ||
+ | |||
+ | jsr makemcpixels | ||
+ | jsr makeluts | ||
+ | ;jsr clearsprites | ||
+ | jsr calc | ||
+ | |||
+ | jsr pointerinit | ||
+ | |||
+ | jsr showerinit | ||
+ | jsr plasmerinit | ||
+ | jsr pointerrestoreinit | ||
+ | |||
+ | jsr logocolorupdate | ||
+ | |||
+ | lda #$ff | ||
+ | sta $d015 | ||
+ | |||
+ | lda #$00 | ||
+ | sta cycle | ||
+ | |||
+ | |||
+ | inc initialized | ||
+ | lda #$02 | ||
+ | - cmp initialized | ||
+ | bne - | ||
+ | jmp outside | ||
+ | |||
+ | initialized .by 0 | ||
+ | |||
+ | ; | ||
+ | outside | ||
+ | |||
+ | -loop | ||
+ | |||
+ | lda go | ||
+ | beq -loop | ||
+ | |||
+ | jsr plasmerinit | ||
+ | |||
+ | lda #0 | ||
+ | sta go | ||
+ | |||
+ | lda calcon | ||
+ | beq + | ||
+ | jsr calc | ||
+ | + | ||
+ | |||
+ | jmp -loop | ||
+ | |||
+ | go .by 0 | ||
+ | calcon .by 0 | ||
+ | ; | ||
+ | irq1 | ||
+ | asl $d019 | ||
+ | |||
+ | lda border | ||
+ | sta rasbuf | ||
+ | lda #$01 | ||
+ | sta border | ||
+ | |||
+ | ;jsr $1003 | ||
+ | |||
+ | lda rasbuf | ||
+ | sta border | ||
+ | |||
+ | lda initialized | ||
+ | bne + | ||
+ | jmp ri | ||
+ | |||
+ | + | ||
+ | lda #<irq2 | ||
+ | sta $0314 | ||
+ | lda #>irq2 | ||
+ | sta $0315 | ||
+ | asl $d019 | ||
+ | lda #$7b | ||
+ | sta $dc0d | ||
+ | lda #$81 | ||
+ | sta $d01a | ||
+ | lda #$1b | ||
+ | sta $d011 | ||
+ | lda #$36 ;3e | ||
+ | sta $d012 | ||
+ | |||
+ | inc initialized | ||
+ | |||
+ | jmp ri | ||
+ | |||
+ | rasbuf .by $00 | ||
+ | ; | ||
+ | |||
+ | irq2 | ||
+ | |||
+ | asl $d019 | ||
+ | |||
+ | lda #$0b | ||
+ | sta border | ||
+ | sta border | ||
+ | |||
+ | lda #$38 ;40 | ||
+ | sta $d001 | ||
+ | sta $d003 | ||
+ | sta $d005 | ||
+ | sta $d007 | ||
+ | sta $d009 | ||
+ | sta $d00b | ||
+ | sta $d00d | ||
+ | sta $d00f | ||
+ | |||
+ | |||
+ | lda #$ff | ||
+ | sta $d017 | ||
+ | |||
+ | lda #$70 | ||
+ | ora $d011 | ||
+ | sta $d011 | ||
+ | |||
+ | lda #$94 | ||
+ | sta $dd00 | ||
+ | lda #$ff | ||
+ | sta $d018 | ||
+ | |||
+ | ldx colors+0 | ||
+ | lda colors+1 | ||
+ | ldy colors+2 | ||
+ | sta $d027 | ||
+ | sta $d028 | ||
+ | sta $d029 | ||
+ | sta $d02a | ||
+ | sta $d02b | ||
+ | sta $d02c | ||
+ | sta $d02d | ||
+ | sta $d02e | ||
+ | stx $d025 | ||
+ | sty $d026 | ||
+ | |||
+ | nop | ||
+ | nop | ||
+ | nop | ||
+ | nop | ||
+ | nop | ||
+ | nop | ||
+ | nop | ||
+ | nop | ||
+ | nop | ||
+ | nop | ||
+ | nop | ||
+ | nop | ||
+ | nop | ||
+ | nop | ||
+ | nop | ||
+ | |||
+ | ldy #$96 | ||
+ | ldx #$94 | ||
+ | |||
+ | |||
+ | |||
+ | lda #$00 | ||
+ | sta $d020 | ||
+ | sta $d021 | ||
+ | |||
+ | jsr shower | ||
+ | |||
+ | |||
+ | lda #$c8 | ||
+ | sta $d016 | ||
+ | |||
+ | ;show logo... | ||
+ | |||
+ | lda $d011 | ||
+ | ora #$20 | ||
+ | sta $d011 | ||
+ | lda #$e8 | ||
+ | sta $d018 | ||
+ | lda #$95 | ||
+ | sta $dd00 | ||
+ | ; lda #$bc | ||
+ | ; sta $d001 | ||
+ | ; sta $d003 | ||
+ | ; sta $d005 | ||
+ | ; sta $d007 | ||
+ | ; sta $d009 | ||
+ | ; sta $d00b | ||
+ | ; sta $d00d | ||
+ | |||
+ | lda #$ff | ||
+ | sta $d01d | ||
+ | sta $d01b | ||
+ | lda #$00 | ||
+ | sta $d017 | ||
+ | sta $d01c | ||
+ | |||
+ | lda #$18 | ||
+ | sta $d000 | ||
+ | lda #$48 | ||
+ | sta $d002 | ||
+ | lda #$78 | ||
+ | sta $d004 | ||
+ | lda #$a8 | ||
+ | sta $d006 | ||
+ | lda #$d8 | ||
+ | sta $d008 | ||
+ | lda #$08 | ||
+ | sta $d00a | ||
+ | lda #$38 | ||
+ | sta $d00c | ||
+ | lda #%01100000 | ||
+ | sta $d010 | ||
+ | lda logocolors+1 | ||
+ | sta $d027 | ||
+ | sta $d028 | ||
+ | sta $d029 | ||
+ | sta $d02a | ||
+ | sta $d02b | ||
+ | sta $d02c | ||
+ | sta $d02d | ||
+ | |||
+ | |||
+ | lda #$03 | ||
+ | sta border | ||
+ | |||
+ | jsr pointerrestore | ||
+ | |||
+ | jsr showlogo2 | ||
+ | |||
+ | inc border | ||
+ | jsr plasma2 | ||
+ | |||
+ | inc border | ||
+ | jsr scroll | ||
+ | |||
+ | inc border | ||
+ | jsr $1003 | ||
+ | |||
+ | inc border | ||
+ | jsr fader | ||
+ | jsr fxchange | ||
+ | jsr logofade | ||
+ | |||
+ | |||
+ | ;init sprites for plasma... | ||
+ | |||
+ | lda #$58 | ||
+ | sta $d000 | ||
+ | lda #$70 | ||
+ | sta $d002 | ||
+ | lda #$88 | ||
+ | sta $d004 | ||
+ | lda #$a0 | ||
+ | sta $d006 | ||
+ | lda #$b8 | ||
+ | sta $d008 | ||
+ | lda #$d0 | ||
+ | sta $d00a | ||
+ | lda #$e8 | ||
+ | sta $d00c | ||
+ | lda #$00 | ||
+ | sta $d00e | ||
+ | lda #%10000000 | ||
+ | sta $d010 | ||
+ | lda #$00 | ||
+ | sta $d01d | ||
+ | sta $d01b | ||
+ | lda #$ff | ||
+ | sta $d017 | ||
+ | sta $d01c | ||
+ | |||
+ | |||
+ | lda #$0f | ||
+ | sta border | ||
+ | |||
+ | jmp ri | ||
+ | |||
+ | cnt .wo 0 | ||
+ | logocolors .by $00,$00 | ||
+ | ; | ||
+ | ri | ||
+ | pla | ||
+ | tay | ||
+ | pla | ||
+ | tax | ||
+ | pla | ||
+ | rti | ||
+ | ; | ||
+ | scroll | ||
+ | |||
+ | lda scrollx | ||
+ | sec | ||
+ | sbc #2 | ||
+ | sta scrollx | ||
+ | bmi + | ||
+ | rts | ||
+ | + | ||
+ | lda #$06 | ||
+ | sta scrollx | ||
+ | |||
+ | ldx #$00 | ||
+ | - lda $04f1,x | ||
+ | sta $04f0,x | ||
+ | lda $04f2,x | ||
+ | sta $04f1,x | ||
+ | lda $04f3,x | ||
+ | sta $04f2,x | ||
+ | lda $04f4,x | ||
+ | sta $04f3,x | ||
+ | inx | ||
+ | inx | ||
+ | inx | ||
+ | inx | ||
+ | cpx #$28 | ||
+ | bne - | ||
+ | |||
+ | ldx scrollpnt | ||
+ | sl lda scrolltext, | ||
+ | cmp #$ff | ||
+ | bne + | ||
+ | lda #> | ||
+ | sta sl+2 | ||
+ | lda #0 | ||
+ | sta scrollpnt | ||
+ | lda #" " | ||
+ | + | ||
+ | tax | ||
+ | sec | ||
+ | sbc #$60 | ||
+ | bcs + | ||
+ | txa | ||
+ | + sta $0517 | ||
+ | |||
+ | inc scrollpnt | ||
+ | bne + | ||
+ | inc sl+2 | ||
+ | + | ||
+ | lda scrollpnt | ||
+ | cmp #$33 | ||
+ | beq + | ||
+ | rts | ||
+ | + | ||
+ | |||
+ | lda #$01 | ||
+ | ldx #$00 | ||
+ | - sta $d8f0,x | ||
+ | inx | ||
+ | cpx #$28 | ||
+ | bne - | ||
+ | |||
+ | rts | ||
+ | |||
+ | scrollx .by 0 | ||
+ | scrollpnt .by 0 | ||
+ | ; | ||
+ | |||
+ | fader | ||
+ | |||
+ | lda go | ||
+ | beq + | ||
+ | rts | ||
+ | + | ||
+ | |||
+ | ldy fadepnt+1 | ||
+ | lda mul3,y | ||
+ | ldx fadecolor | ||
+ | cpx #10 | ||
+ | beq +black | ||
+ | clc | ||
+ | adc mul24,x | ||
+ | tax | ||
+ | lda fadecolors+0, | ||
+ | sta colors+0 | ||
+ | lda fadecolors+1, | ||
+ | sta colors+1 | ||
+ | lda fadecolors+2, | ||
+ | sta colors+2 | ||
+ | jmp + | ||
+ | +black | ||
+ | lda #$00 | ||
+ | sta colors+0 | ||
+ | sta colors+1 | ||
+ | sta colors+2 | ||
+ | + | ||
+ | lda fadeup | ||
+ | beq + | ||
+ | lda fadepnt | ||
+ | clc | ||
+ | adc #$80 | ||
+ | sta fadepnt | ||
+ | lda fadepnt+1 | ||
+ | adc #$00 | ||
+ | sta fadepnt+1 | ||
+ | cmp #$07 | ||
+ | bne + | ||
+ | dec fadeup | ||
+ | + | ||
+ | |||
+ | lda fadedown | ||
+ | beq + | ||
+ | lda fadepnt | ||
+ | sec | ||
+ | sbc #$80 | ||
+ | sta fadepnt | ||
+ | lda fadepnt+1 | ||
+ | sbc #$00 | ||
+ | sta fadepnt+1 | ||
+ | bne + | ||
+ | dec fadedown | ||
+ | + | ||
+ | |||
+ | rts | ||
+ | |||
+ | |||
+ | colors .by 0,0,0 | ||
+ | |||
+ | fadepnt | ||
+ | fadeup | ||
+ | fadedown .by 0 | ||
+ | palette | ||
+ | |||
+ | fadecolor .by 0 | ||
+ | |||
+ | fadecolors | ||
+ | |||
+ | .by $00,$00,$00 | ||
+ | .by $00,$00,$09 | ||
+ | .by $00,$00,$0b | ||
+ | .by $00,$09,$04 | ||
+ | .by $00,$0b,$0a | ||
+ | .by $09,$04,$0f | ||
+ | .by $02,$0a,$07 | ||
+ | .by $04,$0f,$01 | ||
+ | |||
+ | .by $00,$00,$00 | ||
+ | .by $00,$00,$06 | ||
+ | .by $00,$00,$0b | ||
+ | .by $00,$00,$0e | ||
+ | .by $00,$06,$0e | ||
+ | .by $06,$0b,$0f | ||
+ | .by $0b,$0e,$07 | ||
+ | .by $0e,$03,$01 | ||
+ | |||
+ | .by $00,$00,$00 | ||
+ | .by $00,$09,$02 | ||
+ | .by $09,$02,$04 | ||
+ | .by $02,$04,$0e | ||
+ | .by $04,$0e,$03 | ||
+ | .by $0e,$03,$01 | ||
+ | .by $04,$0e,$03 | ||
+ | .by $02,$04,$0e | ||
+ | |||
+ | .by $00,$00,$00 | ||
+ | .by $00,$00,$06 | ||
+ | .by $00,$0b,$0e | ||
+ | .by $09,$0c,$03 | ||
+ | .by $0b,$0f,$01 | ||
+ | .by $0c,$0f,$01 | ||
+ | .by $0b,$0c,$03 | ||
+ | .by $09,$0b,$0e | ||
+ | |||
+ | ;.by $00,$00,$00 | ||
+ | ;.by $00,$00,$06 | ||
+ | ;.by $00,$06,$0e | ||
+ | ;.by $06,$0e,$0f | ||
+ | ;.by $0e,$0f,$01 | ||
+ | ;.by $0f,$01,$01 | ||
+ | ;.by $0e,$0f,$01 | ||
+ | ;.by $06,$0e,$0f | ||
+ | |||
+ | .by $00,$00,$00 | ||
+ | .by $00,$0b,$08 | ||
+ | .by $00,$0c,$0a | ||
+ | .by $06,$0f,$07 | ||
+ | .by $0e,$01,$01 | ||
+ | .by $03,$0f,$07 | ||
+ | .by $0e,$0c,$0a | ||
+ | .by $06,$0b,$08 | ||
+ | |||
+ | .by $00,$00,$00 | ||
+ | .by $00,$00,$0b | ||
+ | .by $00,$0b,$05 | ||
+ | .by $0b,$05,$0d | ||
+ | .by $05,$03,$01 | ||
+ | .by $03,$01,$01 | ||
+ | .by $05,$03,$01 | ||
+ | .by $08,$05,$03 | ||
+ | |||
+ | .by $00,$00,$00 | ||
+ | .by $00,$00,$08 | ||
+ | .by $00,$08,$0a | ||
+ | .by $0b,$0a,$0f | ||
+ | .by $08,$0f,$01 | ||
+ | .by $0a,$0f,$01 | ||
+ | .by $08,$0a,$0f | ||
+ | .by $0b,$08,$0a | ||
+ | |||
+ | .by $00,$00,$00 | ||
+ | .by $00,$00,$02 | ||
+ | .by $00,$02,$0a | ||
+ | .by $00,$0a,$0f | ||
+ | .by $02,$0f,$01 | ||
+ | .by $0a,$01,$01 | ||
+ | .by $02,$0f,$0f | ||
+ | .by $00,$02,$0a | ||
+ | |||
+ | .by $00,$00,$00 | ||
+ | .by $00,$00,$04 | ||
+ | .by $00,$04,$0a | ||
+ | .by $09,$0a,$0f | ||
+ | .by $04,$0f,$01 | ||
+ | .by $0a,$0f,$01 | ||
+ | .by $04,$0a,$0f | ||
+ | .by $09,$04,$0a | ||
+ | |||
+ | .by $00,$00,$00 | ||
+ | .by $00,$00,$0b | ||
+ | .by $00,$0b,$0c | ||
+ | .by $0b,$0c,$0f | ||
+ | .by $0c,$0f,$01 | ||
+ | .by $0f,$01,$01 | ||
+ | .by $0c,$0f,$01 | ||
+ | .by $0b,$0c,$0f | ||
+ | |||
+ | |||
+ | mul24 .by 0, | ||
+ | ; | ||
+ | logofade | ||
+ | |||
+ | ;rts | ||
+ | |||
+ | lda donefading | ||
+ | beq + | ||
+ | rts | ||
+ | + | ||
+ | lda logopnt+1 | ||
+ | sec | ||
+ | sbc #$34 | ||
+ | bcs + | ||
+ | lda #$00 | ||
+ | + asl | ||
+ | tax | ||
+ | lda logofadecolors, | ||
+ | sta logocolors | ||
+ | lda logofadecolors+1, | ||
+ | sta logocolors+1 | ||
+ | |||
+ | lda logopnt | ||
+ | clc | ||
+ | adc #$80 | ||
+ | sta logopnt | ||
+ | lda logopnt+1 | ||
+ | adc #$00 | ||
+ | ;and #$07 | ||
+ | sta logopnt+1 | ||
+ | cmp #$10+$34 | ||
+ | bne logocolorupdate | ||
+ | inc donefading | ||
+ | rts | ||
+ | |||
+ | logocolorupdate | ||
+ | |||
+ | lda logocolors | ||
+ | asl | ||
+ | asl | ||
+ | asl | ||
+ | asl | ||
+ | |||
+ | ldx #$27 | ||
+ | - | ||
+ | sta $b828,x | ||
+ | sta $b850,x | ||
+ | sta $b878,x | ||
+ | sta $bca0,x | ||
+ | sta $bcc8,x | ||
+ | sta $bcf0,x | ||
+ | dex | ||
+ | bpl - | ||
+ | |||
+ | rts | ||
+ | |||
+ | |||
+ | logopnt .wo 0 | ||
+ | |||
+ | logofadecolors | ||
+ | |||
+ | .by $00,$00 | ||
+ | .by $00,$00 | ||
+ | .by $00,$00 | ||
+ | .by $00,$00 | ||
+ | .by $00,$00 | ||
+ | .by $00,$00 | ||
+ | .by $00,$06 | ||
+ | .by $06,$0b | ||
+ | .by $0b,$0e | ||
+ | .by $0e,$0f | ||
+ | .by $0f,$07 | ||
+ | .by $03,$01 | ||
+ | .by $0f,$01 | ||
+ | .by $0e,$07 | ||
+ | .by $0b,$0f | ||
+ | .by $06,$0e | ||
+ | |||
+ | |||
+ | donefading .by 0 | ||
+ | |||
+ | ; | ||
+ | |||
+ | showlogo2 | ||
+ | |||
+ | ;show lower half of logo... | ||
+ | |||
+ | lda #$00 | ||
+ | sta border | ||
+ | |||
+ | lda #$d0 | ||
+ | - cmp $d012 | ||
+ | bne - | ||
+ | |||
+ | inc border | ||
+ | |||
+ | lda #$d1 | ||
+ | sta $d001 | ||
+ | sta $d003 | ||
+ | sta $d005 | ||
+ | sta $d007 | ||
+ | sta $d009 | ||
+ | sta $d00b | ||
+ | sta $d00d | ||
+ | |||
+ | nop | ||
+ | nop | ||
+ | nop | ||
+ | nop | ||
+ | |||
+ | lda #$f8 | ||
+ | sta $d018 | ||
+ | |||
+ | ;jsr showscroll | ||
+ | |||
+ | rts | ||
+ | |||
+ | ; | ||
+ | showscroll | ||
+ | |||
+ | inc border | ||
+ | |||
+ | lda #$e8 | ||
+ | - cmp $d012 | ||
+ | bne - | ||
+ | |||
+ | inc border | ||
+ | |||
+ | lda #$1b | ||
+ | sta $d011 | ||
+ | lda #$16 | ||
+ | sta $d018 | ||
+ | lda #$07 | ||
+ | sta $dd00 | ||
+ | lda scrollx | ||
+ | sta $d016 | ||
+ | |||
+ | rts | ||
+ | |||
+ | ; | ||
+ | fxchange | ||
+ | |||
+ | lda go | ||
+ | beq + | ||
+ | rts | ||
+ | + | ||
+ | |||
+ | lda fxcnt | ||
+ | sec | ||
+ | sbc #$01 | ||
+ | sta fxcnt | ||
+ | lda fxcnt+1 | ||
+ | sbc #$00 | ||
+ | sta fxcnt+1 | ||
+ | |||
+ | bmi +newfx | ||
+ | |||
+ | +fadecheck | ||
+ | |||
+ | lda fxcnt+1 | ||
+ | bne + | ||
+ | lda fxcnt+0 | ||
+ | cmp #$28 | ||
+ | bne + | ||
+ | |||
+ | lda #1 | ||
+ | sta fadedown | ||
+ | lda #0 | ||
+ | sta fadeup | ||
+ | lda #$00 | ||
+ | sta fadepnt+0 | ||
+ | lda #$07 | ||
+ | sta fadepnt+1 | ||
+ | |||
+ | + | ||
+ | rts | ||
+ | |||
+ | +newfx | ||
+ | |||
+ | lda fx | ||
+ | clc | ||
+ | adc #1 | ||
+ | cmp numfx | ||
+ | bne + | ||
+ | lda #1 | ||
+ | + sta fx | ||
+ | |||
+ | lda #1 | ||
+ | sta go | ||
+ | |||
+ | fetchfx | ||
+ | |||
+ | ;fetch parameters for new fx ... | ||
+ | |||
+ | lda fx | ||
+ | asl | ||
+ | tax | ||
+ | lda fxs,x | ||
+ | sta $fe | ||
+ | lda fxs+1,x | ||
+ | sta $ff | ||
+ | |||
+ | ldy #$00 | ||
+ | lda ($fe),y | ||
+ | sta plapa+0 | ||
+ | iny | ||
+ | lda ($fe),y | ||
+ | sta plapa+1 | ||
+ | iny | ||
+ | lda ($fe),y | ||
+ | sta spread+0 | ||
+ | iny | ||
+ | lda ($fe),y | ||
+ | sta spread+1 | ||
+ | iny | ||
+ | |||
+ | lda ($fe),y | ||
+ | sta fadecolor | ||
+ | iny | ||
+ | |||
+ | lda ($fe),y | ||
+ | sta fxcnt | ||
+ | iny | ||
+ | lda ($fe),y | ||
+ | sta fxcnt+1 | ||
+ | iny | ||
+ | |||
+ | lda ($fe),y | ||
+ | sta calcon | ||
+ | iny | ||
+ | |||
+ | ldx #$00 | ||
+ | - | ||
+ | lda ($fe),y | ||
+ | sta xpa,x | ||
+ | iny | ||
+ | inx | ||
+ | cpx #8 | ||
+ | bne - | ||
+ | |||
+ | ldx #$00 | ||
+ | - | ||
+ | lda ($fe),y | ||
+ | sta ypa,x | ||
+ | iny | ||
+ | inx | ||
+ | cpx #8 | ||
+ | bne - | ||
+ | |||
+ | |||
+ | |||
+ | lda #1 | ||
+ | sta fadeup | ||
+ | lda #0 | ||
+ | sta fadedown | ||
+ | lda #$00 | ||
+ | sta fadepnt | ||
+ | sta fadepnt+1 | ||
+ | |||
+ | rts | ||
+ | |||
+ | fx .by 0 | ||
+ | fxcnt .wo $0100 | ||
+ | |||
+ | numfx .by 12 | ||
+ | fxs .wo fx0, | ||
+ | |||
+ | |||
+ | ;by speed (plasma) | ||
+ | ;by spread (plasma) | ||
+ | ;by color | ||
+ | ;wo duration | ||
+ | ;by calc on/off | ||
+ | ;wo xpa (cycler) | ||
+ | ;wo ypa (cycler) | ||
+ | |||
+ | |||
+ | fx0 | ||
+ | .by 0,0 | ||
+ | .by 0,0 | ||
+ | .by black | ||
+ | .wo $0133 | ||
+ | .by 1 | ||
+ | .wo $fb80, | ||
+ | .wo $0601, | ||
+ | |||
+ | fx1 | ||
+ | .by $02,$01 | ||
+ | .by $03,$02 | ||
+ | .by brown1 | ||
+ | .wo $0240 | ||
+ | .by 1 | ||
+ | .wo $fb80, | ||
+ | .wo $0601, | ||
+ | |||
+ | fx2 | ||
+ | .by $fe,$03 | ||
+ | .by $ff,$02 | ||
+ | .by purple1 | ||
+ | .wo $0240 | ||
+ | .by 0 | ||
+ | .wo 0,0,0,0 | ||
+ | .wo 0,0,0,0 | ||
+ | |||
+ | fx2b | ||
+ | .by $01,$02 | ||
+ | .by $fe,$ff | ||
+ | ;.by $01,$02 | ||
+ | ;.by $fe,$01 | ||
+ | ;.by $02,$ff | ||
+ | ;.by $fd,$04 | ||
+ | .by green1 | ||
+ | .wo $0240 | ||
+ | .by 0 | ||
+ | .wo 0,0,0,0 | ||
+ | .wo 0,0,0,0 | ||
+ | |||
+ | fx3 | ||
+ | .by $fd,$04 | ||
+ | .by $ff,$02 | ||
+ | .by blue2 | ||
+ | .wo $0240 | ||
+ | .by 1 | ||
+ | .wo $fd80, | ||
+ | .wo $0401, | ||
+ | |||
+ | fx4 | ||
+ | .by $02,$ff | ||
+ | .by $ff,$02 | ||
+ | .by mixed1 | ||
+ | .wo $0200 | ||
+ | .by 0 | ||
+ | .wo 0,0,0,0 | ||
+ | .wo 0,0,0,0 | ||
+ | |||
+ | fx5 | ||
+ | .by $fd,$02 | ||
+ | .by $fe,$03 | ||
+ | .by grey2 | ||
+ | .wo $0190 | ||
+ | .by 0 | ||
+ | .wo 0,0,0,0 | ||
+ | .wo 0,0,0,0 | ||
+ | |||
+ | fx6 | ||
+ | .by $fd,$04 | ||
+ | .by $ff,$02 | ||
+ | .by purple2 | ||
+ | .wo $0200 | ||
+ | .by 0 | ||
+ | .wo 0,0,0,0 | ||
+ | .wo 0,0,0,0 | ||
+ | |||
+ | fx7a | ||
+ | .by $01,$02 | ||
+ | .by $ff,$01 | ||
+ | .by red1 | ||
+ | .wo $0199 | ||
+ | .by 0 | ||
+ | .wo 0,0,0,0 | ||
+ | .wo 0,0,0,0 | ||
+ | fx7 | ||
+ | .by $01,$02 | ||
+ | .by $ff,$01 | ||
+ | .by skummel1 | ||
+ | .wo $0280 | ||
+ | .by 1 | ||
+ | .wo $f880, | ||
+ | .wo $0601, | ||
+ | |||
+ | fx8 | ||
+ | .by $01,$fe | ||
+ | .by $fd,$04 | ||
+ | .by blue1 | ||
+ | .wo $0240 | ||
+ | .by 0 | ||
+ | .wo 0,0,0,0 | ||
+ | .wo 0,0,0,0 | ||
+ | |||
+ | fx9 | ||
+ | .by $02,$01 | ||
+ | .by $03,$03 | ||
+ | ;.by $fe,$03 | ||
+ | ;.by $ff,$02 | ||
+ | .by purple1 | ||
+ | .wo $0280 | ||
+ | .by 0 | ||
+ | .wo 0,0,0,0 | ||
+ | .wo 0,0,0,0 | ||
+ | |||
+ | |||
+ | ;fx8 | ||
+ | ; .by $01,$02 | ||
+ | ; .by $ff,$01 | ||
+ | ; .by skummel1 | ||
+ | ; .wo $0400 | ||
+ | ; .by 1 | ||
+ | ; .wo $ff80, | ||
+ | ; .wo $0101, | ||
+ | |||
+ | ; | ||
+ | |||
+ | |||
+ | plasma2 | ||
+ | |||
+ | ldx plap+0 | ||
+ | ldy plap+1 | ||
+ | |||
+ | jsr plasmer | ||
+ | |||
+ | lda plap+0 | ||
+ | clc | ||
+ | adc plapa+0 | ||
+ | sta plap+0 | ||
+ | lda plap+1 | ||
+ | clc | ||
+ | adc plapa+1 | ||
+ | sta plap+1 | ||
+ | |||
+ | rts | ||
+ | |||
+ | |||
+ | |||
+ | plap .by $00,$27 | ||
+ | plapa .by $01,$fe | ||
+ | |||
+ | d018s .by $0f, | ||
+ | ; | ||
+ | |||
+ | plasmerinit | ||
+ | |||
+ | |||
+ | lda #< | ||
+ | sta $fe | ||
+ | lda #> | ||
+ | sta $ff | ||
+ | |||
+ | ldy #$00 | ||
+ | - | ||
+ | lda plasmersrc1, | ||
+ | sta plasmersrc, | ||
+ | iny | ||
+ | cpy #17 | ||
+ | bne - | ||
+ | |||
+ | ldx #0 | ||
+ | |||
+ | -loop | ||
+ | |||
+ | ldy #0 | ||
+ | - | ||
+ | lda plasmersrc, | ||
+ | sta ($fe),y | ||
+ | iny | ||
+ | cpy #17 | ||
+ | bne - | ||
+ | |||
+ | tya | ||
+ | clc | ||
+ | adc $fe | ||
+ | sta $fe | ||
+ | lda #0 | ||
+ | adc $ff | ||
+ | sta $ff | ||
+ | |||
+ | tya | ||
+ | clc | ||
+ | adc +ps1+1 | ||
+ | sta +ps1+1 | ||
+ | lda #0 | ||
+ | adc +ps1+2 | ||
+ | sta +ps1+2 | ||
+ | |||
+ | |||
+ | |||
+ | cpx #33 | ||
+ | bne + | ||
+ | |||
+ | ldy #0 | ||
+ | - | ||
+ | lda jsrshowscroll, | ||
+ | sta ($fe),y | ||
+ | iny | ||
+ | cpy #3 | ||
+ | bne - | ||
+ | |||
+ | tya | ||
+ | clc | ||
+ | adc $fe | ||
+ | sta $fe | ||
+ | lda #0 | ||
+ | adc $ff | ||
+ | sta $ff | ||
+ | |||
+ | tya | ||
+ | clc | ||
+ | adc +ps1+1 | ||
+ | sta +ps1+1 | ||
+ | lda #0 | ||
+ | adc +ps1+2 | ||
+ | sta +ps1+2 | ||
+ | |||
+ | |||
+ | + | ||
+ | |||
+ | lda #35 | ||
+ | clc | ||
+ | adc +ss1+1 | ||
+ | sta +ss1+1 | ||
+ | lda #0 | ||
+ | adc +ss1+2 | ||
+ | sta +ss1+2 | ||
+ | |||
+ | lda +sl1+1 | ||
+ | clc | ||
+ | adc spread+0 | ||
+ | sta +sl1+1 | ||
+ | lda +sl2+1 | ||
+ | clc | ||
+ | adc spread+1 | ||
+ | sta +sl2+1 | ||
+ | |||
+ | inx | ||
+ | cpx #height*2 | ||
+ | bne -loop | ||
+ | |||
+ | |||
+ | ldy #$00 | ||
+ | lda #$60 | ||
+ | sta ($fe),y | ||
+ | |||
+ | rts | ||
+ | |||
+ | |||
+ | spread | ||
+ | .by $ff,$02 | ||
+ | |||
+ | |||
+ | plasmersrc | ||
+ | |||
+ | +sl1 lda sine,x | ||
+ | clc | ||
+ | +sl2 adc sine,y | ||
+ | ror | ||
+ | +ps1 sta plasmer+12 | ||
+ | lda div2mod15d018 | ||
+ | +ss1 sta shower+6 | ||
+ | |||
+ | |||
+ | plasmersrc1 | ||
+ | |||
+ | lda sine,x | ||
+ | clc | ||
+ | adc sine,y | ||
+ | ror | ||
+ | sta plasmer+12 | ||
+ | lda div2mod15d018 | ||
+ | sta shower+6 | ||
+ | |||
+ | |||
+ | jsrshowscroll | ||
+ | |||
+ | jsr showscroll | ||
+ | |||
+ | |||
+ | ; | ||
+ | |||
+ | pointerrestoreinit | ||
+ | |||
+ | |||
+ | lda #< | ||
+ | sta $fe | ||
+ | lda #> | ||
+ | sta $ff | ||
+ | |||
+ | -loop | ||
+ | |||
+ | lda +lx+1 | ||
+ | and #$0f | ||
+ | bne + | ||
+ | |||
+ | ldy #0 | ||
+ | - | ||
+ | lda pointerrestoresrc1, | ||
+ | sta ($fe),y | ||
+ | iny | ||
+ | cpy #5 | ||
+ | bne - | ||
+ | |||
+ | jmp +skip | ||
+ | + | ||
+ | |||
+ | ldy #0 | ||
+ | - | ||
+ | lda pointerrestoresrc2, | ||
+ | sta ($fe),y | ||
+ | iny | ||
+ | cpy #4 | ||
+ | bne - | ||
+ | |||
+ | +skip | ||
+ | |||
+ | |||
+ | tya | ||
+ | clc | ||
+ | adc $fe | ||
+ | sta $fe | ||
+ | lda #0 | ||
+ | adc $ff | ||
+ | sta $ff | ||
+ | |||
+ | lda +sx+2 | ||
+ | clc | ||
+ | adc #$04 | ||
+ | sta +sx+2 | ||
+ | sta +sx2+2 | ||
+ | cmp #$7f | ||
+ | bne + | ||
+ | lda #$43 | ||
+ | sta +sx+2 | ||
+ | sta +sx2+2 | ||
+ | inc +sx+1 | ||
+ | inc +sx2+1 | ||
+ | inc +lx+1 | ||
+ | |||
+ | lda +sx+1 | ||
+ | beq +end | ||
+ | |||
+ | + inc +lx+1 | ||
+ | |||
+ | jmp -loop | ||
+ | |||
+ | +end | ||
+ | |||
+ | ldy #$00 | ||
+ | lda #$60 | ||
+ | sta ($fe),y | ||
+ | |||
+ | rts | ||
+ | |||
+ | |||
+ | pointerrestoresrc1 | ||
+ | |||
+ | +lx ldx #$00 | ||
+ | +sx stx $43f8 | ||
+ | |||
+ | pointerrestoresrc2 | ||
+ | |||
+ | inx | ||
+ | +sx2 stx $43f8 | ||
+ | |||
+ | ; | ||
+ | |||
+ | |||
+ | |||
+ | showerinit | ||
+ | |||
+ | |||
+ | lda #<vics | ||
+ | sta $fc | ||
+ | lda #>vics | ||
+ | sta $fd | ||
+ | |||
+ | lda #<shower | ||
+ | sta $fe | ||
+ | lda #>shower | ||
+ | sta $ff | ||
+ | |||
+ | lda #$00 | ||
+ | sta cnt | ||
+ | |||
+ | -loop | ||
+ | ldy #$00 | ||
+ | - | ||
+ | lda showersrc,y | ||
+ | sta ($fe),y | ||
+ | iny | ||
+ | cpy #35 | ||
+ | bne - | ||
+ | |||
+ | tya | ||
+ | clc | ||
+ | adc $fe | ||
+ | sta $fe | ||
+ | lda #$00 | ||
+ | adc $ff | ||
+ | sta $ff | ||
+ | |||
+ | lda +d11+1 | ||
+ | clc | ||
+ | adc #$01 | ||
+ | and #$07 | ||
+ | ora #$18 | ||
+ | sta +d11+1 | ||
+ | |||
+ | |||
+ | |||
+ | ;change vic-updates (d001/ | ||
+ | |||
+ | lda #$ff | ||
+ | sta +v1+3 | ||
+ | sta +v2+3 | ||
+ | sta +v3+3 | ||
+ | sta +v4+3 | ||
+ | lda #$d0 | ||
+ | sta +v1+4 | ||
+ | sta +v2+4 | ||
+ | sta +v3+4 | ||
+ | sta +v4+4 | ||
+ | |||
+ | |||
+ | ldx #$00 | ||
+ | |||
+ | -vicloop | ||
+ | |||
+ | ldy #$00 | ||
+ | lda ($fc),y | ||
+ | cmp cnt | ||
+ | bne + | ||
+ | |||
+ | iny | ||
+ | lda ($fc),y | ||
+ | sta +v1+1,x | ||
+ | iny | ||
+ | lda ($fc),y | ||
+ | sta +v1+3,x | ||
+ | iny | ||
+ | lda ($fc),y | ||
+ | sta +v1+4,x | ||
+ | |||
+ | lda $fc | ||
+ | clc | ||
+ | adc #$04 | ||
+ | sta $fc | ||
+ | lda $fd | ||
+ | adc #$00 | ||
+ | sta $fd | ||
+ | |||
+ | inx | ||
+ | inx | ||
+ | inx | ||
+ | inx | ||
+ | inx | ||
+ | |||
+ | jmp -vicloop | ||
+ | + | ||
+ | |||
+ | |||
+ | lda #$ff | ||
+ | sta +dd+1 | ||
+ | lda #$d0 | ||
+ | sta +dd+2 | ||
+ | lda cnt | ||
+ | cmp #39 | ||
+ | bne + | ||
+ | lda #$8e | ||
+ | sta +dd | ||
+ | lda #$00 | ||
+ | sta +dd+1 | ||
+ | lda #$dd | ||
+ | sta +dd+2 | ||
+ | + | ||
+ | lda cnt | ||
+ | cmp #81 | ||
+ | bne + | ||
+ | lda #$8c | ||
+ | sta +dd | ||
+ | lda #$00 | ||
+ | sta +dd+1 | ||
+ | lda #$dd | ||
+ | sta +dd+2 | ||
+ | + | ||
+ | |||
+ | inc cnt | ||
+ | lda cnt | ||
+ | cmp #height*2 | ||
+ | beq + | ||
+ | jmp -loop | ||
+ | + | ||
+ | |||
+ | ldy #$00 | ||
+ | lda #$60 | ||
+ | sta ($fe),y | ||
+ | |||
+ | rts | ||
+ | |||
+ | |||
+ | showersrc | ||
+ | |||
+ | +d11 lda #$18 | ||
+ | sta $d011 | ||
+ | lda #$00 | ||
+ | sta $d018 | ||
+ | +dd sty $dd00 | ||
+ | +v1 lda #$00 | ||
+ | sta $d0ff | ||
+ | +v2 lda #$00 | ||
+ | sta $d0ff | ||
+ | +v3 lda #$00 | ||
+ | sta $d0ff | ||
+ | +v4 lda #$00 | ||
+ | sta $d0ff | ||
+ | nop | ||
+ | nop | ||
+ | |||
+ | |||
+ | vics | ||
+ | .by $01, | ||
+ | .by $01, | ||
+ | .by $01, | ||
+ | .by $01, | ||
+ | .by $02, | ||
+ | .by $02, | ||
+ | .by $02, | ||
+ | .by $02, | ||
+ | |||
+ | .by $2d, | ||
+ | .by $2d, | ||
+ | .by $2d, | ||
+ | .by $2d, | ||
+ | .by $2e, | ||
+ | .by $2e, | ||
+ | .by $2e, | ||
+ | .by $2e, | ||
+ | |||
+ | .by $2f, | ||
+ | .by $2f, | ||
+ | .by $2f, | ||
+ | .by $2f, | ||
+ | .by $30, | ||
+ | .by $30, | ||
+ | .by $30, | ||
+ | .by $30, | ||
+ | .by $31, | ||
+ | .by $31, | ||
+ | .by $31, | ||
+ | .by $31, | ||
+ | .by $32, | ||
+ | .by $32, | ||
+ | .by $32, | ||
+ | |||
+ | .by $33, | ||
+ | .by $33, | ||
+ | .by $33, | ||
+ | .by $33, | ||
+ | .by $34, | ||
+ | .by $34, | ||
+ | .by $34, | ||
+ | .by $34, | ||
+ | .by $35, | ||
+ | .by $35, | ||
+ | .by $35, | ||
+ | .by $35, | ||
+ | .by $36, | ||
+ | .by $36, | ||
+ | .by $36, | ||
+ | |||
+ | .by $37, | ||
+ | .by $37, | ||
+ | .by $37, | ||
+ | .by $37, | ||
+ | .by $38, | ||
+ | .by $38, | ||
+ | .by $38, | ||
+ | .by $38, | ||
+ | .by $39, | ||
+ | .by $39, | ||
+ | .by $39, | ||
+ | .by $39, | ||
+ | .by $3a, | ||
+ | .by $3a, | ||
+ | .by $3a, | ||
+ | |||
+ | .by $3b, | ||
+ | .by $3b, | ||
+ | .by $3b, | ||
+ | .by $3b, | ||
+ | .by $3c, | ||
+ | .by $3c, | ||
+ | .by $3c, | ||
+ | .by $3c, | ||
+ | .by $3d, | ||
+ | .by $3d, | ||
+ | .by $3d, | ||
+ | .by $3d, | ||
+ | .by $3e, | ||
+ | .by $3e, | ||
+ | .by $3e, | ||
+ | |||
+ | .by $3f, | ||
+ | .by $3f, | ||
+ | .by $3f, | ||
+ | .by $3f, | ||
+ | .by $40, | ||
+ | .by $40, | ||
+ | .by $40, | ||
+ | .by $40, | ||
+ | .by $41, | ||
+ | .by $41, | ||
+ | .by $41, | ||
+ | .by $41, | ||
+ | .by $42, | ||
+ | .by $42, | ||
+ | .by $42, | ||
+ | |||
+ | .by $43, | ||
+ | .by $43, | ||
+ | .by $43, | ||
+ | .by $43, | ||
+ | .by $44, | ||
+ | .by $44, | ||
+ | .by $44, | ||
+ | .by $44, | ||
+ | .by $45, | ||
+ | .by $45, | ||
+ | .by $45, | ||
+ | .by $45, | ||
+ | .by $46, | ||
+ | .by $46, | ||
+ | .by $46, | ||
+ | |||
+ | .by $47, | ||
+ | .by $47, | ||
+ | .by $47, | ||
+ | .by $47, | ||
+ | .by $48, | ||
+ | .by $48, | ||
+ | .by $48, | ||
+ | .by $48, | ||
+ | .by $49, | ||
+ | .by $49, | ||
+ | .by $49, | ||
+ | .by $49, | ||
+ | .by $4a, | ||
+ | .by $4a, | ||
+ | .by $4a, | ||
+ | |||
+ | .by $4b, | ||
+ | .by $4b, | ||
+ | .by $4b, | ||
+ | .by $4b, | ||
+ | .by $4c, | ||
+ | .by $4c, | ||
+ | .by $4c, | ||
+ | .by $4c, | ||
+ | .by $4d, | ||
+ | .by $4d, | ||
+ | .by $4d, | ||
+ | .by $4d, | ||
+ | .by $4e, | ||
+ | .by $4e, | ||
+ | .by $4e, | ||
+ | |||
+ | .by $5a, | ||
+ | .by $5a, | ||
+ | .by $5a, | ||
+ | .by $5a, | ||
+ | .by $5b, | ||
+ | .by $5b, | ||
+ | .by $5b, | ||
+ | |||
+ | .by $00 | ||
+ | |||
+ | ; | ||
+ | |||
+ | pointerinit | ||
+ | |||
+ | |||
+ | ;sprite setup: | ||
+ | ; | ||
+ | ;cycle#00: 00, | ||
+ | ; 80, | ||
+ | ; 80, | ||
+ | ;cycle#01: 01, | ||
+ | ; 81, | ||
+ | ; 81, | ||
+ | ;cycle#02: 02, | ||
+ | ; 82, | ||
+ | ; 82, | ||
+ | ;... ... | ||
+ | ; | ||
+ | ; | ||
+ | ; | ||
+ | |||
+ | |||
+ | lda #$f8 | ||
+ | sta $fc | ||
+ | lda #$43 | ||
+ | sta $fd | ||
+ | |||
+ | lda #$f8 | ||
+ | sta $fe | ||
+ | lda #$c3 | ||
+ | sta $ff | ||
+ | |||
+ | lda #$00 | ||
+ | sta cycle | ||
+ | |||
+ | -loop | ||
+ | |||
+ | ldy #$00 | ||
+ | lda cycle | ||
+ | - | ||
+ | sta ($fc),y | ||
+ | ldx #$34 | ||
+ | ora #$80 | ||
+ | sei | ||
+ | stx $01 | ||
+ | sta ($fe),y | ||
+ | ldx #$36 | ||
+ | stx $01 | ||
+ | cli | ||
+ | iny | ||
+ | and #$7f | ||
+ | clc | ||
+ | adc #$10 | ||
+ | bpl - | ||
+ | |||
+ | lda $fd | ||
+ | clc | ||
+ | adc #$04 | ||
+ | sta $fd | ||
+ | ora #$80 | ||
+ | sta $ff | ||
+ | |||
+ | inc cycle | ||
+ | lda cycle | ||
+ | cmp #cycles | ||
+ | bne -loop | ||
+ | |||
+ | |||
+ | lda #$ff | ||
+ | ldy #$07 | ||
+ | - | ||
+ | sta $fff8,y | ||
+ | dey | ||
+ | bpl - | ||
+ | |||
+ | rts | ||
+ | |||
+ | |||
+ | ; | ||
+ | |||
+ | vicinit | ||
+ | |||
+ | |||
+ | lda #$00 | ||
+ | sta $d020 | ||
+ | sta $d021 | ||
+ | |||
+ | lda #$ff | ||
+ | sta $d018 | ||
+ | lda #$96 | ||
+ | sta $dd00 | ||
+ | |||
+ | lda #$00 | ||
+ | tax | ||
+ | - | ||
+ | sta $d800,x | ||
+ | sta $d900,x | ||
+ | sta $da00,x | ||
+ | sta $db00,x | ||
+ | inx | ||
+ | bne - | ||
+ | |||
+ | |||
+ | ;set logo spr-pnts... | ||
+ | |||
+ | ldx #$06 | ||
+ | lda #$b6 | ||
+ | - sta $bbf8,x | ||
+ | sec | ||
+ | sbc #$01 | ||
+ | dex | ||
+ | bpl - | ||
+ | |||
+ | ldx #$06 | ||
+ | lda #$bd | ||
+ | - sta $bff8,x | ||
+ | sec | ||
+ | sbc #$01 | ||
+ | dex | ||
+ | bpl - | ||
+ | |||
+ | |||
+ | rts | ||
+ | ; | ||
+ | calc | ||
+ | |||
+ | |||
+ | lda #$00 | ||
+ | ldx #$07 | ||
+ | - | ||
+ | sta xps,x | ||
+ | sta yps,x | ||
+ | dex | ||
+ | bpl - | ||
+ | |||
+ | lda xpa+0 | ||
+ | sta +a0+1 | ||
+ | lda xpa+1 | ||
+ | sta +a1+1 | ||
+ | lda xpa+2 | ||
+ | sta +a2+1 | ||
+ | lda xpa+3 | ||
+ | sta +a3+1 | ||
+ | lda xpa+4 | ||
+ | sta +a4+1 | ||
+ | lda xpa+5 | ||
+ | sta +a5+1 | ||
+ | lda xpa+6 | ||
+ | sta +a6+1 | ||
+ | lda xpa+7 | ||
+ | sta +a7+1 | ||
+ | |||
+ | |||
+ | jsr calcxpointers | ||
+ | |||
+ | lda #0 | ||
+ | sta y | ||
+ | |||
+ | |||
+ | -loop1 | ||
+ | |||
+ | jsr calcline | ||
+ | |||
+ | lda #cycles-1 | ||
+ | sta cycle | ||
+ | |||
+ | jsr paintline2 | ||
+ | |||
+ | inc y | ||
+ | lda y | ||
+ | cmp #height | ||
+ | bne -loop1 | ||
+ | |||
+ | rts | ||
+ | |||
+ | ; | ||
+ | makeluts | ||
+ | |||
+ | lda #0 | ||
+ | tax | ||
+ | -loop | ||
+ | sta mod15,x | ||
+ | tay | ||
+ | lda d018s,y | ||
+ | sta mod15d018,x | ||
+ | tya | ||
+ | clc | ||
+ | adc #1 | ||
+ | cmp #15 | ||
+ | bne + | ||
+ | lda #0 | ||
+ | + inx | ||
+ | bne -loop | ||
+ | |||
+ | |||
+ | ldx #0 | ||
+ | ldy #0 | ||
+ | -loop | ||
+ | lda mod15d018,x | ||
+ | sta div2mod15d018, | ||
+ | sta div2mod15d018+1, | ||
+ | inx | ||
+ | iny | ||
+ | iny | ||
+ | bne -loop | ||
+ | |||
+ | |||
+ | ldx #0 | ||
+ | -loop | ||
+ | txa | ||
+ | asl | ||
+ | asl | ||
+ | sta mul4,x | ||
+ | inx | ||
+ | bne -loop | ||
+ | |||
+ | |||
+ | ldx #$00 | ||
+ | -loop | ||
+ | txa | ||
+ | sta tmp | ||
+ | asl | ||
+ | clc | ||
+ | adc tmp | ||
+ | sta mul3,x | ||
+ | inx | ||
+ | bne -loop | ||
+ | |||
+ | rts | ||
+ | |||
+ | ; | ||
+ | makemcpixels | ||
+ | |||
+ | ;make 4 luts for mc-pixels (1 for each mc-x-pos in a byte) | ||
+ | |||
+ | lda #%11000000 | ||
+ | sta mask | ||
+ | |||
+ | ldx #> | ||
+ | stx smp+2 | ||
+ | inx | ||
+ | stx smp+5 | ||
+ | |||
+ | -loop2 | ||
+ | ldx #$00 | ||
+ | ldy #$00 | ||
+ | -loop1 | ||
+ | |||
+ | lda mcs+1,y | ||
+ | and mask | ||
+ | smp sta mcpixels,x | ||
+ | sta mcpixels+$0100, | ||
+ | txa | ||
+ | cmp mcs+2,y | ||
+ | bne + | ||
+ | iny | ||
+ | iny | ||
+ | + | ||
+ | inx | ||
+ | bne -loop1 | ||
+ | |||
+ | inc smp+2 | ||
+ | inc smp+2 | ||
+ | inc smp+5 | ||
+ | inc smp+5 | ||
+ | |||
+ | lsr mask | ||
+ | lsr mask | ||
+ | bcc -loop2 | ||
+ | |||
+ | rts | ||
+ | |||
+ | |||
+ | mcs | ||
+ | .by $00, | ||
+ | .by $22, | ||
+ | .by $44, | ||
+ | .by $66, | ||
+ | .by $98, | ||
+ | .by $ba, | ||
+ | .by $dc, | ||
+ | .by $00 | ||
+ | |||
+ | ; .by $00, | ||
+ | ; .by $24, | ||
+ | ; .by $48, | ||
+ | ; .by $6c, | ||
+ | ; .by $90, | ||
+ | ; .by $b4, | ||
+ | ; .by $d8, | ||
+ | ; .by $00 | ||
+ | |||
+ | |||
+ | mask .by %11000000 | ||
+ | ; | ||
+ | |||
+ | calcline | ||
+ | |||
+ | |||
+ | ;reset x-pointers... | ||
+ | |||
+ | lda xpss+0 | ||
+ | sta xps+0 | ||
+ | lda xpss+1 | ||
+ | sta xps+1 | ||
+ | lda xpss+2 | ||
+ | sta xps+2 | ||
+ | lda xpss+3 | ||
+ | sta xps+3 | ||
+ | lda xpss+4 | ||
+ | sta xps+4 | ||
+ | lda xpss+5 | ||
+ | sta xps+5 | ||
+ | lda xpss+6 | ||
+ | sta xps+6 | ||
+ | lda xpss+7 | ||
+ | sta xps+7 | ||
+ | |||
+ | |||
+ | lda yps+1 | ||
+ | sta +ya1+1 | ||
+ | lda yps+3 | ||
+ | sta +ya3+1 | ||
+ | lda yps+5 | ||
+ | sta +ya5+1 | ||
+ | lda yps+7 | ||
+ | sta +ya7+1 | ||
+ | |||
+ | |||
+ | ldx #width-1 | ||
+ | |||
+ | -loop | ||
+ | |||
+ | ;get x-pointers... | ||
+ | |||
+ | lda xpointers1, | ||
+ | sta sl1+1 | ||
+ | lda xpointers2, | ||
+ | sta sl2+1 | ||
+ | lda xpointers3, | ||
+ | sta sl3+1 | ||
+ | lda xpointers4, | ||
+ | sta sl4+1 | ||
+ | |||
+ | ;add sines ... | ||
+ | |||
+ | +ya1 ldy #1 | ||
+ | sl1 lda sine,y | ||
+ | clc | ||
+ | +ya3 ldy #3 | ||
+ | sl2 adc sine,y | ||
+ | clc | ||
+ | +ya5 ldy #5 | ||
+ | sl3 adc sine,y | ||
+ | clc | ||
+ | +ya7 ldy #7 | ||
+ | sl4 adc sine,y | ||
+ | sta line,x | ||
+ | |||
+ | dex | ||
+ | bpl -loop | ||
+ | |||
+ | |||
+ | ;update y pointers... | ||
+ | |||
+ | lda yps+0 | ||
+ | clc | ||
+ | adc ypa+0 | ||
+ | sta yps+0 | ||
+ | lda yps+1 | ||
+ | adc ypa+1 | ||
+ | sta yps+1 | ||
+ | lda yps+2 | ||
+ | clc | ||
+ | adc ypa+2 | ||
+ | sta yps+2 | ||
+ | lda yps+3 | ||
+ | adc ypa+3 | ||
+ | sta yps+3 | ||
+ | lda yps+4 | ||
+ | clc | ||
+ | adc ypa+4 | ||
+ | sta yps+4 | ||
+ | lda yps+5 | ||
+ | adc ypa+5 | ||
+ | sta yps+5 | ||
+ | lda yps+6 | ||
+ | clc | ||
+ | adc ypa+6 | ||
+ | sta yps+6 | ||
+ | lda yps+7 | ||
+ | adc ypa+7 | ||
+ | sta yps+7 | ||
+ | |||
+ | |||
+ | rts | ||
+ | |||
+ | |||
+ | |||
+ | calcxpointers | ||
+ | |||
+ | ;calc all xpointers once, so calcline doesn' | ||
+ | ;on each line... | ||
+ | |||
+ | |||
+ | ;reset x-pointers... | ||
+ | |||
+ | ldy xpss+0 | ||
+ | sty xps+0 | ||
+ | lda xpss+1 | ||
+ | sta xps+1 | ||
+ | lda xpss+2 | ||
+ | sta xps+2 | ||
+ | lda xpss+3 | ||
+ | sta xps+3 | ||
+ | lda xpss+4 | ||
+ | sta xps+4 | ||
+ | lda xpss+5 | ||
+ | sta xps+5 | ||
+ | lda xpss+6 | ||
+ | sta xps+6 | ||
+ | lda xpss+7 | ||
+ | sta xps+7 | ||
+ | |||
+ | |||
+ | ldx #width-1 | ||
+ | |||
+ | -loop | ||
+ | |||
+ | ;update x pointers... | ||
+ | |||
+ | tya | ||
+ | clc | ||
+ | +a0 adc #0 | ||
+ | tay | ||
+ | lda xps+1 | ||
+ | +a1 adc #1 | ||
+ | sta xps+1 | ||
+ | sta xpointers1, | ||
+ | |||
+ | lda xps+2 | ||
+ | clc | ||
+ | +a2 adc #2 | ||
+ | sta xps+2 | ||
+ | lda xps+3 | ||
+ | +a3 adc #3 | ||
+ | sta xps+3 | ||
+ | sta xpointers2, | ||
+ | |||
+ | lda xps+4 | ||
+ | clc | ||
+ | +a4 adc #4 | ||
+ | sta xps+4 | ||
+ | lda xps+5 | ||
+ | +a5 adc #5 | ||
+ | sta xps+5 | ||
+ | sta xpointers3, | ||
+ | |||
+ | lda xps+6 | ||
+ | clc | ||
+ | +a6 adc #6 | ||
+ | sta xps+6 | ||
+ | lda xps+7 | ||
+ | +a7 adc #7 | ||
+ | sta xps+7 | ||
+ | sta xpointers4, | ||
+ | |||
+ | dex | ||
+ | bpl -loop | ||
+ | |||
+ | rts | ||
+ | |||
+ | |||
+ | |||
+ | xpss .wo $1000, | ||
+ | xpa .wo $fd80, | ||
+ | ypa .wo $0401, | ||
+ | ; | ||
+ | |||
+ | paintline2 | ||
+ | |||
+ | ; | ||
+ | ;(all cycles) | ||
+ | |||
+ | ;optimized so all 15 cycles are stored for each byte at a time | ||
+ | ; | ||
+ | |||
+ | |||
+ | ;args: | ||
+ | ;- line ($00-$ff value for each pixel) | ||
+ | ;- y | ||
+ | |||
+ | |||
+ | ;calc sprite target adr... | ||
+ | |||
+ | ldy y | ||
+ | ldx mod21,y | ||
+ | lda mul3,x | ||
+ | clc | ||
+ | adc #< | ||
+ | sta sprs | ||
+ | |||
+ | ldy y | ||
+ | ldx div21,y | ||
+ | lda ssadd,x | ||
+ | ora #> | ||
+ | sta sprs+1 | ||
+ | sta tmp | ||
+ | |||
+ | clc | ||
+ | lda #> | ||
+ | sta mcl1+1 | ||
+ | adc #$02 | ||
+ | sta mcl2+1 | ||
+ | adc #$02 | ||
+ | sta mcl3+1 | ||
+ | adc #$02 | ||
+ | sta mcl4+1 | ||
+ | |||
+ | ldx # | ||
+ | |||
+ | -loop | ||
+ | |||
+ | ;or 4 pixels together... | ||
+ | |||
+ | ldy mul4,x | ||
+ | |||
+ | lda line+3,y | ||
+ | sta mcl1 ; | ||
+ | lda line+2,y | ||
+ | sta mcl2 | ||
+ | lda line+1,y | ||
+ | sta mcl3 | ||
+ | lda line+0,y | ||
+ | sta mcl4 | ||
+ | |||
+ | ldy #0 | ||
+ | lda (mcl1),y | ||
+ | ora (mcl2),y | ||
+ | ora (mcl3),y | ||
+ | ora (mcl4),y | ||
+ | sta (sprs),y | ||
+ | |||
+ | ldy #17 | ||
+ | lda (mcl1),y | ||
+ | ora (mcl2),y | ||
+ | ora (mcl3),y | ||
+ | ora (mcl4),y | ||
+ | ldy #$40 | ||
+ | sta (sprs),y | ||
+ | |||
+ | ldy #17*2 | ||
+ | lda (mcl1),y | ||
+ | ora (mcl2),y | ||
+ | ora (mcl3),y | ||
+ | ora (mcl4),y | ||
+ | ldy #$80 | ||
+ | sta (sprs),y | ||
+ | |||
+ | ldy #17*3 | ||
+ | lda (mcl1),y | ||
+ | ora (mcl2),y | ||
+ | ora (mcl3),y | ||
+ | ora (mcl4),y | ||
+ | ldy #$c0 | ||
+ | sta (sprs),y | ||
+ | |||
+ | inc sprs+1 | ||
+ | ldy #17*4 | ||
+ | lda (mcl1),y | ||
+ | ora (mcl2),y | ||
+ | ora (mcl3),y | ||
+ | ora (mcl4),y | ||
+ | ldy #$00 | ||
+ | sta (sprs),y | ||
+ | |||
+ | ldy #17*5 | ||
+ | lda (mcl1),y | ||
+ | ora (mcl2),y | ||
+ | ora (mcl3),y | ||
+ | ora (mcl4),y | ||
+ | ldy #$40 | ||
+ | sta (sprs),y | ||
+ | |||
+ | ldy #17*6 | ||
+ | lda (mcl1),y | ||
+ | ora (mcl2),y | ||
+ | ora (mcl3),y | ||
+ | ora (mcl4),y | ||
+ | ldy #$80 | ||
+ | sta (sprs),y | ||
+ | |||
+ | ldy #17*7 | ||
+ | lda (mcl1),y | ||
+ | ora (mcl2),y | ||
+ | ora (mcl3),y | ||
+ | ora (mcl4),y | ||
+ | ldy #$c0 | ||
+ | sta (sprs),y | ||
+ | |||
+ | inc sprs+1 | ||
+ | ldy #17*8 | ||
+ | lda (mcl1),y | ||
+ | ora (mcl2),y | ||
+ | ora (mcl3),y | ||
+ | ora (mcl4),y | ||
+ | ldy #$00 | ||
+ | sta (sprs),y | ||
+ | |||
+ | ldy #17*9 | ||
+ | lda (mcl1),y | ||
+ | ora (mcl2),y | ||
+ | ora (mcl3),y | ||
+ | ora (mcl4),y | ||
+ | ldy #$40 | ||
+ | sta (sprs),y | ||
+ | |||
+ | ldy #17*10 | ||
+ | lda (mcl1),y | ||
+ | ora (mcl2),y | ||
+ | ora (mcl3),y | ||
+ | ora (mcl4),y | ||
+ | ldy #$80 | ||
+ | sta (sprs),y | ||
+ | |||
+ | ldy #17*11 | ||
+ | lda (mcl1),y | ||
+ | ora (mcl2),y | ||
+ | ora (mcl3),y | ||
+ | ora (mcl4),y | ||
+ | ldy #$c0 | ||
+ | sta (sprs),y | ||
+ | |||
+ | inc sprs+1 | ||
+ | ldy #17*12 | ||
+ | lda (mcl1),y | ||
+ | ora (mcl2),y | ||
+ | ora (mcl3),y | ||
+ | ora (mcl4),y | ||
+ | ldy #$00 | ||
+ | sta (sprs),y | ||
+ | |||
+ | ldy #17*13 | ||
+ | lda (mcl1),y | ||
+ | ora (mcl2),y | ||
+ | ora (mcl3),y | ||
+ | ora (mcl4),y | ||
+ | ldy #$40 | ||
+ | sta (sprs),y | ||
+ | |||
+ | ldy #17*14 | ||
+ | lda (mcl1),y | ||
+ | ora (mcl2),y | ||
+ | ora (mcl3),y | ||
+ | ora (mcl4),y | ||
+ | ldy #$80 | ||
+ | sta (sprs),y | ||
+ | |||
+ | lda tmp | ||
+ | sta sprs+1 | ||
+ | |||
+ | |||
+ | lda spraddlo,x | ||
+ | clc | ||
+ | adc sprs | ||
+ | sta sprs | ||
+ | bcc+ | ||
+ | lda spraddhi,x | ||
+ | adc sprs+1 | ||
+ | sta sprs+1 | ||
+ | sta tmp | ||
+ | + | ||
+ | |||
+ | dex | ||
+ | bmi + | ||
+ | jmp -loop | ||
+ | + | ||
+ | |||
+ | rts | ||
+ | |||
+ | |||
+ | ssadd .by $00,$a0,$20 | ||
+ | spraddlo .by $fe, | ||
+ | spraddhi .by $03, | ||
+ | div21 .by 0, | ||
+ | .by 1, | ||
+ | .by 2, | ||
+ | mod21 .by 0, | ||
+ | .by 0, | ||
+ | .by 0, | ||
+ | ; | ||
+ | |||
+ | scrolltext | ||
+ | |||
+ | .text " | ||
+ | |||
+ | .text " | ||
+ | .text " | ||
+ | .text " | ||
+ | .text "Drax, Fanta, JCH and Jeff, and scrolltext in part 4 by Slammer... | ||
+ | |||
+ | .text "Next follows some nerd info about the routines to which you've been subjected, so you can get to know 'em a bit better... | ||
+ | |||
+ | .text " | ||
+ | .text "so please excuse me if I make an ass outta myself " | ||
+ | .text "by taking credit for inventing something which was allready invented in the 1st place! | ||
+ | |||
+ | .text "OK, with that outta the way, let's start the braggin' | ||
+ | .text " | ||
+ | |||
+ | .text "#01 - Wobbler... | ||
+ | .text " | ||
+ | .text " | ||
+ | .text " | ||
+ | .text "color like in 4x4-mode. | ||
+ | .text "But in 4x4 there' | ||
+ | .text "so it's ofcourse a bit more tricky to make big stuff in this mode, " | ||
+ | .text "but I still think it's got some potential... | ||
+ | |||
+ | .text " | ||
+ | .text "#02 - Glenz Each Frame... | ||
+ | .text "Was supposed to be a bit larger, but the bigger version " | ||
+ | .text "kept fucking up, so after a while I reached the point of agony " | ||
+ | .text "and decided 2 release this smaller, but working version. | ||
+ | .text "But still it's prolly the fastest filled vector routine ever on the C64. " | ||
+ | .text "The concept is that all y-coords for all lines are precalculated - " | ||
+ | .text "and I'm not just talking about the start/end coords, but the y-values for all pixels " | ||
+ | .text "in each line. Sounds like it would fill up way too much for the scarce memory of the C64, " | ||
+ | .text "but actually it's packed down to about 8K. " | ||
+ | .tex "The trick is that a line pointing in one direction can use the " | ||
+ | .text "same y-coords as other lines with the same slope, even if they' | ||
+ | .text "and got different lengths. | ||
+ | .text "This means that the linedrawer doesn' | ||
+ | .text "it just looks up the y-value of each pixel, and plots it. Another major " | ||
+ | .text " | ||
+ | .text "This makes the filler 25% faster, but the catch is that the line drawer must plot the dots " | ||
+ | .text " | ||
+ | .text "the y-values hafta be multiplied by 5 to make this work. " | ||
+ | .text "But luckily my linedrawer (aka the " | ||
+ | .text "so if the table is pre-multiplied by 5, it works w/o using any extra cycles. | ||
+ | .text " | ||
+ | |||
+ | .text " | ||
+ | .text "#03 - FLI Fluffy ... " | ||
+ | .text "The 1st FLI Fluffy ever, AFAIK. | ||
+ | .text "Guess there' | ||
+ | .text "still waiting to be realised. | ||
+ | .text "and see if you can remember what woulda been considered impossible dreams on a C64 back then. " | ||
+ | .text "For example "All border realtime texture mapped FLI rubber vector each frame combined with a DYSP and raster splits" | ||
+ | .text "A good source of inspiration is to take a look at a bunch of Amiga demos from that period. | ||
+ | .text "Lots of the routines that were ruling the Amiga scene back then have ofcourse been C64-ized long ago, " | ||
+ | .text "but there' | ||
+ | .text "And don't give up just because there' | ||
+ | .text "lousy C64 version of a routine - that prolly just means there' | ||
+ | |||
+ | |||
+ | .text " | ||
+ | .text "#04 - Copper-plasma ... " | ||
+ | .text "Just some oldskool rasterbender/ | ||
+ | .text "Only 2nd line and stuff, but atleast the sines are large, " | ||
+ | .text "like they used to be on the good old Amiga... | ||
+ | .text " | ||
+ | .text "It only needs updating each 4th line, and the rest of the cycles are just pretty much " | ||
+ | .text " | ||
+ | .text "it coulda been about 20% bigger I guess. | ||
+ | |||
+ | .text " | ||
+ | .text "#05 - Plasma (diz 1) ... " | ||
+ | .text "Only the usual 4 multicolor-colors " | ||
+ | .byte 0 | ||
+ | .text " a time, but " | ||
+ | .byte 0 | ||
+ | .text "least it looks pretty plasmatic, IMHO. " | ||
+ | .text "And isn't plasmaticity what counts when " | ||
+ | .text "it cums to plasma? | ||
+ | .text "ppls plasmaticity perception is a matter of personal plasma preferences.... | ||
+ | |||
+ | .text " | ||
+ | .by 0 | ||
+ | .text " about does it for diz li'l demo... | ||
+ | .text "But ya never know when it's time for the kR4Zy k4m3Lz 2 bust new tricks, " | ||
+ | .text "so watch out for future CML prodz! | ||
+ | .text " | ||
+ | |||
+ | .by 255 | ||
+ | |||
+ | </ | ||
base/colorcycleplasma.txt · Last modified: 2015-04-17 04:30 by 127.0.0.1