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.

tsutil.src 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. .page 'tsutil'
  2. ;*
  3. ;*
  4. ;*********************************
  5. ;*
  6. ;* scrub
  7. ;*
  8. ;* write out buffer if dirty
  9. ;*
  10. ;*********************************
  11. ;*
  12. ;*
  13. scrub
  14. jsr gaflgs
  15. bvc scr1 ; not dirty
  16. ;
  17. jsr wrtout
  18. jsr watjob
  19. scr1 rts
  20. ;*
  21. ;*
  22. ;*********************************
  23. ;*
  24. ;* setlnk
  25. ;*
  26. ;* put track,sector into buffer
  27. ;*
  28. ;*********************************
  29. ;*
  30. ;*
  31. setlnk jsr set00
  32. ;
  33. lda track
  34. sta (dirbuf),y
  35. iny
  36. lda sector
  37. sta (dirbuf),y
  38. jmp sdirty
  39. ;
  40. ;*
  41. ;*
  42. ;********************************
  43. ;*
  44. ;* getlnk
  45. ;*
  46. ;* get link from buffer into
  47. ;* track and sector
  48. ;*
  49. ;********************************
  50. ;*
  51. ;*
  52. getlnk jsr set00
  53. ;
  54. lda (dirbuf),y
  55. sta track
  56. iny
  57. lda (dirbuf),y
  58. sta sector
  59. rts
  60. ;*
  61. ;*
  62. ;********************************
  63. ;*
  64. ;* nullnk
  65. ;*
  66. ;* set track link=0 & sector
  67. ;* link=last non-zero char.
  68. ;*
  69. ;*********************************
  70. ;*
  71. ;*
  72. nullnk
  73. jsr set00
  74. lda #0
  75. sta (dirbuf),y
  76. iny
  77. ldx lindx
  78. lda nr,x
  79. tax
  80. dex
  81. txa
  82. sta (dirbuf),y
  83. rts
  84. ;
  85. ;*
  86. ;*
  87. ;*******************************
  88. ;*
  89. ;* set00
  90. ;*
  91. ;* setup up pointer to buffer
  92. ;*
  93. ;*******************************
  94. ;*
  95. ;*
  96. set00 jsr getact
  97. asl a
  98. tax
  99. lda buftab+1,x
  100. sta dirbuf+1
  101. lda #0
  102. sta dirbuf
  103. ldy #0
  104. rts
  105. ;
  106. ;*
  107. ;*
  108. ;*******************************
  109. ;*
  110. ;* gethdr
  111. ;*
  112. ;* read track,setor from header
  113. ;*
  114. ;*******************************
  115. ;*
  116. ;*
  117. curblk jsr fndrch
  118. gethdr jsr getact
  119. sta jobnum
  120. asl a
  121. tay
  122. lda hdrs,y ; 4/12**************
  123. sta track
  124. lda hdrs+1,y ; 4/12**************
  125. sta sector
  126. rts
  127. ;
  128. ;*
  129. ;*
  130. ;******************************
  131. ;*
  132. ;* wrtab,rdab wrtout,rdin
  133. ;* wrtss,rdss
  134. ;*
  135. ;******************************
  136. ;*
  137. ;*
  138. wrtab lda #write
  139. sta cmd
  140. bne sj10
  141. ;
  142. rdab lda #read
  143. sta cmd
  144. bne sj10
  145. ;
  146. wrtout lda #write
  147. sta cmd
  148. bne sj20
  149. ;
  150. rdin lda #read
  151. sta cmd
  152. bne sj20
  153. ;
  154. wrtss lda #write
  155. sta cmd
  156. bne rds5
  157. ;
  158. rdss lda #read
  159. rds5 sta cmd
  160. ldx lindx
  161. lda ss,x
  162. tax
  163. bpl sj30 ; was...bne sj30
  164. ;
  165. sj10 jsr sethdr
  166. jsr getact
  167. tax
  168. lda drvnum
  169. sta lstjob,x
  170. sj20 jsr cdirty
  171. jsr getact
  172. tax
  173. sj30 jmp setljb
  174. ;*
  175. ;*
  176. ;*
  177. ;***************************
  178. ;*
  179. ;* rdlnk
  180. ;*
  181. ;***************************
  182. ;*
  183. ;*
  184. rdlnk lda #0
  185. jsr setpnt
  186. jsr getbyt
  187. sta track
  188. jsr getbyt
  189. sta sector
  190. rts
  191. ;
  192. ;.end