Marco Antonio Simon dal Poz  <[EMAIL PROTECTED]>  wrote:


> > >Do you know a FDC that supports 1.2Mb and 1.44Mb drives and is still being
> > >produced, and have good documentation?
> > 
> > Note that 3.5MHz is too slow to allow reading of 1.44MB disks. The "inner
> > loop" of the sector read routine is too slow to cope with the data flow. So
> > if you want to create 1.44MB drives for MSX, you either have to use 7MHz
> > Z80 or use some kind of buffer for reading sectors.
> 
> Are you sure? A 720kb disk works with a FDC that handles 250kbits/s, a
> 1440kb disk works with a FDC that handles 500kbits/s. This means that the
> main routine should be able to read 12500 bytes per turn. It means that
> this routine should run 12500 times in 0.2 seconds. Then, the routine
> should spend a maximum of 16 microseconds. In a 3.57561149MHz, this means
> 57 clockcicles.
> 
>       LD HL,address
>       LD C,D3h
> LOOP: IN A,(D0h)      ; 12 clocks
>       RRCA            ; 5 clocks
>       JR NC,LOOP      ; 9 or 12 clocks
>       RRCA            ; 5 clocks
>       RET NC          ; 9 clocks
>       INI             ; 21 clocks (I guess)
>       JP LOOP         ; 10 clocks
> 
> Total: 71 clockcicles. Conclusion: you're right, it's not possible to use
> 1.2Mb or 1.44Mb disks with Z80 at 3.57MHz. It's BAD!

In principle this could work!

The 2793 floppycontroller HAS the capacity to handle 500 Kbit/s 
(apparantly, this was used for larger 8 inch disks -a loooonnngg, 
loooonnngg, time ago).

Can the Z80 handle that?

500 Kbit/s = 62.5 Kbyte/sec.
3.58 MHz / 62500 = 57 clockticks per byte. A bit tight, but possible!

Take the above loop:

LOOP:
    IN A,(D0h)           12 ticks
    RRCA                   5 ticks
    JR NC,LOOP       8 ticks if skipped, 13 if jumping
    RRCA                   5 ticks
    RET NC                6 ticks if skipped, 12 ticks if returning
    INI                         17 ticks
    JP LOOP               11 ticks

If the 1st JR is done: 12+5+13=30 ticks, far less than 57.
Otherwise 12+5+8+5+6+17+11=64 ticks, a tiny bit too many

But speed-up's are still possible here:

-Drop the JP at the end, and put what's before it xx times after each 
other. Doesn't look nice as source code, but works. You could also 
copy this piece of code xxx times to RAM and execute that

-put address of (LOOP) in IX or IY, and replace JP LOOP with JP (IX) 
or JP (IY): takes 9 instead of 11 ticks. Or even use JP (HL): uses 
only 5 (!) ticks

-INI and instructions working with pointers use 16-bit counters. 
Could be replaced with sequences like INC HL: DJNZ LOOP. If you take 
a fixed transfer address (sector buffer!) with start address xx00h, 
you can replace that INC HL with INC L.

-The memory mapped I/O construction used by the floppycontroller in 
European MSX's gives more instructions that you could use (more Z80 
instructions dealing with memory than with I/O)

-Do the INI in the above loop for starters (!): increases pointers, 
AND sets flags!
-> Allows to test those flags immediately (=drop another 5-tick 
instruction). If a byte did come in, you're done, if not, simply 
decrease pointers again

Combining the above: not easy, but it COULD be done !


Alwin Henseler            ([EMAIL PROTECTED])

http://huizen.dds.nl/~alwinh/msx           MSX Tech Doc page


****
MSX Mailinglist. To unsubscribe, send an email to [EMAIL PROTECTED] and put
in the body (not subject) "unsubscribe msx [EMAIL PROTECTED]" (without the
quotes :-) Problems? contact [EMAIL PROTECTED] (www.stack.nl/~wiebe/mailinglist/)
****

Reply via email to