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,162 @@
1
+ ;****************************************************************************
2
+ ;* *
3
+ ;* ser-kernel.inc *
4
+ ;* *
5
+ ;* Serial communication API *
6
+ ;* *
7
+ ;* *
8
+ ;* *
9
+ ;*(C) 2003-2006, 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
+ ;------------------------------------------------------------------------------
37
+ ; The driver header
38
+
39
+ .struct SER_HDR
40
+ ID .byte 3 ; Contains 0x73, 0x65, 0x72 ("ser")
41
+ VERSION .byte 1 ; Interface version
42
+ LIBREF .addr ; Library reference
43
+ JUMPTAB .struct
44
+ INSTALL .addr ; INSTALL routine
45
+ UNINSTALL .addr ; UNINSTALL routine
46
+ OPEN .addr ; OPEN routine
47
+ CLOSE .addr ; CLOSE routine
48
+ GET .addr ; GET routine
49
+ PUT .addr ; PUT routine
50
+ STATUS .addr ; STATUS routine
51
+ IOCTL .addr ; IOCTL routine
52
+ IRQ .addr ; IRQ routine
53
+ .endstruct
54
+ .endstruct
55
+
56
+
57
+ ;------------------------------------------------------------------------------
58
+ ; The SER API version, stored SER_HDR::VERSION
59
+
60
+ SER_API_VERSION = $01
61
+
62
+ ;------------------------------------------------------------------------------
63
+ ; ser_params
64
+
65
+ .struct SER_PARAMS
66
+ BAUDRATE .byte ; Baudrate
67
+ DATABITS .byte ; Number of data bits
68
+ STOPBITS .byte ; Number of stop bits
69
+ PARITY .byte ; Parity setting
70
+ HANDSHAKE .byte ; Type of handshake to use
71
+ .endstruct
72
+
73
+ ;------------------------------------------------------------------------------
74
+ ; Serial parameters
75
+
76
+ ; Baudrate
77
+ SER_BAUD_45_5 = $00
78
+ SER_BAUD_50 = $01
79
+ SER_BAUD_75 = $02
80
+ SER_BAUD_110 = $03
81
+ SER_BAUD_134_5 = $04
82
+ SER_BAUD_150 = $05
83
+ SER_BAUD_300 = $06
84
+ SER_BAUD_600 = $07
85
+ SER_BAUD_1200 = $08
86
+ SER_BAUD_1800 = $09
87
+ SER_BAUD_2400 = $0A
88
+ SER_BAUD_3600 = $0B
89
+ SER_BAUD_4800 = $0C
90
+ SER_BAUD_7200 = $0D
91
+ SER_BAUD_9600 = $0E
92
+ SER_BAUD_19200 = $0F
93
+ SER_BAUD_38400 = $10
94
+ SER_BAUD_57600 = $11
95
+ SER_BAUD_115200 = $12
96
+ SER_BAUD_230400 = $13
97
+ SER_BAUD_31250 = $14
98
+ SER_BAUD_62500 = $15
99
+
100
+ ; Data bit settings
101
+ SER_BITS_5 = $00
102
+ SER_BITS_6 = $01
103
+ SER_BITS_7 = $02
104
+ SER_BITS_8 = $03
105
+
106
+ ; Stop bit settings
107
+ SER_STOP_1 = $00
108
+ SER_STOP_2 = $01
109
+
110
+ ; Parity
111
+ SER_PAR_NONE = $00
112
+ SER_PAR_ODD = $01
113
+ SER_PAR_EVEN = $02
114
+ SER_PAR_MARK = $03
115
+ SER_PAR_SPACE = $04
116
+
117
+ ; Handshake
118
+ SER_HS_NONE = $00 ; No handshake
119
+ SER_HS_HW = $01 ; Hardware (RTS/CTS) handshake
120
+ SER_HS_SW = $02 ; Software handshake
121
+
122
+ ; Bit masks to mask out things from the status returned by ser_status
123
+ SER_STATUS_PE = $01 ; Parity error
124
+ SER_STATUS_FE = $02 ; Framing error
125
+ SER_STATUS_OE = $04 ; Overrun error
126
+ SER_STATUS_DCD = $20 ; NOT data carrier detect
127
+ SER_STATUS_DSR = $40 ; NOT data set ready
128
+
129
+ ;------------------------------------------------------------------------------
130
+ ; Variables
131
+
132
+ .global _ser_drv ; Pointer to driver
133
+
134
+ ;------------------------------------------------------------------------------
135
+ ; Driver entry points
136
+
137
+ .global ser_install
138
+ .global ser_uninstall
139
+ .global ser_open
140
+ .global ser_close
141
+ .global ser_get
142
+ .global ser_put
143
+ .global ser_status
144
+ .global ser_ioctl
145
+ .global ser_irq
146
+
147
+ ;------------------------------------------------------------------------------
148
+ ; C callable functions
149
+
150
+ .global _ser_load_driver
151
+ .global _ser_unload
152
+ .global _ser_install
153
+ .global _ser_uninstall
154
+ .global _ser_open
155
+ .global _ser_close
156
+ .global _ser_get
157
+ .global _ser_put
158
+ .global _ser_status
159
+ .global _ser_ioctl
160
+
161
+ .global _ser_clear_ptr
162
+
@@ -0,0 +1,57 @@
1
+ ;/*****************************************************************************/
2
+ ;/* */
3
+ ;/* signal.inc */
4
+ ;/* */
5
+ ;/* Signal handling definitions */
6
+ ;/* */
7
+ ;/* */
8
+ ;/* */
9
+ ;/* (C) 2002 Ullrich von Bassewitz */
10
+ ;/* Wacholderweg 14 */
11
+ ;/* D-70597 Stuttgart */
12
+ ;/* EMail: uz@musoftware.de */
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
+ ; Standard signal handling functions
37
+ SIG_ERR = $0000
38
+
39
+ ; Signal numbers
40
+ SIGABRT = 0
41
+ SIGFPE = 1
42
+ SIGILL = 2
43
+ SIGINT = 3
44
+ SIGSEGV = 4
45
+ SIGTERM = 5
46
+ SIGCOUNT = 6 ; Number of signals
47
+
48
+ ; Table with signal handlers (asm code only)
49
+ .global sigtable
50
+
51
+ ; Function declarations
52
+ .global __sig_ign
53
+ .global __sig_dfl
54
+ .global _signal
55
+ .global _raise
56
+
57
+
@@ -0,0 +1,245 @@
1
+ ; smc.mac
2
+ ; ca65 Macro-Pack for Self Modifying Code (SMC)
3
+ ;
4
+ ; (c) Christian Kr�ger, latest change: 09-Nov-2011
5
+ ;
6
+ ; This software is provided 'as-is', without any expressed or implied
7
+ ; warranty. In no event will the authors be held liable for any damages
8
+ ; arising from the use of this software.
9
+ ;
10
+ ; Permission is granted to anyone to use this software for any purpose,
11
+ ; including commercial applications, and to alter it and redistribute it
12
+ ; freely, subject to the following restrictions:
13
+ ;
14
+ ; 1. The origin of this software must not be misrepresented; you must not
15
+ ; claim that you wrote the original software. If you use this software
16
+ ; in a product, an acknowledgment in the product documentation would be
17
+ ; appreciated but is not required.
18
+ ; 2. Altered source versions must be plainly marked as such, and must not
19
+ ; be misrepresented as being the original software.
20
+ ; 3. This notice may not be removed or altered from any source
21
+ ; distribution.
22
+ ;
23
+
24
+ .define _SMCDesignator .mid(0, .tcount(label) - 1, label) .ident(.concat(.string(.right(1, label)), "_SMC"))
25
+ .define _SMCAlias .mid(0, .tcount(alias) - 1, alias) .ident(.concat(.string(.right(1, alias)), "_SMC"))
26
+ .define SMC_AbsAdr $FADE
27
+ .define SMC_ZpAdr $00
28
+ .define SMC_Opcode nop
29
+ .define SMC_Value $42
30
+
31
+ .macro SMC_OperateOnValue opcode, label
32
+ opcode _SMCDesignator+1
33
+ .endmacro
34
+
35
+ .macro SMC_OperateOnLowByte opcode, label
36
+ SMC_OperateOnValue opcode, label
37
+ .endmacro
38
+
39
+ .macro SMC_OperateOnHighByte opcode, label
40
+ opcode _SMCDesignator + 2
41
+ .endmacro
42
+
43
+ .macro SMC_Import alias
44
+ .import _SMCAlias
45
+ .endmacro
46
+
47
+ .macro SMC_Export alias, label
48
+ .export _SMCAlias := _SMCDesignator
49
+ .endmacro
50
+
51
+ .macro SMC label, statement
52
+ _SMCDesignator: statement
53
+ .endmacro
54
+
55
+ .macro SMC_TransferOpcode label, opcode, register
56
+ .if .paramcount = 2 .or .match ({register}, a)
57
+ lda #opcode
58
+ sta _SMCDesignator
59
+ .elseif .match ({register}, x)
60
+ ldx #opcode
61
+ stx _SMCDesignator
62
+ .elseif .match ({register}, y)
63
+ ldy #opcode
64
+ sty _SMCDesignator
65
+ .endif
66
+ .endmacro
67
+
68
+ .macro SMC_LoadOpcode label, register
69
+ .if .paramcount = 1 .or .match ({register}, a)
70
+ lda _SMCDesignator
71
+ .elseif .match ({register}, x)
72
+ ldx _SMCDesignator
73
+ .elseif .match ({register}, y)
74
+ ldy _SMCDesignator
75
+ .endif
76
+ .endmacro
77
+
78
+ .macro SMC_StoreOpcode label, register
79
+ .if .paramcount = 1 .or .match ({register}, a)
80
+ sta _SMCDesignator
81
+ .elseif .match ({register}, x)
82
+ stx _SMCDesignator
83
+ .elseif .match ({register}, y)
84
+ sty _SMCDesignator
85
+ .endif
86
+ .endmacro
87
+
88
+ .macro SMC_ChangeBranch label, destination, register
89
+ .if .paramcount = 2 .or .match ({register}, a)
90
+ lda #(destination - _SMCDesignator -2)
91
+ sta _SMCDesignator+1
92
+ .elseif .match ({register}, x)
93
+ ldx #(destination - _SMCDesignator - 2)
94
+ stx _SMCDesignator+1
95
+ .elseif .match ({register}, y)
96
+ ldy #(destination - _SMCDesignator - 2)
97
+ sty _SMCDesignator+1
98
+ .endif
99
+ .endmacro
100
+
101
+ .macro SMC_TransferValue label, value, register
102
+ .if .paramcount = 2 .or .match ({register}, a)
103
+ lda value
104
+ sta _SMCDesignator+1
105
+ .elseif .match ({register}, x)
106
+ ldx value
107
+ stx _SMCDesignator+1
108
+ .elseif .match ({register}, y)
109
+ ldy value
110
+ sty _SMCDesignator+1
111
+ .endif
112
+ .endmacro
113
+
114
+ .macro SMC_LoadValue label, register
115
+ .if .paramcount = 1 .or .match ({register}, a)
116
+ lda _SMCDesignator+1
117
+ .elseif .match ({register}, x)
118
+ ldx _SMCDesignator+1
119
+ .elseif .match ({register}, y)
120
+ ldy _SMCDesignator+1
121
+ .endif
122
+ .endmacro
123
+
124
+ .macro SMC_StoreValue label, register
125
+ .if .paramcount = 1 .or .match ({register}, a)
126
+ sta _SMCDesignator+1
127
+ .elseif .match ({register}, x)
128
+ stx _SMCDesignator+1
129
+ .elseif .match ({register}, y)
130
+ sty _SMCDesignator+1
131
+ .endif
132
+ .endmacro
133
+
134
+
135
+ .macro SMC_TransferLowByte label, value, register
136
+ SMC_TransferValue label, value, register
137
+ .endmacro
138
+
139
+ .macro SMC_LoadLowByte label, register
140
+ SMC_LoadValue label, register
141
+ .endmacro
142
+
143
+ .macro SMC_StoreLowByte label, register
144
+ SMC_StoreValue label, register
145
+ .endmacro
146
+
147
+ .macro SMC_TransferHighByte label, value, register
148
+ .if .paramcount = 2 .or .match ({register}, a)
149
+ lda value
150
+ sta _SMCDesignator+2
151
+ .elseif .match ({register}, x)
152
+ ldx value
153
+ stx _SMCDesignator+2
154
+ .elseif .match ({register}, y)
155
+ ldy value
156
+ sty _SMCDesignator+2
157
+ .endif
158
+ .endmacro
159
+
160
+ .macro SMC_LoadHighByte label, register
161
+ .if .paramcount = 1 .or .match ({register}, a)
162
+ lda _SMCDesignator+2
163
+ .elseif .match ({register}, x)
164
+ ldx _SMCDesignator+2
165
+ .elseif .match ({register}, y)
166
+ ldy _SMCDesignator+2
167
+ .endif
168
+ .endmacro
169
+
170
+ .macro SMC_StoreHighByte label, register
171
+ .if .paramcount = 1 .or .match ({register}, a)
172
+ sta _SMCDesignator+2
173
+ .elseif .match ({register}, x)
174
+ stx _SMCDesignator+2
175
+ .elseif .match ({register}, y)
176
+ sty _SMCDesignator+2
177
+ .endif
178
+ .endmacro
179
+
180
+ .macro SMC_TransferAddressSingle label, address, register
181
+ .if .paramcount = 2 .or .match ((register), a)
182
+ .if (.match (.left (1, {address}), #))
183
+ ; immediate mode
184
+ lda #<(.right (.tcount ({address})-1, {address}))
185
+ sta _SMCDesignator+1
186
+ lda #>(.right (.tcount ({address})-1, {address}))
187
+ sta _SMCDesignator+2
188
+ .else
189
+ ; assume absolute or zero page
190
+ lda address
191
+ sta _SMCDesignator+1
192
+ lda 1+(address)
193
+ sta _SMCDesignator+2
194
+ .endif
195
+ .elseif .match ((register), x)
196
+ .if (.match (.left (1, {address}), #))
197
+ ; immediate mode
198
+ ldx #<(.right (.tcount ({address})-1, {address}))
199
+ stx _SMCDesignator+1
200
+ ldx #>(.right (.tcount ({address})-1, {address}))
201
+ stx _SMCDesignator+2
202
+ .else
203
+ ; assume absolute or zero page
204
+ ldx address
205
+ stx _SMCDesignator+1
206
+ ldx 1+(address)
207
+ stx _SMCDesignator+2
208
+ .endif
209
+ .elseif .match ((register), y)
210
+ .if (.match (.left (1, {address}), #))
211
+ ; immediate mode
212
+ ldy #<(.right (.tcount ({address})-1, {address}))
213
+ sty _SMCDesignator+1
214
+ ldy #>(.right (.tcount ({address})-1, {address}))
215
+ sty _SMCDesignator+2
216
+ .else
217
+ ; assume absolute or zero page
218
+ ldy address
219
+ sty _SMCDesignator+1
220
+ ldy 1+(address)
221
+ sty _SMCDesignator+2
222
+ .endif
223
+ .endif
224
+ .endmacro
225
+
226
+ .macro SMC_TransferAddress label, address
227
+ .if (.match (.left (1, {address}), #))
228
+ ; immediate mode
229
+ lda #<(.right (.tcount ({address})-1, {address}))
230
+ sta _SMCDesignator+1
231
+ ldx #>(.right (.tcount ({address})-1, {address}))
232
+ stx _SMCDesignator+2
233
+ .else
234
+ ; assume absolute or zero page
235
+ lda {address}
236
+ sta _SMCDesignator+1
237
+ ldx 1+{address}
238
+ stx _SMCDesignator)+2
239
+ .endif
240
+ .endmacro
241
+
242
+ .macro SMC_StoreAddress label
243
+ sta _SMCDesignator+1
244
+ stx _SMCDesignator+2
245
+ .endmacro
@@ -0,0 +1,70 @@
1
+ ;*****************************************************************************/
2
+ ;* */
3
+ ;* stdio.inc */
4
+ ;* */
5
+ ;* Mirror definitions for stdio.h */
6
+ ;* */
7
+ ;* */
8
+ ;* */
9
+ ;* (C) 2003-2005, 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
+ ;----------------------------------------------------------------------------
37
+ ; Constants
38
+
39
+ _IOFBF = 0
40
+ _IOLBF = 1
41
+ _IONBF = 2
42
+ BUFSIZ = 256
43
+ EOF = -1
44
+ .if .defined(__APPLE2__)
45
+ FILENAME_MAX = 64+1
46
+ .elseif .defined(__ATARI__)
47
+ FILENAME_MAX = 12+1
48
+ .elseif .defined(__LUNIX__)
49
+ FILENAME_MAX = 80+1
50
+ .else
51
+ FILENAME_MAX = 16+1
52
+ .endif
53
+ L_tmpnam = FILENAME_MAX
54
+ SEEK_CUR = 0
55
+ SEEK_END = 1
56
+ SEEK_SET = 2
57
+ TMP_MAX = 256
58
+
59
+ ; Maximum number of open files (size of the file table)
60
+ FOPEN_MAX = 8
61
+
62
+ ;----------------------------------------------------------------------------
63
+ ; External variables
64
+
65
+ .global _stdin
66
+ .global _stdout
67
+ .global _stderr
68
+
69
+
70
+
@@ -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,52 @@
1
+ ;*****************************************************************************/
2
+ ;* */
3
+ ;* tgi-error.inc */
4
+ ;* */
5
+ ;* TGI error codes */
6
+ ;* */
7
+ ;* */
8
+ ;* */
9
+ ;* (C) 2002-2012, 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
+ ; Error constants
37
+ .enum
38
+ TGI_ERR_OK ; No error
39
+ TGI_ERR_NO_DRIVER ; No driver available
40
+ TGI_ERR_CANNOT_LOAD ; Error loading driver or font
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
+ TGI_ERR_INV_FONT ; Font file is invalid
46
+ TGI_ERR_NO_RES ; Out of resources (memory, handles, ...)
47
+ TGI_ERR_UNKNOWN ; Unknown error
48
+ TGI_ERR_INSTALLED ; A driver is already installed
49
+
50
+ TGI_ERR_COUNT ; Special: Number of error messages
51
+ .endenum
52
+