Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1 | - | 1 | ;---------------------------------------------------------- |
2 | ; GLOBAL.INC |
||
3 | ; PROGETTO: B1601 |
||
4 | ; |
||
5 | ; Definizioni globali |
||
6 | ;---------------------------------------------------------- |
||
7 | |||
8 | .LIST off |
||
9 | |||
10 | ; Evita inclusioni multiple |
||
11 | .IFNDEF _GLOBAL_INC_ |
||
12 | |||
13 | _GLOBAL_INC_ .DEFL 1 |
||
14 | |||
15 | .CHIP 65816 |
||
16 | .RADIX 10 |
||
17 | .SYMBOLS |
||
18 | .LINKLIST |
||
19 | .DEBUG ASM |
||
20 | .OPTIONS dc2 |
||
21 | .LINEAR on |
||
22 | .SPACES on |
||
23 | |||
24 | ;---------------------------------------------------------- |
||
25 | ; ---- parametri dipendenti dal clock |
||
26 | ;---------------------------------------------------------- |
||
27 | |||
28 | ; specificare CLK in MHz |
||
29 | PHI2 .SET 4 ; default 4MHz |
||
30 | |||
31 | ; specificare periodo timer clock in ms |
||
32 | TJIFFY .SET 10 ; default 10ms |
||
33 | |||
34 | ;---------------------------------------------------------- |
||
35 | |||
36 | |||
37 | .INCLUDE inc\macro.inc |
||
38 | .INCLUDE inc\segm.inc |
||
39 | .INCLUDE inc\chips.inc |
||
40 | .INCLUDE inc\kbd.inc |
||
41 | .INCLUDE inc\scn.inc |
||
42 | .INCLUDE inc\bios.inc |
||
43 | |||
44 | SYSTMRCNT .EQU 4 ; numero timer di sistema |
||
45 | |||
46 | ;;VDC20MHZ .EQU 0 |
||
47 | |||
48 | RAM0TOP .EQU $FC00 ; Top + 1 RAM banco 0 |
||
49 | RAM0SYS .EQU $FE00 ; Start SYS. RAM banco 0 |
||
50 | |||
51 | STACK_ADDR .EQU $DFFF ; top stack |
||
52 | STACK_END .EQU $8000 |
||
53 | |||
54 | ; DP |
||
55 | P0MAT .EQU $0200 |
||
56 | FSWP0 .EQU $0500 |
||
57 | CBMP0 .EQU $7F00 |
||
58 | CBMFSP0 .EQU $7E00 |
||
59 | |||
60 | P0USB0 .EQU $3F00 ; USB #0 D.P. |
||
61 | P0LDT .EQU $4000 ; LDT D.P. |
||
62 | P0FAT .EQU $4100 ; FAT D.P. |
||
63 | P0OS .EQU $4200 ; O.S. main D.P. |
||
64 | P0FPU .EQU $3F00 |
||
65 | |||
66 | ; buffer locale funzione _vprinter |
||
67 | LVPBUF .EQU (STACK_ADDR + 1) |
||
68 | ; CBM FS work area |
||
69 | CBMFSW_START .EQU (LVPBUF + $0100) |
||
70 | CBMVIEC_START .EQU (CBMFSW_START + $0100) |
||
71 | |||
72 | VBBCHARRAM .EQU $010000 ; video RAM caratteri (2K) |
||
73 | VBBATTRRAM .EQU $010800 ; video RAM attributi (2K) |
||
74 | VBBPALRAM .EQU $011000 ; video RAM palette (1K) |
||
75 | |||
76 | ; addon serial test board |
||
77 | .IFDEF _ADDSER_INC_ |
||
78 | PICRAM .EQU $011400 ; 1K till $0117FF |
||
79 | EMURAM .EQU $011800 ; 2K window till $011FFF |
||
80 | .ENDIF |
||
81 | |||
82 | SPOUTBUFF .EQU $050000 |
||
83 | SPOUTBUFF2 .EQU $052000 |
||
84 | SPINBUFF .EQU $054000 |
||
85 | SPINBUFF2 .EQU $058000 |
||
86 | SPOUTBUFF3 .EQU $05C000 |
||
87 | SPINBUFF3 .EQU $05D000 |
||
88 | ;SPOUTBUFF4 .EQU $05E000 |
||
89 | ;SPINBUFF4 .EQU $05F000 |
||
90 | SPOUTBUFF4 .EQU $060000 |
||
91 | SPINBUFF4 .EQU $068000 |
||
92 | |||
93 | SPXON .EQU $11 ; XON seriale per handshake software |
||
94 | SPXOFF .EQU $13 ; XOFF seriale per handshake software |
||
95 | |||
96 | |||
97 | ; bank of dma buffer's |
||
98 | DMABNK .EQU $02 |
||
99 | ; DMA buffer's assign |
||
100 | DR0SYS .EQU $00 ; 36 sec. system cache |
||
101 | DR1SYS .EQU $24 ; 36 sec. system cache |
||
102 | DR0CACHE .EQU $48 ; 36 sec. track cache |
||
103 | DMAFREE0 .EQU $6C ; 20 sec. free cache (cbm wr cache) |
||
104 | ;CLCACHE .EQU $80 ; 64 sec. cluster cache |
||
105 | BCBDMA .EQU $80 ; 64 sec. BCB cache |
||
106 | DMAFREE1 .EQU $C0 ; 20 sec. free cache (cbm wr cache) |
||
107 | DMALXBUF .EQU $D4 ; 8 dma buffer associated with lindx (cbm-fs) |
||
108 | DR1CACHE .EQU $DC ; 36 sec. track cache |
||
109 | |||
110 | XMWIN .EQU $012000 |
||
111 | XMWSIZ .EQU $2000 |
||
112 | XMSTART .EQU $2000 |
||
113 | XMSTOP .EQU $4000 |
||
114 | XMBANK .EQU 1 |
||
115 | |||
116 | DMASAVE .EQU $014000 ; save 36 sec. ($4800) |
||
117 | |||
118 | DISKDEVSTR .EQU $018800 |
||
119 | |||
120 | MBR0ATA .EQU $018800 |
||
121 | MBR1ATA .EQU $018A00 |
||
122 | PBR0ATA .EQU $018C00 |
||
123 | PBR1ATA .EQU $018E00 |
||
124 | ID0ATA .EQU $019000 |
||
125 | ID1ATA .EQU $019200 |
||
126 | MBR0USB .EQU $019400 |
||
127 | PBR0USB .EQU $019600 |
||
128 | |||
129 | CBMEMUBUF .EQU $019800 |
||
130 | MONBUF .EQU $019900 |
||
131 | SPBUF .EQU $019A00 ; 512 bytes |
||
132 | |||
133 | MAXDRV .EQU 4 ; max. drive's number |
||
134 | ATADRV .EQU 2 ; first ata device |
||
135 | |||
136 | MAXDDIRS .EQU $40 |
||
137 | DEFDIR0 .EQU $019C00 |
||
138 | DEFDIR1 .EQU DEFDIR0 + MAXDDIRS |
||
139 | DEFDIR2 .EQU DEFDIR1 + MAXDDIRS |
||
140 | DEFDIR3 .EQU DEFDIR2 + MAXDDIRS |
||
141 | |||
142 | USB0STR .EQU $019D80 ; usb #0 disk string descriptor (30 char's) |
||
143 | USB1STR .EQU $019D9E ; usb #1 disk string descriptor |
||
144 | USBBUF .EQU $019DBC ; temp. usb buffer (64 bytes) |
||
145 | |||
146 | TOSWKM .EQU $019E00 ; TOS working memory |
||
147 | TOSSEG .EQU $010000 |
||
148 | HCBSEG .EQU $040000 ; HCB struct's bank |
||
149 | |||
150 | ;--- bank $01 --- editor |
||
151 | EDBUFNAM .EQU $01C800 ; 80 x 10 bytes |
||
152 | EDSAVE01 .EQU $01CB00 |
||
153 | ; .EQU $01CB20 ; save page 01 from ScnLinTmp |
||
154 | EDBUFFILE .EQU $01CC00 ; file name to save/load |
||
155 | EDDSKERR .EQU $01CC50 ; disk error string |
||
156 | EDBUFLIN .EQU EDDSKERR |
||
157 | EDCURFILE .EQU $01CD00 ; editor: current buffer filename |
||
158 | ;.EQU $01CD50 |
||
159 | EDERRSIZ .EQU (EDCURFILE - EDDSKERR) |
||
160 | EDCRTSAV .EQU $01D000 ; 4k: save video bufefr (editor) |
||
161 | EDDSKBUF .EQU $01E000 ; 8k disk buffer |
||
162 | EDDSKBUFSIZ .EQU $2000 ; size |
||
163 | EDWRKEND .EQU $020000 |
||
164 | |||
165 | ;---------------------------------------------------------- |
||
166 | ; ---- dispositivi I/O TEXT |
||
167 | ;---------------------------------------------------------- |
||
168 | TXTD_KEYB .SET $00 ; tastiera (solo input) |
||
169 | TXTD_SER1 .SET $01 ; porta seriale 1 (se presente) |
||
170 | TXTD_SER2 .SET $02 ; porta seriale 2 (se presente) |
||
171 | TXTD_SCN .SET $03 ; video screen (primario o secondario) |
||
172 | TXTD_PRN1 .SET $04 ; porta parallela 1 (se presente) |
||
173 | TXTD_PRN2 .SET $05 ; porta parallela 2 (se presente) |
||
174 | |||
175 | TXTD_MAX .SET (TXTD_PRN2 + 1) |
||
176 | |||
177 | FDPBSIZE .EQU $09 ; size struttura FDPB |
||
178 | FDMAXDRIVE .EQU 2 |
||
179 | |||
180 | ; errori FDC |
||
181 | FDC_BAD .EQU $01 ; bad controller |
||
182 | FDC_SNDTOUT .EQU $02 ; timeout sendto FDC |
||
183 | FDC_RESTOUT .EQU $03 ; FDC timeout result phase/ATA timeout busy |
||
184 | FDC_INTTOUT .EQU $04 ; timeout interrupt FDC/ATA |
||
185 | FDC_BADRES .EQU $05 ; too many bytes in result phase |
||
186 | FDC_FAULT .EQU $06 ; restore/recalibrate error |
||
187 | FDC_SEEK .EQU $07 ; seek error |
||
188 | FDC_DLOSS .EQU $08 ; perdita dati lettura dati |
||
189 | FDC_DATACRC .EQU $09 ; errore CRC data |
||
190 | FDC_NOID .EQU $0A ; ID non trovato |
||
191 | FDC_WP .EQU $0B ; write protect |
||
192 | FDC_MARK .EQU $0C ; errore mark address |
||
193 | FDC_BADFMT .EQU $0D ; mismatch track readID/unknow format |
||
194 | FDC_NODRIVE .EQU $0E ; drive non presente |
||
195 | FDC_FMT .EQU $0F ; mismatch format |
||
196 | FDC_NOTREADY .EQU $10 ; not ready - no disk |
||
197 | FDC_CHANGE .EQU $11 ; disco cambiato |
||
198 | FDC_VER .EQU $12 ; errore di verifica dati |
||
199 | FDC_BADBUF .EQU $13 ; buffer non valido |
||
200 | FDC_PARAMS .EQU $14 ; parametri non validi |
||
201 | FDC_BADOP .EQU $15 |
||
202 | |||
203 | ATA_NOTREADY .EQU $01 |
||
204 | ATA_DLOSS .EQU $02 |
||
205 | ATA_FAULT .EQU $03 |
||
206 | ATA_EBIT .EQU $04 |
||
207 | ATA_DEVRES .EQU $05 |
||
208 | ATA_VERF .EQU $06 |
||
209 | ATA_IDCKS .EQU $07 |
||
210 | ATA_BADOP .EQU $08 |
||
211 | ATA_XMEM .EQU $09 |
||
212 | ATA_MEM .EQU $0A |
||
213 | ATA_MBR .EQU $0B |
||
214 | |||
215 | ; RTC error's |
||
216 | RTC_BADFNC .EQU $01 ; invalid function |
||
217 | RTC_BADTIME .EQU $02 |
||
218 | RTC_BADDATE .EQU $03 |
||
219 | |||
220 | ;---------------------------------------------------------- |
||
221 | ; ---- SYSTEM ERRORS |
||
222 | ;---------------------------------------------------------- |
||
223 | |||
224 | EZERO .EQU 0 ; 'no error' |
||
225 | EINVFNC .EQU 1 ; 'invalid function number' |
||
226 | EINV .EQU 1 |
||
227 | |||
228 | ENOENT .EQU 2 ; 'no such file or directory' |
||
229 | ED_FILE .EQU 2 |
||
230 | |||
231 | ENOPATH .EQU 3 ; 'path not found' |
||
232 | ED_PATH .EQU 3 |
||
233 | ED_ACCESS .EQU 5 ; 'access denied' |
||
234 | |||
235 | ENOMEM .EQU 8 ; 'not enough memory' |
||
236 | EINVMEM .EQU 9 ; 'invalid memory block address' |
||
237 | |||
238 | ED_FORMAT .EQU 11 |
||
239 | |||
240 | ENODEV .EQU 15 ; 'no such device or drive' |
||
241 | ED_DRIVE .EQU 15 |
||
242 | |||
243 | ENOTRDY .EQU 21 ; 'drive not ready' |
||
244 | ED_NOTRDY .EQU 21 ; 'drive not ready' |
||
245 | ED_RDFAIL .EQU 30 ; 'disk read failure' |
||
246 | EINVPATH .EQU 35 ; 'invalid path format' |
||
247 | |||
248 | ; error class |
||
249 | CLASS_MEDIA .EQU 11 ; media failure |
||
250 | |||
251 | ; error locus |
||
252 | ;OC_ |
||
253 | ;---------------------------------------------------------- |
||
254 | ; ---- FAT |
||
255 | ;---------------------------------------------------------- |
||
256 | |||
257 | ; attributi file |
||
258 | ATTR_READ_ONLY .EQU $01 |
||
259 | ATTR_HIDDEN .EQU $02 |
||
260 | ATTR_SYSTEM .EQU $04 |
||
261 | ATTR_VOLUME_ID .EQU $08 |
||
262 | ATTR_DIRECTORY .EQU $10 |
||
263 | ATTR_ARCHIVE .EQU $20 |
||
264 | |||
265 | ATTR_LONG_NAME .EQU $0F |
||
266 | |||
267 | DA_VOLUME .EQU $08 |
||
268 | DA_DIR .EQU $10 |
||
269 | |||
270 | LFN_MAXENT .SET $05 ; max. numero entry LFN |
||
271 | LFN_MAXLEN .SET ((LFN_MAXENT * 13) + 1) |
||
272 | ;LFN_MAXLEN .SET ((5 * 13) + 1) |
||
273 | |||
274 | SFN_MAXLEN .SET (8 + 1 + 3 + 1) |
||
275 | |||
276 | ;.INCLUDE inc\fat.inc |
||
277 | .INCLUDE inc\fsys.inc |
||
278 | .INCLUDE inc\cbm.inc |
||
279 | |||
280 | .ENDIF ;; _GLOBAL_INC_ |
||
281 | |||
282 | .LIST on |