Vice X64 - Creating Keymaps


thoro

Member
Joined
Nov 15, 2005
Messages
132
Hi,

I'm trying to create keymaps for some of my old C64 favourites.

"Thrust" for example uses the keys [A] to rotate the ship,
[Shift] for thrust, [Return] to fire and [Space] for tractor beam.

It would be great to map [A] [Shift] to the Pandora's digital
gamepad and [Return] [Space] to two of the buttons (A/X).

But how can I do that? I saved the default keymap and took a
look at it but the syntax looks quite complicated and I don't
know how to adress the Pandora's Game controls.

Maybe somebody has successfully built keymaps on Vice x64 for
Pandora and can show me how to do this. Any help is appreciated.

Cheers

Thorsten
 
Edit:

I found an arm version of "xev" and put it on my Pandora,
so I'm able to get the keysym codes of the pressed keys.

In addition to that I found a good schematic of the
C64 keyboard matrix (rows/columns).

I'm able to make working keymaps now but this seems to
work with keyboard keys of my Pandora only - the digital
gamepad and the game buttons throw keysym codes that
aren't working in my Vice keymaps.

For example, if I press "Left" on my Pandora's digital
gamepad, xev says "keysym 0xff51", which I interpret
as dez 81 (tried it with dez 65361, too) and doesn't
work in Vice while the key "Enter" gives me
"keysym 0xff0d" which I interpret as dez 13.
If enter a line

13 1 2 8

in my keymap file the Enter key of my Pandora works
now as "A" in Vice.

How can I access the digital gamepad and the Buttons (ABXY)?
 
Thanks, TitanUranus.

I've got it now. I had to find Pickle's keymap in
\mnt\utmp\vicex64.pickle\data\C64\sdl_sym.vkm
to understand how it works.

The codes xev gave me led me into the wrong direction,
as did a keyboard matrix of the C64 I had.

I made a working matrix:

C64_Vice_Keyboard_Matrix.png


I took the right key codes for the Pandora's digital
gamepad from Pickle's keymap and found the buttons
by trial and error.

This is my resulting keymap for "Trust" - I hope it helps
you to build your own keymaps. Don't forget to disable your
joystick in "Machine settings".

Code:
# VICE keyboard mapping file
#
# A Keyboard map is read in as patch to the current map.
#
# File format:
# - comment lines start with '#'
# - keyword lines start with '!keyword'
# - normal line has 'keysym/scancode row column shiftflag'
#
# Keywords and their lines are:
# '!CLEAR'               clear whole table
# '!INCLUDE filename'    read file as mapping file
# '!LSHIFT row col'      left shift keyboard row/column
# '!RSHIFT row col'      right shift keyboard row/column
# '!VSHIFT shiftkey'     virtual shift key (RSHIFT or LSHIFT)
# '!UNDEF keysym'        remove keysym from table
#
# Shiftflag can have the values:
# 0      key is not shifted for this keysym/scancode
# 1      key is shifted for this keysym/scancode
# 2      left shift
# 4      right shift
# 8      key can be shifted or not with this keysym/scancode
# 16     deshift key for this keysym/scancode
# 32     another definition for this keysym/scancode follows
# 256    key is used for an alternative keyboard mapping
#
# Negative row values:
# 'keysym -1 n' joystick #1, direction n
# 'keysym -2 n' joystick #2, direction n
# 'keysym -3 0' first RESTORE key
# 'keysym -3 1' second RESTORE key
# 'keysym -4 0' 40/80 column key
# 'keysym -4 1' CAPS (ASCII/DIN) key
#

!CLEAR

273 6 4 8              /*         Up       -> Shift      */
274 0 7 8              /*         Down     -> Crsr Down  */
275 1 5 8              /*         Right    -> S          */
276 1 2 8              /*         Left     -> A          */
278 0 1 8              /*         Button A -> Return     */
279 3 4 8              /*         Button B -> B          */
280 3 1 8              /*         Button Y -> Y          */
281 7 4 8              /*         Button X -> Space      */

32 7 4 8               /*         Space    -> Space      */
27 7 7 8               /*         ESC      -> Run/Stop   */
44 5 7 8               /*         ,        -> ,          */
46 5 4 8               /*         .        -> .          */

282 0 4 8              /*         F1       -> F1         */
283 0 4 1              /*         F2       -> F2         */
284 0 5 8              /*         F3       -> F3         */
285 0 5 1              /*         F4       -> F4         */
286 0 6 8              /*         F5       -> F5         */
287 0 6 1              /*         F6       -> F6         */
288 0 3 8              /*         F7       -> F7         */
289 0 3 1              /*         F8       -> F8         */

49 7 0 8               /*         1        -> 1          */
50 7 3 8               /*         2        -> 2          */
51 1 0 8               /*         3        -> 3          */
52 1 3 8               /*         4        -> 4          */
53 2 0 8               /*         5        -> 5          */
54 2 3 8               /*         6        -> 6          */
55 3 0 8               /*         7        -> 7          */
56 3 3 8               /*         8        -> 8          */
57 4 0 8               /*         9        -> 9          */
48 4 3 8               /*         0        -> 0          */

97 1 2 8               /*         A        -> A          */
98 3 4 8               /*         B        -> B          */
99 2 4 8               /*         C        -> C          */
100 2 2 8              /*         D        -> D          */
101 1 6 8              /*         E        -> E          */
102 2 5 8              /*         F        -> F          */
103 3 2 8              /*         G        -> G          */
104 3 5 8              /*         H        -> H          */
105 4 1 8              /*         I        -> I          */
106 4 2 8              /*         J        -> J          */
107 4 5 8              /*         K        -> K          */
108 5 2 8              /*         L        -> L          */
109 4 4 8              /*         M        -> M          */
110 4 7 8              /*         N        -> N          */
111 4 6 8              /*         O        -> O          */
112 5 1 8              /*         P        -> P          */
113 7 6 8              /*         Q        -> Q          */
114 2 1 8              /*         R        -> R          */
115 1 5 8              /*         S        -> S          */
116 2 6 8              /*         T        -> T          */
117 3 6 8              /*         U        -> U          */
118 3 7 8              /*         V        -> V          */
119 1 1 8              /*         W        -> W          */
120 2 7 8              /*         X        -> X          */
121 3 1 8              /*         Y        -> Y          */
122 1 4 8              /*         Z        -> Z          */
 
I've been struggling with keysyms as well with vice64x. Could you point me to where you found xev? All I managed to find was xev.c and I haven't been lucky to compile very often.

I appreciate it.
 
I found it here:

http://www.angstrom-distribution.org/feeds/unstable/ipk/glibc/armv7a/base/xev_1.0.4-r0.5_armv7a.ipk

but the results did not work in Vice x64 - maybe it was just me :).

Cheers

Thorsten
 
Back
Top