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.

setdrv.src 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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. ;set up all drives from f2cnt
  9. alldrs ldy lstdrv ; set up drive #'s...
  10. ldx #0 ; ...into file entry table...
  11. ad10 stx f1ptr ; ...on sector ptr byte
  12. lda filtbl,x
  13. jsr setdrv
  14. ldx f1ptr
  15. sta filtbl,x ; incr ptr past ":"
  16. tya ; bits rep drives
  17. sta fildrv,x ; bit7: default
  18. inx ; bit0: drive #
  19. cpx f2cnt
  20. bcc ad10
  21. rts
  22. ;set drive number
  23. ; determines drive # from text or
  24. ; uses default (-d)
  25. ; a: in,out: index, cmdbuf
  26. ; y: in: default drive!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  27. ; out: drive number, - if default
  28. setdrv tax ; x= cmdbuf index
  29. ldy #0 ; set default drive to zero!!!!!!!!!!!!!!!!!!!!!
  30. lda #':
  31. cmp cmdbuf+1,x ; for xxx:file
  32. beq sd40 ; ~
  33. cmp cmdbuf,x ; for xxx:file
  34. bne sd50 ; ~
  35. inx ; found ":", so...
  36. sd20 tya ; drive= default
  37. sd22 and #1 ; convert to numeric
  38. sd24 tay ; restore drive
  39. txa ; a=index & xxxxfile
  40. rts ; ~
  41. sd40 lda cmdbuf,x
  42. inx ; xxx:file
  43. inx ; --~
  44. cmp #'0 ; for xx0:file
  45. beq sd22 ; ~
  46. cmp #'1 ; for xx1:file
  47. beq sd22 ; ~
  48. bne sd20 ; cmd:file or xx,:file
  49. sd50 =* ; ~ ~
  50. tya ; for xxx,file or xx=file
  51. ora #$80 ; ~ ~
  52. and #$81 ; drive= -default
  53. bne sd24 ; finish testing
  54. ;set drive from any config.
  55. setany lda #0
  56. sta image
  57. ldy filtbl
  58. sa05 lda (cb),y
  59. jsr tst0v1
  60. bpl sa20
  61. iny
  62. cpy cmdsiz
  63. bcs sa10
  64. ldy cmdsiz
  65. dey
  66. bne sa05
  67. sa10 dec image
  68. lda #0
  69. ;default to zero!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  70. sa20 and #1
  71. sta drvnum
  72. jmp setlds
  73. ;toggle drvnum
  74. togdrv lda drvnum
  75. eor #1
  76. and #1
  77. sta drvnum
  78. rts
  79. ;set ptrs to one file stream & chk type
  80. fs1set ldy #0
  81. lda f1cnt
  82. cmp f2cnt
  83. beq fs15
  84. dec f2cnt
  85. ldy f2cnt
  86. lda filtbl,y
  87. tay
  88. lda (cb),y
  89. ldy #ntypes-1
  90. fs10 cmp typlst,y
  91. beq fs15
  92. dey
  93. bne fs10
  94. fs15 tya
  95. sta typflg
  96. rts
  97. ;test char in accum for "0" or "1"
  98. tst0v1 cmp #'0
  99. beq t0v1
  100. cmp #'1
  101. beq t0v1
  102. ora #$80
  103. t0v1 and #$81
  104. rts
  105. ; .end