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

    Raphnet NES2USB Struggles

    Scheduled Pinned Locked Moved Help and Support
    raphnetnes2usbby-id
    21 Posts 5 Posters 4.0k 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.
    • hansolo77H
      hansolo77
      last edited by

      @mediamogul Do you know if I need the --detach-kernel-driver flag in my settings? I had a thought that maybe that's why the RunCommand stops working, because I've turned off the driver for the controller. I will test.

      UPDATE
      I've re-wired the USB plugs again, and have successfully managed to get the Raphnet to now always come up with the same event# regardless if my Xbox controller is on or off. All I had to do was connected it to port 0 (top left) of the Raspberry Pi. Now it always comes up as event0 and event1. Doing that caused my Xbox controller settings to get jacked up though. Because now RetroArch is looking for the Raphnet controller as the default Player 1 regardless of the emulator. I hope I fixed it though. I cleared out the retroarch.cfg settings again and re-created the controller mapping to the Xbox. I then set it so it would always use the Xbox controller as the default.

      Who's Scruffy Looking?

      mediamogulM 1 Reply Last reply Reply Quote 0
      • hansolo77H
        hansolo77
        last edited by

        UPDATE 2
        I have now configured a working XBOXDRV config to load via the runcommand-onstart.sh file. I've tested it with the Xbox controller both on and Off, and it works exactly like it should now. So YAY there. However, there is still an issue with RunCommand. I tried to # comment out the lines in the XBOXDRV config to see if I needed that --detach-kernel-driver flag. Apparently, I absolutely do need it. Without it, all I get is a black screen. The option to trigger RunCommand never displays, nor does the game. So I put them back into the config.

        NEW ISSUE Back to RunCommand
        Now that I've got the runcommand-onstart.sh configured and running like it should be, I'm back to the issue of not being able to trigger the RunCommand menu with anything other than the controller I programmed via XBOXDRV. Apparently, the RunCommand menu only excepts input from event0, js0, or a keyboard. By using XBOXDRV to remap the Raphnet controllers to a keyboard, I'm able to trigger RunCommand, and navigate, but I can't select any options. I feel like this a symptom of RunCommand limitations. In that it won't receive input from ALL controllers, and the only option to enter a menu is via the ENTER key. I would really appreciate it if somebody more in the know (dev's, etc) could look at this and consider updating it to allow condition. For instance, why does triggering require a specific controller (make it work with ALL controllers and ALL buttons). And then while navigating, allow input from all HATS, D-PADS, STICKS, etc. And then for selecting, allow input from "A" as well as "ENTER".

        Who's Scruffy Looking?

        mituM 1 Reply Last reply Reply Quote 0
        • mediamogulM
          mediamogul Global Moderator @hansolo77
          last edited by mediamogul

          @hansolo77 said in Raphnet NES2USB Struggles:

          Do you know if I need the --detach-kernel-driver flag in my settings?

          It probably doesn't matter in your case, but it's a good thought. I'd try it with and without to see it it makes a difference.

          I've tested it with the Xbox controller both on and Off, and it works exactly like it should now. So YAY there...

          I tried to # comment out the lines in the XBOXDRV config to see if I needed that --detach-kernel-driver flag. Apparently, I absolutely do need it. Without it, all I get is a black screen.

          Progress, nice! What kind of controller are you using again?

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

          hansolo77H 1 Reply Last reply Reply Quote 0
          • mituM
            mitu Global Moderator @hansolo77
            last edited by

            @hansolo77 said in Raphnet NES2USB Struggles:

            Apparently, the RunCommand menu only excepts input from event0, js0, or a keyboard

            Take a look at https://github.com/RetroPie/RetroPie-Setup/blob/3928a0570727f850ec8895cc18f77cad04d0d86d/scriptmodules/supplementary/runcommand/runcommand.sh#L106, on how the joy2key.py script is started by runcommand. I think you might want to fall on the else part of the test, which - from what I can tell from the joy2key sources - adds all input devices as possible sources.

            hansolo77H 1 Reply Last reply Reply Quote 0
            • hansolo77H
              hansolo77 @mediamogul
              last edited by

              @mediamogul said in Raphnet NES2USB Struggles:

              Progress, nice! What kind of controller are you using again?

              Player 1 - Global Default - Xbox 360 Wireless Controller
              Player 2 - Global Default - Xbox 360 Wireless Controller
              Player 3 - Global Default - Xbox 360 Wireless Controller
              Player 4 - Global Default - Xbox 360 Wireless Controller
              NES Player 1 (via XBOXDRV) - Raphnet NES2USB, Event0, Original NES Controller
              NES Player 2 (via XBOXDRV) - Raphnet NES2USB, Event1, Original NES Controller
              SegaMD Player 1 (via XBOXDRV) MayFlash, by-id, Original Sega Controller
              SegaMD Player 2 (via XBOXDRV) MayFlash, by-id, Original Sega Controller
              Atari (2600,5200,7800,800,etc) Player 1 (via XBOXDRV) - MayFlash, by-id, Original Atari Joystick
              Atari (2600,5200,7800,800,etc) Player 2 (via XBOXDRV) - MayFlash, by-id, Original Atari Joystick

              Who's Scruffy Looking?

              1 Reply Last reply Reply Quote 0
              • hansolo77H
                hansolo77 @mitu
                last edited by

                @mitu said in Raphnet NES2USB Struggles:

                @hansolo77 said in Raphnet NES2USB Struggles:

                Apparently, the RunCommand menu only excepts input from event0, js0, or a keyboard

                Take a look at https://github.com/RetroPie/RetroPie-Setup/blob/3928a0570727f850ec8895cc18f77cad04d0d86d/scriptmodules/supplementary/runcommand/runcommand.sh#L106, on how the joy2key.py script is started by runcommand. I think you might want to fall on the else part of the test, which - from what I can tell from the joy2key sources - adds all input devices as possible sources.

                Ah, that's insightful. Now if I only know how to cause the else statement. By using jsX, than means "ALL" right? I wonder if I can just add an extra mapping in the XBOXDRV to have it send ENTER and TAB along with what I have mapped to A and B. That would at least get me working INSIDE RunCommand. But I still don't have a way to trigger it with my Xbox controller if I don't have the NES controllers hooked up.

                Who's Scruffy Looking?

                mituM 1 Reply Last reply Reply Quote 0
                • mituM
                  mitu Global Moderator @hansolo77
                  last edited by

                  @hansolo77 said in Raphnet NES2USB Struggles:

                  Ah, that's insightful. Now if I only know how to cause the else statement

                  Well, for testing purposes you can copy the else branch code over the if branch. If that works, then you can see you get on that branch.

                  hansolo77H 1 Reply Last reply Reply Quote 0
                  • hansolo77H
                    hansolo77 @mitu
                    last edited by

                    @mitu I don't really follow. Are you saying I should edit the script locally and change the programming to not include anything BUT what's in the else bit? IF that works, what's to keep it from going back in the future?

                    Who's Scruffy Looking?

                    mituM 1 Reply Last reply Reply Quote 0
                    • mituM
                      mitu Global Moderator @hansolo77
                      last edited by

                      @hansolo77

                      for testing purposes

                      1 Reply Last reply Reply Quote 0
                      • hansolo77H
                        hansolo77
                        last edited by

                        The problem with RunCommand is directly associated having the XBOXDRV becoming active via the onstart script. I was able to remap the A and B buttons on my NES controller to be ENTER and TAB, as per the notations in the runcommand.sh script. I'm not able to map the buttons simultaneously though. If I try to do both, it only takes whatever is last entry. So it's either A=A and B=B or A=START and B=TAB. So changing the maps in XBOXDRV isn't the solution.

                        I wonder if a script can be made to launch with the emulator, that would allow the Xbox controller to still remain as js0? The more I think about it though, that's probably just nonsense. It's so weird how it all works. RetroArch will use the Xbox controller as the default no matter what. But also uses the XBOXDRV overtop of that config because it's using a keyboard. I remember at one point trying to map the Xbox controller as a 3rd device, but that pretty much broke RetroArch. I'm probably just going to end up stuck with what I have unless the devs are willing to look at and update RunCommand to not require js0 if it exists.

                        Who's Scruffy Looking?

                        1 Reply Last reply Reply Quote 0
                        • hansolo77H
                          hansolo77
                          last edited by

                          So as a test, I changed the runcommand.sh script to # comment out the if/then statement and make it only load the jsX device. It now read as:

                          function start_joy2key() {
                              [[ "$DISABLE_JOYSTICK" -eq 1 ]] && return
                              # get the first joystick device (if not already set)
                          #    if [[ -c "$__joy2key_dev" ]]; then
                          #       JOY2KEY_DEV="$__joy2key_dev"
                          #    else
                                  JOY2KEY_DEV="/dev/input/jsX"
                          #    fi
                              # if joy2key.py is installed run it with cursor keys for axis, and enter + tab for buttons 0 and 1
                              if [[ -f "$ROOTDIR/supplementary/runcommand/joy2key.py" && -n "$JOY2KEY_DEV" ]] && ! pgrep -f joy2key.py >/dev/null; then
                          
                                  # call joy2key.py: arguments are curses capability names or hex values starting with '0x'
                                  # see: http://pubs.opengroup.org/onlinepubs/7908799/xcurses/terminfo.html
                                  "$ROOTDIR/supplementary/runcommand/joy2key.py" "$JOY2KEY_DEV" kcub1 kcuf1 kcuu1 kcud1 0x0a 0x09 &
                                  JOY2KEY_PID=$!
                              fi
                          }
                          

                          This test didn't work. I still have the same results of not being able to trigger RunCommand.

                          Who's Scruffy Looking?

                          1 Reply Last reply Reply Quote 0
                          • 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.