home *** CD-ROM | disk | FTP | other *** search
/ 64'er 1993 August / 64er_Magazin_93-08_1993_Markt__Technik_de_Side_A.d64 / eciplasma.ascii < prev    next >
Text File  |  2022-10-26  |  5KB  |  294 lines

  1.  
  2. ;---------------------------------------
  3. ; Full Screen Plasma. (200 lines)
  4. ; By: Rasmus Wernersson. dec 92/jan 93.
  5. ; Handle: Raz
  6. ; Group:  Camelot? (- I hope so)
  7. ; Remember to run sine-prg before start.
  8. ;---------------------------------------
  9. ; This is a simplified version of my
  10. ; routine.
  11. ;---------------------------------------
  12. zp1  = $fd
  13. zp2  = $fb
  14. zp3  = $f9
  15. zp4  = $f7
  16. sin  = $2000 ;pointer to sine 1
  17. sin2 = $2200 ;   --   --  --  2
  18. zerosin = $d9
  19. ;---------------------------------------
  20.  
  21.      *= $0b00
  22.      jsr geneci ;setup the effect.
  23.      lda #$00   ;black border
  24.      sta $d020
  25.      lda #$f5    ;pattern: %11110101
  26. clrl
  27.      sta $4000,x ;place pattern
  28.      sta $4100,x
  29.      inx
  30.      bne clrl
  31.      ldx #39   ;place the colours.
  32. setcolour
  33.      lda colours+14,x
  34.      sta $4400,x
  35.      lda colours+13,x
  36.      sta $4800,x
  37.      lda colours+12,x
  38.      sta $4c00,x
  39.      lda colours+11,x
  40.      sta $5000,x
  41.      lda colours+10,x
  42.      sta $5400,x
  43.      lda colours+9,x
  44.      sta $5800,x
  45.      lda colours+8,x
  46.      sta $5c00,x
  47.      lda colours+7,x
  48.      sta $6000,x
  49.      lda colours+6,x
  50.      sta $6400,x
  51.      lda colours+5,x
  52.      sta $6800,x
  53.      lda colours+4,x
  54.      sta $6c00,x
  55.      lda colours+3,x
  56.      sta $7000,x
  57.      lda colours+2,x
  58.      sta $7400,x
  59.      lda colours+1,x
  60.      sta $7800,x
  61.      lda colours+0,x
  62.      sta $7c00,x
  63.      dex
  64.      bpl setcolour ;finished ?
  65.  
  66.      sei        ;setup rasterirq.
  67.      lda #$c8
  68.      sta $d016
  69.      lda #$7f
  70.      sta $dc0d
  71.      lda #$01
  72.      sta $d01a
  73.      lda #$32
  74.      sta $d012
  75.      lda #<eci
  76.      sta $0314
  77.      lda #>eci
  78.      sta $0315
  79.      cli
  80. wait
  81.      jmp wait
  82. geneci
  83.      lda #$10  ;place sinecalc-routine
  84.      sta zp1+1 ;at $1000
  85.      sta zp2+1
  86.      lda #$00
  87.      sta zp1
  88.      sta zp2
  89.      ldx #200 ; 200 lines.
  90.      ldy #$00
  91.      sty save
  92. genloop1
  93.      lda (zp1),y ;copy main code
  94.      sta (zp2),y
  95.      iny
  96.      cpy #15      ;finished ?
  97.      bcc genloop1 ;no.
  98.  
  99.      lda save     ;set sine+line number
  100.      ldy #$01
  101.      sta (zp2),y
  102.      ldy #$04
  103.      sta (zp2),y
  104.      lda #17     ;calc pointer to eci-
  105.      sta m       ;code (line*17)
  106.      lda save
  107.      sta n
  108.      jsr mult
  109.      ldy #7
  110.      lda result
  111.      clc
  112.      adc #$03+6   ;find correct pos.
  113.      sta (zp2),y
  114.      lda result+1
  115.      adc #$30     ;$3006 +pos + 3/4
  116.      iny
  117.      sta (zp2),y
  118.  
  119.      ldy #$0d
  120.      lda result
  121.      clc
  122.      adc #$05+6   ;correct pos
  123.      sta (zp2),y
  124.      lda result+1
  125.      adc #$30     ;$3006 +pos +5/6
  126.      iny
  127.      sta (zp2),y
  128.      inc save
  129.  
  130.  
  131.      ldy #$00
  132.      lda zp2      ;set pointer
  133.      clc          ;to the new pos.
  134.      adc #15
  135.      sta zp2
  136.      lda zp2+1
  137.      adc #$00
  138.      sta zp2+1
  139.      dex          ;all 200 finised?
  140.      bne genloop1 ; no.
  141.      lda #$60    ;opcode for 'rts'
  142.      sta (zp2),y
  143.  
  144.      lda #$08
  145.      sta zp1+1
  146.      lda #$30
  147.      sta zp2+1
  148.      lda #$00
  149.      sta zp1
  150.      lda #$06
  151.      sta zp2
  152.      lda #$33+8
  153.      sta save
  154.      ldx #200
  155.      ldy #$00
  156. genloop2
  157.      lda (zp1),y
  158.      sta (zp2),y
  159.      iny
  160.      cpy #17
  161.      bcc genloop2
  162.      ldy #$01
  163.      lda save
  164.      sta (zp2),y
  165.      dey
  166.      inc save
  167.      cmp #$37+8
  168.      bcc noreset
  169.      lda #$30+8
  170.      sta save
  171. noreset
  172.      lda zp2
  173.      clc
  174.      adc #17
  175.      sta zp2
  176.      lda zp2+1
  177.      adc #$00
  178.      sta zp2+1
  179.      dex
  180.      bne genloop2
  181.  
  182.      lda #$4c   ;opcode for 'jmp'
  183.      sta (zp2),y
  184.      iny
  185.      lda #<eee ;lowbyte for 'eee'
  186.      sta (zp2),y
  187.      iny
  188.      lda #>eee ; hibyte for 'eee'
  189.      sta (zp2),y
  190.  
  191.      rts
  192.  
  193. result .word 0
  194. m    .byte 0      ; m*n
  195. n    .byte 0
  196. mult
  197.      txa
  198.      pha    ;save x-value
  199.      clc
  200.      lda #$00
  201.      sta result
  202.      ldx #$08
  203. gentag
  204.      lsr m
  205.      bcc noadd
  206.      clc
  207.      adc n
  208. noadd
  209.      ror a
  210.      ror result
  211. rorb
  212.      dex
  213.      bne gentag
  214.      sta result+1
  215.      pla
  216.      tax    ;get saved x-value
  217.      rts
  218. eee
  219.      inc $dd00
  220.      ldx #%01110100 ;no border
  221.      stx $d011
  222.      lda #21    ;normal charset, and
  223.      sta $d018  ;scr-pointer at $0400
  224.                 ;(important for sprites)
  225.      ldy tabpos    ;sinepos1
  226.      ldx tabpos2   ;  ---  2
  227.      jsr $1000     ;calc new doublesine
  228.      ldx #%00010100    ;for no-border
  229.      stx $d011
  230.      lda tabpos  ;move sinepos 1/2
  231.      clc
  232.      adc add1
  233.      sta tabpos
  234.      lda tabpos2
  235.      clc
  236.      adc add2
  237.      sta tabpos2
  238. irqexit
  239.      pla         ;exit
  240.      tay
  241.      pla
  242.      tax
  243.      pla
  244.      rti
  245. add1 .byte $00 ;sine1 speed
  246. add2 .byte $01 ; -- 2   --
  247. tabpos2 .byte 0 ;current sinepos1
  248. tabpos .byte 0  ;  ---     ---- 2
  249. save .byte $00
  250. save2 .byte $00
  251.      *= $0800
  252. proto
  253.      ldy #$33+8
  254. b1   lda #$00
  255. a1   ldx #$10
  256.      sty $d011
  257.      stx $d018
  258.      and #$07
  259.      sta $d016
  260.  
  261.      *= $1000
  262.      lda sin,y
  263.      adc sin2+0,x
  264.      sta b1+1
  265.      and #%11111000
  266.      asl a
  267.      sta a1+1
  268.  
  269.      *= $3000
  270. eci
  271.      inc $d019
  272.      dec $dd00
  273.      *= $1c00
  274. colours
  275.      .byte 0,0,0,0,0,0
  276.      .byte 0,0,0,0,0,0,0
  277.      .byte $09,$92,$28,$8a,$af,$f7,$71
  278.      .byte $11,$11,$11,$11,$11,$11,$11
  279.      .byte $11,$11,$11,$11,$11,$11,$11
  280.      .byte $17,$7f,$fa,$a8,$82,$29,$90
  281.      .byte 0,0,0,0,0,0,0
  282.      .byte 0,0,0,0,0,0,0
  283. ;colours   ;(alternative colours)
  284.      .byte $f7,$71,$17,$78,$89
  285.      .byte $09,$95,$5d,$d7,$7d,$d5,$59
  286.      .byte $06,$6b,$b4,$4e,$ef,$f3
  287.      .byte $3f,$fe,$e4,$4b,$b6,$60
  288.      .byte $09,$98,$87,$71,$17,$78,$89
  289.      .byte $09,$92,$28,$8a,$af,$f7
  290.      .byte $7f,$fa,$a8,$82,$29,$90
  291.      .byte $09,$95,$5d,$d7,$7d,$d5,$59
  292.      .byte $09,$98,$87,$71,$17,$78,$89
  293.  
  294.