-
Notifications
You must be signed in to change notification settings - Fork 84
/
new
97 lines (97 loc) · 1.88 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
.PAGE 'NEW'
;NEW: INITIALIZE A DISK, DISK IS
; SOFT-SECTORED, BIT AVAIL. MAP,
; DIRECTORY, & 1ST BLOCK ARE ALL INITED
.SKIP
NEW JSR ONEDRV
LDA FILDRV ;SET UP DRIVE #
BPL N101
LDA #BADFN ;BAD DRIVE # GIVEN
JMP CMDERR
N101 AND #1
STA DRVNUM
JSR SETLDS
.SKIP
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 ;FORMAT DISK****
STA DSKID,X ;STORE IN PROPER DRIVE
LDA CMDBUF+1,Y ;(Y=0)
STA DSKID+1,X
.SKIP
JSR CLRCHN ;CLEAR ALL CHANNELS WHEN FORMATTING
LDA #1 ;...IN TRACK, TRACK=1
STA TRACK
;
;--------- PATCH7 FOR FORMAT BUG 10/17/83---
; JSR FORMAT ;TRANSFER FORMAT TO RAM
JSR PATCH7 ;SET FORMAT FLAG
;-------------------------------------------
;
JSR CLRBAM ;ZERO BAM
JMP N110
.SKIP
N108 JSR INITDR ;CLEAR DIRECTORY ONLY
LDX DRVNUM
LDA DSKVER,X ;USE CURRENT VERSION #
CMP VERNUM
BEQ N110
JMP VNERR ;WRONG VERSION #
N110
JSR NEWMAP ;NEW BAM
.SKIP
LDA JOBNUM
TAY
ASL A
TAX
LDA DSKNAM ;SET PTR TO DISK NAME
STA BUFTAB,X
LDX FILTBL
LDA #27
JSR TRNAME ;TRANSFER CMD BUF TO BAM
.SKIP
LDY #$12
LDX DRVNUM
LDA VERNUM ;SET DOS'S CURRENT FORMAT TYPE
STA DSKVER,X
TXA
ASL A
TAX
LDA DSKID,X ;WRITE DIRECTORY'S I.D.
STA (DIRBUF),Y
INY
LDA DSKID+1,X
STA (DIRBUF),Y
.SKIP
INY
INY
LDA #DOSVER+$30 ;WRITE DIRECTORY DOS VERSION
STA (DIRBUF)Y
INY
LDA VERNUM ;WRITE DIRECTORY FORMAT TYPE
STA (DIRBUF)Y
;
LDY #2
STA (BMPNT),Y ;WRITE DISKETTE'S FORMAT TYPE
LDA DIRTRK
STA TRACK
JSR USEDTS ;SET BAM BLOCK USED
LDA #1
STA SECTOR
JSR USEDTS ;SET 1ST DIR BLOCK USED
JSR SCRBAM ;SCRUB THE BAM
JSR CLRBAM ;SET TO ALL 0'S
LDY #1
LDA #$FF ;SET END LINK
STA (BMPNT)Y
JSR DRTWRT ;CLEAR DIRECTORY
DEC SECTOR
JSR DRTRD ;READ BAM BACK
.SKIP
JMP ENDCMD
.SKIP
.END