I compiled vice from the latest svn revision (r33299). All (that I tried) is well, but each time I start up x64, the joystick keysets revert to their default values.
Apparently the vicerc file is correctly updated, as the keys are different if I exit the emulator without redefining them. The file I attached shows the rc after I did (to Up / Down / Left / Right / Left Ctrl).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As I understand, the problem is caused by the order of the initialization steps: vicerc is loaded before the keyboard gets initialized. keyboard_init() loads the keymap file, and once it gets to (e.g.) KP_5, it overwrites the setting read from the rc file for KeySet2Fire.
As I see, there are two ways to circumvent the problem:
Load vicerc as the last step of initialization, just before the main loop.
When loading the keymap file, skip keys (and joystick keysets, etc.) which already have custom values.
I don't know which solution fits better into the current initialization procedure, so I leave it up to you guys to pick the best one. :)
Last edit: David Nemeskey 2017-05-14
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This works fine in the Gtk3 port and appears to work in the SDL2 port as well. In both ports the keyset settings are saved in vicerc and restored properly.
So perhaps we can close this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Attached the startup log.
Last edit: David Nemeskey 2017-05-14
Apparently the vicerc file is correctly updated, as the keys are different if I exit the emulator without redefining them. The file I attached shows the rc after I did (to Up / Down / Left / Right / Left Ctrl).
As I understand, the problem is caused by the order of the initialization steps: vicerc is loaded before the keyboard gets initialized.
keyboard_init()loads the keymap file, and once it gets to (e.g.)KP_5, it overwrites the setting read from the rc file forKeySet2Fire.As I see, there are two ways to circumvent the problem:
I don't know which solution fits better into the current initialization procedure, so I leave it up to you guys to pick the best one. :)
Last edit: David Nemeskey 2017-05-14
A variation of number 2 is the proper fix. Putting keysets in keymap files is obsolete. Therefore, the
keyboard_parse_set_neg_row()function (in https://sourceforge.net/p/vice-emu/code/HEAD/tree/trunk/vice/src/keyboard.c ) should ignore attempts to set the keysets (i.e., "rows" -1 and -2).This works fine in the Gtk3 port and appears to work in the SDL2 port as well. In both ports the keyset settings are saved in vicerc and restored properly.
So perhaps we can close this?
It seems to b working fine in the current version for me as well.
Great, closing then.