-
Notifications
You must be signed in to change notification settings - Fork 82
/
setdrv
111 lines (111 loc) · 2.19 KB
/
setdrv
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
.PAGE 'SET DRIVE'
;SET 1ST DRIVE AND TABLE POINTERS
ONEDRV LDA F2CNT
STA F1CNT
LDA #1
STA F2CNT
STA F2PTR
.SKIP
;SET UP ALL DRIVES FROM F2CNT
ALLDRS LDY LSTDRV ;SET UP DRIVE #'S...
LDX #0 ;...INTO FILE ENTRY TABLE...
AD10 STX F1PTR ;...ON SECTOR PTR BYTE
LDA FILTBL,X
JSR SETDRV
LDX F1PTR
STA FILTBL,X ;INCR PTR PAST ":"
TYA ;BITS REP DRIVES
STA FILDRV,X ;BIT7: DEFAULT
INX ;BIT0: DRIVE #
CPX F2CNT
BCC AD10
RTS
.SKIP
;SET DRIVE NUMBER
; DETERMINES DRIVE # FROM TEXT OR
; USES DEFAULT (-D)
; A: IN,OUT: INDEX, CMDBUF
; Y: IN: DEFAULT DRIVE!!!!!!!!!!!!!!!!!!!!!!!!!!!!
; OUT: DRIVE NUMBER, - IF DEFAULT
.SKIP
SETDRV TAX ;X= CMDBUF INDEX
LDY #0 ;SET DEFAULT DRIVE TO ZERO!!!!!!!!!!!!!!!!!!!!!
LDA #':
CMP CMDBUF+1,X ;FOR XXX:FILE
BEQ SD40 ; ^
CMP CMDBUF,X ;FOR XXX:FILE
BNE SD50 ; ^
INX ;FOUND ":", SO...
SD20 TYA ;DRIVE= DEFAULT
SD22 AND #1 ;CONVERT TO NUMERIC
SD24 TAY ;RESTORE DRIVE
TXA ;A=INDEX & XXXXFILE
RTS ; ^
.SKIP 2
SD40 LDA CMDBUF,X
INX ; XXX:FILE
INX ; --^
CMP #'0 ;FOR XX0:FILE
BEQ SD22 ; ^
CMP #'1 ;FOR XX1:FILE
BEQ SD22 ; ^
BNE SD20 ;CMD:FILE OR XX,:FILE
SD50 =* ; ^ ^
TYA ;FOR XXX,FILE OR XX=FILE
ORA #$80 ; ^ ^
AND #$81 ;DRIVE= -DEFAULT
BNE SD24 ;FINISH TESTING
.SKIP
;SET DRIVE FROM ANY CONFIG.
SETANY LDA #0
STA IMAGE
LDY FILTBL
SA05 LDA (CB),Y
JSR TST0V1
BPL SA20
INY
CPY CMDSIZ
BCS SA10
LDY CMDSIZ
DEY
BNE SA05
SA10 DEC IMAGE
LDA #0 ;DEFAULT TO ZERO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
SA20 AND #1
STA DRVNUM
JMP SETLDS
;TOGGLE DRVNUM
TOGDRV LDA DRVNUM
EOR #1
AND #1
STA DRVNUM
RTS
.SKIP
;SET PTRS TO ONE FILE STREAM & CHK TYPE
FS1SET LDY #0
LDA F1CNT
CMP F2CNT
BEQ FS15
DEC F2CNT
LDY F2CNT
LDA FILTBL,Y
TAY
LDA (CB),Y
LDY #NTYPES-1
FS10 CMP TYPLST,Y
BEQ FS15
DEY
BNE FS10
FS15 TYA
STA TYPFLG
RTS
.SKIP
;TEST CHAR IN ACCUM FOR "0" OR "1"
TST0V1 CMP #'0
BEQ T0V1
CMP #'1
BEQ T0V1
ORA #$80
T0V1 AND #$81
RTS
.END