home *** CD-ROM | disk | FTP | other *** search
/ 64'er Special 69 / 64er_Magazin_Sonderheft_69_19xx_Markt__Technik_de_Side_B.d64 / draw.bas (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1990-01-01  |  1.5 KB  |  73 lines

  1. 4 rem ----------------------------
  2. 5 rem originalwerte fuer textmodus
  3. 6 rem in adressen 251/252 retten
  4. 7 rem ----------------------------
  5. 10 poke251,peek(53272)
  6. 20 poke252,peek(53265)
  7. 30 ba=8192:sys58692
  8. 40 gosub 1000
  9. 45 ifpeek(254)=33then165
  10. 119 rem -------------------------
  11. 120 rem hires-bildschirm loeschen
  12. 121 rem -------------------------
  13. 130 for i=ba to ba+7999
  14. 140 poke i,0
  15. 150 next:poke254,33
  16. 160 sys58692
  17. 165 gosub 2000: rem textmodus ein
  18. 170 input"x-koordinate start(0-319)";x1
  19. 172 input"y-koordinate start(0-199)";y1
  20. 180 input"x-koordinate ende (0-319)";x2
  21. 182 input"y-koordinate ende (0-199)";y2
  22. 190 gosub 1000: rem hires-grafik ein
  23. 200 gosub 3000: rem farbram weiss
  24. 205 gosub355
  25. 280 poke198,0:wait198,1
  26. 281 goto160
  27. 355 dx=x2-x1:dy=y2-y1
  28. 357 ifabs(dy)<abs(dx)then364
  29. 358 foryl=y1 to y2 step sgn(dy)
  30. 359 x=dx/dy*yl+x1
  31. 360 y=yl
  32. 361 gosub400
  33. 362 next yl
  34. 363 return
  35. 364 for xl=x1 to x2 step sgn(dx)
  36. 365 x=xl
  37. 366 y=dy/dx*xl+y1
  38. 367 gosub 400
  39. 368 next xl
  40. 369 return
  41. 400 yp=int(y/8)
  42. 410 xp=int(x/8)
  43. 420 a1=(yp*40+xp)*8
  44. 430 ay=y-8*yp+a1
  45. 450 r=x-8*xp
  46. 460 m=2^(7-r)
  47. 470 i=peek(ay+ba)
  48. 480 poke ay+ba,i or m
  49. 490 return
  50. 994 rem ------------------------
  51. 995 rem unterprogramm
  52. 996 rem hires-grafik einschalten
  53. 997 rem ------------------------
  54. 1000 poke53272,peek(53272)or8
  55. 1010 poke53265,peek(53265)or32
  56. 1020 return
  57. 1994 rem ------------------------
  58. 1995 rem unterprogramm
  59. 1996 rem hires-grafik abschalten
  60. 1997 rem textmodus wieder aktivieren
  61. 1998 rem ------------------------
  62. 2000 poke53272,peek(251)
  63. 2010 poke53265,peek(252)
  64. 2020 return
  65. 2995 rem ------------------------
  66. 2996 rem unterprogramm
  67. 2997 rem hintergrund weiss und
  68. 2998 rem pixelfarbe schwarz
  69. 2999 rem ------------------------
  70. 3000 for i=1024 to 2023
  71. 3010 poke i,1: rem 16*code zeichenfarbe + code hintergrundfarbe = 0*16+1
  72. 3020 next: return
  73.