Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Drive coding: safe maximum time between $1c01 reads?
2008-03-16 11:54
tlr

Registered: Sep 2003
Posts: 1790
Drive coding: safe maximum time between $1c01 reads?

There was some discussion here previously: Job codes'n buffers

Graham mentions that the rotational speed of an 1571 is often >320 rpm.
I've heard of ~280 rpm on some drives.
So what is the safe distance?

Is the following partial decode safe? (assuming no page crossings)
    ldy #<n>
lp:
    bvc .
    clv
    ldx $1c01
    lda tab,x
    sta buf,y
    dey
    bpl lp
I'm thinking it is. A lap would be 22 cycles (=2+2+4+4+5+2+3).
Assuming min/max 280/330 rpm and a minimum write distance of 26 cycles gives a practical min distance of 26*(280/330)=22.06 cycles.
Maybe I'm missing something in addition... jitter perhaps?

Is 280/330 rpm a too narrow assumption?

EDIT: calculated this on 28 cycles by mistake, corrected it to 26 cycles.
2008-03-16 12:40
MagerValp

Registered: Dec 2001
Posts: 1078
Thinking about a d64 compatible 4-8 GCR scheme?
2008-03-16 18:32
tlr

Registered: Sep 2003
Posts: 1790
No, normal GCR.
2008-03-16 20:15
MagerValp

Registered: Dec 2001
Posts: 1078
Interesting, what would tab do?

I did a partial decode while reading, but mainly shifting to line up the nybbles better.
2008-03-16 20:18
tlr

Registered: Sep 2003
Posts: 1790
tab is a "sparse" table remapping bits to arrive in linear order at the c64 end.
2008-03-31 16:45
tlr

Registered: Sep 2003
Posts: 1790
I have since reduced the distance to 20 cycles, so it should be safe enough.

I have some other questions though:

1. What is the safe spin-up time across drives?
The 1541 ROM seems to use 1 second for this, but that feels like a bit overkill.

2. What can be considered safe stepping/settling times?
The 1541 ROM has slow stepping, and uses acceleration to get higher speed during long movements.
2008-04-02 16:26
raven
Account closed

Registered: Jan 2002
Posts: 137
Not counting the clv & $1c01 read, i've gone as high
as 18/19 cycles between reads.
That DID backfire on some drives (X2001 1541 drive *caugh*)

17 seems to work fine though, but you can also do
some dirty tricks, like use 19 cycles after one $1c01 read,
then use 15 after the next one, so it averages out..
2008-04-02 18:27
tlr

Registered: Sep 2003
Posts: 1790
Quote: Not counting the clv & $1c01 read, i've gone as high
as 18/19 cycles between reads.
That DID backfire on some drives (X2001 1541 drive *caugh*)

17 seems to work fine though, but you can also do
some dirty tricks, like use 19 cycles after one $1c01 read,
then use 15 after the next one, so it averages out..


17 cycles + bvc + clv would be 21 in total then. One below my calculated worst case.

In my routine 20 cycles (total) is the maximum delay, then 16, 17, 17 and 19.
Seems safe then! :)

The 1541 rom seems to use 19 cycles max:
.8:f4d4   50 FE      BVC $F4D4
.8:f4d6   B8         CLV
.8:f4d7   AD 01 1C   LDA $1C01
.8:f4da   91 30      STA ($30),Y
.8:f4dc   C8         INY
.8:f4dd   D0 F5      BNE $F4D4
.8:f4df   A0 BA      LDY #$BA
.8:f4e1   50 FE      BVC $F4E1
.8:f4e3   B8         CLV
.8:f4e4   AD 01 1C   LDA $1C01
.8:f4e7   99 00 01   STA $0100,Y
.8:f4ea   C8         INY
.8:f4eb   D0 F4      BNE $F4E1


How about step delays?
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Alakran_64
New Design/Excess
wil
Case/Padua
crayon/Hokuto Force
Spinball/Excess
Smasher/F4CG
Acidchild/Padua
iAN CooG/HVSC
Sulevi/Virtual Dreams
t0m3000/hf^boom!^ibx
tlr
iceout/Avatar/HF
Guests online: 102
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 Antitrack  (9.8)
3 OTD  (9.8)
4 Fungus  (9.8)
5 S!R  (9.8)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.044 sec.