SDL1UI: VICE cannot be compiled anymore.
Versatile Commodore Emulator
Brought to you by:
blackystardust,
gpz
After long time, I updated my source to the latest ones into the repository (43639) and I discovered that the emulators cannot be compiled anymore with SDL1.
The process hangs with this error:
In file included from ../../../../vice/src/arch/sdl/joy.c:42:
../../../../vice/src/arch/sdl/joy.h:62:33: error: unknown type name ‘SDL_JoystickID’; did you mean ‘SDL_Joystick’?
62 | int sdljoy_get_joynum_for_event(SDL_JoystickID event_device_id);
| ^~~~~~~~~~~~~~
| SDL_Joystick
compilation terminated due to -Wfatal-errors.
make[4]: *** [Makefile:888: joy.o] Error 1
This error is correct because SDL_JoystickID
has been introduced with SDL-2.0.0.
I think I found the cause of the problem, the bug is here:
https://sourceforge.net/p/vice-emu/code/HEAD/tree/trunk/vice/src/arch/sdl/joy.c#l85
The macro is misspelled, it uses
USE_SDLUI2
but it must beUSE_SDL2UI
instead.EDIT: however, fixing joy.c is not enough, all sources including joy.h crash with the same error, so the hack on simulating
SDL_JoystickID
on SDL1 needs to be moved elsewhere.EDIT2: SDL_JoystickGetDeviceInstanceID is also used, but it is available from SDL2.
https://wiki.libsdl.org/SDL2/SDL_JoystickGetDeviceInstanceID
Last edit: Carlo Bramini 2023-04-05
Looks like an opportunity to finally get rid of SDL1 to me :)
To tell you the truth, I wouldn't agree with that choice.
SDL2 cannot run on so many platforms like SDL1 and there are dozens of builds of VICE that cannot use the latest version of this library.
I somehow doubt its "so many" platforms that can even run a current VICE... which would that be? (remember, we will get rid of x64 as well)
Fixed in rev 43722, please try again.
btw, both SDL variants don't work under windows 7 anymore, they crash. maybe it's the newer runtimes.
just for information, i know no one cares about win 7. :)
msys is dropping support for windows 7, so it might be that. Does it work when you build it yourself?
i now tried, but it didn't want to compile with my old GCC 6.5
some tools (like sed) seem to be too outdated and error out.
i might try again later and fix this, although i'm not really feel like playing around too long.
ok, i could compile it. and it works . i used newest SDL2 2.65.5, so that is not the problem.
the official biaries don't really crash, they just hang.
the ones i tried a while ago did hang right after launching.
new ones sooner or later hang (and eat 100% of that cpu core) while i am typing at the ready. "prompt".
All VICE emulators build fine again with SDL1.
My executables for Windows 9x/Me/NT run again.
Thank you very much.
However, you should be prepared for moving to SDL2 - the 4.0 merge will really remove SDL2