fcdev-cc65 0.0.0-stage → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +17 -0
- package/asminc/_file.inc +27 -0
- package/asminc/_heap.inc +35 -0
- package/asminc/accelerator.inc +80 -0
- package/asminc/agat.inc +39 -0
- package/asminc/apple2.inc +95 -0
- package/asminc/apple2.mac +54 -0
- package/asminc/ascii_charmap.inc +287 -0
- package/asminc/atari.inc +1169 -0
- package/asminc/atari.mac +65 -0
- package/asminc/atari2600.inc +7 -0
- package/asminc/atari2600_riot.inc +20 -0
- package/asminc/atari2600_tia.inc +69 -0
- package/asminc/atari5200.inc +133 -0
- package/asminc/atari7800.inc +14 -0
- package/asminc/atari7800_maria.inc +39 -0
- package/asminc/atari7800_riot.inc +20 -0
- package/asminc/atari7800_tia.inc +69 -0
- package/asminc/atari_antic.inc +95 -0
- package/asminc/atari_atascii_charmap.inc +301 -0
- package/asminc/atari_gtia.inc +119 -0
- package/asminc/atari_pokey.inc +43 -0
- package/asminc/atari_screen_charmap.inc +303 -0
- package/asminc/atmos.inc +117 -0
- package/asminc/c128.inc +224 -0
- package/asminc/c16.inc +9 -0
- package/asminc/c64.inc +219 -0
- package/asminc/c65.inc +239 -0
- package/asminc/cbm.mac +56 -0
- package/asminc/cbm510.inc +200 -0
- package/asminc/cbm610.inc +121 -0
- package/asminc/cbm_filetype.inc +34 -0
- package/asminc/cbm_kernal.inc +248 -0
- package/asminc/cbm_petscii_charmap.inc +291 -0
- package/asminc/cbm_screen_charmap.inc +305 -0
- package/asminc/cpu.mac +4 -0
- package/asminc/creativision.inc +66 -0
- package/asminc/ctype.inc +31 -0
- package/asminc/ctype_common.inc +91 -0
- package/asminc/ctypetable.inc +48 -0
- package/asminc/cx16.inc +574 -0
- package/asminc/em-error.inc +49 -0
- package/asminc/em-kernel.inc +106 -0
- package/asminc/errno.inc +37 -0
- package/asminc/fcntl.inc +21 -0
- package/asminc/gamate.inc +64 -0
- package/asminc/generic.mac +53 -0
- package/asminc/get_tv.inc +22 -0
- package/asminc/joy-error.inc +44 -0
- package/asminc/joy-kernel.inc +83 -0
- package/asminc/kim1.inc +31 -0
- package/asminc/longbranch.mac +88 -0
- package/asminc/lynx.inc +460 -0
- package/asminc/mega65.inc +239 -0
- package/asminc/modload.inc +78 -0
- package/asminc/module.mac +13 -0
- package/asminc/mouse-kernel.inc +184 -0
- package/asminc/nes.inc +93 -0
- package/asminc/o65.inc +150 -0
- package/asminc/opcodes.inc +514 -0
- package/asminc/pce.inc +93 -0
- package/asminc/pet.inc +100 -0
- package/asminc/plus4.inc +86 -0
- package/asminc/rp6502.inc +98 -0
- package/asminc/ser-error.inc +55 -0
- package/asminc/ser-kernel.inc +162 -0
- package/asminc/signal.inc +57 -0
- package/asminc/sim65.inc +75 -0
- package/asminc/smc.inc +267 -0
- package/asminc/stat.inc +64 -0
- package/asminc/statvfs.inc +46 -0
- package/asminc/stdio.inc +74 -0
- package/asminc/supervision.inc +75 -0
- package/asminc/sym1.inc +186 -0
- package/asminc/telestrat.inc +546 -0
- package/asminc/tgi-error.inc +52 -0
- package/asminc/tgi-kernel.inc +233 -0
- package/asminc/tgi-vectorfont.inc +70 -0
- package/asminc/time.inc +74 -0
- package/asminc/utsname.inc +46 -0
- package/asminc/vic20.inc +119 -0
- package/asminc/zeropage.inc +40 -0
- package/bin/ar65.exe +0 -0
- package/bin/ca65.exe +0 -0
- package/bin/cc65.exe +0 -0
- package/bin/da65.exe +0 -0
- package/bin/ld65.exe +0 -0
- package/cfg/module.cfg +21 -0
- package/cfg/nes.cfg +62 -0
- package/cfg/none.cfg +37 -0
- package/include/6502.h +140 -0
- package/include/_6522.h +68 -0
- package/include/_6525.h +62 -0
- package/include/_6526.h +71 -0
- package/include/_6545.h +53 -0
- package/include/_6551.h +55 -0
- package/include/_antic.h +254 -0
- package/include/_atari5200os.h +94 -0
- package/include/_atarios.h +661 -0
- package/include/_gtia.h +281 -0
- package/include/_heap.h +60 -0
- package/include/_maria.h +63 -0
- package/include/_mikey.h +264 -0
- package/include/_pbi.h +63 -0
- package/include/_pia.h +52 -0
- package/include/_pokey.h +220 -0
- package/include/_riot.h +26 -0
- package/include/_sid.h +68 -0
- package/include/_suzy.h +336 -0
- package/include/_ted.h +86 -0
- package/include/_tia.h +100 -0
- package/include/_vdc.h +53 -0
- package/include/_vic.h +67 -0
- package/include/_vic2.h +192 -0
- package/include/_vic3.h +188 -0
- package/include/accelerator.h +339 -0
- package/include/agat.h +76 -0
- package/include/apple2.h +358 -0
- package/include/apple2_filetype.h +324 -0
- package/include/apple2enh.h +67 -0
- package/include/arpa/inet.h +81 -0
- package/include/ascii_charmap.h +295 -0
- package/include/assert.h +59 -0
- package/include/atari.h +554 -0
- package/include/atari2600.h +32 -0
- package/include/atari5200.h +100 -0
- package/include/atari7800.h +67 -0
- package/include/atari_atascii_charmap.h +304 -0
- package/include/atari_screen_charmap.h +310 -0
- package/include/atmos.h +189 -0
- package/include/c128.h +175 -0
- package/include/c16.h +60 -0
- package/include/c64.h +175 -0
- package/include/c65.h +120 -0
- package/include/cbm.h +321 -0
- package/include/cbm264.h +165 -0
- package/include/cbm510.h +168 -0
- package/include/cbm610.h +153 -0
- package/include/cbm_filetype.h +108 -0
- package/include/cbm_petscii_charmap.h +297 -0
- package/include/cbm_screen_charmap.h +311 -0
- package/include/cc65.h +109 -0
- package/include/conio.h +248 -0
- package/include/creativision.h +78 -0
- package/include/ctype.h +88 -0
- package/include/cx16.h +420 -0
- package/include/dbg.h +124 -0
- package/include/device.h +72 -0
- package/include/dio.h +113 -0
- package/include/dirent.h +151 -0
- package/include/em/em-kernel.h +77 -0
- package/include/em.h +135 -0
- package/include/errno.h +135 -0
- package/include/fcntl.h +75 -0
- package/include/gamate.h +209 -0
- package/include/geos/gconst.h +69 -0
- package/include/geos/gdisk.h +79 -0
- package/include/geos/gdlgbox.h +110 -0
- package/include/geos/gfile.h +72 -0
- package/include/geos/ggraph.h +180 -0
- package/include/geos/gmemory.h +30 -0
- package/include/geos/gmenu.h +53 -0
- package/include/geos/gprocess.h +22 -0
- package/include/geos/gsprite.h +96 -0
- package/include/geos/gstruct.h +174 -0
- package/include/geos/gsym.h +340 -0
- package/include/geos/gsys.h +54 -0
- package/include/geos.h +109 -0
- package/include/inttypes.h +237 -0
- package/include/iso646.h +60 -0
- package/include/joystick/joy-kernel.h +84 -0
- package/include/joystick.h +109 -0
- package/include/kim1.h +73 -0
- package/include/limits.h +87 -0
- package/include/locale.h +83 -0
- package/include/lynx.h +144 -0
- package/include/lz4.h +43 -0
- package/include/lzsa.h +56 -0
- package/include/mega65.h +120 -0
- package/include/modload.h +103 -0
- package/include/mouse/mouse-kernel.h +67 -0
- package/include/mouse.h +220 -0
- package/include/nes.h +203 -0
- package/include/o65.h +178 -0
- package/include/osic1p.h +66 -0
- package/include/pce.h +110 -0
- package/include/peekpoke.h +58 -0
- package/include/pen.h +78 -0
- package/include/pet.h +113 -0
- package/include/plus4.h +63 -0
- package/include/rp6502.h +266 -0
- package/include/serial.h +180 -0
- package/include/setjmp.h +55 -0
- package/include/signal.h +74 -0
- package/include/sim65.h +136 -0
- package/include/stdarg.h +57 -0
- package/include/stdbool.h +53 -0
- package/include/stddef.h +66 -0
- package/include/stdint.h +144 -0
- package/include/stdio.h +166 -0
- package/include/stdlib.h +174 -0
- package/include/string.h +106 -0
- package/include/supervision.h +137 -0
- package/include/sym1.h +165 -0
- package/include/sys/stat.h +94 -0
- package/include/sys/statvfs.h +74 -0
- package/include/sys/types.h +102 -0
- package/include/sys/utsname.h +97 -0
- package/include/target.h +77 -0
- package/include/telestrat.h +129 -0
- package/include/tgi/tgi-error.h +64 -0
- package/include/tgi/tgi-kernel.h +75 -0
- package/include/tgi/tgi-vectorfont.h +90 -0
- package/include/tgi.h +286 -0
- package/include/time.h +143 -0
- package/include/unistd.h +103 -0
- package/include/vic20.h +141 -0
- package/include/zlib.h +175 -0
- package/include/zx02.h +44 -0
- package/lib/nes.lib +0 -0
- package/lib/none.lib +0 -0
- package/manifest.json +227 -0
- package/package.json +19 -4
- package/README.md +0 -3
package/asminc/plus4.inc
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
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
|
+
VARTAB := $2D ; Pointer to start of BASIC variables
|
|
11
|
+
MEMSIZE := $37 ; Pointer to highest BASIC RAM location (+1)
|
|
12
|
+
TXTPTR := $3B ; Pointer into BASIC source code
|
|
13
|
+
STATUS := $90 ; Kernal I/O completion status
|
|
14
|
+
TIME := $A3 ; 60HZ clock
|
|
15
|
+
FNAM_LEN := $AB ; Length of filename
|
|
16
|
+
LFN := $AC ; Logical file number
|
|
17
|
+
SECADR := $AD ; Secondary address
|
|
18
|
+
DEVNUM := $AE ; Device number
|
|
19
|
+
FNAM := $AF ; Pointer to filename for OPEN
|
|
20
|
+
KEY_COUNT := $EF ; Number of keys in input buffer
|
|
21
|
+
RVS := $C2 ; Reverse flag
|
|
22
|
+
CURS_X := $CA ; Cursor column
|
|
23
|
+
CURS_Y := $CD ; Cursor row
|
|
24
|
+
SCREEN_PTR := $C8 ; Pointer to current char in text screen
|
|
25
|
+
CRAM_PTR := $EA ; Pointer to current char in color RAM
|
|
26
|
+
|
|
27
|
+
BASIC_BUF := $200 ; Location of command-line
|
|
28
|
+
BASIC_BUF_LEN = 89 ; Maximum length of command-line
|
|
29
|
+
|
|
30
|
+
FNBUF := $25E ; Buffer for filename
|
|
31
|
+
FETCH := $494 ; lda (zp),y from RAM
|
|
32
|
+
CHARCOLOR := $53B
|
|
33
|
+
FKEY_COUNT := $55D ; Characters for function key
|
|
34
|
+
FKEY_SPACE := $55F ; Function key definitions
|
|
35
|
+
FKEY_ORIG := $F3D2 ; Original definitions
|
|
36
|
+
|
|
37
|
+
KBDREPEAT := $540
|
|
38
|
+
KBDREPEATRATE := $541
|
|
39
|
+
KBDREPEATDELAY := $542
|
|
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_CLK := $FF13
|
|
71
|
+
TED_BGCOLOR := $FF15
|
|
72
|
+
TED_COLOR1 := $FF16
|
|
73
|
+
TED_COLOR2 := $FF17
|
|
74
|
+
TED_COLOR3 := $FF18
|
|
75
|
+
TED_BORDERCOLOR := $FF19
|
|
76
|
+
TED_VLINEHI := $FF1C
|
|
77
|
+
TED_VLINELO := $FF1D
|
|
78
|
+
TED_HPOS := $FF1E
|
|
79
|
+
TED_ROMSEL := $FF3E
|
|
80
|
+
TED_RAMSEL := $FF3F
|
|
81
|
+
|
|
82
|
+
; ---------------------------------------------------------------------------
|
|
83
|
+
; RAM/ROM selection addresses
|
|
84
|
+
|
|
85
|
+
ENABLE_ROM := TED_ROMSEL
|
|
86
|
+
ENABLE_RAM := TED_RAMSEL
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
; Picocomputer 6502 general defines
|
|
2
|
+
|
|
3
|
+
; RIA UART
|
|
4
|
+
RIA_READY := $FFE0 ; TX=$80 RX=$40
|
|
5
|
+
RIA_TX := $FFE1
|
|
6
|
+
RIA_RX := $FFE2
|
|
7
|
+
|
|
8
|
+
; VSYNC from PIX VGA
|
|
9
|
+
RIA_VSYNC := $FFE3
|
|
10
|
+
|
|
11
|
+
; RIA XRAM portal 0
|
|
12
|
+
RIA_RW0 := $FFE4
|
|
13
|
+
RIA_STEP0 := $FFE5
|
|
14
|
+
RIA_ADDR0 := $FFE6
|
|
15
|
+
|
|
16
|
+
; RIA XRAM portal 1
|
|
17
|
+
RIA_RW1 := $FFE8
|
|
18
|
+
RIA_STEP1 := $FFE9
|
|
19
|
+
RIA_ADDR1 := $FFEA
|
|
20
|
+
|
|
21
|
+
; RIA OS fastcall
|
|
22
|
+
RIA_XSTACK := $FFEC
|
|
23
|
+
RIA_ERRNO := $FFED
|
|
24
|
+
RIA_OP := $FFEF
|
|
25
|
+
RIA_IRQ := $FFF0
|
|
26
|
+
RIA_SPIN := $FFF1
|
|
27
|
+
RIA_BUSY := $FFF2 ; Bit $80
|
|
28
|
+
RIA_A := $FFF4
|
|
29
|
+
RIA_X := $FFF6
|
|
30
|
+
RIA_SREG := $FFF8
|
|
31
|
+
|
|
32
|
+
; RIA OS operation numbers
|
|
33
|
+
RIA_OP_EXIT := $FF
|
|
34
|
+
RIA_OP_ZXSTACK := $00
|
|
35
|
+
RIA_OP_XREG := $01
|
|
36
|
+
RIA_OP_PHI2 := $02
|
|
37
|
+
RIA_OP_CODEPAGE := $03
|
|
38
|
+
RIA_OP_LRAND := $04
|
|
39
|
+
RIA_OP_STDIN_OPT := $05
|
|
40
|
+
RIA_OP_CLOCK := $0F
|
|
41
|
+
RIA_OP_CLOCK_GETRES := $10
|
|
42
|
+
RIA_OP_CLOCK_GETTIME := $11
|
|
43
|
+
RIA_OP_CLOCK_SETTIME := $12
|
|
44
|
+
RIA_OP_CLOCK_GETTIMEZONE := $13
|
|
45
|
+
RIA_OP_OPEN := $14
|
|
46
|
+
RIA_OP_CLOSE := $15
|
|
47
|
+
RIA_OP_READ_XSTACK := $16
|
|
48
|
+
RIA_OP_READ_XRAM := $17
|
|
49
|
+
RIA_OP_WRITE_XSTACK := $18
|
|
50
|
+
RIA_OP_WRITE_XRAM := $19
|
|
51
|
+
RIA_OP_LSEEK := $1A
|
|
52
|
+
RIA_OP_UNLINK := $1B
|
|
53
|
+
RIA_OP_RENAME := $1C
|
|
54
|
+
|
|
55
|
+
; 6522 VIA
|
|
56
|
+
VIA := $FFD0 ; VIA base address
|
|
57
|
+
VIA_PB := VIA+$0 ; Port register B
|
|
58
|
+
VIA_PA1 := VIA+$1 ; Port register A
|
|
59
|
+
VIA_PRB := VIA+$0 ; *** Deprecated ***
|
|
60
|
+
VIA_PRA := VIA+$1 ; *** Deprecated ***
|
|
61
|
+
VIA_DDRB := VIA+$2 ; Data direction register B
|
|
62
|
+
VIA_DDRA := VIA+$3 ; Data direction register A
|
|
63
|
+
VIA_T1CL := VIA+$4 ; Timer 1, low byte
|
|
64
|
+
VIA_T1CH := VIA+$5 ; Timer 1, high byte
|
|
65
|
+
VIA_T1LL := VIA+$6 ; Timer 1 latch, low byte
|
|
66
|
+
VIA_T1LH := VIA+$7 ; Timer 1 latch, high byte
|
|
67
|
+
VIA_T2CL := VIA+$8 ; Timer 2, low byte
|
|
68
|
+
VIA_T2CH := VIA+$9 ; Timer 2, high byte
|
|
69
|
+
VIA_SR := VIA+$A ; Shift register
|
|
70
|
+
VIA_CR := VIA+$B ; Auxiliary control register
|
|
71
|
+
VIA_PCR := VIA+$C ; Peripheral control register
|
|
72
|
+
VIA_IFR := VIA+$D ; Interrupt flag register
|
|
73
|
+
VIA_IER := VIA+$E ; Interrupt enable register
|
|
74
|
+
VIA_PA2 := VIA+$F ; Port register A w/o handshake
|
|
75
|
+
|
|
76
|
+
; Values in ___oserror are the union of these FatFs errors and errno.inc
|
|
77
|
+
.enum
|
|
78
|
+
FR_OK = 32 ; Succeeded
|
|
79
|
+
FR_DISK_ERR ; A hard error occurred in the low level disk I/O layer
|
|
80
|
+
FR_INT_ERR ; Assertion failed
|
|
81
|
+
FR_NOT_READY ; The physical drive cannot work
|
|
82
|
+
FR_NO_FILE ; Could not find the file
|
|
83
|
+
FR_NO_PATH ; Could not find the path
|
|
84
|
+
FR_INVALID_NAME ; The path name format is invalid
|
|
85
|
+
FR_DENIED ; Access denied due to prohibited access or directory full
|
|
86
|
+
FR_EXIST ; Access denied due to prohibited access
|
|
87
|
+
FR_INVALID_OBJECT ; The file/directory object is invalid
|
|
88
|
+
FR_WRITE_PROTECTED ; The physical drive is write protected
|
|
89
|
+
FR_INVALID_DRIVE ; The logical drive number is invalid
|
|
90
|
+
FR_NOT_ENABLED ; The volume has no work area
|
|
91
|
+
FR_NO_FILESYSTEM ; There is no valid FAT volume
|
|
92
|
+
FR_MKFS_ABORTED ; The f_mkfs() aborted due to any problem
|
|
93
|
+
FR_TIMEOUT ; Could not get a grant to access the volume within defined period
|
|
94
|
+
FR_LOCKED ; The operation is rejected according to the file sharing policy
|
|
95
|
+
FR_NOT_ENOUGH_CORE ; LFN working buffer could not be allocated
|
|
96
|
+
FR_TOO_MANY_OPEN_FILES ; Number of open files > FF_FS_LOCK
|
|
97
|
+
FR_INVALID_PARAMETER ; Given parameter is invalid
|
|
98
|
+
.endenum
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
;****************************************************************************
|
|
2
|
+
;* *
|
|
3
|
+
;* ser-error.inc *
|
|
4
|
+
;* *
|
|
5
|
+
;* Serial communication API *
|
|
6
|
+
;* *
|
|
7
|
+
;* *
|
|
8
|
+
;* *
|
|
9
|
+
;* (C) 2003-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
|
+
; Error codes
|
|
38
|
+
|
|
39
|
+
.enum
|
|
40
|
+
SER_ERR_OK ; Not an error - relax
|
|
41
|
+
SER_ERR_NO_DRIVER ; No driver available
|
|
42
|
+
SER_ERR_CANNOT_LOAD ; Error loading driver
|
|
43
|
+
SER_ERR_INV_DRIVER ; Invalid driver
|
|
44
|
+
SER_ERR_NO_DEVICE ; Device (hardware) not found
|
|
45
|
+
SER_ERR_BAUD_UNAVAIL ; Baud rate not available
|
|
46
|
+
SER_ERR_NO_DATA ; Nothing to read
|
|
47
|
+
SER_ERR_OVERFLOW ; No room in send buffer
|
|
48
|
+
SER_ERR_INIT_FAILED ; Initialization failed
|
|
49
|
+
SER_ERR_INV_IOCTL ; IOCTL not supported
|
|
50
|
+
SER_ERR_INSTALLED ; A driver is already installed
|
|
51
|
+
SER_ERR_NOT_OPEN ; Driver not open
|
|
52
|
+
|
|
53
|
+
SER_ERR_COUNT ; Special: Number of error codes
|
|
54
|
+
.endenum
|
|
55
|
+
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
;****************************************************************************
|
|
2
|
+
;* *
|
|
3
|
+
;* ser-kernel.inc *
|
|
4
|
+
;* *
|
|
5
|
+
;* Serial communication API *
|
|
6
|
+
;* *
|
|
7
|
+
;* *
|
|
8
|
+
;* *
|
|
9
|
+
;*(C) 2003-2006, Ullrich von Bassewitz *
|
|
10
|
+
;* 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 SER_HDR
|
|
40
|
+
ID .byte 3 ; Contains 0x73, 0x65, 0x72 ("ser")
|
|
41
|
+
VERSION .byte 1 ; Interface version
|
|
42
|
+
LIBREF .addr ; Library reference
|
|
43
|
+
JUMPTAB .struct
|
|
44
|
+
SER_INSTALL .addr ; SER_INSTALL routine
|
|
45
|
+
SER_UNINSTALL .addr ; SER_UNINSTALL routine
|
|
46
|
+
SER_OPEN .addr ; SER_OPEN routine
|
|
47
|
+
SER_CLOSE .addr ; SER_CLOSE routine
|
|
48
|
+
SER_GET .addr ; SER_GET routine
|
|
49
|
+
SER_PUT .addr ; SER_PUT routine
|
|
50
|
+
SER_STATUS .addr ; SER_STATUS routine
|
|
51
|
+
SER_IOCTL .addr ; SER_IOCTL routine
|
|
52
|
+
SER_IRQ .addr ; SER_IRQ routine
|
|
53
|
+
.endstruct
|
|
54
|
+
.endstruct
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
;------------------------------------------------------------------------------
|
|
58
|
+
; The SER API version, stored SER_HDR::VERSION
|
|
59
|
+
|
|
60
|
+
SER_API_VERSION = $02
|
|
61
|
+
|
|
62
|
+
;------------------------------------------------------------------------------
|
|
63
|
+
; ser_params
|
|
64
|
+
|
|
65
|
+
.struct SER_PARAMS
|
|
66
|
+
BAUDRATE .byte ; Baudrate
|
|
67
|
+
DATABITS .byte ; Number of data bits
|
|
68
|
+
STOPBITS .byte ; Number of stop bits
|
|
69
|
+
PARITY .byte ; Parity setting
|
|
70
|
+
HANDSHAKE .byte ; Type of handshake to use
|
|
71
|
+
.endstruct
|
|
72
|
+
|
|
73
|
+
;------------------------------------------------------------------------------
|
|
74
|
+
; Serial parameters
|
|
75
|
+
|
|
76
|
+
; Baudrate
|
|
77
|
+
SER_BAUD_45_5 = $00
|
|
78
|
+
SER_BAUD_50 = $01
|
|
79
|
+
SER_BAUD_75 = $02
|
|
80
|
+
SER_BAUD_110 = $03
|
|
81
|
+
SER_BAUD_134_5 = $04
|
|
82
|
+
SER_BAUD_150 = $05
|
|
83
|
+
SER_BAUD_300 = $06
|
|
84
|
+
SER_BAUD_600 = $07
|
|
85
|
+
SER_BAUD_1200 = $08
|
|
86
|
+
SER_BAUD_1800 = $09
|
|
87
|
+
SER_BAUD_2400 = $0A
|
|
88
|
+
SER_BAUD_3600 = $0B
|
|
89
|
+
SER_BAUD_4800 = $0C
|
|
90
|
+
SER_BAUD_7200 = $0D
|
|
91
|
+
SER_BAUD_9600 = $0E
|
|
92
|
+
SER_BAUD_19200 = $0F
|
|
93
|
+
SER_BAUD_38400 = $10
|
|
94
|
+
SER_BAUD_57600 = $11
|
|
95
|
+
SER_BAUD_115200 = $12
|
|
96
|
+
SER_BAUD_230400 = $13
|
|
97
|
+
SER_BAUD_31250 = $14
|
|
98
|
+
SER_BAUD_62500 = $15
|
|
99
|
+
SER_BAUD_56_875 = $16
|
|
100
|
+
|
|
101
|
+
; Data bit settings
|
|
102
|
+
SER_BITS_5 = $00
|
|
103
|
+
SER_BITS_6 = $01
|
|
104
|
+
SER_BITS_7 = $02
|
|
105
|
+
SER_BITS_8 = $03
|
|
106
|
+
|
|
107
|
+
; Stop bit settings
|
|
108
|
+
SER_STOP_1 = $00
|
|
109
|
+
SER_STOP_2 = $01
|
|
110
|
+
|
|
111
|
+
; Parity
|
|
112
|
+
SER_PAR_NONE = $00
|
|
113
|
+
SER_PAR_ODD = $01
|
|
114
|
+
SER_PAR_EVEN = $02
|
|
115
|
+
SER_PAR_MARK = $03
|
|
116
|
+
SER_PAR_SPACE = $04
|
|
117
|
+
|
|
118
|
+
; Handshake
|
|
119
|
+
SER_HS_NONE = $00 ; No handshake
|
|
120
|
+
SER_HS_HW = $01 ; Hardware (RTS/CTS) handshake
|
|
121
|
+
SER_HS_SW = $02 ; Software handshake
|
|
122
|
+
|
|
123
|
+
; Bit masks to mask out things from the status returned by ser_status
|
|
124
|
+
SER_STATUS_PE = $01 ; Parity error
|
|
125
|
+
SER_STATUS_FE = $02 ; Framing error
|
|
126
|
+
SER_STATUS_OE = $04 ; Overrun error
|
|
127
|
+
SER_STATUS_DCD = $20 ; NOT data carrier detect
|
|
128
|
+
SER_STATUS_DSR = $40 ; NOT data set ready
|
|
129
|
+
|
|
130
|
+
;------------------------------------------------------------------------------
|
|
131
|
+
; Variables
|
|
132
|
+
|
|
133
|
+
.global _ser_drv ; Pointer to driver
|
|
134
|
+
|
|
135
|
+
;------------------------------------------------------------------------------
|
|
136
|
+
; Driver entry points
|
|
137
|
+
|
|
138
|
+
.global ser_install
|
|
139
|
+
.global ser_uninstall
|
|
140
|
+
.global ser_open
|
|
141
|
+
.global ser_close
|
|
142
|
+
.global ser_get
|
|
143
|
+
.global ser_put
|
|
144
|
+
.global ser_status
|
|
145
|
+
.global ser_ioctl
|
|
146
|
+
.global ser_irq
|
|
147
|
+
|
|
148
|
+
;------------------------------------------------------------------------------
|
|
149
|
+
; C callable functions
|
|
150
|
+
|
|
151
|
+
.global _ser_load_driver
|
|
152
|
+
.global _ser_unload
|
|
153
|
+
.global _ser_install
|
|
154
|
+
.global _ser_uninstall
|
|
155
|
+
.global _ser_open
|
|
156
|
+
.global _ser_close
|
|
157
|
+
.global _ser_get
|
|
158
|
+
.global _ser_put
|
|
159
|
+
.global _ser_status
|
|
160
|
+
.global _ser_ioctl
|
|
161
|
+
|
|
162
|
+
.global _ser_clear_ptr
|
|
@@ -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
|
+
|
package/asminc/sim65.inc
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
|
|
2
|
+
; *******************************************************************************
|
|
3
|
+
; ** **
|
|
4
|
+
; ** sim65.inc : assembler definitions for the sim6502 and sim65c02 targets. **
|
|
5
|
+
; ** **
|
|
6
|
+
; ** Sidney Cadot, January 2025 **
|
|
7
|
+
; ** **
|
|
8
|
+
; *******************************************************************************
|
|
9
|
+
|
|
10
|
+
; The '_peripherals' symbol is defined in the linker configuration
|
|
11
|
+
; file to correspond to the first address in the periperal memory
|
|
12
|
+
; aparture.
|
|
13
|
+
;
|
|
14
|
+
; We use it here as a base address for all peripheral addresses.
|
|
15
|
+
|
|
16
|
+
.import _peripherals
|
|
17
|
+
|
|
18
|
+
; **************************************************************
|
|
19
|
+
; ** **
|
|
20
|
+
; ** Define assembler symbols for the "counter" peripheral. **
|
|
21
|
+
; ** **
|
|
22
|
+
; **************************************************************
|
|
23
|
+
|
|
24
|
+
peripheral_counter_base := _peripherals + 0
|
|
25
|
+
|
|
26
|
+
peripheral_counter_latch := peripheral_counter_base + 0
|
|
27
|
+
peripheral_counter_select := peripheral_counter_base + 1
|
|
28
|
+
peripheral_counter_value := peripheral_counter_base + 2
|
|
29
|
+
|
|
30
|
+
; Values for the peripheral_counter_select register.
|
|
31
|
+
|
|
32
|
+
COUNTER_SELECT_CLOCKCYCLE_COUNTER = $00
|
|
33
|
+
COUNTER_SELECT_INSTRUCTION_COUNTER = $01
|
|
34
|
+
COUNTER_SELECT_IRQ_COUNTER = $02
|
|
35
|
+
COUNTER_SELECT_NMI_COUNTER = $03
|
|
36
|
+
COUNTER_SELECT_WALLCLOCK_TIME = $80
|
|
37
|
+
COUNTER_SELECT_WALLCLOCK_TIME_SPLIT = $81
|
|
38
|
+
|
|
39
|
+
; ********************************************************************
|
|
40
|
+
; ** **
|
|
41
|
+
; ** Define assembler symbols for the "sim65 control" peripheral. **
|
|
42
|
+
; ** **
|
|
43
|
+
; ********************************************************************
|
|
44
|
+
|
|
45
|
+
peripheral_sim65_base := _peripherals + 10
|
|
46
|
+
|
|
47
|
+
peripheral_sim65_cpu_mode := peripheral_sim65_base + 0
|
|
48
|
+
peripheral_sim65_trace_mode := peripheral_sim65_base + 1
|
|
49
|
+
|
|
50
|
+
; Values for the peripheral_sim65_cpu_mode register.
|
|
51
|
+
|
|
52
|
+
SIM65_CPU_MODE_6502 = $00
|
|
53
|
+
SIM65_CPU_MODE_65C02 = $01
|
|
54
|
+
SIM65_CPU_MODE_6502X = $02
|
|
55
|
+
|
|
56
|
+
; Bitfield values for the peripheral_sim65_trace_mode field.
|
|
57
|
+
|
|
58
|
+
SIM65_TRACE_MODE_FIELD_INSTR_COUNTER = $40
|
|
59
|
+
SIM65_TRACE_MODE_FIELD_CLOCK_COUNTER = $20
|
|
60
|
+
SIM65_TRACE_MODE_FIELD_PC = $10
|
|
61
|
+
SIM65_TRACE_MODE_FIELD_INSTR_BYTES = $08
|
|
62
|
+
SIM65_TRACE_MODE_FIELD_INSTR_ASSEMBLY = $04
|
|
63
|
+
SIM65_TRACE_MODE_FIELD_CPU_REGISTERS = $02
|
|
64
|
+
SIM65_TRACE_MODE_FIELD_CC65_SP = $01
|
|
65
|
+
|
|
66
|
+
; Values for the peripheral_sim65_trace_mode field that fully disable / enable tracing.
|
|
67
|
+
|
|
68
|
+
SIM65_TRACE_MODE_DISABLE = $00
|
|
69
|
+
SIM65_TRACE_MODE_ENABLE_FULL = $7F
|
|
70
|
+
|
|
71
|
+
; ************************
|
|
72
|
+
; ** **
|
|
73
|
+
; ** End of sim65.inc **
|
|
74
|
+
; ** **
|
|
75
|
+
; ************************
|