Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user Sepa ! (Registered 2024-05-13) You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Drive code: 1541/81 code conversion.
2015-03-26 19:46
Flavioweb

Registered: Nov 2011
Posts: 447
Drive code: 1541/81 code conversion.

I have a simple question (for you experts).
This is a drivecode for 1541:
DRV_5BYTELOOP
    BVC DRV_5BYTELOOP                   ; Wait for data from the R/W head
    CLV
    LDA $1C01
    STA (BUFLO),Y
    INY
    CPY #$05                            ; Read 5 GCR bytes
    BNE DRV_5BYTELOOP
    RTS

How can i translate it to work on a 1581?
2015-03-26 19:55
Krill

Registered: Apr 2002
Posts: 2854
You don't. The 1581 can store an entire track in RAM and is fast enough to discourage from going low-level as on 1541.
Simply use job codes and implement your custom serial protocol only.

(And to answer your question: GCR is not used on the 1581. It accesses disk data using a WD1770 controller, so you'd read and write its registers in drive code. Obviously, this works entirely different than on the 5.25" drives.)
2015-03-26 21:19
chatGPZ

Registered: Dec 2001
Posts: 11140
its also not really worth optimizing, since all the "slow stuff" happens in hardware :)
2015-03-26 22:55
Krill

Registered: Apr 2002
Posts: 2854
Oh, i'm pretty sure there is ample room for optimisation, e.g. by interleaving disk controller and serial bus access. But as i said, the drive is so fast it really isn't worth the effort.
2015-03-27 09:01
Flavioweb

Registered: Nov 2011
Posts: 447
Excluding AAY there are other texts with low level infos on 1581?
2015-03-27 09:33
MagerValp

Registered: Dec 2001
Posts: 1059
http://cadaver.homeftp.net/rants.htm

Read rants #5, #7, #12, and #13. You can also look at the source for ULoad Model 3 release 1.
2015-03-27 09:56
Krill

Registered: Apr 2002
Posts: 2854
Firmware including source code: http://www.zimmers.net/anonftp/pub/cbm/firmware/drives/new/1581/
Schematics: http://www.zimmers.net/anonftp/pub/cbm/schematics/drives/new/15..
WD1770 info: http://www.cloud9.co.uk/james/BBCMicro/Documentation/wd1770.html
WD1770/2 datasheet: http://dev-docs.atariforge.org/files/WD1772.pdf
Some general info: http://vice-emu.sourceforge.net/plain/drive_info.txt
A 1581 clone: http://www.students.tut.fi/~leinone3/dcn2692/index.html
And lastly, check the VICE source code: http://sourceforge.net/projects/vice-emu/
2015-03-27 10:04
Krill

Registered: Apr 2002
Posts: 2854
Oh, and what do you want to do? Write an IRQ loader with 1581 support? Then yes, see MagerValp's post, and Krill's Loader, repository version 146 has 1581 support, too.
2015-03-27 10:32
Flavioweb

Registered: Nov 2011
Posts: 447
I have to learn a lot of things...
So thanks for all the infos.
I'm just courius to see if i can imagine how to write an iffl loader that works on 41/71/81 autodetecting the device.
For 41/71 there are no problems.
They comes with 1581.
Should be great if i add a "decrunch on the fly" for level exomized files...
2015-03-27 10:58
TNT
Account closed

Registered: Oct 2004
Posts: 189
AFAIK the only program using WD177x inside 1581 directly is MMC64 D81 Writer.
2015-03-27 12:07
MagerValp

Registered: Dec 2001
Posts: 1059
Lasse's rants give you all the information you need to write an IFFL loader that supports 1541/70/71/81/CMD FD/HD - that's how I learned :)
2015-03-27 14:23
cadaver

Registered: Feb 2002
Posts: 1154
Don't remember if I've asked this, but do you do anything special to speed up IFFL scanning on 1581/FD/HD? I never got around to that, as didn't use IFFL in an actual production so far, and only built the 1541 proof-of-concept routine.
2015-03-27 15:37
Flavioweb

Registered: Nov 2011
Posts: 447
I don't know how much time is needed by 81/Fd/HD to complete the seek process... maybe fast enough...
But i have no code to test now.
Maybe MagerValp tried something about this...
2015-03-27 19:13
Krill

Registered: Apr 2002
Posts: 2854
Is there a need to speed up scanning on 1581? Loading a random block, the entire track it is located on is read in a revolution or two, then the links can be walked in no time. Repeat for the rest of the file's tracks.

That said, one can always implement scanning on demand, such that a seek is only performed when loading.
2015-03-28 11:11
MagerValp

Registered: Dec 2001
Posts: 1059
Quote: Don't remember if I've asked this, but do you do anything special to speed up IFFL scanning on 1581/FD/HD? I never got around to that, as didn't use IFFL in an actual production so far, and only built the 1541 proof-of-concept routine.

On 1581 I buffer a track in the drive and then read all 40 t/s links from ram in one sweep. On CMD FD/HD the C64 requests sectors from the drive but only transfer the first two bytes. The 1581 version is a lot faster.
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
Dr.j/Delysid
serato/Finnish Gold
MCM/ONSLAUGHT
Paul Bearer
Sander/Focus
Sepa/OCD
Sentinel/Excess/TREX
katon/Lepsi De
HCL/Booze Design
Beast/Crescent
Flexman
Guests online: 189
Top Demos
1 Next Level  (9.8)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.6)
6 Comaland 100%  (9.6)
7 Uncensored  (9.6)
8 No Bounds  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 Party Elk 2  (9.7)
2 It's More Fun to Com..  (9.6)
3 Layers  (9.6)
4 Cubic Dream  (9.6)
5 Copper Booze  (9.5)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Rainbow Connection  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Fullscreen Graphicians
1 Carrion  (9.8)
2 Joe  (9.8)
3 Duce  (9.8)
4 Mirage  (9.7)
5 Facet  (9.7)

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