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

    GPIOv1 on RetroPie 3.6

    Scheduled Pinned Locked Moved Help and Support
    8 Posts 2 Posters 3.2k 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.
    • S
      SuperSirLink
      last edited by

      I am working on updating my RetroPie box from a Raspberry Pi 1B to a 3B... I was using the original version of the GPIO adapter to run my NES/SNES controllers... I see in the new version of the RetroPie Setup script there is a Gamecon driver and the SNESDev Driver I was using.

      Which is the better driver to use? Or do you need to setup both?

      Incidentally I had recompiled my own copy of SNESDev in order to reconfigure the push button for a single keyboard function as outlined on the old forums here:
      http://blog.petrockblock.com/forums/topic/change-retropie-gpio-button-coding-to-1-press/#post-3528

      Do I see need to do this, or is there another way to now accomplish this? Since I reused actual NES buttons, I wired the reset button to the GPIO adapter to send the ROM reset key press...

      1 Reply Last reply Reply Quote 0
      • S
        SuperSirLink
        last edited by

        So have been doing more research and re-familiarizing myself with the setup... I did not see any way to use Gamecon to drive the momentary button on the GPIO adapter, so I have been working on setting up SNESDev-RPi again... I also didnt see any option still to change the key sequence the virtual keyboard momentary button would send, so I have been working on making the changes myself and recompiling as I did on the RPi 1 build...

        I pulled down a clean copy from Git Hub per the instructions here: https://github.com/petrockblog/SNESDev-RPi
        cd
        git clone git://github.com/petrockblog/SNESDev-RPi.git
        cd SNESDev-RPi

        I was able to modify the SNESDev.c (~/SNESDev-RPi/src) to modify the key sequence like I had before:

        		switch (button.state) {
        		case BTN_STATE_IDLE:
        			break;
        		case BTN_STATE_PRESSED:
        			if (button.pressedCtr == 1 && button.duration >= 1) {
        				uinput_kbd_write(&uinp_kbd, KEY_LEFTALT, 1, EV_KEY);
        				uinput_kbd_write(&uinp_kbd, KEY_H, 1, EV_KEY);
        			}
        			break;
        		case BTN_STATE_RELEASED:
        				if (button.pressedCtr == 1 && button.duration >= 1) {
        					uinput_kbd_write(&uinp_kbd, KEY_LEFTALT, 0, EV_KEY);
        					uinput_kbd_write(&uinp_kbd, KEY_H, 0, EV_KEY);
        					}
        			break;
        		}
        

        I then continued the install with:
        sudo make
        sudo make install
        sudo make installservice

        Testing js0 and js1 works as expected and each button registers:
        jstest /dev/input/js0
        jstest /dev/input/js1

        The test button utility is not recognizing the button presses. Running it shows not pressed, however it sends the correct key sequence in RetroArch now (resets the ROM)...

        1 Reply Last reply Reply Quote 0
        • S
          SuperSirLink
          last edited by

          I should also add, I couldn't not start SNESDev until I REMed out the line in the /etc/snesdev.cfg

          Was getting an error: /usr/local/bin $ /etc/snesdev.cfg:4: no such option 'adapter_version'

          Configuration file for SNESDev, the driver for the RetroPie GPIO Adapter.

          Revision of RetroPie GPIO Adapter. Options: "1x", "2x"
          adapter_version="1x"

          button enabled? Options: 0 (disabled), 1 (enabled)
          button_enabled=1

          game pad 1 enabled? Options: 0 (disabled), 1 (enabled)
          gamepad1_enabled=1

          gamepad 1 type. Options: "nes", "snes"
          gamepad1_type="snes"

          game pad 2 enabled? Options: 0 (disabled), 1 (enabled)
          gamepad2_enabled=1

          gamepad 2 type. Options: "nes", "snes"
          gamepad2_type="snes"

          1 Reply Last reply Reply Quote 0
          • S
            SuperSirLink
            last edited by

            Don't recall if it was like this before, but JStest detects the A and B button as different numbers between NES and SNES controllers... This isn't a big deal from within the emulators since you can specify inputs for each console, but in Emulation Station you don't have that option...

            NES:

            • 1 = A
            • 3 = B
            • 7 = Start
            • 6 = Select

            SNES:

            • 0 = A
            • 1 = B
            • 2 = X
            • 3 = Y
            • 7 = Start
            • 6 = Select
            • 4 = Left Bumper
            • 5 = Right Bumper
            1 Reply Last reply Reply Quote 0
            • S
              SuperSirLink
              last edited by

              Doing this agin but now on RetroPie 4.2 but running into some trouble and not sure where my break down is...

              I am trying to setup SNES-Dev again still using my GPIO adapter 1.2 on a Raspberry Pi 3, I am able to go through my steps above without an issues that I can see. But trying to run the jstest is not successful this time.

              I do not have a js0 or js1 inside /dev/input

              Can someone give me an idea as to where I am going wrong?

              1 Reply Last reply Reply Quote 0
              • DarksaviorD
                Darksavior
                last edited by

                I'm using the gamecon driver with two snes pads. It's much better than the snesdev driver because it doesn't need 30 seconds to shutdown.

                S 1 Reply Last reply Reply Quote 0
                • S
                  SuperSirLink @Darksavior
                  last edited by

                  @Darksavior I thought about switching but I rely on the soft button on the GPIO adapter...

                  1 Reply Last reply Reply Quote 0
                  • S
                    SuperSirLink
                    last edited by

                    My notes to myself were not very clear :) I got the same error I noted when I tried to start SNESDev manually ...

                    I have to rem out the line adapter_version="1x" in /etc/snesdev.cfg (changing the line to the correct version of the board 1x, was not enough)

                    Once I did that I was able to launch SNESdev manually and validate js0 and js1

                    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.