burn 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (190) hide show
  1. data/LICENSE +621 -0
  2. data/README.md +467 -0
  3. data/Rakefile +1 -0
  4. data/bin/burn +14 -0
  5. data/lib/burn/builder.rb +65 -0
  6. data/lib/burn/cli.rb +187 -0
  7. data/lib/burn/debug.rb +25 -0
  8. data/lib/burn/dsl/channel_stream.rb +105 -0
  9. data/lib/burn/dsl/declare.rb +42 -0
  10. data/lib/burn/dsl/dsl_base.rb +31 -0
  11. data/lib/burn/dsl/music.rb +36 -0
  12. data/lib/burn/dsl/note.rb +125 -0
  13. data/lib/burn/dsl/scene.rb +278 -0
  14. data/lib/burn/dsl/sound.rb +30 -0
  15. data/lib/burn/dsl/sound_effect.rb +91 -0
  16. data/lib/burn/dsl.rb +8 -0
  17. data/lib/burn/generator/assembly_music.rb +47 -0
  18. data/lib/burn/generator/assembly_sound_effect.rb +33 -0
  19. data/lib/burn/generator/c_source.rb +54 -0
  20. data/lib/burn/generator/template/mus_template.s +49 -0
  21. data/lib/burn/generator/template/template.c +88 -0
  22. data/lib/burn/generator.rb +3 -0
  23. data/lib/burn/tools/mac/cc65/asminc/_file.inc +27 -0
  24. data/lib/burn/tools/mac/cc65/asminc/_heap.inc +35 -0
  25. data/lib/burn/tools/mac/cc65/asminc/apple2.inc +64 -0
  26. data/lib/burn/tools/mac/cc65/asminc/atari.inc +1175 -0
  27. data/lib/burn/tools/mac/cc65/asminc/atari.mac +59 -0
  28. data/lib/burn/tools/mac/cc65/asminc/atmos.inc +110 -0
  29. data/lib/burn/tools/mac/cc65/asminc/c128.inc +214 -0
  30. data/lib/burn/tools/mac/cc65/asminc/c16.inc +9 -0
  31. data/lib/burn/tools/mac/cc65/asminc/c64.inc +212 -0
  32. data/lib/burn/tools/mac/cc65/asminc/cbm.mac +50 -0
  33. data/lib/burn/tools/mac/cc65/asminc/cbm510.inc +182 -0
  34. data/lib/burn/tools/mac/cc65/asminc/cbm610.inc +110 -0
  35. data/lib/burn/tools/mac/cc65/asminc/cbm_filetype.inc +34 -0
  36. data/lib/burn/tools/mac/cc65/asminc/cpu.mac +24 -0
  37. data/lib/burn/tools/mac/cc65/asminc/ctype.inc +29 -0
  38. data/lib/burn/tools/mac/cc65/asminc/em-error.inc +49 -0
  39. data/lib/burn/tools/mac/cc65/asminc/em-kernel.inc +106 -0
  40. data/lib/burn/tools/mac/cc65/asminc/errno.inc +36 -0
  41. data/lib/burn/tools/mac/cc65/asminc/fcntl.inc +21 -0
  42. data/lib/burn/tools/mac/cc65/asminc/generic.mac +55 -0
  43. data/lib/burn/tools/mac/cc65/asminc/get_tv.inc +22 -0
  44. data/lib/burn/tools/mac/cc65/asminc/joy-error.inc +44 -0
  45. data/lib/burn/tools/mac/cc65/asminc/joy-kernel.inc +85 -0
  46. data/lib/burn/tools/mac/cc65/asminc/longbranch.mac +88 -0
  47. data/lib/burn/tools/mac/cc65/asminc/lynx.inc +279 -0
  48. data/lib/burn/tools/mac/cc65/asminc/modload.inc +78 -0
  49. data/lib/burn/tools/mac/cc65/asminc/mouse-kernel.inc +180 -0
  50. data/lib/burn/tools/mac/cc65/asminc/nes.inc +93 -0
  51. data/lib/burn/tools/mac/cc65/asminc/o65.inc +150 -0
  52. data/lib/burn/tools/mac/cc65/asminc/opcodes.inc +509 -0
  53. data/lib/burn/tools/mac/cc65/asminc/pet.inc +54 -0
  54. data/lib/burn/tools/mac/cc65/asminc/plus4.inc +86 -0
  55. data/lib/burn/tools/mac/cc65/asminc/ser-error.inc +54 -0
  56. data/lib/burn/tools/mac/cc65/asminc/ser-kernel.inc +162 -0
  57. data/lib/burn/tools/mac/cc65/asminc/signal.inc +57 -0
  58. data/lib/burn/tools/mac/cc65/asminc/smc.inc +245 -0
  59. data/lib/burn/tools/mac/cc65/asminc/stdio.inc +70 -0
  60. data/lib/burn/tools/mac/cc65/asminc/supervision.inc +76 -0
  61. data/lib/burn/tools/mac/cc65/asminc/tgi-error.inc +52 -0
  62. data/lib/burn/tools/mac/cc65/asminc/tgi-kernel.inc +234 -0
  63. data/lib/burn/tools/mac/cc65/asminc/tgi-vectorfont.inc +70 -0
  64. data/lib/burn/tools/mac/cc65/asminc/time.inc +59 -0
  65. data/lib/burn/tools/mac/cc65/asminc/utsname.inc +46 -0
  66. data/lib/burn/tools/mac/cc65/asminc/vic20.inc +75 -0
  67. data/lib/burn/tools/mac/cc65/asminc/zeropage.inc +26 -0
  68. data/lib/burn/tools/mac/cc65/bin/ca65 +0 -0
  69. data/lib/burn/tools/mac/cc65/bin/cc65 +0 -0
  70. data/lib/burn/tools/mac/cc65/bin/ld65 +0 -0
  71. data/lib/burn/tools/other/cc65/asminc/_file.inc +27 -0
  72. data/lib/burn/tools/other/cc65/asminc/_heap.inc +35 -0
  73. data/lib/burn/tools/other/cc65/asminc/apple2.inc +64 -0
  74. data/lib/burn/tools/other/cc65/asminc/atari.inc +1175 -0
  75. data/lib/burn/tools/other/cc65/asminc/atari.mac +59 -0
  76. data/lib/burn/tools/other/cc65/asminc/atmos.inc +110 -0
  77. data/lib/burn/tools/other/cc65/asminc/c128.inc +214 -0
  78. data/lib/burn/tools/other/cc65/asminc/c16.inc +9 -0
  79. data/lib/burn/tools/other/cc65/asminc/c64.inc +212 -0
  80. data/lib/burn/tools/other/cc65/asminc/cbm.mac +50 -0
  81. data/lib/burn/tools/other/cc65/asminc/cbm510.inc +182 -0
  82. data/lib/burn/tools/other/cc65/asminc/cbm610.inc +110 -0
  83. data/lib/burn/tools/other/cc65/asminc/cbm_filetype.inc +34 -0
  84. data/lib/burn/tools/other/cc65/asminc/cpu.mac +24 -0
  85. data/lib/burn/tools/other/cc65/asminc/ctype.inc +29 -0
  86. data/lib/burn/tools/other/cc65/asminc/em-error.inc +49 -0
  87. data/lib/burn/tools/other/cc65/asminc/em-kernel.inc +106 -0
  88. data/lib/burn/tools/other/cc65/asminc/errno.inc +36 -0
  89. data/lib/burn/tools/other/cc65/asminc/fcntl.inc +21 -0
  90. data/lib/burn/tools/other/cc65/asminc/generic.mac +55 -0
  91. data/lib/burn/tools/other/cc65/asminc/get_tv.inc +22 -0
  92. data/lib/burn/tools/other/cc65/asminc/joy-error.inc +44 -0
  93. data/lib/burn/tools/other/cc65/asminc/joy-kernel.inc +85 -0
  94. data/lib/burn/tools/other/cc65/asminc/longbranch.mac +88 -0
  95. data/lib/burn/tools/other/cc65/asminc/lynx.inc +279 -0
  96. data/lib/burn/tools/other/cc65/asminc/modload.inc +78 -0
  97. data/lib/burn/tools/other/cc65/asminc/mouse-kernel.inc +180 -0
  98. data/lib/burn/tools/other/cc65/asminc/nes.inc +93 -0
  99. data/lib/burn/tools/other/cc65/asminc/o65.inc +150 -0
  100. data/lib/burn/tools/other/cc65/asminc/opcodes.inc +509 -0
  101. data/lib/burn/tools/other/cc65/asminc/pet.inc +54 -0
  102. data/lib/burn/tools/other/cc65/asminc/plus4.inc +86 -0
  103. data/lib/burn/tools/other/cc65/asminc/ser-error.inc +54 -0
  104. data/lib/burn/tools/other/cc65/asminc/ser-kernel.inc +162 -0
  105. data/lib/burn/tools/other/cc65/asminc/signal.inc +57 -0
  106. data/lib/burn/tools/other/cc65/asminc/smc.inc +245 -0
  107. data/lib/burn/tools/other/cc65/asminc/stdio.inc +70 -0
  108. data/lib/burn/tools/other/cc65/asminc/supervision.inc +76 -0
  109. data/lib/burn/tools/other/cc65/asminc/tgi-error.inc +52 -0
  110. data/lib/burn/tools/other/cc65/asminc/tgi-kernel.inc +234 -0
  111. data/lib/burn/tools/other/cc65/asminc/tgi-vectorfont.inc +70 -0
  112. data/lib/burn/tools/other/cc65/asminc/time.inc +59 -0
  113. data/lib/burn/tools/other/cc65/asminc/utsname.inc +46 -0
  114. data/lib/burn/tools/other/cc65/asminc/vic20.inc +75 -0
  115. data/lib/burn/tools/other/cc65/asminc/zeropage.inc +26 -0
  116. data/lib/burn/tools/other/cc65/bin/ca65 +0 -0
  117. data/lib/burn/tools/other/cc65/bin/cc65 +0 -0
  118. data/lib/burn/tools/other/cc65/bin/ld65 +0 -0
  119. data/lib/burn/tools/win/cc65/asminc/_file.inc +27 -0
  120. data/lib/burn/tools/win/cc65/asminc/_heap.inc +35 -0
  121. data/lib/burn/tools/win/cc65/asminc/apple2.inc +64 -0
  122. data/lib/burn/tools/win/cc65/asminc/atari.inc +1101 -0
  123. data/lib/burn/tools/win/cc65/asminc/atmos.inc +31 -0
  124. data/lib/burn/tools/win/cc65/asminc/c128.inc +213 -0
  125. data/lib/burn/tools/win/cc65/asminc/c16.inc +9 -0
  126. data/lib/burn/tools/win/cc65/asminc/c64.inc +212 -0
  127. data/lib/burn/tools/win/cc65/asminc/cbm510.inc +182 -0
  128. data/lib/burn/tools/win/cc65/asminc/cbm610.inc +110 -0
  129. data/lib/burn/tools/win/cc65/asminc/ctype.inc +29 -0
  130. data/lib/burn/tools/win/cc65/asminc/em-error.inc +44 -0
  131. data/lib/burn/tools/win/cc65/asminc/em-kernel.inc +100 -0
  132. data/lib/burn/tools/win/cc65/asminc/errno.inc +36 -0
  133. data/lib/burn/tools/win/cc65/asminc/fcntl.inc +21 -0
  134. data/lib/burn/tools/win/cc65/asminc/get_tv.inc +22 -0
  135. data/lib/burn/tools/win/cc65/asminc/joy-error.inc +44 -0
  136. data/lib/burn/tools/win/cc65/asminc/joy-kernel.inc +85 -0
  137. data/lib/burn/tools/win/cc65/asminc/lynx.inc +273 -0
  138. data/lib/burn/tools/win/cc65/asminc/modload.inc +78 -0
  139. data/lib/burn/tools/win/cc65/asminc/mouse-kernel.inc +179 -0
  140. data/lib/burn/tools/win/cc65/asminc/nes.inc +93 -0
  141. data/lib/burn/tools/win/cc65/asminc/o65.inc +135 -0
  142. data/lib/burn/tools/win/cc65/asminc/pet.inc +45 -0
  143. data/lib/burn/tools/win/cc65/asminc/plus4.inc +87 -0
  144. data/lib/burn/tools/win/cc65/asminc/rs232.inc +19 -0
  145. data/lib/burn/tools/win/cc65/asminc/ser-error.inc +50 -0
  146. data/lib/burn/tools/win/cc65/asminc/ser-kernel.inc +161 -0
  147. data/lib/burn/tools/win/cc65/asminc/signal.inc +57 -0
  148. data/lib/burn/tools/win/cc65/asminc/stdio.inc +70 -0
  149. data/lib/burn/tools/win/cc65/asminc/supervision.inc +76 -0
  150. data/lib/burn/tools/win/cc65/asminc/tgi-error.inc +48 -0
  151. data/lib/burn/tools/win/cc65/asminc/tgi-kernel.inc +183 -0
  152. data/lib/burn/tools/win/cc65/asminc/tgi-mode.inc +48 -0
  153. data/lib/burn/tools/win/cc65/asminc/time.inc +59 -0
  154. data/lib/burn/tools/win/cc65/asminc/utsname.inc +46 -0
  155. data/lib/burn/tools/win/cc65/asminc/vic20.inc +77 -0
  156. data/lib/burn/tools/win/cc65/asminc/zeropage.inc +22 -0
  157. data/lib/burn/tools/win/cc65/bin/ca65.exe +0 -0
  158. data/lib/burn/tools/win/cc65/bin/cc65.exe +0 -0
  159. data/lib/burn/tools/win/cc65/bin/ld65.exe +0 -0
  160. data/lib/burn/util/os.rb +38 -0
  161. data/lib/burn/util/patternizer.rb +62 -0
  162. data/lib/burn/util/pxes.rb +180 -0
  163. data/lib/burn/util/server.rb +21 -0
  164. data/lib/burn/util.rb +4 -0
  165. data/lib/burn/version.rb +3 -0
  166. data/lib/burn/workspace_default/asset/crt0.s +260 -0
  167. data/lib/burn/workspace_default/asset/famitone.s +1031 -0
  168. data/lib/burn/workspace_default/asset/mus_instruments.s +50 -0
  169. data/lib/burn/workspace_default/asset/music.s +3 -0
  170. data/lib/burn/workspace_default/asset/nes.cfg +83 -0
  171. data/lib/burn/workspace_default/asset/neslib.h +213 -0
  172. data/lib/burn/workspace_default/asset/neslib.s +923 -0
  173. data/lib/burn/workspace_default/asset/runtime.lib +0 -0
  174. data/lib/burn/workspace_default/asset/sounds.s +143 -0
  175. data/lib/burn/workspace_default/asset/test.h +22 -0
  176. data/lib/burn/workspace_default/asset/tileset.chr +0 -0
  177. data/lib/burn/workspace_default/release/js/emulator.html +42 -0
  178. data/lib/burn/workspace_default/release/js/js/dynamicaudio-89ba58da476270a9b630.min.js +1 -0
  179. data/lib/burn/workspace_default/release/js/js/jquery-1.4.2.min.js +154 -0
  180. data/lib/burn/workspace_default/release/js/js/jsnes-4e7a7260aa.js +7149 -0
  181. data/lib/burn/workspace_default/release/js/swf/dynamicaudio.swf +0 -0
  182. data/lib/burn/workspace_default/scripts/compile.bat +30 -0
  183. data/lib/burn/workspace_default/scripts/compile.sh +30 -0
  184. data/lib/burn.rb +11 -0
  185. data/test/helper.rb +8 -0
  186. data/test/runner.rb +2 -0
  187. data/test/test_burn.rb +14 -0
  188. data/test/test_dsl.rb +22 -0
  189. data/test/test_pxes.rb +48 -0
  190. metadata +270 -0
@@ -0,0 +1,76 @@
1
+ ; supervision symbols
2
+
3
+ ; supervision 65c02s
4
+ ; in cc65 up to 2.9.1 65c02 means 65c02s
5
+ .pc02
6
+
7
+ lcd_addr = $4000
8
+ LCD_LINESIZE = $30
9
+ LCD_WIDTH = 160
10
+ LCD_HEIGHT = 160
11
+ ; 2 bit per pixel, packed
12
+
13
+ lcd_width = $2000
14
+ lcd_height = $2001
15
+ lcd_xpos = $2002 ; in pixel, bit 0+1 not used
16
+ lcd_ypos = $2003 ; weird
17
+
18
+ sv_port_r = $2021
19
+ sv_port_w = $2022
20
+
21
+ sv_timer_count = $2023
22
+ ; read for quitting
23
+ sv_timer_quit = $2024
24
+
25
+ ; bit 0 timer, bit 1 dma
26
+ sv_irq_source = $2027
27
+ SV_IRQ_REQUEST_TIMER = 1
28
+ SV_IRQ_REQUEST_DMA = 2
29
+
30
+ ; bit 5,6,7 select bank at 0x8000
31
+ sv_bank = $2026
32
+ SV_NMI_ENABLE_ON = 1
33
+ SV_IRQ_ENABLE_TIMER = 2
34
+ SV_IRQ_ENABLE_DMA = 4
35
+ SV_LCD_ON = 8
36
+ SV_TIMER_MODE_240Hz = $10 ; else 15360
37
+
38
+
39
+ ; low activ/pressed
40
+ sv_control = $2020
41
+ SV_RIGHT = 1
42
+ SV_LEFT = 2
43
+ SV_DOWN = 4
44
+ SV_UP = 8
45
+ SV_BUTTONB = $10
46
+ SV_BUTTONA = $20
47
+ SV_SELECT = $40
48
+ SV_START = $80
49
+
50
+ ; frequency=125000/counter
51
+ sv_audio_right_counter = $2010 ;word
52
+ sv_audio_left_counter = $2014
53
+ SV_AUDIO_ON =$40
54
+ ;bits 0..3 volume
55
+ ; bit 4 ?
56
+ ; bit 5 ?
57
+ sv_audio_right_control = $2012
58
+ sv_audio_left_control = $2016
59
+ ; write activates tone for x/60 sec (0 means 256)
60
+ sv_audio_right_timer = $2013
61
+ sv_audio_left_timer = $2017
62
+
63
+
64
+ ;read for irq quitting
65
+ sv_dma_quit = $2025
66
+ sv_dma_on = $201c
67
+ ; bit 7 true start, false stop
68
+ sv_dma_start = $2018 ; word
69
+ sv_dma_size = $201a ; *32 samples
70
+ sv_dma_control = $201b
71
+ ; bit 0,1 speed: 0 15360, 11 15360/4
72
+ ; bit 2,3 volume: 0 silent, 11 loud
73
+
74
+ sv_noise_volume = $2028 ; and frequency
75
+ sv_noise_timer = $2029
76
+ sv_noise_control = $202a
@@ -0,0 +1,48 @@
1
+ ;*****************************************************************************/
2
+ ;* */
3
+ ;* tgi-error.inc */
4
+ ;* */
5
+ ;* TGI error codes */
6
+ ;* */
7
+ ;* */
8
+ ;* */
9
+ ;* (C) 2002-2004 Ullrich von Bassewitz */
10
+ ;* R�merstra�e 52 */
11
+ ;* D-70794 Filderstadt */
12
+ ;* EMail: uz@cc65.org */
13
+ ;* */
14
+ ;* */
15
+ ;* This software is provided 'as-is', without any expressed or implied */
16
+ ;* warranty. In no event will the authors be held liable for any damages */
17
+ ;* arising from the use of this software. */
18
+ ;* */
19
+ ;* Permission is granted to anyone to use this software for any purpose, */
20
+ ;* including commercial applications, and to alter it and redistribute it */
21
+ ;* freely, subject to the following restrictions: */
22
+ ;* */
23
+ ;* 1. The origin of this software must not be misrepresented; you must not */
24
+ ;* claim that you wrote the original software. If you use this software */
25
+ ;* in a product, an acknowledgment in the product documentation would be */
26
+ ;* appreciated but is not required. */
27
+ ;* 2. Altered source versions must be plainly marked as such, and must not */
28
+ ;* be misrepresented as being the original software. */
29
+ ;* 3. This notice may not be removed or altered from any source */
30
+ ;* distribution. */
31
+ ;* */
32
+ ;*****************************************************************************/
33
+
34
+
35
+
36
+ ; Error constants
37
+ .enum
38
+ TGI_ERR_OK ; No error
39
+ TGI_ERR_NO_DRIVER ; No driver available
40
+ TGI_ERR_LOAD_ERROR ; Error loading driver
41
+ TGI_ERR_INV_DRIVER ; Invalid driver
42
+ TGI_ERR_INV_MODE ; Mode not supported by driver
43
+ TGI_ERR_INV_ARG ; Invalid function argument
44
+ TGI_ERR_INV_FUNC ; Function not supported
45
+
46
+ TGI_ERR_COUNT ; Special: Number of error messages
47
+ .endenum
48
+
@@ -0,0 +1,183 @@
1
+ ;*****************************************************************************/
2
+ ;* */
3
+ ;* tgi-kernel.inc */
4
+ ;* */
5
+ ;* TGI kernel interface */
6
+ ;* */
7
+ ;* */
8
+ ;* */
9
+ ;* (C) 2002-2004 Ullrich von Bassewitz */
10
+ ;* R�merstra�e 52 */
11
+ ;* D-70794 Filderstadt */
12
+ ;* EMail: uz@cc65.org */
13
+ ;* */
14
+ ;* */
15
+ ;* This software is provided 'as-is', without any expressed or implied */
16
+ ;* warranty. In no event will the authors be held liable for any damages */
17
+ ;* arising from the use of this software. */
18
+ ;* */
19
+ ;* Permission is granted to anyone to use this software for any purpose, */
20
+ ;* including commercial applications, and to alter it and redistribute it */
21
+ ;* freely, subject to the following restrictions: */
22
+ ;* */
23
+ ;* 1. The origin of this software must not be misrepresented; you must not */
24
+ ;* claim that you wrote the original software. If you use this software */
25
+ ;* in a product, an acknowledgment in the product documentation would be */
26
+ ;* appreciated but is not required. */
27
+ ;* 2. Altered source versions must be plainly marked as such, and must not */
28
+ ;* be misrepresented as being the original software. */
29
+ ;* 3. This notice may not be removed or altered from any source */
30
+ ;* distribution. */
31
+ ;* */
32
+ ;*****************************************************************************/
33
+
34
+
35
+
36
+ ;------------------------------------------------------------------------------
37
+ ; The driver header
38
+
39
+ .struct TGI_HDR
40
+ ID .byte 3 ; Contains 0x74, 0x67, 0x69 ("tgi")
41
+ VERSION .byte 1 ; Interface version
42
+ VARS .struct
43
+ XRES .word 1 ; X resolution
44
+ YRES .word 1 ; Y resolution
45
+ COLORCOUNT .byte 1 ; Number of available colors
46
+ PAGECOUNT .byte 1 ; Number of screens available
47
+ FONTSIZE_X .byte 1 ; System font size in X direction
48
+ FONTSIZE_Y .byte 1 ; System font size in Y direction
49
+ .endstruct
50
+ RESERVED .byte 4 ; Reserved for extensions
51
+ JUMPTAB .struct
52
+ INSTALL .addr ; INSTALL routine
53
+ UNINSTALL .addr ; UNINSTALL routine
54
+ INIT .addr ; INIT routine
55
+ DONE .addr ; DONE routine
56
+ GETERROR .addr ; GETERROR routine
57
+ CONTROL .addr ; CONTROL routine
58
+ CLEAR .addr ; CLEAR routine
59
+ SETVIEWPAGE .addr ; SETVIEWPAGE routine
60
+ SETDRAWPAGE .addr ; SETDRAWPAGE routine
61
+ SETCOLOR .addr ; SETCOLOR routine
62
+ SETPALETTE .addr ; SETPALETTE routine
63
+ GETPALETTE .addr ; GETPALETTE routine
64
+ GETDEFPALETTE .addr ; GETDEFPALETTE routine
65
+ SETPIXEL .addr ; SETPIXEL routine
66
+ GETPIXEL .addr ; GETPIXEL routine
67
+ LINE .addr ; LINE routine
68
+ BAR .addr ; BAR routine
69
+ CIRCLE .addr ; CIRCLE routine
70
+ TEXTSTYLE .addr ; TEXTSTYLE routine
71
+ OUTTEXT .addr ; OUTTEXT routine
72
+ IRQ .addr ; IRQ routine
73
+ .endstruct
74
+ .endstruct
75
+
76
+ ;------------------------------------------------------------------------------
77
+ ; The TGI API version, stored at TGI_HDR_VERSION
78
+
79
+ TGI_API_VERSION = $02
80
+
81
+ ;------------------------------------------------------------------------------
82
+ ; Text style constants
83
+
84
+ TGI_TEXT_HORIZONTAL = 0
85
+ TGI_TEXT_VERTICAL = 1
86
+
87
+ ;------------------------------------------------------------------------------
88
+ ; Variables
89
+
90
+ .global _tgi_drv ; Pointer to driver
91
+ .global _tgi_error ; Last error code
92
+ .global _tgi_gmode ; Flag: graphics mode active
93
+ .global _tgi_curx ; Current drawing cursor X
94
+ .global _tgi_cury ; Current drawing cursor Y
95
+ .global _tgi_color ; Current drawing color
96
+ .global _tgi_textdir ; Current text direction
97
+ .global _tgi_textmagx ; Text magnification in X dir
98
+ .global _tgi_textmagy ; Text magnification in Y dir
99
+ .global _tgi_xres ; X resolution of the current mode
100
+ .global _tgi_yres ; Y resolution of the current mode
101
+ .global _tgi_colorcount ; Number of available colors
102
+ .global _tgi_pagecount ; Number of available screen pages
103
+ .global _tgi_fontsizex ; System font X size
104
+ .global _tgi_fontsizey ; System font Y size
105
+
106
+ ;------------------------------------------------------------------------------
107
+ ; Driver entry points
108
+
109
+ .global tgi_install
110
+ .global tgi_uninstall
111
+ .global tgi_init
112
+ .global tgi_done
113
+ .global tgi_geterror
114
+ .global tgi_control
115
+ .global tgi_clear
116
+ .global tgi_setviewpage
117
+ .global tgi_setdrawpage
118
+ .global tgi_setcolor
119
+ .global tgi_setpalette
120
+ .global tgi_getpalette
121
+ .global tgi_getdefpalette
122
+ .global tgi_setpixel
123
+ .global tgi_getpixel
124
+ .global tgi_line
125
+ .global tgi_bar
126
+ .global tgi_circle
127
+ .global tgi_textstyle
128
+ .global tgi_outtext
129
+
130
+ ;------------------------------------------------------------------------------
131
+ ; ASM functions
132
+
133
+ .global tgi_getset
134
+ .global tgi_inv_arg
135
+ .global tgi_inv_drv
136
+ .global tgi_linepop
137
+ .global tgi_set_ptr
138
+ .global tgi_popxy
139
+ .global tgi_popxy2
140
+ .global tgi_curtoxy
141
+
142
+ ;------------------------------------------------------------------------------
143
+ ; C callable functions
144
+
145
+ .global _tgi_load
146
+ .global _tgi_load_driver
147
+ .global _tgi_unload
148
+ .global _tgi_install
149
+ .global _tgi_uninstall
150
+ .global _tgi_init
151
+ .global _tgi_ioctl
152
+ .global _tgi_done
153
+ .global _tgi_geterror
154
+ .global _tgi_geterrormsg
155
+ .global _tgi_clear
156
+ .global _tgi_getpagecount
157
+ .global _tgi_setviewpage
158
+ .global _tgi_setdrawpage
159
+ .global _tgi_getcolorcount
160
+ .global _tgi_getmaxcolor
161
+ .global _tgi_setcolor
162
+ .global _tgi_getcolor
163
+ .global _tgi_setpalette
164
+ .global _tgi_getpalette
165
+ .global _tgi_getdefpalette
166
+ .global _tgi_getxres
167
+ .global _tgi_getmaxx
168
+ .global _tgi_getyres
169
+ .global _tgi_getmaxy
170
+ .global _tgi_getpixel
171
+ .global _tgi_setpixel
172
+ .global _tgi_gotoxy
173
+ .global _tgi_line
174
+ .global _tgi_lineto
175
+ .global _tgi_circle
176
+ .global _tgi_bar
177
+ .global _tgi_textstyle
178
+ .global _tgi_textwidth
179
+ .global _tgi_textheight
180
+ .global _tgi_outtext
181
+ .global _tgi_outtextxy
182
+
183
+
@@ -0,0 +1,48 @@
1
+ ;*****************************************************************************/
2
+ ;* */
3
+ ;* tgi-mode.inc */
4
+ ;* */
5
+ ;* TGI mode definitions */
6
+ ;* */
7
+ ;* */
8
+ ;* */
9
+ ;* (C) 2002-2003 Ullrich von Bassewitz */
10
+ ;* R�merstra�e 52 */
11
+ ;* D-70794 Filderstadt */
12
+ ;* EMail: uz@cc65.org */
13
+ ;* */
14
+ ;* */
15
+ ;* This software is provided 'as-is', without any expressed or implied */
16
+ ;* warranty. In no event will the authors be held liable for any damages */
17
+ ;* arising from the use of this software. */
18
+ ;* */
19
+ ;* Permission is granted to anyone to use this software for any purpose, */
20
+ ;* including commercial applications, and to alter it and redistribute it */
21
+ ;* freely, subject to the following restrictions: */
22
+ ;* */
23
+ ;* 1. The origin of this software must not be misrepresented; you must not */
24
+ ;* claim that you wrote the original software. If you use this software */
25
+ ;* in a product, an acknowledgment in the product documentation would be */
26
+ ;* appreciated but is not required. */
27
+ ;* 2. Altered source versions must be plainly marked as such, and must not */
28
+ ;* be misrepresented as being the original software. */
29
+ ;* 3. This notice may not be removed or altered from any source */
30
+ ;* distribution. */
31
+ ;* */
32
+ ;*****************************************************************************/
33
+
34
+
35
+
36
+ ; Graphics modes. Zero may not be used as a mode number.
37
+ .enum
38
+ TGI_MODE_INVALID
39
+ TGI_MODE_320_200_2 ; 320x200, 2 colors (b/w)
40
+ TGI_MODE_160_200_4 ; 160x200, 4 colors
41
+ TGI_MODE_640_200_2 ; 640x200, 2 colors (b/w)
42
+ TGI_MODE_640_480_2 ; 640x480, 2 colors (b/w)
43
+ TGI_MODE_280_192_8 ; 280x192, 8 colors
44
+ TGI_MODE_40_48_16 ; 40x48, 16 colors
45
+ .endenum
46
+
47
+
48
+
@@ -0,0 +1,59 @@
1
+ ;/*****************************************************************************/
2
+ ;/* */
3
+ ;/* time.inc */
4
+ ;/* */
5
+ ;/* Date and time */
6
+ ;/* */
7
+ ;/* */
8
+ ;/* */
9
+ ;/* (C) 2009 Ullrich von Bassewitz */
10
+ ;/* Roemerstrasse 52 */
11
+ ;/* D-70794 Filderstadt */
12
+ ;/* EMail: uz@cc65.org */
13
+ ;/* */
14
+ ;/* */
15
+ ;/* This software is provided 'as-is', without any expressed or implied */
16
+ ;/* warranty. In no event will the authors be held liable for any damages */
17
+ ;/* arising from the use of this software. */
18
+ ;/* */
19
+ ;/* Permission is granted to anyone to use this software for any purpose, */
20
+ ;/* including commercial applications, and to alter it and redistribute it */
21
+ ;/* freely, subject to the following restrictions: */
22
+ ;/* */
23
+ ;/* 1. The origin of this software must not be misrepresented; you must not */
24
+ ;/* claim that you wrote the original software. If you use this software */
25
+ ;/* in a product, an acknowledgment in the product documentation would be */
26
+ ;/* appreciated but is not required. */
27
+ ;/* 2. Altered source versions must be plainly marked as such, and must not */
28
+ ;/* be misrepresented as being the original software. */
29
+ ;/* 3. This notice may not be removed or altered from any source */
30
+ ;/* distribution. */
31
+ ;/* */
32
+ ;/*****************************************************************************/
33
+
34
+
35
+
36
+ ;------------------------------------------------------------------------------
37
+ ; Struct tm - must match the struct defined in time.h
38
+
39
+ .struct tm
40
+ tm_sec .word
41
+ tm_min .word
42
+ tm_hour .word
43
+ tm_mday .word
44
+ tm_mon .word
45
+ tm_year .word
46
+ tm_wday .word
47
+ tm_yday .word
48
+ tm_isdst .word
49
+ .endstruct
50
+
51
+
52
+ ;------------------------------------------------------------------------------
53
+ ; Exported functions
54
+
55
+ .global __systime
56
+ .global _mktime
57
+
58
+
59
+
@@ -0,0 +1,46 @@
1
+ ;/*****************************************************************************/
2
+ ;/* */
3
+ ;/* utsname.inc */
4
+ ;/* */
5
+ ;/* Return system information */
6
+ ;/* */
7
+ ;/* */
8
+ ;/* */
9
+ ;/* (C) 2003 Ullrich von Bassewitz */
10
+ ;/* R�merstrasse 52 */
11
+ ;/* D-70794 Filderstadt */
12
+ ;/* EMail: uz@cc65.org */
13
+ ;/* */
14
+ ;/* */
15
+ ;/* This software is provided 'as-is', without any expressed or implied */
16
+ ;/* warranty. In no event will the authors be held liable for any damages */
17
+ ;/* arising from the use of this software. */
18
+ ;/* */
19
+ ;/* Permission is granted to anyone to use this software for any purpose, */
20
+ ;/* including commercial applications, and to alter it and redistribute it */
21
+ ;/* freely, subject to the following restrictions: */
22
+ ;/* */
23
+ ;/* 1. The origin of this software must not be misrepresented; you must not */
24
+ ;/* claim that you wrote the original software. If you use this software */
25
+ ;/* in a product, an acknowledgment in the product documentation would be */
26
+ ;/* appreciated but is not required. */
27
+ ;/* 2. Altered source versions must be plainly marked as such, and must not */
28
+ ;/* be misrepresented as being the original software. */
29
+ ;/* 3. This notice may not be removed or altered from any source */
30
+ ;/* distribution. */
31
+ ;/* */
32
+ ;/*****************************************************************************/
33
+
34
+
35
+
36
+ ; Struct utsname
37
+ .struct utsname
38
+ sysname .byte 17
39
+ nodename .byte 9
40
+ release .byte 9
41
+ version .byte 9
42
+ machine .byte 25
43
+ .endstruct
44
+
45
+
46
+
@@ -0,0 +1,77 @@
1
+ ;
2
+ ; Vic20 generic definitions. Stolen mostly from c64.inc - Steve Schmidtke
3
+ ;
4
+
5
+
6
+ ; ---------------------------------------------------------------------------
7
+ ; Zero page, Commodore stuff
8
+
9
+ ST := $90 ; IEC status byte
10
+
11
+ TIME := $A0 ; 60HZ clock
12
+ FNAM_LEN := $B7 ; Length of filename
13
+ SECADR := $B9 ; Secondary address
14
+ DEVNUM := $BA ; Device number
15
+ FNAM := $BB ; Pointer to filename
16
+ KEY_COUNT := $C6 ; Number of keys in input buffer
17
+ RVS := $C7 ; Reverse flag
18
+ CURS_FLAG := $CC ; 1 = cursor off
19
+ CURS_BLINK := $CD ; Blink counter
20
+ CURS_CHAR := $CE ; Character under the cursor
21
+ CURS_STATE := $CF ; Cursor blink state
22
+ SCREEN_PTR := $D1 ; Pointer to current char in text screen
23
+ CURS_X := $D3 ; Cursor column
24
+ CURS_Y := $D6 ; Cursor row
25
+ CRAM_PTR := $F3 ; Pointer to current char in color RAM
26
+
27
+ BASIC_BUF := $200 ; Location of command-line
28
+ BASIC_BUF_LEN = 89 ; Maximum length of command-line
29
+
30
+ CHARCOLOR := $286
31
+ CURS_COLOR := $287 ; Color under the cursor
32
+
33
+
34
+ ; ---------------------------------------------------------------------------
35
+ ; Screen size
36
+
37
+ XSIZE = 22
38
+ YSIZE = 23
39
+
40
+ ; ---------------------------------------------------------------------------
41
+ ; Kernal routines
42
+
43
+ ; Direct entries
44
+ CLRSCR := $E55F
45
+ KBDREAD := $E5CF
46
+
47
+ ; ---------------------------------------------------------------------------
48
+ ; Vector and other locations
49
+
50
+ IRQVec := $0314
51
+ BRKVec := $0316
52
+ NMIVec := $0318
53
+
54
+ ; ---------------------------------------------------------------------------
55
+ ; I/O: 6560 VIC
56
+
57
+ VIC := $9000
58
+ VIC_LINES := $9003 ; Screen lines, bit 7 is bit 0 from VIC_HLINE
59
+ VIC_HLINE := $9004 ; Rasterline, bits 1-8
60
+ VIC_COLOR := $900F ; Border and background color
61
+
62
+ ; ---------------------------------------------------------------------------
63
+ ; I/O: 6522 VIA1
64
+
65
+ VIA1 := $9110
66
+ VIA1_JOY := $9111
67
+ VIA1_DDRB := $9112
68
+ VIA1_DDRA := $9113
69
+
70
+ ; ---------------------------------------------------------------------------
71
+ ; I/O: 6522 VIA2
72
+
73
+ VIA2 := $9120
74
+ VIA2_JOY := $9120
75
+ VIA2_DDRB := $9122
76
+ VIA2_DDRA := $9123
77
+
@@ -0,0 +1,22 @@
1
+ ;
2
+ ; zeropage.inc
3
+ ;
4
+ ; (C) Copyright 2002 Ullrich von Bassewitz (uz@cc65.org)
5
+ ;
6
+
7
+ ; Assembler include file that imports the runtime zero page locations used
8
+ ; by the compiler, ready for usage in asm code.
9
+
10
+
11
+ .importzp sp, sreg, regsave
12
+ .importzp ptr1, ptr2, ptr3, ptr4
13
+ .importzp tmp1, tmp2, tmp3, tmp4
14
+ .importzp regbank
15
+
16
+ ; The total amount of zero page space used
17
+
18
+ zpspace = 26
19
+
20
+
21
+
22
+
@@ -0,0 +1,38 @@
1
+ # refered: http://magazine.rubyist.net/?0017-CodeReview#l17
2
+ module Burn
3
+ module Util
4
+ class Os
5
+ @name = ''
6
+
7
+ def initialize
8
+ @name = RbConfig::CONFIG['host_os']
9
+ end
10
+
11
+ def is_win?
12
+ return true if @name =~ /mswin(?!ce)|mingw|bccwin/
13
+ false
14
+ end
15
+
16
+ def is_mac?
17
+ return true if @name =~ /mac|darwin/
18
+ false
19
+ end
20
+
21
+ def is_linux?
22
+ return true if @name =~ /linux|cygwin|bsd|solaris|sunos/
23
+ false
24
+ end
25
+
26
+ def os_name
27
+ if is_win? then
28
+ "win"
29
+ elsif is_mac? then
30
+ "mac"
31
+ else
32
+ "other"
33
+ end
34
+ end
35
+
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,62 @@
1
+ module Burn
2
+ module Util
3
+ class Patternizer
4
+ attr_reader :patterns, :width, :height
5
+ def initialize(spr_large)
6
+ @patterns = []
7
+ @width = 0
8
+ @height = 0
9
+ pattern_separator spr_large
10
+ end
11
+
12
+ include Debug
13
+
14
+ private
15
+ def patternize(spr)
16
+ pattern_upper = []
17
+ pattern_lower = []
18
+ spr.each_line do |line|
19
+ line.chomp.split(//).each do |c|
20
+ if c==' ' then
21
+ pattern_upper << 0
22
+ pattern_lower << 0
23
+ elsif c=='1' then
24
+ pattern_upper << 1
25
+ pattern_lower << 0
26
+ elsif c=='2' then
27
+ pattern_upper << 0
28
+ pattern_lower << 1
29
+ elsif c=='3' then
30
+ pattern_upper << 1
31
+ pattern_lower << 1
32
+ else
33
+ raise "Invalid Character found at sprite text. Please check you are using accepted charcter[\\s0-3]. \n#{spr}"
34
+ end
35
+ end
36
+ end
37
+ @patterns.push [pattern_upper.join+pattern_lower.join].pack("B*")
38
+ end
39
+
40
+ def pattern_separator(spr_large)
41
+ raw=[]
42
+ base_pointer=0
43
+ spr_large.each_line do |line|
44
+ base_pointer=raw.count if !raw[base_pointer].nil? && raw[base_pointer].count>7
45
+ line.chomp.unpack("a8"*(line.length/8)).each_with_index do |data, i|
46
+ raw[base_pointer+i] = [] if raw[base_pointer+i].nil?
47
+ raw[base_pointer+i] << data
48
+ end
49
+ @height+=1
50
+ @width=line.length/8
51
+ end
52
+ @height=@height/8
53
+
54
+ raw.each_with_index do |a, i|
55
+ log index:i
56
+ log a
57
+ patternize a.join("\n")
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end