Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Trackball in Mame4All Retropie? IPac 2 detects as gamepad instead of kb + mouse  (Read 13340 times)

0 Members and 1 Guest are viewing this topic.

robboman123

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 30
  • Last login:February 17, 2021, 04:39:30 pm
  • I want to build my own arcade controls!
Hi guys,

I'm back reviving my old dead cab thanks to Retropie!
http://forum.arcadecontrols.com/index.php/topic,149987.0.html

I'm figuring most things out, but I'm having a lot of trackball trouble currently.. is it supposed to 'just work' with MAME on Retropie when you load up Mame4All?  AdvMAME?  I'm not to this Retroarch \ Libreto thing.. is that configurable for tballs and spinners too? 

So far I can't Centipede to see my trackball at all, but if I load up the Amiga emulator my trackball works in the GUI right away.. so I know it's physically working and the PI can see it attached. 

Any ideas?

« Last Edit: March 15, 2016, 05:59:42 pm by robboman123 »

nitrogen_widget

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1746
  • Last login:March 30, 2024, 09:10:09 am
  • I want to build my own arcade controls!
Re: Trackball in Mame4All Retropie?
« Reply #1 on: March 14, 2016, 04:10:12 pm »
What does your trackball use for an interface?

I only have a usb trackball (cheap led ps2 one with ps2 to usb adaptor) and that works great with millipede on mame4all.

Mame4all though doesn't work with a usb joypad & usb mouse connected at the same time.
you need to use a keyboard encoder or one will be disabled.

robboman123

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 30
  • Last login:February 17, 2021, 04:39:30 pm
  • I want to build my own arcade controls!
Re: Trackball in Mame4All Retropie?
« Reply #2 on: March 14, 2016, 04:41:05 pm »
Its a new Ultimarc ipac2.  Does Mame4All somehow think that's a gamepad?  I don't have any actual gamepads.

I did have my bluetooth keyboard\trackpad connected at the same time.  Maybe that's it, I'll try disconnecting that thing tonight.

Thanks 

robboman123

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 30
  • Last login:February 17, 2021, 04:39:30 pm
  • I want to build my own arcade controls!
Re: Trackball in Mame4All Retropie?
« Reply #3 on: March 14, 2016, 10:09:44 pm »

Mame4all though doesn't work with a usb joypad & usb mouse connected at the same time.
you need to use a keyboard encoder or one will be disabled.

Ah HA!  Thanks, this is exactly my problem.  However I still need a solution..

See, I'm not using a usb joypad.. just my Ultimarc Ipac2 (2015) which is supplying keyboard keys and trackball out a USB port.   I noticed when I run the "configure input" GUI from Emulationstation, it says 'gamepad detected'.  It thinks my IPac2 is a gamepad.  I tried running Centipede with a regular USB keyboard and mouse connected, and the mouse works fine.  Then, with Centipede still running, I plugged in the iPac2 as well and LO and BEHOLD, the trackball worked!  But it fails again as soon as I restart Centipede.

There has to be a workaround for this.. I'll keep searching.

So for some reason it thinks IPAC2 is a gamepad.  It otherwise works fine, maps all the keyboard keys and my trackball..

robboman123

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 30
  • Last login:February 17, 2021, 04:39:30 pm
  • I want to build my own arcade controls!
Re: Trackball in Mame4All Retropie?
« Reply #4 on: March 15, 2016, 01:46:12 pm »
I emailed Andy at Ultimarc to ask if it's possible for the iPac to present itself to the OS as a Keyboard + mouse only.. and NOT a 'gamepad'.  If that can happen (via firmware update or otherwise), then my problem is solved.

I think the only other workaround is to use a different MAME on the PI, such as AdvMame.  I think this problem is specific to Mame4All.

Can anyone else confirm or deny? Or have additional info? 

Cheers...

space invader

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:January 04, 2022, 05:27:36 am
  • I want to build my own arcade controls!
Re: Trackball in Mame4All Retropie?
« Reply #5 on: March 15, 2016, 04:31:07 pm »
Anyone knows whether lr-mame 2003 accepts USB Mouses?

robboman123

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 30
  • Last login:February 17, 2021, 04:39:30 pm
  • I want to build my own arcade controls!
Re: Trackball in Mame4All Retropie?
« Reply #6 on: March 15, 2016, 04:44:13 pm »
Anyone knows whether lr-mame 2003 accepts USB Mouses?

Not sure, I can test it later and reply again.

But again to be clear, all the PI Mame emulators accept USB mouse input.. it's just that Mame4All won't accept mouse at the same time a gamepad is also connected.  If you don't have a gamepad (or an Ipac that thinks it's a gamepad), then it's no problem.   

nitrogen_widget

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1746
  • Last login:March 30, 2024, 09:10:09 am
  • I want to build my own arcade controls!
Re: Trackball in Mame4All Retropie?
« Reply #7 on: March 16, 2016, 10:25:44 am »
I emailed Andy at Ultimarc to ask if it's possible for the iPac to present itself to the OS as a Keyboard + mouse only.. and NOT a 'gamepad'.  If that can happen (via firmware update or otherwise), then my problem is solved.

I think the only other workaround is to use a different MAME on the PI, such as AdvMame.  I think this problem is specific to Mame4All.

Can anyone else confirm or deny? Or have additional info? 

Cheers...

My solution was to use a KADE device set to mimic a keyboard or the GPIO Pins.

robboman123

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 30
  • Last login:February 17, 2021, 04:39:30 pm
  • I want to build my own arcade controls!
I got an email answer from Andy:

Quote
Yes I will send firmware for this when I get back from a short break and of this week.

Andy

Thanks Andy!  Props for Ultimarc!  :applaud:

In the meantime, I set it up to run AdvMame where my trackball works fine.  It didn't work in lr-Mame4all or lr-Mame2003 either, I assume same issue.

Its great there are so many options these days.  It was last century (late 90's) when I built my very first arcade control panel for Mame.  I had to hack a keyboard, follow all the circuit traces from the keys to the PS/2 output pcb to figure out which was which, and then solder control wires direct to the pcb.  Don't get me started on what it took to output PC video to a 15 khz arcade monitor back then!         

space invader

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:January 04, 2022, 05:27:36 am
  • I want to build my own arcade controls!
So, what need to do to use my USB mouse in lr-mame-2003? I have my player 1 buttons conected to gpio pins acting as a keyboard, and for player 2 a USB dragonrise ps3 type gamepad...

robboman123

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 30
  • Last login:February 17, 2021, 04:39:30 pm
  • I want to build my own arcade controls!
So, what need to do to use my USB mouse in lr-mame-2003? I have my player 1 buttons conected to gpio pins acting as a keyboard, and for player 2 a USB dragonrise ps3 type gamepad...

I'm still not sure about that one.. if I happen to figure it out I'll post details.

For anyone else searching this thread regarding the Ipac.. Andy sent me firmware 1.34 for my iPac2 and it indeed makes the board NOT appear as a gamepad\joypad.  When I run 'configure input' from the Retropie Emulationstation menu it now says "No gamepad detected" like I wanted.  Also.. running SNES roms used to bring up this message "ipac not configured... "  that message is gone now.

Unfortunately, this change didn't instantly enable my trackball in Mame4All as I'd hoped (still fine in AdvMame).  Didn't have time to dig any deeper last night, but I'll keep searching for the fix.   


robboman123

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 30
  • Last login:February 17, 2021, 04:39:30 pm
  • I want to build my own arcade controls!
RESOLVED:

Copy of my long post from elsewhere.  I hope this info is easier to find in future and helps others over time.

*************************************

I’ve been struggling for a while to get trackball and spinner to both work. They now both work perfectly, just the way I want, and they work in Mame4All, as well as AdvMame.

For starters, Mame4All is coded to prevent mouse from working at all when there is a js (gamepad, joypad, etc) connected to the system. I don’t use any gamepads (this is an arcade cab). I expected my Ipac2 to appear as a keyboard and mouse ONLY, but for some reason it was causing a js0 device to appear in /dev/input, along with mouse0 and mouse1. When js* is present, there is NO way to get a Mame4All mouse device working.

AdvMame doesn’t care if there’s a js0 present, so that’s one workaround.

But Andy Warne from Ultimarc was quick to respond to my emails, and today he emailed me a different firmware for my IPac2 that completely removes the js0. I flashed it with Winipac utility. Now my Ipac appears as just a keyboard and 2 mouse like I want, no js0. Mame4All FINALLY works with my trackball and spinner without changing anything else!

I found right away that Mame4All just sums together both mouse0 (trackball) and mouse1 (spinner).. I loaded up Arkanoid and both controls work at the same time, which might be OK but is is not exactly what I want.

I noticed that in AdvMame 0.94, Arkanoid worked only with my trackball, the spinner did nothing. I wanted the opposite. I was able to make that work by editing the advmame .rc file

sudo nano /opt/retropie/configs/mame-advmame/(filename).rc

device_mouse raw

device_raw_mousedev[0] /dev/input/mouse0
device_raw_mousedev[1] /dev/input/mouse1
device_raw_mousetype[0] ps2
device_raw_mousetype[1] ps2
… then down in the input_map section…

input_map[p1_dialx] mouse[1,x]
input_map[p1_dialy] mouse[1,y]
… dial = spinner of course. Arkanoid, Tempest, etc use the ‘dial’ control. This specifies p1 dial to be mouse1 (because mouse0 is my trackball)

… I also changed these to specify mouse0 (trackball) where needed:

input_map[p1_mousex] mouse[0,x]
input_map[p1_mousey] mouse[0,y]
input_map[p1_trackballx] mouse[0,x]
input_map[p1_trackbally] mouse[0,y]
Now, if I load up Centipede or Missile Command the trackball works and the spinner does nothing. Vice\Versa when I load Ark or Tempest.

Perfection!!!

Summary:

1). Mame4All: If you are using gamepads, no trackball/spinner for you. Keyboard and multiple mice works fine. If you have no gamepad and still don’t have any mouse, check to see if you have a mystery js0 or js1 entry in /dev/input. If you do,

sudo rm js*

But if the js0 comes right back when you reboot, and you happen to have an Ultimarc interface.. check with Ultimarc, this can be fixed in firmware.

2). Confirm all your mouses, tballs, spinners actually work on your PI, and figure out which is mouse0, which is mouse1, etc.

cat /dev/input/mouse0

…then move the control you think is mouse0 to confirm, it should generate characters onscreen until you ctl-c to quit. Repeat for mouse1, etc.

You can also try this command:

ls -l /dev/input/by-id

This will show you the device IDs and which mouse each one relates to.

3). AdvMame: edit your /opt/retropie/configs/mame-advmame/(filename).rc to specify which controls are default for each function (as per above).

A note about editing the .rc file for newbies:
Make a backup file first (save with a new name). If you have even one character out of place it will prevent AdvMame from running at all.

space invader

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:January 04, 2022, 05:27:36 am
  • I want to build my own arcade controls!
Very useful Robboman123!

And for lr-mame2003? any idea? I want to use this for its crt-type shaders.

And could be posible to use three mouses at a time?one for two for p1 and p2 trackballs (for 2 players simultaneously in marble madness) and the third for the spinner.

lazrhog

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 23
  • Last login:May 19, 2018, 07:03:56 am
  • I want to build my own arcade controls!

I hadn't seen this when I had this issue with my i-pac and my spinner.  In the end, I went into mame4all source code and removed everywhere it tried to disable the mouse (which is what a spinner shows as).  I recompiled it all, and the spinner now works.  The only problem is by doing that, I have somehow screwed up the sensitivity menu in mame4all.  for some reason I can't change the values anymore.  I didn't change that part of the source code, so I'll try again at some point.  I will look into your method too though, although there was some very questionable code in mame4all related to spinner games....

PiNoob

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:February 20, 2018, 06:29:07 pm
  • I want to build my own arcade controls!
Total Noob building a CP with a Pi.  Will turn into a full cab someday, but plans are for portable CP for now.

I have the same issue with Pi and Ultimate I/O.  I reached out to Andy based on robboman123 experience.  Thanks to both for help.  Andy turned around new firmware and now the trackball works.  I haven't been able to get the spinner to work though.  It works when connected to Windows, but not in advmame games.  When I do cat /dev/input/mouse0  both the trackball and the spinner work.  Only one mouse listing.  Anyone have any thoughts?

lazrhog

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 23
  • Last login:May 19, 2018, 07:03:56 am
  • I want to build my own arcade controls!
Andy sent me a new firmware for the i-pac too.  haven't tried it yet, as you can only programme the new firmware with a PC :(     I don't have one of those !


edit:  I managed to reprogram the i-Pac and the spinner spinner int life :)
« Last Edit: May 28, 2016, 01:31:30 pm by lazrhog »

wepoo

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 1
  • Last login:November 18, 2018, 09:25:16 pm
  • I want to build my own arcade controls!
RESOLVED
Roboman123 does having the JoyStick mapping removed have any negative effect in other emulators (nes, GBA, neoGeo)?
Do you know if both MAME4ALL and ADVMAME dismiss mouse/Trackball input when Joysticks are present?


Trapsis

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 1
  • Last login:September 08, 2016, 10:53:55 pm
  • I want to build my own arcade controls!
I'm having the exact same issue.  Is this version of the firmware somewhere online or can someone email it to me? No response from Andy yet.   Thanks!

Andy sent me the updated firmware (1.43) and it worked like a charm!  No js0!
« Last Edit: June 29, 2016, 07:14:03 pm by Trapsis »

Afterburner

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 164
  • Last login:July 27, 2016, 01:02:00 am

And could be posible to use three mouses at a time?one for two for p1 and p2 trackballs (for 2 players simultaneously in marble madness) and the third for the spinner.

I am intensely interested to know if this works.  This is exactly the setup I have on my current cab.  Dual trackballs that are USB 3-button mice and a homemade spinner using usb mouse guts.  Works on a 14yr old PC running XP.

I just got my Pi3 fired up yesterday and a few roms loaded this evening.   Even managed to get a PS3 sixaxis working.

If multiple mice on the Pi works, there are probably a couple of Aimtraks in my future.
  2-player upright dual trackball / dual 8-way rotary joysticks - built from scratch

lazrhog

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 23
  • Last login:May 19, 2018, 07:03:56 am
  • I want to build my own arcade controls!
I'm having the exact same issue.  Is this version of the firmware somewhere online or can someone email it to me? No response from Andy yet.   Thanks!

Andy sent me the updated firmware (1.43) and it worked like a charm!  No js0!

The new firmware works great .... apart from one game  ???    Tron !

The spinner moves the arm of the player, but the joystick also moves the arm, so you can't move and aim.   I can't find any way of removing the joystick (left/right) from the spinner inputs in Mame.   Did you have any luck with that ?

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9402
  • Last login:Today at 07:12:27 pm
  • Designated spam hunter
The new firmware works great .... apart from one game  ???    Tron !

The spinner moves the arm of the player, but the joystick also moves the arm, so you can't move and aim.   I can't find any way of removing the joystick (left/right) from the spinner inputs in Mame.   Did you have any luck with that ?
Have you tried setting these inputs in the MAME "Input (this Game)" menu to "none"? (press ENTER then ESC)
- Dial Analog Dec
- Dial Analog Inc

If it doesn't work, press ENTER then ESC again to restore the default setting.


Scott

lazrhog

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 23
  • Last login:May 19, 2018, 07:03:56 am
  • I want to build my own arcade controls!
The new firmware works great .... apart from one game  ???    Tron !

The spinner moves the arm of the player, but the joystick also moves the arm, so you can't move and aim.   I can't find any way of removing the joystick (left/right) from the spinner inputs in Mame.   Did you have any luck with that ?
Have you tried setting these inputs in the MAME "Input (this Game)" menu to "none"? (press ENTER then ESC)
- Dial Analog Dec
- Dial Analog Inc

If it doesn't work, press ENTER then ESC again to restore the default setting.


Scott

I'll give it a go, but mame4pi doesn't do a great job at recognising the spinner in the 'tab' menu.  I am just using defaults at the moment which work for everything other than Tron

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9402
  • Last login:Today at 07:12:27 pm
  • Designated spam hunter
The new firmware works great .... apart from one game  ???    Tron !

The spinner moves the arm of the player, but the joystick also moves the arm, so you can't move and aim.   I can't find any way of removing the joystick (left/right) from the spinner inputs in Mame.   Did you have any luck with that ?
Have you tried setting these inputs in the MAME "Input (this Game)" menu to "none"? (press ENTER then ESC)
- Dial Analog Dec
- Dial Analog Inc

If it doesn't work, press ENTER then ESC again to restore the default setting.
I'll give it a go, but mame4pi doesn't do a great job at recognising the spinner in the 'tab' menu.  I am just using defaults at the moment which work for everything other than Tron
You shouldn't need to change the "Dial Analog" (spinner) input -- just disable the "Dec" and "Inc" inputs that MAME turns into a simulated spinner output.

There is no need for a simulated spinner when you have a real one.   ;D


Scott
« Last Edit: July 08, 2016, 06:24:19 pm by PL1 »

lazrhog

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 23
  • Last login:May 19, 2018, 07:03:56 am
  • I want to build my own arcade controls!
Ooooh.  Thanks.  Just going to give it a go now !

Edit:  No Joy.  The version of mame is Mame4Pi, and it doesn't have that option, just Dial Left and Dial Right  :(
« Last Edit: July 20, 2016, 03:42:30 pm by lazrhog »