RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    lr-fuse Joypad to Keyboard mapping

    Scheduled Pinned Locked Moved Ideas and Development
    lr-fusezx spectrumcontrols
    24 Posts 7 Posters 6.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • darkniorD
      darknior @maxbeanz
      last edited by

      @maxbeanz said in lr-fuse Joypad to Keyboard mapping:

      Mainly compatibility updates, lr-fuse is based on v1.1 (nearly 2 years old). There have also been improvements with Fast Loading protected games like Alkatraz Protection, tape loading detection improvements, TRD/SCL files can now autoboot, proper Recreated ZX Spectrum Keyboard support, RZX playback improvements and probably lots of other cool stuff.

      Hoooo excellent, i can be excellent if some one port these updates :)
      Fast loading is always a good option :)

      Life is game, just play it !

      1 Reply Last reply Reply Quote 0
      • HoraceAndSpiderH
        HoraceAndSpider
        last edited by

        I would welcome a ZX Spectrum emulator with greater focus on 'controller led play', particularly if it would allow the play of games like Bruce Lee or Gauntlet with 2 players :D

        pjftP 1 Reply Last reply Reply Quote -1
        • pjftP
          pjft @HoraceAndSpider
          last edited by

          @horaceandspider couldn't you play Bruce Lee in the current lr-fuse builds already even prior to this change? Player 1 set to Kempston, player 2 set to Interface 2 and off you go?

          1 Reply Last reply Reply Quote 0
          • HoraceAndSpiderH
            HoraceAndSpider
            last edited by

            @pjft I have never had a great deal with fuse-lr as a “plug and play” solution.

            Always seemed to end up in endless menu navigation just to set something like that up. Maybe I need to check the latest versions, but I remember zesarux was friendlier for setting custom controls but didn’t (doesn’t?) support multiple controller play unfortunately.

            Bruce Lee requires for example “enter” to start iirc, and then games like Gauntlet which have loads of joystick options but need the magic key (shift?) for each player!

            pjftP 1 Reply Last reply Reply Quote 0
            • pjftP
              pjft @HoraceAndSpider
              last edited by

              @horaceandspider wasn't aware of the Gauntlet controls, but for Bruce Lee other than accessing the on screen keyboard once to get things started I don't think you'll have much trouble with it.

              HoraceAndSpiderH 1 Reply Last reply Reply Quote 0
              • HoraceAndSpiderH
                HoraceAndSpider @pjft
                last edited by

                @pjft

                Yes OSK is ok to “do the job” but my interest in this thread is for a fully remapped solution :)

                pjftP 1 Reply Last reply Reply Quote 0
                • pjftP
                  pjft @HoraceAndSpider
                  last edited by

                  @horaceandspider you can remap Start as Enter and save it as a game for option file, I suppose.

                  HoraceAndSpiderH 1 Reply Last reply Reply Quote 0
                  • HoraceAndSpiderH
                    HoraceAndSpider @pjft
                    last edited by

                    @pjft

                    This is what I’ve looked to do, but as I said above I seem to end going round in circles on the menus.

                    although I confess I am not a massive fan of the libretro/retroarch menu system anyway....

                    I guess I’ll just watch and wait with interest :)

                    D 1 Reply Last reply Reply Quote 0
                    • D
                      dudleydes @HoraceAndSpider
                      last edited by

                      @horaceandspider I have taken a look at Bruce Lee and Gauntlet and here's how I have managed to get both games working with controllers for two players.

                      For both games, I took @pjft's suggestion of player 1 using the Kempston joystick and player 2 the Interface 2. To configure this, you can add the following lines to /opt/retropie/configs/zxspectrum/retroarch.cfg:

                      input_libretro_device_p1 = "513"
                      input_libretro_device_p2 = "1025"
                      

                      It's worth nothing that, in lr-fuse, by default, buttons L1 and R1 are mapped to RETURN and SPACE respectively so you can use L1 to start a game in Bruce Lee.

                      Menus are best navigated using the onscreen keyboard. I see little gain in trying to map navigation to a controller, especially in the case of Gauntlet which requires the cursor joystick to navigate the menus. The numbers 5 to 8 from onscreen keyboard can be used to choose an option and Space (R1) to make the selection.

                      For magic in Gaunlet, player 1 uses the Caps key. This can now be mapped to a controller thanks to @pjft's keyboard mapping update. If you want to avoid using the RGUI, you can create a text file GAUNT128.opt (or whatever the tape name is minus the extension) in the folder /opt/retropie/configs/all/retroarch/config/fuse. You can create the fuse folder if it doesn't exist. To this file, add the following:

                      fuse_joypad_y = "Caps"
                      fuse_machine = "Spectrum 128K"
                      

                      I have mapped magic to the Y button but you can map to your preferred button. Note, after you have launched Gauntlet, the game options file will auto-fill with default values for the other parameters.

                      For player 2, magic is the Space bar which is already be mapped to R1.

                      I have tested both games and they work reasonably well, though I haven't got far enough in Gauntlet to test the magic but the relevant buttons on both controllers did make a sound when pressed.

                      1 Reply Last reply Reply Quote 0
                      • HoraceAndSpiderH
                        HoraceAndSpider
                        last edited by HoraceAndSpider

                        @dudleydes said in lr-fuse Joypad to Keyboard mapping:

                        especially in the case of Gauntlet which requires the cursor joystick to navigate the menus. The numbers 5 to 8 from onscreen keyboard can be used to choose an option and Space (R1) to make the selection.

                        Thanks. But just to note you can select the 'protec' controller and use the cursors on the menu all from the same controller at once.

                        Menus are best navigated using the onscreen keyboard. I see little gain in trying to map navigation to a controller

                        I respectfully disagree, but this is a personal preference. I am trying to create a comfortable 'pick up and play' experience, not just for myself, but also for others who might use the machine, and I still want to avoid any OSK usage where i can.

                        I think maybe a little bit too much focus is being spent on the specfic games i mentioned... these were 'off the top of my head' example. There are so many that require a bit of keyboard input (or something like SkoolDaze that requires a hell of a lot of customisation!) , or a game like say jetpac would benefit just from having the 'select kempston' and 'start' menu controls mapped... or better still the game should start with mapping for the keyboard controls and then just use 'start' to ... well... start the game!

                        Greateful for the feedback, and i will look at what you have suggested for the editing of the retroarch file(s).... just a shame not to have a nice clear and easy GUI approach to this which is easy to navigate to, but as i said before , this could be as a result of my dislike of the RGUI interface.

                        I have yet to try the latest update from pjft 's update though. I have been so focused on Amiga development that i must admit my ZX Spectrum love has been left to neglect somewhat.

                        Just to note, in your examples, although working, I would want some consistency, so for example, if i was mapping the magic for player 1 to 'y' i would want player 2 to be the same... so certainly there is need for a bit ore input in many cases than just the default.

                        1 Reply Last reply Reply Quote 0
                        • S
                          ShinraPie @pjft
                          last edited by

                          @pjft said in lr-fuse Joypad to Keyboard mapping:

                          Hi all,

                          The last few weeks I've been getting more and more nostalgic for my ZX Spectrum games, and since I only play on a set up without a keyboard, many of the good games there (Head Over Heels, and others that need more than one fire button) were impractical to play.

                          I put together a PR for lr-fuse that enables users to map keyboard inputs to joypad buttons, so that the joypad can emulate keypresses. The good folks at lr-fuse have kindly helped a lot throughout the process and have just merged the PR, so (I believe) anyone who now updates lr-fuse from source will be able to map keyboard inputs to joypad buttons and enjoy more games. :)

                          Some notes:

                          • Keyboard mappings are set in the Options menu. They'll override the joystick you choose.
                          • You can save per-game option files to store keyboard mappings for specific games. I believe you also need to set RetroArch to load per-game config files in Settings > Configuration (?). Don't quite recall.
                          • Also added support for L2, R2, L3, R3 and Start buttons to be mapped.

                          A million thanks for leiradel and fr500 from lr-fuse (I don't think they're here in the forums, but if they run into this, this wouldn't have been done without their precious guidance).

                          Have a great weekend.

                          This feature is a must have so a big thank you for your work on this.
                          I need to install an earlier version as I think the newest LR-Fuse is broken for 48K Games.
                          The thing is I don't want to roll back so far as losing this feature. Please can you tell me when this was first implemented into RetroPie?

                          Thank you

                          pjftP 1 Reply Last reply Reply Quote 0
                          • pjftP
                            pjft @ShinraPie
                            last edited by pjft

                            @ShinraPie thanks for the message. As far as I recall this has been standard issue on lr-fuse since March 2018, so anything after that should be good to go.

                            I'm currently running 1.1.1 ef603d1 and both 48k and 128k seem to work well - just tried out RoboCop in both versions and it worked as intended. This was the binary that was available from at least a few weeks ago.

                            What issues are you experiencing with 48k though?

                            Happy Spectrum gaming!

                            Edit: also, in the last few years there have been a lot of modern ZX Spectrum games created - there was the Yandex competition last year and another one the previous year, all with solid games. If you'd want recommendations I'll gladly share some of the highlights that I tried out.

                            S 1 Reply Last reply Reply Quote 0
                            • S
                              ShinraPie @pjft
                              last edited by ShinraPie

                              @pjft said in lr-fuse Joypad to Keyboard mapping:

                              @ShinraPie thanks for the message. As far as I recall this has been standard issue on lr-fuse since March 2018, so anything after that should be good to go.

                              I'm currently running 1.1.1 ef603d1 and both 48k and 128k seem to work well - just tried out RoboCop in both versions and it worked as intended. This was the binary that was available from at least a few weeks ago.

                              What issues are you experiencing with 48k though?

                              Happy Spectrum gaming!

                              Edit: also, in the last few years there have been a lot of modern ZX Spectrum games created - there was the Yandex competition last year and another one the previous year, all with solid games. If you'd want recommendations I'll gladly share some of the highlights that I tried out.

                              Thanks PJFT,

                              That's great news I downloaded the latest version of RetroPie a couple of weeks ago so must be using the same version. This means that the software is fine and it's just me not really knowing knowing what I'm doing!

                              Glad you asked what the problem is! I just can't seem to set the 48K mode to work within RGUI - Quick menu - Options.

                              I've been trying to follow the below information from the user DudleyDes but I just can't seem to get it to work and there seems to be very little other info on this out there. Maybe the information is out of date and things are now done differently or maybe I'm just missing a simple setting somewhere which isn't mentioned...

                              Any advice or help you could offer is greatly appreciated.

                              Thanks

                              ***dudleydes 22 Nov 2016, 10:39
                              @Yorick According to World of Spectrum, Jetpac runs on a 16k machine. By default, lr-fuse, which I assume is you are using, runs the the 128k machine - you will see the line fuse_machine = "Spectrum 128K" in the file /opt/retropie/configs/all/retroarch-core-options.cfg.

                              If you change to 48k machine type in the RGUI, then Jetpac will run. Now this will be a pain to change between 48k and 128k machine for newer games that require the extra memory.

                              This is my solution. It may be not be optimum but it works.

                              In the folder /opt/retropie/configs/all/, create a text file called retroarch-core-options-fuse48k.cfg and add the following line:

                              fuse_machine = "Spectrum 48K"
                              Now we need to make sure Jetpac uses the 48k machine so in the ZX Spectrum roms folder, create a text file called Jetpac.tzx.cfg. The file name must match the tape so you may have to amend. In this file, add the following line:

                              core_options_path = /opt/retropie/configs/all/retroarch-core-options-fuse48K.cfg
                              Save and Jetpac should now run. If you take a look at retroarch-core-options-fuse48k.cfg after launching Jetpac, you'll notice RetroArch will have added extra lines. It's best to leave these.

                              For any other games that run a 16k machine such as Deathchase, all you need to do is copy the cfg file and rename it so that it matches the tape.***

                              Edit: Yes would be very interested in seeing some new Speccy games Thanks :D

                              pjftP 1 Reply Last reply Reply Quote 0
                              • pjftP
                                pjft @ShinraPie
                                last edited by

                                @ShinraPie I would follow the standard troubleshooting guidelines here, first and foremost - and potentially creating a separate thread with them, just to be fair with the current thread. I also saw you asked the same question in a separate thread, so you may choose to stick to that one, but whichever way you go about it, just pick one for ease of following up.

                                Can you launch the game selecting "Launch with verbose logging" in the runcommand menu and then send over the /dev/shm/runcommand.logfile? That should easily tell us what's being loaded or not.

                                What symptoms are you actually experiencing, though, to state that 48k isn't working? Does it not show as selected in the RGUI? Does it show it but doesn't load the game? More info will help. Feel free to tag me in the thread you choose or create.

                                An easy way to test it out is to go to RGUI, change it to 48k, and then restart the game in the RGUI, without leaving lr-fuse. Or do you mean no 48k options show up there?

                                Thanks.

                                S 1 Reply Last reply Reply Quote 0
                                • S
                                  ShinraPie @pjft
                                  last edited by

                                  @pjft

                                  Thanks for you swift response, see what you mean about keeping to one thread, I've been getting in a real muddle with this. Most of my time over the last week has been spent trying to do this and it's all just a blur to be honest! I posted an original thread here but nobody responded so I though I'd try replying to your thread since I wanted to be sure that the new version was not broken plus the need to keep your control mapping, so there's some progress at least. Please would you mind checking my thread as it has more information and I'll stick to just this one assuming it gets a reply.
                                  https://retropie.org.uk/forum/topic/26656/lr-fuse-still-not-loading-48k-zx-spectrum-roms-after-trying-all-previous-advice-in-this-forum?_=1592137239676

                                  I think I added a reply to DudleyDes's post just before I saw you responded to this one, once sorted I'll be happy to go through and delete any clutter I've left in other peoples threads.. I would have rather sent a private message but could not even figure that out.

                                  48k does show in the RGUI but all of the Roms that I have tried have not worked (maybe I was just very unlucky and had some bad roms, I'll try some others.) the game starts to load but then it just stops on the white Sinclair Research copyright screen and goes no further.

                                  Could you point me in the direction of the "troubleshooting guidelines"? or by that did you mean following the advice you suggested with the Verbose logging? I will give this a try and post results in my own thread.
                                  I'll figure out how to tag you in my thread and do that... Apologies this is all quite new to me!

                                  Many Thanks

                                  1 Reply Last reply Reply Quote 0
                                  • R
                                    RickyTan @pjft
                                    last edited by

                                    @pjft
                                    @pjft would you care to share your opt.files for the ZX Spectrum games?

                                    pjftP 1 Reply Last reply Reply Quote 0
                                    • pjftP
                                      pjft @RickyTan
                                      last edited by

                                      @RickyTan Hm. The .opt files are per-game - they depend on the games I have created them for, and the names of the files of my games.

                                      Is there anything in specific that you're looking for in those? I am happy to share mine, but I'm not sure if/how they'll help without knowing what you're looking for :)

                                      I default to Kempston joystick controls for lr-fuse, Player 1, and then adjust keys as needed for games that don't work with Kempston out of the box.

                                      Let me know what you're looking for and I'm happy to help!

                                      R 1 Reply Last reply Reply Quote 0
                                      • R
                                        RickyTan @pjft
                                        last edited by RickyTan

                                        @pjft How do you get Anteater to work?
                                        Do you have .opt file for Grand Prix Master

                                        pjftP 1 Reply Last reply Reply Quote 0
                                        • pjftP
                                          pjft @RickyTan
                                          last edited by

                                          @RickyTan I don't have the game Grand Prix Master myself, but from reading it should work with Kempston by default?

                                          For Anteater, the remake released in 2021, it's a simple QAOP control set, with Space for start and fire. This is my anteater.opt file:

                                          fuse_auto_load = "enabled"
                                          fuse_ay_stereo_separation = "none"
                                          fuse_fast_load = "enabled"
                                          fuse_hide_border = "enabled"
                                          fuse_joypad_a = "Space"
                                          fuse_joypad_b = "Space"
                                          fuse_joypad_down = "a"
                                          fuse_joypad_l = "<none>"
                                          fuse_joypad_l2 = "<none>"
                                          fuse_joypad_l3 = "<none>"
                                          fuse_joypad_left = "o"
                                          fuse_joypad_r = "<none>"
                                          fuse_joypad_r2 = "<none>"
                                          fuse_joypad_r3 = "<none>"
                                          fuse_joypad_right = "p"
                                          fuse_joypad_start = "Space"
                                          fuse_joypad_up = "q"
                                          fuse_joypad_x = "<none>"
                                          fuse_joypad_y = "<none>"
                                          fuse_key_hold_time = "500"
                                          fuse_key_ovrlay_transp = "enabled"
                                          fuse_load_sound = "enabled"
                                          fuse_machine = "Spectrum 128K"
                                          fuse_speaker_type = "tv speaker"
                                          

                                          Hopefully it helps.

                                          1 Reply Last reply Reply Quote 1
                                          • First post
                                            Last post

                                          Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                                          Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.