VICE 0.14.2
the Versatile Commodore Emulator

User's manual


Index


1. Overview

VICE is the one and only Versatile Commodore Emulator. It allows you to emulate the Commodore C64, VIC20 and PET2001/3032/4032/8032/8096/8296 8-bit computers with one single package. The emulators run as separate programs, but have the same user interface, share the same settings and support the same file formats.

If you are a user of the previous 0.11.0 version, you will notice that the C128 emulator is no longer included. We apologize for this, but there was really no time to work at it anymore, as too much time was been spent with the many improvements for the other emulators. If you need the C128 emulator you must stick to the 0.11.0 release (which is still available)... or help us to maintain it in the new VICE versions.

1.1. Emulation features

All the emulators provide an accurate 6502/6510 emulator, with emulation of all the opcodes and accurate timing. Also, all of the undocumented opcodes are implemented. Unlike other emulators, the emulation of all the chips (except the VIAs) is cycle accurate, and tries to emulate timings as precisely as possible.

Please do not expect the VIC20 and PET emulators to be as good as the C64 one, as they are still under construction.

1.1.1. C64 emulator

The C64 emulator features a fairly complete emulation of the VIC-II video chip: sprites, all registers and all video modes are fully emulated. Since version 0.13.0, the emulation is fully cycle-accurate.

Moreover, a rather complete emulation of the SID sound chip is provided. All the basic features are implemented as well as most of the complex ones including sync and ring modulation. Filters are the only major feature missing at the moment.

Of course, also both CIAs are cycle-accurate and fully emulated.

1.1.2. VIC20 emulator

The VIC20 is not complete yet, but already emulates all the internal hardware, including the VIA chips. Only part of the VIC-I video chip features are emulated, so many graphical effects will not work correctly.

Sound is implemented, but is still at the experimental stage. If you think it does not sound right and know how to improve it, feel free to contact us.

The VIA chips are not cycle-exact at the moment.

1.1.3 PET emulator

The PET emulator emulates the 2001, 3032, 4032, 8032, 8096 and 8296 models, which in general covers all models of this kind of machines! The hardware is pretty much the same and that is why one single program is enough to emulate all of them. For more detailed information about PET hardware please refer to the PETdoc file.

Both the 40 column and 80 column CRTC video chips are emulated (from the 4032 onward), but a few of the features are not implemented yet (numbers of rasterlines per char and lines per screen). Anyway, those missing features are not very important for average applications.

Sound is available for the PET as well, but like the VIC20 it is still under construction. Of course, also the PET VIA is not cycle-exact.

The PET 8096 is basically a PET 8032 with a 64k extension board, that allows remapping the upper 32k with RAM. You have to write to a special register at $fff0 to remap the memory. The PET 8296 is a 8096 but with a completely redesigned motherboard with 128k RAM in total. Of the additional 32k RAM you can use only some in blocks of 4k, but you have to set jumpers on the motherboard for it. VICE uses the command line options -petram9 and -petramA instead. Also the video controller can handle a larger address range. The PET 8x96 model emulations run the Commodore LOS-96 operating system - basically an improved BASIC 4 version with up to 32k for BASIC text and 32k for variables. See PETdoc for more information.

The PET computers came with three major ROM revisions, so-called BASIC 1, 2 and 4. all of which are provided. The PET 2001 uses the version 1, the PET 3032 uses version 2, and the others use version 4. The 2001 ROM is horribly broken in the IEEE488 part (they shipped it before they tested it with the floppy drive, so only tape worked - which is not supported in this emulator) so the ROM is patched to fix the IEEE488 routines.

What the 2001 patch basically does is (amongst more low level fixes) get the load address for a program file from the first two bytes of the file. This allows loading of PET2001-saved files (that have $0400 as load address) and other PET files (that have $0401). The PET2001 still saves from $0400, not from $0401 as other PETs do.

Moreover, the secondary addresses being used now are 0 and 1 for load and save, and not arbitrary unused secondary addresses.

To select which model to run, you specify the model on the command line with the -model MODEL option, where MODEL can be one of a list of PET model numbers, all described below.

1.2. The keyboard

Using the keyboard is quite straightforward, as each key is mapped to its usual character. VICE will press and release the Shift keys automatically to make everything work as expected.

Special keys are mapped differently for the VIC20 and C64 emulators and the PET emulator.

VIC20/C64 mapping:

PET mapping:

When joystick emulation via the numeric keypad is enabled, the numeric keypad emulates the joystick as follows:

In order to emulate diagonal directions, you can either press two direction keys together or use the 7, 9, 1 and 3 keys. Moreover, 5 moves the cursor down as 2 so that the layout is somewhat more comfortable if you are used to the layout of the cursor keys in standard PC keyboards.

One catch for the PET, though. Because the PET do have a numerical keyboard and the joysticks are rarely used, the joystick emulation can be switched on and off via menu, resource and the command line option -npjoystick.

There are also some keys that perform frequently used commands:

1.3. The disk drive emulation

All the emulators support emulation of up to 4 external disk drives as devices 8, 9, 10 and 11. Devices 8, 9 and 10 emulate virtual Commodore 1541 drives using disk images, i.e. files that contain a dump of all the blocks contained in a real floppy disk (if you want more information about what a disk image is, consult the comp.emulators.cbm FAQ). Device 11, instead, accesses file system directories, thus allowing you to access files without having to copy them to disk images. In addition, device 11 can be used to read and write P00 files (notice that, unlike other emulators, VICE uses the real file system name instead of the internal P00 name to access these files).

There are two available types of 1541 emulation for the disk image-based emulation. One of them the DOS level drive emulation. It does not really emulate the serial line, but patches the kernal ROM (with the so-called serial traps) so that serial line operations can be emulated via C language routines. This emulation is very fast, but only allows use of standard DOS functions (and not even all of them).

The other alternative is a hardware level drive emulation. The Commodore 1541 disk drive was provided with its own CPU (a 6502 as the VIC20) and its own RAM and ROM. So, in order to more closely emulate its features, a complete emulation of this hardware must be provided and that is what the hardware level emulation does. When the hardware level emulation is used, the kernal routines are no longer patched and the serial line is fully emulated. The problem with this emulation is that it needs a lot of processing power, mainly because the emulator has to emulate two CPUs instead of one.

The hardware level emulation is only available on the VIC20 and C64 emulators, and can only be used to emulate one drive at a time. As a consequence, it is only available for unit 8 and disables all the other drives when activated.

On the other hand, the PETs don't use a serial IEC bus to communicate with the floppy, instead they use the parallel IEEE488 bus. This bus transfers byte by byte, as opposed to bit by bit as the C64 and VIC20 do, so in this case it is feasible to emulate the parallel line completely while emulating the drive at DOS level only. The IEEE488 line interpreter maps the drives 8-11 (as described above) to the IEEE488 disk units, and no kernal traps are needed. The same emulation is available in the C64, to emulate the Commodore IEEE488 bus interface.

1.4. Supported file formats

VICE supports the most popular file formats:

An utility (c1541) is provided to allow transfers between these formats.

Notice that the native format for disk images is X64; this means that, although the emulators and utilities can both read and write on D64 disk images, they never produce D64 files.

You can convert an X64 file back into a D64 file with the UNIX dd command:

1.5. System-specific notes

VICE should compile and run without major problems on many UNIX systems, but there are some known issues related to the sound driver. In fact, sound is the least portable part of the emulator and has not been thoroughly tested on all the supported platforms yet.

Linux, AIX and SGI systems should play sound without any problems; if you are running Linux please use the new 2.x kernels, as VICE needs some features that were not implemented in older versions of the Linux sound driver.

On the other hand, HP-UX and Solaris machines are known to cause troubles. If you think you can help debugging the code for these systems, your help would be really appreciated. We are having troubles finding HP-UX and SUN consoles to work at...


2. Usage

2.1. Using the PET/VIC20/C64 emulators

The names of the available emulators are:

You can run each of them by simply typing the name from a shell. If you want to run them from another application (e.g. a window manager or some other sort of program launcher) you should always run them from a terminal window such as xterm or rxvt, as a lot of debugging information is printed and the built-in monitor will be run in there.

There are several options you can specify on the command line, and the -help option lists them all. See below for a detailed description of all the command-line options.

2.1.1. The system ROMs

In order to work properly, the emulators need to load the system ROMs. The place where they will be searched for depends on the value of the directory resource. (See below for a description of what resources are and how they can be changed)

If directory is empty, the emulator will search for the ROMs in two places; first of all, it will try to load them from

where <EMU> is the emulator ID and can be either C64, VIC20 or PET. If they are not found here, it will try to load them from the current directory, under C64, VIC20 or PET.

If a directory has been specified instead, the emulator will always try to boot only from that directory.

The default ROM names for the VIC20 and C64 emulators are the following:

For the PET emulator the Basic and Kernal ROMS are packed into a single file. Only three kernal files are provided; one for each basic revision. To handle the different screen sizes and keyboards, different so-called `editor-ROMs' for the memory range $E000-$E800 are provided. The kernal files contain an editor ROM for 40 columns and graphics keyboard already. The PET ROMs have the following names:

The PETs also have sockets for extension ROMs for the addresses $9000-$9FFF, $A000-$AFFF and $B000-$BFFF (the last one for PET2001 and PET3032 only). You can specify ROM image files for those extensions command line options -petrom9, -petromA and -petromB resp.

An alternative would be to specify a long kernal ROM with the -kernal option that includes the extension ROM areas already.

Also, you can specify a replacement for the basic ROM at $B000-$DFFF with the -petromBasic option and a replacement for the editor ROM at $E000-$E7FF with the -petromEditor option.

You can also edit the configuration file as explained in the appropriate section.

When started, the emulator will also try to load a RAM image file (default name is ram) with the same behavior described above. If not found, the RAM will be initialized as after a power-up.

2.1.2. The menus

When the emulator is running, two pop-up menus can be opened by pressing the right and left mouse button. The `left' menu is used to issue commands, while the `right' menu can be used to change emulation settings.

2.1.2.1. Command Menu (left button)

2.1.2.2. Option menu (right button)

2.1.3. The .vicerc configuration file and the command-line options

When started, the emulator will search for a .vicerc configuration file in your $HOME directory (VICERC in the current directory on MS-DOS). On UNIX, if this is not found it will also try to find a vicerc file in your installation directory (usually something like /usr/local/lib/vice). If they are both unavailable, the settings will be set to the default values. After the settings are initialized, the emulator parses the command line; this allows you to override the values found in the configuration file.

The configuration file contains the settings for all the emulators; this is achieved by dividing the file into emulator-specific sections. Each section begins with the name of the related emulator in brackets, i.e. one of these:

This setup makes it possible for you to edit the configuration file with a text editor.

The resources for one emulator must be specified in the following form:

There can be spaces between the ResourceValue and the `=' symbol, and they will not be included in the value. If you want to force them, you must put the ResourceValue between double quotes ("...").

All the resources have command-line counterparts, but some command-line options are not available as resources. Here is a list of all the command-line options (in parenthesis, you'll find the name of the corresponding resource specification if available):

2.1.4. The Monitor

The built-in monitor features command-line editing with history and file name completion. It accepts the following commands:

2.1.5. The XDebugger

(Warning: the XDebugger is still under construction, and is not 100% functional yet).

When the XDebugger is enabled, a new window pops up. On the left it shows the opcode the CPU is working on, while on the right several register contents are displayed.

Below the registers is the status line. It shows the status of the emulator. It can be Running, Halted or Trace. You can switch between the states with the buttons below the status line. Run lifts off the CPU, Stop halts it, and Trace lets it run with displaying the executed opcodes in the left window.

When the emulator is stopped, it is possible to run single-step execution by pushing the Step button.

With the Skip button the next opcode to be executed can be skipped. This way JAM (i.e. illegal) opcodes can easily be used to trap a program and then be skipped here.

2.2. Using c1541

c1541 is a stand-alone disk image maintenance program. It can be used both interactively and from the command line.

The syntax is:

If some OPTIONS but no IMAGE is specified, c1541 runs in batch mode; otherwise, it attaches the IMAGE if present and enters the interactive mode, where you can type commands that are executed when you press Enter (abbreviations are allowed). As with the monitor, file name completion and command line editing with history are provided. Use quit to exit.

Notice that c1541 always creates X64 files, but can read and write D64 files automatically, without the need for any special options.

Each command-line option has an interactive-mode counterpart, that is shown in parenthesis: (abbreviations are allowed when not ambiguous)

When more than one command is specified in batch mode, all of them are executed in the same order they have on the command line.

This information should also be available in section 1 of the on-line manual pages (man 1 c1541).

2.3. Using petcat

petcat can be used to expand tokenized basic programs into 7-bit ASCII text. The syntax is:

FILES can be either raw CBM binary files or P00. The available options are:

Available versions are:

More information about petcat should be available in section 1 of your on-line manual pages (man 1 petcat).


3. Other documents


4. Acknowledgments

VICE derives from X64, the first Commodore 64 emulator for the X Window System. Here is an informal list of the people who were mostly involved in the development of X64 and VICE:

The VICE core team:

Former team members:

External contributors:

(We hope we have not forgotten anybody; if you think we have, please tell us)

Thanks also to everyone else for sending suggestions, ideas, bug reports, questions and requests. In particular, a warm thank goes to the following people:

Last but not least, a very special thank to:

for writing really cool emulators to compete with. :-)


5. Copyright

VICE is Copyright (c) 1993-1998 Ettore Perazzoli, Teemu Rantanen, André Fachat, Jouko Valta, Jarkko Sonninen and Daniel Sladic.


6. Contacts

You can find the latest news about VICE at the official VICE home page:

Also the public patches and beta releases will be available there as well, so you might want to have a look at it periodically. If you are going to report a bug, please check those pages first; it is possible that the problem you encountered has already been fixed with a newer version.

If you want to report bugs, make suggestions or contribute to the project, please email one of the following people:

Please put the word VICE in all capitals in your subject line (e.g. VICE fails to run game XXX). This helps mail splitting and reduces chances that your message is unintentionally deleted, forgotten or lost.

When you report a bug, please try to be as accurate as possible and describe how it can be reproduced to the very detail. You should also tell us what machine you are running on, what operating system you are using as well as the version of it.

In any case, we would really be glad to receive your comments about VICE.

If you want to contribute, please ask first. It has already happened a couple of times that somebody started working at something that had already been done but not released to the public, and we really do not want anybody to waste time.

People willing to port VICE to other platforms are always welcome. In particular, we would be really glad if somebody ported VICE to MacOS or Windows NT/95. A port of the 0.11.0 C64 emulator for MacOS already exists but it is quite buggy and not maintained any longer.

There are some newsgroups you might be interested in:

We also recommend reading the comp.emulators.cbm and comp.sys.cbm FAQs, which are posted regularly on the corresponding newsgroups and are also available via FTP from ftp://rtfm.mit.edu.


Last modified: Sat Apr 4 23:05:41 CEST 1998