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: MAME mouse code - revisited  (Read 9224 times)

0 Members and 1 Guest are viewing this topic.

Derrick Renaud

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 299
  • Last login:December 06, 2024, 04:31:44 pm
MAME mouse code - revisited
« on: November 28, 2006, 11:17:06 pm »
I dread to delve back into the mouse handling code, but here goes.

First (yes cananas, finally)
I will be submitting support in MAME for more then 4 mouse buttons.  Which goes like this:
Win98/Me less then DX7 = 4 buttons
Win98/Me DX7 or better = 8 buttons
XP with 1 mouse device = 8 buttons
XP with more then 1 mouse device = 5 buttons

That's the way Windows works.  Don't blame me.

Secondly and what I need feedback on is:

Does anyone use Win98/Me and need multi-lightgun support similar to whats available on XP.  Meaning 2 or more, real time tracking lightguns?

Do Smog's divers even work on Win98/Me?  I don't think I ever got them working on those OSes.

Third
Is anyone using Win2000/NT for their lightgun setup?  That would be the only reason to keep the -lightgun option if I went ahead and added Win98/Me lightgun support.

D.

Fozzy The Bear

  • Handbags at dawn in here!!!
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1831
  • Last login:September 18, 2011, 11:29:59 am
  • It's Been One Of Those Days... Don't Ask!
Re: MAME mouse code - revisited
« Reply #1 on: November 29, 2006, 08:41:00 am »
Secondly and what I need feedback on is
Does anyone use Win98/Me and need multi-lightgun support similar to whats available on XP.  Meaning 2 or more, real time tracking lightguns?

Yes Please!! Support for the LCD Topguns would be appreciated.

Do Smog's divers even work on Win98/Me?  I don't think I ever got them working on those OSes.
Unfortunately... No they don't.... The only drivers I can get to work at all properly on win98 are the ones that the manufacturer of the guns EMS provide. To be honest they're a very good driver on Win98 I don't have any problems with them. Except multi gun support in Mame.

Best Regards,
Julian (Fozzy The Bear)
Most bottles and jars contain at least twenty-five percent recycled Pacman.
And research indicates that Space Invaders are strongly attracted to people who have recently eaten meat pies.

Derrick Renaud

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 299
  • Last login:December 06, 2024, 04:31:44 pm
Re: MAME mouse code - revisited
« Reply #2 on: November 29, 2006, 10:16:49 am »
This is why I was wondering if it was worth the effort to force 98/Me to properly support absolute mice (lightguns.)

TopGun has still not released a proper mouse driver, and if Smog's driver does not work for 98/Me, then my adding suppport will have no effect.  Actually it would make the TopGuns no longer work because I would remove the -lightgun option if proper support was added.

So I guess I will not bother at the moment, until someone can get Smog's driver's working in 98/Me.

D.


ahofle

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4544
  • Last login:August 30, 2023, 05:10:22 pm
    • Arcade Ambience Project
Re: MAME mouse code - revisited
« Reply #3 on: November 29, 2006, 11:54:52 am »
Derrick, has something else changed recently in MAME in regards to mouse/lightgun input?  I find that many games are not playable anymore (the aiming is off the further to the right of the screen you point).  Particularly Hogan's Alley and Duck Hunt.  They worked fine a few versions back, but now you can't shoot the right most part of the screen (and you can't even move the crosshair over there with the mouse, so I know it's not a lightgun only issue).

Thanks for all your work on MAME mouse functionality!   :)

Derrick Renaud

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 299
  • Last login:December 06, 2024, 04:31:44 pm
Re: MAME mouse code - revisited
« Reply #4 on: November 29, 2006, 08:22:22 pm »
I take it you mean the PlayChoice versions?

Looks like the crosshairs were not updated when multi-monitor support was added.

Fixed.  I'll submit it with my mouse update.

D.

chemame

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 107
  • Last login:January 26, 2007, 01:54:05 pm
  • I want to build my own arcade controls!
Re: MAME mouse code - revisited
« Reply #5 on: November 29, 2006, 09:26:47 pm »
I think what I use is outside of the box a little, but I'd give my left you-know-what to have this supported well in base mame. I'm still using NoNameMame 0.82 (yes, 0.82!!!) for my lightgun games, because no other emulator since that version has properly supported 2 s-video tv-out lightguns, windows 2000 unofficial service pack 5, nvidia geforce fx5200 128mb

Thanks for the interest, I thought the whole world had left me behind!

Chemame

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
Re: MAME mouse code - revisited
« Reply #6 on: November 29, 2006, 09:35:31 pm »
I guess the actlab guns don't have big enough following?

(I'm not using mine ever since my CRT died, two weeks after getting a "secondary" LCD.  13 days of dual screens and then :cry:.)
Robin
Knowledge is Power

Derrick Renaud

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 299
  • Last login:December 06, 2024, 04:31:44 pm
Re: MAME mouse code - revisited
« Reply #7 on: November 29, 2006, 09:38:20 pm »
I think what I use is outside of the box a little, but I'd give my left you-know-what to have this supported well in base mame. I'm still using NoNameMame 0.82 (yes, 0.82!!!) for my lightgun games, because no other emulator since that version has properly supported 2 s-video tv-out lightguns, windows 2000 unofficial service pack 5, nvidia geforce fx5200 128mb

Bad news.  I never liked NT or 2000.  The CDs are buried in the closet somewhere.  And I have no intention of re-installing them.

To make matters worse, they do not support multiple mice at all.  So the only choice is to use the -lightgun option.  This should still work the same in .110 as it does in .82.  So I will leave the -lightgun option in for the NT/2000 users.

D.

Derrick Renaud

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 299
  • Last login:December 06, 2024, 04:31:44 pm
Re: MAME mouse code - revisited
« Reply #8 on: November 30, 2006, 03:12:25 pm »
I guess the actlab guns don't have big enough following?

It's a lot of aggravation to force Win98/Me to use the mice in control panel mode to get the true, "non-windows-screwed-up" absolute info.  Adding absolute mouse support similar to the XP support to 98/Me would only allow more then 2 Act Labs guns to work and not make any other noticeable difference.  They do not update in real time.

So most Act Labs users would never know anything changed other then they don't need to use -lightgun anymore.

Seeing how Top Gun users have to use the TopGun supplied driver for 98/Me forcing them to use the -lightgun option, I might as well leave things be.

D.

ahofle

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4544
  • Last login:August 30, 2023, 05:10:22 pm
    • Arcade Ambience Project
Re: MAME mouse code - revisited
« Reply #9 on: November 30, 2006, 04:03:37 pm »
Fixed.  I'll submit it with my mouse update.

 :notworthy:  :notworthy:  :notworthy:

It's nice to see a dev who cares about fixing regression problems.

Chris

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4574
  • Last login:September 21, 2019, 04:59:49 pm
    • Chris's MAME Cabinet
Re: MAME mouse code - revisited
« Reply #10 on: November 30, 2006, 04:15:52 pm »
It's a lot of aggravation to force Win98/Me to use the mice in control panel mode to get the true, "non-windows-screwed-up" absolute info.  Adding absolute mouse support similar to the XP support to 98/Me would only allow more then 2 Act Labs guns to work and not make any other noticeable difference.  They do not update in real time.
"Control panel mode"?  Can you point me toward something describing this (Google isn't helping) as it sounds like this may have something to do with why I can't get touchscreens to work properly in WinCab on Win98/2000 (seems like a touchscreen and an Act Labs lightgun would behave very similarly)...

Thanks!

--Chris
--Chris
DOSCab/WinCab Jukebox: http://www.dwjukebox.com

Derrick Renaud

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 299
  • Last login:December 06, 2024, 04:31:44 pm
Re: MAME mouse code - revisited
« Reply #11 on: November 30, 2006, 06:24:03 pm »
"Control panel mode"?  Can you point me toward something describing this (Google isn't helping) as it sounds like this may have something to do with why I can't get touchscreens to work properly in WinCab on Win98/2000 (seems like a touchscreen and an Act Labs lightgun would behave very similarly)...

You need the DX7 docs for full info.  Here's the just of it:

When you setup your devices using: IDirectInputDevice7::SetProperty
use a rguidProp of DIPROPCALIBRATIONMODE_RAW

This forces windows to give you the actual data before it decides to totally bugger it up.  For absolute mice you will now get absolute values between 0 and 0x3fff.

IIRC you have to do this while the mouse is not acquired.

Hard to believe DX has gone through so many versions and the input system still blows.

D.

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: MAME mouse code - revisited
« Reply #12 on: December 03, 2006, 12:29:51 pm »
Quote
First (yes cananas, finally)
I will be submitting support in MAME for more then 4 mouse buttons.  Which goes like this:
Win98/Me less then DX7 = 4 buttons
Win98/Me DX7 or better = 8 buttons
XP with 1 mouse device = 8 buttons
XP with more then 1 mouse device = 5 buttons

That's the way Windows works.  Don't blame me.

Sorry, Derrick, I missed this topic. Thank you for complete the code adding support for all DirectX versions so that it could be aceppted by the MAMETeam. ;)

muzland

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 87
  • Last login:May 30, 2011, 06:28:02 am
  • I want to build my own arcade controls!
Re: MAME mouse code - revisited
« Reply #13 on: December 03, 2006, 03:56:48 pm »
Hi Derrick,

I posted this in another topic but it is probably better here.

Is possible to get rotary games like Ikari Warriors to respond to the mouse wheel so that we can use this as a rotary feature?

I have tried on Ikari in mame version 73 without success.

The reson I ask is I might try mounting one to the top of a joystick for a homemade rotary.

Cheers
Muzland

Derrick Renaud

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 299
  • Last login:December 06, 2024, 04:31:44 pm
Re: MAME mouse code - revisited
« Reply #14 on: December 03, 2006, 05:04:47 pm »
Is possible to get rotary games like Ikari Warriors to respond to the mouse wheel so that we can use this as a rotary feature?

I have tried on Ikari in mame version 73 without success.

73?

Please try 110.  It should work with multiple mice.  In the mean time I will check that it works with DX, when I do some other input cleanup I am working on.

[UPDATE]
I modified the code so that it scales the mouse-Z-axis by 120.  This will make it work in most cases.  Some freak mice may use other scale factors which means they won't work on Z-Axis.  But hey, they don't work now either.

So MAME 111 should do what you need.

[UPDATE2]
I changed the scaling factor to 30.  I think Robin had said that some mice use that.  What that means is that for most mice a sensitivity of 25% will give 1 step for each click of the mouse wheel.

One thing to remember is that it is a little hard to select the Z-Axis in the Player Controls menu.  You have to give it a good spin for it to be accepted.  Our just use a ctrlr file.

D.
« Last Edit: December 03, 2006, 09:43:15 pm by Derrick Renaud »

Funky_K

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 18
  • Last login:June 03, 2008, 04:03:20 pm
Re: MAME mouse code - revisited
« Reply #15 on: December 04, 2006, 01:26:17 pm »
This topic reminded me of a question I had regarding Direct Input codes for mice.

I use MameWah as a front end.  In the config file, functions are assigned to keystrokes by their direct input codes ("K" = DIK_K, "Enter" = DIK_RETURN, etc.)

Are there also codes to assign mouse button presses?  If so, what are they?

Thanks

Chris

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4574
  • Last login:September 21, 2019, 04:59:49 pm
    • Chris's MAME Cabinet
Re: MAME mouse code - revisited
« Reply #16 on: December 04, 2006, 01:45:07 pm »
When you setup your devices using: IDirectInputDevice7::SetProperty
use a rguidProp of DIPROPCALIBRATIONMODE_RAW

This forces windows to give you the actual data before it decides to totally bugger it up.  For absolute mice you will now get absolute values between 0 and 0x3fff.

This is a huge help....  Thanks!

--Chris
--Chris
DOSCab/WinCab Jukebox: http://www.dwjukebox.com

Derrick Renaud

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 299
  • Last login:December 06, 2024, 04:31:44 pm
Re: MAME mouse code - revisited
« Reply #17 on: December 05, 2006, 03:09:07 pm »
This topic reminded me of a question I had regarding Direct Input codes for mice.

I use MameWah as a front end.  In the config file, functions are assigned to keystrokes by their direct input codes ("K" = DIK_K, "Enter" = DIK_RETURN, etc.)

Are there also codes to assign mouse button presses?  If so, what are they?

You will have to ask the MameWah guys.  I do not use front ends.

But as far as coding goes, Mice, keyboards and joysticks are all separate devices and handled differently.  Mice do not use DIK_ commands.  Or anything similar.  Mouse buttons are stored in a DIMOUSESTATE structure.

D.

Derrick Renaud

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 299
  • Last login:December 06, 2024, 04:31:44 pm
Re: MAME mouse code - revisited
« Reply #18 on: December 05, 2006, 03:22:25 pm »
When you setup your devices using: IDirectInputDevice7::SetProperty
use a rguidProp of DIPROPCALIBRATIONMODE_RAW

This forces windows to give you the actual data before it decides to totally bugger it up.  For absolute mice you will now get absolute values between 0 and 0x3fff.

This is a huge help....  Thanks!

--Chris

You may also have to set DIPROP_AXISMODE to DIPROPAXISMODE_ABS.  It's been a while, and I've misplaced the code I was working on.  :)  But DIPROPAXISMODE_ABS definitely produces nothing but garbage on it's own.

D.

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
Re: MAME mouse code - revisited
« Reply #19 on: December 05, 2006, 07:24:19 pm »
You may also have to set DIPROP_AXISMODE to DIPROPAXISMODE_ABS.  It's been a while, and I've misplaced the code I was working on.  :)  But DIPROPAXISMODE_ABS definitely produces nothing but garbage on it's own.

D.

It's not exactly garbage, and needs "decoding".

IIRC, DIPROPAXISMODE_ABS outputs a 32 bit value with no "real" zero point (unless the mouse driver is absolute in win9x with non-system USB mice devices, aka lightguns).  The funny thing is the absolute value is the total from the time windows (and mouse) was installed, and the system mouse is the sum of all mouse devices.  (Err, that's my guess, and it seems that way for at least new USB mice in win9x, and the one winXP I got to see the DIPROPAXISMODE_ABS values right after installing and then a month later.)  So most of the time you aren't going to be even close to zero, but in the billions

Now, If you take the value at enum, and call that is the "zero point" (subtract it from subsequent "current" values), you can get valid readings for a while.  Until the mouse pointer goes of the edge and you can't see how far off, or the exact direction unless exactly above/below/left/right.  Then you need to re-set the "zero point".  (That's basically one of the two directInput ways "lightguns" were handled in analog+.) 
It is possible to write code to move the "zero point" to cover the inevitable move off screen instead of the way I did it, but that's just re-undoing what the OS and directX is doing to put it into DIPROPAXISMODE_ABS.

But the hack that messed me the most was the mode needed to be set, IIRC, after the enum function, but while not acquired.  I hacked it into the pause acquire/unacquire code to get it to work.


These observations are from (system & individual USB mice) win98, winME, & (system mouse only) winXP systems back when analog+ was still active.
Robin
Knowledge is Power

Derrick Renaud

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 299
  • Last login:December 06, 2024, 04:31:44 pm
Re: MAME mouse code - revisited
« Reply #20 on: December 05, 2006, 10:32:22 pm »
[It's not exactly garbage, and needs "decoding".

Hi Robin,

Close enough to garbage.  How about severely mangled.  :)

RAWMOUSE always gives values between 0 & 0xffff.  Nice and pretty for use.

For DX, if you use DIPROPCALIBRATIONMODE_RAW, you always get values between 0 and 0x3fff.  No muss, no fuss, reliable, the kind of data you would expect from an interface that worked.  Of course you shouldn't have to do that, because if you ask for DIPROPAXISMODE_ABS, you would think you would get the absolute data you request, not relative to something absolute.

To change topics a little.  Did you see my other post about adding Digital Speed = 0?  It has to be a couple years since I first mentioned it and now finally got around to coding it.  :)

D.

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re: MAME mouse code - revisited
« Reply #21 on: December 07, 2006, 04:29:26 am »
This topic reminded me of a question I had regarding Direct Input codes for mice.

I use MameWah as a front end.  In the config file, functions are assigned to keystrokes by their direct input codes ("K" = DIK_K, "Enter" = DIK_RETURN, etc.)

Are there also codes to assign mouse button presses?  If so, what are they?

For Mamewah (from http://mamewah.mameworld.net/docs/ctrlr.txt):

'Mouse Inputs:
MOUSE_LEFT
MOUSE_RIGHT
MOUSE_UP
MOUSE_DOWN
MOUSE_SCROLLUP
MOUSE_SCROLLDOWN
MOUSE_BUTTON0
MOUSE_BUTTON1
MOUSE_BUTTON2
MOUSE_BUTTON3

BUT NOTE this is *only* for Mamewah...I invented these codes just to keep things simple...same goes for the joystick codes.

Smog

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 178
  • Last login:April 30, 2007, 06:50:51 am
  • .357
    • How to make a cheap GunCon2 work on your PC
Re: MAME mouse code - revisited
« Reply #22 on: December 19, 2006, 08:10:06 am »
My driver was supposed to work on win 98 .. I had a lot of troubles with the driver control panel (this means you probably cannot configure buttons) but it should work ... I'll try to give it a look in next days.
GunCon2PC Driver on http://guncon2pc.no-ip.org/

ahofle

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4544
  • Last login:August 30, 2023, 05:10:22 pm
    • Arcade Ambience Project
Re: MAME mouse code - revisited
« Reply #23 on: December 19, 2006, 06:03:29 pm »
Hey Derrick...I just tried the latest MAME (v0.111) and Hogan's Alley and Duck Hunt are still messed up.  I then realized it was the Vs versions I was trying, not the Playchoice ones (sry about that).  You still can't move the mouse cursor or lightgun to the far right of the screen.  Is this the same problem as the Playchoice thing you just fixed?

Derrick Renaud

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 299
  • Last login:December 06, 2024, 04:31:44 pm
Re: MAME mouse code - revisited
« Reply #24 on: December 19, 2006, 10:30:43 pm »
Hey Derrick...I just tried the latest MAME (v0.111) and Hogan's Alley and Duck Hunt are still messed up.  I then realized it was the Vs versions I was trying, not the Playchoice ones (sry about that).  You still can't move the mouse cursor or lightgun to the far right of the screen.  Is this the same problem as the Playchoice thing you just fixed?

They worked for me last time I checked.  I only saw a problem with the dual screen update.  Won't get a chance to look at it till after the holidays.

Does anyone else report the same problem?

D.