Joystick support under Debian squeeze

Help
2011-01-07
2013-01-01
  • Phil Reynolds
    Phil Reynolds
    2011-01-07

    Joystick support in fuse worked very well, provided the code was a recent version, in Debian lenny. However, I am now running squeeze, and joystick support cannot be conpiled because the required libraries are obsolete. They are no longer available for squeeze - I have even looked into porting them forwards but there seem to be too many unresolvable dependencies.

    I have tried to cobble a way round it using joy2key, but, for some reason I cannot figure out, only the upward movement seems to be passed to fuse when I do this - no other directions and no buttons. I had set up cursor keys and 0 to fire for the test - the best I could do was get lots of 7s.

    The obvious answer is to rewrite the joystick code to work with more modern libraries, but I cannot work out what it is doing, nor do I have much idea about programing for joystick support.

    However, if any simpler alternatives, even if they are more "wokaround" than a proper fix, can be found, I would be willing to try them.

    Thanks in advance for any information on this.

     
  • Well, same problem here, my excitement on running good olde Atic Atac on my freshly compiled fuse was dampened a little when i realized there was no joystick support at all (although that neuronal branding of keys 5-6-7-8 in my left hands nerves still holds after almost 30 years :-)

    However,  i eventually managed to compile a version of fuse on ubuntu 10.10 with joystick support (at least i just played a decent game of guess what :-) ?), so i'll try to give a short outline here:

    First problem is that libjsw's maintainer and website seem to have gone (err hopefully the maintainer is hopefully doing well….), so i had to google and find some "libjsw-1.5.8.tar.bz2" on an obscure website. Guess my linux box is now part of some botnet.

    Second problem is that libjsw is build against GTK+ 1.x, which is no longer provided as ubuntu package, so we have to build it from source…  which also need some tweaks to build with current GCC:

    (1a) Download and extract http://ftp.gnome.org/pub/gnome/sources/glib/1.2/glib-1.2.10.tar.gz

    (1b) Apply the following patch to gstrfuncs.c to make it compille:

    -- Snip -

    870,871c870
    <                   g_warning (G_GNUC_PRETTY_FUNCTION
    <                              "(): unable to handle positional parameters (%%n$)");
    --
    >                   g_warning ("%s(): unable to handle positional parameters (%%n$)", G_GNUC_PRETTY_FUNCTION);
    1037,1038c1036
    <                     g_warning (G_GNUC_PRETTY_FUNCTION
    <                                "(): unable to handle long double, collecting double only");
    --
    >                     g_warning ("%s(): unable to handle long double, collecting double only", G_GNUC_PRETTY_FUNCTION);
    1080,1081c1078
    <                       g_warning (G_GNUC_PRETTY_FUNCTION
    <                                  "(): unable to handle wide char strings");
    --
    >                       g_warning ("%s(): unable to handle wide char strings", G_GNUC_PRETTY_FUNCTION);
    1111,1113c1108
    <                   g_warning (G_GNUC_PRETTY_FUNCTION
    <                              "(): unable to handle `%c' while parsing format",
    <                              c);
    --
    >                   g_warning ("%s(): unable to handle `%c' while parsing format", G_GNUC_PRETTY_FUNCTION, c);

    -- Snip -

    Now running the usual "./configure && make && make install" should install glib to /usr/local. Dont forget to do a "ldconfig -v" afterwards!

    (1c) Download and extract GTK from http://ftp.gnome.org/pub/gnome/sources/gtk+/1.2/gtk+-1.2.10.tar.gz

    This should bulld "as-is" using  "./configure && make && make install". Dont forget "ldconfig -v"

    Now libjsw (starting from the root of the source):

    (2a) In libjsw/ , edit Makefile and set PREFIX = /usr/local
            Now make && make install should install libjsw

    (2b) In jscalibrator/ , edit  Makefile  and set
            PREFIX=/usr/local
            CC = gcc
            CPP = g++

       and  edit the linker invocation in target "modules" to

           @$(CPP) $(OBJ_C) $(OBJ_CPP) -o $(BIN) $(LIBS) $(LIB_DIRS)

    This should now build jscalibrator. (make && make install)

    Finally, fuse itself. Obviously, re-run "./configure" and see if it detects libjsw. However, to successfully build fuse, i had to tweak

    "Makefile" and "z80/Makefile" to set

         CCLD = g++

    (So all the stuff is finally linked using g++).

    This should eventually yield a joystick-aware fuse binary :-)

    Hope this helps and good luck :-)

    Andreas

     
  • Phil Reynolds
    Phil Reynolds
    2011-01-13

    Hmmm… because I'm on amd64, this won't work as is - configuring glib fails thus:


    checking host system type…Invalid configuration `x86_64-unknown-linux-gnu': machine `x86_64-unknown' not recognized

    checking build system type… Invalid configuration `x86_64-unknown-linux-gnu': machine `x86_64-unknown' not recognized

    and later:

    loading cache ./config.cache within ltconfig
    ltconfig: you must specify a host type if you use `-no-verify'
    Try `ltconfig -help' for more information.
    configure: error: libtool configure failed

    So, not really any further forward yet… though it's certainly a pointer.

    Any further advice would be much appreciated.

     
  • Phil Reynolds
    Phil Reynolds
    2011-01-13

    Thanks, fredm… I updated to trunk 4255 and did ./configure with that option. Joystick support is back, but there is a slight problem - pressing button 11 (or presumably higher on sticks so equipped) crashes fuse. Good progress, though.

     
  • Thanks for the bug report, should be fixed in revision 4259.

     
  • Phil Reynolds
    Phil Reynolds
    2011-01-14

    It is indeed fixed - button 11 is now ignored.