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.

scrtch.src 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. .page 'scratch'
  2. ; scratch file(s)
  3. scrtch jsr fs1set ; set up for 1 stream
  4. jsr alldrs
  5. jsr optsch
  6. lda #0
  7. sta r0 ; used as file count
  8. jsr ffst
  9. bmi sc30
  10. sc15 jsr tstchn ; is it active ?
  11. bcc sc25 ; yes - dont scratch
  12. ldy #0
  13. lda (dirbuf),y
  14. and #$40 ; lock bit
  15. bne sc25 ; it's locked
  16. ;
  17. jsr deldir ; delete directory
  18. ldy #19 ; is this a relative ?
  19. lda (dirbuf),y ; has a ss ?
  20. beq sc17 ; no
  21. sta track ; yes - save track
  22. iny
  23. lda (dirbuf),y ; get sector
  24. sta sector
  25. jsr delfil ; delete by links
  26. sc17 ldx entfnd
  27. lda #$20
  28. and pattyp,x
  29. bne sc20 ; created, not closed
  30. lda filtrk,x ; delete by links
  31. sta track
  32. lda filsec,x
  33. sta sector
  34. jsr delfil
  35. sc20 inc r0
  36. sc25 jsr ffre
  37. bpl sc15
  38. sc30 lda r0 ; finished, set
  39. sta track ; file count
  40. lda #1
  41. ldy #0
  42. jmp scrend ; end of scratch
  43. delfil jsr frets ; delete file by links
  44. jsr opnird ; update bam
  45. jsr bam2x
  46. lda buf0,x
  47. cmp #$ff
  48. beq del10
  49. lda wbam
  50. ora #$40
  51. sta wbam
  52. del10
  53. del2 lda #0
  54. jsr setpnt
  55. jsr rdbyt
  56. sta track
  57. jsr rdbyt
  58. sta sector
  59. lda track
  60. bne del1
  61. jsr mapout
  62. jmp frechn
  63. del1 jsr frets
  64. jsr nxtbuf
  65. jmp del2
  66. deldir ldy #0 ; delete dir entry
  67. tya
  68. sta (dirbuf),y
  69. jsr wrtout
  70. jmp watjob
  71. ; .end