burn 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +621 -0
- data/README.md +467 -0
- data/Rakefile +1 -0
- data/bin/burn +14 -0
- data/lib/burn/builder.rb +65 -0
- data/lib/burn/cli.rb +187 -0
- data/lib/burn/debug.rb +25 -0
- data/lib/burn/dsl/channel_stream.rb +105 -0
- data/lib/burn/dsl/declare.rb +42 -0
- data/lib/burn/dsl/dsl_base.rb +31 -0
- data/lib/burn/dsl/music.rb +36 -0
- data/lib/burn/dsl/note.rb +125 -0
- data/lib/burn/dsl/scene.rb +278 -0
- data/lib/burn/dsl/sound.rb +30 -0
- data/lib/burn/dsl/sound_effect.rb +91 -0
- data/lib/burn/dsl.rb +8 -0
- data/lib/burn/generator/assembly_music.rb +47 -0
- data/lib/burn/generator/assembly_sound_effect.rb +33 -0
- data/lib/burn/generator/c_source.rb +54 -0
- data/lib/burn/generator/template/mus_template.s +49 -0
- data/lib/burn/generator/template/template.c +88 -0
- data/lib/burn/generator.rb +3 -0
- data/lib/burn/tools/mac/cc65/asminc/_file.inc +27 -0
- data/lib/burn/tools/mac/cc65/asminc/_heap.inc +35 -0
- data/lib/burn/tools/mac/cc65/asminc/apple2.inc +64 -0
- data/lib/burn/tools/mac/cc65/asminc/atari.inc +1175 -0
- data/lib/burn/tools/mac/cc65/asminc/atari.mac +59 -0
- data/lib/burn/tools/mac/cc65/asminc/atmos.inc +110 -0
- data/lib/burn/tools/mac/cc65/asminc/c128.inc +214 -0
- data/lib/burn/tools/mac/cc65/asminc/c16.inc +9 -0
- data/lib/burn/tools/mac/cc65/asminc/c64.inc +212 -0
- data/lib/burn/tools/mac/cc65/asminc/cbm.mac +50 -0
- data/lib/burn/tools/mac/cc65/asminc/cbm510.inc +182 -0
- data/lib/burn/tools/mac/cc65/asminc/cbm610.inc +110 -0
- data/lib/burn/tools/mac/cc65/asminc/cbm_filetype.inc +34 -0
- data/lib/burn/tools/mac/cc65/asminc/cpu.mac +24 -0
- data/lib/burn/tools/mac/cc65/asminc/ctype.inc +29 -0
- data/lib/burn/tools/mac/cc65/asminc/em-error.inc +49 -0
- data/lib/burn/tools/mac/cc65/asminc/em-kernel.inc +106 -0
- data/lib/burn/tools/mac/cc65/asminc/errno.inc +36 -0
- data/lib/burn/tools/mac/cc65/asminc/fcntl.inc +21 -0
- data/lib/burn/tools/mac/cc65/asminc/generic.mac +55 -0
- data/lib/burn/tools/mac/cc65/asminc/get_tv.inc +22 -0
- data/lib/burn/tools/mac/cc65/asminc/joy-error.inc +44 -0
- data/lib/burn/tools/mac/cc65/asminc/joy-kernel.inc +85 -0
- data/lib/burn/tools/mac/cc65/asminc/longbranch.mac +88 -0
- data/lib/burn/tools/mac/cc65/asminc/lynx.inc +279 -0
- data/lib/burn/tools/mac/cc65/asminc/modload.inc +78 -0
- data/lib/burn/tools/mac/cc65/asminc/mouse-kernel.inc +180 -0
- data/lib/burn/tools/mac/cc65/asminc/nes.inc +93 -0
- data/lib/burn/tools/mac/cc65/asminc/o65.inc +150 -0
- data/lib/burn/tools/mac/cc65/asminc/opcodes.inc +509 -0
- data/lib/burn/tools/mac/cc65/asminc/pet.inc +54 -0
- data/lib/burn/tools/mac/cc65/asminc/plus4.inc +86 -0
- data/lib/burn/tools/mac/cc65/asminc/ser-error.inc +54 -0
- data/lib/burn/tools/mac/cc65/asminc/ser-kernel.inc +162 -0
- data/lib/burn/tools/mac/cc65/asminc/signal.inc +57 -0
- data/lib/burn/tools/mac/cc65/asminc/smc.inc +245 -0
- data/lib/burn/tools/mac/cc65/asminc/stdio.inc +70 -0
- data/lib/burn/tools/mac/cc65/asminc/supervision.inc +76 -0
- data/lib/burn/tools/mac/cc65/asminc/tgi-error.inc +52 -0
- data/lib/burn/tools/mac/cc65/asminc/tgi-kernel.inc +234 -0
- data/lib/burn/tools/mac/cc65/asminc/tgi-vectorfont.inc +70 -0
- data/lib/burn/tools/mac/cc65/asminc/time.inc +59 -0
- data/lib/burn/tools/mac/cc65/asminc/utsname.inc +46 -0
- data/lib/burn/tools/mac/cc65/asminc/vic20.inc +75 -0
- data/lib/burn/tools/mac/cc65/asminc/zeropage.inc +26 -0
- data/lib/burn/tools/mac/cc65/bin/ca65 +0 -0
- data/lib/burn/tools/mac/cc65/bin/cc65 +0 -0
- data/lib/burn/tools/mac/cc65/bin/ld65 +0 -0
- data/lib/burn/tools/other/cc65/asminc/_file.inc +27 -0
- data/lib/burn/tools/other/cc65/asminc/_heap.inc +35 -0
- data/lib/burn/tools/other/cc65/asminc/apple2.inc +64 -0
- data/lib/burn/tools/other/cc65/asminc/atari.inc +1175 -0
- data/lib/burn/tools/other/cc65/asminc/atari.mac +59 -0
- data/lib/burn/tools/other/cc65/asminc/atmos.inc +110 -0
- data/lib/burn/tools/other/cc65/asminc/c128.inc +214 -0
- data/lib/burn/tools/other/cc65/asminc/c16.inc +9 -0
- data/lib/burn/tools/other/cc65/asminc/c64.inc +212 -0
- data/lib/burn/tools/other/cc65/asminc/cbm.mac +50 -0
- data/lib/burn/tools/other/cc65/asminc/cbm510.inc +182 -0
- data/lib/burn/tools/other/cc65/asminc/cbm610.inc +110 -0
- data/lib/burn/tools/other/cc65/asminc/cbm_filetype.inc +34 -0
- data/lib/burn/tools/other/cc65/asminc/cpu.mac +24 -0
- data/lib/burn/tools/other/cc65/asminc/ctype.inc +29 -0
- data/lib/burn/tools/other/cc65/asminc/em-error.inc +49 -0
- data/lib/burn/tools/other/cc65/asminc/em-kernel.inc +106 -0
- data/lib/burn/tools/other/cc65/asminc/errno.inc +36 -0
- data/lib/burn/tools/other/cc65/asminc/fcntl.inc +21 -0
- data/lib/burn/tools/other/cc65/asminc/generic.mac +55 -0
- data/lib/burn/tools/other/cc65/asminc/get_tv.inc +22 -0
- data/lib/burn/tools/other/cc65/asminc/joy-error.inc +44 -0
- data/lib/burn/tools/other/cc65/asminc/joy-kernel.inc +85 -0
- data/lib/burn/tools/other/cc65/asminc/longbranch.mac +88 -0
- data/lib/burn/tools/other/cc65/asminc/lynx.inc +279 -0
- data/lib/burn/tools/other/cc65/asminc/modload.inc +78 -0
- data/lib/burn/tools/other/cc65/asminc/mouse-kernel.inc +180 -0
- data/lib/burn/tools/other/cc65/asminc/nes.inc +93 -0
- data/lib/burn/tools/other/cc65/asminc/o65.inc +150 -0
- data/lib/burn/tools/other/cc65/asminc/opcodes.inc +509 -0
- data/lib/burn/tools/other/cc65/asminc/pet.inc +54 -0
- data/lib/burn/tools/other/cc65/asminc/plus4.inc +86 -0
- data/lib/burn/tools/other/cc65/asminc/ser-error.inc +54 -0
- data/lib/burn/tools/other/cc65/asminc/ser-kernel.inc +162 -0
- data/lib/burn/tools/other/cc65/asminc/signal.inc +57 -0
- data/lib/burn/tools/other/cc65/asminc/smc.inc +245 -0
- data/lib/burn/tools/other/cc65/asminc/stdio.inc +70 -0
- data/lib/burn/tools/other/cc65/asminc/supervision.inc +76 -0
- data/lib/burn/tools/other/cc65/asminc/tgi-error.inc +52 -0
- data/lib/burn/tools/other/cc65/asminc/tgi-kernel.inc +234 -0
- data/lib/burn/tools/other/cc65/asminc/tgi-vectorfont.inc +70 -0
- data/lib/burn/tools/other/cc65/asminc/time.inc +59 -0
- data/lib/burn/tools/other/cc65/asminc/utsname.inc +46 -0
- data/lib/burn/tools/other/cc65/asminc/vic20.inc +75 -0
- data/lib/burn/tools/other/cc65/asminc/zeropage.inc +26 -0
- data/lib/burn/tools/other/cc65/bin/ca65 +0 -0
- data/lib/burn/tools/other/cc65/bin/cc65 +0 -0
- data/lib/burn/tools/other/cc65/bin/ld65 +0 -0
- data/lib/burn/tools/win/cc65/asminc/_file.inc +27 -0
- data/lib/burn/tools/win/cc65/asminc/_heap.inc +35 -0
- data/lib/burn/tools/win/cc65/asminc/apple2.inc +64 -0
- data/lib/burn/tools/win/cc65/asminc/atari.inc +1101 -0
- data/lib/burn/tools/win/cc65/asminc/atmos.inc +31 -0
- data/lib/burn/tools/win/cc65/asminc/c128.inc +213 -0
- data/lib/burn/tools/win/cc65/asminc/c16.inc +9 -0
- data/lib/burn/tools/win/cc65/asminc/c64.inc +212 -0
- data/lib/burn/tools/win/cc65/asminc/cbm510.inc +182 -0
- data/lib/burn/tools/win/cc65/asminc/cbm610.inc +110 -0
- data/lib/burn/tools/win/cc65/asminc/ctype.inc +29 -0
- data/lib/burn/tools/win/cc65/asminc/em-error.inc +44 -0
- data/lib/burn/tools/win/cc65/asminc/em-kernel.inc +100 -0
- data/lib/burn/tools/win/cc65/asminc/errno.inc +36 -0
- data/lib/burn/tools/win/cc65/asminc/fcntl.inc +21 -0
- data/lib/burn/tools/win/cc65/asminc/get_tv.inc +22 -0
- data/lib/burn/tools/win/cc65/asminc/joy-error.inc +44 -0
- data/lib/burn/tools/win/cc65/asminc/joy-kernel.inc +85 -0
- data/lib/burn/tools/win/cc65/asminc/lynx.inc +273 -0
- data/lib/burn/tools/win/cc65/asminc/modload.inc +78 -0
- data/lib/burn/tools/win/cc65/asminc/mouse-kernel.inc +179 -0
- data/lib/burn/tools/win/cc65/asminc/nes.inc +93 -0
- data/lib/burn/tools/win/cc65/asminc/o65.inc +135 -0
- data/lib/burn/tools/win/cc65/asminc/pet.inc +45 -0
- data/lib/burn/tools/win/cc65/asminc/plus4.inc +87 -0
- data/lib/burn/tools/win/cc65/asminc/rs232.inc +19 -0
- data/lib/burn/tools/win/cc65/asminc/ser-error.inc +50 -0
- data/lib/burn/tools/win/cc65/asminc/ser-kernel.inc +161 -0
- data/lib/burn/tools/win/cc65/asminc/signal.inc +57 -0
- data/lib/burn/tools/win/cc65/asminc/stdio.inc +70 -0
- data/lib/burn/tools/win/cc65/asminc/supervision.inc +76 -0
- data/lib/burn/tools/win/cc65/asminc/tgi-error.inc +48 -0
- data/lib/burn/tools/win/cc65/asminc/tgi-kernel.inc +183 -0
- data/lib/burn/tools/win/cc65/asminc/tgi-mode.inc +48 -0
- data/lib/burn/tools/win/cc65/asminc/time.inc +59 -0
- data/lib/burn/tools/win/cc65/asminc/utsname.inc +46 -0
- data/lib/burn/tools/win/cc65/asminc/vic20.inc +77 -0
- data/lib/burn/tools/win/cc65/asminc/zeropage.inc +22 -0
- data/lib/burn/tools/win/cc65/bin/ca65.exe +0 -0
- data/lib/burn/tools/win/cc65/bin/cc65.exe +0 -0
- data/lib/burn/tools/win/cc65/bin/ld65.exe +0 -0
- data/lib/burn/util/os.rb +38 -0
- data/lib/burn/util/patternizer.rb +62 -0
- data/lib/burn/util/pxes.rb +180 -0
- data/lib/burn/util/server.rb +21 -0
- data/lib/burn/util.rb +4 -0
- data/lib/burn/version.rb +3 -0
- data/lib/burn/workspace_default/asset/crt0.s +260 -0
- data/lib/burn/workspace_default/asset/famitone.s +1031 -0
- data/lib/burn/workspace_default/asset/mus_instruments.s +50 -0
- data/lib/burn/workspace_default/asset/music.s +3 -0
- data/lib/burn/workspace_default/asset/nes.cfg +83 -0
- data/lib/burn/workspace_default/asset/neslib.h +213 -0
- data/lib/burn/workspace_default/asset/neslib.s +923 -0
- data/lib/burn/workspace_default/asset/runtime.lib +0 -0
- data/lib/burn/workspace_default/asset/sounds.s +143 -0
- data/lib/burn/workspace_default/asset/test.h +22 -0
- data/lib/burn/workspace_default/asset/tileset.chr +0 -0
- data/lib/burn/workspace_default/release/js/emulator.html +42 -0
- data/lib/burn/workspace_default/release/js/js/dynamicaudio-89ba58da476270a9b630.min.js +1 -0
- data/lib/burn/workspace_default/release/js/js/jquery-1.4.2.min.js +154 -0
- data/lib/burn/workspace_default/release/js/js/jsnes-4e7a7260aa.js +7149 -0
- data/lib/burn/workspace_default/release/js/swf/dynamicaudio.swf +0 -0
- data/lib/burn/workspace_default/scripts/compile.bat +30 -0
- data/lib/burn/workspace_default/scripts/compile.sh +30 -0
- data/lib/burn.rb +11 -0
- data/test/helper.rb +8 -0
- data/test/runner.rb +2 -0
- data/test/test_burn.rb +14 -0
- data/test/test_dsl.rb +22 -0
- data/test/test_pxes.rb +48 -0
- metadata +270 -0
@@ -0,0 +1,234 @@
|
|
1
|
+
;*****************************************************************************/
|
2
|
+
;* */
|
3
|
+
;* tgi-kernel.inc */
|
4
|
+
;* */
|
5
|
+
;* TGI kernel interface */
|
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
|
+
;------------------------------------------------------------------------------
|
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
|
+
LIBREF .addr ; Library reference
|
43
|
+
VARS .struct
|
44
|
+
XRES .word 1 ; X resolution
|
45
|
+
YRES .word 1 ; Y resolution
|
46
|
+
COLORCOUNT .byte 1 ; Number of available colors
|
47
|
+
PAGECOUNT .byte 1 ; Number of screens available
|
48
|
+
FONTWIDTH .byte 1 ; System font width in pixel
|
49
|
+
FONTHEIGHT .byte 1 ; System font height in pixel
|
50
|
+
ASPECTRATIO .word 1 ; Fixed point 8.8 format
|
51
|
+
FLAGS .byte 1 ; TGI driver flags
|
52
|
+
.endstruct
|
53
|
+
JUMPTAB .struct
|
54
|
+
INSTALL .addr ; INSTALL routine
|
55
|
+
UNINSTALL .addr ; UNINSTALL routine
|
56
|
+
INIT .addr ; INIT routine
|
57
|
+
DONE .addr ; DONE routine
|
58
|
+
GETERROR .addr ; GETERROR routine
|
59
|
+
CONTROL .addr ; CONTROL routine
|
60
|
+
CLEAR .addr ; CLEAR routine
|
61
|
+
SETVIEWPAGE .addr ; SETVIEWPAGE routine
|
62
|
+
SETDRAWPAGE .addr ; SETDRAWPAGE routine
|
63
|
+
SETCOLOR .addr ; SETCOLOR routine
|
64
|
+
SETPALETTE .addr ; SETPALETTE routine
|
65
|
+
GETPALETTE .addr ; GETPALETTE routine
|
66
|
+
GETDEFPALETTE .addr ; GETDEFPALETTE routine
|
67
|
+
SETPIXEL .addr ; SETPIXEL routine
|
68
|
+
GETPIXEL .addr ; GETPIXEL routine
|
69
|
+
LINE .addr ; LINE routine
|
70
|
+
BAR .addr ; BAR routine
|
71
|
+
TEXTSTYLE .addr ; TEXTSTYLE routine
|
72
|
+
OUTTEXT .addr ; OUTTEXT routine
|
73
|
+
IRQ .addr ; IRQ routine
|
74
|
+
.endstruct
|
75
|
+
.endstruct
|
76
|
+
|
77
|
+
;------------------------------------------------------------------------------
|
78
|
+
; The TGI API version, stored at TGI_HDR_VERSION
|
79
|
+
|
80
|
+
TGI_API_VERSION = $04
|
81
|
+
|
82
|
+
;------------------------------------------------------------------------------
|
83
|
+
; Bitmapped tgi driver flags, stored in TGI_HDR::VARS::FLAGS.
|
84
|
+
; Beware: Some of the bits are tested using the BIT instruction, so do not
|
85
|
+
; change the values without checking the code!
|
86
|
+
|
87
|
+
TGI_BM_FONT_FINESCALE = $80 ; Bitmap fonts are fine grained scalable
|
88
|
+
|
89
|
+
;------------------------------------------------------------------------------
|
90
|
+
; Text constants
|
91
|
+
|
92
|
+
TGI_FONT_BITMAP = 0
|
93
|
+
TGI_FONT_VECTOR = 1
|
94
|
+
|
95
|
+
TGI_TEXT_HORIZONTAL = 0
|
96
|
+
TGI_TEXT_VERTICAL = 1
|
97
|
+
|
98
|
+
;----------------------------------------------------------------------------
|
99
|
+
; Results of tgi_outcode
|
100
|
+
|
101
|
+
TGI_CLIP_NONE = $00
|
102
|
+
TGI_CLIP_LEFT = $01
|
103
|
+
TGI_CLIP_RIGHT = $02
|
104
|
+
TGI_CLIP_BOTTOM = $04
|
105
|
+
TGI_CLIP_TOP = $08
|
106
|
+
|
107
|
+
;------------------------------------------------------------------------------
|
108
|
+
; ASM accessible color constants
|
109
|
+
|
110
|
+
.global tgi_color_black:zp ; Target-specific value for black
|
111
|
+
.global tgi_color_white:zp ; Target-specific value for white
|
112
|
+
|
113
|
+
;------------------------------------------------------------------------------
|
114
|
+
; C accessible variables
|
115
|
+
|
116
|
+
.global _tgi_drv ; Pointer to driver
|
117
|
+
.global _tgi_error ; Last error code
|
118
|
+
.global _tgi_gmode ; Flag: graphics mode active
|
119
|
+
.global _tgi_curx ; Current drawing cursor X
|
120
|
+
.global _tgi_cury ; Current drawing cursor Y
|
121
|
+
.global _tgi_color ; Current drawing color
|
122
|
+
.global _tgi_font ; Which font to use
|
123
|
+
.global _tgi_textdir ; Current text direction
|
124
|
+
.global _tgi_vectorfont ; Pointer to vector font
|
125
|
+
.global _tgi_textscalew ; Text magnification for the width
|
126
|
+
.global _tgi_textscaleh ; Text magnification for the height
|
127
|
+
.global _tgi_charwidth ; Width of scaled system font char
|
128
|
+
.global _tgi_charheight ; Height of scaled system font char
|
129
|
+
.global _tgi_xres ; X resolution of the current mode
|
130
|
+
.global _tgi_yres ; Y resolution of the current mode
|
131
|
+
.global _tgi_xmax ; Maximum X coordinate
|
132
|
+
.global _tgi_ymax ; Maximum Y coordinate
|
133
|
+
.global _tgi_colorcount ; Number of available colors
|
134
|
+
.global _tgi_pagecount ; Number of available screen pages
|
135
|
+
.global _tgi_fontwidth ; System font width
|
136
|
+
.global _tgi_fontheight ; System font height
|
137
|
+
.global _tgi_aspectratio ; Aspect ratio, fixed point 8.8
|
138
|
+
.global _tgi_flags ; TGI driver flags
|
139
|
+
|
140
|
+
;------------------------------------------------------------------------------
|
141
|
+
; ASM accessible variables
|
142
|
+
|
143
|
+
.global tgi_clip_x1 ; Coordinate for line clipper
|
144
|
+
.global tgi_clip_y1 ; Coordinate for line clipper
|
145
|
+
.global tgi_clip_x2 ; Coordinate for line clipper
|
146
|
+
.global tgi_clip_y2 ; Coordinate for line clipper
|
147
|
+
|
148
|
+
;------------------------------------------------------------------------------
|
149
|
+
; Driver entry points
|
150
|
+
|
151
|
+
.global tgi_install
|
152
|
+
.global tgi_uninstall
|
153
|
+
.global tgi_init
|
154
|
+
.global tgi_done
|
155
|
+
.global tgi_geterror
|
156
|
+
.global tgi_control
|
157
|
+
.global tgi_clear
|
158
|
+
.global tgi_setviewpage
|
159
|
+
.global tgi_setdrawpage
|
160
|
+
.global tgi_setcolor
|
161
|
+
.global tgi_setpalette
|
162
|
+
.global tgi_getpalette
|
163
|
+
.global tgi_getdefpalette
|
164
|
+
.global tgi_setpixel
|
165
|
+
.global tgi_getpixel
|
166
|
+
.global tgi_line
|
167
|
+
.global tgi_bar
|
168
|
+
.global tgi_textstyle
|
169
|
+
.global tgi_outtext
|
170
|
+
|
171
|
+
;------------------------------------------------------------------------------
|
172
|
+
; ASM functions
|
173
|
+
|
174
|
+
.global tgi_clear_ptr
|
175
|
+
.global tgi_clippedline
|
176
|
+
.global tgi_curtoxy
|
177
|
+
.global tgi_getset
|
178
|
+
.global tgi_imulround
|
179
|
+
.global tgi_inv_arg
|
180
|
+
.global tgi_inv_drv
|
181
|
+
.global tgi_linepop
|
182
|
+
.global tgi_outcode
|
183
|
+
.global tgi_popxy
|
184
|
+
.global tgi_popxy2
|
185
|
+
.global tgi_set_ptr
|
186
|
+
|
187
|
+
;------------------------------------------------------------------------------
|
188
|
+
; C callable functions
|
189
|
+
|
190
|
+
.global _tgi_arc
|
191
|
+
.global _tgi_bar
|
192
|
+
.global _tgi_circle
|
193
|
+
.global _tgi_clear
|
194
|
+
.global _tgi_done
|
195
|
+
.global _tgi_ellipse
|
196
|
+
.global _tgi_getaspectratio
|
197
|
+
.global _tgi_getcolor
|
198
|
+
.global _tgi_getcolorcount
|
199
|
+
.global _tgi_getdefpalette
|
200
|
+
.global _tgi_geterror
|
201
|
+
.global _tgi_geterrormsg
|
202
|
+
.global _tgi_getmaxcolor
|
203
|
+
.global _tgi_getmaxx
|
204
|
+
.global _tgi_getmaxy
|
205
|
+
.global _tgi_getpagecount
|
206
|
+
.global _tgi_getpalette
|
207
|
+
.global _tgi_getpixel
|
208
|
+
.global _tgi_gettextheight
|
209
|
+
.global _tgi_gettextwidth
|
210
|
+
.global _tgi_getxres
|
211
|
+
.global _tgi_getyres
|
212
|
+
.global _tgi_gotoxy
|
213
|
+
.global _tgi_imulround
|
214
|
+
.global _tgi_init
|
215
|
+
.global _tgi_install
|
216
|
+
.global _tgi_install_vectorfont
|
217
|
+
.global _tgi_ioctl
|
218
|
+
.global _tgi_line
|
219
|
+
.global _tgi_lineto
|
220
|
+
.global _tgi_load_driver
|
221
|
+
.global _tgi_outtext
|
222
|
+
.global _tgi_outtextxy
|
223
|
+
.global _tgi_pieslice
|
224
|
+
.global _tgi_setaspectratio
|
225
|
+
.global _tgi_setcolor
|
226
|
+
.global _tgi_setdrawpage
|
227
|
+
.global _tgi_setpalette
|
228
|
+
.global _tgi_setpixel
|
229
|
+
.global _tgi_settextdir
|
230
|
+
.global _tgi_settextscale
|
231
|
+
.global _tgi_settextstyle
|
232
|
+
.global _tgi_setviewpage
|
233
|
+
.global _tgi_uninstall
|
234
|
+
.global _tgi_unload
|
@@ -0,0 +1,70 @@
|
|
1
|
+
;*****************************************************************************/
|
2
|
+
;* */
|
3
|
+
;* tgi-vectorfont.inc */
|
4
|
+
;* */
|
5
|
+
;* TGI vector font definitions */
|
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
|
+
; Vectorfont constants
|
38
|
+
|
39
|
+
TGI_VF_VERSION = $00 ; File version number
|
40
|
+
TGI_VF_FIRSTCHAR = $20 ; First char in file
|
41
|
+
TGI_VF_LASTCHAR = $7E ; Last char in file
|
42
|
+
TGI_VF_CCOUNT = (TGI_VF_LASTCHAR - TGI_VF_FIRSTCHAR + 1)
|
43
|
+
|
44
|
+
;------------------------------------------------------------------------------
|
45
|
+
; TCH file header and font data structures
|
46
|
+
|
47
|
+
; TCH file header
|
48
|
+
.struct TGI_VF_HDR
|
49
|
+
MAGIC .byte 3 ; "TCH"
|
50
|
+
VERSION .byte 1 ; Version number
|
51
|
+
SIZE .word 1 ; Font data size
|
52
|
+
.endstruct
|
53
|
+
|
54
|
+
; Font data loaded directly from file
|
55
|
+
.struct TGI_VECTORFONT
|
56
|
+
TOP .byte ; Height of char
|
57
|
+
BOTTOM .byte ; Descender
|
58
|
+
HEIGHT .byte ; Maximum char height
|
59
|
+
WIDTHS .byte ::TGI_VF_CCOUNT ; Char widths
|
60
|
+
CHARS .word ::TGI_VF_CCOUNT ; Pointer to character defs
|
61
|
+
OPS .byte ; Actually dynamic
|
62
|
+
.endstruct
|
63
|
+
|
64
|
+
;------------------------------------------------------------------------------
|
65
|
+
; C callable functions
|
66
|
+
|
67
|
+
.global _tgi_vectorchar
|
68
|
+
|
69
|
+
|
70
|
+
|
@@ -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,75 @@
|
|
1
|
+
;
|
2
|
+
; Vic20 generic definitions. Stolen mostly from c64.inc - Steve Schmidtke
|
3
|
+
;
|
4
|
+
|
5
|
+
|
6
|
+
; ---------------------------------------------------------------------------
|
7
|
+
; Zero page, Commodore stuff
|
8
|
+
|
9
|
+
TIME := $A0 ; 60HZ clock
|
10
|
+
FNAM_LEN := $B7 ; Length of filename
|
11
|
+
SECADR := $B9 ; Secondary address
|
12
|
+
DEVNUM := $BA ; Device number
|
13
|
+
FNAM := $BB ; Pointer to filename
|
14
|
+
KEY_COUNT := $C6 ; Number of keys in input buffer
|
15
|
+
RVS := $C7 ; Reverse flag
|
16
|
+
CURS_FLAG := $CC ; 1 = cursor off
|
17
|
+
CURS_BLINK := $CD ; Blink counter
|
18
|
+
CURS_CHAR := $CE ; Character under the cursor
|
19
|
+
CURS_STATE := $CF ; Cursor blink state
|
20
|
+
SCREEN_PTR := $D1 ; Pointer to current char in text screen
|
21
|
+
CURS_X := $D3 ; Cursor column
|
22
|
+
CURS_Y := $D6 ; Cursor row
|
23
|
+
CRAM_PTR := $F3 ; Pointer to current char in color RAM
|
24
|
+
|
25
|
+
BASIC_BUF := $200 ; Location of command-line
|
26
|
+
BASIC_BUF_LEN = 89 ; Maximum length of command-line
|
27
|
+
|
28
|
+
CHARCOLOR := $286
|
29
|
+
CURS_COLOR := $287 ; Color under the cursor
|
30
|
+
|
31
|
+
|
32
|
+
; ---------------------------------------------------------------------------
|
33
|
+
; Screen size
|
34
|
+
|
35
|
+
XSIZE = 22
|
36
|
+
YSIZE = 23
|
37
|
+
|
38
|
+
; ---------------------------------------------------------------------------
|
39
|
+
; Kernal routines
|
40
|
+
|
41
|
+
; Direct entries
|
42
|
+
CLRSCR := $E55F
|
43
|
+
KBDREAD := $E5CF
|
44
|
+
|
45
|
+
; ---------------------------------------------------------------------------
|
46
|
+
; Vector and other locations
|
47
|
+
|
48
|
+
IRQVec := $0314
|
49
|
+
BRKVec := $0316
|
50
|
+
NMIVec := $0318
|
51
|
+
|
52
|
+
; ---------------------------------------------------------------------------
|
53
|
+
; I/O: 6560 VIC
|
54
|
+
|
55
|
+
VIC := $9000
|
56
|
+
VIC_LINES := $9003 ; Screen lines, bit 7 is bit 0 from VIC_HLINE
|
57
|
+
VIC_HLINE := $9004 ; Rasterline, bits 1-8
|
58
|
+
VIC_COLOR := $900F ; Border and background color
|
59
|
+
|
60
|
+
; ---------------------------------------------------------------------------
|
61
|
+
; I/O: 6522 VIA1
|
62
|
+
|
63
|
+
VIA1 := $9110
|
64
|
+
VIA1_JOY := $9111
|
65
|
+
VIA1_DDRB := $9112
|
66
|
+
VIA1_DDRA := $9113
|
67
|
+
|
68
|
+
; ---------------------------------------------------------------------------
|
69
|
+
; I/O: 6522 VIA2
|
70
|
+
|
71
|
+
VIA2 := $9120
|
72
|
+
VIA2_JOY := $9120
|
73
|
+
VIA2_DDRB := $9122
|
74
|
+
VIA2_DDRA := $9123
|
75
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
;
|
2
|
+
; zeropage.inc
|
3
|
+
;
|
4
|
+
; (C) Copyright 2002-2012, 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
|
+
.globalzp sp, sreg, regsave
|
12
|
+
.globalzp ptr1, ptr2, ptr3, ptr4
|
13
|
+
.globalzp tmp1, tmp2, tmp3, tmp4
|
14
|
+
.globalzp regbank
|
15
|
+
|
16
|
+
; The size of the register bank
|
17
|
+
regbanksize = 6
|
18
|
+
|
19
|
+
; The total amount of zero page space used
|
20
|
+
zpspace = 26
|
21
|
+
|
22
|
+
; The amount of space that needs to be saved by an interrupt handler that
|
23
|
+
; calls C code (does not include the register bank, which is saved by the
|
24
|
+
; generated C code if required).
|
25
|
+
zpsavespace = zpspace - regbanksize
|
26
|
+
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,27 @@
|
|
1
|
+
;
|
2
|
+
; _file.inc
|
3
|
+
;
|
4
|
+
; (C) Copyright 2002 Ullrich von Bassewitz (uz@cc65.org)
|
5
|
+
;
|
6
|
+
|
7
|
+
; Assembler include file that makes the constants and structures in _file.h
|
8
|
+
; available for asm code.
|
9
|
+
|
10
|
+
; Struct _FILE
|
11
|
+
.struct _FILE
|
12
|
+
f_fd .byte
|
13
|
+
f_flags .byte
|
14
|
+
f_pushback .byte
|
15
|
+
.endstruct
|
16
|
+
|
17
|
+
; Flags field
|
18
|
+
_FCLOSED = $00
|
19
|
+
_FOPEN = $01
|
20
|
+
_FEOF = $02
|
21
|
+
_FERROR = $04
|
22
|
+
_FPUSHBACK = $08
|
23
|
+
|
24
|
+
; File table
|
25
|
+
.global __filetab
|
26
|
+
|
27
|
+
|
@@ -0,0 +1,35 @@
|
|
1
|
+
;
|
2
|
+
; _heap.inc
|
3
|
+
;
|
4
|
+
; (c) Copyright 2003, Ullrich von Bassewitz (uz@cc65.org)
|
5
|
+
;
|
6
|
+
|
7
|
+
; Assembler include file that makes the constants and structures in _heap.h
|
8
|
+
; available for asm code.
|
9
|
+
|
10
|
+
; Struct freeblock
|
11
|
+
; NOTE: For performance reasons, the asm code often uses increment/decrement
|
12
|
+
; operators to access other offsets, so just changing offsets here will
|
13
|
+
; probably not work.
|
14
|
+
.struct freeblock
|
15
|
+
size .word
|
16
|
+
next .addr
|
17
|
+
prev .addr
|
18
|
+
.endstruct
|
19
|
+
|
20
|
+
; Struct usedblock
|
21
|
+
; See notes above
|
22
|
+
.struct usedblock
|
23
|
+
size .word
|
24
|
+
start .addr
|
25
|
+
.endstruct
|
26
|
+
|
27
|
+
HEAP_MIN_BLOCKSIZE = .sizeof (freeblock) ; Minimum size of an allocated block
|
28
|
+
HEAP_ADMIN_SPACE = .sizeof (usedblock) ; Additional space for used bock
|
29
|
+
|
30
|
+
; Variables
|
31
|
+
.global __heaporg
|
32
|
+
.global __heapptr
|
33
|
+
.global __heapend
|
34
|
+
.global __heapfirst
|
35
|
+
.global __heaplast
|
@@ -0,0 +1,64 @@
|
|
1
|
+
|
2
|
+
;-----------------------------------------------------------------------------
|
3
|
+
; Zero page stuff
|
4
|
+
|
5
|
+
WNDLFT := $20 ; Text window left
|
6
|
+
WNDWDTH := $21 ; Text window width
|
7
|
+
WNDTOP := $22 ; Text window top
|
8
|
+
WNDBTM := $23 ; Text window bottom+1
|
9
|
+
CH := $24 ; Cursor horizontal position
|
10
|
+
CV := $25 ; Cursor vertical position
|
11
|
+
BASL := $28 ; Text base address low
|
12
|
+
BASH := $29 ; Text base address high
|
13
|
+
INVFLG := $32 ; Normal/inverse(/flash)
|
14
|
+
PROMPT := $33 ; Used by GETLN
|
15
|
+
RNDL := $4E ; Random counter low
|
16
|
+
RNDH := $4F ; Random counter high
|
17
|
+
HIMEM := $73 ; Highest available memory address+1
|
18
|
+
|
19
|
+
;-----------------------------------------------------------------------------
|
20
|
+
; Vectors
|
21
|
+
|
22
|
+
DOSWARM := $03D0 ; DOS warmstart vector
|
23
|
+
BRKVec := $03F0 ; Break vector
|
24
|
+
SOFTEV := $03F2 ; Vector for warm start
|
25
|
+
PWREDUP := $03F4 ; This must be = EOR #$A5 of SOFTEV+1
|
26
|
+
|
27
|
+
;-----------------------------------------------------------------------------
|
28
|
+
; Hardware
|
29
|
+
|
30
|
+
; Keyboard input
|
31
|
+
KBD := $C000 ; Read keyboard
|
32
|
+
KBDSTRB := $C010 ; Clear keyboard strobe
|
33
|
+
|
34
|
+
; 80 column video switches
|
35
|
+
CLR80COL:= $C000 ; Disable 80 column store
|
36
|
+
SET80COL:= $C001 ; Enable 80 column store
|
37
|
+
RD80COL := $C018 ; >127 if 80 column store enabled
|
38
|
+
RD80VID := $C01F ; >127 if 80 column video enabled
|
39
|
+
|
40
|
+
; Character set switches
|
41
|
+
CLRALTCHAR := $C00E ; Normal Apple II char set
|
42
|
+
SETALTCHAR := $C00F ; Norm/inv LC, no flash
|
43
|
+
ALTCHARSET := $C01E ; >127 if alt charset switched in
|
44
|
+
|
45
|
+
; Language card switches
|
46
|
+
RDLCBNK2 := $C011 ; >127 if LC bank 2 in use
|
47
|
+
RDLCRAM := $C012 ; >127 if LC is read enabled
|
48
|
+
ROMIN := $C081 ; Swap in D000-FFFF ROM
|
49
|
+
LCBANK2 := $C083 ; Swap in LC bank 2
|
50
|
+
LCBANK1 := $C08B ; Swap in LC bank 1
|
51
|
+
|
52
|
+
; Video mode switches
|
53
|
+
TXTCLR := $C050 ; Display graphics
|
54
|
+
TXTSET := $C051 ; Display text
|
55
|
+
MIXCLR := $C052 ; Disable 4 lines of text
|
56
|
+
MIXSET := $C053 ; Enable 4 lines of text
|
57
|
+
LOWSCR := $C054 ; Page 1
|
58
|
+
HISCR := $C055 ; Page 2
|
59
|
+
LORES := $C056 ; Lores graphics
|
60
|
+
HIRES := $C057 ; Hires graphics
|
61
|
+
|
62
|
+
; Game controller
|
63
|
+
BUTN0 := $C061 ; Open-Apple Key
|
64
|
+
BUTN1 := $C062 ; Closed-Apple Key
|