Topic: "Replay_TranslatePS2" added to support library

I did finish the generic PS/2 to matrix keyboard mapper.

It can map PS/2 command to any kind of keyboard matrix up to 8x16 (128) keys, plus 7 separate "static" keys (like pause key or restore key on commodores).

For arcade, instead of the matrix one can use 16 + 7 static keys to be connected to such kind of games.

There are preconfigured configurations (to be continued/improved) as own "Replay_TranslatePS2_Pack", which can be later overwritten by configurations in INI files, either by loading a 512 byte map (planning for a tool to generate such files) or modifying just separate bytes in the table for small keyboard changes (like EN/GE keyboards or so).

Exchanging two keys in the INI file looks like this:
#----------------------------------------
#      Z on CBM / Z on PS/2 (0x1A)
DATA = 0x41,0xFF,0x00020034,2
#      Y on CBM / Y on PS/2 (0x35)
DATA = 0x13,0xFF,0x0002006A,2

The address in the LUT is 2x the PS/2 scan-code (7 bit), extended scan codes start with the MSB set.
The value to write is the X/Y coordinate (or a static key) to set.

A figure of this block and some description of the LUT coding can be found here in SVN:
.../hw/replay/cores/vic20/doc/keymapper_new.pdf

An exemplary mapping for a small keyboard to the VIC-20 core is also in SVN:
.../hw/replay/cores/vic20/doc/Keyboard_Map_VIC20_C64.pdf

/WoS

Re: "Replay_TranslatePS2" added to support library

good work wolfie!

Re: "Replay_TranslatePS2" added to support library

Is it possible to define the button that makes two connection in the matrix?
For example "Extended" on ZX Spectrum makes Symbol shift + Caps shift,
or "." makes SS+M.

Re: "Replay_TranslatePS2" added to support library

Yes, this is possible. One entry in the translation table contains two entries, usually only the first is used. If you use both, this will generate a "double-key" for the core.

E.g. it is already used for the translation of the cursor keys from a PC keyboard (4 separate keys) to the CBM cursor keys on C64/VIC-20 (2 keys direct use, two keys used with shift key at the same time).

/WoS