1541 – Why so complicated

1541YUNO

The Commodore 64 has a disk drive that is unique in many ways. Not only is the Commodore 1541 said to be the world’s slowest disk drive, but it’s also big, bulky, noisy and has a reputation of being unreliable. Also, it works in an unusual way. In many ways it’s the disk drive that has defined our experience with the C64.

In addition to the original model 1541 there were also the updated models 1541C and 1541-II from Commodore. The drives have different looks, differences in hardware and in ROM versions, but the basic functionality and features are principally identical.

Some later models in Commodore’s 8-bit serial disk drive range were improved in some ways, but those have less importance today. For a C64 as a retro system, the 1541 is the de facto standard. Still, in this time of emulators and hardware add-ons, compatibility with the original 1541 disk drive is regarded as a must.

And today, for someone who doesn’t want to resort to emulators only, the large and unconventional disk drive brings some practical challenges. So understanding the 1541 helps us to understand the options we have for replacing it!

It’s an intelligent device

Contrary to other home computer disk drives, the 1541 is an intelligent device. The original 1541 has a large motherboard inside that hosts its own processor, memory, I/O system and built-in disk operating system resident in a ROM chip (i.e. DOS). Basically the 1541 is a standalone computer, and the disk drive can operate on its own without the host computer having to control its every operation. You can think the C64 and 1541 being two computers that communicate over a serial bus. Data and commands are transferred over the serial bus whereas the actual disk operations are handled by the disk drive all by itself.

Interestingly there was a sampling drum machine in the mid eighties, namely E-MU SP-12, that made use of this unusual approach. The sampler could use the 1541 and compatible disk drives as its sample saving and loading medium and storage.

1541 top cover off

Here’s one of mine with already reduced size motherboard. The first models had a motherboard that took up almost the entire length of the large disk drive.

It’s slow as hell

The 1541 may be the slowest consumer disk drive throughout the history. And it’s a known “merit” of the drive. There was various reasons for the legendary slowness, mostly having to do with the unusual implementation, bugs, and prorities on how to overcome the discovered issues.

The VIC-20 was the first Commodore computer to use serial bus for disk drives. Both the VIC-20 and its 1540 disk drive used the MOS 6522 VIA as an interfacing chip, and the intention was to use a hardware shift register offered by this chip for the serial data transfer. However, it turned out that there was a bug in the chip’s shift register that could lead into data corruption. Apparently it was too late to fix the chip or change the hardware design of the computer and disk drive. Instead, the hardware serial data transfer was replaced with a slow software implementation. And it appears that this software solution to overcome the hardware problem was whipped up rather hastily. But that’s how the machines shipped.

Then came the C64. For starters, no new disk drive was designed, but the 1540 was software modified to run slightly slower to make it compatible with the new computer’s video chip timings. That’s the 1541 – a slowed down version of the 1540. Otherwise the drives are identical. In other words, the C64 + 1541 is even slower than the preceding VIC-20 + 1540.

The C64 had the 6522 VIAs replaced with more advanced, bug fixed 6526 CIA interfacing chips. But that didn’t really help as the designated disk drive 1541 still made use of the bugged 6522 VIA. The slow software protocol remained.

The disk drives designated for Commodore 1281570, 1571 and 1581 – finally made use of a bug free hardware serial transfer that should have been already in the VIC-20. When these drives are used with the C128, there’s no need for fast loaders. Sadly, this doesn’t help the C64, as it only uses the slow software transfer also with these drives.

 

It can be sped up

A program that makes a disk drive load faster sounds like a hoax or a joke. But the standard disk loading routines in VIC-20 and C64 were such a joke, that fast loading programs were a norm. Due to the above mentioned approach of two computers communicating with each other using a poor software based transfer protocol meant that the transfer protocol could be easily replaced with a better one.

Fast loaders can be divided into three main categories: software fast loaders, fast loading cartridges and KERNAL fast loaders. Fundamentally they all do the same thing: they run modified code in both the computer and in the disk drive to make the disk operations and data transfer much more efficient and thus faster.


Software fast loaders
are short programs that have to be loaded first using the standard slow loading routines. When loaded and run, the standard loading routines are overridden with more efficient ones, and further disk access happens faster. Many commercial games had their built-in fast loading routines that often doubled as a copy protection. There were also plenty of standalone fast loading programs that could be used to load larger programs, usually cracked games I guess, in much shorter time than it would normally take. Obvious downside of these standalone software fast loaders is that they have to be first loaded every time after the machine was switched off or reset.

Hypra-load Speedload

Two examples of fast loading programs –  after they have been loaded from the disk first. On the left,  a popular fast loading program, Hypra-Load. On the right side one of the fast loaders I used to use a lot, that goes by name Speedload.

Fast loading cartridges are much more convenient. The cartridge is simply plugged into the expansion port of the computer. The faster loading routines are just one or two key strokes away after the machine is switched on. Additionally, some fast loading catridges, like the Action Replay, offer some of the fastest serial loading routines available.

Action Replay menu Action Replay loader

The boot menu of Action Replay. The fast loader is just one F7 key stroke away.

Both the software fast loaders and fast loading cartridges override the standard loading routines. The third option is to replace the built-in KERNAL loading routines by replacing the ROM chips inside the C64, and in some cases, also in the disk drive. This way the fast loading routines are always present, instantly after startup, and virtually transparent in the computer’s operation.

JiffyDOS Exos

Likely the best known KERNAL loading system JiffyDOS, and another KERNAL loading system EXOS straight after startup.

One more loader type worth mentioning are the so called IRQ-loaders. They are a special type of software fast loaders being able to “run in the background”, sort of. This kind of loaders are mostly seen in modern C64 releases such as demos and games, where data is being loaded from the disk at the same time as music and graphics are being shown – which is pretty impressive for a early 80s computer. Needless to say, the C64 was never designed to do something like that.

Deus Ex Machina loading 2 Armalyte loader

A loading screen from a ground breaking demo from 2000, Deus Ex Machina. The graphics are scrolling and zooming in and out while music is playing to keep the audience entertained. Today’s demos don’t usually have dedicated loading screens at all, and the parts follow seamlessly. On the right is an example of a commercial IRQ-loader – the loading screen from the game Armalyte with a progress countdown timer.

And the fast loaders really make a difference. When loading a large file the standard disk drive spends around 13 seconds on a single track before the head steps onto the next track. That’s the *tic* you hear from the disk drive every now and then. The fastest fast loaders spend merely two or three disk rotations (the disk spins at 300 rpm) on one track until it’s completely read and transferred, making any program load in just few seconds. That’s a huge improvement considering that it takes more than two minutes to load a program that fills the C64’s memory using the standard disk loading speed.

A good example of a greatly improved drive side loading routine can be found in some of the fastest loaders. Those behave so that they read the sectors on the disk out of order, rearranging the data in memory. The benefit is that the loading routine reading the disk does not have to wait that the next sector in chain runs under the drive head (the data sectors are interleaved in a way that the sectors are optimized for the slow standard routine).

 

It’s not easy to maintain compatibility with the 1541

Given all the above, the 1541 disk drive isn’t the most straight-forward disk drive to emulate. There is a complete 8-bit computer involved in emulating the disk drive, complete with its own CPU, RAM, I/O and ROM software.

On the other hand, the C64 is communicating with a whole another device, and only expects it to respond in a certain way. The C64 does not care whether if there is a 1541 disk drive at the other end of the serial cable, or some other device that behaves in a similar way. This also opens up possibilities.

In my opinion the most prominent example are the modern SD card based disk drive replacements. For example the sd2iec based SD-card drives only respond to the C64’s drive commands in the way the computer expects – they do not emulate the complete disk drive. In many cases that works perfectly fine. Even many fast loaders are supported, but only because the custom routines used by those loaders are built in and recognized by the sd2iec firmware.

The real issues arise when a custom loader is not specifically supported. Or a program wants to send some custom code to the drive and execute it there on the drive CPU and RAM. Or when an advanced loader wants to take a strict control of the disk drive and access the disk directly by tracks and sectors. Obviously these kinds of things will fail when there is no physical disk to read, no actual drive head to step back and forth, or the 1541 CPU and RAM are not there either.

 

So how to replace the 1541 with something more contemporary?

The sd2iec based devices make a great job bridging the technological gap between the C64 and today’s computers, letting us use SD cards to shuffle programs back and forth. It’s only the down to hardware level compatibility they are lacking. Unfortunately that renders these devices incompatible with some few game titles, and a great deal of demoscene productions.

To achieve a full compatibility with the C64’s standard disk drive, the whole 1541 has to be emulated. Including its mechanics and also the disk images with the definition of how the data is laid out on the disk. And that’s exactly how the 1541 Ultimate and Chameleon handle the disk drive emulation, achieving a very high level of compatibility. If something runs from floppy, it will most likely run from a disk image on these devices.

 

Advertisements

8 Responses to 1541 – Why so complicated

  1. […] 1541, ou C1541 para os iniciados. Agora foi a vez do Ilkka Sjöstedt fazer algo bem parecido e tecer algumas palavras sobre esta curiosa peça de hardware. Inclusive um equipamento que não só não era da Commodore […]

  2. Andreas says:

    Hello. I like the 1541-Floppy. I really like it, even when its big and need space on the table. But it is not only a floppy like the floppys from other computers, its a fully little computer by its own. Same things are explained in your article about that. What i dont like is, that the old 5,25″ Disks are that big. This is a thing, i hate, because this disks are not comfortable to use. 3,5″ Disks, like the Amiga use them, are more comfortable because they are smaller and not so sensitive like the 5,25″ disks. This is the reason why i mostly use my 1541U1 or my SD2IEC with my C64. This is a little bit sad, because of the 1541-floppy and the reasons i told before, but it also not so easy, getting 5,25″ DD-disks to a good price. Therefore my floppys mostly stand around without use. But this is quality hardware. I give one example. When i get my first C64 as a kid, which was in 1984, then i also get a Commodore-1702 monitor and a 1541-floppy. It was the old brown 1541-modell. All this hardware was in heavy use all the years in the 80s and 90s and someday my first C64 died (years later i repaired it). But this 1702 Monitor and also this first 1541-floppy still runs without any problem. Over all this years it was not one day, where one of these two things, made a problem. Monitor runs since 31 years now and this 1541-floppy runs since 31 years now. If this is not quality, what else then? Regards.

    • ilesj says:

      I agree, those big 1541 disk drives have a certain appeal to them! Many seem to prefer the 1541-II model for its reliability, but I must say that none of the 1541 drives I have has ever failed on me. The few I have all still work, although I very seldom use them anymore. Just like you said, I use 1541 Ultimate or SD2IEC for the convenience. It’s so much hassle to copy files or disk images to floppies when it’s possible to run new programs downloaded off Internet from an SD card.

  3. Andreas says:

    Hello. Then you made the same good experiences of quality with the 1541-drives. They work for decades and it seems that they really have no weak-point when they are treated good all the time.

    One thing i want to mention too. I have here many C64 and Amigas. About 6 years ago, i purchased one of these C64 on Ebay with lots of accessories to a very good price (only 2 persons purchased, so i had luck). With this C64 also two floppys came, one was a 1541 and the other a 1541-II. I knew before, that the C64 works flawlessly, but that the two floppys have some problems, because the seller wrote this in the ebay-auction. The lights on these floppys work and they try to find a file on disk, but could not load it. Then i had an idea – maybe only the read/write-head of the floppys is misplaced or just need some movement when they stood for years without use. Then i used this C64-program with the floppys: http://csdb.dk/release/?id=75936
    It`s called Disk-Exerciser and adjust the header in optimal position. This can need about 1 or 10 minutes, depends on the floppy and its header-position at the beginning. The program runs as long as the reading-time is 9 or under 9. After this, they program writes, that the head is now in optimal position. When i get this program as a kid, i often thought this is just a joke-program. Later i realised, how good this works.

    And no joke, after letting this program run through, these two Ebay-floppys which made problems, work perfectly again, which made me very happy. So when you ever have read/write-problems with one of your 1541-floppys (no matter which model), use this program first, before trying to repair them on the hardware-side. Because when no hardware-piece is broken, then the chance is very good, that just a realignment of the floppy-head is necessary.

  4. SortingHat says:

    The great thing about the C64 was you could plug it into ANY TV and if you ever have a virus *which would be rare even today if they still made Commodores* you just turn it off and back on for a clean state.

    No need to throw it away and buy a new one unless something really was broken.

    You could stick a PBJ in the floppy drive and it will still work! Yes that is a true story which happened before I was ever thought of at a friends house of my parents who their friend had a 2 year old that stuck a peanut butter and jelly sandwich half way thru the drive by the time she was caught doing it.

    After removing the sandwich it was thought to be gone forever but when turning the power on it still worked just as before with no problems whatsoever!

    The C64 games HAD better colors then the Apple 2. Here is an example of a game called School Bus Driver.

    Apple version. http://gamecola.net/wp-content/themes/arras-theme/library/timthumb.php?src=http://gamecola.net/wp-content/uploads/2011/03/bus.jpg&w=630&h=250&zc=1

    Commodore 64 version. http://www.gb64.com/Screenshots/S/School_Bus_Driver.png

    The music is also different. The Commodore 64 plays the Entry of the Gladiators Theme.

  5. Gundolf Feinbein-Schlonz says:

    Yes, i knew before that 1541-drives like sandwich with peanut butter. Every morning my three 1541 sit with me on the breakfast-table and get sandwiches, They also like marmelade and honey. So if you want that your 1541 stays healthy for years, give them only good food like the things i wrote.

  6. […] 1541 – Why so complicated?   Ilejs heeft een nieuwe post op zijn blog gemaakt over de 1541. Hierin beschijft hij in het kort waarom de 1541 zo traag is – zelfs trager dan de 1540 van de VIC20. Maar gelukkig verschenen er snelladers. Klik hier. […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: