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 1.3KB

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. .SKIP
  31. LDA FILTRK,X ;DELETE BY LINKS
  32. STA TRACK
  33. LDA FILSEC,X
  34. STA SECTOR
  35. JSR DELFIL
  36. .SKIP
  37. SC20 INC R0
  38. SC25 JSR FFRE
  39. BPL SC15
  40. .SKIP
  41. SC30 LDA R0 ;FINISHED, SET
  42. STA TRACK ; FILE COUNT
  43. LDA #1
  44. LDY #0
  45. JMP SCREND ;END OF SCRATCH
  46. .SKIP
  47. DELFIL JSR FRETS ;DELETE FILE BY LINKS
  48. JSR OPNIRD ;UPDATE BAM
  49. JSR BAM2X
  50. LDA BUF0,X
  51. CMP #$FF
  52. BEQ DEL10
  53. LDA WBAM
  54. ORA #$40
  55. STA WBAM
  56. DEL10
  57. DEL2 LDA #0
  58. JSR SETPNT
  59. JSR RDBYT
  60. STA TRACK
  61. JSR RDBYT
  62. STA SECTOR
  63. LDA TRACK
  64. BNE DEL1
  65. JSR MAPOUT
  66. JMP FRECHN
  67. DEL1 JSR FRETS
  68. JSR NXTBUF
  69. JMP DEL2
  70. .SKIP
  71. DELDIR LDY #0 ;DELETE DIR ENTRY
  72. TYA
  73. STA (DIRBUF),Y
  74. JSR WRTOUT
  75. JMP WATJOB
  76. .SKIP
  77. .END