-
Notifications
You must be signed in to change notification settings - Fork 84
/
map
125 lines (125 loc) · 1.59 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
.PAGE 'NEWMAP'
.SKIP
;
; 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 ;.X=0
LDA T0,X
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
;PUT MEMORY IMAGES TO BAM
JSR PUTBAM
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 'NUMFRE'
;
; 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