argonlefou / DemulShooter

Enable dual lightgun play in arcade games and emulator
116 stars 16 forks source link

Remap Wiimote buttons #146

Closed n33k33 closed 1 year ago

n33k33 commented 1 year ago

Hello,

Sorry this is not an issue but more a call for help.

I am using 2 Wiimotes with 2 Dolphin bars in Mode 2 to play games like Haunted Museum. DemulShooter allows us to do that already and I am really grateful.

First I would like to make 2 observations in case it could help anyone: . Wiimote buttons A and B will be swapped when using DemulShooter if a nunchuk is connected. . You can add GUN_CURSOR=1 to Haunted Museum's ini to get (small) crosshairs which helps a lot with Wiimotes.

Now, to my question. Using my setup, is there any way to remap my Wiimotes' buttons ? Trigger works if I unplug the nunchuks, but would be nice to have start and credits on the Wiimotes. Right now it defaults to 3 mouse buttons and random keys and I couldn't find any remapping program that would even detect them so far. DemulShooter's virtual mouse remaps don't seem to change a thing.

Thanks in advance :)

argonlefou commented 1 year ago

Hello

I do not own Wiimotes and don't really know how they behave, especially with Dolphins bar and the whole mode2/mode4 (or whatever mode) thing

If your Wiimote is seen by Demulshooter (or the GUI or the Diag app, they are sharing the same mechanism) as a Mouse, with buttons mapped to the "mouse buttons" there is nothing you can do... except ask for a changes in the Wiimote driver that is swapping the buttons systemwise then a Nunchunk is plugged

Demulshooter's virtual buttons are not a "remap" function, it just allows people to simulate a mouse button by pressing a key. Usual use is when you're lacking a physical button on a Gun and you need more inputs. So pressing the virtual button will have the same effect than receiving the corresponding mouse button input. Not the opposite

You won't be able to use a remap program to map your Wiimote buttons to a keyboard key which would be used by DemulShooter as a replacement for Trigger....because DemulShooter will read both your Device event and the keyboard event and you'll end with 2 different buttons at the same time

I don't know if it's possible but If you can make your Wiimote to appear as a gamepad (or any HUD device, other than a mouse) with a different driver - I know there was one back in the time making them appear as XBOX controller - the DemulShooter_GUI config screen would change and you'll be able to choose between all gamepad buttons for each action. As well a the possibility to choose each axis.

This is not an existing feature for mice in demulshooter because the usual mice are lightguns, and in most case you are settings the wanted mouse event generated by any button press in the lightgun configuration itself (aimtrak, sinden, gun4ir)

n33k33 commented 1 year ago

Salut ! Thanks a lot for the detailed answer. :)

I understand using Wiimotes + Mayflash's Dolphin Bar is a quite specific environment but I'll elaborate a bit on it for the sake of documenting at least.

The Mayflash Dolphin Bar got different 4 modes to identify the Wiimotes as: Mode 1: Keyboard and Mouse Mode Mode 2: Keyboard and Mouse Game Mode Mode 3: Game Controller Mode Mode 4: Wii Remote Controller Emulator Mode

Most people use it in Mode 4 which works for 4 Wiimotes without any third party programs in the Dolphin emulator. Mode 2 is most used for other programs and as I described above turns the Wiimote into a 3 buttons mouse.

Mode 4 can also be used together with the Touchmote program though, which allows remapping buttons to any mouse, trackpad, keyboard, controller key. This works quite well for me with MAMEUI which for some reason is one of the few programs to detect the Wiimote's X and Y movements when setting Wiimote's pointers as X360 Right Stick. Most programs don't detect it though.

Eventhough it does work in MAMEUI, I could never have DemulShooter GUI or DxDiag detect any movement using Mode 4. DxDiag however does detect movement in Mode 3 but not DemulShooter GUI.

Mode 2 is so far the only way, but it only allows one Wiimote to synch, so you need 2 Mayflash Dolphin Bars to play 2 players and as I said in the OP and as you confirmed, it doesnt seem possible to remap keyboard keys to the Wiimote in that mode. Touchmote does not detect Wiimotes in Mode 2 as they're detected as simple mouse. Thankfully left click is the trigger by default so it works quite well (unless again you have a nunchuk plugged in).

There are several relatively old videos on Youtube that mention using Mode 4 + Touchmote + DemulShooter (here's one). I was confused for a bit as Wiimotes mapped to Xbox controller mode in Touchmote were detected in a different way in DemulShooter than they were on my end. I found out it's because of DemulShooter changes inbetween version 8.x and 10.x.

Here's how DemulShooter detects Wiimotes mapped to Xbox controller in 8.x: https://imgur.com/2zTnTXF

VS in 10.x: https://imgur.com/Lk7mzZq

I've been pretty busy and haven't had time to explore this option yet though.

That's pretty much all I got for now. Some people are for sure much more knowledgeable than me but it's a super niche topic and there aren't really any hub or community for it. I'll update if you guys are interested. :)

argonlefou commented 1 year ago

Thanks for the heads up.

Indeed DemulShooter v10.x was a big change in hardware handling :

Older version (v8.x etc....) was using Microsoft XInput set of functions. It was mainly done because I needed that to use an old Ps3 controller (mounted as a Xbox controller with some unofficial driver) to debug DemulShooter as I can't have a lightgun in my pocket everywhere. The fact that Wiimotes were working with Touchmote was a (nice) side-effect that was not on purpose.

But there was still another kind of device that was not possible to use at all : mounted arcade guns ( = gamepads ) That's why v10.x came with a new generic way to handle any HUD device (gamepads, touchscreen, mounted guns, etc.....). XInput replacement was successfully tested on a couple of gamepads I had and various XInput virtual programs.

However, I didn't know Wiimotes were not working anymore in Mode 4 like it was with old v8.x Unfortunatelly, I have no way to know if the fact that the axis is not detected is because of the way Touchmote driver is exporting things or because I messed with the automated device characteristics reading and understanding with Demulshooter... because even if I can borrow a Wiimote here and then, I still have no access to a Dolphin Bar. And I'm not telling that I can find for sure if I ever get one (please don't make people send stuff and ask for results lol)

But I find it weird that you can get axis movements (Mode 3) on DsDiag but not in DemulShooter_Gui/Demulshooter .... as they are sharing the same code

n33k33 commented 1 year ago

But I find it weird that you can get axis movements (Mode 3) on DsDiag but not in DemulShooter_Gui/Demulshooter .... as they are sharing the same code

Yeah I don't understand it. Made a quick video: https://www.youtube.com/watch?v=jUZRHp8JlBE

because even if I can borrow a Wiimote here and then, I still have no access to a Dolphin Bar. And I'm not telling that I can find for sure if I ever get one (please don't make people send stuff and ask for results lol)

I wouldn't mind contributing a dolphin bar to you for all your hard work honestly ^^ no results expected

Gonna try and do some testing on 8.x tonight to see how it goes.

edit: works indeed as shown in the linked video from previous post on DemulShooter 8.7

argonlefou commented 1 year ago

But I find it weird that you can get axis movements (Mode 3) on DsDiag but not in DemulShooter_Gui/Demulshooter .... as they are sharing the same code

Yeah I don't understand it. Made a quick video: https://www.youtube.com/watch?v=jUZRHp8JlBE

Hmm... you didn't choose the same axis in DsDiag (0x32 for X and I can't see for Y) and in DemulShooter_GUI (0x30 for X and 0x31 for Y) Could it be the cause ?

n33k33 commented 1 year ago

Good point I'll double check that.

So been able to make Model 2 games work pretty well with Mode 4 + Touchmote + DS 8.7 set as Xinput gamepads (right stick)

I was even able to make Haunted Museum 1 work that way which really surprised me ! Thought I had unlocked the key to easy 4 player support in any application using Wiimotes.

But then I tried Haunted Museum 2 with the exact same setup and it won't work which puzzles me even more now ...

edit: nevermind it's working ^^ was the wrong game.exe and DS simply wasn't hooking

Pretty exited right now ^^

KiiinkyFoxx commented 1 year ago

Just to let you know

2 Wiimotes, Touchmote and latest Demulshooter v10.12.0 works absolutely fine.

The only games I've not tested are Lethal Enforcers 3, Music Gun Gun 2, Art is Dead and Heavyfire series but works for everything else on the list and all emulators so no reason to think it wouldn't work for the above ones as well.

Works with either Left or Right stick - in fact one of my Wiimotes uses Left and other uses Right as able to adapt and adjust better to specific Wiimotes set ups

n33k33 commented 1 year ago

2 Wiimotes, Touchmote and latest Demulshooter v10.12.0 works absolutely fine.

Using Dolphin Bar ? In which mode ?

KiiinkyFoxx commented 1 year ago

Using Dolphin Bar ? In which mode ?

Yes and mode 4

n33k33 commented 1 year ago

Using Dolphin Bar ? In which mode ?

Yes and mode 4

I've tested extensively and could never make it work that way. Would love to see your setup. :)