2 ; Christian Groessler, May-2000
4 ; os specific error code mapping
5 ; int __fastcall__ _osmaperrno (unsigned char oserror);
13 cmp #$80 ; error or success
14 bcs errcode ; error, jump
16 lda #0 ; no error, return 0
20 errcode:and #$7f ; create index from error number
22 cpx #MAX_OSERR_VAL ; valid number?
29 inverr: lda #<EUNKNOWN
38 .byte EINTR ;BRKABT = 128 ;($80) BREAK key abort
39 .byte EBUSY ;PRVOPN = 129 ;($81) IOCB already open error
40 .byte ENODEV ;NONDEV = 130 ;($82) nonexistent device error
41 .byte EACCES ;WRONLY = 131 ;($83) IOCB opened for write only error
42 .byte ENOSYS ;NVALID = 132 ;($84) invalid command error
43 .byte EINVAL ;NOTOPN = 133 ;($85) device/file not open error
44 .byte EINVAL ;BADIOC = 134 ;($86) invalid IOCB index error
45 .byte EACCES ;RDONLY = 135 ;($87) IOCB opened for read only error
46 .byte EINVAL ;EOFERR = 136 ;($88) end of file error (should never come,
47 ; specially handled by read.s)
48 .byte EIO ;TRNRCD = 137 ;($89) truncated record error
49 .byte EIO ;TIMOUT = 138 ;($8A) peripheral device timeout error
50 .byte EIO ;DNACK = 139 ;($8B) device does not acknowledge command
51 .byte EIO ;FRMERR = 140 ;($8C) serial bus framing error
52 .byte EINVAL ;CRSROR = 141 ;($8D) cursor out of range error
53 .byte EIO ;OVRRUN = 142 ;($8E) serial bus data overrun error
54 .byte EIO ;CHKERR = 143 ;($8F) serial bus checksum error
55 .byte EIO ;DERROR = 144 ;($90) general device failure
56 .byte EINVAL ;BADMOD = 145 ;($91) bad screen mode number error
57 .byte ENOSYS ;FNCNOT = 146 ;($92) function not implemented in handler
58 .byte ENOMEM ;SCRMEM = 147 ;($93) insufficient memory for screen mode
59 ; codes below taken from "Mein Atari Computer" (german version of "Your Atari Computer")
60 ; also SpartaDOS codes from http://www.atari-central.com/programming/cio_errors.txt
61 .byte EUNKNOWN ; 148 - [SpartaDOS] unrecognized disk format
62 .byte EUNKNOWN ; 149 - [SpartaDOS] disk created by incompatible version of SD
63 .byte EBUSY ; 150 - serial port already open
64 ; [SpartaDOS] directory not found
65 .byte EACCES ; 151 - concurrent mode I/O not enabled (serial)
66 ; [SpartaDOS] file exists
67 .byte EINVAL ; 152 - invalid buffer address for concurrent mode
68 ; [SpartaDOS] not binary format
69 .byte EAGAIN ; 153 - concurrent mode enabled (and another access tried)
70 .byte EACCES ; 154 - concurrent mode I/O not active (serial)
71 ; [SpartaDOS X] loader symbol not defined
72 .byte EUNKNOWN ; 155 - haven't found documentation
73 .byte EUNKNOWN ; 156 - [SpartaDOS X] bad parameter
74 .byte EUNKNOWN ; 157 - haven't found documentation
75 .byte EUNKNOWN ; 158 - [SpartaDOS X] out of memory
76 .byte EUNKNOWN ; 159 - haven't found documentation
77 .byte ENOENT ; 160 - drive number error (DOS)
78 .byte EMFILE ; 161 - too many open files
79 .byte ENOSPC ; 162 - disk full
80 .byte EIO ; 163 - unrecoverable system data I/O error
81 .byte ESPIPE ; 164 - file number mismatch (inv. seek or disk data strucs damaged)
82 .byte ENOENT ; 165 - invalid file name (e.g. lowercase)
83 .byte ESPIPE ; 166 - point data length error
84 .byte EACCES ; 167 - file locked (read-only)
85 .byte ENOSYS ; 168 - command invalid for disk
86 .byte ENOSPC ; 169 - directory full
87 .byte ENOENT ; 170 - file not found
88 .byte ESPIPE ; 171 - point command invalid
89 .byte EUNKNOWN ; 172 - haven't found documentation
90 .byte EUNKNOWN ; 173 - bad disk - format couldn't complete
91 .byte EUNKNOWN ; 174 - haven't found documentation
92 .byte EUNKNOWN ; 175 - haven't found documentation
93 .byte EUNKNOWN ; 176 - [DOS 3] incompatible file system
95 MAX_OSERR_VAL = (* - maptable)