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: Calling all controller experts... (strange MAME mouse issues)  (Read 2951 times)

0 Members and 1 Guest are viewing this topic.

Shoegazer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 135
  • Last login:May 10, 2015, 10:37:58 am
    • NonMAME - The ultimate site for the OTHER arcade emulators!
Calling all controller experts... (strange MAME mouse issues)
« on: February 02, 2007, 01:02:48 pm »
Bizarre, this:

I've been getting a strange problem lately since I've installed my two LCD Topguns, though I don't think it's related to them since it's happening with my trackball mouse buttons as well...

Whenever I'm in MAME's control configuration screen, I select a button, and then push either the LCD TopGun button mapped as "button 3" or right-most trackball mouse button).  On the screen I get:

Mouse 5 button 3 Mouse 5 button 4

...where I *should* get:

Mouse 5 button 3

I realize there is a feature in MAME where if you click a button, push enter, and then click a button again, you can map multiple buttons to the same function - but I'm not pushing enter at all here!  I can also start from scratch (i.e. the controller button is initially mapped as "None") but I get the same result as above.  I know it isn't a faulty button since it happens with both of the Topguns AND the trackball buttons.   Using XP SP2 and MAME32 .112 full.

Thanks,
Shoegazer

« Last Edit: February 06, 2007, 08:14:14 pm by Shoegazer »
NonMAME: Your best source for the OTHER arcade emulators!
http://nonmame.retrogames.com

Shoegazer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 135
  • Last login:May 10, 2015, 10:37:58 am
    • NonMAME - The ultimate site for the OTHER arcade emulators!
Re: Calling all controller experts... (strange MAME mouse issues)
« Reply #1 on: February 06, 2007, 08:14:53 pm »
Still having the same issues after several days of tinkering... curious if anyone may know more about this.
NonMAME: Your best source for the OTHER arcade emulators!
http://nonmame.retrogames.com

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: Calling all controller experts... (strange MAME mouse issues)
« Reply #2 on: February 07, 2007, 05:24:36 pm »
I've been getting a strange problem lately since I've installed my two LCD Topguns, though I don't think it's related to them since it's happening with my trackball mouse buttons as well...

Whenever I'm in MAME's control configuration screen, I select a button, and then push either the LCD TopGun button mapped as "button 3" or right-most trackball mouse button).  On the screen I get:

Mouse 5 button 3 Mouse 5 button 4

...where I *should* get:

Mouse 5 button 3

I realize there is a feature in MAME where if you click a button, push enter, and then click a button again, you can map multiple buttons to the same function - but I'm not pushing enter at all here!

The feature you describe is for 'OR' inputs.  What's happening is the 'AND' feature.  If you press enter then more than one button at a time, mame takes it as you have to push those buttons at the same time for that input to register as "pressed".  IOW, "Mouse 5 button 3 Mouse 5 button 4" means you have to press both "button 3" & "button 4" on mouse 5.  (More info at MameFAQ h03, near middle of answer.)

I had something like what you have on one of my systems, too.  At the time I was guessing it had to do with (conflicting?) mouse drivers & some (incompatible?) mouse devices (a Topgun IIRC).  Anyway, my "fix" was to hand edit the cfg file in a text editor and remove the not wanted button.  IIRC, the buttons worked even without the "fix", but I liked the cleaner look.  Do yours work on you system as is?
Robin
Knowledge is Power

Shoegazer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 135
  • Last login:May 10, 2015, 10:37:58 am
    • NonMAME - The ultimate site for the OTHER arcade emulators!
Re: Calling all controller experts... (strange MAME mouse issues)
« Reply #3 on: February 07, 2007, 08:56:32 pm »
Regards, Robin:

Thanks for getting back to me.  You are absolutely right - it's an "AND" feature in action, rather than "OR".  I was trying to remember what might cause this under normal conditions while posting, and I just remembered wrong.  Thanks for the clarification.

No doubt you are right about conflicting drivers as well, though it is a little strange that it *once* worked, even after I had the LCD Topguns and trackball installed, and now it doesn't.  Anyway, regarding your manual fix I'm assuming you mean MAME's cfg file, correct?  It looks like I may need to do this as well.  The buttons do not work when they are mapped in this strange way - for example, in "Operation Wolf" the grenade, for which I'd like to use button 3, simply doesn't work since it's mapped as "Mouse 5 button 3 Mouse 5 button 4".   I have to map it to some other button on the gun before it'll register, and fire.

Stranger still - I'm using Smog's "Guncon" drivers, and the button registers just fine with his "Guncon2Mouse" application (i.e. the on-screen button 3 turns red when you press the real button 3).  If you've used his app, you know what I mean.  From this information, I deduced that this is a MAME issue, but maybe I'm wrong.  As you now know, it wouldn't be the first time.  ;)

Thanks much for your help.

Shoegazer
NonMAME: Your best source for the OTHER arcade emulators!
http://nonmame.retrogames.com

ahofle

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4544
  • Last login:August 30, 2023, 05:10:22 pm
    • Arcade Ambience Project
Re: Calling all controller experts... (strange MAME mouse issues)
« Reply #4 on: February 08, 2007, 01:28:31 pm »
I've seen similar strangeness when you try mapping your inputs with the game paused.  Unpausing usually allows the actual key presses to be mapped correctly.  Why is that anyway?

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: Calling all controller experts... (strange MAME mouse issues)
« Reply #5 on: February 08, 2007, 06:41:31 pm »
Anyway, regarding your manual fix I'm assuming you mean MAME's cfg file, correct?

There is no single "mame's cfg file".  There is the mame.ini file; there was mame.cfg back when mame was still dos based. 
I mean the cfg file(s) in the cfg folder.  If you're remapping all games, "Input (general)", you'll want to edit default.cfg.  If you're remapping a specific game, you'll edit specificgamename.cfg.


Unpausing usually allows the actual key presses to be mapped correctly.  Why is that anyway?

RawInput and DirectInput (foreground mode), the two methods mame uses to read joystick, mouse & keyboard inputs, make it so either: mame sees the inputs but not other (normal) apps, or other apps but not mame.  When mame is paused, mame is set up so other apps can use the mice and keyboard.  If windows wasn't a multiple threaded OS, mame wouldn't need to do this, but since windows can run more than one app at a time, it makes sense (plus windows almost forces this behavior).

However, this isn't what happened to me and it doesn't sound like him either.
Robin
Knowledge is Power

Shoegazer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 135
  • Last login:May 10, 2015, 10:37:58 am
    • NonMAME - The ultimate site for the OTHER arcade emulators!
Re: Calling all controller experts... (strange MAME mouse issues)
« Reply #6 on: February 08, 2007, 08:15:34 pm »
Anyway, regarding your manual fix I'm assuming you mean MAME's cfg file, correct?

There is no single "mame's cfg file".  There is the mame.ini file; there was mame.cfg back when mame was still dos based. 
I mean the cfg file(s) in the cfg folder.  If you're remapping all games, "Input (general)", you'll want to edit default.cfg.  If you're remapping a specific game, you'll edit specificgamename.cfg.
Well that's what I meant - default.cfg.  Semantics.  ;)  I'll try editing this file, or the overriding "opwolf.cfg" but I don't believe it's going to fix the issue.

Unpausing usually allows the actual key presses to be mapped correctly.  Why is that anyway?

RawInput and DirectInput (foreground mode), the two methods mame uses to read joystick, mouse & keyboard inputs, make it so either: mame sees the inputs but not other (normal) apps, or other apps but not mame.  When mame is paused, mame is set up so other apps can use the mice and keyboard.  If windows wasn't a multiple threaded OS, mame wouldn't need to do this, but since windows can run more than one app at a time, it makes sense (plus windows almost forces this behavior).

However, this isn't what happened to me and it doesn't sound like him either.

Hmmm.. well this DOES sound like something to try at least, couldn't hurt, though I'm with you that it's probably not the issue. 

Actually I have sortof found a workaround in that, using smog's Guncon2Mouse app, I simply don't map the offending mouse button to a usable button on the gun.   So, given that "button 1" is what causes the problem, I just don't use it - instead I use "button 2".  Now in MAME, it appears to be ok with that, even though I've lost one whole button from the list of five usable buttons Guncon2Mouse allows me to use.

Of course, the trackball buttons are a different story... I'm still having issues with trackball "button 1", sadly.

Shoegazer
NonMAME: Your best source for the OTHER arcade emulators!
http://nonmame.retrogames.com

Shoegazer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 135
  • Last login:May 10, 2015, 10:37:58 am
    • NonMAME - The ultimate site for the OTHER arcade emulators!
Re: Calling all controller experts... (strange MAME mouse issues)
« Reply #7 on: February 13, 2007, 11:57:10 pm »
...An update, of sorts.  Still having problems with the third mouse button (right-click).  I'm definitely leaning towards a bug in MAME - that is, when I try to register the third mouse button in MAME, it maps as "Mouse 4 button 0 Mouse 4 button 1" rather than "Mouse 4 button 0". 

This only started occurring when I installed my two LCD TopGuns, and it only happens in MAME.  When you try right-click in Windows, everything is fine. 

ack.
NonMAME: Your best source for the OTHER arcade emulators!
http://nonmame.retrogames.com

Shoegazer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 135
  • Last login:May 10, 2015, 10:37:58 am
    • NonMAME - The ultimate site for the OTHER arcade emulators!
Re: Calling all controller experts... (strange MAME mouse issues)
« Reply #8 on: February 14, 2007, 02:19:19 pm »
Another update.. I see where the problem is, and again - pretty sure it's a mame bug, though it might be a "feature" of some sort and I'm just not clued in.

All I did was uncheck "offscreen shots reload" and now mouse buttons are working properly. 

If someone can help me verify this, I'll submit it to MAMEtesters.

Thanks,
Shoegazer
NonMAME: Your best source for the OTHER arcade emulators!
http://nonmame.retrogames.com

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: Calling all controller experts... (strange MAME mouse issues)
« Reply #9 on: February 14, 2007, 07:49:18 pm »
Another update.. I see where the problem is, and again - pretty sure it's a mame bug, though it might be a "feature" of some sort and I'm just not clued in.

All I did was uncheck "offscreen shots reload" and now mouse buttons are working properly. 

If someone can help me verify this, I'll submit it to MAMEtesters.

[smacks head]
If it's due to offscreen reload, it's not a bug.  If you want I can go into how mame remaps and how the offscreen reload option works, but basically -offscreen_reload steals all mouse "button 1"s (the second button) for reloading.  This is hardcoded, and set at compile time.  Changing this behavior is a "feature increase".  Not a bad feature increase, but still not a real bug.  (I've looked into changing this, but it's coded three different ways in four different places, and I don't see a clean way of setting some mouse devices to reload, some not.)


Can you test some of these again?  Some of your numbers support the reload cause, but other don't quite (it could be semantics though):
..either the ... button mapped as "button 3" or right-most trackball mouse button... I get:

Mouse 5 button 3 Mouse 5 button 4

...where I *should* get:

Mouse 5 button 3
Almost makes sense if you had enabled both -dual_lightguns & -offscreen_reload, except I'd expect the buttons to be 2 & 3, but still "should get ... 3" (assuming mouse button numbers start at 0).  Unless you changed the button numbering with the driver, of course.

... I have sortof found a workaround in that, ... I simply don't map the offending mouse button to a usable button on the gun.   So, given that "button 1" is what causes the problem, I just don't use it - instead I use "button 2".  Now in MAME, it appears to be ok with that, even though I've lost one whole button from the list of five usable buttons Guncon2Mouse allows me to use.

Of course, the trackball buttons are a different story... I'm still having issues with trackball "button 1", sadly.
Okay, these numbers match with what -offscreen_reload is designed to do.

Still having problems with the third mouse button (right-click).  I'm definitely leaning towards a bug in MAME - that is, when I try to register the third mouse button in MAME, it maps as "Mouse 4 button 0 Mouse 4 button 1" rather than "Mouse 4 button 0".
Don't you mean "... rather than 'Mouse 4 button 1"?
Robin
Knowledge is Power

Shoegazer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 135
  • Last login:May 10, 2015, 10:37:58 am
    • NonMAME - The ultimate site for the OTHER arcade emulators!
Re: Calling all controller experts... (strange MAME mouse issues)
« Reply #10 on: February 16, 2007, 08:10:03 pm »
Ok Robin, get ready for some insanely stupid questions from someone who is not totally in the groove with what you are saying...       ok ready?

Pretend you are in a real arcade, and you start playing a real lightgun game, say Area 51.  When you want to reload off-screen, you are pressing the *trigger* (MAME would typically assign this to button 0) as you aim the gun outside of the visible playing area.  So why on earth would MAME want to do anything so hacky as to simulate this condition by forcing a mouse button to act this way?  It's not exactly simulating reality, especially if you don't even really have to aim the gun off-screen to reload.  Assuming this is what you mean, then at least I understand what is going on a little better. 

In my world of obviously limited understanding, I'm imagining that it shouldn't be so hard to simply make MAME recognize that anytime button 0 is pressed outside of the visible playing area, emulate this condition using whatever instructions were provided to the original game CPU when this happened in the real game.  Naive question for sure, but hey - I did warn you.

By the way, you were right about the mouse buttons in previous postings being borked - I'm pretty sure they were all buttons 0 and 1.  Sorry for the confusion.

Slightly off-topic - shouldn't there be a way with MAME .112 to turn crosshairs off by default, without doing something like creating transparent bitmaps?  I could do this, but I think a solution involving a command flag would be more elegant. 

Thanks again for your help, Robin.

Shoegazer
NonMAME: Your best source for the OTHER arcade emulators!
http://nonmame.retrogames.com

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: Calling all controller experts... (strange MAME mouse issues)
« Reply #11 on: February 19, 2007, 05:26:28 am »
Ok Robin, get ready for some insanely stupid questions from someone who is not totally in the groove with what you are saying...       ok ready?

Pretend you are in a real arcade, and you start playing a real lightgun game, say Area 51.  When you want to reload off-screen, you are pressing the *trigger* (MAME would typically assign this to button 0) as you aim the gun outside of the visible playing area.  So why on earth would MAME want to do anything so hacky as to simulate this condition by forcing a mouse button to act this way? 

If the PC lightguns acted like arcade guns, mame wouldn't need the hack.  But they don't, so mame does.   :(

With PC lightguns, when you pull the trigger while pointing off screen, the lightgun sends the windows a second button press with the last onscreen location the trigger was pulled.  This (AFAIK) is done in the PC lightgun's hardware, far before the input gets to mame.  The hack in mame un-does what the PC lightgun does, to simulate the real arcade lightguns.

BTW, that behavior is a bug "feature" of all PC lightguns AFAIK.

Quote
By the way, you were right about the mouse buttons in previous postings being borked - I'm pretty sure they were all buttons 0 and 1.  Sorry for the confusion.

No problem.  It threw me for a little while.  Ya, that's my excuse on why I didn't think of the cause myself. ;)

Quote
Slightly off-topic - shouldn't there be a way with MAME .112 to turn crosshairs off by default, without doing something like creating transparent bitmaps?  I could do this, but I think a solution involving a command flag would be more elegant. 

Aaron has a dislike for too many options.  [shrug]  In coding (the little I do), I agree; too many options makes it that much easier for someone to mess it up, harder to up keep, etc.  OTOH, as a power user, it would be nice to be able to set anything to anything I wanted (which is why I like messing at the code).
There are a few ways you can get around the crosshairs thing.  The easiest is just pressing F1 at the start of each game. :-\  Almost as easy, and do once and forget it too, is the transparent pngs you mentioned. 
Or you can edit the source and recompile.  If you know you don't want crosshairs ever, just go into the drivers folder and delete all "PORT_CROSSHAIR(*,*,*,*)", where those '*'s are anything except ',' or ')', aka "comma" and "right parenthesis" respectively. Or if you just want to change the default, edit line 1200 in src/emu/video.c to "crosshair_visible = 0;".
Robin
Knowledge is Power

Shoegazer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 135
  • Last login:May 10, 2015, 10:37:58 am
    • NonMAME - The ultimate site for the OTHER arcade emulators!
Re: Calling all controller experts... (strange MAME mouse issues)
« Reply #12 on: February 19, 2007, 09:10:41 am »
I see now.  So with the MAME "offscreen shots reload" feature turned on, you have to press Mouse button 1 in order to reload, rather than fire.. right?  I ask this because, the only way I can get Lethal Enforcers to reload in the game is to turn this feature on, and even then, firing off-screen doesn't really reload - only pressing Mouse button 1 reloads.

Stranger still, Area 51 doesn't need this feature turned on at all - I simply aim off-screen and fire, and it works 100%.  Maybe representative of differences in the gun hardware or controller boards in the arcades?

Thanks for the tips re: crosshairs.  Hey, at least I know there IS no command flag.  It would just be nicer if Aaron were a bit more friendly to cab owners since it isn't as easy to press F1 as when you're sitting right there with the keyboard in front of you.  I've mapped it to a mouse button, but it's a pain to turn them off every time.

Shoegazer
NonMAME: Your best source for the OTHER arcade emulators!
http://nonmame.retrogames.com

Derrick Renaud

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 299
  • Last login:December 06, 2024, 04:31:44 pm
Re: Calling all controller experts... (strange MAME mouse issues)
« Reply #13 on: February 19, 2007, 01:07:33 pm »
Thanks for the tips re: crosshairs.  Hey, at least I know there IS no command flag.  It would just be nicer if Aaron were a bit more friendly to cab owners since it isn't as easy to press F1 as when you're sitting right there with the keyboard in front of you.  I've mapped it to a mouse button, but it's a pain to turn them off every time.

I thought it remembered  the crosshair visual state next time you played.  It was supposed to.

D.

Shoegazer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 135
  • Last login:May 10, 2015, 10:37:58 am
    • NonMAME - The ultimate site for the OTHER arcade emulators!
Re: Calling all controller experts... (strange MAME mouse issues)
« Reply #14 on: February 19, 2007, 03:59:01 pm »
Derrick, I sincerely wish it were, it's not working that way for me... so I suppose it's either something I'm doing wrong, or it needs to be reported to MAMEtesters..

Shoegazer
NonMAME: Your best source for the OTHER arcade emulators!
http://nonmame.retrogames.com