Absolute mouse coordinates

https://github.com/MiSTer-devel/Main_MiSTer/wiki

Moderators: Mug UK, Zorro 2, Greenious, spiny, Sorgelig, Moderator Team

Locutus73
Captain Atari
Captain Atari
Posts: 493
Joined: Wed Feb 07, 2018 6:13 pm

Re: Absolute mouse coordinates

Postby Locutus73 » Wed May 01, 2019 5:05 pm

Sorgelig wrote:Now Wiimote support is integrated into Linux.
You don't need to assign IR axes, so you don't need predefined map files anymore. Just setup the wiimote as normal gamepad.
Nunchuck and Classic controller sticks are also supported.

F10 in OSD is to enable/disable the Wiimote.

Great!
I’ll test it ASAP.
:cheers:

Regards.

Locutus73

Gamepimp
Atari User
Atari User
Posts: 32
Joined: Fri Nov 09, 2018 2:59 pm

Re: Absolute mouse coordinates

Postby Gamepimp » Wed May 01, 2019 9:06 pm

Sorgelig wrote:Now Wiimote support is integrated into Linux.
You don't need to assign IR axes, so you don't need predefined map files anymore. Just setup the wiimote as normal gamepad.
Nunchuck and Classic controller sticks are also supported.

F10 in OSD is to enable/disable the Wiimote.


This still requires a DolphinBar or some similar device for the Wiimote to communicate with, correct?

zomgugoff
Atari freak
Atari freak
Posts: 59
Joined: Tue Jan 29, 2019 10:12 am

Re: Absolute mouse coordinates

Postby zomgugoff » Thu May 02, 2019 12:15 am

Gamepimp wrote:This still requires a DolphinBar or some similar device for the Wiimote to communicate with, correct?


Yes. It requires a bluetooth device. The sensor bar is only needed if you want to use the IR pointing.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5270
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Absolute mouse coordinates

Postby Sorgelig » Thu May 02, 2019 4:30 am

zomgugoff wrote:
Gamepimp wrote:This still requires a DolphinBar or some similar device for the Wiimote to communicate with, correct?


Yes. It requires a bluetooth device. The sensor bar is only needed if you want to use the IR pointing.


Dolphinbar is a 3rd-party device. It's NOT required. Probably it can be used as a passive IR light.
What you need is just standard IR emitter bar from Wii or similar. You need to supply the power to it - there are some bars available with USB power.
You even can fire 2 candles on TV sides - they won't require the power :) It will work as well :mrgreen:

I've took IR bar from one of my Wii console, shorted one LED on each side (to reduce required voltage) and connected USB plug to it. So now it's powered from USB.

Similar article: https://rolandtapken.de/blog/2017-07/mo ... wer-supply
Author doesn't know that current in sequentially connected LEDs is the same (not multiplied) so it's 50mA per side, not 150mA, but in general that guide can be used.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5270
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Absolute mouse coordinates

Postby Sorgelig » Thu May 02, 2019 5:08 am

I've ordered Dolphinbar - so will check it later.

warham
Atari maniac
Atari maniac
Posts: 97
Joined: Fri Oct 12, 2018 7:17 am

Re: Absolute mouse coordinates

Postby warham » Thu May 02, 2019 7:04 am

arcadeguns.com sells USB IR bars in 2 sizes, in case you are far away from a large screen.
http://www.arcadeguns.com/index.php?main_page=product_info&cPath=2&products_id=225&zenid=n4p4b91d6m5cn40ocrhrm6uc84

Locutus73
Captain Atari
Captain Atari
Posts: 493
Joined: Wed Feb 07, 2018 6:13 pm

Re: Absolute mouse coordinates

Postby Locutus73 » Thu May 02, 2019 8:28 am

Sorgelig wrote:I've ordered Dolphinbar - so will check it later.

Great! Do you mean to tweak some special QUIRK_DOLPINBAR code in order to handle it without having to assign its IR pointing events doing special tricks in the joypad configuration wizard? If you want I can provide some MiSTer logs for both mode 2 and 3 if they're what you need. I can contact a guy on the Discord channel who has an Aimtrack lightgun and managed to make it work with MiSTer, in order to get some logs if you need them.

Regards.

Locutus73

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5270
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Absolute mouse coordinates

Postby Sorgelig » Thu May 02, 2019 10:18 am

Basically i need axes numbers used for IR tracking and vid/pid.
There must be at least dpad and enough buttons to manage the core and OSD, so IR tracking and basic joystick control will come from the same device. Otherwise it will be hard to use such input device.
NES core has option for lightgun on Joystick 2 which relaxes above requirement, but it may be won't available in all cores.

Locutus73
Captain Atari
Captain Atari
Posts: 493
Joined: Wed Feb 07, 2018 6:13 pm

Re: Absolute mouse coordinates

Postby Locutus73 » Thu May 02, 2019 10:50 am

Sorgelig wrote:Basically i need axes numbers used for IR tracking and vid/pid.

Ok, I can do that for Dolphinbar (even if you'll get yours in a few days) and I can request those data for the Aimtrak lightgun.

Sorgelig wrote:There must be at least dpad and enough buttons to manage the core and OSD, so IR tracking and basic joystick control will come from the same device. Otherwise it will be hard to use such input device.

This might be difficult. We have dpad and enough buttons for sure with Dolphinbar in mode 3 with a Nunchuck connected. I don't know with the Aimtrak, we'll see.

Regards.

Locutus73

Gamepimp
Atari User
Atari User
Posts: 32
Joined: Fri Nov 09, 2018 2:59 pm

Re: Absolute mouse coordinates

Postby Gamepimp » Thu May 02, 2019 11:17 am

For the NES, I would like to be able to use the Wiimote for lightgun games and my 8Bitdo controller for everything else. Would it be possible at some point to be able to have multiple controllers mapped in MiSTer and be able to select the preferred one before playing a game? I like to play with original controllers on my consoles and I essentially have a different controller for each system (USB or 8Bitdo). It would be nice to be able to add all these controllers to MiSTer and then I could select the controller I want in each core.

Locutus73
Captain Atari
Captain Atari
Posts: 493
Joined: Wed Feb 07, 2018 6:13 pm

Re: Absolute mouse coordinates

Postby Locutus73 » Thu May 02, 2019 11:46 am

Gamepimp wrote:For the NES, I would like to be able to use the Wiimote for lightgun games and my 8Bitdo controller for everything else. Would it be possible at some point to be able to have multiple controllers mapped in MiSTer and be able to select the preferred one before playing a game? I like to play with original controllers on my consoles and I essentially have a different controller for each system (USB or 8Bitdo). It would be nice to be able to add all these controllers to MiSTer and then I could select the controller I want in each core.

I might be wrong, but I think what you're asking is already there.
You can have whatever controllers connected to MiSTer, once you fire a core, the first you use is the first controller connected to the virtual console/computer, the second... the second controller.
@Sorgelig please correct me if I'm saying something stupid.

Regards.

Locutus73

User avatar
kitrinx
Captain Atari
Captain Atari
Posts: 174
Joined: Wed Sep 26, 2018 6:03 am

Re: Absolute mouse coordinates

Postby kitrinx » Thu May 02, 2019 1:09 pm

Gamepimp wrote:For the NES, I would like to be able to use the Wiimote for lightgun games and my 8Bitdo controller for everything else. Would it be possible at some point to be able to have multiple controllers mapped in MiSTer and be able to select the preferred one before playing a game? I like to play with original controllers on my consoles and I essentially have a different controller for each system (USB or 8Bitdo). It would be nice to be able to add all these controllers to MiSTer and then I could select the controller I want in each core.


What you're looking for is Peripheral : Zapper (Joy2) and just make sure you use the 8bitdo controller first, so it takes the player 1 spot.

Gamepimp
Atari User
Atari User
Posts: 32
Joined: Fri Nov 09, 2018 2:59 pm

Re: Absolute mouse coordinates

Postby Gamepimp » Thu May 02, 2019 1:10 pm

You have to define the buttons on the controller in the main menu first before using in a core. When a new controller is defined, doesn't that overwrite the map for the previous controller?

Locutus73
Captain Atari
Captain Atari
Posts: 493
Joined: Wed Feb 07, 2018 6:13 pm

Re: Absolute mouse coordinates

Postby Locutus73 » Thu May 02, 2019 1:36 pm

Gamepimp wrote:You have to define the buttons on the controller in the main menu first before using in a core. When a new controller is defined, doesn't that overwrite the map for the previous controller?

Maps are specific for VID:PID pairs, so, as long two controllers don't share the same VID:PID they have individual maps. Some adapters/controllers mimic Xbox360 wired controller sharing its 045E:028E VID:PID.

Regards.

Locutus73

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5270
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Absolute mouse coordinates

Postby Sorgelig » Thu May 02, 2019 2:13 pm

Locutus73 wrote:@Sorgelig please correct me if I'm saying something stupid.

you are correct.

There is a trick to re-number the controllers without reloading the core: every plug/unplug of any controller clears the numbers. So after this procedure you need to press any button on controller you want to use as first player.

With Wiimote support it's enough to enable/disable the wiimote in OSD and numbers will be cleared.
So this hack can be used if you want to change the controller for specific player.

Gamepimp
Atari User
Atari User
Posts: 32
Joined: Fri Nov 09, 2018 2:59 pm

Re: Absolute mouse coordinates

Postby Gamepimp » Thu May 02, 2019 2:58 pm

Locutus73 wrote:Maps are specific for VID:PID pairs, so, as long two controllers don't share the same VID:PID they have individual maps. Some adapters/controllers mimic Xbox360 wired controller sharing its 045E:028E VID:PID.


Good to know. Thanks! :cheers:

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5270
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Absolute mouse coordinates

Postby Sorgelig » Sat May 04, 2019 8:44 pm

I'm in process of adding native support for Wiimote, so it won't require cwiid.
The major advantage is support for RVL-CNT-01-TR (Wiimote v2.0). cwiid doesn't support it.
Also native support allows to connect more than one wiimote without hassle.

RVL-CNT-01-TR still has some problem - when it reconnects it gives very short time to connect, so it always fails. So every time you want to use RVL-CNT-01-TR you have to pair it. RVL-CNT-01 (old Wiimote) gives longer time to reconnect, so it doesn't need to pair every time.

All in all, old Wiimote is preferable for MiSTer.

Locutus73
Captain Atari
Captain Atari
Posts: 493
Joined: Wed Feb 07, 2018 6:13 pm

Re: Absolute mouse coordinates

Postby Locutus73 » Sat May 04, 2019 11:44 pm

Sorgelig wrote:I'm in process of adding native support for Wiimote, so it won't require cwiid.

XWiimote?

Regards.

Locutus73

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5270
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Absolute mouse coordinates

Postby Sorgelig » Sun May 05, 2019 8:43 am

here is the test version:
https://mega.nz/#!tMQjwaBQ!6jwSzErka9qv ... HHtXo2Br_A

replace files through ftp/ssh. Original blootoothd and MiSTer files should be renamed (or deleted) first - otherwise Linux won't allow to replace it. You need to reboot after replace.
Pairing procedure for Wiimote is the same as for any BT device - through F11.

note1: You must use red sync button on the back of wiimote. 1+2 won't work!
note2: Wiimote with motion plus integrated (-TR) requires pairing on every use.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5270
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Absolute mouse coordinates

Postby Sorgelig » Sun May 05, 2019 11:52 am

I found that 1+2 button pairing is also permanent unlike it's written in different places.
So, native support can use 1+2 pair mode instead of red button. But cannot use both. So need to decide.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5270
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Absolute mouse coordinates

Postby Sorgelig » Sun May 05, 2019 1:03 pm

Ok, after several resets of Wiimote it finally stopped to wakeup from buttons if it paired by 1+2. So there is no way to turn on the Wiimote unless you press 1+2 which means it will enter to pairing mode.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5270
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Absolute mouse coordinates

Postby Sorgelig » Tue May 07, 2019 12:00 pm

Thanks for "feedbacks" (for absence of feedback actually).
So i see this topic is not so interesting.
In the meantime i've got the Dolphinbar. What i found that the main mode (mode 4) doesn't work in Linux. While wiimotes are connected to Dolphinbar the linux HID driver complains and refuses to work. It seems wiimotes in this case should be passed through to underlaying hid driver but something prevent it to work.
Actually it's possible to use dolphin bar as a dummy IR emitter and use generic BT dongle, but i would like to avoid it. It seems BT on dolphinbar is working good, so it's better to use it.

So i need help to make dolphinbar work in mode 4 (pass-through). Probably some patching of kernel driver is required.

Locutus73
Captain Atari
Captain Atari
Posts: 493
Joined: Wed Feb 07, 2018 6:13 pm

Re: Absolute mouse coordinates

Postby Locutus73 » Tue May 07, 2019 2:19 pm

Sorgelig wrote:So i need help to make dolphinbar work in mode 4 (pass-through). Probably some patching of kernel driver is required.

I know this is not what you're looking for, but with these
DolphinBar_maps.zip
map files you can use DolphinBar in mode 2 (with Zapper Trigger = Mouse in NES core) or in mode 3 (with a Nunchuck connected to the Wiimote). With these two modes the pointer is wobbling, cwiid seems to apply some low pass filtering and gives a better experience. I have yet to try your new embedded implementation.

Regards.

Locutus73
You do not have the required permissions to view the files attached to this post.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5270
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Absolute mouse coordinates

Postby Sorgelig » Tue May 07, 2019 2:56 pm

Yes, Dolphinbar can be used in mode 1 and 2 as a bare touchscreen input device with absolute coordinates.
But in this mode Wiimote is very crippled. Only one wiimote is supported. Basically it's just mouse device without ability to use it as a gamepad.
Without mode 4 support dolphinbar is pretty much useless. It even doesn't emit the IR if no wiimote is connected. So it cannot be used as a dummy IR bar. I'm very surprised no one (even mayflash team) dared to write the driver for mode 4 for Linux.

I'm very disappointed and don't recommend to buy this crap. It's just wasting the money.

So, use original Wii IR bar with modification to draw the power from USB. Or buy some 3rd part IR bar which is power from USB originally.

Locutus73
Captain Atari
Captain Atari
Posts: 493
Joined: Wed Feb 07, 2018 6:13 pm

Re: Absolute mouse coordinates

Postby Locutus73 » Tue May 07, 2019 3:43 pm

Sorgelig wrote:Yes, Dolphinbar can be used in mode 1 and 2 as a bare touchscreen input device with absolute coordinates.

Yup, mode 1a, 1b, 2 and 3, but mode 1a and 1b are intended for desktop use, not gaming use. When you click the trigger it issues a left mouse click, but it stops the mouse pointer for a while, so Windows actually registers a click on an icon. In mode 2 it doesn't stop the pointer so, since it's continuosly wiggling, you can't actully click anything on Windows. Mode 2 and 3 are game oriented.

Sorgelig wrote:But in this mode Wiimote is very crippled. Only one wiimote is supported. Basically it's just mouse device without ability to use it as a gamepad.

Yes, that's the goal of mode 1-2-3. By the way, what would be the use of more than one wiimote? Two player lightgun games?

Sorgelig wrote:Without mode 4 support dolphinbar is pretty much useless. It even doesn't emit the IR if no wiimote is connected. So it cannot be used as a dummy IR bar. I'm very surprised no one (even mayflash team) dared to write the driver for mode 4 for Linux.

Mode 4 is intended for Dolphin emulator use, so we can find some code here https://github.com/dolphin-emu/dolphin

Regards.

Locutus73


Return to “MiSTer”

Who is online

Users browsing this forum: cacophony and 9 guests