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: Buttons Crossing in MAME  (Read 2629 times)

0 Members and 1 Guest are viewing this topic.

DillonFoulds

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 605
  • Last login:August 27, 2019, 05:04:44 am
Buttons Crossing in MAME
« on: October 03, 2009, 04:58:48 pm »
Hey guys, wiring up a (USB) GPWiz40 to use with MAME .133

I've got all the controls working fine, except when i push player 3 left, it does nothing.
More interesting, Player 4 right controls both player 4 right and player 3 left...

I checked in windows, control panel, game controllers, and the buttons do not cross over. P3 left in windows is Button 17, and p4 right in windows is 16.

Curiously, when i push P3 left while configuring, it sets it to Joy 1 Button 16 (mame lists all buttons as one value less than what windows reports?), but when i reload mame or load any game, it always switches "Joy 1 Button 16" back to "Joy 1 Button 15".

The buttons do not interfere with each other in either Joy2Key in notepad, or in any other emulators...


Edit:
Just checked mame's \cfg\default.cfg, in it, both P3 Left and P4 Right are mapped to JOYCODE_1_BUTTON16, but all the controls in a close number range (14-20) are in use...

Edit2:
I think I've found the problem. Mame starts counting at 0, while windows control panel and mame\cfg\defaults.cfg both start counting at 1.
This wouldn't be an issue, but when default.cfg reaches 16, for some reason it counts it twice, making the numbers stop lining up with the control panel, and start lining up with mame (counting from 0) resulting in a duplicate of JOYCODE_1_BUTTON16, which on my particular setup reflects P3 left and P4 right.

Am I the only one in the world having this problem?


Edit3: Tried a new computer, never ran mame on it before, got the latest mame, problem persists. It can't be a wiring problem, as in control panel it still shows up correctly, and nothing is hitting 2 buttons (mainly P4 right).

Any suggestions? I'm wondering if there's a ctrlr file or something i should be using?
« Last Edit: October 03, 2009, 07:03:28 pm by DillonFoulds »

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: Buttons Crossing in MAME
« Reply #1 on: October 05, 2009, 05:53:07 pm »
Ah, sound very much like back to the old button numbering issues.*

Mame has 16 buttons per device with internal names and numbering from 1-16.  Anything above that uses the OS's numbering and naming.  Microsoft's DirectInput numbers from 0 to 127, and mame uses whatever windows calls buttons 17-128 (which windows calls 16-127).  It's just our luck that windows calls button 17 "button 16", and mame calls button 16 "button 16"

With the same name, I'm guessing mame can't tells the different when reading the cfg file.  It should work the first time you change it I think.
(Hmm, but you're having problems with buttons 15 & 16, not 16 & 17...  :dizzy:)


*FWIW, mame had simular issues back when it only counted up to 10 buttons per device.  I haven't heard this problem for a long time, and thought it was fixed.
Robin
Knowledge is Power

DillonFoulds

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 605
  • Last login:August 27, 2019, 05:04:44 am
Re: Buttons Crossing in MAME
« Reply #2 on: October 05, 2009, 09:08:21 pm »
well i am jamming a start button, 4 play buttons, and an 8-way for each player on to my GPwiz40. Pretty much filling up every pin available...

In mame, it's buttons 15 and 16 (15 keeps remapping to 16 iirc), and mame starts counting from zero, so really it is buttons 16 and 17 in windows control panel.

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: Buttons Crossing in MAME
« Reply #3 on: October 06, 2009, 07:51:13 pm »
In mame, it's buttons 15 and 16 (15 keeps remapping to 16 iirc), and mame starts counting from zero, so really it is buttons 16 and 17 in windows control panel.

I think we need to sort which starts at 0, and which starts at 1:

Starts at 1:
windows control panel,
mame's UI remap menu
mame's internal names

Starts at 0:
mame's internal indexing numbers
directX directInput api numbering
mame's non-internally-named buttons (since it ges the numbers for directInput numbering)

I'm not sure (will test at home):
mame cfg/ctrlr file format

So, you can see, 2 of the "in mame" numbering starts at 1, and the other two start at 0.  Do you mean the cfg file format when you say "in mame"?
Robin
Knowledge is Power

DillonFoulds

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 605
  • Last login:August 27, 2019, 05:04:44 am
Re: Buttons Crossing in MAME
« Reply #4 on: October 06, 2009, 10:28:29 pm »
By "in mame" i mean launch mame, and go into the config menu in the mame ui when you can select a rom, and this one starts at 0.

The default.cfg starts at one on mine.

Windows control panel starts at 1.

That's where my technical knowledge ends. I don't know anything about the inner workings of directX.