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: Lightgun support in MAME  (Read 7278 times)

0 Members and 1 Guest are viewing this topic.

Derrick Renaud

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 299
  • Last login:March 30, 2018, 11:06:19 am
Lightgun support in MAME
« on: March 06, 2006, 01:57:12 pm »
Has any tried using multiple mice/lightguns in Win98SE or WinME using DX7 or greater.  How does it work without using -dual_lightgun?  Do they report as seperate units?

Would there be an uproar if we removed -dual_lightgun and forced you to use a minimum of Win98SE with a minimum of DX7 for dual lightguns?  Multiple Mice/guns would have to be USB devices.  DX support would remain the same when not wanting individual mouse access.

XP will support Serial; PS/2; USB mice as individual mice.

Of course this means there would only be support for guns that report as mice.  Meaning you would have to use GunCon2 for the LCD TopGun, unless they re-write their driver to be a mouse and not just control the mouse as it currently does.

D.

Silver

  • Wiki Contributor
  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1668
  • Last login:February 17, 2024, 10:29:00 am
  • Cunning like the Fox.
    • Mods'n'Mods
Re: Lightgun support in MAME
« Reply #1 on: March 06, 2006, 03:33:22 pm »
Of course this means there would only be support for guns that report as mice.  Meaning you would have to use GunCon2 for the LCD TopGun, unless they re-write their driver to be a mouse and not just control the mouse as it currently does.

I take it from this that using the "system mouse" to control the gun and using the EMS driver means that you new (rawinput?) code will ignore the system mouse completely? Might be worth leaving in an option just to use the standard XP mouse as it is now for greater compatibility.... but that could be something you are trying to avoid.

No complaints from me for the proposed changes (are people using pre-win98se with pre-dx7?) - the EMS driver is not the best, although they are improving it. In fact once you make the changes we could just email them and say "Mame only works with devices that appear as mice/HID input devices" and see what they come up with...

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
Re: Lightgun support in MAME
« Reply #2 on: March 06, 2006, 09:59:47 pm »
I can't answer your questions, but here are some u_rebelscum quotes from old threads that touched on some of it.

Here's a description of using multiple mice using the standard mame build in Windows 98/ME:

http://forum.arcadecontrols.com/index.php?topic=23273.0

I've been testing this a little, and official Mame can do multiple USB in win98/ME, SORT OF.  I was going to test it more before saying anything, but you asked for it. ;D

Limits (well, those I ran into on my system, so far):

1) Win98 and WinME only!  NOT in win2k.  NOT in winXP.  (sound familiar to some of you, huh? ;) )

2) The UI detects the only the "system mouse" axes; i.e. the "all mice together, mouse pointer you see on the desktop" mouse.  Official Mame calles this "Mouse 1".

3) If you want to use multiple mice (or make it so only one physical mouse inputs to a player), you need to hand edit the cfg/cfg file, or better the ctrlr file.

4) Mame's default is for the Mouse "1" (system mouse) to coutrol player 1, mouse "2" (first individual USB mouse) to control player 2, mouse "3" (second individual USB mouse) to control player 3, ect.  So you need to remap [size=-2]cough..ctrlrfile..cough[/size], unless you don't mind playing players 2 & 3. 

5) I can't get my "mouse 4" to work individually, but mame is finding "four" mice, and that mouse does effect the system mouse, and the buttons are "mouse 4" buttons.  (This might be a driver or system issue on my end). 

This means, on my system with the mice I have tested, I can get only two mice at a time.  I would try testing more mice than the three USB I have, but my trackball CPs are "in the shop" ATM.

I suggest editting the ctrlr file, since mame will "correct" the cfg file if a mouse is not found (unplugged at mame start time).

Remember, this is a winME/98 only feature because MS removed (or never added) the directX directInput access to individual mice from win2k/XP.

And here's a brief description of using the dual_lightgun setting in standard Mame:

http://forum.arcadecontrols.com/index.php?topic=24229.0

Official mame's (and mame32's) "Dual lightgun" support only works if one gun's trigger is mouse button 1, the other gun's trigger is mouse button 3.

Official mame's (and mame32's) "Reload" is designed to translate all mouse button 2 presses to reload (and with the "dual lightgun", a mouse button 4 press as player 2 reload).  You can't remap this.

Official mame's (and mame32's) "lightgun" is just like enabling mice, except the cursor position is polled (instead of polling relative movement like with enabling mice).

Quote from: Mame's windows.txt
-[no]lightgun/ -[no]gun

        Controls whether or not MAME treats mouse inputs as lightgun inputs.
        Note that most lightguns map to the mouse, so using -lightgun and
        -mouse together may produce strange results. The default is OFF
        (-nolightgun).

-[no]dual_lightgun / -[no]dual

        Controls whether or not MAME attempts to track two lightguns connected
        at the same time. This option requires -lightgun. The default is OFF
        (-nodual_lightgun).

If the system mouse were applied to both player 1 and player 2, and then player 1 mapped button 1 to the trigger and player 2 mapped button 3 to the trigger wouldn't dual lightguns work even without the dual_lightguns option enabled?  I just tried mame0104b (using 1 mouse and one lightgun), and it seemed to me that the 2 player game would play just fine this way.  The only drawbacks that I noticed between using this method for dual lightguns, vs. using the dual_lightgun option are:

1) The dual_lightgun option only updates the crosshairs when a trigger (typically a mouse button) is pulled, and it only updates the crosshair for the player whose button was pressed.  Without the dual_lightgun option, both crosshairs always land wherever the last user to pull a trigger pointed.  The solution is to turn off the crosshairs.

2) The dual_lightgun option maps buttons and mouse axes automatically.  Without the dual_lightgun option, the user will have to map buttons and the 2nd mouse axis manually.  Also, they'll probably want to turn off the Mame crosshairs.

My point is, even without the dual_lightgun option,  (as far as I can tell) people will still be able to use 2 TV lightguns using the 1/3 player button switch, it'll just take a bit of configuration.

Jake

Edit:  By the way, I was using Windows XP
« Last Edit: March 06, 2006, 10:05:15 pm by jerryjanis »

Derrick Renaud

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 299
  • Last login:March 30, 2018, 11:06:19 am
Re: Lightgun support in MAME
« Reply #3 on: March 06, 2006, 10:29:07 pm »
I can't answer your questions, but here are some u_rebelscum quotes from old threads that touched on some of it.

Thanks for the long reply, but I am actually a MAMEdev, and know most of this.  ;)

1) The dual_lightgun option only updates the crosshairs when a trigger (typically a mouse button) is pulled, and it only updates the crosshair for the player whose button was pressed.  Without the dual_lightgun option, both crosshairs always land wherever the last user to pull a trigger pointed.  The solution is to turn off the crosshairs.

That is a problem that has to do with the Act Labs guns.  They do not provide real time tracking like LCD TopGun.


2) The dual_lightgun option maps buttons and mouse axes automatically.  Without the dual_lightgun option, the user will have to map buttons and the 2nd mouse axis manually.  Also, they'll probably want to turn off the Mame crosshairs.

My point is, even without the dual_lightgun option,  (as far as I can tell) people will still be able to use 2 TV lightguns using the 1/3 player button switch, it'll just take a bit of configuration.

Per my original post, this is not needed anymore except when using less then Direct X 7.  Which is why I might remove -dual_lightgun.  But I want to know if doing so would affect anyone.  Does anyone use less then DX7.

D.

Gh0sty

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 56
  • Last login:December 04, 2019, 05:04:06 pm
  • flying Mame Player
Re: Lightgun support in MAME
« Reply #4 on: March 07, 2006, 03:29:42 am »

XP will support Serial; PS/2; USB mice as individual mice.

wow, what does that exsactly means for us with two LCD Topguns & XP & Mame?
we can only connect 2 via the USB right now.

R
Gh0sty

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re: Lightgun support in MAME
« Reply #5 on: March 07, 2006, 05:26:51 am »
Does anyone use less then DX7.

I haven't researched it, but I would think very few people use a DX version below 7.

Cananas

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 299
  • Last login:August 27, 2017, 07:39:03 am
  • and the seventh day... PacMan was created
Re: Lightgun support in MAME
« Reply #6 on: March 07, 2006, 01:13:50 pm »
Quote
wow, what does that exactly means for us with two LCD Topguns & XP & Mame?
we can only connect 2 via the USB right now.
Actually, with wingun, I have three LCDTopGun connected. When Mame supports multiple mice, I will able to play 3 players gun games!

Thanks for your work,  Derrick


Derrick Renaud

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 299
  • Last login:March 30, 2018, 11:06:19 am
Re: Lightgun support in MAME
« Reply #7 on: March 07, 2006, 01:48:52 pm »
Actually, with wingun, I have three LCDTopGun connected. When Mame supports multiple mice, I will able to play 3 players gun games!
Are there gun games with 3 or more guns?  Which ones.

The goal is to make it so you can use any gun or mouse as input for any gun input on the game.   And to remove the 2 gun limit.

98/DX7 is proving trickier, mainly because I have to remember stuff my mind has long since pushed out.  I want to make support automatic without using -lightgun, which is the tricky part to code.

And before anyone asks, the code will be ready when it is ready, and not before.  Any test code (if I need to) will be posted on the MAMEworld compiling board.

D.

« Last Edit: March 09, 2006, 08:34:59 pm by Derrick Renaud »

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
Re: Lightgun support in MAME
« Reply #8 on: March 07, 2006, 01:56:58 pm »
« Last Edit: March 07, 2006, 02:02:29 pm by jerryjanis »

Gh0sty

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 56
  • Last login:December 04, 2019, 05:04:06 pm
  • flying Mame Player
Re: Lightgun support in MAME
« Reply #9 on: March 07, 2006, 03:31:44 pm »
OMG can you imagine to play with 3 guns?!  total party fun :D
Now i have to order a 3rd one, no joke!

Thank you very much for the hard work Derrick R. !
I will check the Mameworld compiling board for beta testing code.

R
Gh0sty

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re: Lightgun support in MAME
« Reply #10 on: March 08, 2006, 09:28:48 am »
Derrick: I am just curious why some of the games which used a pot-based positional gun or joystick (such as Jurassic Park which apparently used sticks not guns: http://www.klov.com/game_detail.php?letter=J&game_id=8262) are classed as 'lightgun' input type in MAME?  It would seem to make more sense to class these as 'stick', particularly as per my example games which didn't even use a gun-looking controller.

Derrick Renaud

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 299
  • Last login:March 30, 2018, 11:06:19 am
Re: Lightgun support in MAME
« Reply #11 on: March 08, 2006, 06:38:29 pm »
Derrick: I am just curious why some of the games which used a pot-based positional gun or joystick (such as Jurassic Park which apparently used sticks not guns: http://www.klov.com/game_detail.php?letter=J&game_id=8262) are classed as 'lightgun' input type in MAME?  It would seem to make more sense to class these as 'stick', particularly as per my example games which didn't even use a gun-looking controller.
No idea.  :-\  Probably because as far as the current MAME input system goes, they are the same thing.  But by calling the analog gun a lightgun, it allows the driver to access the -lightgun data.  Hopefully we can change that 1 day.  ;D

The input system is not really my thing.  But it could really use more input type descriptions.

Maybe for the axes we need to have a main type, subtype and extended data type.  All three values would describe the input.

Main - Absolute, Relative, Custom

Subtypes:
Absolute - Lightgun, Touch Screen, Analog Stick, Pedal, Paddle, etc

Relative - Spinner, Trackball, Optical Wheel, Rotary Stick- optical, etc

Custom - Rotary Stick - mechanical, Shifter, 49-way, Dance Pad, etc

The extended data could be used to describe stuff like how many optical steps per 1 rotation.  Mostly it would be used for documentation purposes.  But could also be used to describe variations of the sub-type.

All the Absolute types would all operate the same way.  The subtype would just help in the description to better document what the game used.

Same as the Relative types.

But the custom types would requires a lot of changes.  Because each would operate in a different manner.

The above describes what a game wants.  Then the input system would have to map what you are using to what the game wants.  It does this somewhat already for Absolute and Relative.

The fun would come in separating out the custom controls.  Then the driver would just ask for the data it needs.

For example:
Main type = Custom
Sub Type = Rotary Stick - SNK 8
The game would no longer use code in the driver to change analog data to it's switch input.  The input system would map the control you use to what the game wants.  This would also mean you could map the actual control to the input.

All of this is just my pondering - what if?  This would require a lot of work.  And some standardized format would have to be worked out.

Speaking for myself only, and not for MAMEdev... A system like this would be more readily accepted into the main tree, instead of all the current hacks to get custom controls working on a case by case basis.  And someone would have to test 6000 or so games to see that they worked under different variations of controls.  :)

Any takers?
D.
« Last Edit: March 08, 2006, 06:44:34 pm by Derrick Renaud »

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re: Lightgun support in MAME
« Reply #12 on: March 09, 2006, 09:58:51 am »
All of this is just my pondering - what if?  This would require a lot of work.  And some standardized format would have to be worked out.

Speaking for myself only, and not for MAMEdev... A system like this would be more readily accepted into the main tree, instead of all the current hacks to get custom controls working on a case by case basis.  And someone would have to test 6000 or so games to see that they worked under different variations of controls.  :)

This sounds like a good idea, for the long term.  The current input system certainly has a few flaws and hacks, and lacks consistency.

I'm no C programmer but maybe someone here would be up for it (hands up!)...we would all like to see things like the SNK rotaries handled better, and numerous other things - if it could be done within official MAME it would be excellent :).  FWIW we already have a lot of very accurate information on controls in the controls.dat project: http://fe.donkeyfly.com/controls/controls.php