tvstatic.lua 10 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. -- title: tv static
  2. -- author: pixelbath
  3. -- desc: reference for tv static effect
  4. rnd=math.random
  5. -- introduce wobble by scanlines
  6. function SCN(sl)
  7. t=time()/300
  8. poke(0x03FF9,math.sin(t+sl/10)*3)
  9. end
  10. function tv()
  11. -- add static
  12. for i=1,10000 do
  13. pix(rnd(0,239), rnd(0,135), 0)
  14. end
  15. -- add scanlines
  16. for y=0,136,2 do
  17. line(0,y,239,y,0)
  18. end
  19. t=-time()/10
  20. y=t%136
  21. line(0,y,239,y,15)
  22. y=(2*t)%200
  23. line(0,y,239,y,15)
  24. end
  25. function TIC()
  26. -- TODO: make these color bars programmatic
  27. map()
  28. print("TEST",80,50,0,false,4)
  29. --rect(60,80,50,20,8)
  30. tv()
  31. end
  32. -- <TILES>
  33. -- 000:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  34. -- 001:4444444444444444444444444444444444444444444444444444444444444444
  35. -- 002:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
  36. -- 003:6666666666666666666666666666666666666666666666666666666666666666
  37. -- 004:1111111111111111111111111111111111111111111111111111111111111111
  38. -- 005:2222222222222222222222222222222222222222222222222222222222222222
  39. -- 006:9999999999999999999999999999999999999999999999999999999999999999
  40. -- 016:9999999999999999999999999999999999999999999999999999999999999999
  41. -- 018:2222222222222222222222222222222222222222222222222222222222222222
  42. -- 020:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
  43. -- 022:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  44. -- 035:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  45. -- 036:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
  46. -- 037:eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
  47. -- 038:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
  48. -- </TILES>
  49. -- <MAP>
  50. -- 000:000010101010101020202020203030303030404040404050505050506060600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  51. -- 001:000010101010101020202020203030303030404040404050505050506060600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  52. -- 002:000010101010101020202020203030303030404040404050505050506060600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  53. -- 003:000010101010101020202020203030303030404040404050505050506060600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  54. -- 004:000010101010101020202020203030303030404040404050505050506060600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  55. -- 005:000010101010101020202020203030303030404040404050505050506060600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  56. -- 006:000010101010101020202020203030303030404040404050505050506060600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  57. -- 007:000010101010101020202020203030303030404040404050505050506060600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  58. -- 008:000010101010101020202020203030303030404040404050505050506060600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  59. -- 009:000010101010101020202020203030303030404040404050505050506060600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  60. -- 010:000010101010101020202020203030303030404040404050505050506060600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  61. -- 011:000010101010101020202020203030303030404040404050505050506060600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  62. -- 012:000010101010101020202020203030303030404040404050505050506060600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  63. -- 013:000010101010101020202020203030303030404040404050505050506060600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  64. -- 014:010111111111111121212121213131313131414141414151515151516100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  65. -- 015:000042424242424242424242425252525252525252525262626262626262000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  66. -- 016:000042424242424242424242425252525252525252525262626262626262000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  67. -- 017:000000000000424200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  68. -- </MAP>
  69. -- <PALETTE>
  70. -- 000:1a1c2c5d275db13e53ef7d57ffcd75a7f07038b76425717929366f3b5dc941a6f673eff7f4f4f494b0c2566c86333c57
  71. -- </PALETTE>