Compucolor II Emulator Help

This is a collection of random notes that might make it easier to use the emulator. The Compucolor II had some funky features that have been faithfully emulated, but made worse by the fact that the PC keyboard is missing many of the dedicated keys that the Compucolor had (where is the "cyan" key?)

The Most Important Things

The Compucolor II, like most micros of that era, were very quirky machines, and in this case, the keyboard was a standout in that regard. There are a few things to know in order to get much of anything done.

The Compucolor doesn't have lower case characters; instead, those codes map to various graphics glyphs, such as chess pieces. Since all BASIC commands must use upper case, you have to hold Shift to type letters, or more conveniently, just enable your Caps Lock key.

Quickest way to kick the tires: use "Run a program" pulldown, although it doesn't work in all browser versions. See the later section on Autotyping.

The Compucolor has various modes of operation, and it can be confusing if you find yourself stuck in one you didn't plan on. The mode you care most about is BASIC mode, and is the default mode when you start the machine. For example, typing Esc D will put you in the FCS (file control system) mode. In general, typing Esc E will put you back in BASIC while preserving whatever program was in memory, and Esc W will get you back into BASIC mode while clearing out the program. In the worst case, hit the Hard Reset button or reload the page to get a fresh start.

When entering text, left arrow and backspace both erase one character. CTRL-K erases text to the start of the line. CTRL-L erases the screen (page). When a program is running, the down arrow interrupts. When listing a program, the down arrow interrupts. When listing a program, the Break key will pause listing; type any other key to resume listing, except down arrow which stops listing. Hard Reset is like rebooting the machine -- everything is lost. Warm Reset enters CRT mode. Typing Esc E gets you back into BASIC with your program intact.

Keyboard Mapping

First off, the Compucolor doesn't support lower case letters. To type commands you either need to hold the SHIFT key down, or more conveniently, activate the caps lock key.

Repeat Key: The Compucolor didn't have typomatic keyboard action by default. To get autorepeating characters, you had to hold down the REPEAT key while holding some other keyboard key to get a series of that key. Obviously, modern PC keyboards don't have a REPEAT key. Instead, this emulator detects when the PC is autorepeating keys and sends then pretends that the REPEAT key is held down. As a result, the repeat rate is that of the Compucolor, not that of whatever your computer natively generates.

Hard Reset: You can perform a hard reset on the CC-II either by pressing the dedicated button on the webpage, or you can hit the key combination Ctrl-Shift-CPU Reset on the virtual keyboard.

Warm Reset: You can perform a warm reset on the CC-II either by pressing the dedicated button on the webpage, or you can hit the CPU Reset key on the virtual keyboard. Either way, you will get a one line message, and the CC-II is waiting for you to give a command. The three that you will care about are

Function keys: Most PC keyboards have F1 through F12, while the CC-II had F0 through F15. If you need those other buttons, use the virtual keyboard feature (below). The low end CC-II keyboard didn't have any function keys, so it shouldn't be critical.

Numeric Keypad: Just make sure you have the Num Lock key active, otherwise you'll get something other than numbers.

Caps Lock: In general, Compucolor use required keeping the Caps Lock key active nearly all the time, as the machine didn't have lowercase letters. The Compucolor uses the Caps Lock key in one way: it inverts the meaning of the shift key for the characters corresponding to 'A' to 'Z' and 'a' to 'z'. If you press any of the letter keys in combination with the Ctrl key, Caps Lock is ignored.

Break: Pressing the Break key while a program listing was scrolling by would pause the listing. Hitting another key would resume listing. The PC also has a Break key, and is mapped to the same function. However, because this seldom used key can be awkward to hit, the PC End key has also been mapped to this function.

The emulation of the keyboard is imperfect for a number of reasons, and in fact it is impossible to emulate the Compucolor keyboard perfectly from a standard PC keyboard. The PC has a number of keys which don't appear on a Compucolor keyboard, and likewise, the Compucolor keyboard has many keys which don't appear on a standard PC keyboard. Some of these problems can be overcome by using the on the virtual keyboard (next section). Another problem is that most PC keyboards don't implement N-key rollover, which means certain key combinations can't be recognized as being active at the same time; this matters for a few games which use multiple keys simultaneously for controlling game play. See this link to learn more about that issue.

Finally, the javascript model of keyboard events is a fragmented mire; each browser implements events and the state communicated in each event in a different way, even sometimes different versions of one browser changes things. This can lead to a situation where the emulator gets confused: it thinks a key is held down even though it isn't. In this case, one fix is to move the input focus to a different window (click on some icon on your desktop) then move focus back to the emulator window. This will reset the emulated keyboard state.

Virtual keyboard

The Compucolor came configured with one of three keyboard models: standard, extended, and deluxe. These had some key that don't have a corresponding key on a standard PC keyboard, so in case you really need to use one of these keys, the emulator has a "virtual keyboard" feature. By default it is hidden, but selecting one of the radio buttons on the left, under "Virtual Keyboard:" will enable pane with a deluxe keyboard key set, either in small, medium, or large size (to suit your preference).

Most keys are depressed only as long as the mouse button is pressed over the key image. To make the keyboard usable, though, the Caps Lock, Repeat, Shift, and Control keys are toggles -- each press inverts the state of the key. This allows pressing key chords like CTRL-H.

Rather than trying to explain the complexities of the extended keyboard, I advise reading some of the Compucolor documentation.

Autotyping

"Autotyping" is the name for reading a file from the host computer and getting it into the emulated CC-II by having the emulator act as if there is a very fast typist at the keyboard. For arcane reasons, the text which is entered by the autotyper isn't echoed to the screen, although a carriage return is produced for each line.

The emulator comes with a list of programs you can run; use the pulldown menu under "Run a program:" to choose one. If you want to run your own program, select "Use local file..." from the pulldown to navigate to your own file. This item might be missing if your browser doesn't support the javascript FileReader API.

Because it takes a while for the BASIC interpreter to process each line, it takes a few moments to transfer the whole file. A progress bar is displayed on top of the emulated CC-II screen, showing how much of the file has been stuffed into the emulated CC-II. If you change your mind during a file load, hitting the Esc key will cancel the transfer.

The files may contain special directives which are processed by the emulator, but which are not sent to the emulated machine. Any place where the following text appears:

[[[RESET]]]

it will force the emulated Compucolor to go through a hard reset before the rest of the file is read in. This is convenient for autoloading games so that it will make sure any program already in memory is wiped out. Putting "RUN" as the last line of the file will make the program run as soon as it is loaded.

By default, text is fed to the machine one key at a time, as if a very fast typist was at work. Each key is depressed for one field time (which is the frequency that the keyboard polling routine runs), and then no keys are depressed for the next field. Note that characters will be lost if the application can't keep up with that pace. Because most programs, including the BASIC interpreter, have extra bookkeeping to do at the end of each line, a delay of 10 field times will occur when an end of line character is processed. This can be changed to a 17 field time delay with this directive:

[[[STUFFKEYS;17]]]

17 is just an example; it can be any positive integer. Using just

[[[STUFFKEYS]]]

by itself resets the delay to 10 field times.

Even though this can enter about 30 characters per second, it still takes quite a while to type in a long file. The emulator supports a hack to manipulate the machine state in order stuff one program line in at a time. This is fast, but it also means that text is not echoed to the screen as it is entered. Use the following directive:

[[[STUFFLINES]]]

A file can contain any mix of straight text, [[[RESET]]], [[[STUFFLINES]]], and [[[STUFFKEYS]]].

Warning: The CC-II uses the convention of using Ctrl-M (hex 0D, carriage return) line endings, the same convention that Macs use. If the emulator detects that you are trying to read in a file with the wrong line ending style (either DOS or Unix), it will offer to map them (on the fly) to carriage return style line endings.

Warning: The input buffer in the BASIC interpreter uses has room for only 97 characters. If you try to autotype a file containing lines which are longer than this, such lines will get split up, and the result is likely to be a broken program.

Disk Emulation

The emulator is configured with two virtual floppy disk drives, CD0 and CD1. Beneath the emulator window, use the pulldown to choose one to insert into the corresponding drive. If your browser supports the FileReader API, you can also choose "Use local file..." to use a compucolor virtual floppy (.ccvf) disk image of your choice.

After a floppy is loaded, the emulator attempts to read its volume label, and if successful, that label is shown next to the drive indicator (CD0: or CD1:).

Any time a given drive is selected, the drive indicator will turn red.

Most floppy disks, though not all, contain a "MENU.BAS" program. For such disks, the easiest way to get going is to insert the floppy, hit the reset button (either hard reset or warm reset), then hit the Auto button. This will load and run MENU.BAS.

For advanced users, you can also enter FCS by typing Esc D and issue any FCS command, such as DIR. Please read the Compucolor user manuals to learn how to use the floppy properly.

Finally, it should be noted that javascript, by design, doesn't allow writing files onto your host computer file system. If you want to save a virtual disk image, the emulator has this hacky workaround. Hold down the Ctrl key then left click on the CD0: or CD1: label for the virtual disk image you want to save. This will pop open a window with the virtual disk image in a text format. Using that window's menu, save the file to disk. Be sure to save it as a .txt file, not an html file, otherwise it won't work. If that doesn't work, use CTRL-A to select all the text in the window, CTRL-C to copy it, then save it to a file yourself after pasting it into a text editor.

Character Set

The Compucolor II didn't have lower case characters; instead, the slots which normally contained "a" through "z" contained various graphics characters, like the four card suits and chess pieces. This wasn't a great situation for word processing, so despite having only an 8x8 grid to work with, 3rd parties released hardware mods to allow switching between the standard character set when playing games, and one containing lower case letters while doing word processing.

The pulldown labeled "Character set" allows choosing between the standard and lower case character sets.

Soundware

Soundware was a popular third-party hardware add-on to produce audio. This checkbox will not appear unless your browser supports the modern Audio API. It was a pretty primitive affair, where the serial port tx data line was sent to a small amplified speaker, and by means of toggling that tx data line, various simple tones could be produced.

Because of the real-time nature of audio production, there is an inherent tension between buffering a lot of samples (to make sure the audio stream is never interrupted) and buffering just enough samples (to keep the latency low). With browser technology it isn't possible to strike a great balance, so the audio may be a bit laggy at times and a bit choppy other times.

Regulate speed

By default, the emulator aims to make the virtual CC II run at the same speed as the real thing. However, you can uncheck this box and the emulator will try to run as fast as your host computer and browser will allow it. If soundware is enabled at the same time, the audio will sound choppy.

Even if the emulator speed is regulated, the emulator will temporarily go into unregulated mode while loading a BASIC program from the 'Run a program' pulldown on the left side of the display, to save time.

Joystick

There was a board, probably rare, which was an add-on to the Compucolor which had an AY-3-8910 sound chip and joystick interfaces. The joystick part of it is emulated because there are a few disks in the collection which require the use of the joystick.

The X position is mapped such that the left edge of the CRT screen is 0 and the right edge is 255. The Y position is mapped with 255 along the top edge of the screen and 0 at the bottom. Pressing the left mouse button maps to the joystick "fire" button.

ROM Versions

The Compucolor II was originally released with ROMs containing BASIC and FCS (the file control system) known as version 6.78. A couple years later they released a new ROM version, 8.79. This caused a bit of upset, as many assembly language programs made use of subroutines in the ROM, and most of them were moved to a new location.

For the most part, unless you have a specific reason to, just stick with the v6.78 ROMs. v8.79 doesn't buy much but incompatibility.

Browser Compatibility

Firefox 25: The emulator has primarily been developed and tested on recent builds of the Firefox browser and is known to work well there. Earlier versions of Firefox supported a now-obsolete Audio API, so they will not get Soundware emulation.

IE 10: The emulator has received light testing with this browser and mostly works.

IE 9: The emulator has received light testing with this browser and mostly works.

IE 8 and earlier: Nope -- too much work, primarily because they don't support the HTML canvas element, and because javascript is relatively slow on those browsers.

Chrome v25.something: The emulator has received light testing on a recent build of the Chrome browser. It seems to mostly work, with these known shortcomings.

Safari v5.1.8: The emulator has received light testing on this build of Safari on OSX. Reportedly Safari 6.x has improved things in regard to the problems below.

Opera v12.16: Light testing shows that it mostly works, save these few problems:

Other Random Notes

Missing features