Monday, June 29, 2026

Added Tab5 Keyboard support for my portable emulators for Commodore

 

Tab5 Keyboard is a convenience add-on

I added native keyboard support to my emulators already running on M5Stack's Tab5.

There were already 64/Vic-20/128 original keyboards, CardKB, web page adapter, Palm Portable Keyboard, and custom BLE support.  

Now there is also attached keyboard accessory support.  The Tab5 is a 5" ESP32-P4 handheld tablet with high resolution 1280x720 LCD.  The keyboard plugs into the bottom of the tablet, extending the size, and the capabilities.

The implementation scans all 70 keys for presses and translates to a list of C128 key scan codes into ASCII comma separated and newline terminated form, which the emulators already know how to translate into Commodore model specific keyboard scan codes.  As these are pressed scan codes, the press is persisted in the emulated system until the physical key is released.  These are symbolic mappings, not positional mappings because that is my preference.  Want different?  This is open source!

All visibly labeled keys are supported mostly as is.  Keys not Commodore specific are mapped to a Commodore PETSCII character already mapped to the proper ASCII character for the minimal environment (left arrow, underscore, caret, curly braces, pipe, backslash, backquote, tilde).  In addition, shift [Aa] supports letters, and numbers and punctuation to do the normal shifted characters.  In the first iteration I haven't used the [sym] key much yet, giving favor to shift [Aa] instead.   Additional keys worthy of documentation are:

  • tab            COMMODORE C=
  • sym tab        TAB
  • esc            STOP
  • shift esc      LOAD RUN
  • sym esc        ESC
  • ctrl sym del   STOP RESTORE
  • shift del      INSERT
  • \              £
  • shift -        LEFT ARROW
  • shift +        =
  • sym +          HOME
  • sym shift      CLEAR

As a reminder the emulators included are:

  • Commodore 64
  • Commodore 128
  • Commodore Vic-20
  • Environment similar to an Apple 1 (minimalistic 6502/6850/ROM/RAM plus terminal)

Links:

https://github.com/davervw/c-simple-emu6502-cbm/tree/unified-pio

No comments:

Post a Comment