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: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)  (Read 152019 times)

0 Members and 1 Guest are viewing this topic.

tony.silveira

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 697
  • Last login:February 17, 2024, 10:24:34 pm
    • my baby
thanks dr.v!  i'll give it a try this weekend and report back.

one last question.  i use mamewah as my FE.  if i start "star wars" without my yoke plugged in, it isn't active; i have to plug it in (or any other secondary controllers) so that mame sees them at start up.

i'm curious if this util will help with that or, is it just a limitation of the way windows works? 

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:June 25, 2023, 02:23:57 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
one last question.  i use mamewah as my FE.  if i start "star wars" without my yoke plugged in, it isn't active; i have to plug it in (or any other secondary controllers) so that mame sees them at start up.

I don't think that's as much a limitation of windows as it is with mame (and most other apps to be fair). Most games take inventory of the controls that are available during their load up process, and don't monitor for changes to what controllers are plugged or unplugged.

Unfortunately, ControllerRemap can't really help with that problem. You'd still have to make sure that whatever controls were necessary were plugged in before running Mame.

But there may be some guys on here with more in depth knowledge of the internal workings of mame than me, so I could very well be wrong. I just haven't seen it work any other way.

tony.silveira

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 697
  • Last login:February 17, 2024, 10:24:34 pm
    • my baby
i kinda thought it'd be something like that.

curious if there would be a way to trick the OS into always thinking a controller is plugged in?  that way you could assign an ID number with your util and the system would always think that they are plugged in.

another thought would be to pick a game with your FE, have a splash screen come up telling you what contrioller to plug in, wait for the USB signal, plug in, THEN mame starts the game

nick3092

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 211
  • Last login:March 22, 2022, 03:57:28 pm
Re: New ControllerRemap utility, 6/05/11 update available (Version 0.0.7)
« Reply #83 on: June 17, 2012, 06:40:56 pm »
Ok, looks like multiple newseq entries under a port was throwing things off.

I've fixed things up and will do some testing, then post the new build here in a bit.

First off, want to say that I finally got around to using this utility, and it works great.  I have a modular CP with several USB joysticks, and it works great for me.  I'm also assuming this could work for MESS on my cab too.  I also have a number of console to USB converters as well.

I am having one issue with newseq entries, but I don't believe it is the fault of ControllerRemap.  ControllerRemap appears to be correctly creating them in the "live" input section.  However, MAME appears to be ignoring anything other than what is passed in the "standard" entry.  I'm posting in this thread, hoping that this user base would be most likely run into this issue, since it depends on the use of ctrlr files.

For example, I am trying to map the "P1_POSITIONAL" port for my rotary controller in Ikari Warriors.  It is hooked up to my GP-Wiz40 which translates the rotation into one of two button presses.  Here is the code generated in the input section. 

Code: [Select]
      <port type="P1_POSITIONAL" mask="240" defvalue="0" keydelta="0" sensitivity="100">
        <newseq type="standard">
NONE
</newseq>
        <newseq type="decrement">
JOYCODE_7_BUTTON19
</newseq>
        <newseq type="increment">
JOYCODE_7_BUTTON18
</newseq>
      </port>

When I fire up MAME, it does acknowledge that I set the actual dial setting to "NONE".  I have manually changed this to MOUSECODE_1_ZAXIS to test, and MAME does in fact pick up the change from none to mouse z.  But it continues to ignore the fact the dial increase and dial decrease should be mapped to buttons 19 and 18.  It shows them with the default of Z and X (I believe off the top of my head).

It also appears to be ignoring any of the analog settings that are passed on the port line, like the sensitivity.  It keeps defaulting to like 15 (or something) when I'm passing 100 in the string.  Having the same issue when I set up a profile for Arkanoid to set the sensitivity to 40.  It keeps defaulting to 30.  If I manually change them in MAME, it then creates a cfg file in the cfg directory for that particular game.  And if I load the game again, MAME honors those settings.  So it appears to only be ignoring these settings when they are passed via the -ctrlr option.  I even took the corrected cfg file for Ikari and moved it from the cfg folder into the ctrlr folder, and ran MAME using -ctrlr ikari, and it then defaulted back to the original settings.

Has anyone else using this utility notice the same thing?  I'd feel better if at least one other person noticed it besides me before opening a bug with the MAME team.

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:June 25, 2023, 02:23:57 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
curious if there would be a way to trick the OS into always thinking a controller is plugged in?  that way you could assign an ID number with your util and the system would always think that they are plugged in.
another thought would be to pick a game with your FE, have a splash screen come up telling you what contrioller to plug in, wait for the USB signal, plug in, THEN mame starts the game

Sorry, I didn't see this before now.

As far as I know, there's no way to "trick" the os that a device is plugged in without, maybe writing some sort of custom device driver? I'm just not sure on that one.

The "Pause before the game starts" idea would certainly work, but I'm not sure how you'd do it without a good bit a programming. AutoHotkey might be able to do something along those lines.


@nick3092

Now that's an interesting one. You're right about Mame creating those CFG files. If you config things through mame, you'll get a CFG file.

oooo. Yuck, Just came across this post from U-RebelScum, who I believe is one of the mame devs (or at least seems to know A  LOT about controller mapping in mame)

http://forum.arcadecontrols.com/index.php?topic=73690.msg763763#msg763763

Basically, he's saying the Ctrlr file is only for port mapping, not for setting port attributes (which stinks, but I guess that's the way it is right now).

Also, that post was 2007. Maybe it's different now, but I'm not sure how to check (short of sifting through all the code)

nick3092

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 211
  • Last login:March 22, 2022, 03:57:28 pm
Dang.  I searched over at MW, and didn't see anything like this.  But I guess that explains the behavior I'm seeing.  Interesting though that it ignores the "increment" and "decrement" port settings as well.  Although, even if that worked it wouldn't do any good without the sensitivity settings. But if MAME did honor the "increment" and "decrement" settings via ctrlr, the sensitivity settings could be maintained in the individual game cfg files without specifying new JOY/MOUSECODEs

Looks like I'll have to maintain game specific cfg's for each game that require specific sensitivity settings and try not to have any extra joysticks plugged in.  Although, I could set all of those cfg files read only.  Then MAME couldn't muck them up if the controller order was changed.

Either way, thanks again for writing such a nifty utility.

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:June 25, 2023, 02:23:57 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Well, I just had a look (more out of curiousity than anything), and it does look like this is the case. I found where I believe the CFG file is loaded

src\emu\inptport.c  function load_game_config

and it has this

   /* for analog fields, fetch configurable analog attributes */
   else
   {
      /* get base attributes */
      field->state->analog->delta = xml_get_attribute_int(portnode, "keydelta", field->delta);
      field->state->analog->centerdelta = xml_get_attribute_int(portnode, "centerdelta", field->centerdelta);
      field->state->analog->sensitivity = xml_get_attribute_int(portnode, "sensitivity", field->sensitivity);


However, from what I can tell, it looks like all the CFG and CTRLR files are read via

emu\src\config.c function config_load_settings

Well, the files appear to be referenced there, and then through a bunch of C pointer redirection that I'm not quite understanding right now, the files are parsed.

It appears that load_game_config doesn't end up getting called during a ctrlr parse, but is during a cfg parse.

Still not sure why...

wolfsoft

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 92
  • Last login:February 10, 2023, 07:54:14 am
Re: New ControllerRemap utility, 3/30/11 update available (Version 0.0.6)
« Reply #87 on: July 31, 2012, 01:23:18 pm »
I am currenty setting up my remap cfg. It is possible to post a working config of your aimtrak guns with controleralias?
Many thanks

Now this is just too cool. I have a multipanel setup including some with u360s and aimtraks plus joyless. This will now fix my woes! Thanks sooooooooooooo much for this.

Now only to get ledblinky to remap my u360s even if it did not detect them during the start of ledblinky   ;) :w00t
http://www.blog.wolfsoft.de for arcade tutorials
http://www.wolfsoft.de for our website

wolfsoft

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 92
  • Last login:February 10, 2023, 07:54:14 am
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #88 on: August 02, 2012, 03:31:33 am »
I currently tried the ultimarc aimtrack and have a lot of usb devices plugged in
I configured button 1 and button 2 as mouse for the aimtrack and it works with guncode element.
But for button 3 and higher its regocnized as usual usb gamecontoller-
As therefor I have guncode_1 and for button 3 and higher joy_5 button 3
any idea?
thanks
http://www.blog.wolfsoft.de for arcade tutorials
http://www.wolfsoft.de for our website

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:June 25, 2023, 02:23:57 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #89 on: August 02, 2012, 09:15:39 am »
I currently tried the ultimarc aimtrack and have a lot of usb devices plugged in
I configured button 1 and button 2 as mouse for the aimtrack and it works with guncode element.
But for button 3 and higher its regocnized as usual usb gamecontoller-
As therefor I have guncode_1 and for button 3 and higher joy_5 button 3
any idea?

Sorry, you completely lost me on that. I haven't tried hooking it up with an aimtrak yet (mine is still in bubble wrap  :( )

Maybe if you post your Controller file, it might be clearer.

mybrainhurtz

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 79
  • Last login:March 27, 2023, 12:49:29 pm
    • craftygeek
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #90 on: November 08, 2012, 09:33:30 am »
First off, I want to thank you for all of your hard work! I recently added a front USB panel to my cab so I could add additional controllers for 4 player games and was struggling with key mapping. This little utility will solve all of my woes :)

I have been working my way through my cfg file and came to an entry that I am not sure how to deal with.

Code: [Select]
       
       <controller id="GP-Wiz+">
   <input>           

           <...>

            <port type="VOLUME_DOWN">
                <newseq type="standard">
                    JOYCODE_3_BUTTON26 MOUSECODE_3_XAXIS_NEG_SWITCH
                </newseq>
            </port>
            <port type="VOLUME_UP">
                <newseq type="standard">
                    JOYCODE_3_BUTTON26 MOUSECODE_3_XAXIS_POS_SWITCH
                </newseq>
            </port>
    </input>
        </controller>

        <controller id="Spinner">
            <input>

            </input>
        </controller>


I want to use the pause button on my GP-Wiz+ and the TurboTwist2 Spinner that registers as Mouse3 to adjust the volume on the cab. How do I reference inputs from two different controllers to affect a single port?

I suppose an alternative option would be to rewire my pause button to one of the mouse button leads on the spinner interface... if there is one.

Thanks!

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:June 25, 2023, 02:23:57 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #91 on: November 08, 2012, 01:58:08 pm »
I'd probably try something like cabvol or 3rvx before trying to map name keys for that.

That way, it'd work across everything, not just mame

mybrainhurtz

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 79
  • Last login:March 27, 2023, 12:49:29 pm
    • craftygeek
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #92 on: November 08, 2012, 02:30:20 pm »
I was initially using cabvol but I thought perhaps I could simplify things by doing it in mame. Currently I have to run JoyToKey to get a keypress for my pause button, and then cabvol to change the volume.

Thanks for the quick reply!

nick3092

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 211
  • Last login:March 22, 2022, 03:57:28 pm
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #93 on: February 17, 2013, 05:50:05 pm »
So, I'm trying to get this running with MESS as well since it uses the MAME cfg/ctrlr layout as well.  I have a number of USB adapters for the various original controllers that this would be very useful for.  So far, it works fine for most controllers.

The exception being controllers with keypads (Coleco, Intv, Jag, etc..), due to the way MAME/MESS configure the input for a keypad.  It appears to ID everything as "KEYPAD" but there is a "mask" number that some how translates into the specific button on the keypad.  And ControllerRemap ignores that mask, and winds up assigning all 12 buttons to a single keypad entry.


For example, my config that is read in looks like this:
Code: [Select]
        <port tag=":SAC_KEYPAD1" type="KEYPAD" mask="1" defvalue="1">
          <newseq type="standard">
                    JOYCODE_BUTTON19
                </newseq>
        </port>
        <port tag=":SAC_KEYPAD1" type="KEYPAD" mask="2" defvalue="2">
          <newseq type="standard">
                    JOYCODE_BUTTON9
                </newseq>
        </port>
        <port tag=":SAC_KEYPAD1" type="KEYPAD" mask="4" defvalue="4">
          <newseq type="standard">
                    JOYCODE_BUTTON10
                ...

But after it's read in, ControllerRemap lumps everything under a single "KEYPAD" entry:
Code: [Select]
      <port type="KEYPAD" tag=":SAC_KEYPAD1" mask="1" defvalue="1">
        <newseq type="standard">
                    JOYCODE_1_BUTTON19
                 OR
                    JOYCODE_1_BUTTON9
                 OR
                    JOYCODE_1_BUTTON10
                 OR
                 ...

Would it be hard to add handling for keypad devices, so that it maps them uniquely based on the mask value?

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:June 25, 2023, 02:23:57 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #94 on: February 17, 2013, 11:00:56 pm »
Interesting. I hadn't run into that MASK setting before.

I'll see what I can come up with, and let you know.

nick3092

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 211
  • Last login:March 22, 2022, 03:57:28 pm
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #95 on: February 18, 2013, 10:13:44 am »
Thanks for looking into it.  I did just discover another nuance with keypads too.  So, normally each control has a unique "type" identifier for each player.  Like P1_BUTTON1 and P2_BUTTON1.  But for both player 1 and 2, the keypad is always just KEYPAD.  There is a "tag" though, that indicates if it's player 1's keypad or player 2, in addition to the previously mentioned "mask" that tells MESS what key it is.

So from my actual coleco.cfg file, you can see the tag ":SAC_KEYPAD1" differentiates it from "SAC_KEYPAD2"
Code: [Select]
            <port tag=":SAC_KEYPAD1" type="KEYPAD" mask="2" defvalue="2">
                <newseq type="standard">
                    JOYCODE_1_BUTTON9
                </newseq>
            </port>

            <port tag=":SAC_KEYPAD2" type="KEYPAD" mask="1" defvalue="1">
                <newseq type="standard">
                    JOYCODE_2_BUTTON19
                </newseq>
            </port>

But ControllerRemap is also ignoring this "tag" and also lumping all of player 1 and player 2 under the same "keypad" with tag of :SAC_KEYPAD1":
Code: [Select]
      <port type="KEYPAD" tag=":SAC_KEYPAD1" mask="1" defvalue="1">
        <newseq type="standard">
                    JOYCODE_1_BUTTON19
                 OR
...
                 OR
                    JOYCODE_1_BUTTON20
                 OR
                    JOYCODE_1_BUTTON18
                 OR
                    JOYCODE_2_BUTTON19
                 OR
                    JOYCODE_2_BUTTON9
                 OR
...

So it looks like for "keypad" type entries, you have to group by both the "tag" and "mask" values.  Sorry I didn't see that yesterday.  I was just testing with one joystick yesterday, and today was adding the player 2 controls.

Edit: To confirm, I have only confirmed this on Coleco and Intv.  The only other console off the top of my head that used a keypad was Jaguar.
« Last Edit: February 18, 2013, 10:38:32 am by nick3092 »

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:June 25, 2023, 02:23:57 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #96 on: February 18, 2013, 11:13:36 am »
So, just to clarify, you have a config file that might have a number of entries like this

 <port tag=":SAC_KEYPAD1" type="KEYPAD" mask="2" defvalue="2">

differing by the TAG (the number at the end) and the MASK (just the value)

Within each, you might have any number of actual NEWSEQ entries that define the buttons themselves.

Is that about right?


nick3092

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 211
  • Last login:March 22, 2022, 03:57:28 pm
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #97 on: February 18, 2013, 01:38:28 pm »
I have only seen 1 NEWSEQ per PORT.   But yes, the tag seems to indicate which keypad it belongs to, (player 1 or 2).  Along with the description of said pad.  Iin the case of coleco, Super Action Pad (:SAC_KEYPAD1), or Regular Pad (:STD_KEYPAD2) - even though they are functionally the same.  Intv just calls them :KEYPAD1 and :KEYPAD2.

And the Mask must identify which key on the keypad.  I don't see how else MESS is tracking say, '1' on the coleco keypad, vs. '#' when everything is just lumped under a type of KEYPAD.  I did notice non-keypad controls also have a mask as well.

Looking at the MESS source, it appears the "tag" matches the port name in the MESS source.

ie. PORT_START("SAC_KEYPAD1")

And the mask number matches the PORT_BIT.  Mask "8" in my cfg maps to the button I assigned to '3' on the coleco key pad.  Looking at the source you see:

PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("3 (SAC pad 1)")

And PORT_NAME is what you see in the OSD when manually mapping controls.  Probably not that useful to know in this case, but at least we know where those values come from.

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:June 25, 2023, 02:23:57 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #98 on: February 19, 2013, 10:00:17 pm »
Could you post the CFG file in it's entirety.

Having a hard time understanding exactly how those parts fit together...


nick3092

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 211
  • Last login:March 22, 2022, 03:57:28 pm
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #99 on: February 19, 2013, 10:22:22 pm »
Sure.  Here you go.  This is a full mapping for 2 coleco super action joysticks, each with a keypad.  For reference, here is how the physical joystick buttons are mapped to the Coleco keypad:

Joystick - Coleco keypad

9 = 1
10 = 2
11 = 3
12 = 4
...
16 = 8
17 = 9
18 = *
19 = 0
20 = #

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:June 25, 2023, 02:23:57 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #100 on: March 10, 2013, 02:16:40 pm »
Not sure if anyone else is interested in the fixes to support MESS KEYPAD type entries, but I've put together some fixes that should resolve the issue. I can test with mocked up devices, but I don't have any real devices to test with.

If anyone is interested, let me know. I'd rather not post the new build till I have a pretty good idea that it'll work for people.

Shoot me a pm or post here if you're interested.

isamu

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 807
  • Last login:March 18, 2024, 02:38:32 am
  • I'm a llama!
Hello Dr Venture. I just had one question. Does this utility work with other programs/games/emulators as well? I don't really have a use for it in MAME, but it would help with other emulators such as Model 2, etc.

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:June 25, 2023, 02:23:57 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Does this utility work with other programs/games/emulators as well? I don't really have a use for it in MAME, but it would help with other emulators such as Model 2, etc.

Unfortunately, not that I know of. I don't run many other emus, so I definitely haven't tested it, but ControllerRemap basically just rewrites the MAME INI configuration file, so the only way it'd possibly work with other emu's is if they read the mame config files. To my knowledge, none of them do that.


isamu

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 807
  • Last login:March 18, 2024, 02:38:32 am
  • I'm a llama!
Thanks :(  :embarassed:

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:June 25, 2023, 02:23:57 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
If the problem is of a similar nature, it might be possible to get the app to support other emus.

I'm just not familiar with the controller configs of other emus.

Is what you're running into that a USB device is mapped one way one time you run the emu, and another way other times?  A lot of it has to do with the way the EMU identifies the hardware. If it does it right, it won't care where the controller is plugged in.

Unfortunately, Mame doesn't handle controllers quite that way, it uses an enumeration ID (basically just a number, 1-x) of the device. But since windows has a nasty habit of renumbering devices for various reasons, that technique results in mismaps.

If Model2 IDs devices the same way, it might be possible for CR to perform remapping on it's controller files.

If you've got some before and after config files, I could take a look.

isamu

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 807
  • Last login:March 18, 2024, 02:38:32 am
  • I'm a llama!
If the problem is of a similar nature, it might be possible to get the app to support other emus.

I'm just not familiar with the controller configs of other emus.

Is what you're running into that a USB device is mapped one way one time you run the emu, and another way other times?  A lot of it has to do with the way the EMU identifies the hardware. If it does it right, it won't care where the controller is plugged in.

Unfortunately, Mame doesn't handle controllers quite that way, it uses an enumeration ID (basically just a number, 1-x) of the device. But since windows has a nasty habit of renumbering devices for various reasons, that technique results in mismaps.

If Model2 IDs devices the same way, it might be possible for CR to perform remapping on it's controller files.

If you've got some before and after config files, I could take a look.

Thanks for the reply. The problem is that Model 2 emu's config file is actually an ini file, and although it *does* have options to adjust things like controller force feedback, graphics, etc. It oddly enough has NO option to assign or map inputs. There is no controller mapping support at all in the ini file.

Furthermore, there IS an input config file for each Model 2 game, but upon opening it is just a few lines garbage text(Ascii or C++ code?). Not sure if that would make it helpful or not.

Not sure why El Semi didn't provide us with the option to map inputs from our joysicks and wheels via the ini file. Oh well :(

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:June 25, 2023, 02:23:57 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Yuck. Sounds like that's a non-starter. If there were mapping in the INI file, no big deal, but I dont think I want to get into reverse engineering some odd binary config files.  :-\

Applekid

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 25
  • Last login:May 03, 2015, 10:16:28 am
Avast detects a trojan in attachment.  :-\

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:June 25, 2023, 02:23:57 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Hmm thats not good. I run everything through eset nod32 normally.

Im not where I can check it right now, but ill download and check it again.

Anyone else see alarms on the exe?

wolfsoft

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 92
  • Last login:February 10, 2023, 07:54:14 am
yes norton antivirus is deleting it too!
http://www.blog.wolfsoft.de for arcade tutorials
http://www.wolfsoft.de for our website

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:June 25, 2023, 02:23:57 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Very strange. I tried downloading the attachment and I too got a warning from NOD32. So I went back to my dev folder and scanned the original 0.0.9 build that I uploaded (I keep all the old ZIPs) and it was clean.

I've rebuilt, scanned with NOD32 (and a couple online scanners) and posted into a ZIP renamed with a TXT extension, just in case.

Just download, remove the TXT extension and unzip. Please scan the file locally, and let me know if this new build causes virus alerts.


Applekid

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 25
  • Last login:May 03, 2015, 10:16:28 am
Looks like it's coming in clean now. Very odd! Another thing contributing to someday being able to claim I've "seen it all"!

FWIW, I previously disabled the anti-virus and was able to unpack it, but the exe itself was marked with a trojan.

Thanks! :angel:

MydknyteStyrm

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 331
  • Last login:March 20, 2024, 12:19:41 pm
  • Makeup FX Gamer
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #112 on: June 08, 2013, 07:25:29 pm »
Wonderful app, thanks for taking the time to put it together!

I have a small issue, which I'm not sure how to fix. I have one Aimtrak lightgun, and was testing it out with ControllerRemap. I think I did everything right, and I was wondering, when I load up Mame with the -ctrlr MyArcade command, shouldnt I see my settings when i hit TAB in Mame?

I dont, and I wasnt sure how to correct this. My two test games are Lethal Enforcers (1 button game) and Termiator 2 (2 button game). Here is what my MyArcade.cfg looks like.
Code: [Select]
<!--
Configuration Remap file
-->
<mameconfig version="10">
  <!--
    ############################################################
    Define controller aliases, This just makes the controller names
    a little easier to deal with for the rest of the file.
    ############################################################
    -->
  <controlleralias>
    <id>Logitech Dual Action</id>
    <alias>Logitech</alias>
  </controlleralias>
  <controlleralias>
    <id>ATRAK Device#3</id>
    <alias>ATRAK</alias>
  </controlleralias>
  <controlleralias>
    <id>HID#VID_D209_PID_1603_MI_02#7_27d3a5f8_0_0000#</id>
    <alias>Lightgun</alias>
  </controlleralias>
  <!--
    ############################################################
    This is the System Default section
    It generally should be the FIRST system section in the cfg file
    ############################################################
    -->
  <system name="default">
    <!-- put a controller element here to have it copied into ONLY this particular
         system element
    -->
    <controller id="Lightgun">
      <input>
        <port type="P1_BUTTON1">
          <newseq type="standard">
                        GUNCODE_BUTTON1
                    </newseq>
        </port>
        <port type="P1_BUTTON2">
          <newseq type="standard">
                        GUNCODE_BUTTON2
                    </newseq>
        </port>
        <port type="P1_BUTTON3">
          <newseq type="standard">
                        MOUSECODE_1_BUTTON2
                    </newseq>
        </port>
        <port type="P1_LIGHTGUN_X">
          <newseq type="standard">
                        MOUSECODE_XAXIS
                    </newseq>
        </port>
        <port type="P1_LIGHTGUN_Y">
          <newseq type="standard">
                        MOUSECODE_YAXIS
                    </newseq>
        </port>
      </input>
    </controller>
    <controller id="ATRAK">
      <input>
        <port type="P1_BUTTON1">
          <newseq type="standard">
                        GUNCODE_BUTTON1
                    </newseq>
        </port>
        <port type="P1_BUTTON2">
          <newseq type="standard">
                        GUNCODE_BUTTON2
                    </newseq>
        </port>
        <port type="P1_BUTTON3">
          <newseq type="standard">
                        MOUSECODE_1_BUTTON2
                    </newseq>
        </port>
        <port type="P1_LIGHTGUN_X">
          <newseq type="standard">
                        MOUSECODE_XAXIS
                    </newseq>
        </port>
        <port type="P1_LIGHTGUN_Y">
          <newseq type="standard">
                        MOUSECODE_YAXIS
                    </newseq>
        </port>
      </input>
    </controller>
    <!--
        ###################################################
        ACTUAL INPUT MAPPING STARTS HERE
        DO NOT actually put anything in this section.
        It is completely cleared and regenerated!
        ###################################################
        -->
    <input>
      <port type="P1_BUTTON1">
        <newseq type="standard">
                        GUNCODE_3_BUTTON1
                     OR
                        GUNCODE_2_BUTTON1
                    </newseq>
      </port>
      <port type="P1_BUTTON2">
        <newseq type="standard">
                        GUNCODE_3_BUTTON2
                     OR
                        GUNCODE_2_BUTTON2
                    </newseq>
      </port>
      <port type="P1_BUTTON3">
        <newseq type="standard">
                        MOUSECODE_3_BUTTON2
                     OR
                        MOUSECODE_2_BUTTON2
                    </newseq>
      </port>
      <port type="P1_LIGHTGUN_X">
        <newseq type="standard">
                        MOUSECODE_3_XAXIS
                     OR
                        MOUSECODE_2_XAXIS
                    </newseq>
      </port>
      <port type="P1_LIGHTGUN_Y">
        <newseq type="standard">
                        MOUSECODE_3_YAXIS
                     OR
                        MOUSECODE_2_YAXIS
                    </newseq>
      </port>
    </input>
  </system>
  <!--
    ###################################################
    This is a GAME specific section
    Add additional <controller> sections here
    to define how those controllers should map for this
    particular game
    ###################################################
    -->
  <system name="ribbit">
    <!-- This would be stupid to actually use, but as an example
         For this game ("Ribbit"), reverse the UP and DOWN directions
         on the joystick -->
    <controller id="U360 Player1">
      <input>
        <port type="P1_JOYSTICK_UP">
          <newseq type="standard">
                        JOYCODE_YAXIS_DOWN_SWITCH
                    </newseq>
        </port>
        <port type="P1_JOYSTICK_DOWN">
          <newseq type="standard">
                        JOYCODE_YAXIS_UP_SWITCH
                    </newseq>
        </port>
      </input>
    </controller>
    <!--
        ###################################################
        ACTUAL INPUT MAPPING STARTS HERE
        DO NOT actually put anything in this section.
        It is completely cleared and regenerated!
        ###################################################
        -->
    <input></input>
  </system>
</mameconfig>

Any help you can provide would be wonderful. The other question is, should I leave my default.cfg blank in these sections for Lightgun?

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:June 25, 2023, 02:23:57 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #113 on: June 08, 2013, 10:11:54 pm »
Hey MydknyteStyrm

I'm gonna be out of town all next week, and don't have a ton of time to check into this completely right now.

As I recall, you +do not+ see the ctlr mapping, even the static ones (ie when you don't use ctlrremap), from within the mame ui. ctlr files are kinda of the red-headed stepchild of config stuff in mame from what I understand.

That doesn't mean it doesn't work, you just can config or see the config from the ui.

I also believe you normally want the default.cfg blank for those elements you'll use controllerremap for. I generally put ALL the config in the ctlr file.  This means, if I map something via the ui, i'll get it working, then move those entries to my ctlr file, and remove them from the cfg file. Check the docs for controllerremap for more details on that.

I can take a longer look at it in a couple weeks.

thurmansevolution

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16
  • Last login:September 14, 2013, 07:19:53 pm
  • I want to build my own arcade controls!
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #114 on: June 10, 2013, 04:26:45 pm »
Hello! :)

I understand and really appreciate the concept of ControllerRemap Utility, but I'm having a huge problem with it.  I've done all I could do, and I still can't get it to work.  I know a little with xml and understand what to do, but after writing the cfg file, etc...to loading the mame game, the lightguns will still be assigned another # by mame if they are unplugged (outside of mame...not while the game is running of course lol)

Here is my setup:

1 trackball (ultimarc of course ;) )
2 lightguns (Aimtrak)

Front End - GameEx
Mame Version - MameUI32 1.32

Here is a copy of the config file I created:

Code: [Select]
<!-- This file is autogenerated; comments and unknown tags will be stripped -->
<mameconfig version="10">
  <controlleralias>
    <id>HID#Vid_d209_PID_1604_MI_02#7_37a156_0_0000#</id>
    <alias>Lightgun2</alias>
  </controlleralias>
  <controlleralias>
    <id>HID#Vid_d209_PID_1603_MI_02#7_16ec4b4a_0_0000#</id>
    <alias>Lightgun1</alias>
  </controlleralias>
  <controlleralias>
    <id>HID#Vid_d209_PID_15a1#7_315062fa_0_0000#</id>
    <alias>Trackball</alias>
  </controlleralias>
  <system name="default">
    <controller id="LIghtgun1">
      <input>
        <port type="P1_BUTTON1">
          <newseq type="standard">
                    GUNCODE_BUTTON1
                </newseq>
        </port>
        <port type="P1_BUTTON2">
          <newseq type="standard">
                    JOYCODE_BUTTON3
                </newseq>
        </port>
        <port type="P1_BUTTON3">
          <newseq type="standard">
                    JOYCODE_BUTTON4
                </newseq>
        </port>
      </input>
    </controller>
    <controller id="LIghtgun2">
      <input>
        <port type="P2_BUTTON1">
          <newseq type="standard">
                    GUNCODE_BUTTON1
                </newseq>
        </port>
        <port type="P2_BUTTON2">
          <newseq type="standard">
                    JOYCODE_BUTTON2
                </newseq>
        </port>
        <port type="P2_BUTTON3">
          <newseq type="standard">
                    JOYCODE_BUTTON1
                </newseq>
        </port>
      </input>
    </controller>
    <controller id="Trackball">
      <input>
        <port type="P1_TRACKBALL_X">
          <newseq type="standard">
                    MOUSECODE_XAXIS
                </newseq>
        </port>
        <port type="P2_TRACKBALL_X">
          <newseq type="standard">
                    MOUSECODE_XAXIS
                </newseq>
        </port>
        <port type="P1_TRACKBALL_Y">
          <newseq type="standard">
                    MOUSECODE_YAXIS
                </newseq>
        </port>
        <port type="P2_TRACKBALL_Y">
          <newseq type="standard">
                    MOUSECODE_YAXIS
                </newseq>
        </port>
      </input>
    </controller>
    <controller id="LIghtgun1">
      <input>
        <port type="P1_LIGHTGUN_X">
          <newseq type="standard">
                    GUNCODE_XAXIS
                </newseq>
        </port>
      </input>
    </controller>
    <controller id="LIghtgun2">
      <input>
        <port type="P2_LIGHTGUN_X">
          <newseq type="standard">
                    GUNCODE_XAXIS
                </newseq>
        </port>
      </input>
    </controller>
    <controller id="LIghtgun1">
      <input>
        <port type="P1_LIGHTGUN_Y">
          <newseq type="standard">
                    GUNCODE_YAXIS
                </newseq>
        </port>
      </input>
    </controller>
    <controller id="LIghtgun2">
      <input>
        <port type="P2_LIGHTGUN_Y">
          <newseq type="standard">
                    GUNCODE_YAXIS
                </newseq>
        </port>
      </input>
    </controller>
    <controller id="Trackball">
      <input>
        <port type="P2_MOUSE_X">
          <newseq type="standard">
                    MOUSECODE_XAXIS
                </newseq>
        </port>
        <port type="P2_MOUSE_Y">
          <newseq type="standard">
                    MOUSECODE_YAXIS
                </newseq>
        </port>
      </input>
    </controller>
    <input>
      <port type="P1_BUTTON1">
        <newseq type="standard">
                    GUNCODE_BUTTON1
                </newseq>
      </port>
      <port type="P1_BUTTON2">
        <newseq type="standard">
                    JOYCODE_BUTTON3
                </newseq>
      </port>
      <port type="P1_BUTTON3">
        <newseq type="standard">
                    JOYCODE_BUTTON4
                </newseq>
      </port>
      <port type="P2_BUTTON1">
        <newseq type="standard">
                    GUNCODE_BUTTON1
                </newseq>
      </port>
      <port type="P2_BUTTON2">
        <newseq type="standard">
                    JOYCODE_BUTTON2
                </newseq>
      </port>
      <port type="P2_BUTTON3">
        <newseq type="standard">
                    JOYCODE_BUTTON1
                </newseq>
      </port>
      <port type="P1_TRACKBALL_X">
        <newseq type="standard">
                    MOUSECODE_XAXIS
                </newseq>
      </port>
      <port type="P2_TRACKBALL_X">
        <newseq type="standard">
                    MOUSECODE_XAXIS
                </newseq>
      </port>
      <port type="P1_TRACKBALL_Y">
        <newseq type="standard">
                    MOUSECODE_YAXIS
                </newseq>
      </port>
      <port type="P2_TRACKBALL_Y">
        <newseq type="standard">
                    MOUSECODE_YAXIS
                </newseq>
      </port>
      <port type="P1_LIGHTGUN_X">
        <newseq type="standard">
                    GUNCODE_XAXIS
                </newseq>
      </port>
      <port type="P2_LIGHTGUN_X">
        <newseq type="standard">
                    GUNCODE_XAXIS
                </newseq>
      </port>
      <port type="P1_LIGHTGUN_Y">
        <newseq type="standard">
                    GUNCODE_YAXIS
                </newseq>
      </port>
      <port type="P2_LIGHTGUN_Y">
        <newseq type="standard">
                    GUNCODE_YAXIS
                </newseq>
      </port>
      <port type="P2_MOUSE_X">
        <newseq type="standard">
                    MOUSECODE_XAXIS
                </newseq>
      </port>
      <port type="P2_MOUSE_Y">
        <newseq type="standard">
                    MOUSECODE_YAXIS
                </newseq>
      </port>
    </input>
  </system>
</mameconfig>

I'm close to pulling the rest of my hair out with this lol....if someone - anyone - would be able to take a few minutes and tell me what I'm doing wrong, I will appreciate it greatly!! :) 

(which I also tried using batch files, but the iffy-iffy thing is the way GameEx Launches mame games...by command line)


Thanks in advance!



LC  :afro:

chipywinie

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 4
  • Last login:November 15, 2013, 08:45:00 am
  • I want to build my own arcade controls!
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #115 on: June 11, 2013, 11:26:55 am »
hi there!

After much work of searching on the internet, i finally found this awesome app.
I've been 2 days setting it up and i have almost done but for some reason generates an assignment error when missing any controller that uses the same driver.

This is my inputs list:
Code: [Select]
Joystick Device List (Devices are in enumeration order) ..

   1.  'Xbox 360 W', ID=2
   2.  'Xbox 360 W', ID=3
   3.  'usb2joy', ID=0
   4.  'usb2joy', ID=1

Mouse Device List (Devices are in enumeration order) ...

   1.  'HID#VID_1267_PID_0201#7_6c159b4_0_0000#'
   2.  'HID#VID_1D57_PID_32DA_MI_01#8_1dd92e8a_0_0000#'

End of list

H:\Hyperspin\Games\MAME>

Generating the file with the four devices connected, everything works fine.

Here is  the config file:
(see file1.txt)

The problem is, when one of the wireless xbox360 controllers isn't connected, for some reason it's still makes buttons assignments of it.

Here the inputs list:

Code: [Select]
Joystick Device List (Devices are in enumeration order) ..

   1.  'Xbox 360 W', ID=2
   2.  'usb2joy', ID=0
   3.  'usb2joy', ID=1

Mouse Device List (Devices are in enumeration order) ...

   1.  'HID#VID_1267_PID_0201#7_6c159b4_0_0000#'
   2.  'HID#VID_1D57_PID_32DA_MI_01#8_1dd92e8a_0_0000#'

End of list

H:\Hyperspin\Games\MAME>

Here the config the app make:
(see file2.txt)

As can be seen, there is a problem and although the pad is not connected, it's still is assigning controls to mame. It assigns the same controls as the xbox360 pad that is connected.

Anyone knows some way to solve it? because if i just connect one pad, i control with it the player 3 and 4 at the same time.

Greetings and thanks for the app and for the help!.
« Last Edit: June 11, 2013, 11:32:31 am by chipywinie »

MydknyteStyrm

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 331
  • Last login:March 20, 2024, 12:19:41 pm
  • Makeup FX Gamer
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #116 on: June 11, 2013, 05:41:02 pm »
Anyone in here able to hook this up with Hyperspin? I'm having an issue getting the front end to run the exe. My settings on HS are


Startup Program: E:\ControllerRemap.exe
 Params: -ctrlr MyArcade.cfg
 Winstate: HIDDEN

 According to the HS Log, here is what I have

 09:56:31 AM | HyperSpin Started
 09:56:31 AM | Going FullScreen
 09:56:31 AM | Checking for updates
 09:56:31 AM | Update Check Complete
 09:56:31 AM | Startup program: ControllerRemap.exe
 09:56:31 AM | Startup params: -ctrlr MyArcade.cfg
 09:56:31 AM | Working directory: E:\
 09:56:31 AM | Window State: HIDDEN
 09:56:31 AM | Launching ControllerRemap.exe
 09:56:31 AM | Command Line is ControllerRemap.exe -ctrlr MyArcade.cfg
 09:56:31 AM | Playing intro video
 09:56:32 AM | Menu Mode is multi
 09:56:32 AM | Loading Main Menu.xml
 09:56:32 AM | Main Menu.xml successfully loaded
 09:56:33 AM | Main Menu wheel loaded successfully
 09:56:35 AM | Loading MAME.xml
 09:56:35 AM | Main Menu.xml successfully loaded
 09:56:35 AM | MAME wheel loaded successfully
 09:56:37 AM | Launching Game
 09:56:37 AM | Running in normal rom mode
 09:56:37 AM | Excecutable is mame.exe
 09:56:37 AM | Command Line is: "E:\mame.exe" term2.zip
 09:56:48 AM | Loading Main Menu.xml
 09:56:48 AM | Main Menu.xml successfully loaded
 09:56:49 AM | Main Menu wheel loaded successfully
 09:56:51 AM | Exit program unavailable
 09:56:51 AM | Quiting Hyperspin
 09:56:51 AM | Bye!

 I thought it seemed legit, but the correct code to put in a DOS window with ControllerRemap is
 mame term2 -ctrlr MyArcade.cfg

 Any ideas?



« Last Edit: June 12, 2013, 05:44:16 pm by MydknyteStyrm »

thurmansevolution

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16
  • Last login:September 14, 2013, 07:19:53 pm
  • I want to build my own arcade controls!
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #117 on: June 13, 2013, 11:19:59 am »
*Bump*

MydknyteStyrm

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 331
  • Last login:March 20, 2024, 12:19:41 pm
  • Makeup FX Gamer
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #118 on: June 13, 2013, 03:16:39 pm »
After a few cups of coffee and staring at the code, I realized what the problem was.

ControllerRemap.exe should be in the Startup programs for Hyperspin, but with no parameters.(I had previously put the parameter under the Startup program)

Under the MAME wheel, the parameters should be set similar to the DOS setup
-ctrlr MyArcade (with no cfg on the end)

I also removed the ".zip" parameter from HS, and presto, the game works perfectly now.

Check your log.txt in Hyperspin, it will show you how the system is reading the configurations. I made HS do exactly what a DOS prompt would do.

Hope this helps anyone who is attempting the same!

thurmansevolution

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16
  • Last login:September 14, 2013, 07:19:53 pm
  • I want to build my own arcade controls!
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #119 on: June 14, 2013, 01:05:56 pm »
I finally found what the main issue was! :)

I did delete the default.cfg file, but didn't delete any other cfg files that were in that folder (each of my cfg files had custom inputs of its own, which were overriding MyArcade.cfg). Everything works like a charm now! :)

I do have a question though of how ControllerRemap operates. (Just outta curiosity) When you use "/Remap" and enter the path for the MyArcade file, does the utility "remember" the path of the cfg file, so it could alter the inputs before mame starts if the enumeration changed?

Oh, and also, I would like to attempt to build a GUI for this...kinda a little "helper" lol...when I have some spare time. Would it be ok for me to do this?

Thanks!!

LC