Issues with Retrogame - Certain Inputs Not Recognized, Help!

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Hobbes2222
 
Posts: 4
Joined: Sun Sep 07, 2014 12:07 pm

Issues with Retrogame - Certain Inputs Not Recognized, Help!

Post by Hobbes2222 »

I'm building a Raspberry Pi Game Boy following this build thread: https://superpiboy.BANNED.com/. In short, this involves putting the Retropie image onto an SD card, along with the Retrogame files from Adafruit (tutorial found here: https://learn.adafruit.com/retro-gaming ... pi/buttons) and then wiring the GPIO pins to the Game Boy inputs (using this board that's custom-made for the Game Boy: http://store.kitsch-bent.com/product/co ... button-pcb).

I completed all the wiring and then moved on to configuring retrogame. As per the tutorial above, this involves editing the retrogame.c file to reflect the GPIO pins and controls you're using, then making the retrogame file. I used the default configuration that came in the retrogame.c file (i.e. Left is GPIO pin 25, Right 9, Up 10, Down 17, A 23, and B 7). The only thing I had to change in the file was to add two lines for Start (which I mapped to pin 8) and Select (which I mapped to pin 11). Here's what the final retrogame.c file looked like when I was done: http://imgur.com/Y0ZtmT3.

After I added the rows in nano, I hit Control+X to exit, then answered "Yes" to "Save modified buffer?", then pressed Enter when it asked "File Name to write: retrogame.c". Then I got back to the terminal and while the prompt said "pi@raspberrypi ~/retrogame $ " I typed in "make retrogame" and pressed Enter (all per the Adafruit tutorial). The following line then comes up: "make: "retrogame" is up to date."

All the inputs from the Game Boy worked in Retropie after this except for Start and Select. I rechecked everything else (connections to the GPIO pins, solder points on the board, etc.) and everything is correct.

Can anyone shed any light on why my Start and Select buttons wouldn't be working? Is anything I've done above incorrect, or have I omitted something? Does the line "make: 'retrogame' is up to date" reflect a successful make process? I'm a bit of a newbie when it comes to much of this, so any help would be greatly appreciated.

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Issues with Retrogame - Certain Inputs Not Recognized, H

Post by pburgess »

It's strange that it's reporting retrogame is up to date if you've modified the file. It's possible the editor saved the changed version in another location, perhaps directly in your home directory. If that's the case, move it to the retrogame directory, 'cd' there and 'make retrogame' again. Any change? Or try deleting retrogame and making.

User avatar
Bel_Z_Bub
 
Posts: 263
Joined: Wed Jun 04, 2014 1:58 pm

Re: Issues with Retrogame - Certain Inputs Not Recognized, H

Post by Bel_Z_Bub »

are you talking GPIO8 and GPIO11 or pin 8 and pin 11?

GPIO8 and GPIO11 is the SPI bus, could it be they dont work as inputs because SPI is enabled?

User avatar
carcuevas
 
Posts: 2
Joined: Tue Oct 07, 2014 10:28 am

Re: Issues with Retrogame - Certain Inputs Not Recognized, H

Post by carcuevas »

Hi all,

Sorry for re-open the topic, but actually I am finding the same problems, it is recognizing the GPIOs I am using, actually I am not using the RaspberryPi, but the Odroid-W (it should be compatible with the Pi, maybe it can have more GPIOs accessible), my question here if the Retrograme has some restrictions in order to work with some particular GPIOs (for example is just limited for that ones in the PI's headers) , in my case for example I am using the following, and I just can make work the GPIO31 (LEFT)..

ioStandard[] = {
// This pin/key table is used when the PiTFT isn't found
// (using HDMI or composite instead), as with our original
// retro gaming guide.
// Input Output (from /usr/include/linux/input.h)
{ 31, KEY_LEFT }, // Joystick (4 pins)
{ 36, KEY_RIGHT },
{ 37, KEY_UP },
{ 34, KEY_DOWN },
{ 42, KEY_LEFTCTRL }, // A/Fire/jump/primary
{ 41, KEY_LEFTALT }, // B/Bomb/secondary
{ 38, KEY_S }, // Select
{ 39, KEY_P }, // Start
{ 30, KEY_X }, // X/button
{ 29, KEY_Y }, // Y/button
{ 24, KEY_L }, // L/Button
{ 23, KEY_R }, // R/Button
// For credit/start/etc., use USB keyboard or add more buttons.
{ -1, -1 } }; // END OF LIST, DO NOT CHANGE


Thanks a lot for the help in advance :)

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Issues with Retrogame - Certain Inputs Not Recognized, H

Post by pburgess »

I'm surprised the code even compiles on the Odroid.

There's a lot of Pi-specific stuff going on. Specifically, the pin numbers are all based on the Broadcom GPIO #s. And then the pull-up resistor setting uses a 32-bit int and won't handle pin numbers higher than 31. Getting this to work on another board is going to require some low-ish-level knowledge of the hardware and whatever interface the OS provides to it, something I don't have with the Odroid.

User avatar
carcuevas
 
Posts: 2
Joined: Tue Oct 07, 2014 10:28 am

Re: Issues with Retrogame - Certain Inputs Not Recognized, H

Post by carcuevas »

Hi,

thanks for the answer :) so I guess that it's compiling since in essence the Odroid-W should be nearly the same as the PI, actually based in the same Broadcom with smaller size and a bit more features and added GPIOs; Anyway yesterday I did some tests changing the configuration to this:

ioStandard[] = {
// This pin/key table is used when the PiTFT isn't found
// (using HDMI or composite instead), as with our original
// retro gaming guide.
// Input Output (from /usr/include/linux/input.h)
{ 31, KEY_LEFT }, // Joystick (4 pins)
{ 23, KEY_RIGHT },
{ 25, KEY_UP },
{ 24, KEY_DOWN },
{ 18, KEY_LEFTCTRL }, // A/Fire/jump/primary
{ 22, KEY_LEFTALT }, // B/Bomb/secondary
{ 27, KEY_S }, // Select
{ 17, KEY_P }, // Start
{ 2, KEY_X }, // X/button
{ 3, KEY_Y }, // Y/button
{ 9, KEY_L }, // L/Button
{ 10, KEY_R }, // R/Button
// For credit/start/etc., use USB keyboard or add more buttons.
{ -1, -1 } }; // END OF LIST, DO NOT CHANGE



And I was much luckier :) I did not test still the GPIO 2,3,9 and 10 but the rest is working properly, just I needed to add the PULLUP resistors myself; actually I did the test to use a modified kernel to get the chance of using some extra-stuff which comes with the Odroid-W and still it compiled/worked properly...

Thanks a lot for your help once more :)

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”