GithubHelp home page GithubHelp logo

imclab / snesdev-rpi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from petrockblog/snesdev-rpi

0.0 2.0 0.0 1.32 MB

Simulates a virtual keyboard for two SNES controllers that are connected to the GPIO pins of the Raspberry Pi (TM)

Makefile 12.25% C 18.07% Shell 66.15% C++ 2.99% XSLT 0.03% CSS 0.48% JavaScript 0.02%

snesdev-rpi's Introduction

SNESDev-RPi

SNESDev is a user-space driver for the RetroPie GPIO Adapter for the Raspberry Pi. It implements two (S)NES game controllers and a virtual keyboard for up to two (S)NES controllers and a button that are connected to the GPIO pins of the Raspberry Pivia the RetroPie GPIO Adapter (http://blog.petrockblock.com/2012/10/21/the-retropie-gpio-adapter/).

Installation

Manual installation:

First of all, make sure that Git is installed:

sudo apt-get update
sudo apt-get install -y git

SNESDev is downloaded and installed with

cd
git clone git://github.com/petrockblog/SNESDev-RPi.git
cd SNESDev-RPi
sudo make
sudo make install

The lines above build and install two needed libraries and SNESDev-Rpi. The sudo-command is needed for the installation of the two libraries.

Alternatively, you can use the RetroPie Setup Script (https://github.com/petrockblog/RetroPie-Setup) for installing and configuring SNESDev.

Running

In order to run SNESDev mae sure that the uinput module is loaded. You can check this with

lsmod

The module is loaded with

sudo modprobe uinput

If you want to have the uinput module automatically loaded, you can add "uinput" to the file /etc/modules.

SNESDev has to be run as background process with

sudo ~/SNESDev-RPi/bin/SNESDev &

In order to access the uinput device SNESDev has to be run as root. This is (obviously) not so nice and is currently an issue. If you have a solution or suggestion for that, feel free to submit a pull request or send me a mail!

Configuring SNESDev-Rpi

SNESDev-Rpi is configured with the help of the configuration file /etc/snesdev.cfg. It is a lightweighted configuration file and well commented. You can also use the RetroPie Setup Script (https://github.com/petrockblog/RetroPie-Setup) for configuring SNESDev.

IMPORTANT: You might need to configure the correct version of the RetroPie GPIO Adapter. The default version is 2.X. If you find a revision number 1.X on your RetroPie GPIO Adapter you need to set the configiration parameter "adapter_version" to "1x".

Running SNESDev as a service

SNESDev-RPi comes with a script that allows SNESDev to be run as a service. The installation command for that is

sudo make installservice

Button Polling

If you use the functionality for polling a button (on GPIOin P1-11), a three-state automaton is implemented:

  • press and hold: send "r" key (for rewind function of RetroArch)
  • press and release three times: send "ESC"
  • press and release five times: shutdown

For comments, corrections, and suggestions visit https://github.com/petrockblog/SNESDev-RPi.

Have fun!

Raspberry Pi is a trademark of the Raspberry Pi Foundation.

snesdev-rpi's People

Contributors

petrockblog avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.