3. Connecting the controllers

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 on older Pi boards) are independent data pins, one per pad.
NOTE: P1-03 & P1-05 correspond to GPIO2 & GPIO3 in rev.2 board, which must taken into account when loading the module. This is explained in section 4.

4.3 Calibrating the axis of N64 analog pad

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=<delay>". <delay> is value in us, and can be set between 1-50.

mercredi 16 mars 2016

​I took the following steps before downloading the gamecon GPIO driver:

After booting from the SD for the first time, launch RetroPie-Setup, look for option 312 and upgrade Raspbian (you need the latest version of your system before installing the latest gamecon driver developed for it - logical, right?) and reboot.

Update raspi-config (A0 in advanced options) and reboot.

Update the RetroPie-Setup script and reboot.

Change locale (I1)

Change timezone (I2)

Change keyboard (I3)

Overclock the Pi (8)

Reboot (sudo reboot is the command you can type directly into the Pi's console or remotely through Putty)

Binary based installation (in RetroPie-Setup) and reboot.

Install (finally!) the GPIO/DB9 gamecon drivers and accept the offer to configure it for two SNES controllers (even if you want to use other controllers).

Reboot

I know that's a lot of reboots but I didn't want to risk damaging Raspbian (and start over from a blank SD because I'm not a Linux guru) :/

Another thing I like to do is use the 'Quit EmulationStation' option to return to the command line in case some of its files (like the games' metadata) need to be modified (like by the scraper) and won't be locked by the running program.

[At any moment, feel free to add some games to the ROM directories (in Windows: '\\retropie\roms' if you connected your Pi to the (W)LAN) !]

Now, to correctly (on RetroPie 3.6) configure gamecon:

From the console (pi@retropie:~ $), type cd /etc/modprobe.d

Type sudo nano gamecon.conf

You are now inside the 'nano' editor and can adjust the mapping according to your controller type and wiring (my gamecon.conf file looks like this:

options gamecon_gpio_rpi map=0,0,0,0,6,0

...because I only wired one N64 controller (type 6) to the first available (on a Raspberry Pi 2) GPIO pin.)

Use Ctrl+X to exit, press Y and Enter to save the changes.

Recent versions of Linux don't accept these parameters inside the 'modules' file. It should only have 'gamecon_gpio_rpi' without the 'map' part, which is to be written to the .conf file we just mentioned above or there will be a boot error because the deprecated way of setting things is not accepted anymore.

My modules file looks like this:

# /etc/modules: kernel modules to load at boot time.## This file contains the names of kernel modules that should be loaded# at boot time, one per line. Lines beginning with "#" are ignored.

uinputjoydevsnd-bcm2835uinputjoydevsnd-bcm2835gamecon_gpio_rpi

You'll (obviously) need to reboot once again to test these settings.

To learn more about connecting a classic controller to the GPIO port, read this :)

After that, I was able to setup the N64 gamepad as a controller inside EmulationStation; everything but the analog stick was usable there. If this happens to you, just configure the functions you can and skip the others. After that, edit (comfortably, from Windows, in Notepad++) the .cfg file generated in '\\retropie\configs\all\retroarch-joypads'.