• Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
RetroPie forum home
  • Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

After xboxdrv mapping, controller isn't recognized by emulator

Scheduled Pinned Locked Moved Help and Support
xboxdrvatari800runcommandretroarch
21 Posts 5 Posters 2.1k 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.
  • M
    mediamogul Global Moderator @Lummox JR
    last edited by mediamogul 16 Jul 2018, 18:47

    @lummox-jr said in After xboxdrv mapping, controller isn't recognized by emulator:

    Meanwhile I'm hoping @mediamogul takes notice and can offer some guidance too.

    Sure. I've been using the Atari800 emulator quite a bit here recently between 'Last Starfighter', 'Montezuma's Revenge' and 'Pac-Man' (I really like the unpredictable ghost AI).

    My problem is the Atari 800 emulator simply stops seeing the joystick at all.

    Seeing as how you're key-mapping, the emulator shouldn't be looking for a controller at all, but rather the keyboard. Are you sure you have the emulator set to use the 'Keyboard Maps' for controller input?

    One piece of advice you can take or leave is to key-map your entire controller. An example of this using the default Atari800 key-mappings would look like.

    --ui-buttonmap b=KEY_RIGHTCTRL,a=KEY_RIGHTSHIFT,x=KEY_UNKNOWN,y=KEY_UNKNOWN,lb=KEY_UNKNOWN,rb=KEY_UNKNOWN,du=KEY_KP8,dd=KEY_KP5,dl=KEY_KP4,dr=KEY_KP6,start=KEY_F4,back=KEY_P,lt=KEY_UNKNOWN,rt=KEY_UNKNOWN,tl=KEY_UNKNOWN,tr=KEY_UNKNOWN
    

    You'll notice that only 'up', 'down', 'left', 'right', 'a', 'b', 'back' and 'start' are mapped which covers the directions, both action buttons and the start and pause functions. The rest are all mapped as 'KEY_UNKNOWN'. I do this to give myself placeholders for remapping Atari 5200 keypad input to the controller's face buttons for certain games.

    Also, any button left unmapped will produce input from the virtual xboxdrv controller rather than the virtual keyboard, which can have undesired effects in a few emulators. That said, it can also be handy sometimes to mix keyboard input with controller input. The great part about xboxdrv its versatility for just about any use case.

    RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

    1 Reply Last reply Reply Quote 0
    • L
      Lummox JR
      last edited by 16 Jul 2018, 19:04

      @mediamogul said in After xboxdrv mapping, controller isn't recognized by emulator:

      Seeing as how you're key-mapping, the emulator shouldn't be looking for a controller at all, but rather the keyboard. Are you sure you have the emulator set to use the 'Keyboard Maps' for controller input?

      I do not. Where would I change that setting? I tried looking it up but it's Google-proof.

      M 1 Reply Last reply 16 Jul 2018, 19:36 Reply Quote 0
      • M
        mediamogul Global Moderator @Lummox JR
        last edited by 16 Jul 2018, 19:36

        @lummox-jr

        I'm not near my Pi at the moment, but after invoking the options menu, it should be labeled something like 'Controller Input Settings'. From there, the option should be in one of the pull-down menus.

        RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

        L 1 Reply Last reply 16 Jul 2018, 20:01 Reply Quote 0
        • L
          Lummox JR @mediamogul
          last edited by 16 Jul 2018, 20:01

          @mediamogul Which options menu do you mean? There's the Retroarch RGUI (which I can't open with the joystick set the way it is), the Atari 800 emulator options via F1 (I don't see an option by that name there), or do you mean a different menu like in EmulationStation?

          I don't see anything that has the name "Controller input settings" anywhere that I've been looking.

          M 1 Reply Last reply 16 Jul 2018, 21:13 Reply Quote 0
          • M
            mediamogul Global Moderator @Lummox JR
            last edited by mediamogul 16 Jul 2018, 21:13

            @lummox-jr said in After xboxdrv mapping, controller isn't recognized by emulator:

            In the standalone Atari800 emulator, you invoke the options menu with 'F1' and then navigate to the 'Controller Configuration' menu. From there, you'll see 'Enable Keyboard Joystick' and 'Define Layout of Keyboard Joystick'. Between those two settings you'll be able to enable and map accordingly. You'll notice that there's no input setting for the second action button, necessary for some games. For some reason this is hard-coded into the emulator to be the 'Right Shift' key for both player one and two. Using xboxdrv, you can map the 'Right Shift' key using KEY_RIGHTSHIFT to whatever button you like and you should be good to go.

            RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

            L 1 Reply Last reply 16 Jul 2018, 21:35 Reply Quote 0
            • L
              Lummox JR @mediamogul
              last edited by Lummox JR 16 Jul 2018, 21:35

              @mediamogul The emulator I'm using is lr-atari800. When I go to "Controller configuration" in the F1 menu, I see these options:

              Joystick autofire: No
              Enable MultiJoy4: No
              Mouse device: None
              Mouse port: 1
              Mouse speed: 3
              

              There is no option to enable a keyboard joystick.

              If I change the emulator to just plain atari800, I do see that option. However, the colors of the non-lr atari800 emulator are totally messed up, so that the default colors instead of being white on blue are very light blue on white, and the game looks all wrong.

              M 1 Reply Last reply 16 Jul 2018, 22:08 Reply Quote 0
              • M
                mediamogul Global Moderator @Lummox JR
                last edited by mediamogul 16 Jul 2018, 22:08

                @lummox-jr said in After xboxdrv mapping, controller isn't recognized by emulator:

                However, the colors of the non-lr atari800 emulator are totally messed up, so that the default colors instead of being white on blue are very light blue on white, and the game looks all wrong.

                Believe it or not, this is meant to better simulate how the games would actually look on original hardware. In the Options menu, you can set it to use true black and vibrant colors, which is probably the way lr-atari800 is set by default.

                RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

                S L 2 Replies Last reply 16 Jul 2018, 22:35 Reply Quote 0
                • S
                  spud11 @mediamogul
                  last edited by 16 Jul 2018, 22:35

                  @mediamogul I'm using the atari800 emulator too. @Lummox-JR As mediamogul says, mapping to the keys generally works better than other methods.

                  If you can't get lr-atari800 to work properly, in atari800's GUI (entered with F1), go to "controller configuration" and define the joystick keys for both joysticks 1 and 2. For example, I mapped joystick 1/player 1 up/down/left/right to W, S, A and D etc. My xboxdrv configuration looks like this:

                  Player1_atari800="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv >> /dev/shm/runcommand.log 2>&1 \
                  --silent \
                  --detach-kernel-driver \
                  --deadzone=4000 \
                  --deadzone-trigger 15% \
                  --force-feedback \
                  --mimic-xpad \
                  --trigger-as-button \
                  --ui-buttonmap b=void,x=void,y=void,lb=void,rb=void,tl=void,tr=void,guide=void \
                  --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.3:1.0-event-joystick \
                  --device-name "Player_1" \
                  --evdev-absmap ABS_X=y1,ABS_Y=x1 \
                  --ui-axismap X1=KEY_A:KEY_D,Y1=KEY_W:KEY_S \
                  --evdev-keymap BTN_THUMB2=a,BTN_BASE3=back,BTN_BASE6=start,BTN_BASE2=lt,BTN_BASE5=rt \
                  --ui-buttonmap a=KEY_F \
                  --ui-buttonmap back=KEY_UNKNOWN,start=KEY_UNKNOWN,rt+back=KEY_F1,back+rt=KEY_F9,lt=KEY_F4,rt=KEY_SPACE \
                  --ui-buttonmap lt+rt=exec:/opt/retropie/configs/all/SoundToggle.sh"
                  

                  RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

                  1 Reply Last reply Reply Quote 1
                  • L
                    Lummox JR @mediamogul
                    last edited by Lummox JR 17 Jul 2018, 02:57

                    @mediamogul Thank you! I finally got all this working!

                    The only question I have left is that if I have a .bin file that I'm loading, is there any way to tell the emulator what cartridge type is being loaded so I don't have to manually select that (with the keyboard) each time? (Also, is there a way to choose to load BASIC with certain images? There were lots of BASIC games I used to play from Compute! magazine.)

                    M 1 Reply Last reply 17 Jul 2018, 04:35 Reply Quote 0
                    • M
                      mediamogul Global Moderator @Lummox JR
                      last edited by mediamogul 17 Jul 2018, 04:35

                      @lummox-jr said in After xboxdrv mapping, controller isn't recognized by emulator:

                      is there any way to tell the emulator what cartridge type is being loaded so I don't have to manually select that (with the keyboard) each time? (Also, is there a way to choose to load BASIC with certain images? There were lots of BASIC games I used to play from Compute! magazine.)

                      Both can be accomplished by first selecting the right cartridge type or to load with BASIC and then save the ROM out through the options menu using the cartridge management menu. I would recommend saving them to a separate location, rather than saving over the existing files, then archive the originals and finally move the newly saved ROMs into place.

                      Edit: Come to think of it, I don't believe you can specify BASIC this way, but cartridge types will definitely work.

                      RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

                      L 1 Reply Last reply 18 Jul 2018, 03:01 Reply Quote 0
                      • L
                        Lummox JR @mediamogul
                        last edited by Lummox JR 18 Jul 2018, 03:01

                        @mediamogul I found a solution to running BASIC games (these being in .atr files created by basic2boot). This is what the relevant part of my runcommand-onstart.sh file looks like now:

                        	# In the case statement
                        	atari800)
                        		eval $xboxkill
                        		joycommand="$retropad $atari800 &"
                        		eval $joycommand
                        		basicregex='basic\.atr$'
                        		if [[ $rom =~ $basicregex ]]; then
                        			newcmd=`echo $4 | sed 's/\(atari800 \)/\1-basic -xl /'`
                        			echo >>/dev/shm/runcommand.log "Execute: $newcmd"
                        			# Launch the game with altered params
                        			eval >>/dev/shm/runcommand.log $newcmd
                        			eval $xboxkill
                        			# Kill the calling script so it doesn't launch the game
                        			kill $(ps ex | grep runcommand.sh | grep bash | awk '{print $1}')
                        		fi
                        	;;
                        

                        I thought that might be pretty useful for others looking to run BASIC games when the emulator is configured to leave BASIC off by default. In my case it was Gold Rush from the Compute! magazine. The filename is "goldrush -basic.atr". I haven't figured out yet how to get the i flag into the regex I'm using in the if statement (this is largely cobbled together via a lot of Google fu and trial and error) but I'm otherwise happy with it.

                        L 1 Reply Last reply 18 Jul 2018, 03:04 Reply Quote 1
                        • L
                          Lummox JR @Lummox JR
                          last edited by 18 Jul 2018, 03:04

                          Darn it, I'm trying to edit my post but the stupid spam filter isn't letting me.

                          M 1 Reply Last reply 18 Jul 2018, 05:40 Reply Quote 0
                          • M
                            mediamogul Global Moderator @Lummox JR
                            last edited by mediamogul 18 Jul 2018, 05:40

                            @lummox-jr

                            It should let you edit it now that some time has passed. If not, I'll delete it and you can post your revision below. In any event, thanks for posting your solution. I don't currently have any games in mind that this would apply to, but I'm sure I'll run across some eventually and I'll give this a shot.

                            RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

                            cheesymonkeyC 1 Reply Last reply 4 Sept 2024, 11:24 Reply Quote 0
                            • cheesymonkeyC
                              cheesymonkey @mediamogul
                              last edited by 4 Sept 2024, 11:24

                              Six years later, I’m on 4.8.8 on a Pi 5 and I too cannot get the standalone emulator to work with my controller (8BitDo Pro 2). Have followed all the steps, but nothing.

                              Well, almost nothing…

                              If I start emulationstation under tmux directly on the Pi, then log into the same tmux session via SSH on my laptop, I can see the remapped button values (‘4’ when I D-Pad left, ‘6’ when right, etc.) which possibly means xboxdrv is being loaded correctly, the remapping is working but atari800 cannot ‘see’ this.

                              I’m connecting by Bluetooth and xboxdrv assigns a different event handler to that it initially connects on. The guide is unclear on having to remap the controller once it is being handled by xboxdrv. I had to quit out of ES with F4, then run the xboxdrv command in the background, restart ES and remap. Is thia how it should be done? I’m not starting xboxdrv through rc.local as a) Bluetooth and b) I only want to use this method for this emulator, particularly to remap number keys for games like Miner 2049er.

                              mituM 1 Reply Last reply 4 Sept 2024, 11:37 Reply Quote 0
                              • mituM mitu locked this topic on 4 Sept 2024, 11:34
                              • mituM
                                mitu Global Moderator @cheesymonkey
                                last edited by 4 Sept 2024, 11:37

                                @cheesymonkey please don't bump ancient topics.

                                For your controller model, you should install the xpadneo driver and then (re-)map the controller in EmulationStation, you don't need xboxdrv unless nowadays unless you're trying to set-up some special mapping (i.e. emulate 4way joysticks, keys pressed on button combo, modify the deadzone, etc.)

                                If you still have issues after installing xpadneo with the gamepad, please open a separate topic.

                                1 Reply Last reply Reply Quote 0
                                • cheesymonkeyC cheesymonkey referenced this topic on 6 Sept 2024, 13:52
                                • 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.

                                  This community forum collects and processes your personal information.
                                  consent.not_received