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: Lightguns in Linux AdvanceMame  (Read 947 times)

0 Members and 1 Guest are viewing this topic.

jerryjanis

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 821
  • Last login:February 02, 2023, 01:56:44 am
  • Skate or Die!!!
    • Jake's Joystick
Lightguns in Linux AdvanceMame
« on: October 12, 2004, 09:01:16 pm »
I just thought I would pass along the fact that the act labs pc usb light gun works wonderfully in AdvanceMame .87.  I didn't try multiple lightguns, but I'm sure it would work.  One thing that really impressed me was that I was able to use a lightgun for player 1 and a trackball for player 2.  Oddly enough, AdvanceMame (and Xmame) treat the lightgun as a joystick.  I found it convenient because that way it doesn't get mixed in with my mouse devices when I'm trying to configure mame.

--------------- LINUX ---------------
The gun uses the linux kernel "event" driver.

The devices are stored in "/dev/input/".

My lightgun is /dev/input/event1.  Test each of the event devices with the command, "cat /dev/input/eventX" (replace X with the device #) and moving your devices until you see action.  When you cat the device and wiggle/fire/roll the cat'ed device around, garbage will print on the screen and that's how you'll know which one is which.  Devices might be joysticks, keyboards, mice, (etc).  My system only has 4 eventX devices.  (I haven't tried, but there is a command to add additional devices...  Something involving "mknod").

I killed the "gpm" process sometimes just in case, but it wasn't necessary.  Gpm is the console mouse daemon.

I have a custom compiled kernel.  Some key items that I compiled (mostly as modules) include:

Joystick interface
Event interface
(NOT touchscreen interface)
Mice - InKernel, ps/2 mouse
(NOT joysticks)
(NOT touchscreens)

Support for Host-side USB
USB device filesystem
OHCI HDC support
UHCI HCD support
USB HID support
HID input layer support
/dev/hiddev raw HID device support

These may not ALL be necessary, and there may be important ones that I left out, but these worked for me.

------------ AdvanceMame 0.87 ---------------
my advmame.rc file needed the line, "device_joystick event"

In the game settings, I map the fire button to j:left by shooting AT THE CENTER of the screen (calibrate first).  Shooting to the sides registers as though you are moving the joystick to on side.  (I know that doesn't make much sense, but if you try it I think you'll see what I mean).

That's all there was to it!  So far I've only tried Police Trainer, and it works great.

(I also tried it with 0.77 also, and it ALMOST worked - accuracy was off)