home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1986 August / Ahoy_Magazine_86-08_1986_Double_L.d64 / Makewave.128 (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1986-01-01  |  612 b   |  24 lines

  1. 10 rem *** makewave.bas ***
  2. 20 (NULL) 0,1:(NULL) 4,1:(NULL) 1,1
  3. 30 (NULL) 0:poke 2604,120:(NULL) 15:rem put bit map at $2000, color map at $1c00
  4. 40 poke 216,32:rem set bit-map flag
  5. 50 poke 53265,peek(53265)or32:rem enable bit-map mode
  6. 60 base=8192:rem start bit map at $2000
  7. 70 rem *** draw base line ***
  8. 80 y=100:rem place y axis at midscreen
  9. 90 for x=0 to 319:rem draw x axis
  10. 100 gosub 170:next x
  11. 110 rem *** draw sine wave ***
  12. 120 for x=0 to 319 step .5
  13. 130 y=int(100+80*sin(x/10))
  14. 140 gosub 170:next x
  15. 150 goto 150
  16. 160 for x=0 to 319: rem draw x axis
  17. 170 col=int(x/8)
  18. 180 row=int(y/8)
  19. 190 line=y and 7
  20. 200 byte=base+row*320+8*col+line
  21. 210 bitt=7-(x and 7)
  22. 220 poke byte,peek(byte) or (2^bitt)
  23. 230 return
  24.