Arcade Controls with SPI

Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Locked
User avatar
PiffundPaff
 
Posts: 1
Joined: Wed Aug 20, 2014 5:25 am

Arcade Controls with SPI

Post by PiffundPaff »

Hi there,

i want to use the retrogame.c to control my Arcademachine. I am using a MCP23S17 (SPI) do extend my GPIO ports for 2 player gaming.
Is there any easy way to extend the retrogame.c file for SPI use?
I tried to write my own script with uinput for SPI, its working but not in mame so its kind of useless for my purpose. Maybe there is also an easy way to extend my own script to get it working in mame but as a beginner with RPI its kind of hard to get there with no idea how to make it.

I can upload my script if anyone is interested in.

Thanks

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

Re: Arcade Controls with SPI

Post by pburgess »

Is there any easy way to extend the retrogame.c file for SPI use?
An easy way? No. It's a departure from the current program flow and would take a chunk of effort.

We're working on I2C port expander support in retrogame, but it's still pretty rough at the edges. No ETA.

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

Re: Arcade Controls with SPI

Post by Bel_Z_Bub »

I read this yesterday, and in my hunt for saving pins, as well as I found this a bit of a challenge, I thought I'd give it a try this afternoon with an ADS1015 and a level shifter I ordered a few moments before, to see if I can upgrade my battery monitoring system with charge status percentage without losing a pin.

I wrote a custom i2c joystick driver and function within retrogame and to my surprise its working great so far.

so I also ordered the 8 and 16 channel i2c expanders today, I should get them in tomorrow. they have a few more options. I'll let you know the results.

Image

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

Re: Arcade Controls with SPI

Post by Bel_Z_Bub »

last night we have been playing all kinds of multiplayer nintendo games for hours without any troubles using a mcp23017 i2c chip for the second gamepad. brought back some good memories for us. :). No additional cpu usage!

Anyway now I'm going to try it with both controls on 1 chip or a chip for each controller, and I'm looking to buy a spi version as well, I'll let you know the results :)

Image

Locked
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Return to “Adafruit Raspberry Pi® accessories”