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.

255 lines
3.2KB

  1. .PAGE 'TRANSFER'
  2. ;TRANSFER FILENAME FROM CMD TO BUFFER
  3. ; A: STRING SIZE
  4. ; X: STARTING INDEX IN CMDBUF
  5. ; Y: BUFFER #
  6. TRNAME PHA
  7. JSR FNDLMT
  8. JSR TRCMBF
  9. PLA
  10. SEC
  11. SBC STRSIZ
  12. TAX
  13. BEQ TN20
  14. BCC TN20
  15. .SKIP
  16. LDA #$A0
  17. TN10 STA (DIRBUF),Y
  18. INY
  19. DEX
  20. BNE TN10
  21. TN20 RTS
  22. .SKIP 2
  23. ;TRANSFER CMD BUFFER TO OTHER BUFFER
  24. ; USES CURRENT BUFFER PTR
  25. ; LIMIT: ENDING INDEX+1 IN CMD BUF
  26. ; X: STARTING INDEX IN CMD BUF
  27. ; Y: BUFFER #
  28. .SKIP
  29. TRCMBF TYA
  30. ASL A
  31. TAY
  32. LDA BUFTAB,Y
  33. STA DIRBUF
  34. LDA BUFTAB+1,Y
  35. STA DIRBUF+1
  36. LDY #0
  37. ;
  38. TR10 LDA CMDBUF,X
  39. STA (DIRBUF),Y
  40. INY
  41. BEQ TR20
  42. INX
  43. CPX LIMIT
  44. BCC TR10
  45. TR20 RTS
  46. ;
  47. ;
  48. ;FIND THE LIMIT OF THE STRING IN CMDBUF
  49. ; POINTED TO BY X
  50. .SKIP
  51. FNDLMT LDA #0
  52. STA STRSIZ
  53. TXA
  54. PHA
  55. FL05
  56. LDA CMDBUF,X
  57. CMP #',
  58. BEQ FL10
  59. CMP #'=
  60. BEQ FL10
  61. INC STRSIZ
  62. INX
  63. LDA #15
  64. CMP STRSIZ
  65. BCC FL10
  66. CPX CMDSIZ
  67. BCC FL05
  68. FL10 STX LIMIT
  69. PLA
  70. TAX
  71. RTS
  72. .SKIP
  73. .PAGE 'TRNSFR-GETNAM'
  74. ; GET FILE ENTRY FROM DIRECTORY
  75. ; CALLED BY STDIR, GETDIR
  76. GETNAM LDA SA ;SAVE VARIABLES
  77. PHA
  78. LDA LINDX
  79. PHA
  80. JSR GNSUB
  81. PLA ;RESTORE VARIABLES
  82. STA LINDX
  83. PLA
  84. STA SA
  85. RTS
  86. .SKIP
  87. GNSUB LDA #IRSA
  88. STA SA
  89. JSR FNDRCH
  90. JSR GETPNT
  91. LDA ENTFND
  92. BPL GN05 ;MORE FILES
  93. LDA DRVFLG
  94. BNE GN050
  95. JSR MSGFRE ;SEND BLOCKS FREE
  96. CLC ;(C=0): END
  97. RTS ;TERMINATE
  98. .SKIP
  99. GN05 LDA DRVFLG ;(DRVFLG=0):
  100. BEQ GN10 ; SEND FILE NAME
  101. GN050
  102. DEC DRVFLG ;(DRVFLG=-1):NEW DIR
  103. BNE GN051
  104. DEC DRVFLG ;(DRVFLG=-1):
  105. JSR TOGDRV ; SEND BLOCKS FREE
  106. JSR MSGFRE
  107. SEC
  108. JMP TOGDRV
  109. .SKIP
  110. GN051 LDA #0
  111. STA NBTEMP+1
  112. STA DRVFLG ;RESET FLAG
  113. JSR NEWDIR
  114. SEC
  115. RTS
  116. .SKIP
  117. GN10 LDX #DIRLEN ;SET NUMBER BLOCKS
  118. LDY #29 ; & ADJUST SPACING
  119. LDA (DIRBUF),Y
  120. STA NBTEMP+1
  121. BEQ GN12
  122. LDX #DIRLEN-2
  123. GN12 DEY
  124. LDA (DIRBUF),Y
  125. STA NBTEMP
  126. CPX #DIRLEN-2
  127. BEQ GN14
  128. CMP #10
  129. BCC GN14
  130. DEX
  131. CMP #100
  132. BCC GN14
  133. DEX
  134. .SKIP
  135. GN14 JSR BLKNB ;CLEAR NAME BUFFER
  136. .SKIP
  137. LDA (DIRBUF),Y ;SET TYPE CHARS
  138. PHA
  139. ASL A ;(USED IN BCS)
  140. BPL GN15
  141. LDA #'<
  142. STA NAMBUF+1,X
  143. GN15
  144. PLA
  145. AND #$F
  146. TAY
  147. LDA TP2LST,Y
  148. STA NAMBUF,X
  149. DEX
  150. LDA TP1LST,Y
  151. STA NAMBUF,X
  152. DEX
  153. LDA TYPLST,Y
  154. STA NAMBUF,X
  155. DEX
  156. DEX
  157. BCS GN20 ;(FROM ASL)
  158. LDA #'* ;FILE NOT CLOSED
  159. STA NAMBUF+1,X
  160. GN20 LDA #$A0
  161. STA NAMBUF,X
  162. DEX
  163. LDY #18
  164. GN22 LDA (DIRBUF),Y
  165. STA NAMBUF,X
  166. DEX
  167. DEY
  168. CPY #3
  169. BCS GN22
  170. .SKIP
  171. LDA #'" ;SEND NAME IN QUOTES
  172. STA NAMBUF,X
  173. GN30 INX
  174. CPX #$20
  175. BCS GN35
  176. LDA NAMBUF,X
  177. CMP #'"
  178. BEQ GN35
  179. CMP #$A0
  180. BNE GN30
  181. GN35 LDA #'"
  182. STA NAMBUF,X
  183. GN37 INX
  184. CPX #$20
  185. BCS GN40
  186. LDA #$7F
  187. AND NAMBUF,X
  188. STA NAMBUF,X
  189. BPL GN37
  190. .SKIP
  191. GN40 JSR FNDFIL
  192. SEC
  193. GN45 RTS
  194. .SKIP
  195. BLKNB LDY #NBSIZ ;BLANK NAMBUF
  196. LDA #$20
  197. BLKNB1 STA NAMBUF-1,Y
  198. DEY
  199. BNE BLKNB1
  200. RTS
  201. .SKIP
  202. ;NEW DIRECTORY IN LISTING
  203. NEWDIR
  204. JSR BAM2X
  205. JSR REDBAM
  206. JSR BLKNB
  207. LDA #$FF
  208. STA TEMP
  209. LDX DRVNUM
  210. STX NBTEMP
  211. LDA #0
  212. STA NBTEMP+1
  213. LDX JOBNUM
  214. LDA BUFIND,X
  215. STA DIRBUF+1
  216. LDA DSKNAM
  217. STA DIRBUF
  218. LDY #22
  219. .SKIP
  220. ND10 LDA (DIRBUF),Y
  221. CMP #$A0
  222. BNE ND20
  223. LDA #'1 ;VERSION # 1
  224. .BYTE $2C
  225. ND15
  226. LDA (DIRBUF)Y
  227. CMP #$A0
  228. BNE ND20
  229. ;
  230. LDA #$20
  231. ND20
  232. STA NAMBUF+2,Y
  233. DEY
  234. BPL ND15
  235. LDA #$12
  236. STA NAMBUF
  237. LDA #'"
  238. STA NAMBUF+1
  239. STA NAMBUF+18
  240. LDA #$20
  241. STA NAMBUF+19
  242. RTS
  243. .SKIP
  244. MSGFRE JSR BLKNB
  245. LDY #MSGLEN-1
  246. MSG1 LDA FREMSG,Y
  247. STA NAMBUF,Y
  248. DEY
  249. BPL MSG1
  250. JMP NUMFRE
  251. .SKIP
  252. FREMSG .BYTE 'BLOCKS FREE.'
  253. MSGLEN =*-FREMSG
  254. .END