Menu

#355 Joystick should not prompt for RZX

future
open
nobody
None
5
2016-07-25
2016-06-30
No

If you change the joystick file when watching RZX files it will not work.
More info on this matter here: https://github.com/bog-dan-ro/spectacol/issues/87

Related

fuse: 582f2a6da02bb111d08fb779

Discussion

  • Fredrick Meunier

    Hi BogDan,
    Can you provide an example RZX to look at?

     
  • BogDan Vatra

    BogDan Vatra - 2016-07-01

    I can reproduce it with any rzx (with snapshots) recorded by fuse.

     
  • BogDan Vatra

    BogDan Vatra - 2016-07-01

    Let me know if you still need an example :)

     
  • Fredrick Meunier

    Hi BogDan,
    Joystick setting evaluation is done in the UI code at the moment (e.g. joystick_done() for GTK+ or set_joystick_type() for Widget) which is where I'd imagine we'd ignore joystick changes during RZX playback - I imagine that making changes in those places wouldn't help on Spectacol though?

     
  • BogDan Vatra

    BogDan Vatra - 2016-07-07

    Nope, but I'll do the same changes if necessary.

    Isn't easyer to not send the joy prompt notification instead?

     

    Last edit: BogDan Vatra 2016-07-07
  • Fredrick Meunier

    I thought you were talking about using the Joystick preferences as we already shouldn't be prompting for joystick changes when loading in peripherals/joystick.c:285?

    282:     if( settings_current.joystick_keyboard_output != fuse_type &&
    283:         settings_current.joystick_1_output != fuse_type &&
    284:         settings_current.joystick_2_output != fuse_type &&
    285:         !rzx_playback ) {
    
     
  • BogDan Vatra

    BogDan Vatra - 2016-07-07

    I'm talking about ui_confirm_joystick function call. This function should not be called when loading RZX files.

     
  • BogDan Vatra

    BogDan Vatra - 2016-07-07

    Ah I didn't read your entire message :D.
    It seems the code is there but it doesn't work :).

     
  • Sergio Baldoví

    Sergio Baldoví - 2016-07-07

    It seems that rzx_playback is set to 1 after loading the rzx file and the snapshot.

     
  • Fredrick Meunier

    Hi BogDan,
    Looking at your Spectacol issue and having a look at your source, if I read it correctly it looks like you are ignoring the libspectrum_type and inputs arguments to ui_confirm_joystick and are just launching your general joystick configuration dialog.

    ui_confirm_joystick() is intended to call into the UI to present a dialog that asks the user if they want to enable emulation for a joystick configured in a snapshot (including the initial one in an RZX) if we can see they do not currently have the appropriate emulation enabled.

    The arguments tell the UI which joystick interface is enabled in the snapshot and where they are configured to be connected and should report back which real Fuse input device the user wants to connect the joystick to (Joystick 1, 2, keyboard or don't change the config).

    You can either change your UI to present a suitable query dialog to the user or unconditionally return UI_CONFIRM_JOYSTICK_NONE if you don't believe it is relevant for Spectacol users.

    If I've missed your point it may be best for you to attach a demo video and a sample RZX so I can reproduce without having to guess :)

     

    Last edit: Fredrick Meunier 2016-07-08
  • Fredrick Meunier

    The intention of ui_confirm_joystick() with RZX playback is that it is called when loading the initial snap and not for any subsequent mid-playback snaps. As far as I can tell you are intending to not have any prompt to reconfigure the joystick, so shouldn't your ui_confirm_joystick() implementation simply be the following?:

    extern "C" ui_confirm_joystick_t ui_confirm_joystick( libspectrum_joystick /*libspectrum_type*/, int /*inputs*/ )
    {
        return UI_CONFIRM_JOYSTICK_NONE;
    }
    
     

    Last edit: Fredrick Meunier 2016-07-24
  • BogDan Vatra

    BogDan Vatra - 2016-07-24

    I think there is a missundersending here :).
    I thought that ui_confirm_joystick is not called at all when loading a RZX.
    As you pinted here https://sourceforge.net/p/fuse-emulator/bugs/355/#33d2 the call of ui_confirm_joystick is guarded by !rzx_playback, but rzx_playback is initialized too late. My patch just initialize rzx_playback before it loads the snapshot.
    IMHO calling ui_confirm_joystick when loading a RZX is useless because the user already choose a (emulated) joystick type and it used it to start the game. If I'll change the (emulated) joystick type, the user will not be able to use it when he resumes the game.

     
  • Fredrick Meunier

    I definitely think there is a misunderstanding, which is why I suggested adding a demo video and a sample RZX so we can be absolutely clear on what we are discussing :)

    Snapshots store the state of the joystick emulation used when they were made. If the configuration of an emulator doesn't match that joystick configuration when that snapshot or RZX is loaded, the user will not be able to continue playing with the settings from the in-progress game and so we prompt the user if they have a mismatched configuration on whether they want to auto-switch their joystick config to a matching one.

    So the scenario is like:
    1. User selects a joystick configuration
    2. User loads a game
    3. User starts recording a RZX
    4. User saves the RZX to continue at another time
    5. User uses the emulator for other purposes and changes the joystick configuration to something else
    6. User reloads the RZX, the emulator sees the configuration in use in the initial RZX snapshot and prompts the user to change their joystick config to that specific setup so that they can continue as expected - this is not intended to show a standard joystick configuration preference screen, it is supposed to be a specific dialog stepping through any mismatched joystick configuration and asking user preferences
    7. Second and subsequent embedded snaps in the RZX do not change config

    A second scenario replaces steps 1-5 with another user performing these steps and publishing the RZX for others to download and use.

    If step 5 is skipped or there is no mismatch in step 6 for any reason, there is no prompt. The user can only have a mismatch to the snapped joystick state if they decline the auto-switch from the prompt or have turned off joystick prompts.

     
  • windale

    windale - 2016-07-24

    This is how I understand it in layman's terms.

    If the joystick prompt is off :-
    1) The user's joystick is set to 'Kempston' for example.
    2) They load a snapshot that was made with 'Cursor' joystick for example.
    3) Nothing changes and the user's joystick stays as 'Kempston'.

    If the joystick prompt is turned on :-
    1) The user's joystick is set to 'Kempston' for example.
    2) They load a snapshot that was made with 'Cursor' joystick for example.
    3) Because the user's joystick is different the joystick prompt appears telling the user that 'Cursor' joystick was used and do they want to change to it.

     
  • Fredrick Meunier

    That's right - can you describe (or show) what you are finding instead?

     
  • windale

    windale - 2016-07-25

    It's fine on Fuse, but it's completely different on Spectacol. I think BogDan just needs to make it similar to Fuse. At the moment on Spectacol :-

    If the joystick prompt is off :-
    Loading a snapshot changes the joystick without even asking.

    If the joystick prompt is on :-
    Loading a snapshot changes the joystick and the joystick prompt comes up with a list of 7 joystick controllers.

    I think it just needs to be changed to the way described above.

     

Log in to post a comment.