Menu

#1860 SDL1UI: VICE cannot be compiled anymore.

v3.x
closed-fixed
None
SDL1x
Controller Mapping
2023-12-17
2023-04-05
No

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.

Discussion

  • Carlo Bramini

    Carlo Bramini - 2023-04-05

    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 be USE_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
  • gpz

    gpz - 2023-04-05

    Looks like an opportunity to finally get rid of SDL1 to me :)

     
    • Carlo Bramini

      Carlo Bramini - 2023-04-24

      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.

       
  • gpz

    gpz - 2023-04-24

    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)

     
  • Marco van den Heuvel

    Fixed in rev 43722, please try again.

     
  • Marco van den Heuvel

    • status: open --> pending-fixed
    • assigned_to: Marco van den Heuvel
     
  • Querino

    Querino - 2023-04-29

    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. :)

     
  • gpz

    gpz - 2023-04-29

    msys is dropping support for windows 7, so it might be that. Does it work when you build it yourself?

     
    • Querino

      Querino - 2023-04-30

      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.

       
    • Querino

      Querino - 2023-05-01

      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".

       
  • Carlo Bramini

    Carlo Bramini - 2023-05-20

    All VICE emulators build fine again with SDL1.
    My executables for Windows 9x/Me/NT run again.
    Thank you very much.

     
  • gpz

    gpz - 2023-05-21

    However, you should be prepared for moving to SDL2 - the 4.0 merge will really remove SDL2

     
  • compyx

    compyx - 2023-12-17
    • status: pending-fixed --> closed-fixed
     

Log in to post a comment.