Nocturnal
Posts: 16
Joined: Sat Jun 02, 2012 11:15 am

AdvanceMAME Controls

Sat Jun 09, 2012 3:36 pm

So I build some controls, hooked them up to the GPIO port and written a kernel module to interface with the input/joystick subsystem. The issue I am having is that jstest can read the controls fine, but advj detects the controls, but is unable to read them. ie it shows the correct joysticks and buttons, but detects no change in them. specifying --joystick_device raw allows the controls to be read, but neither sdl or event mode work.

Anyone have any thoughts on this? I spent the past day beating my head against advj, trying to get my module code to work before I tried jstest and realised it was working, so I'm not really in the mode for more researching and testing.

SSilver2k2
Posts: 179
Joined: Wed Jun 06, 2012 1:51 am
Location: United States
Contact: Website AOL

Re: AdvanceMAME Controls

Sat Jun 09, 2012 7:02 pm

I don't have an answer but that is a really cool project.

Have you considered looking at the gpio-keys kernel driver/module?
My blog of various geeky things - http://blog.sheasilverman.com
PiPLAY - http://piplay.org
DeskCade.com - Mini Raspberry Pi Arcade Cabinet

Nocturnal
Posts: 16
Joined: Sat Jun 02, 2012 11:15 am

Re: AdvanceMAME Controls

Sun Jun 10, 2012 6:10 pm

Its an interesting module, but it registers with the input system as a keyboard, and I want to register as a joystick.

cpswan
Posts: 47
Joined: Tue May 15, 2012 9:52 am
Contact: Website

Re: AdvanceMAME Controls

Thu Aug 09, 2012 7:52 pm

Nocturnal wrote:So I build some controls, hooked them up to the GPIO port and written a kernel module to interface with the input/joystick subsystem.
Did you ever get this working (and are you willing to share the code)?

cpswan
Posts: 47
Joined: Tue May 15, 2012 9:52 am
Contact: Website

Re: AdvanceMAME Controls

Fri Aug 10, 2012 5:42 pm

I knocked something up with Python that works using the uinput and GPIO modules. Blog post with full description and source.

Nocturnal
Posts: 16
Joined: Sat Jun 02, 2012 11:15 am

Re: AdvanceMAME Controls

Sat Aug 11, 2012 1:00 pm

*Shrugs* It wasn't not working, advmame just can't see the events being generated except in raw mode. No idea why... well none worth the effort of testing at least.

Don't know if you have seen this blog post. Similar to what you have done, except in C not python. Had I been aware of the uinput module, I probably would have used that instead of writing my own from scratch.

I don't have to code for my module handy, my mame box is on hold till I get the last bits in the mail from the US (my package left a month ago, so it should be here any day), I have been working the pi into a toy for my 3yo nephew. The SD card with the code on it should be around here somewhere if you really want to see it.

I used a switch matrix (I believe the final one was 3x8), the pi couldn't drive it directly, and I didn't want to fool around with upping the port power (the lack of proper electrical specs was not encouraging) so I used a couple of transistors to power the matrix. I used a kernel timer to poll the matrix.

Nocturnal
Posts: 16
Joined: Sat Jun 02, 2012 11:15 am

Re: AdvanceMAME Controls

Sat Aug 11, 2012 1:01 pm

*Shrugs* It wasn't not working, advmame just can't see the events being generated except in raw mode. No idea why... well none worth the effort of testing at least.

Don't know if you have seen this blog post. Similar to what you have done, except in C not python. Had I been aware of the uinput module, I probably would have used that instead of writing my own from scratch.

I don't have to code for my module handy, my mame box is on hold till I get the last bits in the mail from the US (my package left a month ago, so it should be here any day), I have been working the pi into a toy for my 3yo nephew. The SD card with the code on it should be around here somewhere if you really want to see it.

I used a switch matrix (I believe the final one was 3x8), the pi couldn't drive it directly, and I didn't want to fool around with upping the port power (the lack of proper electrical specs was not encouraging) so I used a couple of transistors to power the matrix. I used a kernel timer to poll the matrix.

Return to “Media centres”