Pop wrote: ↑Fri Jan 12, 2024 11:33 pm
Thanks, I don't really understand but maybe that's because I don't know enough about Commodore systems.
That's totally understandable.
The quick answer is that Commodore, unlike virtually every other computer maker, uses a different order of letters in its character set.
On all computers, letters, numbers, symbols, and control codes ("Move that cursor left, please") are stored as numbers. Most computers use the ASCII standard for this, and basically every computer built since the 70s has used the same standard. Here's a handy chart:
https://web.alfredstate.edu/faculty/wei ... index.html
In ASCII, the letter "A" is stored as the number 65, "B" is 66, and so on. The lower case letters, "abc..." start at 97 and also go sequentially in ASCII.
But the good folks at Commodore did something a little different. The 1977 Commodore PET did not have lower case letters. Instead, the engineers used that space for graphic symbols, which could be used for drawing boxes and charts. "A" is still 65, but there was no "a". Instead, pressing Shift+A prints the ♠ character, which actually lives at 193 in the PETSCII table. (65 + 128. Turns out the SHIFT key is basically the "add 128" key.)
This is called PETSCII. You can find a handy PETSCII chart here:
https://www.c64-wiki.com/wiki/PETSCII
Well, as you might expect, users were all "HEY, IT MIGHT BE NICE IF WE COULD TYPE LOWER CASE LETTERS INSTEAD OF SHOUTING ALL THE TIME!"
And Commodore said, "SURE, THAT SOUNDS LIKE A GOOD IDEA!" And a second version of the PET came out with a "Typewriter" keyboard. One of the new PET's features was lower case text.
Except... they made the lower case mode optional. And instead of flipping how the shift key works, they just changed the way the text
looked, without changing anything about how it
worked. So Upper-Case "A" became lower-case "a", and pressing
And we've been stuck with that nonsense ever since.
Anyway, this leads us to the obvious question of translating between ASCII and PETSCII. And the process is, surprisingly, super annoying.
In upper-case/graphic mode (the default mode when a Commodore boots up):
A-Z on PC and Commodore are the same.
a-z on PC become graphic symbols on Commodore. So don't use them.
In upper/lower case mode:
A-Z on PC should be mapped to 193-218. (Remember, "SHIFT" adds 128)
a-z on the PC get mapped to 65-90.
And then the are "screen codes"... which are in yet
another order, because Commodore's engineers don't want us to sleep at night.