Page 1 of 1

PETSCII Keyboard/Driver Support for Development on Modern System

Posted: Fri Sep 11, 2020 2:42 pm
by Starsickle

Just a thought I've had: I'm currently developing on Windows 10, and if I were either a contributor to a github project or using modern tools, I'd benefit from access to the X16's PETSCII Keyboard plugged into the computer while coding or developing.

Would this be possible under the current design? Would it require special drivers or application?

I believe a lot of hardship can be eliminated by allowing the keyboard to work on modern systems in any case. And with less hardship, more software.



Example:


  1. Plug in the X16's Keyboard into my W10 System


  2. <Punch The Keys, For Gods' Sake!>


  3. Get PETSCII Characters just like I would natively.



PETSCII Keyboard/Driver Support for Development on Modern System

Posted: Fri Sep 11, 2020 4:01 pm
by Perifractic
The current WASD Keyboard is fully compatible with VICE on Windows 10 to the best of our knowledge.

PETSCII Keyboard/Driver Support for Development on Modern System

Posted: Fri Sep 11, 2020 4:02 pm
by Ender

This sounds more like a software problem than a hardware problem. If you just install a PETSCII font on your system, you should be able to get PESTCII characters (assuming that one exists, I haven't looked it up).  A special keyboard shouldn't even be necessary, besides the convenience of looking down and seeing what the key will type before typing it.


PETSCII Keyboard/Driver Support for Development on Modern System

Posted: Fri Sep 11, 2020 4:07 pm
by SlithyMatt


1 minute ago, Ender said:




This sounds more like a software problem than a hardware problem. If you just install a PETSCII font on your system, you should be able to get PESTCII characters (assuming that one exists, I haven't looked it up).  A special keyboard shouldn't even be necessary, besides the convenience of looking down and seeing what the key will type before typing it.



PETSCII is not compatible with Unicode, so a modern PC won't be able to use it directly, like in a PETSCII text BASIC program. The keyboard will work with the X16 emulator, so you'll get PETSCII within that, just like you would for VICE. For cross development from Windows/Mac/Linux you will need to write your source in Unicode, which means looking up the screen codes for PETSCII graphical characters and putting those in your source.


PETSCII Keyboard/Driver Support for Development on Modern System

Posted: Fri Sep 11, 2020 4:22 pm
by Yuki


11 minutes ago, SlithyMatt said:




PETSCII is not compatible with Unicode



It's compatible starting from Unicode 12, but you'll still need to install a font and do some serious keyboard remapping. Some fonts also have a PETSCII mapping in the Private Use Area.


PETSCII Keyboard/Driver Support for Development on Modern System

Posted: Fri Sep 11, 2020 6:50 pm
by rje


2 hours ago, Perifractic said:




The current WASD Keyboard is fully compatible with VICE on Windows 10 to the best of our knowledge.



Yes, it works nicely.

 


PETSCII Keyboard/Driver Support for Development on Modern System

Posted: Sat Sep 12, 2020 1:11 am
by TomXP411


9 hours ago, Perifractic said:




The current WASD Keyboard is fully compatible with VICE on Windows 10 to the best of our knowledge.



It's not quite compatible with either of the default keymaps. The Pi key, [, ], and \ keys, RunStop , and Restore keys are all different. (I like that there's a separate ESC and Run/Stop key. I wish the emulator would be updated with these keys.)

Do you have a VICE keymap that works with these keys?

 


PETSCII Keyboard/Driver Support for Development on Modern System

Posted: Sat Sep 12, 2020 1:13 am
by Perifractic
It's not quite compatible with either of the default keymaps. The Pi key, [, ], and \ keys, RunStop , and Restore keys are all different. (I like that there's a separate ESC and Run/Stop key. I wish the emulator would be updated with these keys.)
Do you have a VICE keymap that works with these keys?
 
Hmm that's different to my understanding. Let me check into that a little.

PETSCII Keyboard/Driver Support for Development on Modern System

Posted: Sat Sep 12, 2020 1:26 am
by TomXP411


10 hours ago, Starsickle said:




Just a thought I've had: I'm currently developing on Windows 10, and if I were either a contributor to a github project or using modern tools, I'd benefit from access to the X16's PETSCII Keyboard plugged into the computer while coding or developing.



Would this be possible under the current design? Would it require special drivers or application?



I believe a lot of hardship can be eliminated by allowing the keyboard to work on modern systems in any case. And with less hardship, more software.



Example:




  1. Plug in the X16's Keyboard into my W10 System


  2. <Punch The Keys, For Gods' Sake!>


  3. Get PETSCII Characters just like I would natively.




I'm not sure what the issue is... are you trying to get PETSCII characters in a native Windows app, or in the emulator?

The keyboard is actually a standard Windows keyboard - so it needs no driver support. If you press the ~ key on your PC keyboard while running the emulator, you'll get the left arrow. Shift that and you get the Pi symbol.

Now if you want to get PETSCII in a Windows program, you need to do the PETSCII to ASCII translation in your program.

To get started, you should download the C64 font by Style, here: https://style64.org/petscii/

Then look at the PETSCII mapping and figure out how you want your program to store text. The most common way is to use a PETSCII byte stream, then translate the code in the display layer to look like PETSCII glyphs. The simple way to do this is to add $E0 to each character when you draw it on the screen.

You'll still need to do some translation and custom keyboard handling, though: the C= glyphs on the keyboard all need to be handled through a Win key chord, and those characters are not in the same order as the letters they live under. (C= A and C= E are actually next to each other in PETSCII, which makes no sense looking at the keyboard. But it does make sense looking at a PET keyboard...)

So you'll need to address this with a translation table in your editor. Which you'll have to build. Or  you can write a text editor for the CX16 and run it in the emulator. That's what I'm planning on doing.

 


PETSCII Keyboard/Driver Support for Development on Modern System

Posted: Sat Sep 12, 2020 1:30 am
by TomXP411


14 minutes ago, Perifractic said:





16 minutes ago, TomXP411 said:




It's not quite compatible with either of the default keymaps. The Pi key, [, ], and \ keys, RunStop , and Restore keys are all different. (I like that there's a separate ESC and Run/Stop key. I wish the emulator would be updated with these keys.)

Do you have a VICE keymap that works with these keys?

 





Hmm that's different to my understanding. Let me check into that a little.



The letter keys work fine, but the graphic symbols don't map out correctly. This is partly a VICE limitation, since you simply can't represent certain combinations of characters when remapping keys. for example, the [ and ] keys cannot be made to work as [ and ] while also printing the graphic symbols, because [ and ] are already shifted characters. This is a limitation in VICE that I have not been able to work around.