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,180 @@
1
+ ;/*****************************************************************************/
2
+ ;/* */
3
+ ;/* mouse-kernel.inc */
4
+ ;/* */
5
+ ;/* Mouse API */
6
+ ;/* */
7
+ ;/* */
8
+ ;/* */
9
+ ;/* (C) 2003-2009, Ullrich von Bassewitz */
10
+ ;/* Roemerstrasse 52 */
11
+ ;/* D-70794 Filderstadt */
12
+ ;/* EMail: uz@cc65.org */
13
+ ;/* */
14
+ ;/* */
15
+ ;/* */
16
+ ;/* */
17
+ ;/* This software is provided 'as-is', without any expressed or implied */
18
+ ;/* warranty. In no event will the authors be held liable for any damages */
19
+ ;/* arising from the use of this software. */
20
+ ;/* */
21
+ ;/* Permission is granted to anyone to use this software for any purpose, */
22
+ ;/* including commercial applications, and to alter it and redistribute it */
23
+ ;/* freely, subject to the following restrictions: */
24
+ ;/* */
25
+ ;/* 1. The origin of this software must not be misrepresented; you must not */
26
+ ;/* claim that you wrote the original software. If you use this software */
27
+ ;/* in a product, an acknowledgment in the product documentation would be */
28
+ ;/* appreciated but is not required. */
29
+ ;/* 2. Altered source versions must be plainly marked as such, and must not */
30
+ ;/* be misrepresented as being the original software. */
31
+ ;/* 3. This notice may not be removed or altered from any source */
32
+ ;/* distribution. */
33
+ ;/* */
34
+ ;/*****************************************************************************/
35
+
36
+
37
+
38
+
39
+ ;------------------------------------------------------------------------------
40
+ ; Error codes
41
+
42
+ .enum
43
+ MOUSE_ERR_OK ; No error
44
+ MOUSE_ERR_NO_DRIVER ; No driver available
45
+ MOUSE_ERR_CANNOT_LOAD ; Error loading driver
46
+ MOUSE_ERR_INV_DRIVER ; Invalid driver
47
+ MOUSE_ERR_NO_DEVICE ; Mouse hardware not found
48
+ MOUSE_ERR_INV_IOCTL ; Invalid ioctl code
49
+
50
+ MOUSE_ERR_COUNT ; Special: Number of error codes
51
+ .endenum
52
+
53
+ ;------------------------------------------------------------------------------
54
+ ; The driver header
55
+
56
+ .struct MOUSE_HDR
57
+ ID .byte 3 ; Contains 0x6D, 0x6F, 0x75 ("mou")
58
+ VERSION .byte 1 ; Interface version
59
+ LIBREF .addr ; Library reference
60
+ JUMPTAB .struct
61
+ INSTALL .addr
62
+ UNINSTALL .addr
63
+ HIDE .addr
64
+ SHOW .addr
65
+ SETBOX .addr
66
+ GETBOX .addr
67
+ MOVE .addr
68
+ BUTTONS .addr
69
+ POS .addr
70
+ INFO .addr
71
+ IOCTL .addr
72
+ IRQ .addr
73
+ .endstruct
74
+ FLAGS .byte ; Mouse driver flags
75
+ CALLBACKS .struct ; Jump instructions
76
+ .byte ; JMP opcode
77
+ CHIDE .addr ; Jump address
78
+ .byte
79
+ CSHOW .addr
80
+ .byte
81
+ CMOVEX .addr
82
+ .byte
83
+ CMOVEY .addr
84
+ .endstruct
85
+ .endstruct
86
+
87
+ ;------------------------------------------------------------------------------
88
+ ; The mouse callback structure
89
+
90
+ .struct MOUSE_CALLBACKS
91
+ HIDE .addr ; Hide the mouse cursor
92
+ SHOW .addr ; Show the mouse cursor
93
+ MOVEX .addr ; Move the mouse cursor
94
+ MOVEY .addr ; Dito for Y
95
+ .endstruct
96
+
97
+ ;------------------------------------------------------------------------------
98
+ ; The mouse API version, stored in MOUSE_HDR::VERSION
99
+
100
+ MOUSE_API_VERSION = $03
101
+
102
+ ;------------------------------------------------------------------------------
103
+ ; Bitmapped mouse driver flags, stored in MOUSE_HDR::FLAGS.
104
+ ; Note: If neither of MOUSE_FLAG_XXX_IRQ is set, no interrupts are supplied
105
+ ; to the driver. If one of the bits is set, the interrupt vector MUST be
106
+ ; valid.
107
+ ; Beware: Some of the bits are tested using the BIT instruction, so do not
108
+ ; change the values without checking the code!
109
+
110
+ MOUSE_FLAG_EARLY_IRQ = $40 ; Enable IRQ *before* calling INSTALL
111
+ MOUSE_FLAG_LATE_IRQ = $80 ; Enable IRQ *after* calling INSTALL
112
+
113
+ ;------------------------------------------------------------------------------
114
+ ; Mouse button definitions
115
+
116
+ MOUSE_BTN_LEFT = $10
117
+ MOUSE_BTN_RIGHT = $01
118
+
119
+ ;------------------------------------------------------------------------------
120
+ ; Structures used to return data from the mouse driver
121
+
122
+ .struct MOUSE_POS
123
+ XCOORD .word
124
+ YCOORD .word
125
+ .endstruct
126
+
127
+ .struct MOUSE_INFO
128
+ POS .tag MOUSE_POS
129
+ BUTTONS .byte
130
+ .endstruct
131
+
132
+ .struct MOUSE_BOX
133
+ MINX .word
134
+ MINY .word
135
+ MAXX .word
136
+ MAXY .word
137
+ .endstruct
138
+
139
+ ;------------------------------------------------------------------------------
140
+ ; Variables
141
+
142
+ .global _mouse_drv ; Pointer to driver
143
+ .global _mouse_hidden ; Counter, 0 = mouse is visible
144
+
145
+ ;------------------------------------------------------------------------------
146
+ ; C callable functions
147
+
148
+ .global _mouse_load_driver
149
+ .global _mouse_unload
150
+ .global _mouse_install
151
+ .global _mouse_uninstall
152
+ .global _mouse_geterrormsg
153
+ .global _mouse_hide
154
+ .global _mouse_show
155
+ .global _mouse_setbox
156
+ .global _mouse_getbox
157
+ .global _mouse_move
158
+ .global _mouse_buttons
159
+ .global _mouse_pos
160
+ .global _mouse_info
161
+ .global _mouse_ioctl
162
+
163
+ .global _mouse_clear_ptr
164
+
165
+ ;------------------------------------------------------------------------------
166
+ ; Driver entry points (asm callable)
167
+
168
+ .global mouse_install
169
+ .global mouse_uninstall
170
+ .global mouse_hide
171
+ .global mouse_show
172
+ .global mouse_setbox
173
+ .global mouse_getbox
174
+ .global mouse_move
175
+ .global mouse_buttons
176
+ .global mouse_pos
177
+ .global mouse_info
178
+ .global mouse_ioctl
179
+
180
+
@@ -0,0 +1,93 @@
1
+ ;
2
+ ; NES definitions. By Groepaz/Hitmem.
3
+ ;
4
+
5
+
6
+ ;; FIXME: optimize zeropage usage
7
+
8
+ SCREEN_PTR = $62 ;2
9
+ CRAM_PTR = $64 ;2
10
+ CHARCOLOR = $66
11
+ BGCOLOR = $67
12
+ RVS = $68
13
+ CURS_X = $69
14
+ CURS_Y = $6a
15
+
16
+ tickcount = $6b ;2
17
+
18
+ VBLANK_FLAG = $70
19
+
20
+ ringbuff = $0200
21
+ ringwrite = $71
22
+ ringread = $72
23
+ ringcount = $73
24
+
25
+ ppuhi = $74
26
+ ppulo = $75
27
+ ppuval = $76
28
+
29
+ screenrows = (30-1)
30
+ charsperline = 32
31
+ xsize = charsperline
32
+
33
+ ;; PPU defines
34
+
35
+ PPU_CTRL1 = $2000
36
+ PPU_CTRL2 = $2001
37
+ PPU_STATUS = $2002
38
+ PPU_SPR_ADDR = $2003
39
+ PPU_SPR_IO = $2004
40
+ PPU_VRAM_ADDR1 = $2005
41
+ PPU_VRAM_ADDR2 = $2006
42
+ PPU_VRAM_IO = $2007
43
+
44
+ ;; APU defines
45
+
46
+ APU_PULSE1CTRL = $4000 ; Pulse #1 Control Register (W)
47
+ APU_PULSE1RAMP = $4001 ; Pulse #1 Ramp Control Register (W)
48
+ APU_PULSE1FTUNE = $4002 ; Pulse #1 Fine Tune (FT) Register (W)
49
+ APU_PULSE1CTUNE = $4003 ; Pulse #1 Coarse Tune (CT) Register (W)
50
+ APU_PULSE2CTRL = $4004 ; Pulse #2 Control Register (W)
51
+ APU_PULSE2RAMP = $4005 ; Pulse #2 Ramp Control Register (W)
52
+ APU_PULSE2FTUNE = $4006 ; Pulse #2 Fine Tune Register (W)
53
+ APU_PULSE2STUNE = $4007 ; Pulse #2 Coarse Tune Register (W)
54
+ APU_TRICTRL1 = $4008 ; Triangle Control Register #1 (W)
55
+ APU_TRICTRL2 = $4009 ; Triangle Control Register #2 (?)
56
+ APU_TRIFREQ1 = $400A ; Triangle Frequency Register #1 (W)
57
+ APU_TRIFREQ2 = $400B ; Triangle Frequency Register #2 (W)
58
+ APU_NOISECTRL = $400C ; Noise Control Register #1 (W)
59
+ ;;APU_ = $400D ; Unused (???)
60
+ APU_NOISEFREQ1 = $400E ; Noise Frequency Register #1 (W)
61
+ APU_NOISEFREQ2 = $400F ; Noise Frequency Register #2 (W)
62
+ APU_MODCTRL = $4010 ; Delta Modulation Control Register (W)
63
+ APU_MODDA = $4011 ; Delta Modulation D/A Register (W)
64
+ APU_MODADDR = $4012 ; Delta Modulation Address Register (W)
65
+ APU_MODLEN = $4013 ; Delta Modulation Data Length Register (W)
66
+ APU_SPR_DMA = $4014 ; Sprite DMA Register (W)
67
+ APU_CHANCTRL = $4015 ; Sound/Vertical Clock Signal Register (R)
68
+ APU_PAD1 = $4016 ; Joypad #1 (RW)
69
+ APU_PAD2 = $4017 ; Joypad #2/SOFTCLK (RW)
70
+
71
+
72
+ CH_HLINE = 11
73
+ CH_VLINE = 14
74
+ CH_ULCORNER = 176
75
+ CH_URCORNER = 174
76
+ CH_LLCORNER = 173
77
+ CH_LRCORNER = 189
78
+ CH_TTEE = 178
79
+ CH_RTEE = 179
80
+ CH_BTEE = 177
81
+ CH_LTEE = 171
82
+ CH_CROSS = 123
83
+ CH_CURS_UP = 145
84
+ CH_CURS_DOWN = 17
85
+ CH_CURS_LEFT = 157
86
+ CH_CURS_RIGHT = 29
87
+ CH_PI = 126
88
+ CH_DEL = 20
89
+ CH_INS = 148
90
+ CH_ENTER = 10
91
+ CH_STOP = 3
92
+ CH_ESC = 27
93
+
@@ -0,0 +1,150 @@
1
+ ;*****************************************************************************/
2
+ ;* */
3
+ ;* o65.inc */
4
+ ;* */
5
+ ;* Definitions for the o65 file format */
6
+ ;* */
7
+ ;* */
8
+ ;* */
9
+ ;* (C) 2002-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
+ ; This files exports structures and constants to handle the o65 relocatable
37
+ ; file format as defined by Andre Fachat.
38
+
39
+
40
+
41
+ ; The o65 header structure (6502 format)
42
+ .struct O65_HDR
43
+ MARKER .byte 2 ; Non-C64 marker: $01 $00
44
+ MAGIC .byte 3 ; o65 magic: "o65"
45
+ VERSION .byte 1 ; Version number
46
+ MODE .word ; Mode word
47
+ TBASE .word ; Original text (code) segment address
48
+ TLEN .word ; Size of text (code) segment
49
+ DBASE .word ; Original data segment address
50
+ DLEN .word ; Size of data segment
51
+ BBASE .word ; Original bss segment address
52
+ BLEN .word ; Size of bss segment
53
+ ZBASE .word ; Original zp segment address
54
+ ZLEN .word ; Size of zp segment
55
+ STACK .word ; Stacksize needed
56
+ .endstruct
57
+
58
+ ; Marker, magic and version number
59
+ O65_MARKER_0 = $01
60
+ O65_MARKER_1 = $00
61
+ O65_MAGIC_0 = $6F ; 'o'
62
+ O65_MAGIC_1 = $36 ; '6'
63
+ O65_MAGIC_2 = $35 ; '5'
64
+ O65_VERSION = $00
65
+
66
+ ; Defines for the mode word
67
+ O65_CPU_65816 = $8000 ; Executable is for 65816
68
+ O65_CPU_6502 = $0000 ; Executable is for the 6502
69
+ O65_CPU_MASK = $8000 ; Mask to extract CPU type
70
+
71
+ O65_RELOC_PAGE = $4000 ; Page wise relocation
72
+ O65_RELOC_BYTE = $0000 ; Byte wise relocation
73
+ O65_RELOC_MASK = $4000 ; Mask to extract relocation type
74
+
75
+ O65_SIZE_32BIT = $2000 ; All size words are 32bit
76
+ O65_SIZE_16BIT = $0000 ; All size words are 16bit
77
+ O65_SIZE_MASK = $2000 ; Mask to extract size
78
+
79
+ O65_FTYPE_OBJ = $1000 ; Object file
80
+ O65_FTYPE_EXE = $0000 ; Executable file
81
+ O65_FTYPE_MASK = $1000 ; Mask to extract type
82
+
83
+ O65_ADDR_SIMPLE = $0800 ; Simple addressing
84
+ O65_ADDR_DEFAULT = $0000 ; Default addressing
85
+ O65_ADDR_MASK = $0800 ; Mask to extract addressing
86
+
87
+ O65_CHAIN = $0400 ; Chained file, another one follows
88
+ O65_CHAIN_MASK = $0400 ; Mask to extract chain flag
89
+
90
+ O65_BSSZERO = $0200 ; BSS segment must be zeroed
91
+ O65_BSSZERO_MASK = $0200 ; Mask to extract bss zero flag
92
+
93
+ ; The following is used if O65_CPU == 6502
94
+ O65_CPU2_6502 = $0000 ; Executable is for 6502
95
+ O65_CPU2_65C02 = $0010 ; Executable is for 65C02
96
+ O65_CPU2_65SC02 = $0020 ; Executable is for 65SC02
97
+ O65_CPU2_65CE02 = $0030 ; Executable is for 65CE02
98
+ O65_CPU2_6502X = $0040 ; Executable is for NMOS 6502
99
+ O65_CPU2_65816_EMU = $0050 ; Executable is for 65816 in emul mode
100
+ O65_CPU2_MASK = $00F0 ; Mask to extract CPU2 field
101
+
102
+ O65_ALIGN_1 = $0000 ; Bytewise alignment
103
+ O65_ALIGN_2 = $0001 ; Align words
104
+ O65_ALIGN_4 = $0002 ; Align longwords
105
+ O65_ALIGN_256 = $0003 ; Align pages (256 bytes)
106
+ O65_ALIGN_MASK = $0003 ; Mask to extract alignment
107
+
108
+ ; The mode word as generated by the ld65 linker
109
+ O65_MODE_CC65 = O65_CPU_6502 | O65_RELOC_BYTE | O65_SIZE_16BIT | O65_FTYPE_EXE | O65_ADDR_SIMPLE | O65_ALIGN_1
110
+
111
+ ; Relocation type codes
112
+ O65_RTYPE_WORD = $80
113
+ O65_RTYPE_HIGH = $40
114
+ O65_RTYPE_LOW = $20
115
+ O65_RTYPE_SEGADDR = $C0
116
+ O65_RTYPE_SEG = $A0
117
+ O65_RTYPE_MASK = $E0
118
+
119
+ ; Segment IDs
120
+ O65_SEGID_UNDEF = $00
121
+ O65_SEGID_ABS = $01
122
+ O65_SEGID_TEXT = $02
123
+ O65_SEGID_DATA = $03
124
+ O65_SEGID_BSS = $04
125
+ O65_SEGID_ZP = $05
126
+ O65_SEGID_MASK = $07
127
+
128
+ ; Option tags
129
+ O65_OPT_FILENAME = 0
130
+ O65_OPT_OS = 1
131
+ O65_OPT_ASM = 2
132
+ O65_OPT_AUTHOR = 3
133
+ O65_OPT_TIMESTAMP = 4
134
+
135
+ ; Operating system codes for O65_OPT_OS
136
+ O65_OS_OSA65 = 1
137
+ O65_OS_LUNIX = 2
138
+ O65_OS_CC65 = 3
139
+ O65_OS_OPENCBM = 4
140
+
141
+ ; Load errors
142
+ O65_LOAD_OK = 0 ; Module load successful
143
+ O65_LOAD_ERR_READ = 1 ; Read error
144
+ O65_LOAD_ERR_HDR = 2 ; Header error
145
+ O65_LOAD_ERR_OS = 3 ; Wrong OS
146
+ O65_LOAD_ERR_FMT = 4 ; Data format error
147
+ O65_LOAD_ERR_MEM = 5 ; Not enough memory
148
+
149
+
150
+