home *** CD-ROM | disk | FTP | other *** search
/ 64'er Special 7 / 64er_Magazin_Sonderheft_07_86-07_1986_Markt__Technik_de_Side_A.d64 / multi-sinus (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  1KB  |  40 lines

  1. 100 rem sinuskurve in multicolor
  2. 110 rem
  3. 120 rem grafik ein
  4. 130 vic=53248
  5. 140 poke vic+17, peek(vic+17) or 11*16:rem grafik ein
  6. 150 poke vic+22, peek(vic+22) or 16:rem muticolor ein
  7. 155 poke vic+24, peek(vic+24) or 8
  8. 160 rem grafikbild loeschen
  9. 170 gb=8192:rem staradresse grafik
  10. 180 for x=gb to gb+8000:pokex,0:next x
  11. 190 rem farbwerte setzen
  12. 200 vr=1024:rem startadresse videoram
  13. 210 fr=54272:rem staradresse farbram
  14. 220 f1=2*16+6:rem farbe 1 rot und 2 blau
  15. 230 f2=13:rem farbe 3
  16. 240 for x=vr to vr+1000:poke x,f1:next x
  17. 250 for x=fr to fr+1000:poke x,f2:next x
  18. 251 poke53280,0
  19. 260 rem sinuskurve zeichnen
  20. 270 for x=0 to 159
  21. 280 y=70* sin(x/25.6) +99:fa=int(rnd(1)*4)+1
  22. 290 gosub51000
  23. 300 next x
  24. 9999 end
  25. 51000 rem grafikpunkt setzen (multi-color)
  26. 51010 ga=8192:rem startadresse grafikspeicher
  27. 51020 ad=320 * int(y/8) + (y and 7) + (8 * int(x/4)):rem adresse berechnen
  28. 51030 b1=(3-(x-(4*int(x/4))))*2:rem bitnummer 1
  29. 51040 b2=b1+1:rem bitnummer 2
  30. 51050 if fa =0 then f1=0:f2=0
  31. 51060 if fa =1 then f1=0:f2=1
  32. 51070 if fa =2 then f1=1:f2=0
  33. 51080 if fa =3 then f1=1:f2=1
  34. 51090 if f1=0 then goto51110
  35. 51100 pokega+ad, peek(ga+ad) or 2^b1
  36. 51110 if f2=0 then goto51130
  37. 51120 poke ga+ad, peek(ga+ad) or 2^b2
  38. 51130 return
  39. 51140 rem fa= farbwert des punktes (0-3)
  40.