Jump to content
LaunchBox Community Forums

Guide: Cheap Arcade Light Guns with Touchemote


Recommended Posts

Are you talking about MAME still? I don't know about MAMEUI, but MAME has had stable controller IDs for a long time. It's very easy to set up. Look here:

https://docs.mamedev.org/advanced/devicemap.html

I honestly think that even though MAMEUI appears to be the easier to set up, it introduces a lot more complications. If you want, I can share my MAME controller scheme?

Link to comment
Share on other sites

18 minutes ago, Tomkun said:

Are you talking about MAME still? I don't know about MAMEUI, but MAME has had stable controller IDs for a long time. It's very easy to set up. Look here:

https://docs.mamedev.org/advanced/devicemap.html

I honestly think that even though MAMEUI appears to be the easier to set up, it introduces a lot more complications. If you want, I can share my MAME controller scheme?

That would be great for us to see your mame controller scheme.  Thank you very much 

Link to comment
Share on other sites

OK guys, here you are. This is the entire keymap I use, but the most important part is at the top:

<!-- DolphinBarWiiMode and XBox360x4 by Tomkun v0.1 -->
		<!--	
		Logitech Keyboard	VID_046D&amp;PID_C52B&amp;REV_1201&amp;MI_02&amp;Qid_2010&amp;WI_03
		Logitech Mouse		VID_046D&amp;PID_C52B&amp;REV_1201&amp;MI_02
		Dolphinbar Keyboard	VID_0079&amp;PID_1802&amp;MI_00
		Dolphinbar Mouse	VID_0079&amp;PID_1802&amp;MI_01
		Dolphinbar Ctrller	Mayflash Wiimote PC Adapter (device id: Mayflash Wiimote PC Adapter product_18030079-0000-0000-0000-504944564944 instance_8f73ac60-ef9f-11e6-8001-444553540000) (Where 800x=Player)
		XBox One Controller XInput Player X (device id: XInput Player X) (Where X=Player)
		XBox 360 Controller XInput Player X (device id: XInput Player X) (Where X=Player)
		Touchmote (x360)	XInput Player X (device id: XInput Player X) (Where X=Player)
		Steam Controller K	VID_28DE&amp;PID_1142&amp;MI_00&amp;Col01
		Steam Controller M	VID_28DE&amp;PID_1142&amp;MI_00&amp;Col02
		-->
		<input>
		<!-- Keyboards -->
		<mapdevice device="VID_046D&amp;PID_C52B&amp;REV_1201&amp;MI_02&amp;Qid_2010&amp;WI_03" controller="KEYCODE_1" />
		<mapdevice device="VID_28DE&amp;PID_1142&amp;MI_00&amp;Col01" controller="KEYCODE_2" />
		<!-- Mice -->
		<mapdevice device="VID_046D&amp;PID_C52B&amp;MI_01" controller="MOUSECODE_1" />
		<mapdevice device="VID_28DE&amp;PID_1142&amp;MI_00&amp;Col02" controller="MOUSECODE_2" />
		<!-- Controllers -->
		<mapdevice device="XInput Player 1" controller="JOYCODE_1" />
		<mapdevice device="XInput Player 2" controller="JOYCODE_2" />
		<mapdevice device="XInput Player 2" controller="JOYCODE_3" />
		<mapdevice device="XInput Player 2" controller="JOYCODE_4" />

The commented stuff at the top is just for reference. The important bit is the mapdevice section. As you can see, I have set it so that the XInput devices 1-4 are always set as Joystick 1-4. Otherwise the Dolphinbar grabs those slots.

Touchmote emulates Xinput devices, but it's important to note that MAME cannot tell the difference between Xinput devices. So if you have any other Xinput controllers connected, they will all appear in the list. Xinput devices are always enumerated the same way though, and that is in the order they are connected.

I'll try to explain. In my keymap, I assume that my Touchmote emulated controllers are Xinput1 and Xinput2. If I connect my Wiimotes in that order, then fine. However, what if I have been playing a bit of Pac-man on my Xbox One pad beforehand? Well, in that case the pad will be Xinput1 and the Wiimotes 2&3. In that case I need to switch off the Xbox one pad before starting MAME. It will lose it's slot and the Wiimotes will move to positions 1&2.

The easiest way I've found to do this is by using DEVCON. A quick reset to the Xbox One controller dongle will move the controllers to the back of the queue. It's so quick, they don't even disconnect!

The devcon command you need will be:

devcon.exe restart "USB\VID_045E&PID_02E6"

Your VID/PID may be different, so be sure to check. This should work on all Xinput devices. If you aren't sure about the VID/PID of your various controllers, you can see them by launching MAME in verbose mode.

MAME64.exe -verbose

Good luck!

mycontrols.cfg

Link to comment
Share on other sites

10 minutes ago, Tomkun said:

OK guys, here you are. This is the entire keymap I use, but the most important part is at the top:


<!-- DolphinBarWiiMode and XBox360x4 by Tomkun v0.1 -->
		<!--	
		Logitech Keyboard	VID_046D&amp;PID_C52B&amp;REV_1201&amp;MI_02&amp;Qid_2010&amp;WI_03
		Logitech Mouse		VID_046D&amp;PID_C52B&amp;REV_1201&amp;MI_02
		Dolphinbar Keyboard	VID_0079&amp;PID_1802&amp;MI_00
		Dolphinbar Mouse	VID_0079&amp;PID_1802&amp;MI_01
		Dolphinbar Ctrller	Mayflash Wiimote PC Adapter (device id: Mayflash Wiimote PC Adapter product_18030079-0000-0000-0000-504944564944 instance_8f73ac60-ef9f-11e6-8001-444553540000) (Where 800x=Player)
		XBox One Controller XInput Player X (device id: XInput Player X) (Where X=Player)
		XBox 360 Controller XInput Player X (device id: XInput Player X) (Where X=Player)
		Touchmote (x360)	XInput Player X (device id: XInput Player X) (Where X=Player)
		Steam Controller K	VID_28DE&amp;PID_1142&amp;MI_00&amp;Col01
		Steam Controller M	VID_28DE&amp;PID_1142&amp;MI_00&amp;Col02
		-->
		<input>
		<!-- Keyboards -->
		<mapdevice device="VID_046D&amp;PID_C52B&amp;REV_1201&amp;MI_02&amp;Qid_2010&amp;WI_03" controller="KEYCODE_1" />
		<mapdevice device="VID_28DE&amp;PID_1142&amp;MI_00&amp;Col01" controller="KEYCODE_2" />
		<!-- Mice -->
		<mapdevice device="VID_046D&amp;PID_C52B&amp;MI_01" controller="MOUSECODE_1" />
		<mapdevice device="VID_28DE&amp;PID_1142&amp;MI_00&amp;Col02" controller="MOUSECODE_2" />
		<!-- Controllers -->
		<mapdevice device="XInput Player 1" controller="JOYCODE_1" />
		<mapdevice device="XInput Player 2" controller="JOYCODE_2" />
		<mapdevice device="XInput Player 2" controller="JOYCODE_3" />
		<mapdevice device="XInput Player 2" controller="JOYCODE_4" />

The commented stuff at the top is just for reference. The important bit is the mapdevice section. As you can see, I have set it so that the XInput devices 1-4 are always set as Joystick 1-4. Otherwise the Dolphinbar grabs those slots.

Touchmote emulates Xinput devices, but it's important to note that MAME cannot tell the difference between Xinput devices. So if you have any other Xinput controllers connected, they will all appear in the list. Xinput devices are always enumerated the same way though, and that is in the order they are connected.

I'll try to explain. In my keymap, I assume that my Touchmote emulated controllers are Xinput1 and Xinput2. If I connect my Wiimotes in that order, then fine. However, what if I have been playing a bit of Pac-man on my Xbox One pad beforehand? Well, in that case the pad will be Xinput1 and the Wiimotes 2&3. In that case I need to switch off the Xbox one pad before starting MAME. It will lose it's slot and the Wiimotes will move to positions 1&2.

The easiest way I've found to do this is by using DEVCON. A quick reset to the Xbox One controller dongle will move the controllers to the back of the queue. It's so quick, they don't even disconnect!

The devcon command you need will be:


devcon.exe restart "USB\VID_045E&PID_02E6"

Your VID/PID may be different, so be sure to check. This should work on all Xinput devices. If you aren't sure about the VID/PID of your various controllers, you can see them by launching MAME in verbose mode.


MAME64.exe -verbose

Good luck!

mycontrols.cfg

Ok will give it a go this afternoon (Australian time) and will post results.  Thank you very much again Tomkun

Link to comment
Share on other sites

1 minute ago, Tomkun said:

Are you talking about MAME still? I don't know about MAMEUI, but MAME has had stable controller IDs for a long time. It's very easy to set up. Look here:

https://docs.mamedev.org/advanced/devicemap.html

I honestly think that even though MAMEUI appears to be the easier to set up, it introduces a lot more complications. If you want, I can share my MAME controller scheme?

That is a great doc! The question becomes, for more than just lightguns, can this be done for retroarch, dolphin, redream

Link to comment
Share on other sites

Dolphin should work with the Dolphinbar natively, so you shouldn't need to set up anything. Retroarch works, but it also enumerates the Dolphinbar itself. I use a small app called devreorder to make Retroarch ignore it.

I have never used redream, so I don't know about that.

https://github.com/briankendall/devreorder

Here is the ini file that I use:

; devreorder settings
; Any line starting with ; is a comment and will be ignored

[order]
; In this section write the names of your controllers in the
; order you want them to be detected, one per line. Make sure
; they exactly match the name printed in the Game Controllers
; control, panel, including any capital letters and
; punctuation.
; (To open the Game Controllers control panel, press Win+R,
; type joy.cpl into the dialog box, and press enter.)
; Example:
; vJoy Device
; Controller (XBOX 360 For Windows)

[hidden]
; In this section, write the names of controllers that you
; want to be hidden. Again their name must exactly match
; the name printed in the Game Controllers control panel.
; Example:
; Wireless Controller
Mayflash Wiimote PC Adapter

 

devreorder.ini

Link to comment
Share on other sites

46 minutes ago, Tomkun said:

Dolphin should work with the Dolphinbar natively, so you shouldn't need to set up anything. Retroarch works, but it also enumerates the Dolphinbar itself. I use a small app called devreorder to make Retroarch ignore it.

I have never used redream, so I don't know about that.

https://github.com/briankendall/devreorder

Here is the ini file that I use:


; devreorder settings
; Any line starting with ; is a comment and will be ignored

[order]
; In this section write the names of your controllers in the
; order you want them to be detected, one per line. Make sure
; they exactly match the name printed in the Game Controllers
; control, panel, including any capital letters and
; punctuation.
; (To open the Game Controllers control panel, press Win+R,
; type joy.cpl into the dialog box, and press enter.)
; Example:
; vJoy Device
; Controller (XBOX 360 For Windows)

[hidden]
; In this section, write the names of controllers that you
; want to be hidden. Again their name must exactly match
; the name printed in the Game Controllers control panel.
; Example:
; Wireless Controller
Mayflash Wiimote PC Adapter

 

devreorder.ini

I use retroarch quite a lot, but going to give mame a try (as per your instructions Tomkun).  Failing that then may try retroarch using devreorder.

Can I just ask, I am quite new to mame command line (as i said been using retroarch for years) .  the config file you have provided above (keymap), can I download this and copy to the mame directory?  just removing the lines of code that refer to controllers I dont use?   Im just using 2 x wii mote with dolphin bar and ipac2 keyboard encoder for buttons?

Link to comment
Share on other sites

ok so im a little stuck setting up Mame guys.

attached is my touchmote setup.  Which was working fine with mame UI.

The device config is the same as ThePolish 's original thread.  The controller config and the ingame machine config (config this machine only) do not recognise gun movement, they do register button presses, but no gun movement :(    Any ideas?

IMG_2011.jpg

IMG_2012.jpg

IMG_2013.jpg

IMG_2014.jpg

Link to comment
Share on other sites

You need to make sure that your MAME.ini file is pointing to the correct cfg file. If you downloaded the cfg file I posted earlier, copy it into the ctrlr subdirectory. 

Then, you need to edit your MAME.ini file. It should be next to the MAME64.exe executable.

Scroll down to CORE INPUT OPTIONS

Make sure the lines read like this:

ctrlr                     mycontrols
joystick                  1
joystick_deadzone         0.0

The rest you can leave as default. Then you should hopefully be up and running.

Link to comment
Share on other sites

With help from everyone on this thread, in particular Tomkun I have managed to setup a couple of 2 player light gun games using mame and so far after several reboots it seems that mame has kept my settings so far !    So thats great news.  Thank you.

The problem im having now is that its quite a long hard job setting up the gun controls for 2 guns for each light gun game - about 50 or so in this mame set i have that work.  

If I launch a game i can configured the individual machine and it saves, but if i configure all then it seems to loose some of the buttons assignments (in particular the X and Y axis settings for both guns).  

not sure if im doing anything wrong !?!?!

Link to comment
Share on other sites

The cfg file I sent you should work for all lightgun/positional gun games by default. There should be no per-game configuration necessary except for edge-cases with weird control schemes. TIme Crisis springs to mind as it requires the pedal. If you have configured the games individually, perhaps try deleting their config files (back them up of course!) and try again with just my config.

Link to comment
Share on other sites

15 minutes ago, Tomkun said:

The cfg file I sent you should work for all lightgun/positional gun games by default. There should be no per-game configuration necessary except for edge-cases with weird control schemes. TIme Crisis springs to mind as it requires the pedal. If you have configured the games individually, perhaps try deleting their config files (back them up of course!) and try again with just my config.

ok thanks Tom I will try deletng the individual config files created there are only a few.  But surely i will still need to tell mame that the trigger on my wiimote (as an example) i mapped to button A ??

Link to comment
Share on other sites

6 minutes ago, Tomkun said:

The cfg file I sent you does all that. Did you download the full thing, or just the part in the textbox? It's at the bottom of the post.  I'll post it here again. Also make sure you delete the default entry too.

 

mycontrols.cfg

downloaded the complete file.  pointed mame.ini to it (as you explained).    Im just testing it again now.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...