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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. .PAGE 'NEWMAP'
  2. .SKIP
  3. ;
  4. ; BUILD A NEW MAP ON DISKETTE
  5. ;
  6. NEWMAP
  7. NEWMPV
  8. JSR CLNBAM
  9. LDY #0
  10. LDA #18 ;SET LINK TO 18.1
  11. STA (BMPNT),Y
  12. INY
  13. TYA
  14. STA (BMPNT),Y
  15. INY
  16. INY
  17. INY ;.Y=4
  18. NM10
  19. LDA #0 ;CLEAR TRACK MAP
  20. STA T0
  21. STA T1
  22. STA T2
  23. ;
  24. TYA
  25. LSR A
  26. LSR A ;.A=TRACK #
  27. JSR MAXSEC
  28. STA (BMPNT),Y
  29. INY
  30. TAX
  31. NM20
  32. SEC ;SET MAP BITS
  33. ROL T0
  34. ROL T1
  35. ROL T2
  36. DEX
  37. BNE NM20
  38. NM30 ;.X=0
  39. LDA T0,X
  40. STA (BMPNT),Y
  41. INY
  42. INX
  43. CPX #3
  44. BCC NM30
  45. CPY #$90 ;END OF BAM
  46. BCC NM10
  47. JMP NFCALC ;CALC # FREE SECTORS
  48. ;
  49. ;
  50. ;
  51. ;
  52. ; WRITE OUT THE BIT MAP TO
  53. ; THE DRIVE IN LSTJOB(ACTIVE)
  54. ;
  55. MAPOUT JSR GETACT
  56. TAX
  57. LDA LSTJOB,X
  58. MO10 AND #1
  59. STA DRVNUM ;CHECK BAM BEFORE WRITING
  60. ;
  61. ; WRITE BAM ACCORDING TO DRVNUM
  62. ;
  63. SCRBAM
  64. LDY DRVNUM
  65. LDA MDIRTY,Y
  66. BNE SB10
  67. RTS ;NOT DIRTY
  68. SB10
  69. LDA #0 ;SET TO CLEAN BAM
  70. STA MDIRTY,Y
  71. JSR SETBPT ;SET BIT MAP PTR
  72. LDA DRVNUM
  73. ASL A
  74. PHA
  75. ;PUT MEMORY IMAGES TO BAM
  76. JSR PUTBAM
  77. PLA
  78. CLC
  79. ADC #1
  80. JSR PUTBAM
  81. ; VERIFY THE BAM BLOCK COUNT
  82. ; MATCHES THE BITS
  83. ;
  84. LDA TRACK
  85. PHA ;SAVE TRACK VAR
  86. LDA #1
  87. STA TRACK
  88. SB20
  89. ASL A
  90. ASL A
  91. STA BMPNT
  92. JSR AVCK ;CHECK AVAILABLE BLOCKS
  93. INC TRACK
  94. LDA TRACK
  95. CMP MAXTRK
  96. BCC SB20
  97. PLA ;RESTORE TRACK VAR
  98. STA TRACK
  99. ;
  100. JMP DOWRIT ;WRITE IT OUT
  101. .PAGE 'NUMFRE'
  102. ;
  103. ; SET BIT MAP PTR, READ IN BAM IF NEC.
  104. ;
  105. SETBPT
  106. JSR BAM2A
  107. TAX
  108. JSR REDBAM ;READ BAM IF NOT IN
  109. LDX JOBNUM
  110. LDA BUFIND,X ;SET THE PTR
  111. STA BMPNT+1
  112. LDA #0
  113. STA BMPNT
  114. RTS
  115. ;
  116. ; CALC THE NUMBER OF FREE BLOCKS ON DRVNUM
  117. ;
  118. NUMFRE
  119. LDX DRVNUM
  120. LDA NDBL,X
  121. STA NBTEMP
  122. LDA NDBH,X
  123. STA NBTEMP+1
  124. RTS
  125. .END