i gave the SDL2 versions a try under windows. it compiled, but on certain keystrokes (cursor keys, CTRL...) all emus crash. x128 even crashes right after launching.
what VICE version are you using? 2.4.28.31447 what operating system are you using? win 7 what did you do? press some keys, CTRL, ALT, Fxx, home, cursor... what did happen? emus crash what did you expect to happen? the obvious
btw. what's the benefit of SDL2 over SDL1? so far i could only see downsides:
SDL2 does support OpenGL for Embedded Systems ( ES ), SDL1 not, on Windows @ the moment you have downsides but on tablets, smart phones, single board computers like ODROID which support OpenGLES it's accelerated and way faster then SDL1, SDL2 in general is faster
SDL2 supports a lot more grafic backends like SDL1 !
I'm not sure if this is the same thing, but there is definetely a bug in sdlkbd_get_hotkey. Pressing the windows key (on ubuntu 14) yields a return value of 0x400000e3 from sdlkbd_key_mod_to_index which is used to look up an entry in the 8k large array sdlkbd_ui_hotkeys. This obviously causes a segmentation violation. A work-around is simple (check array bounds), but I'm not sure what the proper fix should be.
That huge number is caused by the
SDL_SCANCODE_TO_KEYCODE()
macro in "SDL_keycode.h". It is used on modifier keys, function keys, special function keys, cursor keys, and the keypad. The array's size is based on the number of scan-codes. But, SDL2 makes a huge distinction between scan-codes and key-codes! VICE's current SDL keyboard code isn't "forward-compatible" with SDL2. And, the menu connection to keyboard input will need to be different for SDL2.Oh, and should note that this is with sdlui2 of course
Will try to debug it tomorrow on my ubuntu 14 machine
Just for correctness, the ticket belongs to windows port, but on windows this crashes are not happen on my machine, are you tested it on windows too or only on ubuntu 14 ?
Secondly, if you have already investigated for a patch please share it on pastebin or so
I've only tested on ubuntu. Unfortunately due to my current employment contract I'm unable to submit a patch without going through legal approval. It's a bit silly since it is a two line patch, but that's the unfortunate state of affairs. However, I can say as much as checking the array bounds in sdlkbd_get_hotkey at least works around the problem.
There have been some changes to the SDL2x port key handling recently.
With the current trunk does it still crash ??
I'm traveling, so can't check exact version, but this was trunk from about 1.5 weeks ago.
As of today free window scaling with CRT render looks ok and aspect ratio is enabled
yes, crashes are goneunder windows too.
but now the keys left to the return key don't do anything. but that might be the keymap file.
Just for testing you could delete or rename the sdl_sym.vkm file, then keymap should be fine
ok, some do work if i use the sdl_pos_de.vkm but they aren't the same as in the SDL1 version.
so after all i can say, using the same keymaps as in SDL1 gives in SDL2 different output.
Last edit: Querino 2016-08-13
Can you give me a hint what keys exactly those are ?
Well, could test it for myself, i will look into, thx for reporting
Looks like SDL1 doesn't ask underlying OS for keyboard layout, SDL2 does it, so if you switch to US/EN Keyboard in windows it will work
fixed with r31554
hm... what exactly got fixed with r31554?
free windows scaling looks worse <--- that
blackystardust fixed with r31537 the crashes with cursor keys
i fixed with r31479 and r31476 x128 crash
I can confirm that the issue I had with crashing on windows key appears to be gone in latest trunk!