You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

112 lines
2.2KB

  1. .PAGE 'SET DRIVE'
  2. ;SET 1ST DRIVE AND TABLE POINTERS
  3. ONEDRV LDA F2CNT
  4. STA F1CNT
  5. LDA #1
  6. STA F2CNT
  7. STA F2PTR
  8. .SKIP
  9. ;SET UP ALL DRIVES FROM F2CNT
  10. ALLDRS LDY LSTDRV ;SET UP DRIVE #'S...
  11. LDX #0 ;...INTO FILE ENTRY TABLE...
  12. AD10 STX F1PTR ;...ON SECTOR PTR BYTE
  13. LDA FILTBL,X
  14. JSR SETDRV
  15. LDX F1PTR
  16. STA FILTBL,X ;INCR PTR PAST ":"
  17. TYA ;BITS REP DRIVES
  18. STA FILDRV,X ;BIT7: DEFAULT
  19. INX ;BIT0: DRIVE #
  20. CPX F2CNT
  21. BCC AD10
  22. RTS
  23. .SKIP
  24. ;SET DRIVE NUMBER
  25. ; DETERMINES DRIVE # FROM TEXT OR
  26. ; USES DEFAULT (-D)
  27. ; A: IN,OUT: INDEX, CMDBUF
  28. ; Y: IN: DEFAULT DRIVE!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  29. ; OUT: DRIVE NUMBER, - IF DEFAULT
  30. .SKIP
  31. SETDRV TAX ;X= CMDBUF INDEX
  32. LDY #0 ;SET DEFAULT DRIVE TO ZERO!!!!!!!!!!!!!!!!!!!!!
  33. LDA #':
  34. CMP CMDBUF+1,X ;FOR XXX:FILE
  35. BEQ SD40 ; ^
  36. CMP CMDBUF,X ;FOR XXX:FILE
  37. BNE SD50 ; ^
  38. INX ;FOUND ":", SO...
  39. SD20 TYA ;DRIVE= DEFAULT
  40. SD22 AND #1 ;CONVERT TO NUMERIC
  41. SD24 TAY ;RESTORE DRIVE
  42. TXA ;A=INDEX & XXXXFILE
  43. RTS ; ^
  44. .SKIP 2
  45. SD40 LDA CMDBUF,X
  46. INX ; XXX:FILE
  47. INX ; --^
  48. CMP #'0 ;FOR XX0:FILE
  49. BEQ SD22 ; ^
  50. CMP #'1 ;FOR XX1:FILE
  51. BEQ SD22 ; ^
  52. BNE SD20 ;CMD:FILE OR XX,:FILE
  53. SD50 =* ; ^ ^
  54. TYA ;FOR XXX,FILE OR XX=FILE
  55. ORA #$80 ; ^ ^
  56. AND #$81 ;DRIVE= -DEFAULT
  57. BNE SD24 ;FINISH TESTING
  58. .SKIP
  59. ;SET DRIVE FROM ANY CONFIG.
  60. SETANY LDA #0
  61. STA IMAGE
  62. LDY FILTBL
  63. SA05 LDA (CB),Y
  64. JSR TST0V1
  65. BPL SA20
  66. INY
  67. CPY CMDSIZ
  68. BCS SA10
  69. LDY CMDSIZ
  70. DEY
  71. BNE SA05
  72. SA10 DEC IMAGE
  73. LDA #0 ;DEFAULT TO ZERO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  74. SA20 AND #1
  75. STA DRVNUM
  76. JMP SETLDS
  77. ;TOGGLE DRVNUM
  78. TOGDRV LDA DRVNUM
  79. EOR #1
  80. AND #1
  81. STA DRVNUM
  82. RTS
  83. .SKIP
  84. ;SET PTRS TO ONE FILE STREAM & CHK TYPE
  85. FS1SET LDY #0
  86. LDA F1CNT
  87. CMP F2CNT
  88. BEQ FS15
  89. DEC F2CNT
  90. LDY F2CNT
  91. LDA FILTBL,Y
  92. TAY
  93. LDA (CB),Y
  94. LDY #NTYPES-1
  95. FS10 CMP TYPLST,Y
  96. BEQ FS15
  97. DEY
  98. BNE FS10
  99. FS15 TYA
  100. STA TYPFLG
  101. RTS
  102. .SKIP
  103. ;TEST CHAR IN ACCUM FOR "0" OR "1"
  104. TST0V1 CMP #'0
  105. BEQ T0V1
  106. CMP #'1
  107. BEQ T0V1
  108. ORA #$80
  109. T0V1 AND #$81
  110. RTS
  111. .END