Running the Programs: VICE, .PRG Files and Real Hardware
AT A GLANCE
- Emulator
- VICE, free, for Windows, macOS and Linux
- Which C64
- x64sc, the cycle-exact one
- Run a .PRG
- Drag it onto the VICE window
- Real C64
- Copy the .PRG to an SD card for an SD2IEC, then LOAD"NAME",8
Every listing on this site comes with a ↓ .PRG button: the finished program, ready to load. This page shows how to run those files in VICE, the emulator used to test every listing here, and on a real Commodore 64.
Install VICE
- Download VICE from vice-emu.sourceforge.io. On Windows take the GTK3 build for 64-bit Windows; macOS and Linux builds are on the same page.
- Unzip it anywhere. There is nothing to install, and the C64 ROMs come with it.
- Start
x64sc. VICE ships several emulators;x64scis the C64, emulated cycle by cycle. A blue screen withREADY.means it works.
Run a .PRG
Three ways, from simplest to most flexible:
- Drag and drop. Drag the .PRG file onto the VICE window. VICE resets the C64, loads the program and types RUN for you.
- Smart attach. File > Smart attach, pick the file and choose Autostart. The same thing, through a menu.
- Command line.
x64sc -autostart ZARIA.prg. This is what the Lab does after every build.
When the program has finished loading, type LIST to see its listing on the C64 itself, exactly as the C64 stores it.
The keys that are not on your keyboard
The C64 keyboard has keys a PC does not. VICE maps them to nearby keys. With the default keymap:
| C64 key | On a PC | Used for |
|---|---|---|
| RUN/STOP | Esc | stop a program or a LIST |
| RESTORE | Page Up | with RUN/STOP: reset the screen, keep the program |
| CLR/HOME | Home | {HOME}, and {CLR} with SHIFT |
| INST/DEL | Backspace | delete, and insert with SHIFT |
The C= and CTRL keys, used for colour codes, depend on your keyboard layout and VICE version. Preferences > Settings > Input devices > Keyboard shows the keymap in use, and you can switch between a symbolic map (type the character printed on your PC key) and a positional one (keys sit where they would on a C64).
Keep what you type
VICE starts without a disk in the drive, so SAVE"NAME",8 has nowhere to go. Before you type in a long listing:
- File > Create and attach an empty disk image. Give it a name such as
c64coding.d64. - Type, and SAVE"ZARIA1",8 every few minutes.
- Next time, attach the same .d64 and LOAD"$",8 then LIST to see what is on it.
A snapshot is quicker still: Snapshot > Save snapshot freezes the whole machine, program, screen and all, and Load snapshot brings it back exactly as it was.
Real hardware
A .PRG file is exactly what a C64 drive stores, so it runs unchanged on the real machine. The easy routes:
- SD2IEC and similar SD-card drives: copy the .PRG to the card, then LOAD"ZARIA",8 and RUN.
- 1541 Ultimate, Ultimate 64 and similar cartridges: pick the .PRG from the cartridge menu and run it.
- Typing it in, the way it was meant to be: the type-in guide covers everything you need.
Programs that POKE into memory can behave differently on NTSC machines, on other emulators, or with fast-loader cartridges switched on. If something looks wrong, try it in VICE x64sc with a PAL C64, the setup every listing here is tested on.
Comments
Post a Comment