FORMAT.Text
FORMAT.Text
| Filename | FORMAT.Text |
|---|---|
| Size | 0.01 MB |
| Subsection | firmware / ROM88 |
| Downloads | 0 |
Contents
.Page
;++
; Format
;
;--
; REGISTERS
; IN
; All = Any value
; OUT
; All = Destroyed
;
; CALLS
; ClrBuf Clears 524 byte buffer and other variables
; SelSide Selects side
; Recall Recalibrates disk to optical index sensor
; WriTrk Write no. of sectors in TempSec
; VerTrk Verifies no. of sectors in TempSec
; SeekAlt Seeks the teack in IIob+Track and sets speed
; WrSynTrk Writes bitslip FF's and A9's then sector 0
; WArd16 Write sector x, both header and data fields
; RdAdr Reads sector header
; Read16 Reads data fields
; VfyCksum Verifies checksum that was read
; PreNib Prenibblizes certain bytes for timing purposes
;
;++
.Page
Format .Equ * ; Format entry point
FormTrk .Equ *
Jsr ClrBuf ; Clear the buffer to be written
Lda #7
Sta FmtGap
Jsr RecalMtr ; Turn on motor & start from a known point (Track 0 )
Bcs FormRts ; Abort upon error from Recal
FormTop Jsr SeekAlt ; Go to othe track in IIob+Track & set speed
Ldy CurClass
Lda SecPrtTrk,y ; Fetch number of sectors in current track
Sta TempSec ; Save it for WriTrk
Jsr WriTrk ; Write a track full of sectors
Lda IIob+Command ; If a format track
Cmp #FrmTrk ; Then we're done-exit the routine
Beq VT00 ; Command = FormatTrack (5)
Lda Iob+NoSides ; 1 = single side, 2 = double side
Cmp #2
Bne $39 ; if <> 2 then go to incr to next track
Lda #20
Sta IIob+Side
Jsr WriTrk ; Now write second side
Lda #00
Sta IIob+Side ; Restore to side 0
$39 Inc IIob+Track
Lda IIob+Track
Cmp #MaxTrack+1
Bcc FormTop ; Until we run out of tracks
Dec IIob+Track
Bne VT00 ; Skip tunring the motor on
Verify .Equ * ; Verify entry point
Lda #MaxTrack
Sta IIob+Track ; From inside of disk to outer edge
VerTrk .Equ *
Jsr RecalMtr ; Turn on motor & start from a know point ( track 0 )
Bcs FormRts ; Abort upon error from Recal
VT00 .Equ *
Jsr SeekAlt ; Go to track in IIob+Track & set speed
Ldy CurClass
Lda SecPrTrk,y ; Fetch the number of sectors in current track
Sta TempSec ; Save it for WriTrk routine
Jsr VerTrk
Bcs FormErr ; Error, exit from routine
Lda IIob+Command ; If a verify track
Cmp #FrmtTrk ; Then we're done-exit the routine
Bcs $41 ; Command = FormatTrack (5) or VerifyTrack (6)
Lda Iob+NoSides ; 1 = Single side, 2 = double side
Cmp #2
Bne $39
Lda #20
Sta IIob+Side
Jsr VerTrk ; Now verify side 1, track x
Bcs FormErr ; Error, exit from routine
Lda #00
Sta IIob+Side
$39 Dec IIob+Track
Bpl VT00
$41 Clc
Rts
FormErr Lda IIob+Track ; Current track number
Sta Trkjl0dNumb ; Save for host's usage
Lda IIob+Side ; Current side
And #20 ; leave bit 5 -- side bit
Beq $17
Lda #1
$17 Sta SideNumb ; Save for host's usage
Lda #SErrFrmt ; Format error code
FormRts Rts
TooSml .Equ *
.Byte 0., 5., 10., 15. ; Not used
.Byte 20., 25., 30., 35. ; 4:7
.Byte 40., 45., 50., 55. ; 8:11
.Byte 60., 65., 70., 75. ; 12:15
JustRit .Equ *
.Byte 108., 99., 90., 81., 72. ; Sectors in class * 9 bytes per sector
;++
; Wri…
Showing first 3,000 characters of 5,790 total. Open the full document →