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
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 45033 times)

0 Members and 1 Guest are viewing this topic.

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Fourth Beta Version of ControllerRemap now available. (Version 0.0.10)

NOTE: I've gotten several reports of version 0.0.9 throwing virus alerts. I've rebuilt version 0.0.10, scanned with NOD32 locally as well as with a couple online scanners, and posted it in a ZIP file with a TXT extension, just in case.

When you download, just rename the file to a ZIP file to extract.

If anyone still gets a virus alert, please let me know (PM or respond on this thread).

++++++++++++++++++++++
V0.0.11 What's new
Fixed a bug in handling aliased controllers when the controller is not currently connected to the machine.
Now, that controllers mappings will be ignored and not written to the config file.


++++++++++++++++++++++
V0.0.10 What's new
Added support for MESS KEYPAD entries.

++++++++++++++++++++++
V0.0.9 What's new
Fixed problem with PORT entries that have more than 1 "newseq" child element. Previously, the children wouldn't
be properly copied to the remapped section.
Also, any additional attributes would be duplicated either. Both should now work properly.
This is particularly important for things like steering wheels that make use of the "increment" and "decrement" type newseq entries. Thanks to ArcadeBliss for pointing this out!


++++++++++++++++++++++
V0.0.8 What's new
Fixed minor issue with the command line /SAVE command


++++++++++++++++++++++
V0.0.7 What's new
Added support for GUNCODE input elements. Before, GUNCODE elements were simply ignored.
Added GUNCODE sample to the Sample.cfg file (and updated the PDF documentation)


++++++++++++++++++++++
V0.0.6 What's new
Fixed the Sample.cfg file to be correct (and match the PDF documentation)
Fixed so that you can specify a partial controller ID (any amount of ID actually, starting at the beginning) and the program will first attempt to match on the +entire+ id, and if that fails, will then attempt to match the whatever portion of the ID you've specified against the actual controller ID.
Ugh, that sounds terrible.
Here's an example:

This is a controller element with the FULL ENTIRE controller id specified:
    <controlleralias>
        <id>HID#Vid_1241_Pid_1111#b_2eabd86_0_00000#</id>
        <alias>Top Trackball</alias>
    </controlleralias>

Notice that "_0_00000#" at the end? That identifies which USB port the controller is plugged into. Since that port number can change if you move the device to a different port, ControllerRemap might not find it the next time.

Instead, you can now specify any amount of the ID, beginning at the start. So, I might set up the configuration like this instead:

    <controlleralias>
        <id>HID#Vid_1241_Pid_1111#b_2eabd86</id>
        <alias>Top Trackball</alias>
    </controlleralias>

When ControllerRemap sees the shortened version and attempts to match it against the complete ID of the installed device, it won't match.

Once it's searched all devices in that manner, it goes back and checks each device ID to see if it +begins with+ the specified ID. If it finds a match this way, the device is matched up just like before.

Technically, this does mean you could specify something silly like:
    <controlleralias>
        <id>HID#Vid_12
        <alias>Top Trackball</alias>
    </controlleralias>

That ID is likely too short to uniquely identify a single device, so your result will probably not be what you want.

Just use as much of the device ID as what looks to uniquely identify the device and you should be good.
++++++++++++++++++++++


Let me start by saying this thing is serious beta at this point. Standard disclaimers apply (It work on my machine, blah blah).

You'll need the .net runtime 3.5. But otherwise, that should be it.

It does require 2 DirectX dlls, but they are part of the executable and get extracted automatically as necessary. Nothing to do there.
Though wherever you run it from will need WRITE rights.

Extract the ZIP into a folder somewhere.

There's a sample CFG file, the documentation as a PDF, and the EXE.

It's basically a simple command line app. Run ControllerRemap /? for options.

And check out the help for a quick start guide, as well as the full docs.

Let me know if you run into anything, have questions, suggestions, can't get it to work, think the docs suck, etc.





----- OLD MESSAGE BELOW  -------
I've been working out the kinks on a little utility I'm calling ControllerRemap.

Essentially, it's my take on trying to solve the problem of what happens when you have a cab that supports USB input devices that might be disconnected or reconnected in various combinations at various times.

Many games support the concept of a JoystickID (and you can use another utility called JoyIDs to set those id's easily). The idea being that it assigns an ID to a joystick and that ID persists for that particular joystick, even if it's unplugged, other devices are plugged in and then the original device is reconnected.

However, from what I can tell of Mame, it doesn't support Joystick IDs. It appears that mame simply enumerates the devices current connected to the system when Mame is run, and subsequently uses those numbers in all the CFG and controller files it reads.

And since windows enumerates USB devices by Vendor ID, and since the vendor ID is essentially a random hex number, there's no telling where specific devices will end up in the enumeration order.

Soooo.. If you have 2 U360's, and you map them in MAME as Joystick 1 and 2, but then you plug in a game pad and it happens to sort BEFORE the U360s, mame will now think they're sticks 2 and 3.

I've seen plenty of projects around that appear to make use of disconnectable devices, but I've never seen any info on how to get mame to play reasonably well with them, without having to manually remap devices constantly.

At any rate, ControllerRemap, essentially allows you to define mame port mappings connected specifically to a controller by it's unique ID, including joysticks and RawMouse devices (like multiple trackballs or spinners if you have them).

It also allows you to set those maps for specific "systems" (ie drivers, or BIOS's, or specific games), just like the mame controller and CFG files currently allow, but with the added benefit of being able to specifically indicate which controllers map to what mame ports.

So, right before you run MAME, you run ControllerRemap, which basically just looks at the current controllers installed in the system and rebuilds the <INPUT> sections in your controller file to match what you +actually+ have installed.



Would anyone else find this concept useful? Have I completely missed some capability of Mame that would provide for this?

Right now the code is a little rough around the edges, but if there's interest, I could clean it up a bit and make it publicly available.

Just wanted to gauge interest (and see if I've totally wasted my time for a feature that Mame already has  ::) )

« Last Edit: July 11, 2013, 07:49:03 am by drventure »

Blanka

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2248
    • Retro Space
Re: New ControllerRemap utility, would anyone else find it useful?
« Reply #1 on: January 23, 2011, 01:22:33 am »
Sounds cool (if it was on mac)!
Maybe include remapping of keys as well. We have a tool on mac that does this, but I don't know if it exists for Windows. It allows you to map U360 to keyboard keypresses, U360 to mouse coordinates, mouse to keyboard mapping, adding macro's to any key, well pretty much mess up any controller to do anything else.

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, would anyone else find it useful?
« Reply #2 on: January 23, 2011, 10:12:43 am »
Unless I'm mistaken, JoyToKey and XPadder already do those sorts of things for Windows.

So far, any way, I haven't needed to use anything like that (that actually converts joystick input to keyboard presses) with Mame, it seems to handle all the various input devices I have pretty seamlessly.

However, I could see a small benefit with a utility like that. Since it would convert u360 stick movements to keypresses, Mame wouldn't have to have the sticks mapped at all, it would just use it's default keyboard mappings. Assuming JoyToKey or XPadder used JoystickID's to connect with specific joysticks, no matter when they were connected, that might work well.

But.... If you did want to play games using an Analog stick in mame, you might still have problems.

My little utility doesn't actually take input from any of the devices. It literally rewrites the Mame CFG controller file and exits. That's it.

SammyWI

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 356
Re: New ControllerRemap utility, would anyone else find it useful?
« Reply #3 on: January 23, 2011, 10:57:00 am »
Sounds like a useful tool.  I do disconnect my stand alone CP occasionally and remapping every time is a pain.

I've never needed joytokey in MAME, but I do use it for Daphne with a U360.  In that case, I don't think I've had any issues with unplugging things.  But it's been a while.

Cananas

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 299
  • and the seventh day... PacMan was created
Re: New ControllerRemap utility, would anyone else find it useful?
« Reply #4 on: January 23, 2011, 11:07:16 am »
Yes. It seems very interesting tool.

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, would anyone else find it useful?
« Reply #5 on: January 23, 2011, 11:50:03 am »
I haven't worked with Daphne yet, but I believe JoyToKey makes use of JoystickIDs, which typically won't change even if you unplug the controller, plug it back in later, and plug other controllers in in conjunction with it. BUT to set JoystickID's effectively, you really need to grab a copy of JoyIDs.

But, it sounds like there's enough interest that I'll go ahead and clean this up and put it up online for some peer review  :)

I'll post back when I've got it a little farther along

Thanks for the comments, guys!

Bender

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1919
    • Happ to Tron Conversion tutorial
Re: New ControllerRemap utility, would anyone else find it useful?
« Reply #6 on: January 23, 2011, 12:30:08 pm »
This sounds great!
I have a big project for down the road that this is going to be essential for, I have always been concerned about how I'd over come disconnecting and reconnecting devices and not have the MAME controls all f*ed up
Keep us posted!
« Last Edit: January 23, 2011, 12:31:48 pm by Bender »

NickG

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 586
  • Dig.
    • My Projects Page
Re: New ControllerRemap utility, would anyone else find it useful?
« Reply #7 on: January 23, 2011, 03:11:07 pm »
+1 interested party

animatorJustin

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 59
Re: New ControllerRemap utility, would anyone else find it useful?
« Reply #8 on: January 23, 2011, 09:57:18 pm »
+1 very, very interested. Trying to get wireless xbox controllers to work... :banghead: 

Bender

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1919
    • Happ to Tron Conversion tutorial
Re: New ControllerRemap utility, would anyone else find it useful?
« Reply #9 on: January 23, 2011, 10:01:07 pm »
+1 very, very interested. Trying to get wireless xbox controllers to work... :banghead: 

oh yeah, that too, I've given up on that cause when the computer doesn't detect the controller all my settings are off in mame

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, would anyone else find it useful?
« Reply #10 on: January 23, 2011, 10:16:27 pm »
This should definitely help to rectify those situations.

That's the main reason I ended up writing it. If I plugged in my xbox drums and PS2 guitar controllers, and then didn't think to unplug them before running mame, mame was all messed up.

And lets say I want to use an AIMtrak. It won't be plugged in all the time, but when it is, it'll suffer the same problems, I'm sure.

I should be able to post a workable version here in the next few days. This gizmo's a WHOLE LOT simpler than the Engine18 plugin  ::)

Stay tuned!

SavannahLion

  • Wiki Contributor
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5986
Re: New ControllerRemap utility, would anyone else find it useful?
« Reply #11 on: January 24, 2011, 10:34:25 am »
+1

bkenobi

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1666
Re: New ControllerRemap utility, would anyone else find it useful?
« Reply #12 on: January 24, 2011, 12:03:22 pm »
Does this sound similar (not the same) to CFG Magician?  It can remap controls similar to what you are describing (I think).

markronz

  • We traced the call, and it came from....INSIDE YOUR ARCADE MACHINE!
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 819
  • Game on!
Re: New ControllerRemap utility, would anyone else find it useful?
« Reply #13 on: January 24, 2011, 02:53:55 pm »
Plus one for the interest.

My current project does not have a need for such a thing, however, much like you're describing, some day I do plan on adding other controllers, guitars and etc, which would be plugged and unplugged on an as needed basis.   I've often wondered how I would handle such a scenario and think a tool like this would be AMAZING to solve that issue! 

vault

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
Re: New ControllerRemap utility, would anyone else find it useful?
« Reply #14 on: January 25, 2011, 05:27:03 pm »
+1 for interest.
I am building a cabinet with an embedded U360.  I need to plug in a Logitech gamepad occasionally to support a second player but whenever I do that the Logitech device shows up as Joy1 in mame...
I am using Mala as a frontend so I would be really interested in seeing your code eventually being ported as a Mala plugin. (by the way Mala does not get confused with the usb changes, I suppose it is using the IDs correctly)
I am only interested in overwriting the default.cfg file prior to mame start. How would you recommend that your code gets executed before mame? (a wrapper script around the mame executable?)
If I get this right your utility would detect whenever I connect the Logitech gamepad and then remap Player1 to use Joy2 (i.e. U360) amd Player2 to use Joy1(i.e. Logitech).
When just the U360 is present then the mapping should be Player1 to use Joy1 (U360) and Player2 none.
I hope we have your tool soon...

P.S. I have attached the U360 on my panel in a reverse direction because of problems with space so now I have the U360 joystick mapped in reverse in Mame (i.e. Joy1 up is actually U360 down). I hope your tool is flexible enough to cater for this as well...

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, Now available (Serious Beta!)
« Reply #15 on: January 25, 2011, 10:57:48 pm »
@bkenobi

I haven't checked out CFGMagician. Sounds like I need to! Thanks

@Vault

The wrapper idea is exactly right. I just start a BAT file from Mala, and in the BAT file, I run ControllerRemap, and then start Mame.

I've actually got some code in ControllerRemap to echo all command line parms down to mame and launch it automatically, but i haven't had time to fully test that feature out, so it's not documented yet.

Check out the top post on this thread, I've updated it with an attachment for the first beta release of ControllerRemap.

Let me know what you think!

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, Now available (Serious Beta!)
« Reply #16 on: January 25, 2011, 11:05:14 pm »
Answering the Question about CFGMagician. I just checked out the website and docs. It looks like it's more of a CFG Generator that run based on lists of games. I'm still not quite sure about it, as I've never really noticed that I've needed to set up configs for specific games. Usually, just defining the DEFAULT mappings works for me.

ControllerRemap wouldn't really work well with CFGMagician, mainly because ControllerRemap is intended to be used against a single CFG file located in Mame's CTRLR folder.

But that ctrlr file can contain input port mappings for any number of games, bios's, and drivers as well as the DEFAULT set of mappings.

So in theory, you COULD run CFGMagician to generate various CFG files that you need, and then move their contents into your controller CFG file.

But it'd still be a pretty manual process at this point.

vault

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
Re: New ControllerRemap utility, Now available (Serious Beta!)
« Reply #17 on: January 26, 2011, 10:50:41 am »
Absolutely amazing work !!!.
And it works too. I just finished testing it. I struggled a bit until I realized I had to delete my existing cfg\default.cfg because it was overwriting everything else.
After that the remapping works like a charm.
My startMame.cmd file that I placed in C:\mame0138 consists of just 3 lines. The % vars are for Mala to send the romname and sometimes other staff like -triplebuffer

@echo off
C:\utilities\ControllerRemap.exe /Remap:C:\mame0138\ctrlr\MikesArcade.cfg > NUL
call C:\mame0138\mame.exe %1 %2 %3 %4 -ctrlr MikesArcade
« Last Edit: January 26, 2011, 01:02:33 pm by vault »

vault

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
Re: New ControllerRemap utility, Now available (Serious Beta!)
« Reply #18 on: January 26, 2011, 11:23:09 am »
In fact just to play it safe and avoid any interoperability issues between controllers I just put the default.cfg file back in the config folder.
However this time I removed all the ports that ControllerRemap is handling and I am using it for all the rest of the ports.
This way I can set to None whatever defaults Mame comes with that can cause trouble while playing.

What would be great is if ControllerRemap could automatically detect the conflicts in the cfg\default.cfg and simply remove from it the ports that itself is trying to remap.
« Last Edit: January 26, 2011, 01:52:40 pm by vault »

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, Now available (Serious Beta!)
« Reply #19 on: January 26, 2011, 09:46:31 pm »
Great news! Thanks for letting me know.

Yeah, the default file can interfere with the ctrlr file if there are conflicting port assignments. Mame doesn't seem to combine them, it just reads them in a certain order and the assignments it reads later overwrite the earlier read assigments.

I just set all my assignments up in my ctrlr file and blanked out the default.cfg.

But, you could also set up a few constant keyboard mappings in your default and not worry about them in the ctrlr file.

Interesting idea about altering  the default.cfg file... I'm not sure. If you set those ports deliberately in default.cfg, they could get wiped out inadvertently.

At any rate, glad to hear it's working for you!

MacGyver

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 281
Re: New ControllerRemap utility, Now available (Serious Beta!)
« Reply #20 on: March 30, 2011, 04:51:05 am »
Drventure, thank you. This utility make those of us with 5+ usb devices be able to spend more time playing games instead of spending time resetting them up.
You should know there is an error in your PDF on the configuration file layout, the order has it as <system=default><input><system=gamespecific><input></input></system></input></system>, when I think it is supposed to be <system=default><input></input></system><system=gamespecific><input></input></system>.

The utility works perfectly unless the USB device is changed to a different port, when this happens the sub IDs change, and you have to re-create the alias portion again with the new sub IDs. 
Is there a way to have ControllerRemap match from left to right only the portion of the ID in the alias ID and ignore anything longer then the alias ID that it detects from windows?
Basically give us the ability to ignore the sub IDs if we want?  So that an Aimtrak showing up as VEN_1234&DEV1602&0001_34fedsaa could simply have VEN_1234&DEV1602 in the .cfg file under the alias ID, so that moving the device to a different port won't require a "ControllerRemap /list" and editing the new sub IDs into the .cfg?  The Vendor and Device portion should be sufficient, and doesn't ever change no matter what port you change it to.

I will use your wonderful utility as is when I finally build my cabinet, but people with control panel only setups (like mine currently is until I build my cabinet) sometimes use different USB ports when they plug them in, and that requires me to edit the .cfg.

Thanks again, it was a brilliant idea, and was defiantly needed. :applaud:

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, Now available (Serious Beta!)
« Reply #21 on: March 30, 2011, 07:52:41 am »
@McGyver

Thanks for the comments. I'll check on the PDF get an update posted. It's entirely possible I flubbed the docs there  :-[

As for the subid bit, I never noticed that while I was working on it, but hell yeah, that should be an easy fix and what you describe is exactly how I'd want it to work in that situation (plugging USB devices into different ports). Thanks for the heads up. Just monitor this thread for updates. I'll post back here once I've got the fix done.

VanillaGorilla

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 478
  • Coin detected in pocket
Re: New ControllerRemap utility, Now available (Serious Beta!)
« Reply #22 on: March 30, 2011, 09:17:30 am »
Awesome Idea. Long time coming, too. Cant wait to check it out this weekend! Now I wont have panel swap anxiety anymore ;)

MacGyver

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 281
Re: New ControllerRemap utility, Now available (Serious Beta!)
« Reply #23 on: March 30, 2011, 11:01:43 am »
Cool. I will keep checking back.  ;D
Also, I was wrong about the tag order error, it's not in the PDF, it's in the Sample.cfg that was included, at the very end:
Code: [Select]
    </controller>
    <!-- ###################################################
         ACTUAL INPUT MAPPING STARTS HERE
         DO NOT actually put anything in this section.
         It is completely cleared and regenerated!
         ###################################################
    -->
    <input>
      <!-- ###################################################
           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>
    </input>
  </system>
</mameconfig>

The PDF is correct, I remember now, I couldn't get the .cfg file I made to work because I was going solely off the Sample.cfg, then read the through the PDF and decided the PDF must be correct, and fixed the Sample to match the PDF.  It just took a little longer to figure out which one was correct.

Again, thanks for a great utility.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15662
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: New ControllerRemap utility, Now available (Serious Beta!)
« Reply #24 on: March 30, 2011, 01:00:14 pm »
drventure: 

I know nobody likes to hear it when they've done a ton of work, but I'm pretty sure there is a better way.  I remember reading that mame supports generic joystick flags, as well as device specific joystick flags.  In other words insted of say "JOYCODE_YAXIS_UP" you can put "MADCATZ_GAMEPAD_YAXIS_UP" and this solves the enumeration issue most of the time. 

Keep in mind I've never actually used this feature before, so I can't tell you if, how or how well it works. 

I think the utility is still needed though because when changing inputs inside mame, it uses the generic flags.  You might use this to alter how your program works though as it could simply convert the generic flags to specific flags without all the swapping. 

MacGyver

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 281
Re: New ControllerRemap utility, Now available (Serious Beta!)
« Reply #25 on: March 30, 2011, 04:08:13 pm »
Any specifics Howard_Casto?  I looked for about an hour, and all I found were posts of people describing the problem, but not understanding why.  I understand why, and the fact mame doesn't lock the vendor & device id to "mouse #" by default is surprising. For me the "MADCATZ_GAMEPAD_YAXIS_UP" setting would be ok for the aimtraks, something like "ATRAK Device #1_YAXIS_UP" most likely, but my spinners and trackball don't enumerate as joysticks, and would probably never keep their "mouse #" moniker after a reboot or being unplugged.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15662
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: New ControllerRemap utility, Now available (Serious Beta!)
« Reply #26 on: March 30, 2011, 05:48:44 pm »
Any specifics Howard_Casto?  I looked for about an hour, and all I found were posts of people describing the problem, but not understanding why.  I understand why, and the fact mame doesn't lock the vendor & device id to "mouse #" by default is surprising. For me the "MADCATZ_GAMEPAD_YAXIS_UP" setting would be ok for the aimtraks, something like "ATRAK Device #1_YAXIS_UP" most likely, but my spinners and trackball don't enumerate as joysticks, and would probably never keep their "mouse #" moniker after a reboot or being unplugged.


It's been a year or two since I ran across it.  I actually found it while mucking about in the source code so afaik it's an undocumented feature.  I'll try to find an example for you guys later this week. 

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15662
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: New ControllerRemap utility, Now available (Serious Beta!)
« Reply #27 on: March 30, 2011, 07:11:43 pm »
Hmm.. it looks like it's been removed.  There are remnants of it there, but at the top of the input.c file it reads:

Code: [Select]
To do:
        * auto-selecting joystick configs
        * per-joystick configs?
        * test half-axis selections
        * add input test menu
        * get rid of osd_customize_inputport_list
But you know, it wouldn't be terribly hard to implement the use of joystick ids.  The function for initalizing dx devices simply enumerates them in the order to which they are found, after that the variables are unchanged until mame exits.  All that would have to be done is re-arrange the enumeration function to work via joyid.  It would be helpful to get some other people to look at this, but I think it is quite possible to fix this issue with mame and submit it to the mame devs.

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, Now available (Serious Beta!)
« Reply #28 on: March 30, 2011, 07:39:47 pm »
Hey Howard

Yeah, I noticed something in the source (I'd been able to hone in on the input.c file), but from what it looked like to me, +everything+ in mame keyed off the ordinal of the enumerated devices, and the device info was simply stored in an array, in the enumerated order, which seemed like it'd make reworking that quite challenging, but, I'm definitely no MameDev, and I didn't spend a whole lot of time investigating either. The bigger prob is that I don't think you'd be able to just change the way the sticks are stored in the array, because you'd need to continue to support BOTH methods of identifying devices for backwards compat (otherwise peoples config files would get nuked). Maybe that's not a big concern though....

Using the Joystick ID's would be fine for sticks, but there's still an issue with Mice (ie trackballs and spinners) that are USB devices but aren't joysticks and can still move around when devices are plugged and unplugged. I suspect a solution that just uses stick ID's wouldn't quite cover the bases.

But, I'm happy to make my code open source if that'd help anyone. I'm not sure it would (it's all .net), and to be honest, I doubt I'm going to have any time to much around in Mame internals any time soon, other than just really simple tweaks. Which sucks, cause I'd like to  :(

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, Now available (Serious Beta!)
« Reply #29 on: March 30, 2011, 07:52:50 pm »
And Howard.

No worries about "a better way". I'm always open to a better way!

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, Now available (Serious Beta!)
« Reply #30 on: March 30, 2011, 08:08:07 pm »
@Mcgyver.

I'm thinking this.

You specify a device ID (or the first PART of a device ID) in the config file.

When I search, i try to match the full ID, if that doesn't work, go back through and match with a "begins with" logic.

Assuming the device id's are unique from the beginning that should work.

Alternatively, I could support a wildcard match....

Hmmm, that might work better, actually....

I'll look into it.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15662
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: New ControllerRemap utility, Now available (Serious Beta!)
« Reply #31 on: March 30, 2011, 11:56:58 pm »
Well they had started to implement it years ago if I remember correctly, but I think that was just around the time that ctrlr and cfg files switched from being ini based to xml based, so I'm guessing it got lost in the shuffle. 

I'm not sure if stright joystick ids would be the best solution anyway, as you said... multi mice and all that.  You wouldn't change the enumeration of the joystick, but rather store more info about it in the joylist array and use it as search flags when reading in the ctrlr file (which is only done once, so speed isn't an issue).  A specific entry would look something like this: 

Code: [Select]
<port type="P1_JOYSTICK_UP">
              <newseq type="standard" devname="MADCATZ Xbox 360 Controller" id="1">
              JOYCODE_1_YAXIS_DOWN_SWITCH</newseq>
 </port>

Note the two new flags... both of which would be optional and most likely have to be manually inserted. 

DevName would represent the device name, which mame already parses for verbose printout.  Id would represent the joystick id or device id respectively.  When mame parses a xml file, if it finds a devname or id entry, it ignores the number in the joycode flag and does a search through the array to find the device with the matching devname and/or id.  If devname and id are missing, it handles the binding normally.  Joystick id probably wouldn't be the best id to use anyway, the device address might be better.


Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15662
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: New ControllerRemap utility, 3/30/11 update available (Version 0.0.6)
« Reply #32 on: March 31, 2011, 12:17:08 am »
I did a little bit of reasearch about joystickIDs because I realized that aside from a preferred device, they aren't used in vista/win 7 anymore. 
Apparently joystick ids are created just how mame does it, by enumerating all joysticks.  The only difference is that the device name can be used to override this enumeration. 

HOWEVER, joystick ids stil can't tell two identical devices apart.  If you had 4 identical xbox 360 controllers and a flightstick, for example....

You could put the flightstick anywhere in the order you want, but when it comes to the 360 pads, the first one plugged in is the first, ect.....

The way you are doing it with the device address is the ONLY way to be certain of which device it is, and only then if you plug it into the same port.

I don't think this is an issue anyway, I just thought it might be interesting to note why mame didn't use joyids. 

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 3/30/11 update available (Version 0.0.6)
« Reply #33 on: March 31, 2011, 12:15:26 pm »
Hi Howard

Thanks for the info. Yeah, I searched through all the stuff I could find about USB device ID's and when you have two identical devices, they really are identical. There's just not a lot to go on to uniquely id them.

still, i like the idea of the ability to specify a partial ID and have it match, in those cases where the partial ID still uniquely ID's a device.

But thanks for the extra info!

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 3/30/11 update available (Version 0.0.6)
« Reply #34 on: March 31, 2011, 12:17:19 pm »
@Macgyver

Just in case you didn't see the root post, i've updated the EXE (and the sample.cfg file) with the new capability. the PDF is updated as well with some example info.

Let me know if it works any better for you. It was a quick mod while my daughter was in the tub, so it's entirely possible I've missed a bit, but, as usual, it works on my machine  ;)

MacGyver

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 281
Re: New ControllerRemap utility, 3/30/11 update available (Version 0.0.6)
« Reply #35 on: March 31, 2011, 12:43:00 pm »
I tried the new one, works absolutely perfectly. :) I bounced the guns and spinners all over with the shortened IDs, they work perfectly.  Everyone should use this program, at least until they fix the usb device issues with mame for windows. 
I cut back my utrak, aimtraks, and spinners to just the VEN and DEV, and they are picked up everywhere and mapped correctly in mame everytime, but people with usb gamepads probably will want to use the whole ID.

Thank you again.  :applaud:

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 3/30/11 update available (Version 0.0.6)
« Reply #36 on: March 31, 2011, 01:42:54 pm »
Great. Glad to hear it's working!

Nephasth

  • Guest
  • Trade Count: (0)
Re: New ControllerRemap utility, 3/30/11 update available (Version 0.0.6)
« Reply #37 on: March 31, 2011, 06:31:18 pm »
Glad I finally read through this thread. I thought this utility was like Xpadder, "remap" threw me off. I've been thinking of a solution for this problem since I read about it a few months back. What I came up with was to keep all USB controllers plugged in all the time (simple hardware solution). And to keep everything neat and organized I wanted to use retractable cable reels, but damn those are expensive. It will still be many moons before I will actually need to worry about this problem, but I will definitely be using this. :applaud:

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 3/30/11 update available (Version 0.0.6)
« Reply #38 on: March 31, 2011, 07:11:00 pm »
Wow. Those are cool, but 150$  :dizzy:

Ugh.

Well, one day, I might dust off my C knowledge and go hacking through mame to make the mods and try to get it accepted, but I'd hate to do the work and then find that it's not the sort of thing the mame devs want in the code. And I wouldn't want to have to leave it as a patch.

So... I think my little utility will work right nice for now   :)

If you can leave everything hooked, that's probably easiest, though!

ArcadeBliss

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 161
Re: New ControllerRemap utility, 3/30/11 update available (Version 0.0.6)
« Reply #39 on: April 01, 2011, 01:32:02 am »
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

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 3/30/11 update available (Version 0.0.6)
« Reply #40 on: April 01, 2011, 07:41:46 am »
Cool.

You'll probably have to forcibly kill and restart ledblinky to get it to recognize the change. Arzoo could probably help with that.

NipRing

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 142
  • I love cats but i just cant eat a whole one myself
Re: New ControllerRemap utility, 3/30/11 update available (Version 0.0.6)
« Reply #41 on: April 01, 2011, 09:06:11 pm »
I'm sure everyone using this/talking about it knows more about PCs than me, and i'm sorry i dont know more. I downloaded it, opened the folder, and there was ControllerRemap exe, and instruction pdf, and a sample cfg. I started reading the instruction pdf, created a new text doc with notepad, copied the cfg text portion from the inst. to the doc, named it and saved it. When i go to run the CR exe, it opens and closes in an instant. Every time. However two dll files showed up, as well as remap.lastrun. Am i doing something wrong? I didnt even get to run the ControllerRemap /list  :-\  damn i wish i new more code type stuff  ???

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 3/30/11 update available (Version 0.0.6)
« Reply #42 on: April 01, 2011, 10:23:00 pm »
Hey Nipring, Sorry you're having troubles.

Well, if you're getting the 2 dll's extracted, and the lastrun file generated, it means the app is at least running (so you've got .net installed etc).

So that's good.

Open a DOS box, and try running it from there (it's a command line tool, so dbl clicking it from explorer won't do you much good).

You should get a title/version printed out.

then, in the dos box, type "controllerremap /list" and press enter.

That should generate the initial list that shows the devices currently in your system.

Again, there's no GUI for this tool (at least not yet) so you'll have to deal with the command line and dos boxes to get it going. Primitive and crude, but, it's also free...

From there, start with a REALLY simple config file, just like one controller and one mapping. run it and get it to properly update the CFG file.

then you can expand the CFG, add more to it, and define the additional controllers, and finally wrap it up by adding it to a bat file that runs controllerremap, then MAME.

My instructs probably aren't the greatest in the world (I'm a developer, not a tech writer  :) ), but I'll do what I can to help.

It'd be nice to put a nice GUI front end on it for config purposes, but to do so would almost require reimplementing MAME's config stuff, and I just don't have time for that right now.

MacGyver

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 281
Re: New ControllerRemap utility, 3/30/11 update available (Version 0.0.6)
« Reply #43 on: April 04, 2011, 01:27:22 am »
Yeah drventure, I think the nature of the program and the configuration creating part are going to be a challenge for non-technicians.  Most people that will benefit from this don't even know that they need it, or why the problem is happening.  I think until you make a gui that basically outputs a mame.exe replacement batch file, some people are going to have trouble.  I think you might need to change the name of this post to something like:
 "MAME USB device Remapper (for replacing instances of MOUSE ? that have been moved to a different MOUSE # after a reboot or being plugged into a different port)"
That's about as small as I could make it.  ;D

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 3/30/11 update available (Version 0.0.6)
« Reply #44 on: April 04, 2011, 07:50:56 am »
I'd put some thought into somehow possibly reading the EXISTING config (assuming that it's correct as of the point you initially run the program) and using that as the basis for creating the mapping entries.

Sort of like...
1 Read existing config file
2 check mouse and joystick port numbers
3 match them up to existing devices
4 write controller entries back into the config such that those devices will always get mapped that way from then on.

But, I was a bit concerned that there's no good way for the program to know whether what it comes up with is correct, and taking out the requirement to learn a little bit of how to set things up would just make it that much more difficult to resolve issues that would happen as a result of trying to automatically handle it.

If anyone's got any ideas, I'm all ears! It would be nice to simplify it a bit.

MacGyver

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 281
Re: New ControllerRemap utility, 3/30/11 update available (Version 0.0.6)
« Reply #45 on: April 04, 2011, 08:11:22 am »
You could try to go at it from the point of view of a "Mame USB lock in" utility.  Have the user set up their settings in default.cfg manually or via the gui in Mame, then when the user runs the "Lock" utility, it scans the default.cfg and the USB ports, matches them up, and builds the ctrl .cfg file.  Then the user can run the "Set" program after a reboot or before Mame launches, and it will just fix the USB mappings.  Depending on how bored you are, you could include a flag to scan and build the specific game.cfg into the ctrl .cfg when the "Lock" program is run.

I have no problem with how your utility works right now, and don't know why Mame doesn't already deal with how USB devices like to jump around in Windows.  If you are wanting to help people out, I don't think it can get any simpler than, "Mame works fine right now; Lock, Play.  Mame is broken; Set, Play."

Again, thanks for an already great fix.  :cheers:

kronic24601

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 285
  • Evil Arcade Monkey Strikes Again!
Re: New ControllerRemap utility, 3/30/11 update available (Version 0.0.6)
« Reply #46 on: April 04, 2011, 09:11:26 pm »
Just found this thread. I am looking forward to testing this out soon. I've been really annoyed at having to reset USB controller items due to my swappable control panel so I'm really hoping this works :)

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 3/30/11 update available (Version 0.0.6)
« Reply #47 on: April 04, 2011, 09:27:20 pm »
@Kronic

Let me know how it works for you!


Damonator

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 3
Re: New ControllerRemap utility, 3/30/11 update available (Version 0.0.6)
« Reply #48 on: June 05, 2011, 05:00:19 pm »
This utility is working great for my spinner, trackball and mouse - but not for my lightguns.  My condensed configuration file is:

Code: [Select]
<mameconfig version="10">
  <controlleralias>
    <id>HID#VID_061C_PID_AA00#7_35df86d5_0_0000#</id>
    <alias>Lightgun1</alias>
  </controlleralias>
  <system name="default">
    <controller id="Lightgun1">
      <input>
        <port type="P1_LIGHTGUN_X">
          <newseq type="standard">
                    GUNCODE_XAXIS
                </newseq>
        </port>
        <port type="P1_LIGHTGUN_Y">
          <newseq type="standard">
                    GUNCODE_YAXIS
                </newseq>
        </port>
      </input>
    </controller>
    <input>
      <port type="P1_LIGHTGUN_X">
        <newseq type="standard">
                    GUNCODE_XAXIS
                </newseq>
      </port>
      <port type="P1_LIGHTGUN_Y">
        <newseq type="standard">
                    GUNCODE_YAXIS
                </newseq>
      </port>
    </input>
  </system>
</mameconfig>

When I perform the remap, the generated input section does not have the proper lightgun number in the newseq tags - ie the text remains "GUNCODE_XAXIS" instead of "GUNCODE_3_XAXIS".  In the controller configuration, if I use "MOUSECODE_XAXIS" instead of "GUNCODE_XAXIS", it properly generates a "MOUSECODE_3_XAXIS" in the input section.

Am I doing something wrong or is it not recognizing the GUNCODE_XXX text?

Thanks for the great utility!

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 3/30/11 update available (Version 0.0.6)
« Reply #49 on: June 05, 2011, 05:49:14 pm »
@Damonator

Doh! Didn't realize GUNCODE was one of the input types (I don't have my aimtracks working yet so I haven't had to work with GUNCODE entries yet.

But you're right, I'll need to add support for those entry types.

I'll try and get that implemented and tested out this week.

I'll post when a new build is available.

Glad to hear the rest is working right. Once I add the GUNCODE entries, they should be fine too.

Sorry about that

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 3/30/11 update available (Version 0.0.6)
« Reply #50 on: June 05, 2011, 05:56:24 pm »
Just had a look at the mame source and it looks like those are the only 4 "CODE' elements

JOYCODE
KEYCODE
GUNCODE
MOUSECODE

So once I get GUNCODE added that should finish it up!

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 6/05/11 update available (Version 0.0.7)
« Reply #51 on: June 05, 2011, 10:34:56 pm »
Well, as it turns out, I had some time this afternoon (after grilling and swimming, yeah summer!), so what the heck.

I've just updated the first page on this thread with version 0.0.7 that should support GUNCODE remaps (very similar to MOUSECODE remapping, in reality).

I haven't done a ton of testing, since I don't really have any guns set up yet (my aimtrak is still quite naked), so you mileage may very.

@Damonator: If you have some time to give this a whirl, I'd appreciate any feedback!

It should work straight out using the same setup you tried in your config file (I used your config as the basis of my tests!).

Damonator

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 3
Re: New ControllerRemap utility, 6/05/11 update available (Version 0.0.7)
« Reply #52 on: June 06, 2011, 12:08:17 am »
Thanks drventure - the changed worked perfectly!  I actually have two guns and it correctly assigned both of them to the appropriate GUNCODE.

Excellent work!

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 6/05/11 update available (Version 0.0.7)
« Reply #53 on: June 06, 2011, 07:33:49 am »
Thanks for checking it out.

Glad it worked! I'm looking forward to getting my Aimtraks set up.

diggso

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 43
Re: New ControllerRemap utility, 6/05/11 update available (Version 0.0.7)
« Reply #54 on: July 17, 2011, 05:24:25 pm »
good work dr. this issue has been bugging me since i first set up my cab and i couldn't find an answer anywhere. basically i have 2 spinners and a trackball all plugged into a usb hub. can you tell me if the current code will work for a usb hub?

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 6/05/11 update available (Version 0.0.7)
« Reply #55 on: July 17, 2011, 06:47:30 pm »
Definitely. Usb hubs are no problem. My cab has 5 usb hubs (4 to 10 ports each), some always connected, some disconnectable (like game pads, and a drum controller). Hubs make no difference at all to the program.

One question though. If you've got 2 spinners and a trackball, those are pretty much static devices, right. Ie they're always plugged in. If that's the case, you shouldn't need the remap util, unless you're ALSO running disconnectable gamepads or you've got a swappable control panel, or something else like that.

diggso

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 43
Re: New ControllerRemap utility, 6/05/11 update available (Version 0.0.7)
« Reply #56 on: July 18, 2011, 03:21:58 am »
Yep, always plugged in but the 3 devices are randomly assigned to the mame ports on startup.

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 6/05/11 update available (Version 0.0.7)
« Reply #57 on: July 18, 2011, 08:25:49 am »
That's strange. Usually, Windows will keep things more or less consistent between boots as long as nothing gets plugged in or removed.

At any rate, yeah, grab a copy, and run

ControllerRemap /list

from the command line to make sure you can uniquely ID the 3 devices. If you can, it should be able to clean that situation up nicely.

diggso

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 43
Re: New ControllerRemap utility, 6/05/11 update available (Version 0.0.7)
« Reply #58 on: July 18, 2011, 04:03:31 pm »
hey dr, apologies for this - i realise your utility has far wider reaching potential than the problem i'm describing but it has solved my issue and may help someone else in the process.
as described its a relatively simple setup with 2 spinners and a trackball - enumerated randomly on each boot. i've configured most games to be
mouse 2 for 1 player spinner, mouse 3 for 2 player spinner, and mouse 4 for trackball. to get the devices enumerated correctly i have to pull out the p2 spinner and trackball usbs and re-insert in the correct order. up until now there has been no other solution.
i've already had a go with the utility and i can see that each device has a unique id (the vendor ids are the same but the rest is different) that seems to hold steady between boots. to this end i've created aliases for them in the file and the following:
        <controller id="Spinner1">
            <input>
                <port type="P1_DIAL">
                    <newseq type="standard">MOUSECODE_XAXIS</newseq>
                </port>
            </input>
        </controller>
        <controller id="Spinner2">
            <input>
                <port type="P2_DIAL">
                    <newseq type="standard">MOUSECODE_XAXIS</newseq>
                </port>
            </input>
        </controller>
        <controller id="Trackball">
            <input>
                <port type="P1_TRACKBALL_X">
                    <newseq type="standard">MOUSECODE_XAXIS</newseq>
                </port>
                <port type="P1_TRACKBALL_Y">
                    <newseq type="standard">MOUSECODE_YAXIS</newseq>
                </port>
            </input>
        </controller>
I've had to remove the specific mouse reference in the game's individual cfg file, while retaining any sensitivity/speed adjustments but thats it. All works the way it should(as far as I've tested!).
Only issue I have is that I can't find where to add pre commands to mame in mala - easy for other emulators but not for mame. i'm not being lazy but if you have a second to let me know how you usually get it to run i'd appreciate it.
thanks again - great application

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 6/05/11 update available (Version 0.0.7)
« Reply #59 on: July 18, 2011, 06:51:54 pm »
I set things up so that mala runs a BAT file, and the BAT file runs ControllerRemap and then runs mame.

You should also be able to use the /MAME:filenameformame option on the ControllerRemap command line, and then execute ControllerRemap directly from Mala.

I don't normally do that and haven't extensively tested it though, simply because I found vectoring things through a BAT file gives me a little more flexibility.

Let me know if you still have problems getting it to run either way, and I'll try to run it down.

ArcadeBliss

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 161
Re: New ControllerRemap utility, 6/05/11 update available (Version 0.0.7)
« Reply #60 on: December 12, 2011, 02:13:34 am »
Hi drventure,

thanks again for this wonderful tool. It is a godsend for my multipanel setup. I have noticed a bug though with the way the tool handles port mapping with multiple <newseq> tags.

I have configured my Logitech USB Wheel as shown below.

Code: [Select]
    <controller id="Logitech MOMO Racing USB">
        <input>
            <port type="P1_PADDLE" mask="255" defvalue="128">
                <newseq type="standard">
                    JOYCODE_1_XAXIS
                </newseq>
            </port>
            <port type="P1_PEDAL" mask="255" defvalue="0" reverse="yes">
                <newseq type="decrement">
                    JOYCODE_1_ZAXIS_POS_SWITCH
                </newseq>
                <newseq type="increment">
                    JOYCODE_1_ZAXIS_POS_SWITCH
                </newseq>
            </port>
        </input>
</controller>

After running ControllerRemap it turns this section into this  ??? .

Code: [Select]
     <port type="P1_PADDLE">
        <newseq type="standard">
                    JOYCODE_1_XAXIS
                </newseq>
      </port>
      <port type="P1_PEDAL">
        <newseq type="standard">
              NONE
          </newseq>
      </port>

As you can see it removes the <newseq type="increment"> and <newseq type="decrement"> sections. Any ideas what I am doing wrong? Thanks in advance.

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 6/05/11 update available (Version 0.0.7)
« Reply #61 on: December 12, 2011, 07:42:26 am »
@ArcadeBliss.

Hmm. I likely just never accounted for the "newseq type="xxxx"" sections. I don't recall seeing those during my testing...

I'll take a look and post back to this thread. Shouldn't be a big deal, and I doubt it's anything you're doing wrong.

And thanks for the heads up! There's so many combinations possible for the Mame controllers. The more feedback I can get, the better.

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 6/05/11 update available (Version 0.0.7)
« Reply #62 on: December 12, 2011, 11:49:56 am »
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.

ArcadeBliss

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 161
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #63 on: December 13, 2011, 03:14:19 am »
Woohoo Christmas came early. I tested the new version and it works like a charm. It even keeps the other assorted info such as mask= and the like.

Thanks very much. You rock.  :afro:


drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #64 on: December 13, 2011, 07:32:52 am »
Great news! Thanks for checking it out.

isamu

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 574
  • I'm a llama!
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #65 on: January 03, 2012, 12:20:07 am »
Interesting tool. I will be keeping my eye on this. Thanks Badmouth for the link.

Is there any way you can create a utility to change the hardware ID#'s of our USB devices within Windows 7? I hate having my gear shifter always at device ID #1, while my steering wheel is always device ID #3.

Oh and in addition to that, can you please develop a way for mame to support xinput devices?
« Last Edit: January 03, 2012, 03:58:25 am by isamu »

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #66 on: January 03, 2012, 08:00:06 am »
Quote
Is there any way you can create a utility to change the hardware ID#'s of our USB devices within Windows 7? I hate having my gear shifter always at device ID #1, while my steering wheel is always device ID #3.

Check out JoyIDs. As far as I know, that's the furthest you can get toward being able to change those ids. I do know that even with JoyIDs, the devices can still get moved around by windows. That's why I gave up on that approach and wrote controllerremap.


Quote
Oh and in addition to that, can you please develop a way for mame to support xinput devices?

Isn't xinput just a layer over standard directinput? I use xbox compatible sticks with mame right now (they're just USB hid devices, or am I missing something). Regardless, I don't see myself doing any work on Mame directly any time soon. I'm probably not the right person to ask for that kind of feature.

isamu

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 574
  • I'm a llama!
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #67 on: January 03, 2012, 11:06:02 pm »
Quote
Is there any way you can create a utility to change the hardware ID#'s of our USB devices within Windows 7? I hate having my gear shifter always at device ID #1, while my steering wheel is always device ID #3.

Check out JoyIDs. As far as I know, that's the furthest you can get toward being able to change those ids. I do know that even with JoyIDs, the devices can still get moved around by windows. That's why I gave up on that approach and wrote controllerremap.


Quote
Oh and in addition to that, can you please develop a way for mame to support xinput devices?

Isn't xinput just a layer over standard directinput? I use xbox compatible sticks with mame right now (they're just USB hid devices, or am I missing something). Regardless, I don't see myself doing any work on Mame directly any time soon. I'm probably not the right person to ask for that kind of feature.


OK drventure thanks.

kmhamel

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 23
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #68 on: February 17, 2012, 03:49:00 pm »
Ok i've read the instructions. Before I start I do have a question. When I make my cfg file. Do I transfer all the info for my machine from the default to the new cfg file, ie buttons, joysticks and spinners or just the joystick and spinners? After running "list" is see that the U360's come up as joysticks and usb mouse devices. Do I just use the spinner mouse device names and joystick id, and ignore the joystick mouse device ids?

Has anyone run this program with the hypersin frontend? If so, how did you setup mame?


drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #69 on: February 18, 2012, 11:14:23 am »
Hmm, a u360 shouldn't come up as a mouse device. It definitely should only show as a joystick.

Could you post the list file you get when you run it?

In terms of running with other front ends, all you +SHOULD+ have to do is create a  batch file that runs controllerremap first, and then runs mame as usual.

Something like this

{path}\ControllerRemap /remap:{path and filename of controller file to remap}
{path}\Mame %1 -ctrlr {path and filename of controller file to remap} %2 %3 %4 %5

something like that (i'm going from memory, but basically the idea is to pass whatever other arguments have been passed on the BAT file command line on to mame, but run ControllerRemap first to remap the controller file you want to use).

About whether to transfer all your config.

I don't believe it's strictly necessary. I'm pretty sure Mame loads the DEFAULT.CFG file, then any ROM specific CFG file, and then the Controller file, but don't quote me on that.

The thing that can hang you up is that once you decide to specify a controller file, you can no longer use the Mame menu to CHANGE any controller settings. If you try it, It'll look like it worked, but your settings won't stick.


For those reasons, and because it keeps all the config for everything in one neat file, I just put everything (keyboard, mouse, sticks etc) into the controller file.

Once you get used to looking at it, you should find you can setup the defaults fairly easily and then just use overrides for specific games that need them (for instance, I override Missile Command and World Class bowling to make both trackballs look like the player 1 trackball, but my default config is for each trackball to map to a specific player, 1 or 2).

kmhamel

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 23
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #70 on: February 18, 2012, 02:51:52 pm »
Well I made up a cfg file.....the buttons don't work. mame assigned a bunch of different keys.

Here is the controller list:
ControllerRemap Utility v0.0.0.0 - For Mame
(c) 2011 drventure Enterprises


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

   1.  'Ultimarc Ultra-Stik Player 1', ID=0
   2.  'Ultimarc Ultra-Stik Player 2', ID=1

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

   1.  'HID#Vid_fafa_Pid_0060#7_9eb3352_0_0000#'                          Player 1 spinner
   2.  'HID#Vid_d209_Pid_0502_MI_01#8_24588317_0_0000#'              Player 2 U360
   3.  'HID#Vid_fafa_Pid_0061#7_21934b00_0_0000#'                         Player 2 spinner
   4.  'HID#Vid_d209_Pid_0501_MI_01#8_3a7f8b52_0_0000#'               Player 1 U360
   5.  'HID#Vid_046d_Pid_c529_MI_01_Col01#8_1a7b4d3_0_0000#'       Mouse/keyboard

End of list

Here is the cfg file that I am having problems with:

<!-- This file is autogenerated; comments and unknown tags will be stripped -->
<mameconfig version="10">
  <controlleralias>
    <id>Ultimarc Ultra-Stik Player 1</id>
    <alias>U360 player1</alias>
  </controlleralias>
  <controlleralias>
    <id>Ultimarc Ultra-Stik Player 2</id>
    <alias>U360 player2</alias>
  </controlleralias>
  <controlleralias>
    <id>Ultimarc Ultra-Stik Player 2</id>
    <alias>U360 player2</alias>
  </controlleralias>
  <controlleralias>
    <id>HID#Vid_fafa_Pid_0060#7_9eb3352_0_0000#</id>
    <alias>Spinner player1</alias>
  </controlleralias>
  <controlleralias>
    <id>HID#Vid_fafa_Pid_0061#7_21934b00_0_0000#</id>
    <alias>Spinner player2</alias>
  </controlleralias>
  <system name="default">
    <controller id="U360 Player1">
      <input>
        <port type="P1_JOYSTICK_UP">
          <newseq type="standard">
                    JOYCODE_1_YAXIS_UP_SWITCH
                </newseq>
        </port>
        <port type="P1_JOYSTICK_DOWN">
          <newseq type="standard">
                    JOYCODE_1_YAXIS_DOWN_SWITCH
                </newseq>
        </port>
        <port type="P1_JOYSTICK_LEFT">
          <newseq type="standard">
                    JOYCODE_1_XAXIS_LEFT_SWITCH
                </newseq>
        </port>
        <port type="P1_JOYSTICK_RIGHT">
          <newseq type="standard">
                    JOYCODE_1_XAXIS_RIGHT_SWITCH
                </newseq>
        </port>
        <port type="P1_LIGHTGUN_X">
          <newseq type="standard">
                    JOYCODE_1_XAXIS
                </newseq>
        </port>
        <port type="P1_LIGHTGUN_Y">
          <newseq type="standard">
                    JOYCODE_1_YAXIS
                </newseq>
        </port>
        <port type="P1_MOUSE_X">
          <newseq type="standard">
                    JOYCODE_1_XAXIS
               </newseq>
        </port>
        <port type="P1_MOUSE_Y">
          <newseq type="standard">
                    JOYCODE_1_YAXIS
                </newseq>
        </port>
      </input>
    </controller>
    <controller id="U360 Player2">
      <input>
        <port type="P2_JOYSTICK_UP">
          <newseq type="standard">
                    JOYCODE_2_YAXIS_UP_SWITCH
                </newseq>
        </port>
        <port type="P2_JOYSTICK_DOWN">
          <newseq type="standard">
                    JOYCODE_2_YAXIS_DOWN_SWITCH
                </newseq>
        </port>
        <port type="P2_JOYSTICK_LEFT">
          <newseq type="standard">
                    JOYCODE_2_XAXIS_LEFT_SWITCH
                </newseq>
        </port>
        <port type="P2_JOYSTICK_RIGHT">
          <newseq type="standard">
                    JOYCODE_2_XAXIS_RIGHT_SWITCH
                </newseq>
        </port>
        <port type="P2_LIGHTGUN_X">
          <newseq type="standard">
                    JOYCODE_2_XAXIS
                </newseq>
        </port>
        <port type="P2_LIGHTGUN_Y">
          <newseq type="standard">
                    JOYCODE_2_YAXIS
                </newseq>
        </port>
        <port type="P2_POSITIONAL">
          <newseq type="standard">
                    JOYCODE_2_XAXIS
                </newseq>
        </port>
        <port type="P2_MOUSE_X">
          <newseq type="standard">
                    JOYCODE_2_XAXIS
                </newseq>
        </port>
        <port type="P2_MOUSE_Y">
          <newseq type="standard">
                    JOYCODE_2_YAXIS
                </newseq>
        </port>
        <port type="P2_POSITIONAL">
          <newseq type="standard">
                    JOYCODE_2_XAXIS
                </newseq>
        </port>
      </input>
    </controller>
    <controller id="Keyboard">
      <input>
        <port type="P1_JOYSTICK_UP">
          <newseq type="standard">
                    KEYCODE_UP
                </newseq>
        </port>
        <port type="P1_JOYSTICK_DOWN">
          <newseq type="standard">
                    KEYCODE_DOWN
                </newseq>
        </port>
        <port type="P1_JOYSTICK_LEFT">
          <newseq type="standard">
                    KEYCODE_LEFT
                </newseq>
        </port>
        <port type="P1_JOYSTICK_RIGHT">
          <newseq type="standard">
                    KEYCODE_RIGHT
                </newseq>
        </port>
        <port type="P1_BUTTON1">
          <newseq type="standard">
                    KEYCODE_A
                </newseq>
        </port>
        <port type="P1_BUTTON2">
          <newseq type="standard">
                    KEYCODE_S
                </newseq>
        </port>
        <port type="P1_BUTTON3">
          <newseq type="standard">
                    KEYCODE_Z
                </newseq>
        </port>
        <port type="P1_BUTTON4">
          <newseq type="standard">
                    KEYCODE_X
                </newseq>
        </port>
        <port type="P1_BUTTON5">
          <newseq type="standard">
                    KEYCODE_D
                </newseq>
        </port>
        <port type="P1_BUTTON6">
          <newseq type="standard">
                    KEYCODE_C
                </newseq>
        </port>
        <port type="P1_SELECT">
          <newseq type="standard">
                    KEYCODE_1
                </newseq>
        </port>
        <port type="P2_JOYSTICK_UP">
          <newseq type="standard">
                    KEYCODE_P
                </newseq>
        </port>
        <port type="P2_JOYSTICK_DOWN">
          <newseq type="standard">
                    KEYCODE_STOP
                </newseq>
        </port>
        <port type="P2_JOYSTICK_LEFT">
          <newseq type="standard">
                    KEYCODE_L
                </newseq>
        </port>
        <port type="P2_JOYSTICK_RIGHT">
          <newseq type="standard">
                    KEYCODE_COLON
                </newseq>
        </port>
        <port type="P2_BUTTON1">
          <newseq type="standard">
                    KEYCODE_J
                </newseq>
        </port>
        <port type="P2_BUTTON2">
          <newseq type="standard">
                    KEYCODE_K
                </newseq>
        </port>
        <port type="P2_BUTTON3">
          <newseq type="standard">
                    KEYCODE_M
                </newseq>
        </port>
        <port type="P2_BUTTON4">
          <newseq type="standard">
                    KEYCODE_N
                </newseq>
        </port>
        <port type="P2_BUTTON5">
          <newseq type="standard">
                    KEYCODE_H
                </newseq>
        </port>
        <port type="P2_BUTTON6">
          <newseq type="standard">
                    KEYCODE_B
                </newseq>
        </port>
        <port type="P2_START">
          <newseq type="standard">
                    KEYCODE_2
                </newseq>
        </port>
        <port type="P2_SELECT">
          <newseq type="standard">
                    KEYCODE_2
                </newseq>
        </port>
        <port type="START2">
          <newseq type="standard">
                    KEYCODE_2
                </newseq>
        </port>
        <port type="COIN2">
          <newseq type="standard">
                    KEYCODE_6
                </newseq>
        </port>
      </input>
    </controller>
    <controller id="spinner player1">
      <input>
        <port type="P1_PADDLE">
          <newseq type="standard">
                    MOUSECODE_1_XAXIS
                </newseq>
        </port>
        <port type="P1_PADDLE_V">
          <newseq type="standard">
                    MOUSECODE_1_XAXIS
                </newseq>
        </port>
        <port type="P1_POSITIONAL">
          <newseq type="standard">
                    MOUSECODE_1_YAXIS
                </newseq>
        </port>
        <port type="P1_POSITIONAL_V">
          <newseq type="standard">
                    MOUSECODE_1_YAXIS
                </newseq>
        </port>
        <port type="P1_DIAL">
          <newseq type="standard">
                    MOUSECODE_1_XAXIS
                </newseq>
        </port>
        <port type="P1_DIAL_V">
          <newseq type="standard">
                    MOUSECODE_1_XAXIS
                </newseq>
        </port>
      </input>
    </controller>
    <controller id="spinner player2">
      <input>
        <port type="P2_PADDLE">
          <newseq type="standard">
                    MOUSECODE_2_XAXIS
                </newseq>
        </port>
        <port type="P2_PADDLE_V">
          <newseq type="standard">
                    MOUSECODE_2_XAXIS
                </newseq>
        </port>
        <port type="P2_DIAL">
          <newseq type="standard">
                    MOUSECODE_2_XAXIS
                </newseq>
        </port>
        <port type="P2_DIAL_V">
          <newseq type="standard">
                    MOUSECODE_2_XAXIS
                </newseq>
        </port>
      </input>
    </controller>
    <input>
      <port type="P1_JOYSTICK_UP">
        <newseq type="standard">
                    JOYCODE_1_YAXIS_UP_SWITCH
                </newseq>
      </port>
      <port type="P1_JOYSTICK_DOWN">
        <newseq type="standard">
                    JOYCODE_1_YAXIS_DOWN_SWITCH
                </newseq>
      </port>
      <port type="P1_JOYSTICK_LEFT">
        <newseq type="standard">
                    JOYCODE_1_XAXIS_LEFT_SWITCH
                </newseq>
      </port>
      <port type="P1_JOYSTICK_RIGHT">
        <newseq type="standard">
                    JOYCODE_1_XAXIS_RIGHT_SWITCH
                </newseq>
      </port>
      <port type="P1_LIGHTGUN_X">
        <newseq type="standard">
                    JOYCODE_1_XAXIS
                </newseq>
      </port>
      <port type="P1_LIGHTGUN_Y">
        <newseq type="standard">
                    JOYCODE_1_YAXIS
                </newseq>
      </port>
      <port type="P1_MOUSE_X">
        <newseq type="standard">
                    JOYCODE_1_XAXIS
               </newseq>
      </port>
      <port type="P1_MOUSE_Y">
        <newseq type="standard">
                    JOYCODE_1_YAXIS
                </newseq>
      </port>
      <port type="P1_PADDLE">
        <newseq type="standard">
                    MOUSECODE_3_XAXIS
                </newseq>
      </port>
      <port type="P1_PADDLE_V">
        <newseq type="standard">
                    MOUSECODE_3_XAXIS
                </newseq>
      </port>
      <port type="P1_POSITIONAL">
        <newseq type="standard">
                    MOUSECODE_3_YAXIS
                </newseq>
      </port>
      <port type="P1_POSITIONAL_V">
        <newseq type="standard">
                    MOUSECODE_3_YAXIS
                </newseq>
      </port>
      <port type="P1_DIAL">
        <newseq type="standard">
                    MOUSECODE_3_XAXIS
                </newseq>
      </port>
      <port type="P1_DIAL_V">
        <newseq type="standard">
                    MOUSECODE_3_XAXIS
                </newseq>
      </port>
      <port type="P2_PADDLE">
        <newseq type="standard">
                    MOUSECODE_2_XAXIS
                </newseq>
      </port>
      <port type="P2_PADDLE_V">
        <newseq type="standard">
                    MOUSECODE_2_XAXIS
                </newseq>
      </port>
      <port type="P2_DIAL">
        <newseq type="standard">
                    MOUSECODE_2_XAXIS
                </newseq>
      </port>
      <port type="P2_DIAL_V">
        <newseq type="standard">
                    MOUSECODE_2_XAXIS
                </newseq>
      </port>
    </input>
  </system>
</mameconfig>

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #71 on: February 18, 2012, 05:34:27 pm »
Ok. I see a few things, so I'll just list the things to look at and work with

1), Mame (and XML) is pretty particular about case, You have
               <controller id="Keyboard">
     but that "Keyboard" should probably by "keyboard".
My utility tries to ignore case in most places, but Mame is not quite as forgiving.

2) Although it won't hurt anything (because I coded the utility to ignore it), you don't have to include the stick numbers in the <controller> port definitions, and I find it can get confusing if you do.

For instance, you have

<system name="default">
    <controller id="U360 Player1">
      <input>
        <port type="P1_JOYSTICK_UP">
          <newseq type="standard">
                    JOYCODE_1_YAXIS_UP_SWITCH
                </newseq>
        </port>

But keep in mind that in this area, that "JOYCODE_1_YAXIS_UP_SWITCH" really doesn't mean JOYSTICK_1, because JOYSTICK_1 might change on you. Instead, I usually just use "JOYCODE_YAXIS_UP_SWITCH". That way, there's no confusing a controller definition with an actual input definition. It won't necessarily solve any problems here, but it might help to keep things clear.

3) I'm assuming this is the CFG file +AFTER+ you've run the controller remap utility on it. The reason I say this is that it has a populated <input> section under <system name="default"> (the large section toward the end).

If that's NOT the case, then I'd recommend deleting the input section and run controllerremap from the command line (I usually create a little batch file called "remap.bat" to make this easier.

So, run the utility to remap things, then reload the cfg file, and the <input> section should now contain a bunch of port definitions. If it DOESN'T, that means you didn't run the utility right, so check your paths, etc.

If it DOES, then you've got your paths and all right, so now it's just a matter of identifying what ports aren't mapping right.


4) Keep backups. I'm a software developer so I use a version control system, but if you can't or don't want to do that, just make backup copies with incrementing numbered file names or something. That way, if things get screwed up, you can quickly revert back.

5) And finally, start slow and simple and work your way up. For instance, instead of trying to define the P1 stick with Lightgun and mouse ports, try just defining the up/down/left/right and get that working first.

<system name="default">
    <controller id="U360 Player1">
      <input>
        <port type="P1_JOYSTICK_UP">
          <newseq type="standard">
                    JOYCODE_YAXIS_UP_SWITCH
                </newseq>
        </port>
        <port type="P1_JOYSTICK_DOWN">
          <newseq type="standard">
                    JOYCODE_YAXIS_DOWN_SWITCH
                </newseq>
        </port>
        <port type="P1_JOYSTICK_LEFT">
          <newseq type="standard">
                    JOYCODE_XAXIS_LEFT_SWITCH
                </newseq>
        </port>
        <port type="P1_JOYSTICK_RIGHT">
          <newseq type="standard">
                    JOYCODE_XAXIS_RIGHT_SWITCH
                </newseq>
        </port>
    </controller>
....

Same with the keyboard options.

edit the CFG file, save, run the remap util, and reload the cfg file to examine the changes it made. If they look right, fire up mame with rom you know uses those inputs and verify that they work in Mame.

Be sure to remember to tell mame to use a specific controller file! You can do that in the MAME.INI file or via command line, but you do have to tell it one way or the other.

Once you've got a few basic input defs working, save a backup and expand out from there.

And let me know how things go. If you still are having issues, just post back here. I try to monitor the boards pretty regularly.

kmhamel

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 23
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #72 on: February 19, 2012, 11:50:16 am »
Thanks, controls and buttons work after making the two corrections. "Keyboard" has to be "keyboard".  :cheers:

Now I just have to fit the controllerremap into hyperspin.

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #73 on: February 19, 2012, 12:09:24 pm »
Great. Glad to hear that's all it was.

TopJimmyCooks

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2093
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #74 on: February 21, 2012, 10:00:54 pm »
dr:
can you take a quick look at my config file, It went through remapping with no error messages, but will not run under mame.  I checked as best I could in regular notepad for any missed cases or unpaired tags.  renamed file to .txt so I could attach it.  I really appreciate your help.   

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #75 on: February 21, 2012, 10:24:36 pm »
Sure.

First, you don't need to define and alias for anything that isn't a stick or mouse, so you can get rid of the USBHUB entry.

Second, in the <controller> sections, generally , I don't use the device number because it can be confusing.

So

<system name="default">
    <controller id="U360 Player1">
      <input>
        <port type="P1_JOYSTICK_UP">
          <newseq type="standard">
                    JOYCODE_1_YAXIS_UP_SWITCH
                </newseq>
        </port>


Would become

<system name="default">
    <controller id="U360 Player1">
      <input>
        <port type="P1_JOYSTICK_UP">
          <newseq type="standard">
                    JOYCODE_YAXIS_UP_SWITCH
                </newseq>
        </port>

Note that I just removed the _1 after JOYCODE.

If you leave it, ControllerRemap will just replace it with the right ID but I find it a bit confusing to leave those in...

You have 2 SIDEWINDER <controller> sections. Looks like the second one has all sorts of other ports in it. That could definitely cause a problem, For any <system> section, a particular <controller> section should only be included once.

It looks like it DID perform a remap (you can tell this because there is an <input> section immediately below the <system> sections). Those <input> sections are removed and rewritten by the remap process when you run it.

That's good news because it means that there's nothing spectacularly wrong with the XML (ie leaving off a close tag or something) that would invalidate the whole file.


I'd remove the second "id=Sidewinder"  section first, Run remap and verify that the <input> section is including the right elements, then add back in whatever you really need in that second sidewinder section.

Let me know how it goes!

TopJimmyCooks

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2093
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #76 on: February 22, 2012, 08:43:03 am »
Thank you good sir, will edit and report back. 

Hoopz

  • Don't brand me a troublemaker!
  • Trade Count: (+8)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5093
  • Intellivision Rocks!
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #77 on: February 27, 2012, 11:50:54 am »
TTT

Can we get this stickied?
Ajax should have been named Warlord, not Swan.

First off, Hoopz is right.

tony.silveira

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 551
    • my baby
hey guys,

reading up on this post for the first time and i think this little app could work for my situation.

i have a star wars yoke i've added to my panel as a removable unit, using a dual strike hack mounted inside the box i built.  i'm also going to be using dual strike hacks for a motorcycle handle assembly (two in fact for that controller) and pedals (one more dual strike hack).

my question on using ControllerRemap, how will differentiate between these different hacks when plugged in?  or will it even?

thanks guys, looking forward to taking a crack at this util.

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
It should be able to distinguish between them.

You can plug all three in, and run

controllerremap /list

to get a list of the device signatures.

Even if the device names are exactly the same, their ID numbers should be slightly different, and you can use that to ID the individual devices.

The Docs have full details.

tony.silveira

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 551
    • 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: 4144
  • 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: 551
    • 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: 206
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: 4144
  • 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: 206
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: 4144
  • 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: 84
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: 84
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: 4144
  • 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
    • 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: 4144
  • 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
    • 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: 206
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: 4144
  • 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: 206
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: 4144
  • 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: 206
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: 4144
  • 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: 206
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: 4144
  • 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: 574
  • 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: 4144
  • 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: 574
  • I'm a llama!
Thanks :(  :embarassed:

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • 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: 574
  • 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: 4144
  • 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
Avast detects a trojan in attachment.  :-\

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • 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: 84
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: 4144
  • 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
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: 294
  • 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: 4144
  • 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
  • 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
  • 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: 294
  • 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
  • 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: 294
  • 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
  • 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

Connorsdad

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 268
  • I want to build my own arcade controls!

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

Saved this thread for future reference, I would definitely appreciate a friendlier GUI for noobs like me :)
    

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #121 on: June 14, 2013, 05:00:35 pm »
I considered a GUI but quickly realized that it would be a significant project. Just look at the built in mame UI for configuring controls.

But if your still interested, I absolutely wouldn't mind and would be happy to help any way I could.

chipywinie

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 4
  • I want to build my own arcade controls!
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #122 on: June 15, 2013, 10:11:51 am »
hello drventure

Sorry if I do not understand very well, my English is very bad.

ask you a few post back about my problem, I ask again if gone unnoticed

I have two xbox360 wireless controls, which are for the player 3 and 4.

when only one control connect xbox360, controllerremap I assigned to that command the player 3 and 4, when in theory, if not detected would not have to assign controls.

is there any way around this? is a defect of the program? or just works well and you can not do anything?

greetings and thank you very much!

thurmansevolution

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16
  • I want to build my own arcade controls!
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #123 on: June 15, 2013, 07:58:04 pm »
Thanks drventure!  :) Lol, I understand that it's gonna be somewhat of a nice uphill battle creating a "dedicated" GUI for it (with concerns of writing complex coding, etc)...I have the same outlook.  What I plan on doing though is creating a small tool that will create the "MyArcade.cfg" file (including all of the IDs and Aliases), then use the ControllerRemap Utility to automatically remap after the file is created, and then place the complete "MyArcade.cfg" file into the specified "mame/ctrlr" folder - while also moving the default.cfg folder out of mame\controls.  It will also include other functions like: backing up ID numbers to Notepad; Fetching Controller IDs, etc...

All in all, its just a simple ahk gui script (don't judge lol) that will pretty much do the whole process for you.  I started working on the GUI a little last night, and have the first tab done:



Basically, what happens is that the Helper will write the file from a basic...kinda templete.  If the boxes to the left of the controllers are checked, it will write those down in order, along with inputing the ID numbers and Aliases in the correct place.  If it comes to an area that the checkbox is unchecked, it will skip writing that section of templete and proceed to the next checked area and start writing. 

The second tab will have a bunch of "goodies" that will make it easier to add new controllers after the first run of the Helper.

Please let me know what you think of it so far - It may take a little while to get it 100% going (I'm also helping planning for a wedding and honeymoon, building a driving cab, and a whole lot of projects at work lol), but it will hopefully be done soon :).

LC

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #124 on: June 28, 2013, 06:51:25 pm »
@chipywinie

Finally got a chance to look at your files.

Yeah, that doesn't look right at a quick glance. It's supposed to just drop the definitions for the P4 stick if the device isn't available.

I'll try to get some time this weekend to see what might be happening in the code.

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #125 on: June 30, 2013, 08:36:56 am »
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?

Glad to hear you got that other issue worked out.

As to the Remap option, no, ControllerRemap doesn't remember anything <g>. Seriously though, it doesn't save "configuration" options anywhere, or anything like that. It's basically just a file "filter".

You run it and point it at a file, and it looks at the current system config and the command line options you specify and filters that file, writing out whatever output you tell it to. That's about it.

I do believe chipywiny has found an issue though, so I'm hunting it down now.

chipywinie

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 4
  • I want to build my own arcade controls!
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #126 on: July 03, 2013, 06:03:02 pm »
@chipywinie

Finally got a chance to look at your files.

Yeah, that doesn't look right at a quick glance. It's supposed to just drop the definitions for the P4 stick if the device isn't available.

I'll try to get some time this weekend to see what might be happening in the code.

thanks for the help!

if you need to perform any test, I'm at your disposal.

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #127 on: July 03, 2013, 10:03:48 pm »
@chipywinie

I've attached a testing build to this message.

Extract it and give it a go.

It should properly ignore the aliases for those devices that aren't actually plugged in when run.

Let me know how it goes.

Anyone else checking this thread out. There's nothing new in this build except specifically the fix for the issue chipywinie has run into to it's probably not worth messing with.

EDIT, I've removed the attachment here and updated the OP
« Last Edit: July 08, 2013, 07:59:56 pm by drventure »

chipywinie

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 4
  • I want to build my own arcade controls!
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #128 on: July 08, 2013, 02:15:24 pm »
@chipywinie

I've attached a testing build to this message.

Extract it and give it a go.

It should properly ignore the aliases for those devices that aren't actually plugged in when run.

Let me know how it goes.

Anyone else checking this thread out. There's nothing new in this build except specifically the fix for the issue chipywinie has run into to it's probably not worth messing with.

thanks for all drventure.

I've tried it today, it works perfectly.

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 12/12/11 update available (Version 0.0.9)
« Reply #129 on: July 08, 2013, 04:49:45 pm »
Great! Glad to hear it. I'll update the OP and remove the beta.

Thanks for letting me know.
« Last Edit: July 08, 2013, 07:59:08 pm by drventure »

Connorsdad

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 268
  • I want to build my own arcade controls!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #130 on: August 11, 2013, 05:51:21 am »
Could this work with the sega model 2/3 emulators ?

They have configs which have the same problem as mame regarding ids.

Sent from Amstrad CPC464

    

nick3092

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 206
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #131 on: August 11, 2013, 09:41:45 am »
Could this work with the sega model 2/3 emulators ?

They have configs which have the same problem as mame regarding ids.

Sent from Amstrad CPC464

Someone else asked this earlier in the thread.  It most likely will not work.  Per the person who asked the question, the model 2 emu uses a binary file to store the relevant settings.  So, that's not something easily re-written.  If you can find an ini or xml style file that clearly lays out the controller mapping for a specific emulator, then it might be able to be supported by Dr V's tool.  I don't use model 2 or 3 on my cab, so I can't speak to how the emu's work, or how they save their settings.

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #132 on: August 11, 2013, 09:54:41 am »
Could this work with the sega model 2/3 emulators ?

They have configs which have the same problem as mame regarding ids.

Sent from Amstrad CPC464

Someone else asked this earlier in the thread.  It most likely will not work.  Per the person who asked the question, the model 2 emu uses a binary file to store the relevant settings.  So, that's not something easily re-written.  If you can find an ini or xml style file that clearly lays out the controller mapping for a specific emulator, then it might be able to be supported by Dr V's tool.  I don't use model 2 or 3 on my cab, so I can't speak to how the emu's work, or how they save their settings.

What he said  ;)

But seriously, yeah, without some very specific info on the binary file formats used, that'd be a job I just don't have time to take on (plus I don't use Model2/3 myself, at least not yet).


Wade007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 309
  • A MAME cabinet at home is heaven
    • bit.ly/1cWnoIC
    • Cheapskategamer.com
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #133 on: November 05, 2013, 01:56:48 pm »
I was recently pointed to this thread after asking how to keep the IDs of my MAME cabinet lightguns (ArcadeGuns) consistent after each boot up.
Thank you for creating such a great utility!! I've been looking for this solution for quite a while but need a bit of help.

I've read and re-read the PDF and sample config files. I'm not a complete beginner with this stuff, but I can't seem to get it to work.
I know I'm close but I'm not quite there with the new config XML file. Wondering if someone might take a quick look at my code....please.  :dunno

I'm using an Xarcade tankstick (two joysticks and trackball) as my control panel. On top of this I've added two lightguns (AimTrak)
Up until now I've simply pointed MAME to the "xarcade.cfg" file in my "ctrl" folder for all controls except for the lightguns. The lightguns would be configured within MAME and of course would change IDs from time to time. Enter the need for this utility. All I need to do is essentially combine the xarcade.ctlr with the abiltily of ControllerRemap for lightgun control (X/Y axis, 3 buttons each)

Below is the unaltered code of the xarcade.cfg file (working):
Code: [Select]
<mameconfig version="10">
<system name="default">

<!-- X-Arcade Version 1.0 input configuration file -->

<input>
<remap origcode="KEYCODE_UP" newcode="KEYCODE_8_PAD" />
<remap origcode="KEYCODE_DOWN" newcode="KEYCODE_2_PAD" />
<remap origcode="KEYCODE_LEFT" newcode="KEYCODE_4_PAD" />
<remap origcode="KEYCODE_RIGHT" newcode="KEYCODE_6_PAD" />

<port type="UI_UP">
<newseq type="standard">KEYCODE_UP OR KEYCODE_8_PAD</newseq>
</port>
<port type="UI_DOWN">
<newseq type="standard">KEYCODE_DOWN OR KEYCODE_2_PAD</newseq>
</port>
<port type="UI_LEFT">
<newseq type="standard">KEYCODE_LEFT OR KEYCODE_4_PAD</newseq>
</port>
<port type="UI_RIGHT">
<newseq type="standard">KEYCODE_RIGHT OR KEYCODE_6_PAD</newseq>
</port>
<port type="UI_SELECT">
<newseq type="standard">KEYCODE_ENTER OR KEYCODE_LCONTROL</newseq>
</port>

<port type="UI_CONFIGURE">
<newseq type="standard">KEYCODE_TAB OR KEYCODE_1 KEYCODE_3</newseq>
</port>
<port type="UI_CANCEL">
<newseq type="standard">KEYCODE_ESC OR KEYCODE_2 KEYCODE_4</newseq>
</port>

<port type="START1">
<newseq type="standard">KEYCODE_1</newseq>
</port>
<port type="START2">
<newseq type="standard">KEYCODE_2</newseq>
</port>
<port type="COIN1">
<newseq type="standard">KEYCODE_3</newseq>
</port>
<port type="COIN2">
<newseq type="standard">KEYCODE_4</newseq>
</port>
<port type="START3">
<newseq type="standard">NONE</newseq>
</port>
<port type="START4">
<newseq type="standard">NONE</newseq>
</port>

<port type="P1_JOYSTICK_UP">
<newseq type="standard">KEYCODE_8_PAD</newseq>
</port>
<port type="P1_JOYSTICK_DOWN">
<newseq type="standard">KEYCODE_2_PAD</newseq>
</port>
<port type="P1_JOYSTICK_LEFT">
<newseq type="standard">KEYCODE_4_PAD</newseq>
</port>
<port type="P1_JOYSTICK_RIGHT">
<newseq type="standard">KEYCODE_6_PAD</newseq>
</port>
<port type="P1_JOYSTICKRIGHT_UP">
<newseq type="standard">KEYCODE_R</newseq>
</port>
<port type="P1_JOYSTICKRIGHT_DOWN">
<newseq type="standard">KEYCODE_F</newseq>
</port>
<port type="P1_JOYSTICKRIGHT_LEFT">
<newseq type="standard">KEYCODE_D</newseq>
</port>
<port type="P1_JOYSTICKRIGHT_RIGHT">
<newseq type="standard">KEYCODE_G</newseq>
</port>
<port type="P1_JOYSTICKLEFT_UP">
<newseq type="standard">KEYCODE_8_PAD</newseq>
</port>
<port type="P1_JOYSTICKLEFT_DOWN">
<newseq type="standard">KEYCODE_2_PAD</newseq>
</port>
<port type="P1_JOYSTICKLEFT_LEFT">
<newseq type="standard">KEYCODE_4_PAD</newseq>
</port>
<port type="P1_JOYSTICKLEFT_RIGHT">
<newseq type="standard">KEYCODE_6_PAD</newseq>
</port>

<port type="P1_BUTTON1">
<newseq type="standard">KEYCODE_LCONTROL   OR JOYCODE_1_BUTTON1 OR MOUSECODE_1_BUTTON1</newseq>
</port>
<port type="P1_BUTTON2">
<newseq type="standard">KEYCODE_LALT       OR JOYCODE_1_BUTTON2 OR MOUSECODE_1_BUTTON3</newseq>
</port>
<port type="P1_BUTTON3">
<newseq type="standard">KEYCODE_SPACE      OR JOYCODE_1_BUTTON3 OR MOUSECODE_1_BUTTON2</newseq>
</port>
<port type="P1_BUTTON4">
<newseq type="standard">KEYCODE_LSHIFT     OR JOYCODE_1_BUTTON4</newseq>
</port>
<port type="P1_BUTTON5">
<newseq type="standard">KEYCODE_Z          OR JOYCODE_1_BUTTON5</newseq>
</port>
<port type="P1_BUTTON6">
<newseq type="standard">KEYCODE_X          OR JOYCODE_1_BUTTON6</newseq>
</port>
<port type="P2_BUTTON1">
<newseq type="standard">KEYCODE_A          OR JOYCODE_2_BUTTON1</newseq>
</port>
<port type="P2_BUTTON2">
<newseq type="standard">KEYCODE_S          OR JOYCODE_2_BUTTON2</newseq>
</port>
<port type="P2_BUTTON3">
<newseq type="standard">KEYCODE_Q          OR JOYCODE_2_BUTTON3</newseq>
</port>
<port type="P2_BUTTON4">
<newseq type="standard">KEYCODE_W          OR JOYCODE_2_BUTTON4</newseq>
</port>
<port type="P2_BUTTON5">
<newseq type="standard">KEYCODE_E          OR JOYCODE_2_BUTTON5</newseq>
</port>
<port type="P2_BUTTON6">
<newseq type="standard">KEYCODE_OPENBRACE  OR JOYCODE_2_BUTTON6</newseq>
</port>
</input>
</system>

<system name="neogeo">
<input>
<port type="P1_BUTTON1">
<newseq type="standard">KEYCODE_C          OR JOYCODE_1_BUTTON1</newseq>
</port>
<port type="P1_BUTTON2">
<newseq type="standard">KEYCODE_LSHIFT     OR JOYCODE_1_BUTTON2</newseq>
</port>
<port type="P1_BUTTON3">
<newseq type="standard">KEYCODE_Z          OR JOYCODE_1_BUTTON3</newseq>
</port>
<port type="P1_BUTTON4">
<newseq type="standard">KEYCODE_X          OR JOYCODE_1_BUTTON4</newseq>
</port>
<port type="P1_BUTTON5">
<newseq type="standard">NONE</newseq>
</port>
<port type="P1_BUTTON6">
<newseq type="standard">NONE</newseq>
</port>
<port type="P1_BUTTON7">
<newseq type="standard">NONE</newseq>
</port>
<port type="P1_BUTTON8">
<newseq type="standard">NONE</newseq>
</port>
<port type="P2_BUTTON1">
<newseq type="standard">KEYCODE_CLOSEBRACE OR JOYCODE_2_BUTTON1</newseq>
</port>
<port type="P2_BUTTON2">
<newseq type="standard">KEYCODE_W          OR JOYCODE_2_BUTTON2</newseq>
</port>
<port type="P2_BUTTON3">
<newseq type="standard">KEYCODE_E          OR JOYCODE_2_BUTTON3</newseq>
</port>
<port type="P2_BUTTON4">
<newseq type="standard">KEYCODE_OPENBRACE  OR JOYCODE_2_BUTTON4</newseq>
</port>
<port type="P2_BUTTON5">
<newseq type="standard">NONE</newseq>
</port>
<port type="P2_BUTTON6">
<newseq type="standard">NONE</newseq>
</port>
<port type="P2_BUTTON7">
<newseq type="standard">NONE</newseq>
</port>
<port type="P2_BUTTON8">
<newseq type="standard">NONE</newseq>
</port>
</input>
</system>

</mameconfig>

The following is my current (not quite working) combined X-Arcade/Arcadeguns cfg (xarcade_arcadeguns.cfg) file:

Code: [Select]
<!-- This file is autogenerated; comments and unknown tags will be stripped -->
<mameconfig version="10">
  <controlleralias>
    <id>HID#VID_D209_PID_1601_MI_02#7_6f6937b_0_0000#</id>
    <alias>Lightgun_Player1</alias>
  </controlleralias>
  <controlleralias>
    <id>HID#VID_D209_PID_1602_MI_02#7_23fea4a1_0_0000#</id>
    <alias>Lightgun_Player2</alias>
  </controlleralias>
  <system name="default">
    <controller id="Xarcade_UI_Control">
      <input>
        <remap origcode="KEYCODE_UP" newcode="KEYCODE_8_PAD" />
        <remap origcode="KEYCODE_DOWN" newcode="KEYCODE_2_PAD" />
        <remap origcode="KEYCODE_LEFT" newcode="KEYCODE_4_PAD" />
        <remap origcode="KEYCODE_RIGHT" newcode="KEYCODE_6_PAD" />
        <port type="UI_UP">
          <newseq type="standard">KEYCODE_UP OR KEYCODE_8_PAD </newseq>
        </port>
        <port type="UI_DOWN">
          <newseq type="standard">KEYCODE_DOWN OR KEYCODE_2_PAD </newseq>
        </port>
        <port type="UI_LEFT">
          <newseq type="standard">KEYCODE_LEFT OR KEYCODE_4_PAD </newseq>
        </port>
        <port type="UI_RIGHT">
          <newseq type="standard">KEYCODE_RIGHT OR KEYCODE_6_PAD</newseq>
        </port>
        <port type="UI_SELECT">
          <newseq type="standard">KEYCODE_ENTER OR KEYCODE_LCONTROL</newseq>
        </port>
        <port type="UI_CONFIGURE">
          <newseq type="standard">KEYCODE_TAB OR KEYCODE_1 KEYCODE_3</newseq>
        </port>
        <port type="UI_CANCEL">
          <newseq type="standard">KEYCODE_ESC OR KEYCODE_2 KEYCODE_4</newseq>
        </port>
        <port type="START1">
          <newseq type="standard">KEYCODE_1</newseq>
        </port>
        <port type="START2">
          <newseq type="standard">KEYCODE_2</newseq>
        </port>
        <port type="COIN1">
          <newseq type="standard">KEYCODE_3</newseq>
        </port>
        <port type="COIN2">
          <newseq type="standard">KEYCODE_4</newseq>
        </port>
        <port type="START3">
          <newseq type="standard">NONE</newseq>
        </port>
        <port type="START4">
          <newseq type="standard">NONE</newseq>
        </port>
      </input>
    </controller>
    <controller id="Xarcade_Joystick_Control">
      <input>
        <port type="P1_JOYSTICK_UP">
          <newseq type="standard">
                    KEYCODE_8PAD
                </newseq>
        </port>
        <port type="P1_JOYSTICK_DOWN">
          <newseq type="standard">
                    KEYCODE_2PAD
                </newseq>
        </port>
        <port type="P1_JOYSTICK_LEFT">
          <newseq type="standard">
                    KEYCODE_4PAD
                </newseq>
        </port>
        <port type="P1_JOYSTICK_RIGHT">
          <newseq type="standard">
                    KEYCODE_6PAD
                </newseq>
        </port>
        <port type="P1_BUTTON1">
          <newseq type="standard">
                    GUNCODE_4_BUTTON1 OR KEYCODE_LCONTROL
                </newseq>
        </port>
        <port type="P1_BUTTON2">
          <newseq type="standard">
                    JOYCODE_1_BUTTON3 OR KEYCODE_LALT
                </newseq>
        </port>
        <port type="P1_BUTTON3">
          <newseq type="standard">
                    JOYCODE_1_BUTTON2 OR KEYCODE_SPACE
                </newseq>
        </port>
        <port type="P1_BUTTON4">
          <newseq type="standard">
                    KEYCODE_LSHIFT
                </newseq>
        </port>
        <port type="P1_BUTTON5">
          <newseq type="standard">
                    KEYCODE_Z
                </newseq>
        </port>
        <port type="P1_BUTTON6">
          <newseq type="standard">
                    KEYCODE_X
                </newseq>
        </port>
        <port type="P1_BUTTON7">
          <newseq type="standard">
                    KEYCODE_C
                </newseq>
        </port>
        <port type="P1_BUTTON8">
          <newseq type="standard">
                    KEYCODE_5
                </newseq>
        </port>
        <port type="P2_BUTTON1">
          <newseq type="standard">
                    KEYCODE_A OR GUNCODE_3_BUTTON1
                </newseq>
        </port>
        <port type="P2_BUTTON2">
          <newseq type="standard">
                    JOYCODE_2_BUTTON3 OR KEYCODE_S
                </newseq>
        </port>
        <port type="P2_BUTTON3">
          <newseq type="standard">
                    JOYCODE_2_BUTTON2 OR KEYCODE_Q
                </newseq>
        </port>
      </input>
    </controller>
    <controller id="Lightgun_Player1">
      <input>
        <port type="P1_LIGHTGUN_X">
          <newseq type="standard">
                        GUNCODE_XAXIS
                    </newseq>
        </port>
        <port type="P1_LIGHTGUN_Y">
          <newseq type="standard">
                        GUNCODE_YAXIS
                    </newseq>
        </port>
        <port type="P1_AD_STICK_X">
          <newseq type="standard">
                    GUNCODE_XAXIS
                </newseq>
        </port>
        <port type="P1_AD_STICK_Y">
          <newseq type="standard">
                    GUNCODE_YAXIS
                </newseq>
        </port>
      </input>
    </controller>
    <controller id="Lightgun_Player2">
      <input>
        <port type="P2_LIGHTGUN_X">
          <newseq type="standard">
                        GUNCODE_XAXIS
                    </newseq>
        </port>
        <port type="P2_LIGHTGUN_Y">
          <newseq type="standard">
                        GUNCODE_YAXIS
                    </newseq>
        </port>
        <port type="P2_AD_STICK_X">
          <newseq type="standard">
                    GUNCODE_XAXIS
                </newseq>
        </port>
        <port type="P2_AD_STICK_Y">
          <newseq type="standard">
                    GUNCODE_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="P2_LIGHTGUN_X">
        <newseq type="standard">
                        GUNCODE_2_XAXIS
                    </newseq>
      </port>
      <port type="P2_LIGHTGUN_Y">
        <newseq type="standard">
                        GUNCODE_2_YAXIS
                    </newseq>
      </port>
      <port type="P2_AD_STICK_X">
        <newseq type="standard">
                    GUNCODE_2_XAXIS
                </newseq>
      </port>
      <port type="P2_AD_STICK_Y">
        <newseq type="standard">
                    GUNCODE_2_YAXIS
                </newseq>
      </port>
    </input>
  </system>
</mameconfig>
My Super Arcade cabinet project:
Software blog article: http://bit.ly/1cWnoIC

Hardware blog article: http://bit.ly/1dWxjvP

YouTube video: http://bit.ly/1N818Xm

Super Arcade Cabinet Progress thread (Now Complete):
http://forum.arcadecontrols.com/index.php/topic,123292.0.html

Frontend Video Intro: http://bit.ly/1P9HPDN

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #134 on: November 05, 2013, 07:22:15 pm »
Hi Wade007

Sorry you're having some troubles.

I think the first place to start is with the keyboard

You've got something like this in your ctrlr file

Code: [Select]
  <system name="default">
    <controller id="Xarcade_UI_Control">
      <input>
        <remap origcode="KEYCODE_UP" newcode="KEYCODE_8_PAD" />
        <remap origcode="KEYCODE_DOWN" newcode="KEYCODE_2_PAD" />
        <remap origcode="KEYCODE_LEFT" newcode="KEYCODE_4_PAD" />
        <remap origcode="KEYCODE_RIGHT" newcode="KEYCODE_6_PAD" />
        <port type="UI_UP">
          <newseq type="standard">KEYCODE_UP OR KEYCODE_8_PAD </newseq>
        </port>

The main problem there I suspect is that if the xarcade "looks" like a keyboard, you need to use the "keyboard" controller id

so, something more like this

Code: [Select]
  <system name="default">
    <controller id="keyboard">
      <input>
        <port type="UI_UP">
          <newseq type="standard">KEYCODE_UP</newseq>
        </port>

Note that I removed the REMAP lines, I'm not completely sure what they do, or if ControllerRemap will handle them, and it doesn't seem like they should be strictly necessary.

for instance, they appear to map a KEYUP to a KEY 8 PAD port. But then the port definition specifies +either+ KEY UP or KEY 8 PAD. I'm just not sure about that part.

Make sure the "keyboard" controller id ONLY includes keyboard port elements. For instance, if p1_up maps to KEY_UP and to JOYSTICK_1_XAXIS_UP_SWITCH, you have the port map for KEY_UP under the "keyboard" controller id section, and other the joystick section, you'd include only the JOYSTICK_1_XAXIS_UP_SWITCH mapping. When controllerremap processes, it'll merge both those elements as applicable.

Make those changes first and get things to a point where you're getting your keyboard elements mapped into the <input> section at the bottom of the file (after the comment block that says ACTUAL INPUT MAPPING STARTS HERE)

Be sure to use the /list option to get the IDs of the controllers. Then, it might make things easier to define a few aliases for those.

Then we can take a stab any any remaining issues.

Wade007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 309
  • A MAME cabinet at home is heaven
    • bit.ly/1cWnoIC
    • Cheapskategamer.com
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #135 on: November 07, 2013, 12:12:46 am »
Thank you so much for your help drventure!!

I took your advice and tweaked a few things with my ctrl file. I'm much much closer. I seem to have regained control of the keyboard functions relative to my xarcade tankstick once again. Joystick MAME games work like before.

I triple checked the ID of my lightguns and fixed the ID for lightgun1. It was off by one digit and therefore wasn't getting picked up via the alias. All good now. Now, Lightgun 1 and 2 seem to have been picked up/re-mapped correctly (X/Y axis control) however Lightgun 2 trigger/buttons aren't mapped. Lightgun 1 buttons work, but probably only because I lucked out and called for GUNCODE_4_BUTTON1 in the P1_BUTTON1 port type, etc. I need to remap the 3 buttons on each lightgun correctly. Pull out of keyboard controller id right? How do I separate the trigger/gun buttons again separately from the keyboard section so they will get correctly remapped everytime? Also, Keystoke arrows don't seem to work on MAME UI.

I'm making progress... Can you take a look at my code again here below and give me another nudge or two in the right direction?

Thanks again for your work on this utility. I have high hopes of getting this to work and no longer having to worry about having to constantly re-configure my lightguns on my MAME cabinet! :)


Code: [Select]
<!-- This file is autogenerated; comments and unknown tags will be stripped -->
<mameconfig version="10">
  <controlleralias>
    <id>HID#VID_D209_PID_1601_MI_02#7_6f69e7b_0_0000#</id>
    <alias>Lightgun_Player1</alias>
  </controlleralias>
  <controlleralias>
    <id>HID#VID_D209_PID_1602_MI_02#7_23fea4a1_0_0000#</id>
    <alias>Lightgun_Player2</alias>
  </controlleralias>
  <system name="default">
    <controller id="keyboard">
      <input>
        <port type="UI_UP">
          <newseq type="standard">KEYCODE_UP OR KEYCODE_8_PAD </newseq>
        </port>
        <port type="UI_DOWN">
          <newseq type="standard">KEYCODE_DOWN OR KEYCODE_2_PAD </newseq>
        </port>
        <port type="UI_LEFT">
          <newseq type="standard">KEYCODE_LEFT OR KEYCODE_4_PAD </newseq>
        </port>
        <port type="UI_RIGHT">
          <newseq type="standard">KEYCODE_RIGHT OR KEYCODE_6_PAD</newseq>
        </port>
        <port type="UI_SELECT">
          <newseq type="standard">KEYCODE_ENTER OR KEYCODE_LCONTROL</newseq>
        </port>
        <port type="UI_CONFIGURE">
          <newseq type="standard">KEYCODE_TAB OR KEYCODE_1 KEYCODE_3</newseq>
        </port>
        <port type="UI_CANCEL">
          <newseq type="standard">KEYCODE_ESC OR KEYCODE_2 KEYCODE_4</newseq>
        </port>
        <port type="START1">
          <newseq type="standard">KEYCODE_1</newseq>
        </port>
        <port type="START2">
          <newseq type="standard">KEYCODE_2</newseq>
        </port>
        <port type="COIN1">
          <newseq type="standard">KEYCODE_3</newseq>
        </port>
        <port type="COIN2">
          <newseq type="standard">KEYCODE_4</newseq>
        </port>
        <port type="START3">
          <newseq type="standard">NONE</newseq>
        </port>
        <port type="START4">
          <newseq type="standard">NONE</newseq>
        </port>
        <port type="P1_JOYSTICK_UP">
          <newseq type="standard">
                    KEYCODE_8PAD
                </newseq>
        </port>
        <port type="P1_JOYSTICK_DOWN">
          <newseq type="standard">
                    KEYCODE_2PAD
                </newseq>
        </port>
        <port type="P1_JOYSTICK_LEFT">
          <newseq type="standard">
                    KEYCODE_4PAD
                </newseq>
        </port>
        <port type="P1_JOYSTICK_RIGHT">
          <newseq type="standard">
                    KEYCODE_6PAD
                </newseq>
        </port>
        <port type="P1_BUTTON1">
          <newseq type="standard">
                    GUNCODE_4_BUTTON1 OR KEYCODE_LCONTROL
                </newseq>
        </port>
        <port type="P1_BUTTON2">
          <newseq type="standard">
                    JOYCODE_1_BUTTON3 OR KEYCODE_LALT
                </newseq>
        </port>
        <port type="P1_BUTTON3">
          <newseq type="standard">
                    JOYCODE_1_BUTTON2 OR KEYCODE_SPACE
                </newseq>
        </port>
        <port type="P1_BUTTON4">
          <newseq type="standard">
                    KEYCODE_LSHIFT
                </newseq>
        </port>
        <port type="P1_BUTTON5">
          <newseq type="standard">
                    KEYCODE_Z
                </newseq>
        </port>
        <port type="P1_BUTTON6">
          <newseq type="standard">
                    KEYCODE_X
                </newseq>
        </port>
        <port type="P1_BUTTON7">
          <newseq type="standard">
                    KEYCODE_C
                </newseq>
        </port>
        <port type="P1_BUTTON8">
          <newseq type="standard">
                    KEYCODE_5
                </newseq>
        </port>
        <port type="P2_BUTTON1">
          <newseq type="standard">
                    KEYCODE_A OR GUNCODE_3_BUTTON1
                </newseq>
        </port>
        <port type="P2_BUTTON2">
          <newseq type="standard">
                    JOYCODE_2_BUTTON3 OR KEYCODE_S
                </newseq>
        </port>
        <port type="P2_BUTTON3">
          <newseq type="standard">
                    JOYCODE_2_BUTTON2 OR KEYCODE_Q
                </newseq>
        </port>
      </input>
    </controller>
    <controller id="Lightgun_Player1">
      <input>
        <port type="P1_LIGHTGUN_X">
          <newseq type="standard">
                        GUNCODE_XAXIS
                    </newseq>
        </port>
        <port type="P1_LIGHTGUN_Y">
          <newseq type="standard">
                        GUNCODE_YAXIS
                    </newseq>
        </port>
        <port type="P1_AD_STICK_X">
          <newseq type="standard">
                    GUNCODE_XAXIS
                </newseq>
        </port>
        <port type="P1_AD_STICK_Y">
          <newseq type="standard">
                    GUNCODE_YAXIS
                </newseq>
        </port>
      </input>
    </controller>
    <controller id="Lightgun_Player2">
      <input>
        <port type="P2_LIGHTGUN_X">
          <newseq type="standard">
                        GUNCODE_XAXIS
                    </newseq>
        </port>
        <port type="P2_LIGHTGUN_Y">
          <newseq type="standard">
                        GUNCODE_YAXIS
                    </newseq>
        </port>
        <port type="P2_AD_STICK_X">
          <newseq type="standard">
                    GUNCODE_XAXIS
                </newseq>
        </port>
        <port type="P2_AD_STICK_Y">
          <newseq type="standard">
                    GUNCODE_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="UI_UP">
        <newseq type="standard">KEYCODE_UP OR KEYCODE_8_PAD </newseq>
      </port>
      <port type="UI_DOWN">
        <newseq type="standard">KEYCODE_DOWN OR KEYCODE_2_PAD </newseq>
      </port>
      <port type="UI_LEFT">
        <newseq type="standard">KEYCODE_LEFT OR KEYCODE_4_PAD </newseq>
      </port>
      <port type="UI_RIGHT">
        <newseq type="standard">KEYCODE_RIGHT OR KEYCODE_6_PAD</newseq>
      </port>
      <port type="UI_SELECT">
        <newseq type="standard">KEYCODE_ENTER OR KEYCODE_LCONTROL</newseq>
      </port>
      <port type="UI_CONFIGURE">
        <newseq type="standard">KEYCODE_TAB OR KEYCODE_1 KEYCODE_3</newseq>
      </port>
      <port type="UI_CANCEL">
        <newseq type="standard">KEYCODE_ESC OR KEYCODE_2 KEYCODE_4</newseq>
      </port>
      <port type="START1">
        <newseq type="standard">KEYCODE_1</newseq>
      </port>
      <port type="START2">
        <newseq type="standard">KEYCODE_2</newseq>
      </port>
      <port type="COIN1">
        <newseq type="standard">KEYCODE_3</newseq>
      </port>
      <port type="COIN2">
        <newseq type="standard">KEYCODE_4</newseq>
      </port>
      <port type="START3">
        <newseq type="standard">NONE</newseq>
      </port>
      <port type="START4">
        <newseq type="standard">NONE</newseq>
      </port>
      <port type="P1_JOYSTICK_UP">
        <newseq type="standard">
                    KEYCODE_8PAD
                </newseq>
      </port>
      <port type="P1_JOYSTICK_DOWN">
        <newseq type="standard">
                    KEYCODE_2PAD
                </newseq>
      </port>
      <port type="P1_JOYSTICK_LEFT">
        <newseq type="standard">
                    KEYCODE_4PAD
                </newseq>
      </port>
      <port type="P1_JOYSTICK_RIGHT">
        <newseq type="standard">
                    KEYCODE_6PAD
                </newseq>
      </port>
      <port type="P1_BUTTON1">
        <newseq type="standard">
                    GUNCODE_4_BUTTON1 OR KEYCODE_LCONTROL
                </newseq>
      </port>
      <port type="P1_BUTTON2">
        <newseq type="standard">
                    JOYCODE_1_BUTTON3 OR KEYCODE_LALT
                </newseq>
      </port>
      <port type="P1_BUTTON3">
        <newseq type="standard">
                    JOYCODE_1_BUTTON2 OR KEYCODE_SPACE
                </newseq>
      </port>
      <port type="P1_BUTTON4">
        <newseq type="standard">
                    KEYCODE_LSHIFT
                </newseq>
      </port>
      <port type="P1_BUTTON5">
        <newseq type="standard">
                    KEYCODE_Z
                </newseq>
      </port>
      <port type="P1_BUTTON6">
        <newseq type="standard">
                    KEYCODE_X
                </newseq>
      </port>
      <port type="P1_BUTTON7">
        <newseq type="standard">
                    KEYCODE_C
                </newseq>
      </port>
      <port type="P1_BUTTON8">
        <newseq type="standard">
                    KEYCODE_5
                </newseq>
      </port>
      <port type="P2_BUTTON1">
        <newseq type="standard">
                    KEYCODE_A OR GUNCODE_3_BUTTON1
                </newseq>
      </port>
      <port type="P2_BUTTON2">
        <newseq type="standard">
                    JOYCODE_2_BUTTON3 OR KEYCODE_S
                </newseq>
      </port>
      <port type="P2_BUTTON3">
        <newseq type="standard">
                    JOYCODE_2_BUTTON2 OR KEYCODE_Q
                </newseq>
      </port>
      <port type="P1_LIGHTGUN_X">
        <newseq type="standard">
                        GUNCODE_4_XAXIS
                    </newseq>
      </port>
      <port type="P1_LIGHTGUN_Y">
        <newseq type="standard">
                        GUNCODE_4_YAXIS
                    </newseq>
      </port>
      <port type="P1_AD_STICK_X">
        <newseq type="standard">
                    GUNCODE_4_XAXIS
                </newseq>
      </port>
      <port type="P1_AD_STICK_Y">
        <newseq type="standard">
                    GUNCODE_4_YAXIS
                </newseq>
      </port>
      <port type="P2_LIGHTGUN_X">
        <newseq type="standard">
                        GUNCODE_2_XAXIS
                    </newseq>
      </port>
      <port type="P2_LIGHTGUN_Y">
        <newseq type="standard">
                        GUNCODE_2_YAXIS
                    </newseq>
      </port>
      <port type="P2_AD_STICK_X">
        <newseq type="standard">
                    GUNCODE_2_XAXIS
                </newseq>
      </port>
      <port type="P2_AD_STICK_Y">
        <newseq type="standard">
                    GUNCODE_2_YAXIS
                </newseq>
      </port>
    </input>
  </system>
</mameconfig>
My Super Arcade cabinet project:
Software blog article: http://bit.ly/1cWnoIC

Hardware blog article: http://bit.ly/1dWxjvP

YouTube video: http://bit.ly/1N818Xm

Super Arcade Cabinet Progress thread (Now Complete):
http://forum.arcadecontrols.com/index.php/topic,123292.0.html

Frontend Video Intro: http://bit.ly/1P9HPDN

Wade007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 309
  • A MAME cabinet at home is heaven
    • bit.ly/1cWnoIC
    • Cheapskategamer.com
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #136 on: November 10, 2013, 12:03:59 pm »
OK, I've pushed things along some more since my last post. I think I have everything set up in the Ctrl file now so my XArcade Tankstick and two ArcadeGuns (Aimtraks) to get remapped correctly on my MAME cabinet. I was able to clean up my XML coding a bit more and resolved the P2 lightgun trigger mapping issue. Keystroke arrows in MAME UI has been resolved. It had nothing to do with ControllerRemap but rather a frontend issue that got messed up somehow.

Only one question remains... correctly remapping the 2nd and 3rd buttons (JOYCODE) on the lightguns via ControllerRemap. What am I not understanding?

Each of my Aimtrak based lightguns has 3 buttons. Trigger, Reload (back) and handle.

For example if I map the following buttons (partial code) for Lightgun_Player1:

Code: [Select]
<controller id="Lightgun_Player1">
      <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_BUTTON2
                    </newseq>
        </port>
      </input>
</controller>

What results via ControllerRemap (partial code) is:

Code: [Select]
<port type="P1_BUTTON1">
        <newseq type="standard">
                    KEYCODE_LCONTROL <!-- This is correct. Mapped separately via the "keyboard" id-->
                 OR
                    GUNCODE_3_BUTTON1 <!-- This works! Trigger button remapped correctly-->
        </newseq>
      </port>
      <port type="P1_BUTTON2">
        <newseq type="standard">
                    KEYCODE_LALT <!-- This is correct. Mapped separately via the "keyboard" id-->
                 OR
                    JOYCODE_3_BUTTON3 <!-- NOT correct for the P1 gun. If mapped via MAME it should be
                                                             JOYCODE_1_BUTTON3 in order to work correctly-->
        </newseq>
      </port>
      <port type="P1_BUTTON3">
        <newseq type="standard">
                    KEYCODE_SPACE <!-- This is correct. Mapped separately via the "keyboard" id-->
                 OR
                    JOYCODE_3_BUTTON2 <!-- NOT correct for the P1 gun. If mapped via MAME it seems to be
                                                             JOYCODE_1_BUTTON2 in order to work correctly-->
        </newseq>

Similarly, the second and third buttons on the Player 2 lightgun only work when mapped (manually) to JOYCODE_2_BUTTON"X". The trigger buttons (GUNCODE) for both guns work perfectly.

Something seems off here, but I'm not sure how to fix it. Any help (drventure?).

Do I need to map the JOYCODE buttons separately somehow?

I deleted the config files for "default" and any lightgun game that uses 2 or more buttons before executing ControllerRemap, but the 2nd and 3rd "Joycode" buttons don't seem to picked up correctly. Generally, only the keyboard button gets mapped and the JOYCODE_X_BUTTONX gets left off entirely when I look at the resulting MAME config file for the desired lightgun game. What am I missing here?

Lastly, another huge THANKS for this utility. Despite my questions/concerns, this app is a huge help and greatly needed. Thanks for the time and effort to create it (drventure).
 
« Last Edit: November 10, 2013, 12:20:25 pm by Wade007 »
My Super Arcade cabinet project:
Software blog article: http://bit.ly/1cWnoIC

Hardware blog article: http://bit.ly/1dWxjvP

YouTube video: http://bit.ly/1N818Xm

Super Arcade Cabinet Progress thread (Now Complete):
http://forum.arcadecontrols.com/index.php/topic,123292.0.html

Frontend Video Intro: http://bit.ly/1P9HPDN

Wade007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 309
  • A MAME cabinet at home is heaven
    • bit.ly/1cWnoIC
    • Cheapskategamer.com
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #137 on: November 10, 2013, 02:06:59 pm »
Not quite solved but....

As a follow-up, I realized that perhaps Windows was seeing my Aimtraks as both a lightgun AND a joystick and therefore I needed to remap the controls separately.

When I run ControllerRemap /list I get a Joystick Device list as follows [brackets added]:

Code: [Select]
1. 'ATRAK Device #1' , ID=0 [This is P1 lightgun]
2. 'ATRAK Device #2' , ID=1 [This is P2 lightgun]

Mouse Device List (after listing installed mouse and trackball)
1. [...computer mouse listed here...code]
2. [...xarcade trackball listed here...code]
3. 'HID#VID_D209_PID_1602_MI_02#7_23fea4a1_0_0000#' [This is P2 lightgun]
4. 'HID#VID_D209_PID_1601_MI_02#7_6f69e7b_0_0000#' [This is P1 lightgun]

So in my XML Ctrl file I set up the following code to pick up the joystick button portion of the lightguns (Buttons 2 &3) along with the regular lightgun (which work fine) settings:

Code: [Select]
<controlleralias>
    <id>ATRAK Device #1</id>
    <alias>"Lightgun_Player1_joystickbuttons"</alias>
  </controlleralias>
  <controlleralias>
    <id>ATRAK Device #2</id>
    <alias>"Lightgun_Player2_joystickbuttons"</alias>
  </controlleralias>

<controlleralias>
    <id>HID#VID_D209_PID_1601_MI_02#7_6f69e7b_0_0000#</id>
    <alias>Lightgun_Player1</alias>
  </controlleralias>
  <controlleralias>
    <id>HID#VID_D209_PID_1602_MI_02#7_23fea4a1_0_0000#</id>
    <alias>Lightgun_Player2</alias>
  </controlleralias>

Then in the <system name="default"> area of my ctrl XML file I added the following code:

Code: [Select]
<controller id="Lightgun_Player1_joystickbuttons">
      <input>
        <port type="P1_BUTTON2">
          <newseq type="standard">
                        JOYCODE_BUTTON3
                    </newseq>
        </port>
        <port type="P1_BUTTON3">
          <newseq type="standard">
                        JOYCODE_BUTTON2
                    </newseq>
        </port>
      </input>
    </controller>
    <controller id="Lightgun_Player2_joystickbuttons">
      <input>
        <port type="P2_BUTTON2">
          <newseq type="standard">
                        JOYCODE_BUTTON3
                    </newseq>
        </port>
        <port type="P2_BUTTON3">
          <newseq type="standard">
                        JOYCODE_BUTTON2
                    </newseq>
        </port>
      </input>
    </controller>

Shouldn't this work? Trouble is...it's not. After executing ControllerRemp.exe, it still won't map the P1/P2 BUTTON2/3 buttons to JOYCODE_BUTTON"X" like its suppose to. It only maps the keyboard mappings and nothing else.  :banghead:

I'm stuck. Below is my entire current ctrl XML file written for ControllerRemp.exe. Any ideas...anyone? drventure?  :notworthy:

Code: [Select]
<!-- This file is autogenerated; comments and unknown tags will be stripped -->
<mameconfig version="10">
  <controlleralias>
    <id>HID#VID_D209_PID_1601_MI_02#7_6f69e7b_0_0000#</id>
    <alias>Lightgun_Player1</alias>
  </controlleralias>
  <controlleralias>
    <id>HID#VID_D209_PID_1602_MI_02#7_23fea4a1_0_0000#</id>
    <alias>Lightgun_Player2</alias>
  </controlleralias>
  <controlleralias>
    <id>ATRAK Device #1</id>
    <alias>"Lightgun_Player1_joystickbuttons"</alias>
  </controlleralias>
  <controlleralias>
    <id>ATRAK Device #2</id>
    <alias>"Lightgun_Player2_joystickbuttons"</alias>
  </controlleralias>
  <system name="default">
    <controller id="keyboard">
      <input>
        <port type="UI_UP">
          <newseq type="standard">KEYCODE_UP OR KEYCODE_8_PAD </newseq>
        </port>
        <port type="UI_DOWN">
          <newseq type="standard">KEYCODE_DOWN OR KEYCODE_2_PAD </newseq>
        </port>
        <port type="UI_LEFT">
          <newseq type="standard">KEYCODE_LEFT OR KEYCODE_4_PAD </newseq>
        </port>
        <port type="UI_RIGHT">
          <newseq type="standard">KEYCODE_RIGHT OR KEYCODE_6_PAD</newseq>
        </port>
        <port type="UI_SELECT">
          <newseq type="standard">KEYCODE_ENTER OR KEYCODE_LCONTROL</newseq>
        </port>
        <port type="UI_CONFIGURE">
          <newseq type="standard">KEYCODE_TAB OR KEYCODE_1 KEYCODE_3</newseq>
        </port>
        <port type="UI_CANCEL">
          <newseq type="standard">KEYCODE_ESC OR KEYCODE_2 KEYCODE_4</newseq>
        </port>
        <port type="START1">
          <newseq type="standard">KEYCODE_1 OR ENTER</newseq>
        </port>
        <port type="START2">
          <newseq type="standard">KEYCODE_2</newseq>
        </port>
        <port type="COIN1">
          <newseq type="standard">KEYCODE_3</newseq>
        </port>
        <port type="COIN2">
          <newseq type="standard">KEYCODE_4</newseq>
        </port>
        <port type="START3">
          <newseq type="standard">NONE</newseq>
        </port>
        <port type="START4">
          <newseq type="standard">NONE</newseq>
        </port>
        <port type="P1_JOYSTICK_UP">
          <newseq type="standard">
                    KEYCODE_8PAD
                </newseq>
        </port>
        <port type="P1_JOYSTICK_DOWN">
          <newseq type="standard">
                    KEYCODE_2PAD
                </newseq>
        </port>
        <port type="P1_JOYSTICK_LEFT">
          <newseq type="standard">
                    KEYCODE_4PAD
                </newseq>
        </port>
        <port type="P1_JOYSTICK_RIGHT">
          <newseq type="standard">
                    KEYCODE_6PAD
                </newseq>
        </port>
        <port type="P1_BUTTON1">
          <newseq type="standard">
                    KEYCODE_LCONTROL
                </newseq>
        </port>
        <port type="P1_BUTTON2">
          <newseq type="standard">
                    KEYCODE_LALT
                </newseq>
        </port>
        <port type="P1_BUTTON3">
          <newseq type="standard">
                    KEYCODE_SPACE
                </newseq>
        </port>
        <port type="P1_BUTTON4">
          <newseq type="standard">
                    KEYCODE_LSHIFT
                </newseq>
        </port>
        <port type="P1_BUTTON5">
          <newseq type="standard">
                    KEYCODE_Z
                </newseq>
        </port>
        <port type="P1_BUTTON6">
          <newseq type="standard">
                    KEYCODE_X
                </newseq>
        </port>
        <port type="P1_BUTTON7">
          <newseq type="standard">
                    KEYCODE_C
                </newseq>
        </port>
        <port type="P1_BUTTON8">
          <newseq type="standard">
                    KEYCODE_5
                </newseq>
        </port>
        <port type="P2_BUTTON1">
          <newseq type="standard">
                    KEYCODE_A
                </newseq>
        </port>
        <port type="P2_BUTTON2">
          <newseq type="standard">
                    KEYCODE_S
                </newseq>
        </port>
        <port type="P2_BUTTON3">
          <newseq type="standard">
                    KEYCODE_Q
                </newseq>
        </port>
        <port type="P2_BUTTON4">
          <newseq type="standard">
                    KEYCODE_W         
                </newseq>
        </port>
        <port type="P2_BUTTON5">
          <newseq type="standard">
                    KEYCODE_E         
                </newseq>
        </port>
        <port type="P2_BUTTON6">
          <newseq type="standard">
                    KEYCODE_OPENBRACE 
                </newseq>
        </port>
        <port type="P2_BUTTON7">
          <newseq type="standard">
                    KEYCODE_CLOSEBRACE
                </newseq>
        </port>
        <port type="P2_BUTTON8">
          <newseq type="standard">
                    KEYCODE_6
                </newseq>
        </port>
      </input>
    </controller>
    <controller id="Lightgun_Player1">
      <input>
        <port type="P1_BUTTON1">
          <newseq type="standard">
                        GUNCODE_BUTTON1
                    </newseq>
        </port>
        <port type="P1_LIGHTGUN_X">
          <newseq type="standard">
                        GUNCODE_XAXIS
                    </newseq>
        </port>
        <port type="P1_LIGHTGUN_Y">
          <newseq type="standard">
                        GUNCODE_YAXIS
                    </newseq>
        </port>
        <port type="P1_AD_STICK_X">
          <newseq type="standard">
                    GUNCODE_XAXIS
                </newseq>
        </port>
        <port type="P1_AD_STICK_Y">
          <newseq type="standard">
                    GUNCODE_YAXIS
                </newseq>
        </port>
      </input>
    </controller>
    <controller id="Lightgun_Player2">
      <input>
        <port type="P2_BUTTON1">
          <newseq type="standard">
                        GUNCODE_BUTTON1
                    </newseq>
        </port>
        <port type="P2_LIGHTGUN_X">
          <newseq type="standard">
                        GUNCODE_XAXIS
                    </newseq>
        </port>
        <port type="P2_LIGHTGUN_Y">
          <newseq type="standard">
                        GUNCODE_YAXIS
                    </newseq>
        </port>
        <port type="P2_AD_STICK_X">
          <newseq type="standard">
                    GUNCODE_XAXIS
                </newseq>
        </port>
        <port type="P2_AD_STICK_Y">
          <newseq type="standard">
                    GUNCODE_YAXIS
                </newseq>
        </port>
      </input>
    </controller>
    <controller id="Lightgun_Player1_joystickbuttons">
      <input>
        <port type="P1_BUTTON2">
          <newseq type="standard">
                        JOYCODE_BUTTON3
                    </newseq>
        </port>
        <port type="P1_BUTTON3">
          <newseq type="standard">
                        JOYCODE_BUTTON2
                    </newseq>
        </port>
      </input>
    </controller>
    <controller id="Lightgun_Player2_joystickbuttons">
      <input>
        <port type="P2_BUTTON2">
          <newseq type="standard">
                        JOYCODE_BUTTON3
                    </newseq>
        </port>
        <port type="P2_BUTTON3">
          <newseq type="standard">
                        JOYCODE_BUTTON2
                    </newseq>
        </port>
      </input>
    </controller>
    <!--
        ###################################################
        ACTUAL INPUT MAPPING STARTS HERE
        DO NOT actually put anything in this section.
        It is completely cleared and regenerated!
        ###################################################
     -->
    <crosshairs>
      <crosshair player="0" mode="0" />
      <crosshair player="1" mode="0" />
    </crosshairs>
    <input>
      <port type="UI_UP">
        <newseq type="standard">KEYCODE_UP OR KEYCODE_8_PAD </newseq>
      </port>
      <port type="UI_DOWN">
        <newseq type="standard">KEYCODE_DOWN OR KEYCODE_2_PAD </newseq>
      </port>
      <port type="UI_LEFT">
        <newseq type="standard">KEYCODE_LEFT OR KEYCODE_4_PAD </newseq>
      </port>
      <port type="UI_RIGHT">
        <newseq type="standard">KEYCODE_RIGHT OR KEYCODE_6_PAD</newseq>
      </port>
      <port type="UI_SELECT">
        <newseq type="standard">KEYCODE_ENTER OR KEYCODE_LCONTROL</newseq>
      </port>
      <port type="UI_CONFIGURE">
        <newseq type="standard">KEYCODE_TAB OR KEYCODE_1 KEYCODE_3</newseq>
      </port>
      <port type="UI_CANCEL">
        <newseq type="standard">KEYCODE_ESC OR KEYCODE_2 KEYCODE_4</newseq>
      </port>
      <port type="START1">
        <newseq type="standard">KEYCODE_1 OR ENTER</newseq>
      </port>
      <port type="START2">
        <newseq type="standard">KEYCODE_2</newseq>
      </port>
      <port type="COIN1">
        <newseq type="standard">KEYCODE_3</newseq>
      </port>
      <port type="COIN2">
        <newseq type="standard">KEYCODE_4</newseq>
      </port>
      <port type="START3">
        <newseq type="standard">NONE</newseq>
      </port>
      <port type="START4">
        <newseq type="standard">NONE</newseq>
      </port>
      <port type="P1_JOYSTICK_UP">
        <newseq type="standard">
                    KEYCODE_8PAD
                </newseq>
      </port>
      <port type="P1_JOYSTICK_DOWN">
        <newseq type="standard">
                    KEYCODE_2PAD
                </newseq>
      </port>
      <port type="P1_JOYSTICK_LEFT">
        <newseq type="standard">
                    KEYCODE_4PAD
                </newseq>
      </port>
      <port type="P1_JOYSTICK_RIGHT">
        <newseq type="standard">
                    KEYCODE_6PAD
                </newseq>
      </port>
      <port type="P1_BUTTON1">
        <newseq type="standard">
                    KEYCODE_LCONTROL
                 OR
                        GUNCODE_4_BUTTON1
                    </newseq>
      </port>
      <port type="P1_BUTTON2">
        <newseq type="standard">
                    KEYCODE_LALT
                </newseq>
      </port>
      <port type="P1_BUTTON3">
        <newseq type="standard">
                    KEYCODE_SPACE
                </newseq>
      </port>
      <port type="P1_BUTTON4">
        <newseq type="standard">
                    KEYCODE_LSHIFT
                </newseq>
      </port>
      <port type="P1_BUTTON5">
        <newseq type="standard">
                    KEYCODE_Z
                </newseq>
      </port>
      <port type="P1_BUTTON6">
        <newseq type="standard">
                    KEYCODE_X
                </newseq>
      </port>
      <port type="P1_BUTTON7">
        <newseq type="standard">
                    KEYCODE_C
                </newseq>
      </port>
      <port type="P1_BUTTON8">
        <newseq type="standard">
                    KEYCODE_5
                </newseq>
      </port>
      <port type="P2_BUTTON1">
        <newseq type="standard">
                    KEYCODE_A
                 OR
                        GUNCODE_2_BUTTON1
                    </newseq>
      </port>
      <port type="P2_BUTTON2">
        <newseq type="standard">
                    KEYCODE_S
                </newseq>
      </port>
      <port type="P2_BUTTON3">
        <newseq type="standard">
                    KEYCODE_Q
                </newseq>
      </port>
      <port type="P2_BUTTON4">
        <newseq type="standard">
                    KEYCODE_W         
                </newseq>
      </port>
      <port type="P2_BUTTON5">
        <newseq type="standard">
                    KEYCODE_E         
                </newseq>
      </port>
      <port type="P2_BUTTON6">
        <newseq type="standard">
                    KEYCODE_OPENBRACE 
                </newseq>
      </port>
      <port type="P2_BUTTON7">
        <newseq type="standard">
                    KEYCODE_CLOSEBRACE
                </newseq>
      </port>
      <port type="P2_BUTTON8">
        <newseq type="standard">
                    KEYCODE_6
                </newseq>
      </port>
      <port type="P1_LIGHTGUN_X">
        <newseq type="standard">
                        GUNCODE_4_XAXIS
                    </newseq>
      </port>
      <port type="P1_LIGHTGUN_Y">
        <newseq type="standard">
                        GUNCODE_4_YAXIS
                    </newseq>
      </port>
      <port type="P1_AD_STICK_X">
        <newseq type="standard">
                    GUNCODE_4_XAXIS
                </newseq>
      </port>
      <port type="P1_AD_STICK_Y">
        <newseq type="standard">
                    GUNCODE_4_YAXIS
                </newseq>
      </port>
      <port type="P2_LIGHTGUN_X">
        <newseq type="standard">
                        GUNCODE_2_XAXIS
                    </newseq>
      </port>
      <port type="P2_LIGHTGUN_Y">
        <newseq type="standard">
                        GUNCODE_2_YAXIS
                    </newseq>
      </port>
      <port type="P2_AD_STICK_X">
        <newseq type="standard">
                    GUNCODE_2_XAXIS
                </newseq>
      </port>
      <port type="P2_AD_STICK_Y">
        <newseq type="standard">
                    GUNCODE_2_YAXIS
                </newseq>
      </port>
    </input>
  </system>
</mameconfig>



[EDIT - Final solution] I finally just decided to just hard-code the JOYCODE buttons 2 & 3 on my lightguns for Player 1 and Player 2 in the Keyboard ID area as they come up in MAME. These buttons don't seem to get messed up like the GUNCODE IDs often do upon Windows bootup. I just mapped them directly and they seem to work fine. No need to try and map them as a joystick controller separately after all. Unless anyone else has a new idea or solution, I'm going with this one. I then created a BAT file to launch ControllerRemap.exe and put a shortcut to the BAT file in my Windows/Startup menu. Done.

Thought I'd post here in case anyone else was using AimTrak/Arcade Guns. Thanks again drventure for this utility. Definitely solves a concern I had for a long time. Nice work!!
« Last Edit: November 13, 2013, 01:34:17 pm by Wade007 »
My Super Arcade cabinet project:
Software blog article: http://bit.ly/1cWnoIC

Hardware blog article: http://bit.ly/1dWxjvP

YouTube video: http://bit.ly/1N818Xm

Super Arcade Cabinet Progress thread (Now Complete):
http://forum.arcadecontrols.com/index.php/topic,123292.0.html

Frontend Video Intro: http://bit.ly/1P9HPDN

MydknyteStyrm

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 294
  • Makeup FX Gamer
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #138 on: November 26, 2013, 02:22:56 pm »
I was wondering if this utility was necessary if I was planning my cab to NOT have any control unplugged. Everything I put in is staying. Does Windows change my ID's on powering up and down? Thanks!

Wade007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 309
  • A MAME cabinet at home is heaven
    • bit.ly/1cWnoIC
    • Cheapskategamer.com
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #139 on: November 26, 2013, 07:05:30 pm »

Quote
I was wondering if this utility was necessary if I was planning my cab to NOT have any control unplugged. Everything I put in is staying. Does Windows change my ID's on powering up and down? Thanks!

Others can chime in here regarding their own situations, but for me the answer to your question is a resounding "YES".

I have two AimTrak guns that NEVER get unplugged, but Windows  often changes their IDs upon boot-up of my cabinet system, making MAME lightguns games temporarily not work. I knew how to fix it, but it was a bother to have to reconfigure the guns occasionally, and then cross my fingers that Windows wouldn't change the IDs again on the next boot-up. It was a concern I had for quite a while. One that I brought up to Arcade Guns owner, Eric Harbo. He's the one who showed me this thread.

This utility fixed the problem for me. :)
« Last Edit: November 26, 2013, 07:07:31 pm by Wade007 »
My Super Arcade cabinet project:
Software blog article: http://bit.ly/1cWnoIC

Hardware blog article: http://bit.ly/1dWxjvP

YouTube video: http://bit.ly/1N818Xm

Super Arcade Cabinet Progress thread (Now Complete):
http://forum.arcadecontrols.com/index.php/topic,123292.0.html

Frontend Video Intro: http://bit.ly/1P9HPDN

lemonflavoured

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 22
  • I want to build my own arcade controls!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #140 on: December 03, 2013, 09:49:21 am »
I've just a quick question on the way this utility works. I have 2 trackballs in my cab which love changing ID so for instance trackball 1 is showing as mouse 4 in mame and on reboot it becomes mouse2. Does this utility simply rebind everything that was mouse 4 to mouse2 and just keeps the mame bindings up to date or does it perform some other kind of trickery where make still sees trackball 1 as mouse 4?

Connorsdad

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 268
  • I want to build my own arcade controls!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #141 on: December 03, 2013, 11:29:25 am »
I was wondering if this utility was necessary if I was planning my cab to NOT have any control unplugged. Everything I put in is staying. Does Windows change my ID's on powering up and down? Thanks!

I have each aimtrak and my spinner/trackball plugged into different USB ports/USB Controllers on the MB, as long as I don't unplug them the id's stick, most of the time. Roughly 1 out of every 5 boots, at least one of the id's has changed but if I reboot, the id's return as before. If you plan on using mame only then by all means this app is the best option, but, if you plan on also running model3/model2 emulators I would suggest trying out the different port trick.
    

eustonr

  • Trade Count: (0)
  • Newbie
  • *
  • Offline Offline
  • Posts: 1
  • I want to build my own arcade controls!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #142 on: April 03, 2014, 05:41:18 am »
Hi,

I've had the issue with Mame, and USB controllers that ControllerRemap is designed to fix - My system consists of:

2 Ultra Sticks
2 Aimtrak lightguns
1 UTrak Trackball
1 MinI-PAC Board

I dont use the UTrak controller for the trackball - to save USB ports, I wired the trackball into the Mini-PAC board. The MiniPAC has an onboard mouse controller (designed for Trackballs), so a separate board becomes unnecessary.

The issue I have is :

ControllerRemap identifies the 2 Ultra sticks, and also the 2 Aimtraks - but it doesnt see the Mini-PAC.

That would be fine, but all 3 are USB controllers, and all 3 register as mouse controllers to Mame.

When I first installed ControllerMap and configured it, it worked ok for a while. Then after a few reboots Gun 1 stopped working, and Gun 2 was being seen by Mame as Gun 1. Drove me nuts for a while - until I realised that the Mini-PAC was being seen by Mame as the 3rd mouse controller. The 2 Ultra Sticks were being seen first (and always seemed to be) The lightguns were being seen as the 4th and 5th controllers.

But controllerremap ./list only shows the 2 sticks and 2 guns. ControllerRemap was therefore mapping (correctly) stick 1 and 2 to controller 1 & 2 - but incorrectly  remapping the guns to controllers 3 and 4. (instead of 4 and 5). It worked at first because the trackball (MiniPAC) was being seen last on those reboots where the setup worked..

After a few frustrating hours, I finally worked it out - and put in a temporary work around. I am able to force the MiniPAC to being seen last by windows on every reboot, by plugging the MiniPAC into a USB hub, and plugging that hub into the last numbered USB port on my motherboard. It works for now, but it would be nice not to have to use a hub in my Cabinet!

I could rewire the whole cabinet, and start using the seperate UTrack Trackball controller instead of the MiniPAC (and disable the onboard Trackball controller) - but there's no guarantee that will work either (as ControlerRemap may not see the UTrack controller either)

Any ideas?

thanks

stigzler

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 860
  • It seemed like a good idea at the time....
    • Mago Arcade
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #143 on: April 10, 2014, 04:48:28 pm »
Hmmm, this looks great but cannot get working...

The DOS error:



The ctrlr cfg file:

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>HID#VID_D209_PID_1603_MI_02#7_27d3a5f8</id>
    <alias>Lightgun1</alias>
  </controlleralias>
  <controlleralias>
    <id>HID#VID_D209_PID_1604_MI_02#7_37a156</id>
    <alias>Lightgun2</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="Lightgun1">
      <input>
        <port type="P1_LIGHTGUN_X">
          <newseq type="standard">
                        GUNCODE_XAXIS
                    </newseq>
        </port>
        <port type="P1_LIGHTGUN_Y">
          <newseq type="standard">
                        GUNCODE_YAXIS
                    </newseq>
        </port>
      </input>
    </controller>
    <controller id="Lightgun2">
      <input>
        <port type="P2_LIGHTGUN_X">
          <newseq type="standard">
                        GUNCODE_XAXIS
                    </newseq>
        </port>
        <port type="P2_LIGHTGUN_Y">
          <newseq type="standard">
                        GUNCODE_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_LIGHTGUN_X">
        <newseq type="standard">
                        GUNCODE_3_XAXIS
                    </newseq>
      </port>
      <port type="P1_LIGHTGUN_Y">
        <newseq type="standard">
                        GUNCODE_3_YAXIS
                    </newseq>
      </port>
      <port type="P2_LIGHTGUN_X">
        <newseq type="standard">
                        GUNCODE_5_XAXIS
                    </newseq>
      </port>
      <port type="P2_LIGHTGUN_Y">
        <newseq type="standard">
                        GUNCODE_5_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>

Command line:

C:\Emulators\Mame0149b\mame64.exe ptblank -rompath "J:\roms" -joy -skip_gameinfo -nowindow -video d3d -noswitchres -triplebuffer -ctrlr MyArcade2

 :dunno Any ideas??


nick3092

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 206
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #144 on: April 12, 2014, 07:56:29 am »
Hmmm, this looks great but cannot get working...

The DOS error:



The ctrlr cfg file:

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>HID#VID_D209_PID_1603_MI_02#7_27d3a5f8</id>
    <alias>Lightgun1</alias>
  </controlleralias>
  <controlleralias>
    <id>HID#VID_D209_PID_1604_MI_02#7_37a156</id>
    <alias>Lightgun2</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="Lightgun1">
      <input>
        <port type="P1_LIGHTGUN_X">
          <newseq type="standard">
                        GUNCODE_XAXIS
                    </newseq>
        </port>
        <port type="P1_LIGHTGUN_Y">
          <newseq type="standard">
                        GUNCODE_YAXIS
                    </newseq>
        </port>
      </input>
    </controller>
    <controller id="Lightgun2">
      <input>
        <port type="P2_LIGHTGUN_X">
          <newseq type="standard">
                        GUNCODE_XAXIS
                    </newseq>
        </port>
        <port type="P2_LIGHTGUN_Y">
          <newseq type="standard">
                        GUNCODE_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_LIGHTGUN_X">
        <newseq type="standard">
                        GUNCODE_3_XAXIS
                    </newseq>
      </port>
      <port type="P1_LIGHTGUN_Y">
        <newseq type="standard">
                        GUNCODE_3_YAXIS
                    </newseq>
      </port>
      <port type="P2_LIGHTGUN_X">
        <newseq type="standard">
                        GUNCODE_5_XAXIS
                    </newseq>
      </port>
      <port type="P2_LIGHTGUN_Y">
        <newseq type="standard">
                        GUNCODE_5_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>

Command line:

C:\Emulators\Mame0149b\mame64.exe ptblank -rompath "J:\roms" -joy -skip_gameinfo -nowindow -video d3d -noswitchres -triplebuffer -ctrlr MyArcade2

 :dunno Any ideas??

Unfortunately MAME doesn't differentiate between "could not load file" and "file not found".  Most likely you are experiencing the latter.  Make sure you have the file in your ctrlr folder.  If it is, maybe you have the ctrlr directory set wrong in your mame.ini file.  Should look something like this (which btw, you can shorten your command line by setting options that don't change in here):

Code: [Select]
#
# CORE SEARCH PATH OPTIONS
#
rompath                   roms;chds
hashpath                  hash
samplepath                samples
artpath                   artwork
ctrlrpath                 ctrlr
inipath                   .;ini
fontpath                  .
cheatpath                 cheat
crosshairpath             crosshair


stigzler

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 860
  • It seemed like a good idea at the time....
    • Mago Arcade
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #145 on: April 12, 2014, 04:25:38 pm »
Thanks Nick, but that didn't work either. :(

I have two ini files - one in root mame directory and the other in the INI folder under root. I changed both to:

Code: [Select]
rompath                   J:\roms
hashpath                  hash
samplepath                samples
artpath                   artwork
ctrlrpath                 C:\Emulators\Mame0149b\ctrlr
inipath                   ini
fontpath                  .
cheatpath                 cheat
crosshairpath             crosshair

Still no joy. :( Any other ideas?

stigzler

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 860
  • It seemed like a good idea at the time....
    • Mago Arcade
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #146 on: April 13, 2014, 03:35:05 am »
Update - it appears as though it is my MAME setup, somehow. I tried with the "Hotrod" ctrlr file and still no joy. Doesn't make any sense to me this, though. mame.ini is pointing towards the ctrlr folder in mame root. But appears not to be reading this.

My mame.ini file in mame root:

Code: [Select]
#
# CORE CONFIGURATION OPTIONS
#
readconfig                1
writeconfig               0

#
# CORE SEARCH PATH OPTIONS
#
rompath                   J:\roms
hashpath                  hash
samplepath                samples
artpath                   artwork
ctrlrpath                 ctrlr
inipath                   .;ini
fontpath                  .
cheatpath                 cheat
crosshairpath             crosshair

#
# CORE OUTPUT DIRECTORY OPTIONS
#
cfg_directory             cfg
nvram_directory           nvram
memcard_directory         memcard
input_directory           inp
state_directory           sta
snapshot_directory        snap
diff_directory            diff
comment_directory         comments

#
# CORE OUTPUT DIRECTORY OPTIONS
#
hiscore_directory         hi

#
# CORE STATE/PLAYBACK OPTIONS
#
state                     
autosave                  0
playback                 
record                   
mngwrite                 
aviwrite                 
wavwrite                 
snapname                  %g/%i
snapsize                  auto
snapview                  internal
burnin                    0

#
# CORE PERFORMANCE OPTIONS
#
autoframeskip             0
frameskip                 0
seconds_to_run            0
throttle                  1
sleep                     1
speed                     1.0
refreshspeed              0

#
# CORE ROTATION OPTIONS
#
rotate                    1
ror                       0
rol                       0
autoror                   0
autorol                   0
flipx                     0
flipy                     0

#
# CORE ARTWORK OPTIONS
#
artwork_crop              1
use_backdrops             1
use_overlays              1
use_bezels                1
use_cpanels               1
use_marquees              1

#
# CORE SCREEN OPTIONS
#
brightness                1.0
contrast                  1.0
gamma                     1.0
pause_brightness          0.65
effect                    none

#
# CORE VECTOR OPTIONS
#
antialias                 1
beam                      1.0
flicker                   0

#
# CORE SOUND OPTIONS
#
sound                     1
samplerate                48000
samples                   1
volume                    0

#
# CORE INPUT OPTIONS
#
coin_lockout              1
ctrlr                     
mouse                     1
joystick                  1
lightgun                  1
multikeyboard             0
multimouse                0
steadykey                 0
ui_active                 0
offscreen_reload          1
joystick_map              auto
joystick_deadzone         0.3
joystick_saturation       0.85
natural                   0
joystick_contradictory    0
coin_impulse              0

#
# CORE INPUT AUTOMATIC ENABLE OPTIONS
#
paddle_device             keyboard
adstick_device            keyboard
pedal_device              keyboard
dial_device               keyboard
trackball_device          keyboard
lightgun_device           keyboard
positional_device         keyboard
mouse_device              mouse

#
# CORE DEBUGGING OPTIONS
#
log                       0
verbose                   0
update_in_pause           0
debug                     0
debugscript               
debug_internal            0

#
# CORE MISC OPTIONS
#
bios                     
cheat                     0
skip_gameinfo             0
uifont                    default
ramsize                   
confirm_quit              0
ui_mouse                  0

#
# CORE MKChamp OPTIONS
#
disable_hiscore_patch     0
disable_nagscreen_patch   0
disable_loading_patch     0

#
# WINDOWS DEBUGGING OPTIONS
#
oslog                     0
watchdog                  0
debugger_font             "Lucida Console"
debugger_font_size        9

#
# WINDOWS PERFORMANCE OPTIONS
#
priority                  0
multithreading            1
numprocessors             auto
profile                   0
bench                     0

#
# WINDOWS VIDEO OPTIONS
#
video                     d3d
numscreens                1
window                    0
maximize                  1
keepaspect                1
prescale                  1
waitvsync                 0
syncrefresh               0
menu                      0

#
# DIRECTDRAW-SPECIFIC OPTIONS
#
hwstretch                 1

#
# DIRECT3D-SPECIFIC OPTIONS
#
d3dversion                8
filter                    1

#
# DIRECT3D POST-PROCESSING OPTIONS
#
hlsl_enable               1
hlslpath                  hlsl
hlsl_ini_read             0
hlsl_ini_write            0
hlslini                   %g
hlsl_prescale_x           0
hlsl_prescale_y           0
hlsl_preset               -1
hlsl_write               
hlsl_snap_width           2048
hlsl_snap_height          1536
shadow_mask_alpha         0.0
shadow_mask_texture       aperture.png
shadow_mask_x_count       320
shadow_mask_y_count       240
shadow_mask_usize         0.09375
shadow_mask_vsize         0.109375
curvature                 0.0
pincushion                0.0
scanline_alpha            0.0
scanline_size             1.0
scanline_height           0.7
scanline_bright_scale     1.0
scanline_bright_offset    0.0
scanline_jitter           0.0
defocus                   0.0,0.0
converge_x                0.0,0.0,0.0
converge_y                0.0,0.0,0.0
radial_converge_x         0.0,0.0,0.0
radial_converge_y         0.0,0.0,0.0
red_ratio                 1.0,0.0,0.0
grn_ratio                 0.0,1.0,0.0
blu_ratio                 0.0,0.0,1.0
saturation                1.0
offset                    0.0,0.0,0.0
scale                     1.0,1.0,1.0
power                     1.0,1.0,1.0
floor                     0.0,0.0,0.0
phosphor_life             0.0,0.0,0.0
yiq_enable                0
yiq_cc                    3.59754545
yiq_a                     0.5
yiq_b                     0.5
yiq_o                     0.0
yiq_p                     1.0
yiq_n                     1.0
yiq_y                     6.0
yiq_i                     1.2
yiq_q                     0.6
yiq_scan_time             52.6
yiq_phase_count           2

#
# PER-WINDOW VIDEO OPTIONS
#
screen                    auto
aspect                    auto
resolution                auto
view                      auto
screen0                   auto
aspect0                   auto
resolution0               auto
view0                     auto
screen1                   auto
aspect1                   auto
resolution1               auto
view1                     auto
screen2                   auto
aspect2                   auto
resolution2               auto
view2                     auto
screen3                   auto
aspect3                   auto
resolution3               auto
view3                     auto

#
# FULL SCREEN OPTIONS
#
triplebuffer              0
switchres                 0
full_screen_brightness    1.0
full_screen_contrast      1.0
full_screen_gamma         1.0

#
# WINDOWS SOUND OPTIONS
#
audio_latency             2

#
# INPUT DEVICE OPTIONS
#
dual_lightgun             0


Any ideas?
« Last Edit: April 13, 2014, 04:02:03 am by stigzler »

stigzler

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 860
  • It seemed like a good idea at the time....
    • Mago Arcade
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #147 on: September 15, 2014, 12:31:58 pm »
Just come back to this, and getting stuck at exactly the same place.....

Again, has anyone had any success with this? Just can't get any further....

mmg1design

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 14
  • I want to build my own arcade controls!
    • My Website
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #148 on: September 15, 2014, 05:29:36 pm »
Just come back to this, and getting stuck at exactly the same place.....

Again, has anyone had any success with this? Just can't get any further....


I ran into this problem a while back. I Can't remember exactly what I did to make it work, but once it worked I couldn't recreate the error again. Try this;

(you have your roms in a different drive, I would put just one rom in the default rom folder to test)


1. Delete the current mame.ini at the root of mame. (backup the file if you have custom settings)

2. Delete the mame.ini in the ini folder (don't have two mame.ini's because that just complicates it)

3. run mame to confirm that it runs without errors and it will load just the default settings. Exit out of mame.

4. create a new mame.ini, "mame.exe -cc"

5. Edit that new mame.ini that is in the root, Add the name of your controller to it.

6. Run mame again and see if it loads your controller


Hope that works.


Instruction Cards for Street fighter games and other fighting genre. Download Here

stigzler

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 860
  • It seemed like a good idea at the time....
    • Mago Arcade
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #149 on: September 16, 2014, 09:28:54 am »

5. Edit that new mame.ini that is in the root, Add the name of your controller to it.

Hope that works.

thanks mmg1 - nice of someone to take the time to try and help. I'm a bit loathe to go messing with the ini's as have other settings in there that does various things and don't want to loose them!! However - getting nowhere fast with this + may have to give it a go.

However, I don't quite get your point 5 above - when you say add name of controller to it - what do I put where - can't see any section in the ini for this!

I'm wondering whether it's something wrong with the xml format and that's why mame can't load it - the xml is above.

thanks

stigzler

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 860
  • It seemed like a good idea at the time....
    • Mago Arcade
ControllerRemap ABC Guide
« Reply #150 on: September 24, 2014, 09:41:35 pm »
OK - bit the bullet and chased this down to the ground!! Took me a day and a half, but finally licked it! Great application DrVenture!! Soo sweet now set up and MAME's a happy beast with all my USB hot-swapping!

One thing I've gathered is that quite a few people have had difficulties getting their heads around how to set this up. So, I've made a simple A, B, C guide with screenshots and stuff to help anyone out who's approaching this for the first time. Doubled the time it took me, but I'm very much for helping out the next guy. :)

It also contains a script to make testing easier and also some other support files.

You can grab it here:
https://dl.dropboxusercontent.com/u/15144043/ControllerRemapGuide/ControllerRemapGuide.zip

I'm hoping it'll reduce the time to get this up and running from a day and a half to maybe even an hour!

Let me know if any mistakes/improvement needed. :)

« Last Edit: September 25, 2014, 10:24:53 am by stigzler »

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #151 on: November 15, 2014, 03:07:41 pm »
Sorry guys, haven't had chance to visit much lately, but I'll try to hit on some questions now.

I was wondering if this utility was necessary if I was planning my cab to NOT have any control unplugged. Everything I put in is staying. Does Windows change my ID's on powering up and down? Thanks!

In my experience, YES. At least with Vista, and win7.

Haven't had a chance to work much with Win8 yet

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #152 on: November 15, 2014, 03:10:13 pm »
I've just a quick question on the way this utility works. I have 2 trackballs in my cab which love changing ID so for instance trackball 1 is showing as mouse 4 in mame and on reboot it becomes mouse2. Does this utility simply rebind everything that was mouse 4 to mouse2 and just keeps the mame bindings up to date or does it perform some other kind of trickery where make still sees trackball 1 as mouse 4?

That's pretty much exactly what it does.

You add definitions (Controller aliases, etc) in the config file. Mame ignores it but ControllerRemap uses that to ID what device is what ID, then rewrites the rest of the config file to use the proper IDs for the controls, whatever they are at the point that it was run (it's not dynamic, it doesn't sit and monitor for device swaps or anything like that)

That's why you need to set up so that controllerremap is run right before you start mame.

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #153 on: November 15, 2014, 03:29:30 pm »
Thanks Nick, but that didn't work either. :(
I have two ini files - one in root mame directory and the other in the INI folder under root. I changed both to:
Code: [Select]
rompath                   J:\roms
hashpath                  hash
samplepath                samples
artpath                   artwork
ctrlrpath                 C:\Emulators\Mame0149b\ctrlr
inipath                   ini
fontpath                  .
cheatpath                 cheat
crosshairpath             crosshair

Still no joy. :( Any other ideas?


Let's see if I can help any.

First, simple stuff (you've probably already done this but just in case...)
Mame.ini is in the \mame\ini folder

mame.ini contains a ctrlrpath line that should contain ctrlr as the value.

Create a file in ctrlr folder, call it MyController.cfg or somesuch

That's the CFG file that should contain the controllerremap configs, it's XML, and it'll need to be structured properly or mame won't load it (and I believe it fails silently, so you won't +know+ that it didn't load it. Ugh.


Get the CFG all set up and run
controllerremap /remap:{path}MyController.cfg

(I usually set the above up in a bat file called remap.bat, or just R.BAT so I don't have to type the command all the time.

First , If you look at that file, does it look like the INPUT sections got rewritten at all? Make a back up and compare them if you're not sure.
If that part appears to be working right copy and paste the XML file into one of the online XML checkers.

Like this one
http://www.xmlvalidation.com/

If it checks out, move on to the next step.



Ok. Just Saw Stigzler's write up. Very nice.

One thing to point out is that ControllerRemap has NOTHING to do with the mame.ini file.

It doesn't even use the MAME.INI file to locate the CFG file (you need to put the full path on the command line).


Another thing that can be VERY helpful, is to generate the MAP file (Via /save), then use that with the /TESTMAP command.
Check out the map file, it's a pretty straightforward file. Swap some sections around to +simulate+ controllers being unplugged and replugged, save several different MAP files, then use the /TESTMAP:filename command to swap between the maps and see out the INPUT ports are rewritten.

An editor that will automatically reload files when they're changed externally is a HUGE help for this (personally I like RJTextEd as a good free windows editor.

http://www.rj-texted.se/


drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #154 on: November 15, 2014, 03:33:36 pm »
@stigzler

Glad to see you got it working! I apologize that I wasn't more help earlier.

If you have any suggestions (other than adding a GUI  ;D ) feel free to throw em out there.

I know the app isn't the most user friendly of tools right now. I've been thinking of how I might "nice it up" a bit, but really, getting MAME controls configured right is kind of a tough thing to do, even in the best of circumstances, so I haven't had much luck coming up with improvements (over and above just adding this kind of remap capability to MAME directly, which I've seriously contemplated, but just don't have the time right now.)

Any hardcore C devs that want to take that on, I'd definitely throw in with, though!


drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #155 on: November 15, 2014, 03:38:07 pm »
@stigzler

Damn, nice job on that guide!

Would you mind if I included it in the ControllerRemap Zip?

Of course, I'd leave it as is with full attribution. I'm just thinking it might help people out to get two distinct views on the process.

Thanks again for writing that up!

stigzler

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 860
  • It seemed like a good idea at the time....
    • Mago Arcade
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #156 on: November 15, 2014, 04:08:31 pm »
No worries and feel free to include. :)

Thanks for a good app.  :applaud:

bsong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19
  • I want to build my own arcade controls!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #157 on: November 20, 2014, 02:36:15 pm »
Great utility you have here if i could get it to work ... its been driving me up the walls.  First off when i test it using the utility it remaps everything correctly, when i launch MAME it seems like nothing is getting remapped I have a smilier setup to WADE007,

also when i launch hyperspin and i press the start button all the keys go blank as if nothing got assigned at all

can someone please help?

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #158 on: November 20, 2014, 02:53:13 pm »
Sorry you're having troubles. Let's take a look at a few things

also when i launch hyperspin and i press the start button all the keys go blank as if nothing got assigned at all

This one's likely the easiest, you'll need a <controller id='keyboard' section in <system name="default">, or no keys will be mapped. This is because ControllerRemap doesn't "merge" mappings into the configuration, it clears and then rewrites the entire <system><input> section and that's the only section that MAME reads when loading the configuration up.


First off when i test it using the utility it remaps everything correctly, when i launch MAME it seems like nothing is getting remapped I have a smilier setup to WADE007,

if it's working when you test it, but not when you actually launch mame, there's only a couple likely issues.

1) you're not launching mame with the -ctrlr YourFile.cfg option. If you don't, mame won't know to load your customized controller CFG file. if the CFG file is updated, but just doesn't contain any KEYMAPS, then this is likely the problem.

2) the way you're executing ControllerRemap is causing the remapped CFG file to be written to the wrong location. Normally, controller files are CFG files that should live in \Mame\ctrlr. A bit unlikely, esp if you have the CFG files inthe ctrlr dir, but it's worth mentioning.

3) the only other possibility I can think of is that you might not have however you're launching mame set up right to properly invoke ControllerRemap before launching mame, so the CFG file isn't getting updated at all. One clue here would be that the CFG file doesn't have an updated timestamp after you launch and quite mame. It should ALWAYS get updated by ControllerRemap if it's being run.

4) The only other possibility is that there's some kind of XML formatting issue with the CFG file that's preventing Mame from loading it. A bit unlikely, since usually ControllerRemap will also barf on the file, but it's possible.

Let me know if any of that doesn't make sense

bsong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19
  • I want to build my own arcade controls!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #159 on: November 20, 2014, 09:14:14 pm »
still not working there are no other files in the ctrlr folder besides my own config file


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>ATRAK Device #1 ID = 0</id>
    <alias>"Lightgun_Player1_joystickbuttons"</alias>
  </controlleralias>
  <controlleralias>
    <id>ATRAK Device #2 ID = 1</id>
    <alias>"Lightgun_Player2_joystickbuttons"</alias>
  </controlleralias>
  <controlleralias>
    <id>HID#VID_D209_PID_1601_MI_02#9_375eebb1_0_0000#</id>
    <alias>Lightgun_Player1</alias>
  </controlleralias>
  <controlleralias>
    <id>HID#VID_D209_PID_1602_MI_02#9_2f312172_0_0000#</id>
    <alias>Lightgun_Player2</alias>
  </controlleralias>
  <!--
    ############################################################
    This is the System Default section
    It generally should be the FIRST system section in the cfg file
    ############################################################
    -->
  <system name="default">
    <controller id="keyboard">
      <input>
        <port type="UI_UP">
          <newseq type="standard">KEYCODE_UP OR KEYCODE_8_PAD</newseq>
        </port>
        <port type="UI_DOWN">
          <newseq type="standard">KEYCODE_DOWN OR KEYCODE_2_PAD</newseq>
        </port>
        <port type="UI_LEFT">
          <newseq type="standard">KEYCODE_LEFT OR KEYCODE_4_PAD</newseq>
        </port>
        <port type="UI_RIGHT">
          <newseq type="standard">KEYCODE_RIGHT OR KEYCODE_6_PAD</newseq>
        </port>
        <port type="UI_SELECT">
          <newseq type="standard">KEYCODE_ENTER OR KEYCODE_LCONTROL</newseq>
        </port>
        <port type="UI_CONFIGURE">
          <newseq type="standard">KEYCODE_TAB</newseq>`0
        </port>
        <port type="UI_CANCEL">
          <newseq type="standard">KEYCODE_ESC</newseq>
        </port>
        <port type="START1">
          <newseq type="standard">KEYCODE_1</newseq>
        </port>
        <port type="START2">
          <newseq type="standard">KEYCODE_2</newseq>
        </port>
        <port type="COIN1">
          <newseq type="standard">KEYCODE_5</newseq>
        </port>
        <port type="COIN2">
          <newseq type="standard">KEYCODE_6</newseq>
        </port>
        <port type="P1_JOYSTICK_UP">
          <newseq type="standard">
                    KEYCODE_8PAD
                </newseq>
        </port>
        <port type="P1_JOYSTICK_DOWN">
          <newseq type="standard">
                    KEYCODE_2PAD
                </newseq>
        </port>
        <port type="P1_JOYSTICK_LEFT">
          <newseq type="standard">
                    KEYCODE_4PAD
                </newseq>
        </port>
        <port type="P1_JOYSTICK_RIGHT">
          <newseq type="standard">
                    KEYCODE_6PAD
                </newseq>
        </port>
        <port type="P2_JOYSTICK_UP">
          <newseq type="standard">
                    KEYCODE_UP
                </newseq>
        </port>
        <port type="P2_JOYSTICK_DOWN">
          <newseq type="standard">
                    KEYCODE_DOWN
                </newseq>
        </port>
        <port type="P2_JOYSTICK_LEFT">
          <newseq type="standard">
                    KEYCODE_LEFT
                </newseq>
        </port>
        <port type="P2_JOYSTICK_RIGHT">
          <newseq type="standard">
                    KEYCODE_RIGHT
                </newseq>
        </port>
        <port type="P1_BUTTON1">
          <newseq type="standard">
                    KEYCODE_Q
                </newseq>
        </port>
        <port type="P1_BUTTON2">
          <newseq type="standard">
                    KEYCODE_W
                </newseq>
        </port>
        <port type="P1_BUTTON3">
          <newseq type="standard">
                    KEYCODE_E
                </newseq>
        </port>
        <port type="P1_BUTTON4">
          <newseq type="standard">
                    KEYCODE_R
                </newseq>
        </port>
        <port type="P1_BUTTON5">
          <newseq type="standard">
                    KEYCODE_T
                </newseq>
        </port>
        <port type="P1_BUTTON6">
          <newseq type="standard">
                    KEYCODE_Y
                </newseq>
        </port>
        <port type="P2_BUTTON1">
          <newseq type="standard">
                    KEYCODE_A
                </newseq>
        </port>
        <port type="P2_BUTTON2">
          <newseq type="standard">
                    KEYCODE_S
                </newseq>
        </port>
        <port type="P2_BUTTON3">
          <newseq type="standard">
                    KEYCODE_D
                </newseq>
        </port>
        <port type="P2_BUTTON4">
          <newseq type="standard">
                    KEYCODE_F         
                </newseq>
        </port>
        <port type="P2_BUTTON5">
          <newseq type="standard">
                    KEYCODE_G         
                </newseq>
        </port>
        <port type="P2_BUTTON6">
          <newseq type="standard">
                    KEYCODE_H 
                </newseq>
        </port>
      </input>
    </controller>
    <controller id="Lightgun_Player1">
      <input>
        <port type="P1_BUTTON1">
          <newseq type="standard">
                        GUNCODE_BUTTON1
                    </newseq>
        </port>
        <port type="P1_LIGHTGUN_X">
          <newseq type="standard">
                        GUNCODE_XAXIS
                    </newseq>
        </port>
        <port type="P1_LIGHTGUN_Y">
          <newseq type="standard">
                        GUNCODE_YAXIS
                    </newseq>
        </port>
        <port type="P1_AD_STICK_X">
          <newseq type="standard">
                    GUNCODE_XAXIS
                </newseq>
        </port>
        <port type="P1_AD_STICK_Y">
          <newseq type="standard">
                    GUNCODE_YAXIS
                </newseq>
        </port>
      </input>
    </controller>
    <controller id="Lightgun_Player2">
      <input>
        <port type="P2_BUTTON1">
          <newseq type="standard">
                        GUNCODE_BUTTON1
                    </newseq>
        </port>
        <port type="P2_LIGHTGUN_X">
          <newseq type="standard">
                        GUNCODE_XAXIS
                    </newseq>
        </port>
        <port type="P2_LIGHTGUN_Y">
          <newseq type="standard">
                        GUNCODE_YAXIS
                    </newseq>
        </port>
        <port type="P2_AD_STICK_X">
          <newseq type="standard">
                    GUNCODE_XAXIS
                </newseq>
        </port>
        <port type="P2_AD_STICK_Y">
          <newseq type="standard">
                    GUNCODE_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="UI_UP">
        <newseq type="standard">KEYCODE_UP OR KEYCODE_8_PAD</newseq>
      </port>
      <port type="UI_DOWN">
        <newseq type="standard">KEYCODE_DOWN OR KEYCODE_2_PAD</newseq>
      </port>
      <port type="UI_LEFT">
        <newseq type="standard">KEYCODE_LEFT OR KEYCODE_4_PAD</newseq>
      </port>
      <port type="UI_RIGHT">
        <newseq type="standard">KEYCODE_RIGHT OR KEYCODE_6_PAD</newseq>
      </port>
      <port type="UI_SELECT">
        <newseq type="standard">KEYCODE_ENTER OR KEYCODE_LCONTROL</newseq>
      </port>
      <port type="UI_CONFIGURE">
        <newseq type="standard">KEYCODE_TAB</newseq>
      </port>
      <port type="UI_CANCEL">
        <newseq type="standard">KEYCODE_ESC</newseq>
      </port>
      <port type="START1">
        <newseq type="standard">KEYCODE_1</newseq>
      </port>
      <port type="START2">
        <newseq type="standard">KEYCODE_2</newseq>
      </port>
      <port type="COIN1">
        <newseq type="standard">KEYCODE_5</newseq>
      </port>
      <port type="COIN2">
        <newseq type="standard">KEYCODE_6</newseq>
      </port>
      <port type="P1_JOYSTICK_UP">
        <newseq type="standard">
                    KEYCODE_8PAD
                </newseq>
      </port>
      <port type="P1_JOYSTICK_DOWN">
        <newseq type="standard">
                    KEYCODE_2PAD
                </newseq>
      </port>
      <port type="P1_JOYSTICK_LEFT">
        <newseq type="standard">
                    KEYCODE_4PAD
                </newseq>
      </port>
      <port type="P1_JOYSTICK_RIGHT">
        <newseq type="standard">
                    KEYCODE_6PAD
                </newseq>
      </port>
      <port type="P2_JOYSTICK_UP">
        <newseq type="standard">
                    KEYCODE_UP
                </newseq>
      </port>
      <port type="P2_JOYSTICK_DOWN">
        <newseq type="standard">
                    KEYCODE_DOWN
                </newseq>
      </port>
      <port type="P2_JOYSTICK_LEFT">
        <newseq type="standard">
                    KEYCODE_LEFT
                </newseq>
      </port>
      <port type="P2_JOYSTICK_RIGHT">
        <newseq type="standard">
                    KEYCODE_RIGHT
                </newseq>
      </port>
      <port type="P1_BUTTON1">
        <newseq type="standard">
                    KEYCODE_Q
                 OR
                        GUNCODE_3_BUTTON1
                    </newseq>
      </port>
      <port type="P1_BUTTON2">
        <newseq type="standard">
                    KEYCODE_W
                </newseq>
      </port>
      <port type="P1_BUTTON3">
        <newseq type="standard">
                    KEYCODE_E
                </newseq>
      </port>
      <port type="P1_BUTTON4">
        <newseq type="standard">
                    KEYCODE_R
                </newseq>
      </port>
      <port type="P1_BUTTON5">
        <newseq type="standard">
                    KEYCODE_T
                </newseq>
      </port>
      <port type="P1_BUTTON6">
        <newseq type="standard">
                    KEYCODE_Y
                </newseq>
      </port>
      <port type="P2_BUTTON1">
        <newseq type="standard">
                    KEYCODE_A
                 OR
                        GUNCODE_2_BUTTON1
                    </newseq>
      </port>
      <port type="P2_BUTTON2">
        <newseq type="standard">
                    KEYCODE_S
                </newseq>
      </port>
      <port type="P2_BUTTON3">
        <newseq type="standard">
                    KEYCODE_D
                </newseq>
      </port>
      <port type="P2_BUTTON4">
        <newseq type="standard">
                    KEYCODE_F         
                </newseq>
      </port>
      <port type="P2_BUTTON5">
        <newseq type="standard">
                    KEYCODE_G         
                </newseq>
      </port>
      <port type="P2_BUTTON6">
        <newseq type="standard">
                    KEYCODE_H 
                </newseq>
      </port>
      <port type="P1_LIGHTGUN_X">
        <newseq type="standard">
                        GUNCODE_3_XAXIS
                    </newseq>
      </port>
      <port type="P1_LIGHTGUN_Y">
        <newseq type="standard">
                        GUNCODE_3_YAXIS
                    </newseq>
      </port>
      <port type="P1_AD_STICK_X">
        <newseq type="standard">
                    GUNCODE_3_XAXIS
                </newseq>
      </port>
      <port type="P1_AD_STICK_Y">
        <newseq type="standard">
                    GUNCODE_3_YAXIS
                </newseq>
      </port>
      <port type="P2_LIGHTGUN_X">
        <newseq type="standard">
                        GUNCODE_2_XAXIS
                    </newseq>
      </port>
      <port type="P2_LIGHTGUN_Y">
        <newseq type="standard">
                        GUNCODE_2_YAXIS
                    </newseq>
      </port>
      <port type="P2_AD_STICK_X">
        <newseq type="standard">
                    GUNCODE_2_XAXIS
                </newseq>
      </port>
      <port type="P2_AD_STICK_Y">
        <newseq type="standard">
                    GUNCODE_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
    ###################################################
        -->
  <input></input>
</mameconfig>

I also notice when i don't run controller remap in my hyperpsin setup everything runs fine
« Last Edit: November 21, 2014, 12:53:51 pm by bsong »

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #160 on: November 21, 2014, 09:12:38 am »
Try moving that Last INPUT section (at the very end of the file) up above the <SYSTEM> section.

Mame can sometimes be very sensitive to the position of elements in the XML (shouldn't be, but I seem to recall having issues with that in the past).

I don't have time to test right now, but I'll take a look this weekend.

If that turns out to be the case, I think I might add logic to always FORCE the system element to the end of the file.

bsong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19
  • I want to build my own arcade controls!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #161 on: November 22, 2014, 06:44:52 pm »
moved it up and still no dice arghhh I realize that the controller remap.exe file gets run but never actually grabs the xml according to the hyperspin logs

it only reads it when I actually test

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #162 on: November 22, 2014, 08:33:11 pm »
moved it up and still no dice arghhh I realize that the controller remap.exe file gets run but never actually grabs the xml according to the hyperspin logs

it only reads it when I actually test
Maybe you need to specify the full path to the file whereever you have ControllerRemap.exe being run inside Hyperspin. The default dir might not be what you think it is.

That's the only thing I can think of.

bsong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19
  • I want to build my own arcade controls!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #163 on: November 22, 2014, 08:34:26 pm »
i actually moved it to the c: directory and it still wont read it at all any other ideas?

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #164 on: November 22, 2014, 08:38:52 pm »
i actually moved it to the c: directory and it still wont read it at all any other ideas?

That won't help because even if ControllerRemap could read it, mame won't find the cfg file.

In Hyperspin, where you've added config to run controllerRemap, you'll need it to look something like

c:\mame\utilities\ControllerRemap.exe /remap:c:\mame\ctrlr\mycontroller.cfg

Ie specify the full path to where you've got controllerremap and where the CFG file is.




bsong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19
  • I want to build my own arcade controls!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #165 on: November 29, 2014, 08:01:44 pm »
okay so after a lot of tinkering i got to this point

hyperspin is loading the file  and i see the controllerremap is saving the right cfg according to the log

2014-11-29T16:51:54
ControllerRemap Utility v0.0.11.0 - For Mame
(c) 2011 drventure Enterprises

2014-11-29T16:51:54 Scanning and processing files in C:\Hyperspin\emulators\Mame\ctrlr\myConfig.cfg
2014-11-29T16:51:54 Processing file C:\Hyperspin\emulators\Mame\ctrlr\myConfig.cfg
2014-11-29T16:51:54    Treating as a Mame cfg file...
2014-11-29T16:51:54    No changes.

the UI controls do work and i able to navigate around and start a game

now the only problem lies in actually getting the game controls to work it seems like none of the buttons are mapped within the game

here is my XML file
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>ATRAK Device #1</id>
    <alias>"Lightgun_Player1_joystickbuttons"</alias>
  </controlleralias>
  <controlleralias>
    <id>ATRAK Device #2</id>
    <alias>"Lightgun_Player2_joystickbuttons"</alias>
  </controlleralias>
  <controlleralias>
    <id>HID#VID_D209_PID_1601_MI_02#9_375eebb1_0_0000#</id>
    <alias>Lightgun_Player2</alias>
  </controlleralias>
  <controlleralias>
    <id>HID#VID_D209_PID_1602_MI_02#9_2f312172_0_0000#</id>
    <alias>Lightgun_Player1</alias>
  </controlleralias>
  <!--
    ############################################################
    This is the System Default section
    It generally should be the FIRST system section in the cfg file
    ############################################################
    -->
  <system name="default">
    <controller id="keyboard">
      <input>
        <port type="UI_UP">
          <newseq type="standard">
                    KEYCODE_8PAD OR KEYCODE_UP
                </newseq>
        </port>
        <port type="UI_DOWN">
          <newseq type="standard">
                    KEYCODE_2PAD OR KEYCODE_DOWN
                </newseq>
        </port>
        <port type="UI_LEFT">
          <newseq type="standard">
                    KEYCODE_4PAD OR KEYCODE_LEFT
                </newseq>
        </port>
        <port type="UI_RIGHT">
          <newseq type="standard">
                    KEYCODE_6PAD OR KEYCODE_RIGHT
                </newseq>
        </port>
        <port type="UI_SELECT">
          <newseq type="standard">
                    KEYCODE_ENTER
                </newseq>
        </port>
        <port type="UI_CONFIGURE">
          <newseq type="standard">
                    KEYCODE_TAB
                </newseq>
        </port>
        <port type="UI_CANCEL">
          <newseq type="standard">
                    KEYCODE_ESC
                </newseq>
        </port>
        <port type="UI_START1">
          <newseq type="standard">
                    KEYCODE_1
                </newseq>
        </port>
        <port type="UI_START2">
          <newseq type="standard">
                    KEYCODE_2
                </newseq>
        </port>
        <port type="UI_COIN1">
          <newseq type="standard">
                    KEYCODE_5
                </newseq>
        </port>
        <port type="UI_COIN2">
          <newseq type="standard">
                    KEYCODE_6
                </newseq>
        </port>
        <port type="P1_JOYSTICK_UP">
          <newseq type="standard">
                    KEYCODE_8PAD
                </newseq>
        </port>
        <port type="P1_JOYSTICK_DOWN">
          <newseq type="standard">
                    KEYCODE_2PAD
                </newseq>
        </port>
        <port type="P1_JOYSTICK_LEFT">
          <newseq type="standard">
                    KEYCODE_4PAD
                </newseq>
        </port>
        <port type="P1_JOYSTICK_RIGHT">
          <newseq type="standard">
                    KEYCODE_6PAD
                </newseq>
        </port>
        <port type="P1_JOYSTICKRIGHT_UP">
          <newseq type="standard">
                    NONE
                </newseq>
        </port>
        <port type="P1_JOYSTICKRIGHT_DOWN">
          <newseq type="standard">
                    NONE
                </newseq>
        </port>
        <port type="P1_JOYSTICKRIGHT_LEFT">
          <newseq type="standard">
                    NONE
                </newseq>
        </port>
        <port type="P1_JOYSTICKRIGHT_RIGHT">
          <newseq type="standard">
                    NONE
                </newseq>
        </port>
        <port type="P1_JOYSTICKLEFT_UP">
          <newseq type="standard">
                    NONE
                </newseq>
        </port>
        <port type="P1_JOYSTICKLEFT_DOWN">
          <newseq type="standard">
                    NONE
                </newseq>
        </port>
        <port type="P1_JOYSTICKLEFT_LEFT">
          <newseq type="standard">
                    NONE
                </newseq>
        </port>
        <port type="P1_JOYSTICKLEFT_RIGHT">
          <newseq type="standard">
                    NONE
                </newseq>
        </port>
        <port type="P1_BUTTON1">
          <newseq type="standard">
                    KEYCODE_Q
                </newseq>
        </port>
        <port type="P1_BUTTON2">
          <newseq type="standard">
                    KEYCODE_W
                </newseq>
        </port>
        <port type="P1_BUTTON3">
          <newseq type="standard">
                    KEYCODE_E
                </newseq>
        </port>
        <port type="P1_BUTTON4">
          <newseq type="standard">
                    KEYCODE_R
                </newseq>
        </port>
        <port type="P1_BUTTON5">
          <newseq type="standard">
                    KEYCODE_T
                </newseq>
        </port>
        <port type="P1_BUTTON6">
          <newseq type="standard">
                    KEYCODE_Y
                </newseq>
        </port>
        <port type="P1_START">
          <newseq type="standard">
                    KEYCODE_1
                </newseq>
        </port>
        <port type="P2_JOYSTICK_UP">
          <newseq type="standard">
                    KEYCODE_UP
                </newseq>
        </port>
        <port type="P2_JOYSTICK_DOWN">
          <newseq type="standard">
                    KEYCODE_DOWN
                </newseq>
        </port>
        <port type="P2_JOYSTICK_LEFT">
          <newseq type="standard">
                    KEYCODE_LEFT
                </newseq>
        </port>
        <port type="P2_JOYSTICK_RIGHT">
          <newseq type="standard">
                    KEYCODE_RIGHT
                </newseq>
        </port>
        <port type="P2_BUTTON1">
          <newseq type="standard">
                    KEYCODE_A
                </newseq>
        </port>
        <port type="P2_BUTTON2">
          <newseq type="standard">
                    KEYCODE_S
                </newseq>
        </port>
        <port type="P2_BUTTON3">
          <newseq type="standard">
                    KEYCODE_D
                </newseq>
        </port>
        <port type="P2_BUTTON4">
          <newseq type="standard">
                    KEYCODE_F
                </newseq>
        </port>
        <port type="P2_BUTTON5">
          <newseq type="standard">
                    KEYCODE_G
                </newseq>
        </port>
        <port type="P2_BUTTON6">
          <newseq type="standard">
                    KEYCODE_H
                </newseq>
        </port>
        <port type="P2_START">
          <newseq type="standard">
                    KEYCODE_2
                </newseq>
        </port>
      </input>
    </controller>
    <controller id="Lightgun_Player1">
      <input>
        <port type="P1_BUTTON1">
          <newseq type="standard">
                        JOYCODE_2_BUTTON0
                    </newseq>
        </port>
        <port type="P1_LIGHTGUN_X">
          <newseq type="standard">
                        GUNCODE_2_XAXIS
                    </newseq>
        </port>
        <port type="P1_LIGHTGUN_Y">
          <newseq type="standard">
                        GUNCODE_2_YAXIS
                    </newseq>
        </port>
        <port type="P1_AD_STICK_X">
          <newseq type="standard">
                    GUNCODE_2_XAXIS
                </newseq>
        </port>
        <port type="P1_AD_STICK_Y">
          <newseq type="standard">
                    GUNCODE_2_YAXIS
                </newseq>
        </port>
      </input>
    </controller>
    <controller id="Lightgun_Player2">
      <input>
        <port type="P2_BUTTON1">
          <newseq type="standard">
                        JOYCODE_1_BUTTON1
                    </newseq>
        </port>
        <port type="P2_LIGHTGUN_X">
          <newseq type="standard">
                        GUNCODE_1_XAXIS
                    </newseq>
        </port>
        <port type="P2_LIGHTGUN_Y">
          <newseq type="standard">
                        GUNCODE_1_YAXIS
                    </newseq>
        </port>
        <port type="P2_AD_STICK_X">
          <newseq type="standard">
                    GUNCODE_1_XAXIS
                </newseq>
        </port>
        <port type="P2_AD_STICK_Y">
          <newseq type="standard">
                    GUNCODE_1_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="UI_UP">
        <newseq type="standard">
                    KEYCODE_8PAD OR KEYCODE_UP
                </newseq>
      </port>
      <port type="UI_DOWN">
        <newseq type="standard">
                    KEYCODE_2PAD OR KEYCODE_DOWN
                </newseq>
      </port>
      <port type="UI_LEFT">
        <newseq type="standard">
                    KEYCODE_4PAD OR KEYCODE_LEFT
                </newseq>
      </port>
      <port type="UI_RIGHT">
        <newseq type="standard">
                    KEYCODE_6PAD OR KEYCODE_RIGHT
                </newseq>
      </port>
      <port type="UI_SELECT">
        <newseq type="standard">
                    KEYCODE_ENTER
                </newseq>
      </port>
      <port type="UI_CONFIGURE">
        <newseq type="standard">
                    KEYCODE_TAB
                </newseq>
      </port>
      <port type="UI_CANCEL">
        <newseq type="standard">
                    KEYCODE_ESC
                </newseq>
      </port>
      <port type="UI_START1">
        <newseq type="standard">
                    KEYCODE_1
                </newseq>
      </port>
      <port type="UI_START2">
        <newseq type="standard">
                    KEYCODE_2
                </newseq>
      </port>
      <port type="UI_COIN1">
        <newseq type="standard">
                    KEYCODE_5
                </newseq>
      </port>
      <port type="UI_COIN2">
        <newseq type="standard">
                    KEYCODE_6
                </newseq>
      </port>
      <port type="P1_JOYSTICK_UP">
        <newseq type="standard">
                    KEYCODE_8PAD
                </newseq>
      </port>
      <port type="P1_JOYSTICK_DOWN">
        <newseq type="standard">
                    KEYCODE_2PAD
                </newseq>
      </port>
      <port type="P1_JOYSTICK_LEFT">
        <newseq type="standard">
                    KEYCODE_4PAD
                </newseq>
      </port>
      <port type="P1_JOYSTICK_RIGHT">
        <newseq type="standard">
                    KEYCODE_6PAD
                </newseq>
      </port>
      <port type="P1_JOYSTICKRIGHT_UP">
        <newseq type="standard">
                    NONE
                </newseq>
      </port>
      <port type="P1_JOYSTICKRIGHT_DOWN">
        <newseq type="standard">
                    NONE
                </newseq>
      </port>
      <port type="P1_JOYSTICKRIGHT_LEFT">
        <newseq type="standard">
                    NONE
                </newseq>
      </port>
      <port type="P1_JOYSTICKRIGHT_RIGHT">
        <newseq type="standard">
                    NONE
                </newseq>
      </port>
      <port type="P1_JOYSTICKLEFT_UP">
        <newseq type="standard">
                    NONE
                </newseq>
      </port>
      <port type="P1_JOYSTICKLEFT_DOWN">
        <newseq type="standard">
                    NONE
                </newseq>
      </port>
      <port type="P1_JOYSTICKLEFT_LEFT">
        <newseq type="standard">
                    NONE
                </newseq>
      </port>
      <port type="P1_JOYSTICKLEFT_RIGHT">
        <newseq type="standard">
                    NONE
                </newseq>
      </port>
      <port type="P1_BUTTON1">
        <newseq type="standard">
                    KEYCODE_Q
                 OR
                        JOYCODE_1_BUTTON0
                    </newseq>
      </port>
      <port type="P1_BUTTON2">
        <newseq type="standard">
                    KEYCODE_W
                </newseq>
      </port>
      <port type="P1_BUTTON3">
        <newseq type="standard">
                    KEYCODE_E
                </newseq>
      </port>
      <port type="P1_BUTTON4">
        <newseq type="standard">
                    KEYCODE_R
                </newseq>
      </port>
      <port type="P1_BUTTON5">
        <newseq type="standard">
                    KEYCODE_T
                </newseq>
      </port>
      <port type="P1_BUTTON6">
        <newseq type="standard">
                    KEYCODE_Y
                </newseq>
      </port>
      <port type="P1_START">
        <newseq type="standard">
                    KEYCODE_1
                </newseq>
      </port>
      <port type="P2_JOYSTICK_UP">
        <newseq type="standard">
                    KEYCODE_UP
                </newseq>
      </port>
      <port type="P2_JOYSTICK_DOWN">
        <newseq type="standard">
                    KEYCODE_DOWN
                </newseq>
      </port>
      <port type="P2_JOYSTICK_LEFT">
        <newseq type="standard">
                    KEYCODE_LEFT
                </newseq>
      </port>
      <port type="P2_JOYSTICK_RIGHT">
        <newseq type="standard">
                    KEYCODE_RIGHT
                </newseq>
      </port>
      <port type="P2_BUTTON1">
        <newseq type="standard">
                    KEYCODE_A
                 OR
                        JOYCODE_2_BUTTON1
                    </newseq>
      </port>
      <port type="P2_BUTTON2">
        <newseq type="standard">
                    KEYCODE_S
                </newseq>
      </port>
      <port type="P2_BUTTON3">
        <newseq type="standard">
                    KEYCODE_D
                </newseq>
      </port>
      <port type="P2_BUTTON4">
        <newseq type="standard">
                    KEYCODE_F
                </newseq>
      </port>
      <port type="P2_BUTTON5">
        <newseq type="standard">
                    KEYCODE_G
                </newseq>
      </port>
      <port type="P2_BUTTON6">
        <newseq type="standard">
                    KEYCODE_H
                </newseq>
      </port>
      <port type="P2_START">
        <newseq type="standard">
                    KEYCODE_2
                </newseq>
      </port>
      <port type="P1_LIGHTGUN_X">
        <newseq type="standard">
                        GUNCODE_1_XAXIS
                    </newseq>
      </port>
      <port type="P1_LIGHTGUN_Y">
        <newseq type="standard">
                        GUNCODE_1_YAXIS
                    </newseq>
      </port>
      <port type="P1_AD_STICK_X">
        <newseq type="standard">
                    GUNCODE_1_XAXIS
                </newseq>
      </port>
      <port type="P1_AD_STICK_Y">
        <newseq type="standard">
                    GUNCODE_1_YAXIS
                </newseq>
      </port>
      <port type="P2_LIGHTGUN_X">
        <newseq type="standard">
                        GUNCODE_2_XAXIS
                    </newseq>
      </port>
      <port type="P2_LIGHTGUN_Y">
        <newseq type="standard">
                        GUNCODE_2_YAXIS
                    </newseq>
      </port>
      <port type="P2_AD_STICK_X">
        <newseq type="standard">
                    GUNCODE_2_XAXIS
                </newseq>
      </port>
      <port type="P2_AD_STICK_Y">
        <newseq type="standard">
                    GUNCODE_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
    ###################################################
        -->
</mameconfig>


thanks for the help in advance




bsong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19
  • I want to build my own arcade controls!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #166 on: December 05, 2014, 01:07:49 pm »
anyone have any ideas?

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #167 on: December 05, 2014, 02:52:39 pm »
Can you run controllerremap /list and post the results here?

I might be able to figure what's wrong from that and your remap file.

bsong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19
  • I want to build my own arcade controls!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #168 on: December 05, 2014, 09:43:17 pm »
ControllerRemap Utility v0.0.11.0 - For Mame
(c) 2011 drventure Enterprises


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

   1.  'ATRAK Device #2', ID=1
   2.  'ATRAK Device #1', ID=0

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

   1.  'HID#VID_D209_PID_1602_MI_02#9_2f312172_0_0000#'
   2.  'HID#VID_D209_PID_1601_MI_02#9_375eebb1_0_0000#'
   3.  'HID#VID_046D_PID_C52B_MI_01_Col01#7_9ffb40b_0_0000#'

End of list

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #169 on: December 06, 2014, 11:30:59 am »
I apologize. I mispoke.

I need you to run

ControllerRemap.exe /save

This will create a controllerremap.map file in the current dir.

If you can post THAT file, I should be able to tell what's up.

Thanks

bsong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19
  • I want to build my own arcade controls!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #170 on: December 06, 2014, 12:15:41 pm »
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfControllerEntry xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ControllerRemap">
  <ControllerEntry>
    <DeviceID>1</DeviceID>
    <EnumerationPos>1</EnumerationPos>
    <IsJoystick>true</IsJoystick>
    <IsMouse>false</IsMouse>
    <Name>ATRAK Device #2</Name>
  </ControllerEntry>
  <ControllerEntry>
    <DeviceID>0</DeviceID>
    <EnumerationPos>2</EnumerationPos>
    <IsJoystick>true</IsJoystick>
    <IsMouse>false</IsMouse>
    <Name>ATRAK Device #1</Name>
  </ControllerEntry>
  <ControllerEntry>
    <DeviceID>0</DeviceID>
    <EnumerationPos>3</EnumerationPos>
    <IsJoystick>false</IsJoystick>
    <IsMouse>true</IsMouse>
    <Name>HID#VID_046D_PID_C52B_MI_01_Col01#7_9ffb40b_0_0000#</Name>
  </ControllerEntry>
  <ControllerEntry>
    <DeviceID>0</DeviceID>
    <EnumerationPos>2</EnumerationPos>
    <IsJoystick>false</IsJoystick>
    <IsMouse>true</IsMouse>
    <Name>HID#VID_D209_PID_1601_MI_02#9_375eebb1_0_0000#</Name>
  </ControllerEntry>
  <ControllerEntry>
    <DeviceID>0</DeviceID>
    <EnumerationPos>1</EnumerationPos>
    <IsJoystick>false</IsJoystick>
    <IsMouse>true</IsMouse>
    <Name>HID#VID_D209_PID_1602_MI_02#9_2f312172_0_0000#</Name>
  </ControllerEntry>
</ArrayOfControllerEntry>

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #171 on: December 06, 2014, 12:49:09 pm »
Cool. I'll take a look and let you know. I've got a lot going on this weekend. Might be next week, but I'll figure it out.

bsong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19
  • I want to build my own arcade controls!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #172 on: December 06, 2014, 12:50:38 pm »
awesome this thing has been driving me nuts

lebronfaling

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 4
  • I want to build my own arcade controls!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #173 on: December 07, 2014, 10:35:11 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
Find me here and my hobby site for safe wipe

bsong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19
  • I want to build my own arcade controls!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #174 on: December 10, 2014, 02:12:23 pm »
drventure, any luck ?

stigzler

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 860
  • It seemed like a good idea at the time....
    • Mago Arcade
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #175 on: December 10, 2014, 03:21:51 pm »

zero_koop

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 34
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #176 on: January 19, 2015, 05:20:10 pm »
Hi, I think I'm getting close to figuring this out, but I'm having trouble with the -ctrlr command with MAME.  Anytime I add the "-ctrlr MyArcade" command to the command line (along with other commands I'm using) MAME just refuses to start.  Even if I point it to one of the preexisting controller files (e.g. "-ctrlr xarcade").  So this isn't necessarily a problem with the controller remap utility, but I was wondering if anyone knew what to do with this?  Thanks.

milhouse

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 170
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #177 on: January 19, 2015, 11:14:41 pm »
Hi,

I am trying to get this working but am having trouble right off the bat.  I am getting XML/Java errors, even when I try to remap the sample.cfg file without any changes.

Thoughts?

Code: [Select]
2015-01-19T23:12:59
ControllerRemap Utility v0.0.11.0 - For Mame
(c) 2011 drventure Enterprises

2015-01-19T23:12:59 Scanning and processing files in D:\emulators\mame\ctrlr\Sample.CFG
2015-01-19T23:12:59 Processing file D:\emulators\mame\ctrlr\Sample.CFG
2015-01-19T23:12:59    Treating as a Mame cfg file...
2015-01-19T23:12:59
2015-01-19T23:12:59 Unexpected problem encountered. System.NullReferenceException: Object reference not set to an instance of an object.
   at ControllerRemap.ControllerEntries._Closure$__4._Lambda$__12(ControllerEntry j)
   at System.Linq.Enumerable.WhereListIterator`1.MoveNext()
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   at ControllerRemap.ControllerEntries.get_InternalFindByID(String index, Boolean IgnoreInstance)
   at ControllerRemap.CFGFileMame.Scan()
   at ControllerRemap.CFGFiles.Scan()
   at ControllerRemap.Program.Main()

bsong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19
  • I want to build my own arcade controls!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #178 on: January 26, 2015, 03:13:53 pm »
can anyone help us?

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4144
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)
« Reply #179 on: February 12, 2015, 03:01:42 pm »
My apologies
Lot of crap going on personally.

I'll try to take a look this weekend.
</