-
Notifications
You must be signed in to change notification settings - Fork 1
/
loader_drive_1bit1581.inc
54 lines (43 loc) · 1.18 KB
/
loader_drive_1bit1581.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
.print ". 1581 serial 1 bit loader"
.namespace iolib {
.namespace serial1bit1581 {
.pseudopc $0500 {
.var drive_serial = true
.var ledinverted = false
#import "loader_drive_core.inc"
#import "loader_drive_1bitserial.inc"
.label blk4job = $06
.label blk4trk = $13
.label blk4sec = $14
.label drv0id1 = $1d
.label drv0id2 = $1e
.label bitbuff = $5e
.label hdrid1 = $1d
.label hdrid2 = $1e
.label retrycnt = $5f
// serial bus bits are inverted!
// default value %01010000
// Bit 7 ATN IN
// Bit 6 0 = Write protect active
// Bit 5 Data Direction of the Bus Driver (FSM)
// 0 = Input, 1 = Output
// Bit 4 automatic ATN-Response
// Bit 3 CLOCK OUT
// Bit 2 CLOCK IN
// Bit 1 DATA OUT
// Bit 0 DATA IN
.label serialdata = $4001
.label ledport = $79
.const ledvalue = %01000000
.label blk4buf = $0700
.const dirsect = 3
.label dirtrack = $022b
driveload(init, dirtrack, dirsect, blk4trk, blk4sec, blk4job, blk4buf, retrycnt, hdrid1, hdrid2, drv0id1, drv0id2, readbyte, writebyte, ledport, ledvalue, serialdata, drive_serial, ledinverted)
init: driveserial1bitinit(serialdata)
readbyte:
driveserial1bitread(serialdata, bitbuff)
writebyte:
driveserial1bitwrite(serialdata, bitbuff)
}
}
}