Commodore 64 Cheat Sheet

Celebrity Monologues. This base allows guest posting, but please register for the full experience.

Moderators: AArdvark, Ice Cream Jonsey

User avatar
Flack
Posts: 8820
Joined: Tue Nov 18, 2008 3:02 pm
Location: Oklahoma
Contact:

Commodore 64 Cheat Sheet

Post by Flack »

(ICJ, please move to whichever message base is best suited.)

01. BASIC

Image

Powering on the Commodore 64 places you at a BASIC prompt. Note that by simply turning the machine on, the amount of available RAM drops from 64k to 39k. Fake news!

02. ATTACHING A DISK IMAGE

Image

All Commodore 64 emulators recognize .D64 files as Commodore disk images. In real life you would would insert a disk into your disk drive before using it. In an emulator, you must "attach" the disk. Different emulators have different ways to do this but they're all the same basic idea. Note that each physical disk drive on the Commodore 64 had an assigned number on the serial bus, and the first one was always #8. 99% of all Commodore programs assume you are loading from drive 8, and many/most multifile programs will fail if loaded from a different drive.

03. GET A DIRECTORY

Image

Getting the list of files on a C64 floppy takes two commands. The first command loads the list of files and the second one displays them. The command to load a directory is:
LOAD"$",8
LIST
A few things here. First, the C64 keyboard does not match up with a PC keyboard. The quotation mark on a C64 keyboard is Shift-2 (@ on a PC keyboard). Also note that spaces are optional in the middle of most commands, so the following three commands are identical:

Code: Select all

LOAD"$",8
LOAD "$" ,8
LOAD          "$"          ,8
After typing LIST, you can see that the disk I inserted contains a few games.

04. LOADING PROGRAMS / WILDCARDS

Image

The Commodore 64 processes filenames in sequential order, and supports wildcards (*) when matching file names. If we want to load "Hideous Bill", which also happens to be the first file on the disk, we can do that in a number of ways.
LOAD "HIDEOUS BILL" ,8,1 -- this works because the file name is an exact match.
LOAD "HID*" ,8,1 -- this works because HID* matches the first file.
LOAD "*" ,8,1 -- this works because the wildcard just matches the first file it comes to.

Many people think LOAD "*" ,8,1 means "load the game!" or something. Really it means "load the first file you come to," and for all commercial games, the loader file would be the first file on the game's disk.

05. LOADING / RUN

Image

Once the game has loaded, type RUN to start the game (or often, to start more loading.)

06. WAIT

Image

Commodore's 1541 disk drive was notoriously slow, so be patient. Eventually, your game should load and run. If you come to one of those fancy cracking screens, you'll have to hit the space bar to bypass it.

07. LOADING OTHER FILES ON A DISK

Image

Let's jump back to the directory for a moment. Let's say instead of Hideous Bill, we wanted to play Archon II. Since we know the filename, we COULD type LOAD "ARCHON II" ,8,1 ... but I am lazy, so let's just load "A*" since "Archon II" is the first file that starts with the letter "A" on the disk.

Note in the directory that there are two files that start with the letter A. The first one (Archon II) is only 1 block long and the second one (Archon II-2048) is much larger. The second one is the ML code that the first one will load into memory and execute. When in doubt, load the first/smallest file.

08. WHEN DONE, TYPE RUN

Image

Just like that, we've loaded a different game off of the same disk!

09. FASTLOAD

Image

Most emulators also support the use of cartridge files. The Epyx Fastload cartridge will not only make games load 7x faster, but also greatly simplifies all the disk commands. To use it, you'll have to track down an image of the cartridge in .CRT format and virtually attach it to your Commodore emulator. One you have done that and turn on the machine, you should see the word "FASTLOAD" appear underneath the READY prompt. You're in business!

10. FASTLOAD COMMANDS

Image

With the Fastload cartridge in, you can now get a directory simply by typing $ and hitting return. The entire load command has been replaced by a % sign. To load Pipeline from the disk, all I had to type was %p* and hit enter.

11. THAT WAS FAST

Image

You can't tell from your side, but that game loaded really quickly!

---

CHEAT SHEET

Directory: LOAD "$" ,8 followed by LIST
Load: LOAD "FILENAME" ,8,1 followed by RUN
For loading files, wildcard can be used.

Keyboard quirks:

Quotation Mark: Shift 2
Asterisk: ]
Restore = Page Up
Run/Stop = ESC
Control = Tab Key
Commodore Key - Left CTRL key
"I failed a savings throw and now I am back."

User avatar
AArdvark
Posts: 16107
Joined: Tue May 14, 2002 6:12 pm
Location: Rochester, NY

Re: Commodore 64 Cheat Sheet

Post by AArdvark »

There was no way to move files from drive 8 to drive 9 with the onboard basic, was there. I had to install JiffyDos for stuff like that

User avatar
Jizaboz
Posts: 4788
Joined: Tue Jan 31, 2012 2:00 pm
Location: USA
Contact:

Re: Commodore 64 Cheat Sheet

Post by Jizaboz »

Cool stuff man. This is an excellent guide for beginners and even a reminder for veterans.

For a while I was really interested in programming for the C64 but got stuck.. then my interest shifted to Vectrex. I would love to come back to it one day though as modern programming tools for C64 dev are really nice. It's just that I get hung up on things. My last deal was I could not how tf to print a background AND animated sprites in the same "game loop". I could only do one or the other.

Flack and I have a "demo" to create one day so perhaps tinkering with that will give me a couple of ah-ha moments.
(╯°□°)╯︵ ┻━┻

User avatar
Flack
Posts: 8820
Joined: Tue Nov 18, 2008 3:02 pm
Location: Oklahoma
Contact:

Re: Commodore 64 Cheat Sheet

Post by Flack »

AArdvark wrote: Mon Jun 22, 2020 6:12 pm There was no way to move files from drive 8 to drive 9 with the onboard basic, was there. I had to install JiffyDos for stuff like that
So as much as I love the Commodore 64, I will be the first to say that doing anything related to files or disks from the command line is an exercise in frustration.

The Epyx Fastload cartridge has the most basic features built into a menu system. On the C64, you enter this menu by typing the British pound key on the C64's keyboard. In WinVice and some other emulators, that key has been mapped to the INS key on a PC keyboard.

Image

Note that even with this, you have to do a directory, note the full file name, then select copy, and type in the entire filename. It's certainly not very efficient. In reality, everyone back then used Fast Hack 'em or copy/disk utilities to highlight files and copy them between disks. I don't remember ever copying a file from the command line.
"I failed a savings throw and now I am back."

Post Reply