retroCombsRetro computing with a touch of modern
Search/
MEGA65

MEGA65 User’s Guide Chapter 6 - Using Disks and Disk Images

by Steven B. Combs, Ph.D. Topic: MEGA65

Welcome back to another installment of the MEGA65 User’s Guide series! Today, we’re diving into Chapter 6: Using Disks and Disk Images. In this chapter, we’ll explore how to work with both physical and virtual disk drives on the MEGA65. You’ll learn how to create, mount, and manage disk images, plus pick up some great tips for working with the internal 3.5” floppy drive.

As always, this post is the text companion to the YouTube video. It’s packed with links, errata, and every command from the episode so you can type along. Grab your manual and let’s learn how to manage your disks and disk images!

MEGA65 Chapter 6 Image

MEGA65 User’s Guide Series Page

TABLE OF CONTENTS


Below are the links you need to help you get the most out of your MEGA65.

MEGA65 Accessories

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 and the eBay Partner Network.

SUPPORT THE BLOG AND CHANNEL

Check out the supporters page to learn about my amazing supporters and how you can join our community.

COMPANION YOUTUBE VIDEO

Title: MEGA65 Using Disks and Disk Images (User’s Guide Ch. 6)

MEGA65 Using Disks and Disk Images (User's Guide Ch. 6) MEGA65 Using Disks and Disk Images (User's Guide Ch. 6)

VIDEO ERRATA

  1. 2024-12-24: The printed version of the manual implies COPY "MYGAME",U8 TO "MYGAME",U9 is valid syntax for the COPY command. It is not, and the page has been corrected for future versions of the manual. The correct syntax to copy a file from one drive to another is COPY "MYGAME",U8 TO U9. I’ve used the correct syntax in the COPY section below. See Appendix A: BASIC Command Reference for more information.

DISK DRIVES

The MEGA65 supports both physical and virtual drives:

  1. The built-in 3.5” floppy drive: Compatible with double density (DD) floppy disks, just like the Commodore 65.
  2. External drives: Attach legacy drives, such as a 1541, to the IEC port, or modern recreations such as a Pi1541 or SD2IEC devices.
  3. Virtual drives: Besides physical drives, you can access and use virtual .D81 disk image files. The MEGA65 doesn’t currently support .D64 files. You’ll find most software for the MEGA65 in .D81 format on the Filehost.

When you fire up the MEGA65, the MEGA65 demo disk, from the MEGA65.D81 disk image on the SD card, is the first thing that loads. The MEGA65 boots this disk image by default, but you can change this in the Configuration Utility (see Chapter 4) or replace that file with another of the same name. The MEGA65 includes tools to manage disk images in the Freezer and with BASIC commands, and we’ll cover both in this chapter.

And for those of you who’ve been with Commodore since the early days, you’ll be happy to know that physical and virtual disks both use the same BASIC commands you know and love, with some great modern additions and improvements.

UNIT NUMBERS AND DRIVE NUMBERS

The MEGA65 can handle multiple drive units simultaneously by assigning a unit number to each drive. By default, the first unit number is 8, which is either a physical disk inserted in the drive or a virtual disk attached using the Freezer.

For those familiar with the original Commodore computers, you know this command loads software from the default, or unit 8, drive:

LOAD "MYPROGRAM",8,1

This drive is connected to the Commodore serial bus, or IEC. The IEC uses an IEEE-488-style serial protocol that provides unit numbers from 0 to 31 for various devices, and the protocol reserves unit numbers 8 through 11 for disk drives. Good news! The MEGA65 follows these standards.

BASIC 65 includes modern improvements to make using drives easier. For example, if you want to load software from drive 9, use the U parameter:

DLOAD "MY-PROGRAM",U9

If you omit the U9 parameter, the MEGA65 defaults to unit 8, as it should.

The great thing about the MEGA65 is that it includes both a physical floppy drive and access to virtual disks on the internal SD card. This can be confusing, so let’s clear it up a little. Unless you have changed the configuration we chatted about in Chapter 4, a virtual disk on the SD card named MEGA65.D81 is the default virtual disk attached to unit 8. To change this in immediate mode or in a BASIC 65 program, use the MOUNT command. By default, the floppy disk drive remains disconnected until you use the MOUNT command. Confusing now, but this will make sense by the time we finish this chapter.

In addition to unit numbers, there are drive numbers for the Commodore 8050 dual drive. Because these are extremely rare, I won’t cover their use in this series, but check out Chapter 6 in the printed manual for more information. On the other hand, if you’re interested in a dual drive today, check out the BitBinders dual 1581 recreations, available in either a vertical or horizontal format. And if you have a Commodore 8050 lying around and you don’t need it, I’d love to test it on my MEGA65. Reach out to me!

WHY VIRTUAL DISKS?

Before we dive into using virtual disks, let’s diverge from the User’s Guide for a moment to touch on why the MEGA65 defaults to virtual disks rather than the internal 3.5” floppy drive. Virtual disks offer a number of advantages:

  1. Convenience: Disk images, like .D81 and .D64 files, are stored on SD cards or other media, allowing you to switch between them instantly without physically swapping disks.
  2. Preservation: Since virtual disks are digital files, they protect software originally stored on fragile floppy disks and prevent data loss over time.
  3. Faster access: Virtual disks provide quicker load times while still emulating retro disk speeds for an authentic experience.
  4. Larger capacity: A .D81 can hold up to 800 KB, compared to a 1541 floppy’s measly 170 KB.
  5. Easy backup and sharing: Virtual disks are simple to back up, copy, and share online, making software distribution and data protection a breeze.
  6. Multi-disk management: Virtual disks enable seamless switching between multi-disk setups, bypassing the need for physical disk swapping, especially if you have a single floppy drive.
  7. Modern integration: Virtual disks integrate with emulators like VICE or Xemu, streamlining development and testing on both emulators and MEGA65 hardware.
  8. Software compatibility: They support both legacy Commodore software and new MEGA65 programs, giving you the best of retro and modern computing, which is what this channel is all about!

USING VIRTUAL DISK IMAGES

When you first power on your MEGA65, it loads the intro disk menu from a .D81 file called MEGA65.D81 stored on the SD card. You can modify this default behavior in the MEGA65 Configuration Utility. There are three ways to manage virtual disks on the MEGA65:

  1. The Freezer menu: Remember that one? Hold the RESTORE key for about one second and the Freezer pops up.
  2. BASIC commands: Such as MOUNT. More on that later.
  3. The Configuration Utility: Where you can change the default .D81 boot image.

Earlier we talked about unit numbers. Each MEGA65 drive is assigned a unit number, and you can have two managed drives at once. The first managed drive is typically set to unit 8 or 10, and the second drive to unit 9 or 11. For simplicity, I recommend sticking with units 8 and 9.

WHERE TO GET DISK IMAGE FILES

So, you’re probably wondering, where do I get these .D81 files? You can create one yourself, and we’ll learn how a little later, but first you’ll want disk images full of software. Your first stop is the MEGA65 Filehost, where you can browse, search, and download .D81 disk images.

After you download a .D81 image, copy it to your MEGA65 SD card using one of these methods:

  1. Manually copy the disk image from your PC to your SD card.
  2. Use M65Connect to transfer the disk image from your PC to your MEGA65.
  3. Use the mega65_ftp command line tool to transfer the disk image from your PC to your MEGA65.

You’ve seen the first option in previous videos. We’ll explore options two and three in Chapter 7.

The Filehost is not the only place to find disk images. It’s a bit confusing at first, but just remember:

  • GO64 mode on the MEGA65: Search for older Commodore 64 titles stored on .D81 disk images.
  • The C64 core: Search for .D64 disk image files.

MOUNTING DISK IMAGES WITH THE FREEZER

Let’s use the Freezer to get started with disk images:

  1. Press and hold the RESTORE key for one second. The MEGA65 Freezer menu will appear.
  2. Select the first managed drive by pressing 0. A disk image browser displays the disk image files on the internal or external SD card. If an external SD card is installed, that will be the default (we talked about that in a previous chapter), and there’s no way to switch between them in the Freezer menu.
  3. On the left side are primary devices and folders. When one of those is selected, its contents appear on the right-hand side of the page.
  4. Use the cursor keys to select a disk image and press RETURN. The image is mounted to the managed drive.
  5. If needed, press 1 to perform the same actions for the second managed drive. Remember, you can have two disk images mounted at the same time.
  6. Press F3 to leave the Freezer menu and access the disk image.

If you want to change the unit numbers from the default 8 and 9, load the disk image, return to the main Freezer menu, and press either 8 or 9 on the keyboard to toggle the unit number assigned to the first or second managed drive.

MOUNTING DISK IMAGES FROM BASIC

BASIC 65 includes a new command called MOUNT that you can use in lieu of the Freezer to mount disk images. This is my preferred way to mount images, and you can use it in a BASIC program or in immediate mode. To mount a disk image to unit 8, the default, use:

MOUNT "MEGA65.D81"

To mount a disk image to unit 9, add the U argument (don’t forget that comma!):

MOUNT "MEGA65.D81",U9

Verify each with DIR or DIR U9. We’ll check out another use of the MOUNT command in just a little bit, so stay tuned.

CREATING A NEW DISK IMAGE

Now you’re probably wondering, how do I create my own disk image? If you need a blank disk image for your own BASIC programs and data files, create one in the Freezer:

  1. Press and hold the RESTORE key for one second. The Freezer menu will appear.
  2. Press either 0 or 1 to select the managed drive that will contain the disk image.
  3. Cursor down to the - NEW D81 DD IMAGE - option at the top of the left column.
  4. A disk image name prompt will appear. Type the name of the disk image, no more than 16 characters, but do not include the .D81 extension.
  5. Press RETURN. The new disk image is created and mounted to the MEGA65 managed drive.
  6. Exit the Freezer with F3 and verify in immediate mode with the DIR command. More on DIR later.

Unlike the 1980s and ’90s, create as many of these disk images as you like. They don’t cost a thing, and you’re not going to drop one on a speaker and erase it!

MANAGING SD CARD FILES IN SUBDIRECTORIES

New to the MEGA65 is the ability to create folders on an SD card. These folders keep things organized as you start your collection of disk images. For instance, you may want all your games in a folder called GAMES, or even break that down by type, such as adventure, action, or strategy.

There are two ways to create subdirectories on an SD card:

  1. Manually create them on the SD card using your PC.
  2. Use the Ethernet file transfer tools, which we’ll discuss in Chapter 7.

TIP: Only one subdirectory! You can’t go any deeper than one subdirectory from the root directory of your SD card.

Earlier you saw the Freezer menu display subdirectories. To make them easy to identify, their names begin with the forward slash (/) character.

BASIC 65 also includes the CHDIR (change directory) command, and it does exactly what it says: it changes directories on the SD card. You can use this command in immediate mode or in a BASIC program. Here’s an example that changes to a subdirectory and then mounts a disk image located there:

CHDIR "DEMOS",U12
MOUNT "XANADUPV.D81"

That disk image is now mounted. And by the way, that Xanadu demo is awesome! Run to the Filehost now and download it. It’s a great example of what you can accomplish in assembly and BASIC 65. I even produced a video about this demo.

USING THE INTERNAL 3.5” FLOPPY DISK DRIVE

One of the great features of the MEGA65 is the internal 3.5” floppy disk drive. To maintain the intent of the Commodore 65, the MEGA65 includes that wonderful physical drive for a true retro 8-bit experience, with all its nostalgic sounds and quirks. There are even software box sets available for the MEGA65 that include the software on both SD card and 3.5” floppy. It’s way cool! Check out my unboxings of Showdown and Hibernated.

Before you can use the 3.5” floppy, you need to mount it. There are two ways to do this.

Mounting the 3.5” Drive with the Freezer

Mounting the physical 3.5” floppy disk drive with the Freezer is similar to mounting disk images:

  1. Press and hold the RESTORE key for one second. The Freezer menu will appear.
  2. Select the first managed drive by pressing 0.
  3. Use the cursor down key to select - INTERNAL 3.5" - and press RETURN.
  4. The physical 3.5” floppy drive is now mounted to the first managed drive and the default unit 8.
  5. If you need to change the unit number, press the 8 key to cycle between units 8 and 10.

NOTE: The internal 3.5” disk drive can only be mounted to the first managed drive with unit numbers 8 or 10. It cannot be 9 or 11.

Insert a disk and try the DIR command. If you receive an error, the disk might not be formatted. We’ll take care of that in a bit.

Mounting the 3.5” Drive from BASIC

Earlier we used the MOUNT command with arguments to mount a disk image from the SD card. To mount the internal 3.5” floppy, use the MOUNT command without arguments to assign the internal drive to unit 8:

MOUNT

There are currently no arguments to mount the drive to unit 10. Use the Freezer menu if you need that option.

DD and HD Disks

If we’re going to talk about disk drives, we need to talk about disk formats. There are both double density (DD) and high density (HD) disks, and the MEGA65’s internal floppy drive uses DD disks.

Floppy disks haven’t been manufactured since around 2011, but there is still plenty of stock available. If you’re looking for disks, take a look at FloppyDisk.com. They specialize in finding old pallets and leftover stock, and they even have an Amazon store. You’ll find a link in the MEGA65 Accessories section above.

DD floppy disks are hard to find, and you’re more likely to find HD disks. These are not compatible with the MEGA65 drive by default, but there’s a trick. On the left-hand side of an HD disk, you’ll find a cutout. This is not the same as the cutout on the right-hand side used to write-protect a disk. Place a piece of tape over the HD cutout, covering both sides of the disk for this trick to work, and the MEGA65 will think you’ve inserted a DD disk. If you’ve been around Commodore computers for years, you’ll remember this trick. We used it back in the day too!

Formatting a Disk

Disks don’t work right out of the box; they first need to be formatted. The drive in the MEGA65 emulates the Commodore 1581, a popular Commodore 3.5” drive unit.

WARNING: Formatting a disk erases all content. Make sure you have a blank disk, or that you really want to remove the contents of a previously formatted disk, before you start.

  1. Mount the drive using either the Freezer menu or the MOUNT command. We covered both earlier, so feel free to scroll back and review.
  2. Insert the DD disk (or the HD disk with a piece of tape on it) into the 3.5” floppy drive on the right-hand side of the MEGA65.
  3. Use the FORMAT command followed by a disk name, no more than 16 characters, and a two-character ID of your choosing. Here’s the example from the video:
FORMAT "MYDISK",I11
  1. Answer yes at the prompt. The disk will take a minute or two to format as it crunches and buzzes through the process.
  2. Use the DIR command to verify the format completed properly.

You’re now ready to use this disk to save your BASIC programs.

USING EXTERNAL IEC DISK DRIVES

On the back of the MEGA65 is an IEC port. Even though the MEGA65 includes an internal 3.5” floppy, that doesn’t stop you from using another external drive in your collection, such as a 1541 or a 1581. You can even use a modern Pi1541 or SD2IEC devices. The MEGA65 really does provide a lot of flexibility for any type of storage device you want to use.

BOOTABLE DISKS

The MEGA65 retains the familiar method from older Commodore computers where the first file in a disk directory can be loaded with:

LOAD "*",8,1

Most of us have that built into our muscle memory! This loads the first file on the disk, and you typically run it with the RUN command. The asterisk (*) is a wildcard symbol that tells the MEGA65 to match the first file in the directory without specifying its name.

AUTO-BOOTING DISKS

You can also take advantage of a more advanced autoboot feature introduced with the Commodore 65: a disk can contain a file named AUTOBOOT.C65. If the file exists on the disk and is a valid program, the BOOT command will automatically load and run it. It’s a slick option. As a matter of fact, I could probably spend a whole video on how to create your own AUTOBOOT.C65 to do all kinds of things automatically when you start your MEGA65. If that’s something you’d be interested in, let me know in the video comments.

There are other ways to autoboot. The Configuration Utility discussed in Chapter 4 allows the MEGA65 to automatically mount either a disk image or the internal 3.5” floppy drive during the boot process. When the disk contains an AUTOBOOT.C65 program, the system will automatically load and run it with no user intervention.

This autoboot process is how the intro disk works. The file AUTOBOOT.C65 is part of the MEGA65.D81 virtual disk image stored on the SD card, which is automatically mounted during startup.

Setting up an autoboot disk is useful if you want the MEGA65 to perform specific actions every time it powers up. For example, you can write a short BASIC program, name it AUTOBOOT.C65, and have it configure your screen, text, and colors, or assign commands to function keys.

ACCESSING THE SD CARD FROM BASIC

Here’s a cool trick up the MEGA65’s sleeve: it can access the SD card just like a drive. The most important thing to remember is that the SD card is assigned to unit 12. Keep this in mind and you can use several useful commands to perform interesting operations.

List all the contents of the SD card without activating the Freezer menu. This is how I like to view the SD card when I’m using the MEGA65:

DIR U12

Some programs are in their native .PRG format and are not contained on a disk image. There’s no need to move these to a disk image. Copy the .PRG file to the SD card and load it directly into MEGA65 memory, where PROGRAMNAME is the name of the program and U12 is the SD card:

DLOAD "PROGRAMNAME.PRG",U12

We talked about subdirectories earlier, and you can view them with the DIR U12 command. To navigate into a subdirectory, use CHDIR:

CHDIR "SUBDIRECTORYNAME",U12

To move from the subdirectory back to the root directory, use two dots in place of a directory name, with no unit number:

CHDIR ".."

Many of you know that two dots means “move up a level,” even on modern devices. It works just the same way on our MEGA65.

TIP: By default, the MOUNT command does not require the U12 argument, even though it mounts disk images from the SD card. If you use the U argument when mounting disk images, that argument sets the unit number for the disk image being mounted. Confused yet? It’ll all make sense as you use these commands. I promise!

COMMON DISK OPERATIONS

We’ve used a lot of BASIC 65 disk commands. Let’s take a further look at the ones we’ve used and a few more. The examples below use the same file names I used in the video.

DIR

Display the directory listing of a disk:

DIR
DIR U9
DIR W

DIR lists the default disk image. DIR U9 lists the contents of the unit 9 image. New on the MEGA65, DIR W displays a wide listing in three columns instead of a single column, so it fills more of the screen and you can see more of the contents at once.

Commodore 64 users may remember that loading a directory would overwrite the contents of BASIC memory. You don’t need to worry about that limitation on the MEGA65.

DLOAD and RUN

Load and run programs from a disk with the DLOAD and RUN commands:

DLOAD "COOLGAME"
RUN

Or combine the two in a single command:

RUN "COOLGAME"

DSAVE

Not only will you want to load software, you’ll want to save the software you create in BASIC. Save the current program in memory to disk with DSAVE:

DSAVE "MYGAME"
DSAVE "MYGAME",U9

The second example saves to the unit 9 device. To overwrite an existing file, add the @ option:

DSAVE "@MYGAME",U9

Commodore 128 and TED series users will be familiar with using the @ symbol to replace files. Commodore 64 and VIC-20 users, this one will be new to you!

BACKUP

Back up an entire disk from one unit to another with the BACKUP command:

BACKUP U8 TO U9

This is handy for making backups of disk images and for copying the contents of a disk image to a physical floppy, or vice versa. Yes, you can do that!

COPY

The COPY command copies a file. The first example copies the file to a new file on the same disk or image. The second copies a file across two different disks or images, depending on which devices you’ve attached to which units. Really handy stuff!

COPY "MYGAME" TO "MYGAME-1"
COPY "MYGAME",U8 TO U9

NOTE: See the VIDEO ERRATA for the corrected unit-to-unit syntax.

RENAME

Rename files with the RENAME command:

RENAME "MYPROGRAM-V1" TO "MYPROGRAM-V2"

DELETE

There are times you’ll want to delete a file. Use the DELETE command, either on the default unit or, in the second example, on unit 9:

DELETE "JUNKFILE"
DELETE "JUNKFILE",U9

SHORTCUT DISK COMMANDS

BASIC 65 includes several shortcut commands so you don’t have to type the full command. Some of these will be familiar to folks who’ve used things like the Epyx Fast Load cartridge.

Shortcut Action
/ LOAD a program
↑ RUN a program (the up arrow next to the * key, not the cursor key)
← SAVE a program (the left arrow next to the 1 key, not the cursor key)
@ Display the disk drive status
$ Display the directory

Better yet, you can combine these shortcuts with the U argument to specify which unit you want to act upon.

Here’s a fun example of how I like to use these shortcuts together:

  1. Make sure you have a disk or disk image available in the drive.
  2. In immediate mode, type $ and press RETURN. The directory displays.
  3. Use the cursor keys to place the cursor at the far left of the line with the program you want to load.
  4. Type the ↑ (up arrow) key and press RETURN.
  5. The MEGA65 ignores everything on the line except the file name, then loads and runs the program. Pretty slick!

There’s more information about each disk command in Appendix A: BASIC Command Reference. I encourage you to visit those pages to learn even more.

CONCLUSION

That closes Chapter 6 of our MEGA65 User’s Guide series. Learning to use drives on the MEGA65 is a crucial skill, and it will get easier over time. I promise! As mentioned, if you need help, reach out to the MEGA65 Discord. There are a ton of folks there willing to help you on your MEGA65 journey.

Channel members also get access to my Discord, where we have a MEGA65 channel and a friendly group of retroCombians who are also MEGA65 owners. We’ll be happy to help if the larger MEGA65 Discord feels overwhelming. Become a channel member to join us. If this chapter helped, leave a tip.

Until next time, what are you waiting for? Get out there, download some software from the Filehost, and give your MEGA65 a good shakedown. Missed the last one? Catch up with Chapter 5: Upgrading the MEGA65, and I’ll see you in Chapter 7: Transferring Files. 🕹️ retroCombs, OUT!

Comments

Comments use GitHub Discussions; sign in with GitHub to join in.