VICE is the one and only Versatile Commodore Emulator. It provides emulation of the Commodore 64, 128, VIC20 and PET 8-bit computers within a single package. The emulators run as separate programs, but have the same user interface, share the same settings and support the same file formats.
Important notice: If you have no idea what a Commodore 8-bit computer is, or have questions about how these machines are used, how the file formats work or anything else that is not strictly related to VICE, you should read the appropriate FAQs first, as that kind of information is not available here. See section 14 Contact information for information about how to retrieve the FAQs.
All the emulators provide an accurate 6502/6510 emulator, with emulation of all the opcodes (both documented and undocumented ones) and accurate timing. Unlike other emulators, VICE aims to be cycle accurate; it tries to emulate chip timings as precisely as possible and does so efficiently.
Please do not expect the VIC20, C128 and PET emulators to be as good as the C64 one, as they are still under construction.
The C64 emulator, called `x64', features a fairly complete emulation of the VIC-II video chip: sprites, all registers and all video modes are fully emulated. The emulation has been fully cycle-accurate since version 0.13.0.
A rather complete emulation of the SID sound chip is also provided. All the basic features are implemented as well as most of the complex ones including synchronisation, ring modulation and filters. There are two emulators of the SID chip available: one is the "standard" VICE emulator, available since VICE 0.12; the other one is Dag Lem's reSID engine. The reSID engine is a lot more accurate than the standard engine, but it is also a lot slower, and only suitable for faster machines.
Naturally, also both CIAs (or VIAs, in some cases) are fully emulated and cycle accurate.
The C128 emulator, called `x128', features a complete emulation of the internal MMU (Memory Management Unit), plus all the features of the C64 emulation. The following things are missing, though:
The VIC20 emulates all the internal hardware, including the VIA chips. The VIC-I video chip is only partially emulated, so some graphical effects will not work correctly.
Sound support is implemented, but is still at an experimental stage. If you think it could be improved and know how to do so, feel free to contact us (see section 14 Contact information).
The PET emulator emulates the 2001, 3032, 4032, 8032, 8096, 8296 and SuperPET (MicroMainFrame 9000) models, covering practically the whole series. The hardware is pretty much the same in each 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). Fortunately, they are not very important for average applications.
Sound is available for the PET as well, but like the VIC20's it is still under construction.
The PET 8096 is basically a PET 8032 with a 64k extension board which
allows remapping the upper 32k with RAM. You have to write to a special
$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 SuperPET also is a PET 8032 with an expansion board. It can map 4k
at a time out of 64k into the
$9*** area. Also it has an ACIA
6551 for RS232 communication. The 6809 that is built into the SuperPET
is not emulated, though.
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 with respect to IEEE488 (they shipped it before they tested it with the floppy drive, so only tape worked. Therefore the emulator patches the ROM to fix the IEEE488 routines.
As well as other low-level fixes the 2001 patch obtains the load address for a program file from the first two bytes of the file. This allows the loading of both PET2001-saved files (that have $0400 as their load address) and other PET files (that have $0401). The PET2001 saves from $0400 and not from $0401 as other PETs do.
Moreover, the secondary addresses used are now
load and save, respectively, and not arbitrary unused secondary
To select which model to run, specify it on the
command line with the
-model MODEL option, where
MODEL can be one of a list of PET model numbers, all
described in see section 7.3.1 Changing PET model settings
The CBM-II emulator emulates several types of CBM-II models. Those
models are known under different names in the USA and Europe. In the
States they have been sold as
B256, in Europe as
CBM 620 (low-profile case) or
CBM 710 and
CBM 720 (high-profile case with monitor).
These computers are prepared to take a coprocessor board with an 8088 or
Z80 CPU. Indeed there are models
CBM 630 and
CBM 730 that
supposedly had those processors. However these models are not emulated.
The basic difference is the amount of RAM these machines have been
supplied with. The
B128 and the
CBM *10 models had 128k
RAM, the others 256k. This implies some banking scheme, as the 6502 can
only address 64k. And indeed those machines use a 6509, that can
address 1 MByte of RAM. It has 2 registers at addresses 0 and 1. The
indirect bank register at address 1 determines the bank (0-15) where the
LDA (zp),Y and
STA (zp),Y take the data from. The
exec bank register at address 0 determines the bank where all other read
and write addresses take place.
Many models have been expanded to more than the built-in memory. In fact some machines have been expanded to the full 1M. Bank 15 is used as system bank, with only little RAM, and lots of expansion cartridge ROM area, the I/O and the kernal/basic ROMs. Some models have been modified to map RAM into the expansion ROM area. Those modifications can be emulated as well.
The different settings are described in see section 7.4.1 Changing CBM-II model.
There are two ways of emulating the keyboard in VICE.
The default way (symbolic mapping) is to map every X11 key combination to the corresponding key combination on the real machine: for example, if you press *, which is bound to Shift-8 on a U.S. keyboard, in the C64 emulator, the emulated machine will have just the unshifted * key pressed (as * is unshifted on the C64 keyboard). Likewise, pressing ' on the same U.S. keyboard without any shift key will cause the combination Shift-7 to be pressed in the emulated C64. This way, it becomes quite obvious what keys should be typed to obtain all the symbols.
There is, however, one problem with symbolic mapping: some keys really need to be mapped specially regardless. The most important examples being, in the VIC20, C64 and C128 emulators, that CTRL is mapped to Tab and that the Commodore key is mapped to the left Control). The RUN/STOP key is mapped to the ESC key on the PC keyboard. The PET emulator, lacking the Commodore key but having an ESC key, uses the left Control key as RUN/STOP and the ESC key as ESC of course.
The second way (positional mapping) is to map every key on the "real" keyboard to the key which has the same position on the keyboard of the emulated machine. This way, no Shift key is forced by the program (with the exception of the function keys F2, F4, F6 and F8, which require Shift on the Commodore keyboards), and the keyboard is more comfortable to use in those programs (such as some games) that require the keys to be in the correct positions.
Warning: unlike the real C64, VICE "presses" the Shift key together with the key to shift when the Shift must be forced. In most cases this should work fine, but some keyboard routines are quite picky and tend not to recognize the shift key because of this. For instance, F6 (which on the real C64 is obtained with Shift + F5) could be recognized as F5. In that case, use the shift key manually (i.e., type Shift + F5 in the example). Yes, we know this is a bug.
The RESTORE key is mapped to Page Up (or Prev) by default.
Joysticks can be emulated both via the keyboard and via a real joystick connected to the host machine (the latter only works on GNU/Linux systems).
There are two keyboard layouts for joystick use, known as numpad and custom.
The numpad layout uses the numeric keypad keys, i.e., the numbers 1...9 which emulate all the directions including the diagonal ones; 0 emulates the fire button.
The custom layout uses the keys w, e, r, s, d, f, x, c, v for the directions and space for the fire button instead.
All the emulators support up to 4 external disk drives as devices 8, 9, 10 and 11. Each of these devices can emulate virtual Commodore 1541 drives in one of two ways:
P00format (again, consult the
comp.emulators.cbmFAQ for more info).
When using disk images there are two available types of 1541 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 kernal 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 the PETs) 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 remain unpatched 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.
However, the PETs do not use a serial IEC bus to communicate with the floppy drive but instead use the parallel IEEE488 bus. This does byte by byte transfers, as opposed to the bit by bit transfers of the C64 and VIC20, so making it 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 of the Commodore IEEE488 bus interface is available for the C64.
VICE supports the most popular Commodore file formats:
D64disk image files;
G64GCR-encoded 1541 disk image files;
T64tape image files (read-only);
An utility (
c1541, see section 10 c1541) is provided to allow transfers
and conversions between these formats.
Notice that the native format for disk images is
means that, although the emulators and utilities can both read and write
D64 disk images, they never produce
You can convert an
X64 file back into a
D64 file with the
dd bs=64 skip=1 if=IMAGE.X64 of=IMAGE.D64
See section 11 The emulator file formats for a technical description of the supported file formats.
This section tries to describe the most common known problems with VICE, and how to resolve them.
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, the sound code is the least portable part of the emulator and has not yet been thoroughly tested on all the supported platforms.
Linux, AIX and SGI systems should play sound without any problems; if you are running Linux please use a 2.x kernel, 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...
Some problems have been reported with the proprietary version of the Open Sound System for Linux. With a Crystal sound card, sound output was significantly delayed and, apparently, the allocated buffer size was completely wrong. This is not a VICE bug, but rather an OSS bug.
If you cannot start VICE because you get errors about shared memory, try to run it with the `+mitshm' command-line option (see section 6.4.2 Video command-line options). This will completely disable usage of the MITSHM extensions, that are normally used to speed up the emulation window updates. Of course, this will also result in a big loss in speed.
Reasons for this failure could be:
If you want to avoid running the emulator with `+mitshm' every time, run it once with `+mitshm' and then choose "Save settings" from the right-button menu.
VICE supports the emulation of a printer either on the userport or as
IEC device 4. Unfortunately the Commodore IEC routines do not
send all commands to the IEC bus. For example an
is not seen on the IEC bus. Also a
CLOSE 1 after that
is not seen. VICE can see from printing that there was an
but it cannot see when the close was. Also a "finish print job"
cannot be seen on the userport device.
To flush the printer buffer (write to
print.dump or to the
printer) now a menu entry can be used. Disabling and re-enabling the printer
should work as well.
The printing services have not been extensively tested but apart from the problem mentioned above it should work fine now.
If you find that the German keyboard mapping (plus German charset) does not print uppercase umlauts, then you are right. The umlauts replace the [,\ and ] characters in the charset. The keys that make these characters do not have a different entry in the PET editor ROM tables when shifted. Thus it is not possible to get the uppercase umlauts in the editor. Nevertheless other programs are reported to change the keyboard mapping table and thus allow the use of the shifted (uppercase) umlauts.
Anyway, the VICE keyboard mappings are far from being perfect and we are open to any suggestions.
Go to the first, previous, next, last section, table of contents.