Install gamecon_gpio_rpi, without using RetroPie
  • Hi all,

    So I found my gaming-image of choice: PiMame (PiPlay). I'm building a raspberry pi into a NES case, and using the original set of controllers. I want to implement the "gamecon_gpio_rpi"-driver to use them. I do not want to use the original RetroPie install script to install the driver, now i'm wondering if there is some way of installing this driver on PiMame. Can someone explain which steps have to be taken to install the driver?
    I do have the following URL about the driver: https://github.com/petrockblog/RetroPie-Setup/wiki/Module-for-GPIO-interface-for-retro-game-controllers

    Thanks in advance,
    Joost
  • What Connor posted should be right. Download that .deb, and install it.

    Then run:

    # modprobe gamecon_gpio_rpi map=,,,,,
    where is a number defining the pad type:
    0 = no connection
    1 = SNES pad
    2 = NES pad
    3 = Gamecube pad
    6 = N64 pad
    7 = PSX/PS2 pad
    8 = PSX DDR controller
    9 = SNES mouse

    More Info:
    -http://www.raspberrypi.org/phpBB3/viewtopic.php?f=78&t=15787
    -https://github.com/petrockblog/RetroPie-Setup/wiki/Module-for-GPIO-interface-for-retro-game-controllers


  • Full Readme:

    --- Game controller driver for Raspberry Pi's GPIO v0.9 ---

    1. Intro

    The driver is designed to be used with retro game controllers connected to Raspberry Pi's GPIO. Currently, up to 4 controllers of following types are supported:

    -NES gamepads
    -SNES gamepads
    -PSX/PS2 gamepads
    -N64 gamepads
    -Gamecube gamepads

    The driver is based on gamecon driver (see Documentation/input/joystick-parport.txt), but uses different pinout and parameters. No warranty - use at your own risk.


    2. Required hardware

    -Raspberry Pi and supported controllers
    -Jumper wires between GPIO and pads
    -Breadboard or splitter if multiple controllers are connected simultaneously


    3. Connecting the controllers

    GPIO pinout: http://elinux.org/Rpi_Low-level_peripherals

    Pins P1-01 and P1-06 are used as common power and ground for all controllers. Note that 3.3V is used for all controllers, even if SNES&NES pads nominally are operated at 5V. They should work fine with 3.3V so no level shifters are needed for data pins. The maximum current spec (50mA) should be enough for 4 controllers. However, use a proper ac adapter with Pi to avoid any unwanted voltage drops.

    Pins P1-03,05,07,26 (GPIO0, GPIO1, GPIO4 and GPIO7) are independent data pins, one per pad.
    NOTE: P1-03 & P1-05 correspond to GPIO2 G GPIO3 in rev.2 board, which must taken into account when loading the module. This is explained in section 4.

    Pins P1-19 & P1-23 (GPIO10 & 11) are common signal pins for all NES/SNES pads.
    Pins P1-08, P1-10 & P1-12 (GPIO14, 15 & 18) are common signal pins for all PSX/PS2 pads.


    3.1 NES & SNES gamepads

    Rpi pin SNES controller pin NES controller pin

    P1-01 (3.3V) ==== 1 (power) 1 (power)
    GPIO10 ---> 2 (clock) 5 (clock)
    GPIO11 ---> 3 (latch) 6 (latch)
    GPIOXX <--- 4 (serial data) 7 (data)<br />P1-06 (GND) ==== 7 (ground) 4 (ground)

    GPIOXX is the independent data pin. See section 4 on how to select the correct GPIO.

    SNES&NES controller pinout: http://pinoutsguide.com/Game/snescontroller_pinout.shtml


    3.2 N64 pads

    Rpi pin N64 controller pin

    P1-01 (3.3V) ==== power (leftmost)
    GPIOXX <--> data (middle)
    P1-06 (GND) ==== ground (rightmost)

    GPIOXX is the independent data pin. See section 4 on how to select the correct GPIO.

    N64 controller pinout: http://skytroniks.com/images/n64contports.jpg


    3.3 Gamecube pads

    Rpi pin Gamecube controller pin

    P1-01 (3.3V) ==== 6 (power/3.43V)
    GPIOXX <--> 3 (data)
    P1-06 (GND) ==== 2&5 (gnd)

    GPIOXX is the independent data pin. See section 4 on how to select the correct GPIO.

    http://ezhid.sourceforge.net/gcpad.png



  • 3.4 PSX/PS2 pads

    Rpi pin PSX controller pin

    P1-01 (3.3V) ==== 5 (power/3.3V)
    GPIO14 ---> 2 (command)
    GPIO15 ---> 6 (select)
    GPIO18 ---> 7 (clock)
    GPIOXX <--- 1 (data)<br />P1-06 (GND) ==== 4 (ground)

    GPIOXX is the independent data pin. See section 4 on how to select the correct GPIO.

    http://pinouts.ru/Game/playstation_9_pinout.shtml


    4. Configuring the driver

    Perform the following operations as root (or with sudo):


    4.1 Configure pads
    # modprobe gamecon_gpio_rpi map=,,,,,
    where is a number defining the pad type:
    0 = no connection
    1 = SNES pad
    2 = NES pad
    3 = Gamecube pad
    6 = N64 pad
    7 = PSX/PS2 pad
    8 = PSX DDR controller
    9 = SNES mouse

    For example, if a snes pad is connected to GPIO0 and a N64 pad to GPIO7, the command would be "modprobe gamecon_gpio_rpi map=1,0,0,6".

    NOTE: pad1 & pad2 are only used with rev.1 board, and pad5 and pad6 with rev.2. So if you have rev.2 board, pad1 and pad2 must be set as 0.

    The final pad index (used by the programs) is assigned sequentially for connected pads starting from 0. So in the previous example, snes pad would get index 0 and N64 pad index 1.

    Use "tail /var/log/kern.log" to verify that module loading was successful


    4.2 Testing the pads
    # apt-get install joystick
    # jstest /dev/input/jsX
    where X corresponds to the pad index (0-3)


    4.3 Calibrating the axis of N64 analog pad
    # jscal -s 4,1,0,0,0,6972137,6972137,1,0,0,0,6547006,6468127,1,0,0,0,536854528,536854528,1,0,0,0,536854528,536854528 /dev/input/jsX
    for each N64 controller


    4.4 Setting access delay for psx pads

    The access delay for PSX pads is set to 10us, which minimizes the performance penalty caused by the driver. However, in some rare cases it may not be enough to get stable input. If you have issues when reading psx pads, raise the delay with following extra modprobe parameter: "psx_delay=". is value in us, and can be set between 1-50.


    5. More information
    -http://www.raspberrypi.org/phpBB3/viewtopic.php?f=78&t=15787
    -https://github.com/petrockblog/RetroPie-Setup/wiki/Module-for-GPIO-interface-for-retro-game-controllers

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!