Main > Software Forum

New ControllerRemap utility, 7/11/13 update available (Version 0.0.11)

<< < (27/47) > >>

Connorsdad:
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:

--- Quote from: Connorsdad 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

--- End quote ---

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:

--- Quote from: nick3092 on August 11, 2013, 09:41:45 am ---
--- Quote from: Connorsdad 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

--- End quote ---

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.

--- End quote ---

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:
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: ---<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>

--- End code ---

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


--- Code: ---<!-- 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>
--- End code ---

drventure:
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: ---  <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>

--- End code ---

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: ---  <system name="default">
    <controller id="keyboard">
      <input>
        <port type="UI_UP">
          <newseq type="standard">KEYCODE_UP</newseq>
        </port>

--- End code ---

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.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version