Retro computing with a touch of modern and the home for all things, retroCombs (aka Steven Combs).

Disclosure Statement: When you click on links to various merchants on this site and make a purchase, this can result in this site earning a commission. Affiliate programs and affiliations include, but are not limited to Amazon, the eBay Partner Network, and/or others.

27 June 2020

retroCombs: Create a blank .c64 disk image for the Pi1541 or SD2IEC

by Steven B. Combs, Ph.D.

In my last post and video, I shared my experience with the assembly and first use of a Commodore4Ever Pi1541 for the Raspberry Pi Zero. Not familiar with the device? Take look here for more information.

The Pi1541 turned out to be a great device; if you have a bunch of disk images laying around your computer. As I began to prepare for my next using the Commodore Plus/4 episode, it became evident that I needed a blank disk image so I could save and load my own basic program and application files. I wasn’t sure you could do this with the Pi1541 by itself, so I began to look for hints online. Turns out, you cannot. You need to do this on a computer using some software. In this post and the accompanying video, I share that process as well as some other tips.

NOTE: While this process focuses on the creation of a .d64 diskette image for the Pi1541, it turns out that this same process works for SD2IEC devices. I updated the title and the contents to reflect this use case.

YouTube Video: Create a blank .c64 disk image for the Pi1541 or SD2IEC

In the video below, I share the content found in the blog post below.

Below are the links (#ad) mentioned in the video:

  1. PiDRIVE ZERO Raspberry Pi HAT pi1541 1581 Commodore 64, 128, and Vic-20 Emulator with OLED display
  2. The Versatile Commodore Emulator (VICE)
  3. Commodore4Ever
  4. Pi1541 Project
  5. Raspberry PI Zero
  6. Serial Cables
  7. microSD Card
  8. microUSB Cable
  9. SD2IEC

Creating a blank .c64 disk image

The process for creating a blank image utilizes the VICE (Versatile Commodore Emulator) emulator software. Installation of VICE varies by computer; however, I will run through the installation on a Linux distribution (Elementary OS). Check out the VICE download page for the many other versions available.

Install VICE

For Linux users, the most recent version of VICE should be ready to install from your distribution’s repositories. On my Elementary OS install (based on Ubuntu), it’s as simple as:

  1. Launch the Terminal.
  2. Type sudo apt update and wait for the repository lists to update.
  3. Type sudo apt install vice and a terminal message similar to the one below will appear:

     Reading package lists... Done
     Building dependency tree
     Reading state information... Done
     The following additional packages will be installed:
     libgtkglext1 libpangox-1.0-0
     The following NEW packages will be installed:
     libgtkglext1 libpangox-1.0-0 vice
     0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
     Need to get 5,257 kB of archives.
     After this operation, 34.0 MB of additional disk space will be used.
     Do you want to continue? [Y/n]
  4. Type y at the prompt and VICE will install.

For the Linux version, VICE will install several VICE launchers as shown in the image below:

Various VICE Launchers

While you can use this software to create your own .d64 diskette image, the software is also a whole lot of fun for on-the-go retro-computing on other devices; but that’s for another post. Let’s not get distracted and get back to the task at hand.

Create the diskette image

With VICE installed, create a diskette image using the following steps:

  1. Start the VICE (C46) emulator on your computer. A screen similar to the one below will appear:

    VICE 64 Screen

  2. From the VICE menu, select File / Create and attach an empty disk image / Device #8. The following dialog box (or something similar), will appear:

    VICE Create Disk Image Dialog Box

  3. Navigate to a location where you can easily find the .d64 file. I like to use the Downloads folder.
  4. In the Name text edit area, type the name of the file you want to create.
  5. You can select which device to automatically connect in the lower-left of the dialog box; however, that has nothing to do with the creation of the image. It simply connects the new image to that device number for VICE after the image is created. Use the default; #8.
  6. In the Name text edit box, type a name for the image in all lower case and no more than 16 characters. This text will display in the directory listing when you display the contents of the .d64 disk image on your Pi1541, SD2IEC, or within VICE.

NOTE: Type everything in lower case characters because they will be converted to upper-case when using on a Commodore computer or emulator. You can use other symbols, but I recommend you first take a look online at what symbols are allowed.

  1. The formatting ID: text edit box is purely cosmetic and can be any two alpha-numeric characters. You can also leave this box blank.
  2. Using the Type dropdown menu, select the d64 option (it will be the default).
  3. Select the Save button to create the diskette image. VICE will also attach this new diskette image to the current VICE instance. If you remember your diskette commands (such as LOAD "$",8 and then LIST), you can play around with the image on your computer before we transfer it to the Pi1541.
  4. Once you are done mucking around with the image under VICE, close the VICE application.

Transfer the disk image

Now that the diskette image is created, let’s move it to the Pi1541.

  1. Place the Pi1541 SD card into the computer.
  2. Open a file manager.
  3. Browse to the 1541 directory on the SD card.
  4. Copy the newly created .d64 from the computer to the 1541 directory as shown in the image below:

    transfer .d64 image to sd card

  5. Once the image is transferred (it will take less than a second), eject the SD card.

Use the disk image

With the image transferred, we can now use it on a Commodore 8-bit computer.

  1. Insert the SD card into the Pi1541 (or SD2IEC device).
  2. Connect the Pi1541 to the computer using a cable.
  3. Apply power to the Pi1541 using a microUSB cable. The Pi1541 screen will flash and the green power light will illuminate.
  4. Turn on the Commodore computer (in my case, a Plus/4). The Pi1541 screen will display the contents of the microSD card.
  5. Use the buttons on the Pi1541 to navigate to the .d64 image created.
  6. On the Commodore computer, list a directory with either the LOAD "$",8 or DIRECTORY commands (depending on the Commodore computer you are using with the first option usable by all).

The directory listing will include the new .d64 image contents and it can now be used like a diskette inserted into a 1541 disk drive.

Final Thoughts

You could find a copy of a blank .d64 file online, download it, and then place it on the SD card; but where’s the fun, and learning, in that? Besides, now that you have the secret sauce, you can now easily add your own header text to the image and create other types of diskette or tape image files using the same process, but with different options. The fun is in the exploration.

I’d also like to point out that you can transfer a .d64 file between computers and devices. Want to code on your computer? Place the SD card from the Pi1541 or SD2IEC device into a computer, use VICE to code (using a modern keyboard and emulating any Commodore 8-bit you wish), save the program to the disk image, and then place it back into the Pi1541 (or SD2IEC) and try the program on an actual Commodore computer. It’s a great way to take your retro-computing hobby on the road with you! While you’re at it, load up the SD card with other programs and disk images and use the VICE IEC option to access them all (you are welcome for that extra tip and can Google that one!).

One last reminder. As I’ve learned over time, SD cards, can be fragile. Make sure you have many on hand (#ad) and back up your data regularly.

Join the Fun

Know another way to create a .64 disk image? Have other tips and suggestions for me and the community? Well, why don’t you help make this post better! Leave your comments and thoughts below or in the comments under the YouTube video.

🕹️ retroCombs, OUT!