annotate 3rdparty/drivers/tccc/tccchd.asm @ 749:ec1909ff0764

Updated Makefile
author boisy
date Wed, 08 Jan 2003 05:09:53 +0000
parents d76cc2119c4f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
82
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1 * TCCCHD: Hard disk driver/scsi host adapter driver for OS9
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
2 * Copyright (C) 1990,1991,1992,1993,1994,1995,1996 Robert E. Brose II
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
3 *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
4 * This program is free software; you can redistribute it and/or modify
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
5 * it under the terms of the GNU General Public License as published by
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
7 * (at your option) any later version.
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
8 *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
9 * This program is distributed in the hope that it will be useful,
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
12 * GNU General Public License for more details.
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
13 *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
14 * You should have received a copy of the GNU General Public License
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
15 * along with this program; if not, write to the Free Software
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
17
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
18 opt w131
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
19 nam Hard Disk driver, flip-flop & latch version.
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
20 ttl title page
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
21
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
22 * experimental no DP version 9-11-90
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
23 **************************************************************
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
24 * T C C C (TC^3) *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
25 * H A R D D I S K device driver for CoCo OS9 *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
26 * written by Robert E. Brose II *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
27 * uses Western digital WD 1002-shd or Xebec 5" controller*
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
28 * host adapter modeled after example in Xebec manual *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
29 * Allows use of 2 different drives with separate offsets *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
30 * for partitioning (ms 13 bits of 21 bit sector #) *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
31 **************************************************************
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
32 *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
33 *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
34 * physical drive number stored in IT.DNS.
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
35 *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
36 * revision history
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
37 *------------------------------------
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
38 * 2.0 Totally revamped
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
39 * Controller number gotten from the PD (PD.DNS lower 4 bits).
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
40 * Avoids use of DP, it's faster without it.
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
41 * Most subroutines moved to inline code to increase speed
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
42 * Added time slice release if controller is busy 12/01/90
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
43 * set blocks in init instead of doing it on every packet 12/01/90
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
44 * 2.1 Added adaptec conditional statements 02-23-92
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
45 * Uniform descriptors, params adaptec doesn't need are ignored 02-23-92
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
46 * 2.2 init/don't init drive, bit 6 of PD.DNS. 1=don't init 1-15-94
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
47 * resets drive in setup routine 1-16-94
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
48 * locks scsi packet, elims conflict on multiple drives on the same
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
49 * host adapter. 1-16-94
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
50 * altered format to work with seagate drives. 1-16-94
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
51 * 5/6.x changed revisn and versn below to match up with this history 1-19-94
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
52 * 5.x 256 byte sectors version.
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
53 * 6.x 1K HD sectors version. 1-19-94
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
54 * 5/6.2 added HOG flag for maximum speed, to hog the cpu
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
55 * 5/6/7/8.3 Added MEDSEC for 512 byte sectors
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
56 * 5/6/7/8.4 much 6309 optimisation
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
57 * 9.x Redid version/revision stuff again. Version is now 9, revision
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
58 * indicates sector size. 6809: 1=256 by/sec 2=512 by/sec 3=1024 by/sec
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
59 * Nitros 6309 4=256 by/sec 5=512 by/sec 6=1024 by/sec
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
60 *10.x Changes to allow >1 drive with large sectors. 11-5-94
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
61 * UGH removed for now, flush is too complicated with BIGSEC
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
62 * changed 6309 block moves to I/O to allow for a gap to service serial
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
63 * interrupts every 256 moves (affects sector sizes >256 bytes). 3-25-95
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
64 *11.x Optimizations from better understanding about when the driver can
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
65 * be interupted, thanks Alan DeKok. 1-7-96
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
66 * Handles inits of several scsi id'd devices. 1-7-96
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
67 * Fixed Calcsec, logread and logwrit to handle 512 bytes/sector 1-8-96
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
68 *12.x Added DISTO HD II support 3-9-96
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
69 * notes: sleep causes the only possible reentrant situation (~HOG)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
70 * in this case cmd block and cache buffer must be preserved.
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
71 * To make multiple drives/driver work for 512 and 1024 (BUFSEC)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
72 * cases will require info like drive, lun, offset, etc to be
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
73 * save for the previous sector so a cache flush can be done. YUK!
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
74 * Added sector 0 cache because rbf accesses it all the darn time! 6-8-96
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
75
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
76 H6309 equ 1 if 6309 cpu, 0=on!
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
77
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
78 ttl equates
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
79 DBHS equ 1 data requires req handshake version 0=ON! (i.e. adaptec)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
80 BIGSEC equ 1 use 1024 byte physical sectors (0=ON!)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
81 MEDSEC equ 0 use 512 byte physical sectors (0=ON!)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
82 HOG equ 1 hog the cpu on waits (speeds up disk access 0=ON!)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
83 DISTO equ 1 use HD II ports and status bits (0=ON!)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
84 MDRIVES equ 1 can use more than 1 drive / driver in BUFSEC case (0=ON!)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
85 MPAK equ 1 includes multipak switching code (needed for DISTO w/ MPAK 0=ON!)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
86 CANFORM equ 0 drive formatting allowed (0=ON!)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
87 CACHE equ 1 sector 0 cache (0=ON!).
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
88
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
89
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
90 * BUFSEC below means a buffer is used when reading/writing physical secs
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
91 * (0=on)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
92
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
93 ifeq BIGSEC
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
94 BUFSEC equ $0
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
95 m.smask equ %11111100
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
96 m.nsmask equ %00000011
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
97 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
98
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
99 ifeq MEDSEC
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
100 BUFSEC equ $0
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
101 m.smask equ %11111110
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
102 m.nsmask equ %00000001
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
103 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
104
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
105 BUFSEC equ $1
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
106 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
107 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
108
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
109 ifeq H6309
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
110
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
111 ifeq BIGSEC
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
112 revisn equ 6
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
113 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
114 ifeq MEDSEC
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
115 revisn equ 5
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
116 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
117 revisn equ 4
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
118 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
119 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
120
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
121 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
122
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
123 ifeq BIGSEC
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
124 revisn equ 3
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
125 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
126 ifeq MEDSEC
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
127 revisn equ 2
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
128 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
129 revisn equ 1
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
130 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
131 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
132
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
133 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
134
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
135 verson equ 12
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
136
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
137 numdrvs equ 4 number of drives supported by driver (logical)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
138 * status byte mask
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
139
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
140 m.error equ %00000010 error flag
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
141
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
142 * status register bit masks
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
143
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
144 ifeq DISTO
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
145 m.req equ %10000000 data request line
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
146 m.busy equ %00000001 busy status line
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
147 * broken on disto??? m.msg equ %00000100 end of message status line
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
148 m.msg equ %00000000 end of message status line
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
149 m.cmd equ %01000000 command/data status line
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
150 m.in equ %00100000 input/output status line
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
151 * broken msg on disto ??? m.nnc equ %11100101 unconnected lines = ignore mask
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
152 m.nnc equ %11100001 unconnected lines = ignore mask
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
153
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
154 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
155
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
156 * normal TCCC defs
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
157 m.req equ %00000001 data request line
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
158 m.busy equ %00000010 busy status line
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
159 m.msg equ %00000100 end of message status line
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
160 m.cmd equ %00001000 command/data status line
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
161 m.in equ %00010000 input/output status line
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
162
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
163 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
164
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
165 m.phys equ %00100000 physical drive mask (LUN on Controller)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
166 m.init equ %01000000 initialize drive on change flag
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
167 m.cont equ %00001111 controller address mask
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
168 m.recal equ %00010000 do a recal (home) on 1st drive access
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
169 m.format equ %10000000 enable format command
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
170
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
171 ifeq MPAK
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
172 m.mpscs equ %11110000 Mpak slot select SCS clearing mask
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
173 mpsel equ $FF7F multipak select latch addr, used for disto.
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
174 EXTPRM equ 25 extra params in descriptor
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
175 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
176 EXTPRM equ 24 extra params in descriptor
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
177 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
178
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
179 * input and output ports offsets for HOST ADAPTER bus
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
180
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
181 ifeq DISTO
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
182 datapo equ 3 read and write data
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
183 rstpo equ 1 software reset
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
184 selpo equ 2 controller select
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
185 statpo equ 1 read status
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
186 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
187
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
188 * Normal TCCC defines
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
189 datapo equ 0 read and write data
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
190 rstpo equ 1 software reset
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
191 selpo equ 2 controller select
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
192 selrst equ 3 reset of select (scuzzie adapters)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
193 statpo equ 1 read status
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
194
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
195 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
196
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
197 * controller opcodes
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
198
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
199 o.ready equ $00 test for drive ready
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
200 o.param equ $0c set parameters for the drives
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
201 o.read equ $08 read sector(s)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
202 o.write equ $0a write sector(s)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
203 o.formt equ $04 format drive
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
204 o.recal equ $01 recalibrate drive (head to track 0)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
205
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
206 ifp1
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
207 use defsfile
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
208 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
209
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
210 ttl data allocation
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
211
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
212 org DRVBEG
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
213 tables rmb DRVMEM*numdrvs reserve space for system tables
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
214
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
215 * command packet for controller
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
216
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
217 packet equ .
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
218
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
219 opcode rmb 1 command opcode
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
220 lun rmb 1 logical unit number : ms part of lsn
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
221 lsn rmb 2 logical sector number
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
222 blocks rmb 1 interleave or block count
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
223 control rmb 1 control byte set at packet send time
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
224 plocked rmb 1 above control block in use, locked
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
225 blocked rmb 1 buffer sector (caching) in use, locked
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
226
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
227 * extra parameters read in from the descriptor.
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
228
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
229 param rmb 8 physical drive 0 params
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
230 param1 rmb 8 physical drive 1 params
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
231
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
232 * logical drive offsets
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
233
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
234 offsd1 rmb 2
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
235 offsd2 rmb 2
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
236 offsd3 rmb 2
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
237 offsd4 rmb 2
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
238
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
239 ifeq MPAK
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
240 * Multipak latch temp storage and slot.
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
241 mpslot rmb 1 From descriptor, FF = no mpak
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
242 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
243
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
244 * end of extra params read in from descriptor
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
245
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
246 ifeq MPAK
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
247 mpstor rmb 1 Current multipak value outside of this driver.
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
248 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
249 didflag rmb 1 read lsn 0 flag
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
250 lastphy rmb 1 last drive accessed (physical)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
251 sec0fl rmb numdrvs (recal (home) completed flag)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
252 tempw1 rmb 2 word temp var
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
253 tempw2 rmb 2 word temp var
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
254
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
255 iniflg rmb numdrvs whether or not the device has been initalized
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
256
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
257 ifeq BUFSEC
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
258
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
259 ifeq BIGSEC
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
260 secbuf rmb 1024 buffer for physical sector
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
261 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
262 secbuf rmb 512 buffer for physical sector
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
263 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
264
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
265 ifeq CACHE
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
266 sec0 rmb 256*numdrvs optional sector 0 cache
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
267 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
268
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
269 lastdrv rmb 1 last LOGICAL drive accessed
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
270 lsech rmb 1 24 bit address, sector in buffer (logical w/o least sig 2 bits)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
271 lsecm rmb 1 (part of above)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
272 lsecl rmb 1 "
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
273 physech rmb 1 24 bit address, sector in buffer (physical sector in buffer)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
274 physecm rmb 1 (part of above)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
275 physecl rmb 1 "
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
276 cached rmb 1 cache is dirty flag
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
277 secidx rmb 1 index into physical sector
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
278 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
279
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
280 endmem equ .
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
281
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
282 ttl module entry
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
283
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
284 mod endmod,name,drivr+objct,reent+verson,xferad,endmem
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
285 mode fcb $ff mode
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
286
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
287 ifeq DISTO
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
288 ifeq DBHS
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
289 name fcs "DIDBHS"
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
290 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
291 ifeq BIGSEC
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
292 name fcs "DI1024"
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
293 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
294 ifeq MEDSEC
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
295 name fcs "DIS512"
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
296 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
297 name fcs "DISTHD"
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
298 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
299 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
300 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
301
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
302 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
303
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
304 ifeq DBHS
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
305 name fcs "DBHSHD"
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
306 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
307 ifeq BIGSEC
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
308 name fcs "TC1024"
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
309 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
310 ifeq MEDSEC
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
311 name fcs "TCC512"
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
312 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
313 name fcs "TCCCHD"
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
314 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
315 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
316 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
317
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
318 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
319
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
320 fcb revisn
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
321
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
322 * rbf dispatch vectors
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
323
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
324 xferad lbra INIT
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
325
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
326 ifeq BUFSEC
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
327 lbra LOGREAD
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
328 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
329 bra READ
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
330 nop
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
331 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
332
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
333
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
334 ifeq BUFSEC
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
335 bra LOGWRIT
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
336 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
337 bra WRITE
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
338 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
339
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
340 nop
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
341 lbra GETSTA
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
342 lbra SETSTA
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
343 lbra TERM
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
344
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
345 ifeq BUFSEC
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
346 ttl logical sector write
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
347
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
348 * logwrit
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
349 *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
350 * input:
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
351 * b = msb of os9 lsn
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
352 * x = lsbs of os9 lsn
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
353 * y = path descriptor
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
354 * u = static storage
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
355 *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
356 * output:
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
357 * 256 bytes moved from the os9 buffer to the physical buffer. Any
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
358 * necessary physical sector writing and reading is done also.
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
359 *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
360 LOGWRIT
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
361
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
362 ifne HOG
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
363 pshs u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
364 logwr01 tst blocked,u critical lock on this section
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
365 beq logwr02 because of the buffer
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
366 pshs b,x
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
367 ldx #1
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
368 os9 F$Sleep wait a while
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
369 puls b,x
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
370 bra logwr01 and check again
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
371 logwr02 com blocked,u set it
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
372 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
373
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
374 pshs b save HSB
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
375 tfr x,d msb and lsb into d for manipulation
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
376 stb secidx,u save lsb for indexing into phys sec buf later
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
377 andb #m.smask zero indexing bits
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
378 cmpd lsecm,u lower part of logical sector
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
379 puls b get back HSB
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
380 bne diffwr if compare fails, new sector, need preread
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
381 cmpb lsech,u compare HSB's
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
382
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
383 ifne MDRIVES
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
384 beq cpysecw ok, in buffer
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
385 diffwr
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
386
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
387 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
388
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
389 bne diffwr failed new sec need preread
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
390 lda PD.DRV,y current drive
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
391 cmpa lastdrv,u = last drive?
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
392 beq cpysecw if same, log sector is in physical buffer
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
393 diffwr
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
394 sta lastdrv,u save logical drive for future compare
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
395 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
396
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
397 tst cached,u need to flush physical sector?
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
398 beq cleanw no, skip ahead
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
399 pshs b,x,y,u save new sector
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
400 ldb physech,u get current HSB
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
401 ldx physecm,u get current msb & lsb
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
402 lbsr WRITE do the physical write
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
403 puls b,x,y,u restore new sector
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
404 bcs logwre exit on write error
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
405
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
406 cleanw lbsr calcsec
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
407 pshs y
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
408 lbsr READ read the physical sector
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
409 puls y
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
410 bcs logwre exit on read error
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
411
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
412 cpysecw
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
413 ldy PD.BUF,y os9 buffer
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
414 lda secidx,u index into physical buffer
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
415 anda #m.nsmask mask upper off
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
416 leax secbuf,u location of physical buffer
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
417 ldb #128
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
418 cpsw2 tsta done calculating index?
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
419 beq cpsw2b yup, exit loop
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
420 abx these 2 ins advance 256 bytes into physical buffer
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
421 abx
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
422 deca
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
423 bra cpsw2
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
424
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
425 cpsw2b clr cached,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
426 com cached,u set cache dirty flag
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
427
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
428 ifeq H6309
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
429
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
430 cpsw3 ldw #256 bytes to copy
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
431 tfm y+,x+
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
432
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
433 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
434
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
435 * 16 bit copy, 128 words from os9 buff to phys buff
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
436 cpsw3 ldu ,y++ get byte from os9 buffer
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
437 stu ,x++ to phys sector
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
438 decb
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
439 bne cpsw3
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
440
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
441 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
442
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
443 clrb
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
444
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
445 logwre
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
446
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
447 ifne HOG
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
448 puls u restore static pointer
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
449 clr blocked,u clear lock on this section
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
450 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
451
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
452 rts
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
453
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
454
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
455 ttl logical sector read
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
456
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
457 * logread
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
458 *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
459 * input:
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
460 * b = msb of os9 lsn
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
461 * x = lsbs of os9 lsn
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
462 * y = path descriptor
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
463 * u = static storage
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
464 *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
465 * output:
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
466 * 256 bytes moved from the physical buffer to the os9 buffer. Any
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
467 * necessary physical sector writing and reading is done first.
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
468 *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
469 LOGREAD
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
470
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
471 ifne HOG
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
472 pshs u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
473 logre01 tst blocked,u critical lock on this section
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
474 beq logre02 because of the buffer
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
475 pshs b,x
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
476 ldx #1
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
477 os9 F$Sleep wait a while
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
478 puls b,x
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
479 bra logre01 and check again
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
480 logre02 com blocked,u set lock
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
481 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
482
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
483 pshs b save HSB
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
484 tfr x,d msb and lsb into d for manipulation
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
485 stb secidx,u save lsb for indexing into phys sec buf later
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
486 andb #m.smask zero indexing bits
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
487 cmpd lsecm,u lower part of phys sector
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
488 puls b get back HSB
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
489 bne diffrd if compare fails, new sector to read
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
490 cmpb lsech,u compare HSB's
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
491
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
492 ifne MDRIVES
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
493 beq cpysecr ok, in buffer
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
494 diffrd
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
495
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
496 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
497
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
498 bne diffrd failed new sec need preread
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
499 lda PD.DRV,y current drive
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
500 cmpa lastdrv,u = last drive?
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
501 beq cpysecr if same, log sector is in physical buffer
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
502 diffrd
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
503 sta lastdrv,u save logical drive for future compare
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
504 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
505
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
506 tst cached,u need to flush physical sector?
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
507 beq cleanr no, skip ahead
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
508 pshs b,x,y,u save new sector
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
509 ldb physech,u get current HSB
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
510 ldx physecm,u get current msb & lsb
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
511 lbsr WRITE do the physical write
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
512 puls b,x,y,u restore new sector
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
513 bcs logrde exit on write error
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
514
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
515 cleanr bsr calcsec
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
516 pshs y
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
517 lbsr READ read the physical sector
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
518 puls y
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
519 bcs logrde exit on read error
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
520
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
521 cpysecr
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
522 ldy PD.BUF,y os9 buffer
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
523 lda secidx,u index into physical buffer
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
524 anda #m.nsmask mask upper off
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
525 leax secbuf,u location of physical buffer
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
526 ldb #128
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
527 cpsr2 tsta done calculating index?
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
528 beq cpsr3 yup, exit loop
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
529 abx these 2 ins advance 256 bytes into physical buffer
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
530 abx
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
531 deca
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
532 bra cpsr2
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
533
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
534 ifeq H6309
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
535
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
536 cpsr3 ldw #256
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
537 tfm x+,y+
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
538
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
539 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
540
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
541 * 16 bit copy, 128 words from phys buff to os9 buff
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
542 cpsr3 ldu ,x++ get byte from phys sec
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
543 stu ,y++ to os9 buffer
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
544 decb
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
545 bne cpsr3
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
546
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
547 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
548
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
549 clrb
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
550 logrde
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
551
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
552 ifne HOG
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
553 puls u restore static pointer
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
554 clr blocked,u clear lock on this section
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
555 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
556
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
557 rts
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
558
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
559 * fast calcsec (see comments in 6809 code below)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
560
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
561 ifeq H6309
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
562 calcsec stb lsech,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
563 tfr x,w
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
564
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
565 tfr f,a
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
566 anda #m.smask
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
567 sta lsecl,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
568 ste lsecm,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
569
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
570 *aim #m.smask,lsecl,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
571
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
572 * 4x (256 x 4 =1k sector) or 2x (256 x 2 = 512 sector)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
573
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
574 ifeq BIGSEC
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
575 lsrb
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
576 rorw
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
577 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
578
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
579 lsrb
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
580 rorw
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
581 stb physech,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
582 tfr w,x
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
583 stx physecm,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
584 rts
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
585
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
586 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
587
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
588 calcsec stb lsech,u save logical sec hsb for next compare
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
589 stb physech,u and in physec for shifting
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
590 tfr x,d get msb & lsb into d for shifting
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
591 andb #m.smask strip lower bits lsb sec #
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
592 std lsecm,u save it for compare
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
593 std physecm,u as above for shifting
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
594 lsr physech,u shift 24 bits right 2 bits, converts to physical sec # (1st 8)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
595 ror physecm,u (2nd 8)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
596 ror physecl,u (3rd 8)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
597
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
598 * 4x (256 x 4 =1k sector) or 2x (256 x 2 = 512 sector)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
599 ifeq BIGSEC
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
600 lsr physech,u (1st 8, second time)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
601 ror physecm,u (2nd 8, second time)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
602 ror physecl,u (3rd 8, second time)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
603 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
604
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
605 ldx physecm,u for return value
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
606 ldb physech,u for return value
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
607 rts
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
608
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
609 endc (H6309)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
610 endc (bufsec)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
611
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
612 ttl write sector
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
613
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
614 * write
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
615 *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
616 * input:
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
617 * b = msb of lsn
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
618 * x = lsb's of lsn
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
619 * y = path descriptor
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
620 * u = static storage
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
621 *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
622 * output:
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
623 * b,x,y,u destroyed
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
624 * 256 bytes written (512/1024 bufsec version)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
625 * otherwise, carry set and b = error code
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
626 *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
627 *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
628 WRITE
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
629 ifeq MPAK
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
630 pshs u need for restore at end of write routine
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
631 tst mpslot,u multipak in use? (1xxxxxxxb = no)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
632 bmi slotw2 hi bit set, skip
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
633 lda >mpsel get current value
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
634 sta mpstor,u save it
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
635 anda #m.mpscs clear scs bits
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
636 ora mpslot,u add in scs select
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
637 sta >mpsel put it to mpak
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
638 slotw2
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
639 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
640
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
641 lda #o.write controller write opcode
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
642 lbsr setup setup packet, initiate command
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
643
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
644 ifeq BUFSEC
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
645 leax secbuf,u get address of physical sector buffer
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
646 clr cached,u clear cache dirty flag
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
647 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
648 ldx PD.BUF,y get buffer address into x
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
649 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
650
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
651 ldu V.PORT,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
652 leay statpo,U
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
653 leau datapo,u u points to data port
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
654 lda #m.req
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
655
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
656 ifeq HOG
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
657 W0 bita ,y get req bit
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
658 beq W0 wait till req
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
659
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
660 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
661
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
662 W00 clrb 256 tries
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
663 W0 bita ,y get req bit
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
664 bne W0B
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
665 decb
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
666 bne W0 keep trying
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
667 lbsr doslp
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
668 bra W00
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
669
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
670 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
671
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
672 ifeq DBHS
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
673 W0B bra W1 first req got already, skip ahead
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
674 W0C ldb ,y status port
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
675 bitb #m.req have req?
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
676 beq W0C wait till we do
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
677 bitb #m.cmd finished putting data?
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
678 bne W2A if so, skip ahead
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
679 W1 lda ,x+ get a byte from memory
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
680 sta ,u put it to the drive
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
681 bra W0C go again
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
682
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
683 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
684
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
685 * for 6309, use block transfer fixed size. Not really according to scsi
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
686 * spec, but FAST!
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
687
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
688 ifeq H6309
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
689 W0B
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
690 ifeq BIGSEC
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
691 ldw #1024
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
692 tfm x+,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
693 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
694 ifeq MEDSEC
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
695 ldw #512
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
696 tfm x+,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
697 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
698 ldw #256
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
699 tfm x+,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
700 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
701 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
702
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
703 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
704
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
705 ifeq DISTO
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
706 W0B bra W2
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
707 W1 lda ,X+
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
708 sta ,U
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
709 W2 ldb ,Y
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
710 andb #m.nnc and out the floating bits
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
711 cmpb #m.req+m.busy still have data?
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
712 beq W1 yup go for more
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
713
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
714 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
715 W0B ldb #m.req+m.busy status mask for command/data mode
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
716 bra W2
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
717 W1 lda ,X+
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
718 sta ,U
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
719 W2 cmpb ,Y
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
720 beq W1
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
721 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
722
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
723 * didn't work, don't know why. changed to make disto easier
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
724
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
725 *W0B ldb #m.cmd command mode?
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
726 * bra W2
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
727 *W1 LDA ,X+
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
728 * STA ,U
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
729 *W2 BITB ,Y
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
730 * BEQ W1 not command mode yet, go for more data
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
731
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
732 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
733 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
734
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
735 ifeq DISTO
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
736
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
737 W2A ldb ,y get status bits
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
738 andb #m.nnc strip floating bits
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
739 cmpb #m.req+m.busy+m.cmd+m.in
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
740 bne W2A
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
741 lda ,u status data byte
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
742 W2C ldb ,y get status bits
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
743 andb #m.nnc strip floating bits
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
744 cmpb #m.req+m.busy+m.msg+m.cmd+m.in
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
745 bne W2C
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
746
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
747 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
748
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
749 W2A ldb #m.req+m.busy+m.cmd+m.in
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
750 W2B cmpb ,y get status
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
751 bne W2B
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
752 lda ,u status data byte
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
753 ldb #m.req+m.busy+m.msg+m.cmd+m.in
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
754 W2C cmpb ,y
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
755 bne W2C get term byte
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
756
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
757 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
758
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
759 ldb ,u discard
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
760 anda #m.error isolate error bit
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
761 beq w3 if no error
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
762 comb flag error
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
763 ldb #E$Write error code for OS9
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
764 bra w4
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
765
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
766 w3 clrb flag no errors
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
767
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
768 w4
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
769 ifeq MPAK
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
770 puls u saved at top of routine
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
771 pshs a,cc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
772 lda mpstor,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
773 sta >mpsel restore old mpak slot value
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
774 puls a,cc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
775 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
776
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
777 rts
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
778
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
779
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
780 ttl read sector
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
781
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
782 * read
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
783 *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
784 * input:
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
785 * b = hsb of lsn
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
786 * x = lsb's of lsn
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
787 * y = path descriptor
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
788 * u = static storage
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
789 * output:
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
790 * b,x,y destroyed, u preserved
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
791 * if no error, 256 bytes into sector buffer
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
792 * otherwise carry set and b = error
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
793 *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
794 *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
795 READ
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
796 ifeq MPAK
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
797 tst mpslot,u multipak in use? (1xxxxxxxb = no)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
798 bmi slotr2 hi bit set, skip change
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
799 lda >mpsel get current value
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
800 sta mpstor,u save it
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
801 anda #m.mpscs clear scs bits
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
802 ora mpslot,u add in scs select
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
803 sta >mpsel put it to mpak
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
804 slotr2
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
805 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
806
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
807 tstb hsb = 0
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
808 bne rdnot0 no, skip
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
809 leax ,x msb & lsb =0?
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
810 bne rdnot0
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
811
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
812 ifeq BUFSEC
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
813 lda secidx,u least 2 bits are in here
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
814 anda #m.nsmask
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
815 bne rdnot0
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
816 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
817
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
818 * first access to drive (implied) so recal the drive to home heads.
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
819
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
820 pshs d,x
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
821 leax sec0fl,u get flag for this drive
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
822 lda PD.DRV,y get drive #
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
823 tst a,x drive LSN0 already read?
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
824 bne sec0dn yup, skip it
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
825 com a,x flag recal done now
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
826 clr didflag,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
827 com didflag,u set disk id sec flag on
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
828 lda PD.DNS,y
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
829 anda #m.recal should this drive be homed?
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
830 beq sec0dn
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
831
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
832 ldx #0 clear sector # back out (B is still clear)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
833
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
834 lda #o.recal
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
835 lbsr setup
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
836
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
837 ifeq DISTO
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
838
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
839 recal0 ldb statpo,x (see comments at W2A)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
840 andb #m.nnc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
841 cmpb #m.req+m.busy+m.cmd+m.in
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
842 bne recal0
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
843 lda datapo,x
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
844 recal1 ldb statpo,x
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
845 andb #m.nnc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
846 cmpb #m.req+m.busy+m.msg+m.cmd+m.in
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
847 bne recal1
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
848
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
849 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
850
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
851 ldb #m.req+m.busy+m.cmd+m.in
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
852 recal0 cmpb statpo,x
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
853 bne recal0
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
854 lda datapo,x
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
855 ldb #m.req+m.busy+m.msg+m.cmd+m.in
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
856 recal1 cmpb statpo,x
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
857 bne recal1
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
858
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
859 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
860
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
861 lda datapo,x
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
862 sec0dn
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
863 puls d,x
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
864
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
865 rdnot0 lda #o.read opcode for read operation
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
866 lbsr setup setup packet, initiate command
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
867
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
868 ifeq BUFSEC
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
869 leax secbuf,u physical buffer location
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
870 clr cached,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
871 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
872 ldx PD.BUF,y setup buffer loc in x
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
873 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
874
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
875 pshs Y,U
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
876 ldu V.PORT,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
877 leay statpo,U
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
878 leau datapo,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
879
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
880 lda #m.req wait for data request
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
881
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
882 ifeq HOG
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
883
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
884 R0 bita ,y
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
885 beq R0 wait for req
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
886
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
887 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
888 R00 clrb 256 tries for req
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
889 R0 bita ,y
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
890 bne R0B
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
891 decb
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
892 bne R0 keep trying
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
893 lbsr doslp
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
894 bra R00
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
895
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
896 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
897
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
898 ifeq DBHS
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
899
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
900 R0B bra R1 first time have req, skip forward
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
901 R0C ldb ,y get status
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
902 bitb #m.req request bit
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
903 beq R0C no, go again
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
904 bitb #m.cmd finished with data?
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
905 bne R2A yes, skip ahead
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
906 R1 lda ,u get data from the controller
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
907 sta ,x+ to memory
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
908 bra R0C go again
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
909
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
910 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
911
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
912 R0B
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
913 * for 6309, use block transfer fixed size. Not really according to scsi
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
914 * spec, but FAST!
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
915
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
916 ifeq H6309
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
917 ifeq BIGSEC
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
918 ldw #256
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
919 orcc #%01010000
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
920 tfm u,x+
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
921 andcc #%10101111
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
922 ldw #256
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
923 orcc #%01010000
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
924 tfm u,x+
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
925 andcc #%10101111
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
926 ldw #256
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
927 orcc #%01010000
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
928 tfm u,x+
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
929 andcc #%10101111
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
930 ldw #256
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
931 orcc #%01010000
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
932 tfm u,x+
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
933 andcc #%10101111
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
934 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
935 ifeq MEDSEC
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
936 ldw #256
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
937 orcc #%01010000
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
938 tfm u,x+
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
939 andcc #%10101111
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
940 ldw #256
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
941 orcc #%01010000
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
942 tfm u,x+
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
943 andcc #%10101111
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
944 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
945 ldw #256
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
946 orcc #%01010000
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
947 tfm u,x+
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
948 andcc #%10101111
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
949 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
950 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
951
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
952 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
953
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
954 ifeq DISTO
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
955 bra R2
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
956 R1 lda ,U
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
957 sta ,X+
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
958 R2 ldb ,Y
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
959 andb #m.nnc and out floating bits
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
960 cmpb #m.in+m.busy+m.req still more data?
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
961 beq R1 yes, go for more
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
962 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
963 ldb #m.in+m.busy+m.req test bit for command/data mode
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
964 bra R2
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
965 R1 lda ,U
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
966 sta ,X+
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
967 R2 cmpb ,Y
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
968 beq R1
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
969 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
970
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
971 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
972 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
973
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
974 ifeq DISTO
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
975
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
976 R2A ldb ,y get status bits
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
977 andb #m.nnc strip floating bits
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
978 cmpb #m.req+m.busy+m.cmd+m.in
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
979 bne R2A
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
980 lda ,u status data byte
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
981 R2C ldb ,y get status bits
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
982 andb #m.nnc strip floating bits
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
983 cmpb #m.req+m.busy+m.msg+m.cmd+m.in
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
984 bne R2C
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
985
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
986 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
987
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
988 R2A ldb #m.req+m.busy+m.cmd+m.in
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
989 R2B cmpb ,y get status
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
990 bne R2B
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
991 lda ,u status data byte
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
992 ldb #m.req+m.busy+m.msg+m.cmd+m.in
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
993 R2C cmpb ,y
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
994 bne R2C get term byte
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
995
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
996 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
997
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
998 ldb ,u discard
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
999 anda #m.error isolate error bit
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1000 puls Y,U
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1001 beq r3 if no error detected
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1002 comb flag error to OS9
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1003 ldb #E$Read error code to be returned
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1004 bra r6
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1005 r3 lda didflag,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1006 beq r5 if lsn not 0
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1007 clr didflag,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1008 lda PD.DRV,y get drive number
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1009 ldb #DRVMEM size of each entry
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1010 mul calculate the offset into the table
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1011 leax tables,u get base address
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1012 leax d,x get record address
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1013
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1014 ifeq BUFSEC
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1015 leay secbuf,u physical sector buffer
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1016 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1017 ldy PD.BUF,y sector buffer address
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1018 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1019
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1020 ifeq H6309
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1021
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1022 ldw #DD.SIZ
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1023 tfm y+,x+
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1024
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1025 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1026
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1027 ldb #DD.SIZ number of bytes to copy
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1028 r4 lda ,y+ get a byte from the disk identification sector
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1029 sta ,x+ put it into the drive table
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1030 decb count bytes to copy
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1031 bne r4
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1032
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1033 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1034
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1035 r5 clrb
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1036 r6
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1037 ifeq MPAK
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1038 pshs a,cc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1039 lda mpstor,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1040 sta >mpsel restore old mpak slot value
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1041 puls a,cc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1042 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1043
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1044 rts
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1045
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1046 ttl device init
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1047
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1048 * init
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1049 *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1050 * input:
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1051 * y = device descriptor
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1052 * u = static storage
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1053 *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1054 * output:
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1055 * carry set if error
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1056 * b = error code
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1057 *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1058 * y,u preserved. others destroyed
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1059
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1060 INIT pshs y
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1061
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1062 ldx V.PORT,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1063
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1064 ifne DISTO
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1065 sta selrst,x reset select line
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1066 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1067
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1068 * removed 1-16-94, multiple drives are now imbeded scsi, each has controller
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1069 * shouldn't do a scsi bus reset
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1070
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1071 * ifne ADAPTEC
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1072 * sta rstpo,x reset controllers (if more than one device, should be removed)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1073 * ldb #m.busy
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1074 *iniw bitb statpo,x wait till not busy
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1075 * bne iniw
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1076 * endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1077
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1078 leay $21,y get start of params & offsets in descriptor
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1079 ldb #EXTPRM bytes to transfer
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1080 leax param,u start of drive parameters in static storage
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1081 offload lda ,y+ get drive parameters from descriptor
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1082 sta ,x+ put into static
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1083 decb
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1084 bne offload if not done
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1085 puls y
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1086 clr didflag,u sector 0 read flag=cleared
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1087 lda #$ff will set lastphy to undef
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1088 sta lastphy,u store it
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1089
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1090 ifeq BUFSEC
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1091 sta lastdrv,u set last logical read to unknown
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1092 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1093
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1094 ldb #numdrvs number of drives controller supports
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1095 stb V.NDRV,u to the manager space
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1096 leax tables,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1097 lda #$ff
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1098 fixtab sta DD.TOT,x setup starting info in the tables until the first sector
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1099 clr V.TRAK,x of the device is read which will fill in the drive tables
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1100 sta V.TRAK+1,x
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1101 leax DRVMEM,x
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1102 decb
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1103 bne fixtab if not done with both tables
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1104 lda #1
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1105 sta blocks,u set up for normal read/write 1 sector
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1106 clr blocked,u extended buffer locked flag
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1107 clr plocked,u param block locked flag
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1108
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1109 ifeq BUFSEC
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1110 clr cached,u cache dirty flag
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1111 clr secidx,u index into physical sector
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1112 ldb #$ff
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1113 stb lsech,u set begin phy sec number to impossible value to force read
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1114 stb lsecm,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1115 ldb #m.smask
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1116 stb lsecl,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1117 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1118
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1119 ldb #numdrvs
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1120 leax sec0fl,u clean recal flags
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1121 clnrecal
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1122 clr ,x+
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1123 decb
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1124 bne clnrecal
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1125
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1126 clrb no errors
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1127 rts
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1128
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1129 ttl sleep for rest of tick. Switch mpak slot if necessary (during HW Access)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1130
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1131
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1132 * entry conditions:
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1133 * U = static storage
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1134 * exit conditions
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1135 * registers preserved
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1136
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1137 doslp
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1138 pshs b,x
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1139
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1140 ifeq MPAK
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1141 tst mpslot,u multipak in use? (1xxxxxxxb = no)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1142 bpl doslp2 hi bit clear, do change
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1143 ldx #1
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1144 os9 F$Sleep wait a while
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1145 bra doslp exit
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1146 doslp2 ldb mpstor,u get back old mpak sel value
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1147 stb >mpsel put it to mpak
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1148 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1149
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1150 ldx #1
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1151 os9 F$Sleep wait a while
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1152
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1153 ifeq MPAK
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1154 ldb >mpsel get current value (could have changed)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1155 stb mpstor,u save it again
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1156 andb #m.mpscs clear scs bits
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1157 orb mpslot,u add in scs select
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1158 stb >mpsel put it to mpak
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1159 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1160
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1161 doslpo
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1162 puls b,x,pc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1163
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1164
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1165 ttl setup and initiate command
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1166
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1167 * entry conditions:
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1168 * Y = path descriptor
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1169 * A = opcode to controller
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1170 * B = MSB of disk logical sector number
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1171 * X = LSB's of disk logical sector number
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1172 * U = static storage
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1173 *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1174 * setup command packet
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1175 * select controller
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1176 * initiate command
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1177 *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1178 * exit conditions:
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1179 * A = destroyed
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1180 * B = destroyed
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1181 * X = controller base
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1182 * U = unchanged (static)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1183 * Y = unchanged (PD)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1184 *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1185 setup
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1186 set0
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1187 ifne HOG
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1188 tst plocked,u critical lock on this section
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1189 beq set02
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1190 * sleep was inline, now call
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1191 bsr doslp sleep for a while
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1192 bra set0 and check again
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1193 set02 com plocked,u set the lock
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1194 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1195
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1196 sta opcode,u put controller opcode into command packet
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1197 stb lun,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1198 stx lsn,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1199 lda PD.DNS,y get physical drive number (0 or 1 supported) and init flag
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1200 tfr a,b
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1201 anda #m.phys (bit 5 is physical drive number)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1202 andb #m.init
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1203 beq set25 skip init if not set in desc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1204
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1205 * changed 4-16-96, always check for init, based on descriptor
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1206 *was ifne ADAPTEC adaptec handles drive parameter switches internally
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1207
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1208 cmpa lastphy,u current physical drive?
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1209 beq set25 yes, continue
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1210
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1211 pshs a,y
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1212 sta lastphy,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1213 ldx V.PORT,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1214
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1215 * wait for controller to finish any previous command
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1216 * needs x set to port base and y set to pd
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1217
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1218 ldb #m.busy busy status bit
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1219 sel1 bitb statpo,x read status port
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1220
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1221 ifeq HOG
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1222
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1223 bne sel1 wait till not busy
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1224
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1225 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1226
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1227 beq sel1b skip if not busy
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1228 bsr doslp
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1229 bra sel1
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1230
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1231 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1232
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1233 sel1b lda PD.DNS,y controller number (lower 4 bits of PD.DNS var)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1234 anda #m.cont isolate controller number
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1235 sta datapo,x latch the controller select
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1236 sta selpo,x generate a select strobe
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1237 sel2 bitb statpo,x read status port
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1238 beq sel2 wait for controller to recognize select
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1239
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1240 ifne DISTO
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1241 sta selrst,x reset select (scuzzie version)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1242 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1243
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1244 lda lastphy,u get drive back
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1245 leay param,U Point to Drive 0 Params as Default
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1246 tsta Is it Drive 0?
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1247 beq setp2 yes, get drive 0 parameters
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1248 leay param1-param,Y Point to Drive 1 Params
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1249 setp2 lda #m.req
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1250 setp3 bita statpo,x get status
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1251 beq setp3 wait till ready
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1252 lda #o.param set param command
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1253 sta datapo,x send it out
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1254 ldb #5 rest of packet
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1255 clra
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1256 pakout sta datapo,x dump em out!
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1257 decb
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1258 bne pakout if not done
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1259 lda #m.req
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1260 setp4 bita statpo,x
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1261 beq setp4
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1262 ldb #8 # of parameters to send out
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1263 paramout lda ,y+ get a parameter
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1264 sta datapo,x send it out
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1265 decb
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1266 bne paramout if not done, go again
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1267
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1268 ifeq DISTO
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1269 setp5 ldb statpo,x get status bits
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1270 andb #m.nnc strip floating bits
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1271 cmpb #m.req+m.busy+m.cmd+m.in
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1272 bne setp5
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1273 lda datapo,x status data byte
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1274 setp6 ldb statpo,x get status bits
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1275 andb #m.nnc strip floating bits
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1276 cmpb #m.req+m.busy+m.msg+m.cmd+m.in
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1277 bne setp6
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1278
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1279 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1280
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1281 ldb #m.req+m.busy+m.cmd+m.in
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1282 setp5 cmpb statpo,x get status
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1283 bne setp5
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1284 lda datapo,x status data byte
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1285 ldb #m.req+m.busy+m.msg+m.cmd+m.in
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1286 setp6 cmpb statpo,x
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1287 bne setp6 get term byte
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1288
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1289 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1290
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1291 ldb datapo,x discard
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1292 puls a,Y
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1293
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1294 set25
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1295 ora lun,u or in physical drive with sector number top 8 of 24 bits
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1296 sta lun,u and put it back in place
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1297 lda PD.STP,y get step and options
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1298 sta control,u to the packet
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1299 lda PD.DRV,y drive # from path descriptor
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1300 lsla byte to word offset
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1301 leax offsd1,u base of offsets
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1302 ldd a,x get offset
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1303 addd lun,u add in top 16 of 24 bit sector number
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1304 std lun,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1305 ldx V.PORT,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1306
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1307 * wait for controller to finish any previous command
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1308 * needs x set to port base and y set to pd
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1309
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1310 set26 ldb #m.busy busy status bit
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1311 sel3 bitb statpo,x read status port
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1312
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1313 ifeq HOG
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1314
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1315 bne sel3 wait till not busy
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1316
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1317 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1318
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1319 beq sel3b skip ahead if not busy
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1320 lbsr doslp
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1321 bra sel3
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1322
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1323 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1324
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1325 sel3b lda PD.DNS,y controller number (lower 4 bits of PD.DNS var)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1326 anda #m.cont isolate controller number
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1327 sta datapo,x latch the controller select
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1328 sta selpo,x generate a select strobe
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1329 sel4 bitb statpo,x read status port
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1330 beq sel4 wait for controller to recognize select
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1331
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1332 ifne DISTO
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1333 sta selrst,x reset select (scuzzie version)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1334 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1335
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1336 ttl send command packet
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1337 * sends the command packet to the disk controller
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1338 * needs x set to V.PORT
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1339
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1340 taskout pshs y
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1341 leay packet,u address of scsi packet
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1342 ldb #6 number of bytes to transfer
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1343 task00 lda #m.req
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1344 task0 bita statpo,x
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1345 beq task0
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1346
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1347 * ifeq H6309
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1348 *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1349 * orcc #%01010000
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1350 * ldw #6
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1351 * tfm y+,x
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1352 * andcc #%10101111
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1353 *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1354 * else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1355
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1356 task1 lda ,y+ get a byte from the packet
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1357 sta datapo,x send it to the controller
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1358 decb count the bytes
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1359
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1360 ifeq DBHS
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1361 bne task00 need to check req again
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1362 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1363 bne task1
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1364 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1365
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1366 * endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1367
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1368 ifne HOG
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1369 clr plocked,u clear critical section lock
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1370 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1371
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1372 puls y,pc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1373
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1374 ifeq CANFORM
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1375
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1376 ttl format the drive
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1377
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1378 * format
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1379 *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1380 * Called by setstat. Entire drive will be formatted.
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1381 *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1382 FORMAT ldd R$U,X Get Track Number
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1383 lbne nofrmerr If Not Zero We are Done
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1384 ldd R$Y,X get sides
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1385 tsta
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1386 lbne nofrmerr
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1387
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1388 ifeq MPAK
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1389 pshs b
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1390 tst mpslot,u multipak in use? (1xxxxxxxb = no)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1391 bmi slotf2 hi bit set, skip change
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1392 ldb >mpsel get current value
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1393 stb mpstor,u save it
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1394 andb #m.mpscs clear scs bits
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1395 orb mpslot,u add in scs select
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1396 stb >mpsel put it to mpak
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1397 slotf2
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1398 puls b
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1399 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1400
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1401 tfr D,X Set LSB's of Track # to Zero
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1402
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1403 lda PD.ILV,y get drive interleave
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1404 *sta >$ff68 DEBUG
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1405 sta blocks,u put into packet (in place of blocks, restored below)
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1406
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1407 * deal with the drive offset, needs to be zeroed for unit format
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1408 pshs y
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1409 * nitros adj
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1410
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1411 ifeq H6309
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1412 lda PD.DRV+2,y
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1413 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1414 lda PD.DRV,y
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1415 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1416
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1417 lsla drive to index
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1418 leax offsd1,u offset table
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1419 stx tempw1,u save the offset location
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1420 ldy a,x
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1421 sty tempw2,u save the offset value
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1422 ldy #0
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1423 sty a,x set the offset temporarily to 0
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1424 puls y
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1425
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1426 ifne HOG
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1427 format0 tst plocked,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1428 beq format1
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1429 lbsr doslp
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1430 bra format0
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1431 com plocked,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1432 format1
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1433 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1434
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1435 lda #o.formt Get Format Command
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1436 clrb sector high byte
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1437 ldx #0 sector low word
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1438 lbsr setup
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1439
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1440 * restore the original offset
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1441
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1442 pshs x
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1443 ldx tempw1,u offset loc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1444 ldd tempw2,u offset value
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1445 std ,x put it back in the table
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1446 puls x
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1447
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1448 lda #1
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1449 sta blocks,u put 1 back to blocks
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1450
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1451 ifeq DISTO
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1452 format2 ldb statpo,x get status bits
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1453 andb #m.nnc strip floating bits
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1454 cmpb #m.req+m.busy+m.cmd+m.in
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1455 beq format2b
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1456 lbsr doslp
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1457 bra format2
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1458 format2b lda datapo,x status data byte
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1459 format3 ldb statpo,x get status bits
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1460 andb #m.nnc strip floating bits
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1461 cmpb #m.req+m.busy+m.msg+m.cmd+m.in
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1462 bne format3
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1463
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1464 else
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1465
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1466 ldb #m.req+m.busy+m.cmd+m.in
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1467 format2 cmpb statpo,x get status
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1468 beq format2b
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1469 lbsr doslp
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1470 bra format2
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1471 format2b lda datapo,x status data byte
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1472 ldb #m.req+m.busy+m.msg+m.cmd+m.in
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1473 format3 cmpb statpo,x
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1474 bne format3 get term byte
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1475
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1476 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1477
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1478 ldb datapo,x discard
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1479 anda #m.error
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1480 beq nofrmerr format sucessful
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1481 comb indicate error
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1482 ldb #E$Write
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1483 bra formato
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1484
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1485 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1486
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1487 nofrmerr clrb
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1488 formato
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1489 ifeq MPAK
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1490 pshs a,cc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1491 lda mpstor,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1492 sta >mpsel restore old mpak slot value
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1493 puls a,cc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1494 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1495
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1496 ifne HOG
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1497 clr plocked,u
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1498 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1499
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1500 rts
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1501
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1502 SETSTA ldx PD.RGS,y find the stacked values
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1503 cmpb #SS.Reset
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1504 beq nofrmerr
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1505
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1506 ifeq CANFORM
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1507
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1508 cmpb #SS.WTrk is it the format command?
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1509 bne noformat
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1510
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1511 * is it ok to format this drive?
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1512 lda PD.DNS,y
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1513 anda #m.format
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1514 lbne format
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1515 noformat
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1516 endc
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1517
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1518 GETSTA comb
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1519 ldb #E$UnkSvc unknown service request
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1520 rts
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1521
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1522 TERM equ nofrmerr
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1523
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1524 emod
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1525 endmod equ *
d76cc2119c4f Bob Brose's driver for TC^3 Controller -- Thanks Bob!
boisy
parents:
diff changeset
1526 end