Ultimate Commodore Charset / PETSCII / Keyboard Reference

Another addition to the The Ultimate C64 Reference: We’re adding character sets, PETSCII codes and keyboard layouts – supporting eight different Commodore computers.

There are three different (related) modes: Character Sets, PETSCII and Keyboard. The controls on the left switch some global settings:

  • Character Set lets you select the Commodore 8×8 charset to be used in all modes. The drop-down list contains 84 ROM-extracted charsets.

  • Control Codes specifies which set of PETSCII control codes will be visualized in the PETSCII table.

  • Color Scheme matches the charset to the color scheme of a specific computer, or shows it in black-on-white.

  • Aspect Ratio controls the width-to-height ratio of the character set displayed, showing them either with square pixels, or matching one of the computers.

  • By clicking one of the radio boxes next to the computer names, the four settings above will be set to match a specific computer.

  • The checkboxes next to the computer names allow viewing the PETSCII control codes, keyboards and keyboard combinations of multiple computers in all other views.

Character Sets

The Character Sets tab shows all 128 characters of the currently selected charset as well as its inverted form, sorted by screen code. You can click on a character to view its screen code, PETSCII and Unicode values, as well as the keyboard combinations that produce this key on the different machines.

Below, there is a table showing all character sets at the same time. It can be filtered to only show upper case or lower case charsets.

In addition, there is a function that lets you compare two character sets. The middle line shows the XOR of the two charsets. This example shows that several lower case letters were optimized from the C64 to the TED:

PETSCII

The PETSCII tab visualizes the 256 PETSCII codes. Codes 0x00 to 0x1F (the first two rows) and codes $80 to $9F (rows 9 and 10) are control codes, the others are printable. Clicking on a code will reveal the PETSCII value, the screen code and the keyboard combinations. For control codes, it shows the functions on the different computers, and for printable characters it shows the Unicode equivalent.

The table below shows this information for all codes in one place. Here is a part of it comparing some keyboard combinations and control codes between three different computers:

Keyboard

The Keyboard tab shows the keyboard layouts of the different computers and lets you explore which PETSCII codes and characters are generated by which key combinations.

In the screenshot above, you can see the three different keyboards of the computers from the TED series: the C16, the C116 and the Plus/4.

Contributing

Like all web pages of the Ultimate C64 Reference, these view are generated from independent formatted ASCII files. The C64 keyboard file looks like this, for example:

It contains the ASCII-art of the layout, which is converted into SVG graphics by a Python script, the key caps, information about modifiers as well as the scancode-to-PETSCII tables.

The Ultimate C64 Reference is being developed as an open source project at github.com/mist64/c64ref – contributions in the form of additions, corrections etc. are welcome!

3 thoughts on “Ultimate Commodore Charset / PETSCII / Keyboard Reference”

  1. Great work!

    Side track: It’s debatable if the color mentioned above is dark yellow or brwon on the 80 col output of the C128. As it is a digital output without official standardisation (in contrast to PAL, NTSC and similar), it’s up to the monitor to interpret the signals. Using a monitor that behaves exactly like an IBM CGA (or EGA which will run in CGA mode) monitor, that color will be brown as those monitors contains extra hardware specifically to change that color from dark yellow to brown (which technically is “dark orange”, although human vision works rather strange re brown vs orange – see the video about the color brown on the youtube channel Technology Connections). On the other hand, using simple resistor networks to convert the digital RGBI signal to an analogue RGB signal will indeed produce dark yellow. I’m not sure which colors the various Commodore branded monitors did produce – likely brown as that would had made the monitors usable with PC CGA (with correct colors) too.

    Btw not sure if it could easily be done, but it would be super nice if some addition to your scripts could input and/or output configuration files for VICE. Being able to visualize how the keys are mapped in VICE would be super nice. Especially when combining some national keyboards on a modern PC with national keyboard layouts on the old Commodore computers things can easily get rather confusing. I usually end up just trying each key with and without shift until I find which key generates the character I’m trying to type. (Obviously this doesn’t apply to the A-Z, a-z letters and 0-9 digits, “only” the other keys).

  2. Showing info about keyboard mapping in VICE could be a lot of work, since the keymaps are changing over time. On the other hand, maybe something that *generates* VICE keyboard mappings might be useful…

Leave a Comment