base:2nd_pixel_fli_distorter
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | base:2nd_pixel_fli_distorter [2015-04-17 04:30] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== 2nd Pixel FLI Distorter ====== | ||
+ | |||
+ | The concept for this routine is to generate and animation of a logo wobbling in some sine waves. Instead of playing the animation normally, some sine values control which frame is displayed for each rasterline, similarly to e.g. rubbervector. I couldn' | ||
+ | |||
+ | < | ||
+ | ; | ||
+ | ; 2nd Pixel FLI Distorter | ||
+ | ; | ||
+ | ; Coded by Cruzer/CML 2002-2004 | ||
+ | ; Released in You Know the Routine/ | ||
+ | ; Assembled with MXass | ||
+ | ; To get the binaries: Run the demo part and save $1000-$bfff | ||
+ | ; | ||
+ | ; Disclaimer: I'm not very proud of the state of this code in terms of | ||
+ | ; readability and stuff. The assembler is also kinda lame, so I cannot | ||
+ | ; recommend it. I'm now using Kick Assembler, which I can highly recommend. | ||
+ | ; | ||
+ | ; | ||
+ | ; | ||
+ | ; | ||
+ | ; | ||
+ | ; | ||
+ | ; | ||
+ | ; | ||
+ | ; | ||
+ | ; | ||
+ | |||
+ | .la newlogo=0 | ||
+ | ; | ||
+ | |||
+ | .la width = 24 ;chars | ||
+ | .la height = 67 ;pixels | ||
+ | .la frames = 20 ;in logo animation | ||
+ | |||
+ | .la wp = $02 | ||
+ | .la wpo = wp+height | ||
+ | .la hiphopzp = $a0 | ||
+ | |||
+ | .la hiphopscreen | ||
+ | .la siner = $0820 ;* | ||
+ | ;.la sine = $0c00 ;used by logo generator | ||
+ | .la d011 = $0c00 ;* | ||
+ | .la d018 = $0c50 ;* | ||
+ | .la sine2 = $0e00 | ||
+ | .la main = $21b0 | ||
+ | .la logo = $3000 ;note! overwritten by code+data now! | ||
+ | .la hiphopfont | ||
+ | .la hiphopcharset | ||
+ | .la anim = $4000 | ||
+ | .la wobbler | ||
+ | .la bitmap | ||
+ | .la screens | ||
+ | |||
+ | .ba main | ||
+ | .la border=$d0ff | ||
+ | |||
+ | ; | ||
+ | jmp start | ||
+ | |||
+ | x .by 0 | ||
+ | y .by 0 | ||
+ | |||
+ | tmp .wo 0 | ||
+ | |||
+ | |||
+ | wobbling .by 0 | ||
+ | |||
+ | ; | ||
+ | start | ||
+ | |||
+ | sei | ||
+ | lda #$00 | ||
+ | sta $d020 | ||
+ | sta $d021 | ||
+ | |||
+ | jsr init | ||
+ | |||
+ | lda #$00 | ||
+ | jsr $1000 | ||
+ | |||
+ | cli | ||
+ | sei | ||
+ | |||
+ | lda #<main1 | ||
+ | sta $0314 | ||
+ | lda #>main1 | ||
+ | sta $0315 | ||
+ | asl $d019 | ||
+ | lda #$7b | ||
+ | sta $dc0d | ||
+ | lda #$81 | ||
+ | sta $d01a | ||
+ | lda #$1b | ||
+ | sta $d011 | ||
+ | lda #$a0 | ||
+ | sta $d012 | ||
+ | cli | ||
+ | |||
+ | |||
+ | ldx #0 | ||
+ | ldy #0 | ||
+ | - | ||
+ | nop | ||
+ | nop | ||
+ | inx | ||
+ | bne - | ||
+ | iny | ||
+ | bne - | ||
+ | |||
+ | |||
+ | -loop | ||
+ | |||
+ | jsr hiphopclear | ||
+ | |||
+ | lda wobbling | ||
+ | bne +skip | ||
+ | |||
+ | lda msg | ||
+ | asl | ||
+ | tax | ||
+ | lda hiphopscreenoffsets, | ||
+ | cmp #$ff | ||
+ | bne + | ||
+ | jsr hiphopscreensetup3 | ||
+ | jmp +skip | ||
+ | + sta hiphopscreenoffset | ||
+ | lda hiphopscreenoffsets+1, | ||
+ | sta hiphopscreenoffset+1 | ||
+ | jsr hiphopscreensetup | ||
+ | +skip | ||
+ | lda #1 | ||
+ | sta cleared | ||
+ | |||
+ | jsr tag | ||
+ | |||
+ | lda #1 | ||
+ | sta tagged | ||
+ | |||
+ | -wait | ||
+ | lda hiphopstop | ||
+ | bne +load | ||
+ | lda tagged | ||
+ | bne -wait | ||
+ | |||
+ | jmp -loop | ||
+ | |||
+ | +load | ||
+ | |||
+ | lda #1 | ||
+ | sta stopirq | ||
+ | |||
+ | - lda irqstopped | ||
+ | beq - | ||
+ | |||
+ | loadnext | ||
+ | sei | ||
+ | lda #$0a | ||
+ | sta $d021 | ||
+ | lda #$00 | ||
+ | sta $d01a | ||
+ | sta $d015 | ||
+ | lda #$14 | ||
+ | sta $d018 | ||
+ | lda #$37 | ||
+ | sta $01 | ||
+ | lda zp2e | ||
+ | sta $2e | ||
+ | lda zp2f | ||
+ | sta $2f | ||
+ | |||
+ | ldx #0 | ||
+ | - | ||
+ | lda $0a00,x | ||
+ | sta $c000,x | ||
+ | lda $0b00,x | ||
+ | sta $c100,x | ||
+ | inx | ||
+ | bne - | ||
+ | |||
+ | jmp $c1f0 | ||
+ | |||
+ | |||
+ | zp2e .by 0 | ||
+ | zp2f .by 0 | ||
+ | |||
+ | tagged .by 0 | ||
+ | cleared .by 0 | ||
+ | hiphopstop .by 0 | ||
+ | |||
+ | stopirq .by 0 | ||
+ | irqstopped .by 0 | ||
+ | |||
+ | ; | ||
+ | main1 ;just text... | ||
+ | |||
+ | asl $d019 | ||
+ | |||
+ | |||
+ | |||
+ | inc border | ||
+ | jsr $1003 | ||
+ | |||
+ | lda doubledraw | ||
+ | bne +notimetowaste | ||
+ | |||
+ | inc border | ||
+ | |||
+ | lda #$fc | ||
+ | - cmp $d012 | ||
+ | bne - | ||
+ | |||
+ | lda #$20 | ||
+ | - cmp $d012 | ||
+ | bne - | ||
+ | |||
+ | |||
+ | +notimetowaste | ||
+ | |||
+ | lda #$97 | ||
+ | sta $dd00 | ||
+ | lda #$1e | ||
+ | sta $d018 | ||
+ | lda #$c8 | ||
+ | sta $d016 | ||
+ | lda hiphopcolor | ||
+ | sta $d021 | ||
+ | lda d011+$0f | ||
+ | and #$1f | ||
+ | sta $d011 | ||
+ | |||
+ | |||
+ | inc border | ||
+ | jsr hiphopcontrol | ||
+ | |||
+ | jsr spacecontrol | ||
+ | |||
+ | lda #$09 | ||
+ | sta border | ||
+ | |||
+ | |||
+ | lda wobbling | ||
+ | beq ri | ||
+ | |||
+ | lda #<main2 | ||
+ | sta $0314 | ||
+ | lda #>main2 | ||
+ | sta $0315 | ||
+ | lda #$53 | ||
+ | sta $d012 | ||
+ | asl $d019 | ||
+ | |||
+ | ri | ||
+ | pla | ||
+ | tay | ||
+ | pla | ||
+ | tax | ||
+ | pla | ||
+ | rti | ||
+ | |||
+ | |||
+ | |||
+ | main2 ; | ||
+ | |||
+ | |||
+ | asl $d019 | ||
+ | |||
+ | inc border | ||
+ | jsr flishow | ||
+ | |||
+ | inc border | ||
+ | jsr $1003 | ||
+ | |||
+ | |||
+ | lda cnt | ||
+ | ora cnt+1 | ||
+ | bne +wob | ||
+ | lda #1 | ||
+ | sta border | ||
+ | jsr updatesiner | ||
+ | jmp +skip | ||
+ | |||
+ | +wob | ||
+ | inc border | ||
+ | jsr wobbleit | ||
+ | |||
+ | |||
+ | +skip | ||
+ | |||
+ | jsr hiphopcontrol | ||
+ | |||
+ | lda #$00 | ||
+ | sta border | ||
+ | |||
+ | jsr effectcontrol | ||
+ | |||
+ | jsr spacecontrol | ||
+ | jsr checkrastertime | ||
+ | |||
+ | lda #$09 | ||
+ | sta border | ||
+ | |||
+ | jmp ri | ||
+ | |||
+ | |||
+ | |||
+ | fadeoutirq | ||
+ | |||
+ | asl $d019 | ||
+ | |||
+ | lda stopirq | ||
+ | bne +stop | ||
+ | |||
+ | ldx cnt | ||
+ | lda fadecolz,x | ||
+ | sta $d020 | ||
+ | lda cnt | ||
+ | cmp #9 | ||
+ | beq + | ||
+ | inc cnt | ||
+ | jmp +j | ||
+ | + | ||
+ | jmp loadnext | ||
+ | lda #1 | ||
+ | sta hiphopstop | ||
+ | +j | ||
+ | jmp ri | ||
+ | |||
+ | |||
+ | +stop | ||
+ | |||
+ | lda #$00 | ||
+ | sta $d01a | ||
+ | lda #1 | ||
+ | sta irqstopped | ||
+ | jmp ri | ||
+ | |||
+ | fadecolz .by $0, | ||
+ | |||
+ | ; | ||
+ | spacecontrol | ||
+ | |||
+ | lda $dc01 | ||
+ | cmp #$ef | ||
+ | beq +space | ||
+ | rts | ||
+ | |||
+ | +space | ||
+ | |||
+ | lda #< | ||
+ | sta $0314 | ||
+ | lda #> | ||
+ | sta $0315 | ||
+ | lda #$00 | ||
+ | sta $d012 | ||
+ | sta cnt | ||
+ | asl $d019 | ||
+ | |||
+ | sta $d418 | ||
+ | sta $d011 | ||
+ | |||
+ | rts | ||
+ | |||
+ | ; | ||
+ | checkrastertime | ||
+ | |||
+ | ;if (rastertime==too little) | ||
+ | ;then use more, so hiphop-msg don't get tagged too fast... | ||
+ | |||
+ | - lda $d012 | ||
+ | sec | ||
+ | sbc #$aa | ||
+ | bcs - | ||
+ | - lda $d011 | ||
+ | and #$80 | ||
+ | bne - | ||
+ | |||
+ | rts | ||
+ | |||
+ | ; | ||
+ | |||
+ | effectcontrol | ||
+ | |||
+ | lda cnt | ||
+ | clc | ||
+ | adc #1 | ||
+ | sta cnt | ||
+ | lda cnt+1 | ||
+ | adc #0 | ||
+ | sta cnt+1 | ||
+ | |||
+ | lda cnt+0 | ||
+ | cmp #0 | ||
+ | bne + | ||
+ | lda cnt+1 | ||
+ | cmp #2 | ||
+ | bne + | ||
+ | jsr startfadeout | ||
+ | + | ||
+ | |||
+ | jsr effectfadein | ||
+ | jsr effectfadeout | ||
+ | |||
+ | rts | ||
+ | |||
+ | cnt .wo 0 | ||
+ | |||
+ | |||
+ | |||
+ | neweffect | ||
+ | |||
+ | ldx effect | ||
+ | lda sineadds,x | ||
+ | sta sineadd | ||
+ | txa | ||
+ | asl | ||
+ | tax | ||
+ | lda sinespreads, | ||
+ | sta sinespread | ||
+ | lda sinespreads+1, | ||
+ | sta sinespread+1 | ||
+ | |||
+ | lda #0 | ||
+ | sta cnt | ||
+ | sta cnt+1 | ||
+ | |||
+ | inc effect | ||
+ | lda effect | ||
+ | cmp #4 | ||
+ | bne + | ||
+ | lda #0 | ||
+ | sta effect | ||
+ | + | ||
+ | |||
+ | lda #1 | ||
+ | sta first | ||
+ | |||
+ | jsr startfadein | ||
+ | |||
+ | rts | ||
+ | |||
+ | sinespreads | ||
+ | |||
+ | ;.wo $0100, | ||
+ | .wo $0100, | ||
+ | |||
+ | sineadds | ||
+ | ;.by $01, | ||
+ | .by $01, | ||
+ | |||
+ | ; | ||
+ | startfadeout | ||
+ | |||
+ | lda #0 | ||
+ | sta fadeoutpnt | ||
+ | rts | ||
+ | |||
+ | effectfadeout | ||
+ | |||
+ | |||
+ | lda fadeoutpnt | ||
+ | cmp #20 | ||
+ | bne + | ||
+ | rts | ||
+ | + | ||
+ | lsr | ||
+ | tax | ||
+ | lda d011,x | ||
+ | ora #$40 | ||
+ | sta d011,x | ||
+ | lda d011+10,x | ||
+ | ora #$40 | ||
+ | sta d011+10,x | ||
+ | lda d011+20,x | ||
+ | ora #$40 | ||
+ | sta d011+20,x | ||
+ | lda d011+30,x | ||
+ | ora #$40 | ||
+ | sta d011+30,x | ||
+ | lda d011+40,x | ||
+ | ora #$40 | ||
+ | sta d011+40,x | ||
+ | lda d011+50,x | ||
+ | ora #$40 | ||
+ | sta d011+50,x | ||
+ | lda d011+60,x | ||
+ | ora #$40 | ||
+ | sta d011+60,x | ||
+ | lda d011+70,x | ||
+ | ora #$40 | ||
+ | sta d011+70,x | ||
+ | |||
+ | inc fadeoutpnt | ||
+ | lda fadeoutpnt | ||
+ | cmp #20 | ||
+ | bne + | ||
+ | jsr neweffect | ||
+ | + | ||
+ | |||
+ | rts | ||
+ | |||
+ | |||
+ | fadeoutpnt .by 20 | ||
+ | |||
+ | |||
+ | |||
+ | startfadein | ||
+ | |||
+ | lda #0 | ||
+ | sta fadeinpnt | ||
+ | rts | ||
+ | |||
+ | |||
+ | effectfadein | ||
+ | |||
+ | |||
+ | lda fadeinpnt | ||
+ | cmp #20 | ||
+ | bne + | ||
+ | rts | ||
+ | + | ||
+ | sec | ||
+ | sbc #10 | ||
+ | bcs + | ||
+ | jmp +j | ||
+ | + | ||
+ | tax | ||
+ | lda d011,x | ||
+ | and #$3f | ||
+ | sta d011,x | ||
+ | lda d011+10,x | ||
+ | and #$3f | ||
+ | sta d011+10,x | ||
+ | lda d011+20,x | ||
+ | and #$3f | ||
+ | sta d011+20,x | ||
+ | lda d011+30,x | ||
+ | and #$3f | ||
+ | sta d011+30,x | ||
+ | lda d011+40,x | ||
+ | and #$3f | ||
+ | sta d011+40,x | ||
+ | lda d011+50,x | ||
+ | and #$3f | ||
+ | sta d011+50,x | ||
+ | lda d011+60,x | ||
+ | and #$3f | ||
+ | sta d011+60,x | ||
+ | lda d011+70,x | ||
+ | and #$3f | ||
+ | sta d011+70,x | ||
+ | |||
+ | +j | ||
+ | inc fadeinpnt | ||
+ | |||
+ | rts | ||
+ | |||
+ | |||
+ | fadeinpnt .by 20 | ||
+ | |||
+ | ;.text " | ||
+ | ; | ||
+ | flishow | ||
+ | |||
+ | lda #$00 | ||
+ | sta $d021 | ||
+ | |||
+ | nop | ||
+ | nop | ||
+ | |||
+ | lda #$94 | ||
+ | sta $dd00 | ||
+ | |||
+ | lda $d011 | ||
+ | ora #$30 | ||
+ | sta $d011 | ||
+ | |||
+ | lda #$d8 | ||
+ | sta $d016 | ||
+ | |||
+ | ;nop | ||
+ | ;nop | ||
+ | ;nop | ||
+ | nop | ||
+ | nop | ||
+ | |||
+ | ldy #$00 | ||
+ | -loop | ||
+ | lda d011,y | ||
+ | sta $d011 | ||
+ | lda d018,y | ||
+ | sta $d018 | ||
+ | iny | ||
+ | cpy #$4c | ||
+ | bne -loop | ||
+ | |||
+ | inc border | ||
+ | |||
+ | |||
+ | |||
+ | lda d011+$0f | ||
+ | ora #$70 | ||
+ | ;and #$1f | ||
+ | sta $d011 | ||
+ | |||
+ | lda #$97 | ||
+ | sta $dd00 | ||
+ | lda #$1e | ||
+ | sta $d018 | ||
+ | lda #$c8 | ||
+ | sta $d016 | ||
+ | lda hiphopcolor | ||
+ | sta $d021 | ||
+ | |||
+ | ldx #$1c | ||
+ | - dex | ||
+ | bne - | ||
+ | |||
+ | lda d011+$0f | ||
+ | and #$1f | ||
+ | sta $d011 | ||
+ | |||
+ | lda #$00 | ||
+ | sta $ffff | ||
+ | |||
+ | rts | ||
+ | |||
+ | |||
+ | |||
+ | ; | ||
+ | wobbleit | ||
+ | |||
+ | |||
+ | ;copy wobblepointers to old wobblepointers | ||
+ | |||
+ | lda wp+0 | ||
+ | sta wpo+0 | ||
+ | lda wp+1 | ||
+ | sta wpo+1 | ||
+ | lda wp+2 | ||
+ | sta wpo+2 | ||
+ | lda wp+3 | ||
+ | sta wpo+3 | ||
+ | lda wp+4 | ||
+ | sta wpo+4 | ||
+ | lda wp+5 | ||
+ | sta wpo+5 | ||
+ | lda wp+6 | ||
+ | sta wpo+6 | ||
+ | lda wp+7 | ||
+ | sta wpo+7 | ||
+ | lda wp+8 | ||
+ | sta wpo+8 | ||
+ | lda wp+9 | ||
+ | sta wpo+9 | ||
+ | lda wp+10 | ||
+ | sta wpo+10 | ||
+ | lda wp+11 | ||
+ | sta wpo+11 | ||
+ | lda wp+12 | ||
+ | sta wpo+12 | ||
+ | lda wp+13 | ||
+ | sta wpo+13 | ||
+ | lda wp+14 | ||
+ | sta wpo+14 | ||
+ | lda wp+15 | ||
+ | sta wpo+15 | ||
+ | lda wp+16 | ||
+ | sta wpo+16 | ||
+ | lda wp+17 | ||
+ | sta wpo+17 | ||
+ | lda wp+18 | ||
+ | sta wpo+18 | ||
+ | lda wp+19 | ||
+ | sta wpo+19 | ||
+ | lda wp+20 | ||
+ | sta wpo+20 | ||
+ | lda wp+21 | ||
+ | sta wpo+21 | ||
+ | lda wp+22 | ||
+ | sta wpo+22 | ||
+ | lda wp+23 | ||
+ | sta wpo+23 | ||
+ | lda wp+24 | ||
+ | sta wpo+24 | ||
+ | lda wp+25 | ||
+ | sta wpo+25 | ||
+ | lda wp+26 | ||
+ | sta wpo+26 | ||
+ | lda wp+27 | ||
+ | sta wpo+27 | ||
+ | lda wp+28 | ||
+ | sta wpo+28 | ||
+ | lda wp+29 | ||
+ | sta wpo+29 | ||
+ | lda wp+30 | ||
+ | sta wpo+30 | ||
+ | lda wp+31 | ||
+ | sta wpo+31 | ||
+ | lda wp+32 | ||
+ | sta wpo+32 | ||
+ | lda wp+33 | ||
+ | sta wpo+33 | ||
+ | lda wp+34 | ||
+ | sta wpo+34 | ||
+ | lda wp+35 | ||
+ | sta wpo+35 | ||
+ | lda wp+36 | ||
+ | sta wpo+36 | ||
+ | lda wp+37 | ||
+ | sta wpo+37 | ||
+ | lda wp+38 | ||
+ | sta wpo+38 | ||
+ | lda wp+39 | ||
+ | sta wpo+39 | ||
+ | lda wp+40 | ||
+ | sta wpo+40 | ||
+ | lda wp+41 | ||
+ | sta wpo+41 | ||
+ | lda wp+42 | ||
+ | sta wpo+42 | ||
+ | lda wp+43 | ||
+ | sta wpo+43 | ||
+ | lda wp+44 | ||
+ | sta wpo+44 | ||
+ | lda wp+45 | ||
+ | sta wpo+45 | ||
+ | lda wp+46 | ||
+ | sta wpo+46 | ||
+ | lda wp+47 | ||
+ | sta wpo+47 | ||
+ | lda wp+48 | ||
+ | sta wpo+48 | ||
+ | lda wp+49 | ||
+ | sta wpo+49 | ||
+ | lda wp+50 | ||
+ | sta wpo+50 | ||
+ | lda wp+51 | ||
+ | sta wpo+51 | ||
+ | lda wp+52 | ||
+ | sta wpo+52 | ||
+ | lda wp+53 | ||
+ | sta wpo+53 | ||
+ | lda wp+54 | ||
+ | sta wpo+54 | ||
+ | lda wp+55 | ||
+ | sta wpo+55 | ||
+ | lda wp+56 | ||
+ | sta wpo+56 | ||
+ | lda wp+57 | ||
+ | sta wpo+57 | ||
+ | lda wp+58 | ||
+ | sta wpo+58 | ||
+ | lda wp+59 | ||
+ | sta wpo+59 | ||
+ | lda wp+60 | ||
+ | sta wpo+60 | ||
+ | lda wp+61 | ||
+ | sta wpo+61 | ||
+ | lda wp+62 | ||
+ | sta wpo+62 | ||
+ | lda wp+63 | ||
+ | sta wpo+63 | ||
+ | lda wp+64 | ||
+ | sta wpo+64 | ||
+ | lda wp+65 | ||
+ | sta wpo+65 | ||
+ | lda wp+66 | ||
+ | sta wpo+66 | ||
+ | |||
+ | |||
+ | inc border | ||
+ | |||
+ | |||
+ | ;lda effect | ||
+ | ;beq +showanim | ||
+ | |||
+ | +sine | ||
+ | |||
+ | lda sinepnt | ||
+ | tay | ||
+ | lda first | ||
+ | beq + | ||
+ | jsr siner+$a0 | ||
+ | jmp +j | ||
+ | + jsr siner | ||
+ | +j | ||
+ | lda #0 | ||
+ | sta first | ||
+ | |||
+ | lda sinepnt | ||
+ | clc | ||
+ | adc sineadd | ||
+ | sta sinepnt | ||
+ | |||
+ | jmp +skip | ||
+ | |||
+ | first .by 0 | ||
+ | effect .by 0 | ||
+ | sinepnt .by 0 | ||
+ | sineadd .by 0 | ||
+ | |||
+ | |||
+ | +showanim | ||
+ | |||
+ | ;show anim-frames... | ||
+ | |||
+ | ldx #height | ||
+ | lda +testfr | ||
+ | beq + | ||
+ | cmp #2 | ||
+ | beq +sk | ||
+ | dex | ||
+ | + | ||
+ | lda +testfr+1 | ||
+ | - | ||
+ | sta wp,x | ||
+ | dex | ||
+ | dex | ||
+ | bpl - | ||
+ | |||
+ | +sk | ||
+ | |||
+ | inc +testfr | ||
+ | lda +testfr | ||
+ | cmp #3 ;3rd frame | ||
+ | bne + | ||
+ | lda #0 | ||
+ | sta +testfr | ||
+ | inc +testfr+1 | ||
+ | lda +testfr+1 | ||
+ | cmp #20 | ||
+ | bne + | ||
+ | lda #0 | ||
+ | sta +testfr+1 | ||
+ | + | ||
+ | |||
+ | jmp +skip | ||
+ | |||
+ | +testfr .wo 0 | ||
+ | |||
+ | |||
+ | |||
+ | +skip | ||
+ | |||
+ | inc border | ||
+ | |||
+ | lda #$34 | ||
+ | sta $01 | ||
+ | |||
+ | jsr wobbler | ||
+ | |||
+ | lda #$36 | ||
+ | sta $01 | ||
+ | |||
+ | rts | ||
+ | |||
+ | +fr .by 0 | ||
+ | |||
+ | |||
+ | |||
+ | ; | ||
+ | ; | ||
+ | ; | ||
+ | |||
+ | |||
+ | |||
+ | hiphopinit | ||
+ | |||
+ | |||
+ | lda $2e | ||
+ | sta zp2e | ||
+ | lda $2f | ||
+ | sta zp2f | ||
+ | |||
+ | jsr hiphopclear | ||
+ | jsr hiphopscreensetup | ||
+ | |||
+ | rts | ||
+ | |||
+ | |||
+ | hiphopscreensetup3 | ||
+ | |||
+ | |||
+ | ;lda #< | ||
+ | lda #<533 | ||
+ | sta hiphopscreenoffset | ||
+ | lda #>533 | ||
+ | sta hiphopscreenoffset+1 | ||
+ | jsr hiphopscreensetup | ||
+ | |||
+ | rts | ||
+ | |||
+ | |||
+ | hiphopscreensetup | ||
+ | |||
+ | |||
+ | |||
+ | ldx #$00 | ||
+ | txa | ||
+ | - | ||
+ | sta hiphopscreen+$0000, | ||
+ | sta hiphopscreen+$0100, | ||
+ | sta hiphopscreen+$0200, | ||
+ | sta hiphopscreen+$0300, | ||
+ | inx | ||
+ | bne - | ||
+ | |||
+ | |||
+ | .la hhs=$f0 | ||
+ | |||
+ | |||
+ | hiphopscreensetup2 | ||
+ | |||
+ | lda #< | ||
+ | sta hhs | ||
+ | lda #> | ||
+ | sta hhs+1 | ||
+ | |||
+ | lda hhs | ||
+ | clc | ||
+ | adc hiphopscreenoffset | ||
+ | sta hhs | ||
+ | lda hhs+1 | ||
+ | adc hiphopscreenoffset+1 | ||
+ | sta hhs+1 | ||
+ | |||
+ | lda #0 | ||
+ | sta +tmp | ||
+ | |||
+ | |||
+ | |||
+ | ldy #0 ;x | ||
+ | |||
+ | -xloop | ||
+ | |||
+ | ldx #0 ;y | ||
+ | |||
+ | -yloop | ||
+ | |||
+ | lda +tmp | ||
+ | sta (hhs),y | ||
+ | |||
+ | inc +tmp | ||
+ | |||
+ | lda hhs | ||
+ | clc | ||
+ | adc #40 | ||
+ | sta hhs | ||
+ | lda hhs+1 | ||
+ | adc #0 | ||
+ | sta hhs+1 | ||
+ | |||
+ | inx | ||
+ | cpx #8 | ||
+ | bne -yloop | ||
+ | |||
+ | lda hhs | ||
+ | sec | ||
+ | sbc #<320 | ||
+ | sta hhs | ||
+ | lda hhs+1 | ||
+ | sbc #>320 | ||
+ | sta hhs+1 | ||
+ | |||
+ | iny | ||
+ | cpy #32 | ||
+ | bne -xloop | ||
+ | |||
+ | rts | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | hiphopscreenoffset .wo 0 | ||
+ | hiphopscreenoffsets .wo 0, | ||
+ | +tmp .by 0 | ||
+ | |||
+ | |||
+ | |||
+ | hiphopclear | ||
+ | |||
+ | |||
+ | ldx #$00 | ||
+ | -loop | ||
+ | lda #$ff | ||
+ | sta hiphopcharset+$0000, | ||
+ | sta hiphopcharset+$0100, | ||
+ | sta hiphopcharset+$0200, | ||
+ | sta hiphopcharset+$0300, | ||
+ | sta hiphopcharset+$0400, | ||
+ | sta hiphopcharset+$0500, | ||
+ | sta hiphopcharset+$0600, | ||
+ | sta hiphopcharset+$0700, | ||
+ | inx | ||
+ | bne -loop | ||
+ | |||
+ | |||
+ | ; lda #%00111000 | ||
+ | ; sta hiphopcharset+3 | ||
+ | ; sta hiphopcharset+6 | ||
+ | ; lda #%01111100 | ||
+ | ; sta hiphopcharset+4 | ||
+ | ; sta hiphopcharset+5 | ||
+ | |||
+ | rts | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | hiphopcontrol | ||
+ | |||
+ | |||
+ | lda cleared | ||
+ | bne + | ||
+ | lda #0 | ||
+ | sta hiphopcolor | ||
+ | rts | ||
+ | + | ||
+ | ldx hiphopcolor+1 | ||
+ | lda hiphopcolors+15, | ||
+ | sta hiphopcolor | ||
+ | |||
+ | lda tagged | ||
+ | bne + | ||
+ | rts | ||
+ | + | ||
+ | dec hiphopcnt | ||
+ | beq + | ||
+ | jmp +fade | ||
+ | + | ||
+ | lda #0 | ||
+ | sta tagged | ||
+ | sta cleared | ||
+ | sta hiphopcolor | ||
+ | lda hiphopcnt+1 | ||
+ | sta hiphopcnt | ||
+ | lda hiphopcolor+1 | ||
+ | clc | ||
+ | adc #$10 | ||
+ | cmp #$60 | ||
+ | bne + | ||
+ | lda #$00 | ||
+ | + sta hiphopcolor+1 | ||
+ | rts | ||
+ | |||
+ | +fade | ||
+ | lda hiphopcnt | ||
+ | sec | ||
+ | sbc #$10 | ||
+ | bcc + | ||
+ | rts | ||
+ | + | ||
+ | lda hiphopcnt | ||
+ | ora hiphopcolor+1 | ||
+ | tax | ||
+ | lda hiphopcolors, | ||
+ | sta hiphopcolor | ||
+ | rts | ||
+ | |||
+ | hiphopcnt .by $10,$68,$58 | ||
+ | |||
+ | hiphopcolor .by 2,$20 | ||
+ | hiphopcolors | ||
+ | .by $0, | ||
+ | .by $0, | ||
+ | .by $0, | ||
+ | .by $0, | ||
+ | .by $0, | ||
+ | .by $0, | ||
+ | |||
+ | |||
+ | |||
+ | tag | ||
+ | |||
+ | lda #0 | ||
+ | sta +mp | ||
+ | sta +x | ||
+ | sta +y | ||
+ | sta +line | ||
+ | sta doubledraw | ||
+ | |||
+ | lda #1 | ||
+ | sta oneline | ||
+ | |||
+ | -loop | ||
+ | |||
+ | ldx +mp | ||
+ | ml lda msg1,x | ||
+ | cmp #$f0 | ||
+ | bne + | ||
+ | lda #1 | ||
+ | sta wobbling | ||
+ | jmp +skip | ||
+ | + cmp #$f1 | ||
+ | bne + | ||
+ | lda #1 | ||
+ | sta doubledraw | ||
+ | jmp +skip | ||
+ | + cmp #$21 ;" | ||
+ | bne + | ||
+ | lda #$1b | ||
+ | + cmp #$2e ;" | ||
+ | bne + | ||
+ | lda #$1c | ||
+ | + cmp #$23 ;" | ||
+ | bne + | ||
+ | lda #$1d | ||
+ | + cmp #$27 ;"'" | ||
+ | bne + | ||
+ | lda #$1e | ||
+ | + cmp #$2d ;" | ||
+ | bne + | ||
+ | lda #$1f | ||
+ | + cmp #$bd ;" | ||
+ | bne + | ||
+ | ldx #$20 | ||
+ | jmp +skip | ||
+ | + cmp #$3c ;EOL | ||
+ | beq +eol | ||
+ | |||
+ | and #$1f | ||
+ | sta +chr | ||
+ | beq +space | ||
+ | |||
+ | ldx +line | ||
+ | bne + | ||
+ | ;ldx #0 | ||
+ | stx oneline | ||
+ | + | ||
+ | |||
+ | sta +chr | ||
+ | ldx +x | ||
+ | ldy +y | ||
+ | jsr drawchar | ||
+ | lda doubledraw | ||
+ | beq + | ||
+ | lda +chr | ||
+ | ldx +x | ||
+ | inx | ||
+ | ldy +y | ||
+ | iny | ||
+ | jsr drawchar | ||
+ | + | ||
+ | +space | ||
+ | ldx +chr | ||
+ | +skip | ||
+ | lda +x | ||
+ | clc | ||
+ | adc +widths,x | ||
+ | sta +x | ||
+ | inc +mp | ||
+ | |||
+ | ;lda +mp | ||
+ | ;cmp #20 | ||
+ | ;bne + | ||
+ | jmp -loop | ||
+ | |||
+ | +eol | ||
+ | |||
+ | inc +mp | ||
+ | |||
+ | ldx oneline | ||
+ | lda +y | ||
+ | clc | ||
+ | adc linedifs,x | ||
+ | sta +y | ||
+ | lda #0 | ||
+ | sta +x | ||
+ | + | ||
+ | inc +line | ||
+ | lda +line | ||
+ | cmp #2 | ||
+ | ;lda +mp | ||
+ | ;cmp #40 | ||
+ | beq + | ||
+ | jmp -loop | ||
+ | + | ||
+ | |||
+ | inc msg | ||
+ | lda msg | ||
+ | cmp msg+1 | ||
+ | bne + | ||
+ | |||
+ | lda #0 | ||
+ | sta msg | ||
+ | |||
+ | lda #<msg1 | ||
+ | sta ml+1 | ||
+ | lda #>msg1 | ||
+ | sta ml+2 | ||
+ | |||
+ | ldx #17 | ||
+ | - lda msg99,x | ||
+ | sta msg9,x | ||
+ | dex | ||
+ | bpl - | ||
+ | |||
+ | + | ||
+ | |||
+ | lda msg | ||
+ | asl | ||
+ | tax | ||
+ | lda messages,x | ||
+ | sta ml+1 | ||
+ | lda messages+1, | ||
+ | sta ml+2 | ||
+ | |||
+ | ; lda ml+1 | ||
+ | ; clc | ||
+ | ; adc #40 | ||
+ | ; sta ml+1 | ||
+ | ; lda ml+2 | ||
+ | ; adc #0 | ||
+ | ; sta ml+2 | ||
+ | |||
+ | ldx oneline | ||
+ | lda hiphopcnt+1, | ||
+ | sta hiphopcnt | ||
+ | |||
+ | rts | ||
+ | |||
+ | +mp .by 0 | ||
+ | +chr .by 0 | ||
+ | +x .by 0 | ||
+ | +y .by 0 | ||
+ | +line .by 0 | ||
+ | oneline .by 0 | ||
+ | doubledraw .by 0 | ||
+ | linedifs .by 24,12 | ||
+ | msg .by 0,30 | ||
+ | |||
+ | messages | ||
+ | .wo msg1, | ||
+ | .wo msg8, | ||
+ | .wo msg13, | ||
+ | .wo msg20, | ||
+ | |||
+ | msg1 | ||
+ | .te "<" | ||
+ | .te "you know the deal<" | ||
+ | msg2 | ||
+ | .te "<" | ||
+ | .te "you know the name<" | ||
+ | msg3 | ||
+ | .te "<" | ||
+ | .te "you know the game<" | ||
+ | msg4 | ||
+ | .te " | ||
+ | .te "name of the game<" | ||
+ | msg5 | ||
+ | .te " | ||
+ | .te " | ||
+ | msg6 | ||
+ | .te "<" | ||
+ | .te " | ||
+ | msg7 | ||
+ | .by $f1 | ||
+ | .te " | ||
+ | .te " | ||
+ | msg8 | ||
+ | .te "<" | ||
+ | .te " | ||
+ | msg9 | ||
+ | .by $f0 | ||
+ | .te "<" | ||
+ | .te " | ||
+ | |||
+ | msg10 | ||
+ | .te "<" | ||
+ | .te " | ||
+ | msg11 | ||
+ | .te " | ||
+ | .te " | ||
+ | msg11b | ||
+ | .te " and flexing the<" | ||
+ | .te " eight bit muscle<" | ||
+ | |||
+ | |||
+ | msg12 | ||
+ | .te " with diz brand½-<" | ||
+ | .te " | ||
+ | msg12b | ||
+ | .te "<" | ||
+ | .te "kamel produktion½!<" | ||
+ | |||
+ | ; .te "½ in a brand new<" | ||
+ | ; .te " | ||
+ | msg13 | ||
+ | .te " now we hopefully<" | ||
+ | .te " ½ get back the ...<" | ||
+ | msg14 | ||
+ | .te " | ||
+ | .te " | ||
+ | msg15 | ||
+ | .te " | ||
+ | .te " ½da whole thang½...<" | ||
+ | msg16 | ||
+ | .te " code½' | ||
+ | .te " | ||
+ | msg17 | ||
+ | .te "½ and synthetic<" | ||
+ | .te " | ||
+ | msg18 | ||
+ | .te " | ||
+ | .te " | ||
+ | msg19 | ||
+ | .te " | ||
+ | .te " | ||
+ | msg20 | ||
+ | .te "<" | ||
+ | .te " | ||
+ | msg21 | ||
+ | .te " | ||
+ | .te " | ||
+ | msg22 | ||
+ | .te "<" | ||
+ | .te " | ||
+ | msg23 | ||
+ | .te "<" | ||
+ | .te " | ||
+ | msg24 | ||
+ | .te "<" | ||
+ | .te " | ||
+ | msg25 | ||
+ | .te "<" | ||
+ | .te " | ||
+ | msg26 | ||
+ | .te "<" | ||
+ | .te "know wutta mean½...<" | ||
+ | msg27 | ||
+ | msg28 | ||
+ | .te "<" | ||
+ | .te "<" | ||
+ | |||
+ | |||
+ | msg99 | ||
+ | .by $f1 | ||
+ | .te "<" | ||
+ | .te " | ||
+ | |||
+ | |||
+ | +widths | ||
+ | .by 12,21,15,16 ; abc | ||
+ | .by 17,12,18,15 ;defg | ||
+ | .by 12,14,20,17 ;hijk | ||
+ | .by 17,17,12,12 ;lmno | ||
+ | .by 14,13,17,22 ;pqrs | ||
+ | .by 17,13,12,18 ;tuvw | ||
+ | .by 15,20,22, 9 ;xyz! | ||
+ | .by 7,14, 6,15 ; | ||
+ | .by 7 ;½ | ||
+ | |||
+ | |||
+ | drawchar | ||
+ | |||
+ | ;x=x y=y a=char | ||
+ | |||
+ | stx +x | ||
+ | sty +y | ||
+ | |||
+ | ; cmp #0 ;space | ||
+ | ; bne + | ||
+ | ; rts | ||
+ | ;+ | ||
+ | sec | ||
+ | sbc #1 | ||
+ | sta +chr | ||
+ | |||
+ | |||
+ | ;fetch start-adr... | ||
+ | |||
+ | ;adr for first char... | ||
+ | lda #$80 | ||
+ | sta +adr+1 | ||
+ | lda #> | ||
+ | sta +adr+2 | ||
+ | |||
+ | ;if (!first char) look it up... | ||
+ | lda +chr | ||
+ | beq + | ||
+ | sec | ||
+ | sbc #1 | ||
+ | asl | ||
+ | tax | ||
+ | lda hiphopfont, | ||
+ | sta +adr+1 | ||
+ | lda hiphopfont+1, | ||
+ | clc | ||
+ | adc #> | ||
+ | sta +adr+2 | ||
+ | + | ||
+ | |||
+ | |||
+ | ;fetch bytes pr. line... | ||
+ | |||
+ | lda +chr | ||
+ | asl | ||
+ | tax | ||
+ | lda mul10,x | ||
+ | sta +l+1 | ||
+ | lda mul10+1,x | ||
+ | clc | ||
+ | adc #> | ||
+ | sta +l+2 | ||
+ | |||
+ | ldy #0 | ||
+ | ldx #$40 | ||
+ | -loop | ||
+ | +l lda hiphopfont, | ||
+ | sta +tmp | ||
+ | and #%11000000 | ||
+ | lsr | ||
+ | lsr | ||
+ | lsr | ||
+ | lsr | ||
+ | lsr | ||
+ | lsr | ||
+ | sta +bpl+0,y | ||
+ | lda +tmp | ||
+ | and #%00110000 | ||
+ | lsr | ||
+ | lsr | ||
+ | lsr | ||
+ | lsr | ||
+ | sta +bpl+1,y | ||
+ | lda +tmp | ||
+ | and #%00001100 | ||
+ | lsr | ||
+ | lsr | ||
+ | sta +bpl+2,y | ||
+ | lda +tmp | ||
+ | and #%00000011 | ||
+ | sta +bpl+3,y | ||
+ | inx | ||
+ | iny | ||
+ | iny | ||
+ | iny | ||
+ | iny | ||
+ | cpy #40 | ||
+ | bne -loop | ||
+ | |||
+ | |||
+ | |||
+ | ;fetch lines' | ||
+ | |||
+ | |||
+ | lda #0 | ||
+ | sta +line | ||
+ | sta +fetchpnt | ||
+ | |||
+ | -yloop | ||
+ | |||
+ | lda +x | ||
+ | sta +xx | ||
+ | |||
+ | -xloop | ||
+ | |||
+ | ldy +line | ||
+ | lda +bpl,y | ||
+ | beq +nextline | ||
+ | |||
+ | ldx +fetchpnt | ||
+ | +adr lda hiphopfont+384, | ||
+ | tax | ||
+ | lsr | ||
+ | lsr | ||
+ | lsr | ||
+ | lsr | ||
+ | sta +black | ||
+ | txa | ||
+ | and #$0f | ||
+ | sta +white | ||
+ | beq +zerowidth | ||
+ | |||
+ | lda +y | ||
+ | clc | ||
+ | adc +line | ||
+ | tay | ||
+ | lda +xx | ||
+ | clc | ||
+ | adc +black | ||
+ | tax | ||
+ | lda +white | ||
+ | |||
+ | jmp drawline | ||
+ | backfromdrawline | ||
+ | |||
+ | |||
+ | +zerowidth | ||
+ | |||
+ | lda +black | ||
+ | clc | ||
+ | adc +white | ||
+ | adc +xx | ||
+ | sta +xx | ||
+ | |||
+ | ldx +line | ||
+ | dec +bpl,x | ||
+ | |||
+ | inc +fetchpnt | ||
+ | |||
+ | jmp -xloop | ||
+ | |||
+ | +nextline | ||
+ | |||
+ | inc +line | ||
+ | lda +line | ||
+ | cmp #40 | ||
+ | bne -yloop | ||
+ | |||
+ | rts | ||
+ | |||
+ | +x .by 0 | ||
+ | +xx .by 0 | ||
+ | +y .by 0 | ||
+ | +chr .by 0 | ||
+ | +tmp .by 0 | ||
+ | +line .by 0 | ||
+ | +fetchpnt .by 0 | ||
+ | +bpl | ||
+ | .by 0, | ||
+ | .by 0, | ||
+ | mul10 | ||
+ | .wo 0, | ||
+ | .wo 100, | ||
+ | .wo 200, | ||
+ | .wo 300,310 | ||
+ | |||
+ | +black .by 0 | ||
+ | +white .by 0 | ||
+ | |||
+ | |||
+ | |||
+ | drawline | ||
+ | |||
+ | ;draw horizontal line to charset | ||
+ | ;x=x y=y a=width | ||
+ | |||
+ | ;cmp #0 ;if (width==0) return | ||
+ | ;bne + | ||
+ | ;jmp backfromdrawline | ||
+ | + | ||
+ | dex | ||
+ | ;stx +x | ||
+ | ;sty +py+1 | ||
+ | sta +w | ||
+ | |||
+ | |||
+ | txa | ||
+ | and #$f8 | ||
+ | asl | ||
+ | sta $a0 | ||
+ | lda #0 | ||
+ | rol | ||
+ | asl $a0 | ||
+ | rol | ||
+ | asl $a0 | ||
+ | rol | ||
+ | ora #> | ||
+ | sta $a1 | ||
+ | |||
+ | txa | ||
+ | and #$07 | ||
+ | tax | ||
+ | clc | ||
+ | adc +w | ||
+ | sta +cx+1 | ||
+ | |||
+ | |||
+ | -loop | ||
+ | |||
+ | lda +pixels,x | ||
+ | beq +nextrow | ||
+ | and ($a0),y | ||
+ | sta ($a0),y | ||
+ | |||
+ | -back | ||
+ | inx | ||
+ | +cx cpx #$ff | ||
+ | bne -loop | ||
+ | jmp +done | ||
+ | |||
+ | +nextrow | ||
+ | |||
+ | lda #%11111110 | ||
+ | and ($a0),y | ||
+ | sta ($a0),y | ||
+ | |||
+ | lda $a0 | ||
+ | clc | ||
+ | adc #$40 | ||
+ | sta $a0 | ||
+ | lda $a1 | ||
+ | adc #0 | ||
+ | and #$07 | ||
+ | ora #> | ||
+ | sta $a1 | ||
+ | jmp -back | ||
+ | |||
+ | +done | ||
+ | |||
+ | jmp backfromdrawline | ||
+ | |||
+ | +w .by 0 | ||
+ | |||
+ | |||
+ | +pixels | ||
+ | .by %01111111 | ||
+ | .by %10111111 | ||
+ | .by %11011111 | ||
+ | .by %11101111 | ||
+ | .by %11110111 | ||
+ | .by %11111011 | ||
+ | .by %11111101 | ||
+ | .by 0 | ||
+ | .by %01111111 | ||
+ | .by %10111111 | ||
+ | .by %11011111 | ||
+ | .by %11101111 | ||
+ | .by %11110111 | ||
+ | .by %11111011 | ||
+ | .by %11111101 | ||
+ | .by 0 | ||
+ | .by %01111111 | ||
+ | .by %10111111 | ||
+ | .by %11011111 | ||
+ | .by %11101111 | ||
+ | .by %11110111 | ||
+ | .by %11111011 | ||
+ | |||
+ | ; | ||
+ | |||
+ | makeanim | ||
+ | |||
+ | ; | ||
+ | |||
+ | rts | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ; | ||
+ | init | ||
+ | |||
+ | lda #$36 | ||
+ | sta $01 | ||
+ | |||
+ | jsr vicinit | ||
+ | |||
+ | jsr fillbitmap | ||
+ | |||
+ | ldx #$00 | ||
+ | - lda sine2,x | ||
+ | sta sine2+$100, | ||
+ | inx | ||
+ | bne - | ||
+ | |||
+ | |||
+ | lda #newlogo | ||
+ | beq + | ||
+ | jsr makeanim | ||
+ | + | ||
+ | jsr hiphopinit | ||
+ | |||
+ | jsr makewobbler | ||
+ | jsr makesiner | ||
+ | jsr neweffect | ||
+ | |||
+ | |||
+ | |||
+ | ldx #0 | ||
+ | lda #$ff | ||
+ | - | ||
+ | sta wp,x | ||
+ | sta wpo,x | ||
+ | inx | ||
+ | cpx #height | ||
+ | bne - | ||
+ | |||
+ | |||
+ | ldx #$4f | ||
+ | - | ||
+ | lda d011,x | ||
+ | ora #$40 | ||
+ | sta d011,x | ||
+ | dex | ||
+ | bpl - | ||
+ | |||
+ | |||
+ | rts | ||
+ | |||
+ | ; | ||
+ | vicinit | ||
+ | |||
+ | lda #$97 | ||
+ | sta $dd00 | ||
+ | lda #$c8 | ||
+ | sta $d016 | ||
+ | lda #$00 | ||
+ | sta $d011 | ||
+ | lda #$00 | ||
+ | sta $d015 | ||
+ | sta $d020 | ||
+ | sta $d021 | ||
+ | |||
+ | ldx #0 | ||
+ | lda #$00 | ||
+ | - | ||
+ | sta $d800,x | ||
+ | sta $d900,x | ||
+ | sta $da00,x | ||
+ | sta $db00,x | ||
+ | inx | ||
+ | bne - | ||
+ | |||
+ | rts | ||
+ | ; | ||
+ | fillbitmap | ||
+ | |||
+ | ;fill bitmap with 2nd pixel pattern... | ||
+ | |||
+ | lda #$34 | ||
+ | sta $01 | ||
+ | |||
+ | lda #<bitmap | ||
+ | sta $fe | ||
+ | lda #>bitmap | ||
+ | sta $ff | ||
+ | |||
+ | ldy #$00 | ||
+ | -loop | ||
+ | tya | ||
+ | and #$01 | ||
+ | tax | ||
+ | lda +bytes,x | ||
+ | sta ($fe),y | ||
+ | iny | ||
+ | bne -loop | ||
+ | |||
+ | inc $ff | ||
+ | lda $ff | ||
+ | and #$1f | ||
+ | cmp #$18 | ||
+ | bne -loop | ||
+ | |||
+ | |||
+ | ;clear fli-bug area... | ||
+ | |||
+ | lda #< | ||
+ | sta $fe | ||
+ | lda #> | ||
+ | sta $ff | ||
+ | |||
+ | ldx #17 | ||
+ | -loop1 | ||
+ | ldy #$00 | ||
+ | tya | ||
+ | -loop2 | ||
+ | sta ($fe),y | ||
+ | iny | ||
+ | cpy #8*12 | ||
+ | bne -loop2 | ||
+ | lda $fe | ||
+ | clc | ||
+ | adc #$40 | ||
+ | sta $fe | ||
+ | lda $ff | ||
+ | adc #$01 | ||
+ | sta $ff | ||
+ | dex | ||
+ | bpl -loop1 | ||
+ | |||
+ | |||
+ | lda #$36 | ||
+ | sta $01 | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ;remove lower pixels... | ||
+ | |||
+ | lda #< | ||
+ | sta $fe | ||
+ | lda #> | ||
+ | sta $ff | ||
+ | |||
+ | ldy #$00 | ||
+ | tya | ||
+ | -loop2 | ||
+ | ;sta ($fe),y | ||
+ | iny | ||
+ | iny | ||
+ | iny | ||
+ | iny | ||
+ | iny | ||
+ | iny | ||
+ | iny | ||
+ | iny | ||
+ | bne -loop2 | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | lda #$36 | ||
+ | sta $01 | ||
+ | |||
+ | |||
+ | ;fill screens with black... | ||
+ | |||
+ | lda #< | ||
+ | sta $fe | ||
+ | lda #> | ||
+ | sta $ff | ||
+ | -loop | ||
+ | lda #$00 | ||
+ | sta ($fe),y | ||
+ | iny | ||
+ | bne -loop | ||
+ | inc $ff | ||
+ | lda $ff | ||
+ | sec | ||
+ | sbc #> | ||
+ | cmp #$20 | ||
+ | bne -loop | ||
+ | rts | ||
+ | |||
+ | |||
+ | +bytes | ||
+ | .by %00010010 | ||
+ | .by %01001000 | ||
+ | |||
+ | ; | ||
+ | makewobbler | ||
+ | |||
+ | |||
+ | sei | ||
+ | lda #$34 | ||
+ | sta $01 | ||
+ | |||
+ | lda #< | ||
+ | sta $fe | ||
+ | lda #> | ||
+ | sta $ff | ||
+ | |||
+ | |||
+ | -yloop | ||
+ | |||
+ | lda +y | ||
+ | asl | ||
+ | tax | ||
+ | lda +ststarts,x | ||
+ | sec | ||
+ | sbc #16 | ||
+ | sta +st+1 | ||
+ | lda +ststarts+1, | ||
+ | sbc #0 | ||
+ | sta +st+2 | ||
+ | |||
+ | |||
+ | lda $fe | ||
+ | clc | ||
+ | adc #$99 | ||
+ | sta +jw+1 | ||
+ | lda $ff | ||
+ | adc #$00 | ||
+ | sta +jw+2 | ||
+ | |||
+ | ldy #0 | ||
+ | - | ||
+ | lda wobblersrc1, | ||
+ | sta ($fe),y | ||
+ | iny | ||
+ | cpy #9 | ||
+ | bne - | ||
+ | |||
+ | jsr yaddfe | ||
+ | |||
+ | inc +lx+1 | ||
+ | inc +cx+1 | ||
+ | |||
+ | |||
+ | lda #0 | ||
+ | sta +x | ||
+ | |||
+ | -xloop | ||
+ | |||
+ | ldy #0 | ||
+ | - | ||
+ | lda wobblersrc2, | ||
+ | sta ($fe),y | ||
+ | iny | ||
+ | cpy #6 | ||
+ | bne - | ||
+ | |||
+ | jsr yaddfe | ||
+ | |||
+ | lda +la+1 | ||
+ | clc | ||
+ | adc #20 | ||
+ | sta +la+1 | ||
+ | lda +la+2 | ||
+ | adc #0 | ||
+ | sta +la+2 | ||
+ | |||
+ | lda +st+1 | ||
+ | clc | ||
+ | adc #1 | ||
+ | sta +st+1 | ||
+ | lda +st+2 | ||
+ | adc #0 | ||
+ | sta +st+2 | ||
+ | |||
+ | inc +x | ||
+ | lda +x | ||
+ | cmp #width | ||
+ | bne -xloop | ||
+ | |||
+ | |||
+ | inc +y | ||
+ | lda +y | ||
+ | cmp #9 | ||
+ | beq +addjmp1 | ||
+ | cmp #36 | ||
+ | beq +addjmp2 | ||
+ | cmp #40 | ||
+ | beq +addjmp3 | ||
+ | cmp #44 | ||
+ | beq +addjmp4 | ||
+ | cmp #48 | ||
+ | beq +addjmp5 | ||
+ | cmp #52 | ||
+ | beq +addjmp6 | ||
+ | cmp #56 | ||
+ | beq +addjmp7 | ||
+ | cmp #60 | ||
+ | beq +addjmp8 | ||
+ | cmp #64 | ||
+ | beq +addjmp9 | ||
+ | cmp #height | ||
+ | beq +end | ||
+ | jmp -yloop | ||
+ | |||
+ | |||
+ | +addjmp1 | ||
+ | ldx #0 | ||
+ | jmp +addjmp | ||
+ | +addjmp2 | ||
+ | ldx #3 | ||
+ | jmp +addjmp | ||
+ | +addjmp3 | ||
+ | ldx #6 | ||
+ | jmp +addjmp | ||
+ | +addjmp4 | ||
+ | ldx #9 | ||
+ | jmp +addjmp | ||
+ | +addjmp5 | ||
+ | ldx #12 | ||
+ | jmp +addjmp | ||
+ | +addjmp6 | ||
+ | ldx #15 | ||
+ | jmp +addjmp | ||
+ | +addjmp7 | ||
+ | ldx #18 | ||
+ | jmp +addjmp | ||
+ | +addjmp8 | ||
+ | ldx #21 | ||
+ | jmp +addjmp | ||
+ | +addjmp9 | ||
+ | ldx #24 | ||
+ | jmp +addjmp | ||
+ | |||
+ | +addjmp | ||
+ | |||
+ | ldy #0 | ||
+ | - | ||
+ | lda +jmpsrc,x | ||
+ | sta ($fe),y | ||
+ | inx | ||
+ | iny | ||
+ | cpy #3 | ||
+ | bne - | ||
+ | |||
+ | dex | ||
+ | dex | ||
+ | lda +jmpsrc,x | ||
+ | sta $fe | ||
+ | lda +jmpsrc+1,x | ||
+ | sta $ff | ||
+ | |||
+ | jmp -yloop | ||
+ | |||
+ | |||
+ | +end | ||
+ | |||
+ | ldy #0 | ||
+ | lda #$60 | ||
+ | sta ($fe),y | ||
+ | |||
+ | lda #$36 | ||
+ | sta $01 | ||
+ | |||
+ | rts | ||
+ | |||
+ | +x .by 0 | ||
+ | +y .by 0 | ||
+ | |||
+ | |||
+ | wobblersrc1 | ||
+ | |||
+ | +lx ldx wp | ||
+ | +cx cpx wpo | ||
+ | bne + | ||
+ | +jw jmp wobbler+$99 | ||
+ | + | ||
+ | |||
+ | wobblersrc2 | ||
+ | |||
+ | +la lda anim,x | ||
+ | +st sta $e0b8 | ||
+ | |||
+ | +jmpsrc | ||
+ | jmp $d040 | ||
+ | jmp $e202 | ||
+ | jmp $e602 | ||
+ | jmp $ea02 | ||
+ | jmp $ee02 | ||
+ | jmp $f202 | ||
+ | jmp $f602 | ||
+ | jmp $fa02 | ||
+ | jmp $fe02 | ||
+ | |||
+ | |||
+ | +ststarts | ||
+ | .wo $e0b8, | ||
+ | .wo $e0e0, | ||
+ | .wo $e108, | ||
+ | .wo $e130, | ||
+ | .wo $e158, | ||
+ | .wo $e180, | ||
+ | .wo $e1a8, | ||
+ | .wo $e1d0, | ||
+ | .wo $e1f8, | ||
+ | ; | ||
+ | makesiner | ||
+ | |||
+ | lda #<siner | ||
+ | sta $fe | ||
+ | lda #>siner | ||
+ | sta $ff | ||
+ | |||
+ | |||
+ | ldx #height | ||
+ | -loop | ||
+ | |||
+ | ldy #0 | ||
+ | - | ||
+ | lda sinersrc,y | ||
+ | sta ($fe),y | ||
+ | iny | ||
+ | cpy #5 | ||
+ | bne - | ||
+ | |||
+ | jsr yaddfe | ||
+ | |||
+ | |||
+ | txa | ||
+ | and #1 | ||
+ | ;beq + | ||
+ | lda +a+1 | ||
+ | clc | ||
+ | adc #$02 | ||
+ | sta +a+1 | ||
+ | + | ||
+ | |||
+ | inc +s+1 | ||
+ | |||
+ | dex | ||
+ | bne -loop | ||
+ | |||
+ | ldy #0 | ||
+ | lda #$60 | ||
+ | sta ($fe),y | ||
+ | |||
+ | jsr updatesiner | ||
+ | |||
+ | rts | ||
+ | |||
+ | |||
+ | sinersrc | ||
+ | |||
+ | +a lda sine2,y | ||
+ | +s sta wp | ||
+ | |||
+ | |||
+ | |||
+ | updatesiner | ||
+ | |||
+ | |||
+ | lda #<siner | ||
+ | sta $fe | ||
+ | lda #>siner | ||
+ | sta $ff | ||
+ | |||
+ | |||
+ | lda #0 | ||
+ | sta tmp | ||
+ | sta tmp+1 | ||
+ | |||
+ | ldx #height | ||
+ | ldy #1 | ||
+ | |||
+ | -loop | ||
+ | lda tmp+1 | ||
+ | sta ($fe),y | ||
+ | |||
+ | lda tmp | ||
+ | clc | ||
+ | adc sinespread | ||
+ | sta tmp | ||
+ | lda tmp+1 | ||
+ | adc sinespread+1 | ||
+ | sta tmp+1 | ||
+ | |||
+ | tya | ||
+ | clc | ||
+ | adc #5 | ||
+ | tay | ||
+ | lda $ff | ||
+ | adc #0 | ||
+ | sta $ff | ||
+ | |||
+ | dex | ||
+ | bpl -loop | ||
+ | |||
+ | rts | ||
+ | |||
+ | |||
+ | sinespread .wo 1 | ||
+ | |||
+ | ; | ||
+ | yaddfe | ||
+ | tya | ||
+ | clc | ||
+ | adc $fe | ||
+ | sta $fe | ||
+ | lda #0 | ||
+ | adc $ff | ||
+ | sta $ff | ||
+ | rts | ||
+ | ; | ||
+ | </ | ||
base/2nd_pixel_fli_distorter.txt · Last modified: 2015-04-17 04:30 by 127.0.0.1