-
Notifications
You must be signed in to change notification settings - Fork 87
/
Copy pathmap.src
120 lines (97 loc) · 1.54 KB
/
map.src
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
.page
.subttl map
; build a new map on diskette
newmap
newmpv jsr clnbam
ldy #0
lda #18 ;set link to 18.1
sta (bmpnt),y
iny
tya
sta (bmpnt),y
iny
iny
iny ;.y=4
nm10 lda #0 ;clear track map
sta t0
sta t1
sta t2
tya
lsr a
lsr a ;.a=track #
jsr maxsec
sta (bmpnt),y
iny
tax
nm20 sec ;set map bits
rol t0
rol t1
rol t2
dex
bne nm20
nm30 lda t0,x ;.x=0
sta (bmpnt),y
iny
inx
cpx #3
bcc nm30
cpy #$90 ;end of bam
bcc nm10
jmp nfcalc ;calc # free sectors
; write out the bit map to the drive in lstjob(active)
mapout jsr getact
tax
lda lstjob,x
mo10 and #1
sta drvnum ;check bam before writing
; write bam according to drvnum
scrbam ldy drvnum
lda mdirty,y
bne sb10
rts ;not dirty
sb10 lda #0 ;set to clean bam
sta mdirty,y
jsr setbpt ;set bit map ptr
lda drvnum
asl a
pha
jsr putbam ;put memory images to bam
pla
clc
adc #1
jsr putbam
; verify the bam block count matches the bits
lda track
pha ;save track var
lda #1
sta track
sb20 asl a
asl a
sta bmpnt
jsr avck ;check available blocks
inc track
lda track
cmp maxtrk
bcc sb20
pla ;restore track var
sta track
jmp dowrit ;write it out
.page
; set bit map ptr, read in bam if nec.
setbpt jsr bam2a
tax
jsr redbam ;read bam if not in
ldx jobnum
lda bufind,x ;set the ptr
sta bmpnt+1
lda #0
sta bmpnt
rts
; calc the number of free blocks on drvnum
numfre ldx drvnum
lda ndbl,x
sta nbtemp
lda ndbh,x
sta nbtemp+1
rts
; .end