example01.sh 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. $01spritesbg = '0'
  2. $02spritesfg = '0'
  3. $05luacode = '1'
  4. $0awaveform = '1'
  5. $0cpalette = '1'
  6. $0dtunesnotes = '1'
  7. $0etunesframes = '1'
  8. if [$01spritesbg != '0']
  9. then
  10. #- 01 - sprites background (tiles)
  11. xxd -r -p ./library/01_sprites_bg.hex > 01_sprites_bg.bin
  12. filesize=`du -b "01_sprites_bg.bin" | cut -f1`
  13. printf "0: %.6x" $filesize | xxd -r -g0 > 01_3bytes_.bin
  14. echo 0:01 | xxd -r > 01_byte0_.bin
  15. dd ibs=1 count=1 skip=0 if=01_3bytes_.bin of=01_byte3_.bin
  16. dd ibs=1 count=1 skip=1 if=01_3bytes_.bin of=01_byte2_.bin
  17. dd ibs=1 count=1 skip=2 if=01_3bytes_.bin of=01_byte1_.bin
  18. cat 01_byte0_.bin 01_byte1_.bin 01_byte2_.bin 01_byte3_.bin 01_sprites_bg.bin > 01_all.bin
  19. rm 01_*_.bin
  20. rm 01_sprites_bg.bin
  21. sleep 1
  22. fi
  23. if [$02spritesfg != '0']
  24. then
  25. #- 02 - sprites foreground
  26. xxd -r -p ./library/02_sprites_fg.hex > 02_sprites_fg.bin
  27. filesize=`du -b "02_sprites_fg.bin" | cut -f1`
  28. printf "0: %.6x" $filesize | xxd -r -g0 > 02_3bytes_.bin
  29. echo 0:02 | xxd -r > 02_byte0_.bin
  30. dd ibs=1 count=1 skip=0 if=02_3bytes_.bin of=02_byte3_.bin
  31. dd ibs=1 count=1 skip=1 if=02_3bytes_.bin of=02_byte2_.bin
  32. dd ibs=1 count=1 skip=2 if=02_3bytes_.bin of=02_byte1_.bin
  33. cat 02_byte0_.bin 02_byte1_.bin 02_byte2_.bin 02_byte3_.bin 02_sprites_fg.bin > 02_all.bin
  34. rm 02_*_.bin
  35. rm 02_sprites_fg.bin
  36. sleep 1
  37. fi
  38. #- 03 - cover (?)
  39. #- 04 - map (?)
  40. #- 05 - Lua code
  41. filesize=`du -b "example01.lua" | cut -f1`
  42. printf "0: %.6x" $filesize | xxd -r -g0 > 05_3bytes_.bin
  43. echo 0:05 | xxd -r > 05_byte0_.bin
  44. dd ibs=1 count=1 skip=0 if=05_3bytes_.bin of=05_byte3_.bin
  45. dd ibs=1 count=1 skip=1 if=05_3bytes_.bin of=05_byte2_.bin
  46. dd ibs=1 count=1 skip=2 if=05_3bytes_.bin of=05_byte1_.bin
  47. cat 05_byte0_.bin 05_byte1_.bin 05_byte2_.bin 05_byte3_.bin example01.lua > 05_all.bin
  48. rm 05_*_.bin
  49. sleep 1
  50. #- 06 - ?
  51. #- 07 - ?
  52. #- 08 - ?
  53. #- 09 - sfx (?)
  54. #- 0A - waveform (?)
  55. xxd -r -p ./library/waveform.hex > waveform.bin
  56. filesize=`du -b "waveform.bin" | cut -f1`
  57. printf "0: %.6x" $filesize | xxd -r -g0 > 0A_3bytes_.bin
  58. echo 0:0A | xxd -r > 0A_byte0_.bin
  59. dd ibs=1 count=1 skip=0 if=0A_3bytes_.bin of=0A_byte3_.bin
  60. dd ibs=1 count=1 skip=1 if=0A_3bytes_.bin of=0A_byte2_.bin
  61. dd ibs=1 count=1 skip=2 if=0A_3bytes_.bin of=0A_byte1_.bin
  62. cat 0A_byte0_.bin 0A_byte1_.bin 0A_byte2_.bin 0A_byte3_.bin waveform.bin > 0A_all.bin
  63. rm 0A_*_.bin
  64. rm waveform.bin
  65. sleep 1
  66. #- 0B - ?
  67. #- 0C - palette
  68. xxd -r -p ./library/palette.hex > palette.bin
  69. filesize=`du -b "palette.bin" | cut -f1`
  70. printf "0: %.6x" $filesize | xxd -r -g0 > 0C_3bytes_.bin
  71. echo 0:0C | xxd -r > 0C_byte0_.bin
  72. dd ibs=1 count=1 skip=0 if=0C_3bytes_.bin of=0C_byte3_.bin
  73. dd ibs=1 count=1 skip=1 if=0C_3bytes_.bin of=0C_byte2_.bin
  74. dd ibs=1 count=1 skip=2 if=0C_3bytes_.bin of=0C_byte1_.bin
  75. cat 0C_byte0_.bin 0C_byte1_.bin 0C_byte2_.bin 0C_byte3_.bin palette.bin > 0C_all.bin
  76. rm 0C_*_.bin
  77. rm palette.bin
  78. sleep 1
  79. #- 0D - tunes: notes
  80. xxd -r -p ./library/tunes_notes.hex > tunes_notes.bin
  81. filesize=`du -b "tunes_notes.bin" | cut -f1`
  82. printf "0: %.6x" $filesize | xxd -r -g0 > 0D_3bytes_.bin
  83. echo 0:0D | xxd -r > 0D_byte0_.bin
  84. dd ibs=1 count=1 skip=0 if=0D_3bytes_.bin of=0D_byte3_.bin
  85. dd ibs=1 count=1 skip=1 if=0D_3bytes_.bin of=0D_byte2_.bin
  86. dd ibs=1 count=1 skip=2 if=0D_3bytes_.bin of=0D_byte1_.bin
  87. cat 0D_byte0_.bin 0D_byte1_.bin 0D_byte2_.bin 0D_byte3_.bin tunes_notes.bin > 0D_all.bin
  88. rm 0D_*_.bin
  89. rm tunes_notes.bin
  90. sleep 1
  91. #- 0E - tunes: frames
  92. xxd -r -p ./library/tunes_frames.hex > tunes_frames.bin
  93. filesize=`du -b "tunes_frames.bin" | cut -f1`
  94. printf "0: %.6x" $filesize | xxd -r -g0 > 0E_3bytes_.bin
  95. echo 0:0E | xxd -r > 0E_byte0_.bin
  96. dd ibs=1 count=1 skip=0 if=0E_3bytes_.bin of=0E_byte3_.bin
  97. dd ibs=1 count=1 skip=1 if=0E_3bytes_.bin of=0E_byte2_.bin
  98. dd ibs=1 count=1 skip=2 if=0E_3bytes_.bin of=0E_byte1_.bin
  99. cat 0E_byte0_.bin 0E_byte1_.bin 0E_byte2_.bin 0E_byte3_.bin tunes_frames.bin > 0E_all.bin
  100. rm 0E_*_.bin
  101. rm tunes_frames.bin
  102. sleep 1
  103. #- 0F - ?
  104. cat 05_all.bin 0D_all.bin 0E_all.bin 01_all.bin 02_all.bin 0C_all.bin 0A_all.bin > example01.tic
  105. rm 05_all.bin 0D_all.bin 0E_all.bin 01_all.bin 02_all.bin 0C_all.bin 0A_all.bin
  106. sleep 1
  107. tic80 example01.tic
  108. # tic80 -fullscreen example01.tic still doesn't work... :(