blitstuff.lua 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. -- title: blit ram to video
  2. -- author: pixelbath
  3. -- desc: blit ram to video, one byte at a time
  4. -- script: lua
  5. t=0
  6. base_addr= 0x4000
  7. base_vram= 0x0000
  8. function blit_random()
  9. base_addr=math.floor(math.random()*0x14000)+0x4000
  10. end
  11. function TIC()
  12. if btn(4) then blit_random() end
  13. if t>32639 then
  14. cls(0)
  15. end
  16. local offset=t%32640
  17. poke(base_vram+offset, peek(base_addr+offset))
  18. t=t+1
  19. end
  20. -- <TILES>
  21. -- 001:eccccccccc888888caaaaaaaca888888cacccccccacc0ccccacc0ccccacc0ccc
  22. -- 002:ccccceee8888cceeaaaa0cee888a0ceeccca0ccc0cca0c0c0cca0c0c0cca0c0c
  23. -- 003:eccccccccc888888caaaaaaaca888888cacccccccacccccccacc0ccccacc0ccc
  24. -- 004:ccccceee8888cceeaaaa0cee888a0ceeccca0cccccca0c0c0cca0c0c0cca0c0c
  25. -- 017:cacccccccaaaaaaacaaacaaacaaaaccccaaaaaaac8888888cc000cccecccccec
  26. -- 018:ccca00ccaaaa0ccecaaa0ceeaaaa0ceeaaaa0cee8888ccee000cceeecccceeee
  27. -- 019:cacccccccaaaaaaacaaacaaacaaaaccccaaaaaaac8888888cc000cccecccccec
  28. -- 020:ccca00ccaaaa0ccecaaa0ceeaaaa0ceeaaaa0cee8888ccee000cceeecccceeee
  29. -- </TILES>
  30. -- <WAVES>
  31. -- 000:00000000ffffffff00000000ffffffff
  32. -- 001:0123456789abcdeffedcba9876543210
  33. -- 002:0123456789abcdef0123456789abcdef
  34. -- </WAVES>
  35. -- <SFX>
  36. -- 000:000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000304000000000
  37. -- </SFX>
  38. -- <PALETTE>
  39. -- 000:1a1c2c5d275db13e53ef7d57ffcd75a7f07038b76425717929366f3b5dc941a6f673eff7f4f4f494b0c2566c86333c57
  40. -- </PALETTE>