Re: Info/help needed with copying disks

Re: Info/help needed with copying disks

From: Spiro Trikaliotis <ml-cbmhackers_at_trikaliotis.net>
Date: Mon, 11 May 2009 12:27:39 +0200
Message-ID: <20090511102739.GA13327@trikaliotis.net>
Hello Ruud,

* On Mon, May 11, 2009 at 07:43:31AM +0200 ruud.baltissen@apg.nl wrote:
 
> Yesterday I wrote Joe Foster a PM asking if he could tell me how he read
> the data from disk. During writing this email I got this idea:
> - use one turn of the floppy to find out in which order the sectors are
> stored.
> - then start reading/writing the sectors with an interleave.

I can tell you how the warp mode of SC does it:

- Reading a sector: The drive code knows (has a table) of which sectors
  it needs to transfer to the PC. The code just reads in a sector header
  and decodes it. Then it finds out if this sector is needed. If not,
  the code proceeds to the next sector. Instead, if this sector is
  needed, it is read in and transferred to the PC.

  Thus, there is no extra round at the beginning needed for this, as in
  your proposal.

  Note also that with warp mode, the GCR decoding is done on the PC
  side, as the PC is much faster.

- Writing a sector:
  IIRC (I have not had a look at the sources), the speed advantage is
  there simply by letting the PC do the GCR encoding.

> 2) en/decoding the sector - I have no idea.

 
> I know there is a routine the 1541 uses to find the right header to
> cover 1).

For reading, have a look at $F4D1-$F507 (and the called routines). For
writing, have a look at $F575-$F5E6. These routines are very simple, but
they expect that you know beforehand which block you are manipulating.


>                            Regarding 2) I have two qestions:
> - I know the routines exists and should be able to find out how to use
> it but if somebody happens to have some experience on this matter, info
> is welcome.
> - I have no idea how much time it takes to en/decode a sector. Anyone?

Measured with VICE (empty disk):

- $F4ED-$F4F0 (GCR -> binary): 22.890 cycles
- $F586-$F589 (binary -> GCR): 22.693 cycles

Of course, it might change according to the actual data, but you have
rough estimates of the typically needed time.

And: Yes, the GCR routines in the 1541 *are* slow.

The 1571 has different routines, cf. $9606-$970C (read) or $976e-$97f6
(write). The do the GCR <-> binary conversion "on the fly" with the help
of the (big) tables at $970D - $A40C.

HTH,
Spiro.

-- 
Spiro R. Trikaliotis                              http://opencbm.sf.net/
http://www.trikaliotis.net/                     http://www.viceteam.org/

       Message was sent through the cbm-hackers mailing list
Received on 2009-05-11 13:36:30

Archive generated by hypermail 2.2.0.