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.

verdir 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. .PAGE 'VER-DIR'
  2. ; VALIDATE FILES WITH BAM
  3. ; CREATE NEW BAM ACCORDING TO
  4. ; CONTENTS OF FILES ENTERED IN DIR
  5. .SKIP
  6. VERDIR
  7. VALDAT
  8. ;VALIDATE IS SOFT-LOAD
  9. JSR SIMPRS ;EXTRACT DRIVE #
  10. JSR INITDR
  11. LDA #$40
  12. STA WBAM
  13. JSR NEWMPV ;SET NEW BAM
  14. LDA #0
  15. STA DELIND
  16. JSR SRCHST ;SEARCH FOR FIRST FILE
  17. BNE VD25 ;FOUND ONE
  18. .SKIP
  19. VD10 LDA #0 ;SET DIRECTORY SECTORS...
  20. STA SECTOR ;...IN BAM
  21. LDA DIRTRK
  22. STA TRACK
  23. JSR VMKBAM
  24. LDA #0
  25. STA WBAM
  26. JSR SCRBAM ;WRITE OUT BAMS
  27. JMP ENDCMD
  28. .SKIP
  29. VD15 INY
  30. LDA (DIRBUF),Y
  31. PHA ;SAVE TRACK
  32. INY
  33. LDA (DIRBUF),Y
  34. PHA ;SAVE SECTOR
  35. LDY #19 ;GET SS TRACK
  36. LDA (DIRBUF),Y ;IS THIS RELATIVE ?
  37. BEQ VD17 ;NO
  38. STA TRACK ;YES - SAVE TRACK
  39. INY
  40. LDA (DIRBUF),Y ;GET SS SECTOR
  41. STA SECTOR
  42. JSR VMKBAM ;VALIDATE SS BY LINKS
  43. VD17 PLA
  44. STA SECTOR ;NOW DO DATA BLOCKS
  45. PLA
  46. STA TRACK
  47. JSR VMKBAM ;SET BIT USED IN BAM
  48. VD20 JSR SRRE ;SEARCH FOR MORE
  49. BEQ VD10 ;NO MORE FILES
  50. VD25
  51. LDY #0
  52. LDA (DIRBUF),Y
  53. BMI VD15
  54. JSR DELDIR ;NOT CLOSED DELETE DIR
  55. JMP VD20
  56. ;
  57. VMKBAM ;MARK BAM WITH FILE SECTORS
  58. JSR TSCHK
  59. JSR WUSED
  60. JSR OPNIRD
  61. MRK2 LDA #0
  62. JSR SETPNT
  63. JSR GETBYT
  64. STA TRACK
  65. JSR GETBYT
  66. STA SECTOR
  67. LDA TRACK
  68. BNE MRK1
  69. JMP FRECHN
  70. MRK1 JSR WUSED
  71. JSR NXTBUF
  72. JMP MRK2
  73. ;
  74. .END