5

Is the character set format same on every Commodore 8-bit computer or are there any character size, character order, or other differences between the machines?

I'm purely interested in the character set data: how the character data is organised in the set on each machine. I already know how the character data is laid out in the C64 and the 264 series (C16, Plus/4, etc.) computers and that the character set format is identical on those machines. I'm just lacking the information on the rest of the Commodore 8-bits.

  • 1
    This is way too broad. I would be great if you could specify it down to a question that can be answered withotu writing a whole essay. Maybe even start with what you considere a loadable character set, as most computers charset can be loaded by help of an EPROMer :)) – Raffzahn Sep 10 '18 at 13:38
  • You've asked two separate questions too. I recommend cutting it down to the second one, because (I think) that's more interesting. – wizzwizz4 Sep 10 '18 at 17:06
  • 1
    How can an "A or B" question be "too broad"? – traal Sep 10 '18 at 18:49
  • @traal See the history, the question has been significantly improved. – Philip Kendall Sep 10 '18 at 19:47
  • The ROM character set differs between the PET and the VC20/C64/C16/C116/C+4/C128 group. – Janka Sep 10 '18 at 20:42
5

PETSCII's very similar across all of the machines, but not quite identical. Some control codes differ depending on the particular machine's capabilities (the C64's colour codes would make no sense on a monochrome PET) but older codes generally appear very similar to newer ones.

4

If by "character set" you mean the visual appearance of the characters (which is the typical meaning of this term in documentation contemporary with 8-bit machines) then no, it is not identical on all Commodore 8-bit machines.

One difference is that the VIC and PET computers use a different typeface from the 64 and later machines. Compare the text in these images from a PET and VIC-20:

PET (emulated) screenshot VIC-20 (emulated) screenshot

to the text on a 64:

enter image description here

The PET and VIC machines use a 1-pixel wide "stroke", and certain characters use a serif, while the 64 and later machines use a 2-pixel wide stroke when possible, and are sans-serif. Compare the "B" and the "D" in the above screeshots.

Another difference is that certain machines released in Japan had Katakana in their character sets, including the VIC-1001 (the Japanese VIC-20) and the Japanese release of the Commodore 64.

  • I'll bet the PET/VIC font would be near illegible on an NTSC composite C64 — especially the early ones, which were in-phase. – Tommy Nov 15 '18 at 16:35
  • 1
    @Tommy Agreed! Not an issue on the VIC-20, of course, because its pixels are so huge. (horizontal resolution = 176 -- just slightly more than half the 64's 320) – Laurence Gonsalves Nov 15 '18 at 17:05
  • @Tommy: From my experience, monitors tended to shift dark/light boundaries toward the light pixel, so a single white pixel on a dark background would be about 0.5 pixels wide, while a single dark pixel on a white background would be about 1.5 pixels wide. If the VIC-II chip had been able to afford another couple bits on each of the four background color registers, it would have been helpful to use them to indicate whether a character data should be inverted, and whether it should come from the first half or second half of the character set. The 2K character ROM could then have included... – supercat Nov 16 '18 at 20:55
  • ...both single- and double-stroke fonts, and code could have used whichever was appropriate for normal text and for inverse text. – supercat Nov 16 '18 at 20:56
1

Update I just reread the question and have realised the questioner already knows how the C64 character set data is organised, but I'm going to leave this answer here anyway for other people who maybe don't.

I can speak for two machines: The PET and the Commodore 64. Both machines organise the characters on an 8x8 grid of pixels in terms of how they look. In the PET, the programmer has no access to how the character data is organised. It's in a ROM somewhere and the hardware picks the data by reference to an index which it gets from the screen memory. If you POKE 32768,1 you will put an A in the first location of screen memory. Note that the screen code is not ASCII or PETSCII but a modified version thereof.

Commodore PET screen codes

You put a number in a location on the screen and the character generator hardware looks up the relevant character internal and puts the right bit pattern on the screen. The character generator has two possible character sets - one with upper case and graphics and one with lower case and upper case - and these are selected by one of the control lines on the PET's VIA chip, which is, in turn controlled by the PCR register on the VIA that is mapped into the PET's memory at location 59468 ($E84C). That's why POKE 59468,12 and POKE 59468,14 select the different character sets.

The Commodore 64 is different in that the character set ROMs can be mapped into the 6510's address space so you can see them. Each character on screen takes 8 x 8 pixels. In the character ROM, each character takes 8 consecutive bytes, one byte for each row of pixels. The picture below is a hex dump of the first twenty eight characters in the C64 character ROM. The row highlighted in blue, is the character that appears on screen when you poke a screen location with 1.

Screen shot of the start of character ROM

If we take the bytes:

18 3C 66 7E 66 66 66 00

Each byte is a row, so stack them one on top of the other

18
3C 
66 
7E 
66
66
66
00

If a bit is 1, then the pixel in that position is on. So expand the hex numbers above using an X for 1 and a . for 0

...XX...
..XXXX..
.XX..XX.
.XXXXXX.
.XX..XX.
.XX..XX.
.XX..XX.
........

The aspect ratio is wrong, but you can see it is an A. For comparison, the equivalent PET character looks like this

...XX...
..X..X..
.X....X.
.XXXXXX.
.X....X.
.X....X.
.X....X.
........

The vertical strokes are thinner. The reason why the vertical strokes on the C64 are two pixels wide is that they characters are designed to be displayed on an ordinary television and it makes them more readable. The Commodore Programming Guide says this:

For best results, always make any vertical lines in your characters at least 2 dots (bits) wide. This helps prevent CHROMA noise (color distortion) on your characters when they are displayed on a TV screen.

There are 256 possible numbers you can poke into a screen location, so there are 8 x 256 bytes = 2K bytes needed to represent a whole character set. The C64 character ROM contains two character sets, one for upper case and graphics, the other for lower and upper case.

The VIC chip can take its character "ROM" from pretty much any 2Kbyte aligned slot in the C64 address space, so you can copy the character ROM to RAM, modify it as you see fit and then point the Vic at it to get your own custom characters.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.