-
Notifications
You must be signed in to change notification settings - Fork 85
/
map
165 lines (165 loc) · 2.01 KB
/
map
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
.PAGE 'NEWMAP'
;
; BUILD A NEW MAP ON DISKETTE
;
NEWMAP
JSR SETBMP
JSR CLRBAM
JSR SETBJ
;
; SET NEW BAM, CALLED BY VERDIR
;
NEWMPV
JSR SETH
JSR JOB2X
LDA BAMTRK
STA HDRS+2,X
LDA BAMSEC
STA HDRS+3,X
LDY LOTRK
LDA #1
STA TRACK
STA (BMPNT),Y
LDA #1
STA R0
NM40
JSR MBAM ; DO A BAM MULTIPLY
BCS NM45
TAY
CLC
ADC BAMSIZ
BEQ NM50
BCC NM50
NM45
JSR BAMOUT ; WRITE THE BAM OUT
JSR CLRBAM
LDY LOTRK
LDA TRACK
STA (BMPNT),Y
JSR JOB2X
LDY R0
LDA BAMTRK,Y
STA HDRS+2,X
LDA BAMSEC,Y
STA HDRS+3,X
INC R0
JSR MBAM
NM50
STY R1
LDA TRACK
JSR MAXSEC
STA LSTSEC
LDA #0
STA SECTOR
NM60
LDA R1
JSR FREUS2 ; MARK THE BAM
JSR FRETS2
INC SECTOR
LDA SECTOR
CMP LSTSEC
BCC NM60
INC TRACK
LDX TRACK
CPX MAXTRK
BCC NM40
JSR BAMOUT
NM70
LDX DRVNUM
LDA #0
STA MDIRTY,X
RTS
;
; BAMOUT - SET LINKS, VERNUM, & WRITE IT
;
BAMOUT
LDA DOS
BNE BAMOU1 ; 8050/8250 BAM ROUTINE
PLA
PLA ; SET STACK FOR PROPER RETURN
RTS
BAMOU1
LDX R0
LDY #0
LDA BAMTRK,X
STA (BMPNT),Y
INY
LDA BAMSEC,X
STA (BMPNT),Y
INY
LDA VERNUM
STA (BMPNT),Y
INY
LDA #0
STA (BMPNT),Y
LDY #HITRK
LDA TRACK
STA (BMPNT),Y
LDA CMDNUM
CMP #VAL
BEQ BMO2
JMP DOWRIT ; WRITE THIS BAM
BMO2
INC BMPNT+1 ; ADVANCE TO NEXT BUFFER
RTS
.PAGE 'MAPOUT'
;
; WRITE OUT THE BIT MAP TO
; THE DRIVE IN LSTJOB(ACTIVE)
;
MAPOUT
JSR GETACT
TAX
LDA LSTJOB,X
MO10
AND #1
STA DRVNUM
JSR SETBJ
;
; VERIFY THE BAM BLOCK COUNT
; MATCHES THE BITS
;
JSCRBM
JSR SETBMP
LDY DRVNUM
LDA MDIRTY,Y
BNE SB10
RTS
SB10
LDA #0
STA MDIRTY,Y
LDY LOTRK
LDA (BMPNT),Y
MC10
PHA
JSR MBAM2
JSR AVCK
PLA
CLC
ADC #1
PHA ; SAVE TRACK
LDA DOS
BNE MC11 ; 8050/8250 BAM
PLA ; GET TRACK
CMP MAXTRK ; MAX TRACK+1 ON DISK
BEQ MC12 ; DONE, WRITE BAM OUT
BNE MC10
MC11
PLA ; GET TRACK
LDY #HITRK
CMP (BMPNT),Y
BCC MC10
MC12
JMP DOWRIT
.PAGE 'NUMFRE'
;
; CALC THE NUMBER OF FREE BLOCKS ON DRVNUM
;
NUMFRE
LDX DRVNUM
LDA NDBL,X
STA NBTEMP
LDA NDBH,X
STA NBTEMP+1
RTS
.END