Re: Order of sectors on a track

Re: Order of sectors on a track

From: Ingo Korb <ml_at_akana.de>
Date: Mon, 25 May 2009 09:30:53 +0200
Message-ID: <u1vqdskpe.fsf@dragon.akana.de>
<ruud.baltissen@apg.nl> writes:

> The problem is that the header is GCRed as well. And decoding the header
> after having read it takes too much time I already found out: the first
> SYNC I was able to catch was of the next header ie. I missed the data
> one. 

You seem to use very slow code for that, some speeders like EXOS (which
is closely related to the FC3 speeder) have no problems doing just that:

=== Cut here ===
        ;; Subroutine: Wait for the next sector header and store
        ;;             the sector number in $f9
waitsect
	lda #$03                ; set disk controller buffer pointer to $0300
	sta $31
	lda #$00
	sta $30
l5a3	jsr rom_waitsync        ; Wait for SYNC (sets Y=0)
l5a6	bvc l5a6                ; Wait for a byte
l5a8	clv
	lda $1c01               ; Read GCR byte
	cmp #$52                ; sector header?
	bne l5a3                ; No, loop until sector header found
        
l5b0	iny                     ; increment buffer offset
        
l5b1	bvc l5b1                ; read 3 GCR bytes from disk and store at $0301-$0303
l5b3	clv
	lda $1c01
	sta ($30),y
	iny
	cpy #$04
	bne l5b1
        
l5be	ldy #$02                ; reset buffer offset
	jsr $f82b               ; convert $0302-? to binary
        
	l5c4 = * + 1
	lda $54                 ; read decoded sector number (assumed)
	sta $f9                 ; store in $f9
	rts
=== Cut here ===

(part of the drive code of EXOS)

-ik


       Message was sent through the cbm-hackers mailing list
Received on 2009-05-25 09:38:02

Archive generated by hypermail 2.2.0.