Menu

#417 FUSE doesn't work anymore on RetroPie

v1.6.0
closed-fixed
nobody
sdl (4)
9
2021-02-28
2018-03-24
windale
No

FUSE doesn't work on RetroPie (Raspberry Pi) anymore. The last version that worked is v1.4.1. I think it's something to do with the new display method on FUSE. RetroPie uses Dispmanx. Any chance of getting this working again or are we stuck on v1.4.1 from now on ?

Discussion

1 2 > >> (Page 1 of 2)
  • Fredrick Meunier

    Could you try 1.5.0? There are no display or user interface related changes between 1.4.1 and 1.5.0, so if that doesn't work the problem may not be related to Fuse itself?

     
  • windale

    windale - 2018-03-25

    v1.5.0 may work but RetroPie will have to update their setup script as I don't know how to manually do it. RetroPie has been on v1.4.1 for a while now and then tried updating to v1.5.1 which didn't work as seen here :-

    https://retropie.org.uk/forum/topic/16766/segmentation-fault-with-fuse-v1-5-1

    Also, who updates the GUI for the Raspberry Pi version ? I can't use the D-Pad on my controller (as it's an Axis and not buttons), I can only control using the Analog stick. This means I can't even map it because the buttons aren't available. This really needs an update.

     
  • Fredrick Meunier

    I don't know who is involved with maintaining the RetroPie distribution - I don't recall seeing the people involved with that discuss anything with us here? I don't know what their setup is or which UI they use so its hard to give specific advice. Assuming that they are using libSDL for joystick support, you may need to check how it maps your controller's D-Pad to buttons and axis events and let us know what you find? It may be that yor D-Pad is sending button events instead of axis events.

    I don't have a RPi and I don't know if any of the other maintainters do, but if they don't its really down to the people interested in that platform talking with us to resolve any issues (or resolving issues themselves and letting us know what they've found).

    You could also give us the output from Fuse 1.5.1 with the --sdlfullscreenmode flag set to 'list'?

     
  • windale

    windale - 2018-03-25

    I'll just have to stick with v1.4.1 as they have already reverted back to it (because 1.5.1 didn't work). They don't seem interested unless someone else does it.

    Regarding my D-pad, it's actually detected as Axis events and doesn't work in the GUI, only the Analogue stick works which feels weird when using it to play Spectrum games and trying to navigate the menu is a nightmare as it moves too fast, better to use the keyboard. You can't map Axis in the GUI controls either, only buttons.

    It wouldn't be so bad if they updated Libretro FUSE but that's still uses FUSE v1.1 and has been for 2 years. Oh well.

     
  • Fredrick Meunier

    With the SDL joystick code, all axis events are handled as directional controls so the setup you describe for the D-Pad would work unless there is something platform-specific on the Pi? EDIT: See below - I was misremebering this detail.

    The libretro maintainer did pop onto the development mailing list for a little to talk about updating to a newer Fuse, but we hvaen't heard anything from him in a while.

     

    Last edit: Fredrick Meunier 2018-06-10
  • Sarah

    Sarah - 2018-06-09

    I too have a joypad with analogue sticks but the d-pad doesn't work (which is also detected as axis). I am using RetroPie and FUSE (Final ?) version 1.4.1. Is this the part of the input.c file that checks the joystick directions ? It says nothing about axis ?

       switch( joystick_event->button ) {
        case INPUT_JOYSTICK_UP   : button = JOYSTICK_BUTTON_UP;    break;
        case INPUT_JOYSTICK_DOWN : button = JOYSTICK_BUTTON_DOWN;  break;
        case INPUT_JOYSTICK_LEFT : button = JOYSTICK_BUTTON_LEFT;  break;
        case INPUT_JOYSTICK_RIGHT: button = JOYSTICK_BUTTON_RIGHT; break;
    

    Is this a conflict ? My D-Pad and Analogue Sticks are both detected as Axis but it only uses the Analogue.

    Left Analog L/R - Axis 0
    Left Analog U/D - Axis 1
    Right Analog L/R - Axis 2
    Right Analog U/D - Axis 3
    D-Pad L/R - Axis 4
    D-Pad U/D - Axis 5

    Is there a way to get it to use D-pad as priority ?

     
    • Fredrick Meunier

      Hmmm, I may have been thinking of an alternative form of the code.

      Do you know whether you are using the SDL joystick code or the libjsw code? The SDL code is in sdljoystick.c in the function sdljoystick_axismove() only maps axis 0 and 1 to spectrum joystick directions.

      You could try changing it to, though the result may depend on the axis values returned by your D-Pad:

      sdljoystick_axismove( SDL_JoyAxisEvent *axisevent )
      {
        if( axisevent->axis % 2 == 0 ) {
          do_axis( axisevent->which, axisevent->value,
                   INPUT_JOYSTICK_LEFT, INPUT_JOYSTICK_RIGHT );
        } else if( axisevent->axis % 2 == 1 ) {
          do_axis( axisevent->which, axisevent->value,
                   INPUT_JOYSTICK_UP,   INPUT_JOYSTICK_DOWN  );
        }
      }
      
       
  • Sarah

    Sarah - 2018-06-10

    It didn't work i'm afraid. I searched for the sdljoystick.c file and found it in fuse/ui/sdl/ (it's the correct file).

    The section of code you showed me at default is set at axis 0 and 1 which is my Left Analogue stick so this makes sense so far. I tried changing the 0 and 1 to 4 and 5 which is what jstest reports as my D-pad but it didn't work. I tried changing the 0 and 1 to 2 and 3 which is my Right Analogue stick and that worked fine. Why won't it let me use the D-Pad ? As I said, I got the button and axis mappings from jstest and it reports my D-Pad as axis 4 for Left/Right and 5 for Up/Down.

    EDIT: In EmulationStation when mapping the controller it lists the D-Pad directions as HAT.

     

    Last edit: Sarah 2018-06-10
  • Sarah

    Sarah - 2018-06-11

    Has anyone any idea why it isn't working ? This would probably mean that the same thing would happen on all platforms (if the analogues and d-pad are all detected as axis). Would this part have anything to do with it ?

     if( value > 16384 ) {
        event1.type = INPUT_EVENT_JOYSTICK_RELEASE;
        event2.type = INPUT_EVENT_JOYSTICK_PRESS;
      } else if( value < -16384 ) {
        event1.type = INPUT_EVENT_JOYSTICK_PRESS;
        event2.type = INPUT_EVENT_JOYSTICK_RELEASE;
      } else {
        event1.type = INPUT_EVENT_JOYSTICK_RELEASE;
        event2.type = INPUT_EVENT_JOYSTICK_RELEASE;
    

    But my D-Pad range is either -32767 or 32767 direction pressed or not pressed so that code probably doesn't affect it as it's above/below 16384 ? I don't understand why it doesn't work.

     
  • Fredrick Meunier

    That code would be what would interpret an axis event and your axis values should be OK if that event comes in as you were expecting - there is a chance that it is coming in as a SDL "hat" event. This code may help work that out assuming you are using the GTK+ UI - do you get the hat event message?:

    void
    ui_joystick_poll( void )
    {
      /* No action needed in SDL UI; joysticks already handled by the SDL events
         system */
    
    #ifndef UI_SDL
      SDL_Event event;
    
      while( SDL_PollEvent( &event ) ) {
        switch( event.type ) {
        case SDL_JOYBUTTONDOWN:
          sdljoystick_buttonpress( &(event.jbutton) );
          break;
        case SDL_JOYBUTTONUP:
          sdljoystick_buttonrelease( &(event.jbutton) );
          break;
        case SDL_JOYAXISMOTION:
          sdljoystick_axismove( &(event.jaxis) );
          break;
        case SDL_JOYHATMOTION:
          printf("Got hat event\n");
          break;
        default:
          break;
        }
      }
    #endif
    
    }
    
     
  • Sarah

    Sarah - 2018-06-12

    I am not sure if I have the GTK UI but the Retropie build script here https://github.com/RetroPie/RetroPie-Setup/blob/master/scriptmodules/emulators/fuse.sh
    mentions this -

    ./configure --prefix="$md_inst" --without-libao --without-gpm --without-gtk --without-libxml2 --with-sdl LIBSPECTRUM_CFLAGS="-I$md_build/libspectrum" LIBSPECTRUM_LIBS="-L$md_build/libspectrum/.libs -lspectrum"
        make clean
        make
        md_ret_require="$md_build/fuse"
    

    without-gtk with-sdl

    I tried adding the SDL_JOYHATMOTION part but I didn't get any message (I pressed the D-pad in the menu). When am I supposed to see that message or is it because it's wrong for my platform ? (I also kept the axis as 4 and 5 in the code and also tried 0 and 1 again).

     
  • Fredrick Meunier

    In that case try to put it in ui/sdl/sdlui.c instead - assuming that you are starting Fuse from a console so can see its console output:

    #if defined USE_JOYSTICK && !defined HAVE_JSW_H
    
        case SDL_JOYBUTTONDOWN:
          sdljoystick_buttonpress( &(event.jbutton) );
          break;
        case SDL_JOYBUTTONUP:
          sdljoystick_buttonrelease( &(event.jbutton) );
          break;
        case SDL_JOYAXISMOTION:
          sdljoystick_axismove( &(event.jaxis) );
          break;
        case SDL_JOYHATMOTION:
          printf("Got hat event\n");
          break;
    
     
  • Sarah

    Sarah - 2018-06-12

    Sorry, this is getting complicated for me now :( I am running Fuse from the Retropie Frontend so I won't be able to see anything in the console. Should I change the input.c file axis to 4 and 5 (which my dpad reports) or leave it at the default 0 and 1 and then add the JOYHATMOTION part to the sdlui.c file ?

    When I changed the axis to 2 and 3 in fuse/ui/sdl/sdljoystick.c it changed the controls to my Right Analogue stick but 4 and 5 didn't work.

    Do I have to change both files ?

     
  • Sarah

    Sarah - 2018-06-12

    As I cannot see if it's printing a HAT event message what was the code going to be to make it work anyway ? (Instead of printing "Got hat event" ). I can only use trial and error as I don't know how to run from console.

     
  • Sarah

    Sarah - 2018-06-13

    Could you tell me the SDL_JOYHATMOTION code please so I can try to see if it works ? I can see that you're fed up with helping me so if you could just show me the code that you were going to suggest instead of the printf and if it doesn't work then i'll stop asking and give up ! Thanks.

     
  • Fredrick Meunier

    Don't worry that anyone is tired helping, but we are all busy so can't always respond straight away.

    As you can't see the console, try this instead (it will popup a message in the interface):

    #if defined USE_JOYSTICK && !defined HAVE_JSW_H
    
        case SDL_JOYBUTTONDOWN:
          sdljoystick_buttonpress( &(event.jbutton) );
          break;
        case SDL_JOYBUTTONUP:
          sdljoystick_buttonrelease( &(event.jbutton) );
          break;
        case SDL_JOYAXISMOTION:
          sdljoystick_axismove( &(event.jaxis) );
          break;
        case SDL_JOYHATMOTION:
          ui_error( UI_ERROR_WARNING, "Got hat event\n" );
          break;
    
    #endif                  /* if defined USE_JOYSTICK && !defined HAVE_JSW_H */
    
     
  • Sarah

    Sarah - 2018-06-13

    OK, the message came up when I pressed the D-pad ! (But then it locked up!)

    So the only file I have changed up to this point is fuse/ui/sdl/sdlui.c and added the JOYHATMOTION part.

    While i'm here, to prevent too many posts, could you also tell me what to change for the Open Menu button ? Currently it's Joypad Button 2 and can't be remapped. I would like to change it to my Start button (Button 10).

     
  • Fredrick Meunier

    OK, that confirms that we need to add Joystick hat support to get your D-Pad working. I'll look at that when I get a chance.

    The open menu button is handled in input.c (INPUT_JOYSTICK_FIRE_2 below):

    static int
    do_joystick( const input_event_joystick_t *joystick_event, int press )
    {
      int which;
    
    #ifdef USE_WIDGET
      if( ui_widget_level >= 0 ) {
        if( press ) ui_widget_keyhandler( joystick_event->button );
        return 0;
      }
    
    #ifndef GEKKO /* Home button opens the menu on Wii */
      switch( joystick_event->button ) {
      case INPUT_JOYSTICK_FIRE_2:
        if( press ) ui_popup_menu( INPUT_KEY_F1 );
        break;
    
      default: break;               /* Remove gcc warning */
    
      }
    #endif  /* #ifndef GEKKO */
    
     
    • Fredrick Meunier

      This is an untested experimental patch to add support for joystick hats. I don't have a gamepad that works that way so any feedback you can provide would be welcome.

       
  • Sarah

    Sarah - 2018-06-16

    Thanks for pointing me to the Open Menu button part. It's a shame that it doesn't let you remap the menu button in the GUI because it's in the way of the fire buttons and accidently gets pressed.

    I hope the D-Pad fix doesn't require any extra files to be added as I think v1.4.1 is the final version in Retopie because they can't/won't update it for some reason. (It could all be done in the sdlui.c file ?).

     
  • Sarah

    Sarah - 2018-06-19

    Any news ?

     
  • Sarah

    Sarah - 2018-06-25

    Can anybody please help to get this resolved ? I just wan't to be able to use the d-pad to control the menu/games instead of the analogue stick. We've established that my d-pad needs HAT support in Fuse (and i'm assuming other people will need this too). If anyone can finish what's needed in the sdlui.c file i'd be grateful.

     
  • Sarah

    Sarah - 2018-06-26

    I have no idea what to do with a patch and Retropie are not updating Fuse so I will never see the changes in a new version. Could you show me what parts of code to add to the existing files like we did above so I can manually change them ? Thanks.

     
    • Alberto Garcia

      Alberto Garcia - 2019-01-09

      Hey, if you open the patch file you'll see lines that start with a '+', those are the ones that you need to add to the file.

      edit: I realize that this was applied in [patches:#409], sorry for the noise.

       

      Related

      Patches: #409


      Last edit: Alberto Garcia 2019-01-09
  • Sergio Baldoví

    Sergio Baldoví - 2019-04-21
    • labels: --> sdl
    • status: open --> closed-fixed
    • Group: future --> NextRelease
     
1 2 > >> (Page 1 of 2)

Log in to post a comment.