-
Notifications
You must be signed in to change notification settings - Fork 84
/
new
100 lines (100 loc) · 1.48 KB
/
new
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
.PAGE 'NEW'
;NEW: INITIALIZE A DISK, DISK IS
; SOFT-SECTORED, BIT AVAIL. MAP,
; DIRECTORY, & 1ST BLOCK ARE ALL INITED
.SKIP
NEW JSR ONEDRV
LDA FILDAT ;SET UP DRIVE #
BPL N101
LDA #BADFN
JMP CMDERR
N101 AND #1
STA DRVNUM
JSR SETLDS
.SKIP
JSR SETBMP
LDA DRVNUM
ASL A
TAX
LDY FILTBL+1 ;GET DISK ID
CPY CMDSIZ ;?IS THIS NEW OR CLEAR?
BEQ N108 ;END OF CMD STRING
LDA CMDBUF,Y
STA DSKID,X ;STORE IN PROPER DRIVE
LDA CMDBUF+1,Y ;(Y=0)
STA DSKID+1,X
.SKIP
LDA #1 ;...IN TRACK, TRACK=1
STA TRACK
JSR FORMAT ;TRANSFER FORMAT TO RAM
JMP N110
.SKIP
N108 JSR INITDR
LDY #2
LDA (BMPNT)Y ;USE CURRENT VERSION #
CMP VERNUM
BEQ N110
JMP VNERR
N110
LDA #0
TAY
.SKIP
N111 STA (BMPNT)Y ;CLEAR BUFFER
INY
BNE N111
.SKIP
LDA DRVNUM
CLC
ADC #BAMJOB ;BUF #13 + DRVNUM
STA JOBNUM
ASL A
TAX
LDA #$90
STA BUFTAB,X
.SKIP
LDY #1
STY SECTOR
LDA #$FF
STA (BMPNT)Y
LDA #18
STA TRACK
;
JSR DRTWRT ;CLEAR DIRECTORY
.SKIP
JSR NEWMAP ;NEW BAM
LDY #2
LDA VERNUM
STA (BMPNT)Y ;SET VERSION #
.SKIP
JSR USEDTS ;USE 18.1
DEC SECTOR
JSR USEDTS ;USE 18.0
.SKIP
LDY JOBNUM
LDX FILTBL
LDA #27
JSR TRNAME ;TRANSFER CMD BUF TO BUF0
.SKIP
LDY #$12
LDA DRVNUM ;SET UP CURRENT I.D.
ASL A
TAX
LDA DSKID,X
STA (DIRBUF),Y
INY
LDA DSKID+1,X
STA (DIRBUF),Y
.SKIP
INY
INY
LDA #DOSVER+$30
STA (DIRBUF)Y
INY
LDA VERNUM ;SHOW VER #
STA (DIRBUF)Y
.SKIP
JSR DRTWRT ;WRITE IT OUT
.SKIP
JMP ENDCMD
.SKIP
.END