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,135 @@
|
|
1
|
+
;*****************************************************************************/
|
2
|
+
;* */
|
3
|
+
;* o65.inc */
|
4
|
+
;* */
|
5
|
+
;* Definitions for the o65 file format */
|
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
|
+
; 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_ALIGN_1 = $0000 ; Bytewise alignment
|
88
|
+
O65_ALIGN_2 = $0001 ; Align words
|
89
|
+
O65_ALIGN_4 = $0002 ; Align longwords
|
90
|
+
O65_ALIGN_256 = $0003 ; Align pages (256 bytes)
|
91
|
+
O65_ALIGN_MASK = $0003 ; Mask to extract alignment
|
92
|
+
|
93
|
+
; The mode word as generated by the ld65 linker
|
94
|
+
O65_MODE_CC65 = O65_CPU_6502 | O65_RELOC_BYTE | O65_SIZE_16BIT | O65_FTYPE_EXE | O65_ADDR_SIMPLE | O65_ALIGN_1
|
95
|
+
|
96
|
+
; Relocation type codes
|
97
|
+
O65_RTYPE_WORD = $80
|
98
|
+
O65_RTYPE_HIGH = $40
|
99
|
+
O65_RTYPE_LOW = $20
|
100
|
+
O65_RTYPE_SEGADDR = $C0
|
101
|
+
O65_RTYPE_SEG = $A0
|
102
|
+
O65_RTYPE_MASK = $E0
|
103
|
+
|
104
|
+
; Segment IDs
|
105
|
+
O65_SEGID_UNDEF = $00
|
106
|
+
O65_SEGID_ABS = $01
|
107
|
+
O65_SEGID_TEXT = $02
|
108
|
+
O65_SEGID_DATA = $03
|
109
|
+
O65_SEGID_BSS = $04
|
110
|
+
O65_SEGID_ZP = $05
|
111
|
+
O65_SEGID_MASK = $07
|
112
|
+
|
113
|
+
; Option tags
|
114
|
+
O65_OPT_FILENAME = 0
|
115
|
+
O65_OPT_OS = 1
|
116
|
+
O65_OPT_ASM = 2
|
117
|
+
O65_OPT_AUTHOR = 3
|
118
|
+
O65_OPT_TIMESTAMP = 4
|
119
|
+
|
120
|
+
; Operating system codes for O65_OPT_OS
|
121
|
+
O65_OS_OSA65 = 1
|
122
|
+
O65_OS_LUNIX = 2
|
123
|
+
O65_OS_CC65 = 3
|
124
|
+
O65_OS_OPENCBM = 4
|
125
|
+
|
126
|
+
; Load errors
|
127
|
+
O65_LOAD_OK = 0 ; Module load successful
|
128
|
+
O65_LOAD_ERR_READ = 1 ; Read error
|
129
|
+
O65_LOAD_ERR_HDR = 2 ; Header error
|
130
|
+
O65_LOAD_ERR_OS = 3 ; Wrong OS
|
131
|
+
O65_LOAD_ERR_FMT = 4 ; Data format error
|
132
|
+
O65_LOAD_ERR_MEM = 5 ; Not enough memory
|
133
|
+
|
134
|
+
|
135
|
+
|
@@ -0,0 +1,45 @@
|
|
1
|
+
;
|
2
|
+
; PET generic definitions.
|
3
|
+
;
|
4
|
+
|
5
|
+
|
6
|
+
; ---------------------------------------------------------------------------
|
7
|
+
; Zero page, Commodore stuff
|
8
|
+
|
9
|
+
MEMSIZE := $34 ; Size of memory installed
|
10
|
+
TIME := $8D ; 60HZ clock
|
11
|
+
ST := $96 ; IEC status byte
|
12
|
+
KEY_COUNT := $9E ; Number of keys in input buffer
|
13
|
+
RVS := $9F ; Reverse flag
|
14
|
+
CURS_FLAG := $A7 ; 1 = cursor off
|
15
|
+
CURS_BLINK := $A8 ; Blink counter
|
16
|
+
CURS_CHAR := $A9 ; Character under the cursor
|
17
|
+
CURS_STATE := $AA ; Cursor blink state
|
18
|
+
SCREEN_PTR := $C4 ; Pointer to current char in text screen
|
19
|
+
CURS_X := $C6 ; Cursor column
|
20
|
+
FNLEN := $D1 ; Length of filename
|
21
|
+
LFN := $D2 ; Current Logical File Number
|
22
|
+
SECADR := $D3 ; Secondary address
|
23
|
+
DEVNUM := $D4 ; Device number
|
24
|
+
SCR_LINELEN := $D5 ; Screen line length
|
25
|
+
CURS_Y := $D8 ; Cursor row
|
26
|
+
FNADR := $DA ; Pointer to file name
|
27
|
+
|
28
|
+
KEY_BUF := $26F ; Keyboard buffer
|
29
|
+
|
30
|
+
;----------------------------------------------------------------------------
|
31
|
+
; PET ROM type detection
|
32
|
+
|
33
|
+
PET_DETECT := $FFFB
|
34
|
+
PET_2000 = $CA
|
35
|
+
PET_3000 = $FC
|
36
|
+
PET_4000 = $FD
|
37
|
+
|
38
|
+
|
39
|
+
;----------------------------------------------------------------------------
|
40
|
+
; Vector and other locations
|
41
|
+
|
42
|
+
IRQVec := $0090
|
43
|
+
BRKVec := $0092
|
44
|
+
NMIVec := $0094
|
45
|
+
|
@@ -0,0 +1,87 @@
|
|
1
|
+
;
|
2
|
+
; Plus/4 generic definitions.
|
3
|
+
;
|
4
|
+
|
5
|
+
|
6
|
+
; ---------------------------------------------------------------------------
|
7
|
+
; Zero page, Commodore stuff
|
8
|
+
|
9
|
+
TMPPTR := $22 ; Temporary ptr used by BASIC
|
10
|
+
ST := $90 ; IEC status byte
|
11
|
+
TIME := $A3 ; 60HZ clock
|
12
|
+
FNAM_LEN := $AB ; Length of filename
|
13
|
+
LFN := $AC ; Logical file number
|
14
|
+
SECADR := $AD ; Secondary address
|
15
|
+
DEVNUM := $AE ; Device number
|
16
|
+
FNAM := $AF ; Pointer to filename for OPEN
|
17
|
+
KEY_COUNT := $EF ; Number of keys in input buffer
|
18
|
+
RVS := $C2 ; Reverse flag
|
19
|
+
CURS_X := $CA ; Cursor column
|
20
|
+
CURS_Y := $CD ; Cursor row
|
21
|
+
SCREEN_PTR := $C8 ; Pointer to current char in text screen
|
22
|
+
CRAM_PTR := $EA ; Pointer to current char in color RAM
|
23
|
+
|
24
|
+
BASIC_BUF := $200 ; Location of command-line
|
25
|
+
BASIC_BUF_LEN = 89 ; Maximum length of command-line
|
26
|
+
|
27
|
+
FNBUF := $25E ; Buffer for filename
|
28
|
+
FETCH := $494 ; lda (zp),y from RAM
|
29
|
+
CHARCOLOR := $53B
|
30
|
+
FKEY_COUNT := $55D ; Characters for function key
|
31
|
+
FKEY_SPACE := $55F ; Function key definitions
|
32
|
+
FKEY_ORIG := $F3D2 ; Original definitions
|
33
|
+
|
34
|
+
; ---------------------------------------------------------------------------
|
35
|
+
; Kernal routines
|
36
|
+
|
37
|
+
; Direct entries
|
38
|
+
CLRSCR := $D88B
|
39
|
+
KBDREAD := $D8C1
|
40
|
+
|
41
|
+
; ---------------------------------------------------------------------------
|
42
|
+
; Vector and other locations
|
43
|
+
|
44
|
+
IRQVec := $0314
|
45
|
+
BRKVec := $0316
|
46
|
+
NMIVec := $0318
|
47
|
+
|
48
|
+
; ---------------------------------------------------------------------------
|
49
|
+
; Screen size
|
50
|
+
|
51
|
+
XSIZE = 40
|
52
|
+
YSIZE = 25
|
53
|
+
|
54
|
+
; ---------------------------------------------------------------------------
|
55
|
+
; I/O
|
56
|
+
|
57
|
+
TED_T1LO := $FF00
|
58
|
+
TED_T1HI := $FF01
|
59
|
+
TED_T2LO := $FF02
|
60
|
+
TED_T2HI := $FF03
|
61
|
+
TED_T3LO := $FF04
|
62
|
+
TED_T4HI := $FF05
|
63
|
+
TED_MULTI1 := $FF07
|
64
|
+
TED_KBD := $FF08
|
65
|
+
TED_CURSHI := $FF0C
|
66
|
+
TED_CURSLO := $FF0D
|
67
|
+
TED_V1FRQLO := $FF0E
|
68
|
+
TED_V2FRQLO := $FF0F
|
69
|
+
TED_V2FRQHI := $FF10
|
70
|
+
TED_BGCOLOR := $FF15
|
71
|
+
TED_COLOR1 := $FF16
|
72
|
+
TED_COLOR2 := $FF17
|
73
|
+
TED_COLOR3 := $FF18
|
74
|
+
TED_BORDERCOLOR := $FF19
|
75
|
+
TED_VLINEHI := $FF1C
|
76
|
+
TED_VLINELO := $FF1D
|
77
|
+
TED_HPOS := $FF1E
|
78
|
+
TED_ROMSEL := $FF3E
|
79
|
+
TED_RAMSEL := $FF3F
|
80
|
+
|
81
|
+
; ---------------------------------------------------------------------------
|
82
|
+
; RAM/ROM selection addresses
|
83
|
+
|
84
|
+
ENABLE_ROM := TED_ROMSEL
|
85
|
+
ENABLE_RAM := TED_RAMSEL
|
86
|
+
|
87
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
;
|
2
|
+
; rs232.inc
|
3
|
+
;
|
4
|
+
; (C) Copyright 2002 Ullrich von Bassewitz (uz@cc65.org)
|
5
|
+
;
|
6
|
+
|
7
|
+
; Assembler include file that makes the constants and structures from rs232.h
|
8
|
+
; available for asm code.
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
; Error codes returned by all functions
|
13
|
+
RS_ERR_OK = $00 ; Not an error - relax
|
14
|
+
RS_ERR_NOT_INITIALIZED = $01 ; Module not initialized
|
15
|
+
RS_ERR_BAUD_TOO_FAST = $02 ; Cannot handle baud rate
|
16
|
+
RS_ERR_BAUD_NOT_AVAIL = $03 ; Baud rate not available
|
17
|
+
RS_ERR_NO_DATA = $04 ; Nothing to read
|
18
|
+
RS_ERR_OVERFLOW = $05 ; No room in send buffer
|
19
|
+
RS_ERR_INIT_FAILED = $06 ; Initialization of RS232 routines failed
|
@@ -0,0 +1,50 @@
|
|
1
|
+
;****************************************************************************
|
2
|
+
;* *
|
3
|
+
;* ser-error.inc *
|
4
|
+
;* *
|
5
|
+
;* Serial communication API *
|
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
|
+
;------------------------------------------------------------------------------
|
37
|
+
; Error codes
|
38
|
+
|
39
|
+
SER_ERR_OK = $00 ; Not an error - relax
|
40
|
+
SER_ERR_NO_DRIVER = $01 ; No driver available
|
41
|
+
SER_ERR_CANNOT_LOAD = $02 ; Error loading driver
|
42
|
+
SER_ERR_INV_DRIVER = $03 ; Invalid driver
|
43
|
+
SER_ERR_NO_DEVICE = $04 ; Device (hardware) not found
|
44
|
+
SER_ERR_BAUD_UNAVAIL = $05 ; Baud rate not available
|
45
|
+
SER_ERR_NO_DATA = $06 ; Nothing to read
|
46
|
+
SER_ERR_OVERFLOW = $07 ; No room in send buffer
|
47
|
+
SER_ERR_INIT_FAILED = $08 ; Initialization failed
|
48
|
+
SER_ERR_INV_IOCTL = $09 ; IOCTL not supported
|
49
|
+
|
50
|
+
|
@@ -0,0 +1,161 @@
|
|
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
|
+
JUMPTAB .struct
|
43
|
+
INSTALL .word ; INSTALL routine
|
44
|
+
UNINSTALL .word ; UNINSTALL routine
|
45
|
+
OPEN .word ; OPEN routine
|
46
|
+
CLOSE .word ; CLOSE routine
|
47
|
+
GET .word ; GET routine
|
48
|
+
PUT .word ; PUT routine
|
49
|
+
STATUS .word ; STATUS routine
|
50
|
+
IOCTL .word ; IOCTL routine
|
51
|
+
IRQ .word ; IRQ routine
|
52
|
+
.endstruct
|
53
|
+
.endstruct
|
54
|
+
|
55
|
+
|
56
|
+
;------------------------------------------------------------------------------
|
57
|
+
; The SER API version, stored SER_HDR::VERSION
|
58
|
+
|
59
|
+
SER_API_VERSION = $00
|
60
|
+
|
61
|
+
;------------------------------------------------------------------------------
|
62
|
+
; ser_params
|
63
|
+
|
64
|
+
.struct SER_PARAMS
|
65
|
+
BAUDRATE .byte ; Baudrate
|
66
|
+
DATABITS .byte ; Number of data bits
|
67
|
+
STOPBITS .byte ; Number of stop bits
|
68
|
+
PARITY .byte ; Parity setting
|
69
|
+
HANDSHAKE .byte ; Type of handshake to use
|
70
|
+
.endstruct
|
71
|
+
|
72
|
+
;------------------------------------------------------------------------------
|
73
|
+
; Serial parameters
|
74
|
+
|
75
|
+
; Baudrate
|
76
|
+
SER_BAUD_45_5 = $00
|
77
|
+
SER_BAUD_50 = $01
|
78
|
+
SER_BAUD_75 = $02
|
79
|
+
SER_BAUD_110 = $03
|
80
|
+
SER_BAUD_134_5 = $04
|
81
|
+
SER_BAUD_150 = $05
|
82
|
+
SER_BAUD_300 = $06
|
83
|
+
SER_BAUD_600 = $07
|
84
|
+
SER_BAUD_1200 = $08
|
85
|
+
SER_BAUD_1800 = $09
|
86
|
+
SER_BAUD_2400 = $0A
|
87
|
+
SER_BAUD_3600 = $0B
|
88
|
+
SER_BAUD_4800 = $0C
|
89
|
+
SER_BAUD_7200 = $0D
|
90
|
+
SER_BAUD_9600 = $0E
|
91
|
+
SER_BAUD_19200 = $0F
|
92
|
+
SER_BAUD_38400 = $10
|
93
|
+
SER_BAUD_57600 = $11
|
94
|
+
SER_BAUD_115200 = $12
|
95
|
+
SER_BAUD_230400 = $13
|
96
|
+
SER_BAUD_31250 = $14
|
97
|
+
SER_BAUD_62500 = $15
|
98
|
+
|
99
|
+
; Data bit settings
|
100
|
+
SER_BITS_5 = $00
|
101
|
+
SER_BITS_6 = $01
|
102
|
+
SER_BITS_7 = $02
|
103
|
+
SER_BITS_8 = $03
|
104
|
+
|
105
|
+
; Stop bit settings
|
106
|
+
SER_STOP_1 = $00
|
107
|
+
SER_STOP_2 = $01
|
108
|
+
|
109
|
+
; Parity
|
110
|
+
SER_PAR_NONE = $00
|
111
|
+
SER_PAR_ODD = $01
|
112
|
+
SER_PAR_EVEN = $02
|
113
|
+
SER_PAR_MARK = $03
|
114
|
+
SER_PAR_SPACE = $04
|
115
|
+
|
116
|
+
; Handshake
|
117
|
+
SER_HS_NONE = $00 ; No handshake
|
118
|
+
SER_HS_HW = $01 ; Hardware (RTS/CTS) handshake
|
119
|
+
SER_HS_SW = $02 ; Software handshake
|
120
|
+
|
121
|
+
; Bit masks to mask out things from the status returned by rs232_status
|
122
|
+
SER_STATUS_PE = $01 ; Parity error
|
123
|
+
SER_STATUS_FE = $02 ; Framing error
|
124
|
+
SER_STATUS_OE = $04 ; Overrun error
|
125
|
+
SER_STATUS_DCD = $20 ; NOT data carrier detect
|
126
|
+
SER_STATUS_DSR = $40 ; NOT data set ready
|
127
|
+
|
128
|
+
;------------------------------------------------------------------------------
|
129
|
+
; Variables
|
130
|
+
|
131
|
+
.global _ser_drv ; Pointer to driver
|
132
|
+
|
133
|
+
;------------------------------------------------------------------------------
|
134
|
+
; Driver entry points
|
135
|
+
|
136
|
+
.global ser_install
|
137
|
+
.global ser_uninstall
|
138
|
+
.global ser_open
|
139
|
+
.global ser_close
|
140
|
+
.global ser_get
|
141
|
+
.global ser_put
|
142
|
+
.global ser_status
|
143
|
+
.global ser_ioctl
|
144
|
+
.global ser_irq
|
145
|
+
|
146
|
+
;------------------------------------------------------------------------------
|
147
|
+
; C callable functions
|
148
|
+
|
149
|
+
.global _ser_load_driver
|
150
|
+
.global _ser_unload
|
151
|
+
.global _ser_install
|
152
|
+
.global _ser_uninstall
|
153
|
+
.global _ser_open
|
154
|
+
.global _ser_close
|
155
|
+
.global _ser_get
|
156
|
+
.global _ser_put
|
157
|
+
.global _ser_status
|
158
|
+
.global _ser_ioctl
|
159
|
+
|
160
|
+
.global _ser_clear_ptr
|
161
|
+
|
@@ -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,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__) .or .defined(__APPLE2ENH__)
|
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
|
+
|