The Beagle Entertainment System (BES) is a suite of emulators with a GUI front-end that makes retrogaming on the BeagleBone Black simple and straightforward. It provides two SNES controller ports that use a BBB programmable realtime unit (PRU) to bitbang the controller protocol using GPIOs. This provides very low-latency controller inputs to the emulators, no matter how busy the main CPU is.
I started with a design using some Adafruit component boards I had sitting around: the ILI9340 320×240 TFT LCD, a four-channel BSS138 FET line-level converter, and a DS1307 RTC breakout board. I spent some time breadboarding the setup, using Fritzing for planning. The plan was to provide a status screen for the console using the LCD, native SNES gamepad interfacing with GPIOs running through the BSS138 board, and a battery-backed RTC for games that had one in their original carts.
The logic-level converters were necessary because SNES controllers use 5 volt signals and the BBB uses 3.3 volts. The SNES controller protocol is well documented, and I used the BBB’s PRUSS to bitbang the protocol using GPIOs. This has the added advantage of the controls not getting sluggish when the CPU load is high on the system. USB gamepads using the kernel joystick interface tend to get less responsive when CPU load gets really high, but the PRU keeps chugging along without any concern about CPU load. My PRU firmware placed the state of the two controllers into a 32-bit memory location shared between main system RAM and PRU RAM, so checking the controller states was as simple as doing a 32-bit memory read in my application.