Joystick mapping revamp?

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

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

ericgus
Atari Super Hero
Atari Super Hero
Posts: 500
Joined: Fri Apr 08, 2016 4:53 am
Location: Boston MA - USA

Re: Joystick mapping revamp?

Postby ericgus » Wed Nov 06, 2019 5:36 pm

Sorgelig wrote:As Newsdee told, there was no change in gamepad handling. So changes should not affect the work of this adapter. Basically it just asks for 4 more buttons, nothing more.


maybe the case but SOMETHING is going wonky.. I cant get Mister to recognize the buttons it did previously.. so I can't even finish the mapping. At best it "partly" works..

I can only get like right, down to work, with this new mister version, I cant proceed to get the other directions mapped, nor any of the numeric buttons, the clr/enter or the side buttons.. they just dont work now (they did before with no problems). Its like the Mister stops responding to the joystick inputs after a button press or two..

for reference the controller looks like this :
Image

some screen shots showing on my Mac how the adapter is detected and how it maps the buttons in the Joystick tester and the openEMU applications. Hope this helps.
You do not have the required permissions to view the files attached to this post.

ericgus
Atari Super Hero
Atari Super Hero
Posts: 500
Joined: Fri Apr 08, 2016 4:53 am
Location: Boston MA - USA

Re: Joystick mapping revamp?

Postby ericgus » Wed Nov 06, 2019 10:47 pm

forgot to add, if there is any diagnostic testing I can do to help figure out what the issue is .. please let me know how I can assist.

User avatar
Newsdee
Atari God
Atari God
Posts: 1538
Joined: Fri Sep 19, 2014 8:40 am

Re: Joystick mapping revamp?

Postby Newsdee » Thu Nov 07, 2019 2:23 am

Can you connect your MiSTer via its terminal console and read the debug output from it?
https://github.com/MiSTer-devel/Main_Mi ... connection

When you run the above on the menu core, it will print out all the USB events.
That should give us a hint of what is going on with the adapter.

Also can you please send the .map file that you mapped on the menu core?
I want to check how you mapped your OSD button; it's possible that when you try to map in cores, that button is pushed and it clears all mappings.

Basically, one cannot remap the OSD button defined in menu but if that is an issue, you can just skip it.

ericgus
Atari Super Hero
Atari Super Hero
Posts: 500
Joined: Fri Apr 08, 2016 4:53 am
Location: Boston MA - USA

Re: Joystick mapping revamp?

Postby ericgus » Thu Nov 07, 2019 5:25 am

Newsdee wrote:Can you connect your MiSTer via its terminal console and read the debug output from it?
https://github.com/MiSTer-devel/Main_Mi ... connection

When you run the above on the menu core, it will print out all the USB events.
That should give us a hint of what is going on with the adapter.

Also can you please send the .map file that you mapped on the menu core?
I want to check how you mapped your OSD button; it's possible that when you try to map in cores, that button is pushed and it clears all mappings.

Basically, one cannot remap the OSD button defined in menu but if that is an issue, you can just skip it.


I need to connect the mister to my computer with a mini usb cable (thats DIFFERENT) that the one used for USB joysticks and such correct? am I reading this right? .. its not something that can be done by SSH'ing into the mister ?

the .map files are in the CONFIG directory correct? I might clear them out and try again, and send you the newer fresh ones...

User avatar
Newsdee
Atari God
Atari God
Posts: 1538
Joined: Fri Sep 19, 2014 8:40 am

Re: Joystick mapping revamp?

Postby Newsdee » Thu Nov 07, 2019 11:56 am

Yes. the serial console uses the mini USB connector between the Ethernet plug and the regular micro USB plug.
Once connected Windows should assign a COM port for it, and then you can use any terminal program.

I just want to check your map to see if I see anything unusual. It's a long shot but maybe there's something that didn't setup right.

ericgus
Atari Super Hero
Atari Super Hero
Posts: 500
Joined: Fri Apr 08, 2016 4:53 am
Location: Boston MA - USA

Re: Joystick mapping revamp?

Postby ericgus » Thu Nov 07, 2019 4:40 pm

ok ill give it a go (gotta dig out one of those cables) ..

thanks.. hopefully we can sort this out.

ericgus
Atari Super Hero
Atari Super Hero
Posts: 500
Joined: Fri Apr 08, 2016 4:53 am
Location: Boston MA - USA

Re: Joystick mapping revamp?

Postby ericgus » Fri Nov 08, 2019 5:56 am

Newsdee wrote:Yes. the serial console uses the mini USB connector between the Ethernet plug and the regular micro USB plug.
Once connected Windows should assign a COM port for it, and then you can use any terminal program.

I just want to check your map to see if I see anything unusual. It's a long shot but maybe there's something that didn't setup right.



Is this the sort of thing you are looking for, note some buttons didnt elicit any sort of output .. others did .. (eg the side buttons failed to get any response) some of the numeric key buttons also failed to generate output, others did..

like before I could not successfully map many if any buttons or the dpad fully (I had to skip most buttons as they simply didnt register when I tried to push the corresponding button when asked) this is, at best, partly mapped. I think maybe up/down/right mapped and that was about it.. LEFT wouldnt map at all and just ignored my attempts.. same with most of the 0-9, CLEAR/ENTER buttons and the side buttons.

(Again I want to repeat. the old version of the Mister without the virtual snes controller, this joystick/usb adapter worked perfectly)

input_04d8_f6eb_v3.map.txt


login: Input event: type=EV_ABS, Axis=0, Offset=3, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_ABS, Axis=1, Offset=795, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_ABS, Axis=1, Offset=1007, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_ABS, Axis=0, Offset=512, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_ABS, Axis=1, Offset=512, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_ABS, Axis=0, Offset=1, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_ABS, Axis=1, Offset=1, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_KEY, code=289(0x121), value=1, jnum=0, ID:04d8:f6eb:05
Input event: type=EV_ABS, Axis=0, Offset=512, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_ABS, Axis=1, Offset=512, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_KEY, code=289(0x121), value=0, jnum=0, ID:04d8:f6eb:05
Input event: type=EV_ABS, Axis=0, Offset=3, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_ABS, Axis=1, Offset=999, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_ABS, Axis=0, Offset=512, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_ABS, Axis=1, Offset=512, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_ABS, Axis=0, Offset=1, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_ABS, Axis=1, Offset=3, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_KEY, code=289(0x121), value=1, jnum=0, ID:04d8:f6eb:05
Input event: type=EV_ABS, Axis=0, Offset=512, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_ABS, Axis=1, Offset=512, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_KEY, code=289(0x121), value=0, jnum=0, ID:04d8:f6eb:05
Input event: type=EV_ABS, Axis=0, Offset=1, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_ABS, Axis=1, Offset=1023, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_ABS, Axis=1, Offset=3, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_KEY, code=289(0x121), value=1, jnum=0, ID:04d8:f6eb:05
Input event: type=EV_ABS, Axis=1, Offset=512, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_KEY, code=289(0x121), value=0, jnum=0, ID:04d8:f6eb:05
Input event: type=EV_ABS, Axis=0, Offset=512, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_ABS, Axis=0, Offset=1, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_ABS, Axis=1, Offset=3, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_KEY, code=289(0x121), value=1, jnum=0, ID:04d8:f6eb:05
Input event: type=EV_ABS, Axis=0, Offset=512, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_ABS, Axis=1, Offset=512, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_KEY, code=289(0x121), value=0, jnum=0, ID:04d8:f6eb:05
Input event: type=EV_ABS, Axis=0, Offset=1, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_ABS, Axis=0, Offset=512, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_ABS, Axis=0, Offset=1, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_ABS, Axis=0, Offset=512, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_ABS, Axis=0, Offset=1, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_ABS, Axis=1, Offset=1023, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
Input event: type=EV_ABS, Axis=1, Offset=3, jnum=0, ID:04d8:f6eb:05, abs_min = 0, abs_max = 1023, fuzz = 3
You do not have the required permissions to view the files attached to this post.

angelicliver
Retro freak
Retro freak
Posts: 16
Joined: Wed May 15, 2019 11:30 am

Re: Joystick mapping revamp?

Postby angelicliver » Sat Nov 09, 2019 10:06 am

I'm experiencing exactly the same bizarre behaviour since the mapping revamp with my 8bitdo USB adapters and SF30, M30, N30 etc. I've not had time to hook up USB debugging yet but everything works fine on MiSTer Main builds prior to the revamp. I will try to post the output log later this weekend.

Thanks for everyone's hard work.

Threepwood
Atari maniac
Atari maniac
Posts: 87
Joined: Thu Jan 10, 2019 10:06 am

Re: Joystick mapping revamp?

Postby Threepwood » Sat Nov 09, 2019 1:33 pm

angelicliver wrote:I'm experiencing exactly the same bizarre behaviour since the mapping revamp with my 8bitdo USB adapters and SF30, M30, N30 etc. I've not had time to hook up USB debugging yet but everything works fine on MiSTer Main builds prior to the revamp. I will try to post the output log later this weekend.

Thanks for everyone's hard work.


I got the same issue with my SN30 and M30 connected to an 8bitdo bluetooth dongle with latest firmware. I cannot remap the controllers in Genesis/SNES, because while assigning the D-Pad it always goes to "cancelling".

My SN30 Pro+ works, though.

I haven't tested any other cores or gamepads.
2x MiSTer FPGA: [Official Stormtrooper Case, USB Hub 2.1 with Bridge Board, 128MB SDRAM, ADC, RTC 1.3, I/O v5.5] + [3D printed MiSTer XS Case v2, 128MB SDRAM, I/O v5.6 XL]

paulbnl
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 119
Joined: Wed Oct 24, 2018 9:43 am

Re: Joystick mapping revamp?

Postby paulbnl » Sat Nov 09, 2019 3:03 pm

It should work if you don't skip the Menu button when mapping the controller in Menu core.

Threepwood
Atari maniac
Atari maniac
Posts: 87
Joined: Thu Jan 10, 2019 10:06 am

Re: Joystick mapping revamp?

Postby Threepwood » Sat Nov 09, 2019 3:54 pm

paulbnl wrote:It should work if you don't skip the Menu button when mapping the controller in Menu core.


Thanks Paulbnl, now they work when I map the menu button (I use Select+Start). I indeed skipped the menu button with gamepads that have no dedicated button that can be used for this.

This is still unexpected behavior and I would suggest maybe having select+menu as default combination for Menu?
2x MiSTer FPGA: [Official Stormtrooper Case, USB Hub 2.1 with Bridge Board, 128MB SDRAM, ADC, RTC 1.3, I/O v5.5] + [3D printed MiSTer XS Case v2, 128MB SDRAM, I/O v5.6 XL]

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

Re: Joystick mapping revamp?

Postby Sorgelig » Sat Nov 09, 2019 7:52 pm

Threepwood wrote:
paulbnl wrote:It should work if you don't skip the Menu button when mapping the controller in Menu core.


Thanks Paulbnl, now they work when I map the menu button (I use Select+Start). I indeed skipped the menu button with gamepads that have no dedicated button that can be used for this.

This is still unexpected behavior and I would suggest maybe having select+menu as default combination for Menu?

Why don't assign Menu button to dedicated button? All 8bitdo gamepads have separate surface button which works fine as menu button.

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

Re: Joystick mapping revamp?

Postby Sorgelig » Sat Nov 09, 2019 8:40 pm

i've tried to skip the Menu button and still have no "cancelling" message in core gamepad assignment.. What else i have to do to reproduce the problem?

Threepwood
Atari maniac
Atari maniac
Posts: 87
Joined: Thu Jan 10, 2019 10:06 am

Re: Joystick mapping revamp?

Postby Threepwood » Sat Nov 09, 2019 10:17 pm

Sorgelig wrote:Why don't assign Menu button to dedicated button? All 8bitdo gamepads have separate surface button which works fine as menu button.


My bad, after a firmware update the 8bitdo USB adapters were no longer in X-Input mode -_-; That is why many of the buttons no longer worked. When I set them back to X-Input mode (Select+UP for 3 seconds till the LED on the bluetooth dongle blinks and reconnects the gamepad), then I can map all buttons, except the Star-Button on the SN30 Pro+.

Good that you mentioned that they work for you.

I will test if the cancelling still appears in that mode, even when the menu button is not assigned.

EDIT: With the M30 skipping the menu button I am not asked to assign LEFT in the Genesis core and LEFT won't work, but no "cancelling"

EDIT2: The M30 missing the LEFT query in Genesis only happens when the menu buttons is not assigned. With Menu button it works as intended. The SN30 Pro+ is asked for LEFT in the Genesis core, no matter if the Menu button is assigned or not.
2x MiSTer FPGA: [Official Stormtrooper Case, USB Hub 2.1 with Bridge Board, 128MB SDRAM, ADC, RTC 1.3, I/O v5.5] + [3D printed MiSTer XS Case v2, 128MB SDRAM, I/O v5.6 XL]

paulbnl
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 119
Joined: Wed Oct 24, 2018 9:43 am

Re: Joystick mapping revamp?

Postby paulbnl » Sat Nov 09, 2019 10:57 pm

Sorgelig wrote:i've tried to skip the Menu button and still have no "cancelling" message in core gamepad assignment.. What else i have to do to reproduce the problem?


The issue is with EV_ABS events sending the axis 0 as ev->code 0 and Menu combo is also 0 when undefined.

Mapping menu button is only done with EV_KEY events so setting osd_combo only with EV_KEY event fixes it.

Code: Select all

   if (ev->type == EV_KEY && ev->code == input[dev].mmap[SYS_BTN_OSD_KTGL + 2])
   {
      if (ev->value) input[dev].osd_combo |= 2;
      else input[dev].osd_combo &= ~2;
   }

   if (ev->type == EV_KEY && ev->code == input[dev].mmap[SYS_BTN_OSD_KTGL + 1])
   {
      if (ev->value) input[dev].osd_combo |= 1;
      else input[dev].osd_combo &= ~1;
   }

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

Re: Joystick mapping revamp?

Postby Sorgelig » Sun Nov 10, 2019 8:28 am

paulbnl wrote:The issue is with EV_ABS events sending the axis 0 as ev->code 0 and Menu combo is also 0 when undefined.

Mapping menu button is only done with EV_KEY events so setting osd_combo only with EV_KEY event fixes it.

Thanks for tracking down the problem!

angelicliver
Retro freak
Retro freak
Posts: 16
Joined: Wed May 15, 2019 11:30 am

Re: Joystick mapping revamp?

Postby angelicliver » Mon Nov 11, 2019 9:31 am

paulbnl wrote:
Sorgelig wrote:i've tried to skip the Menu button and still have no "cancelling" message in core gamepad assignment.. What else i have to do to reproduce the problem?


The issue is with EV_ABS events sending the axis 0 as ev->code 0 and Menu combo is also 0 when undefined.

Mapping menu button is only done with EV_KEY events so setting osd_combo only with EV_KEY event fixes it.

Code: Select all

   if (ev->type == EV_KEY && ev->code == input[dev].mmap[SYS_BTN_OSD_KTGL + 2])
   {
      if (ev->value) input[dev].osd_combo |= 2;
      else input[dev].osd_combo &= ~2;
   }

   if (ev->type == EV_KEY && ev->code == input[dev].mmap[SYS_BTN_OSD_KTGL + 1])
   {
      if (ev->value) input[dev].osd_combo |= 1;
      else input[dev].osd_combo &= ~1;
   }


Thanks for tracking this down. I'd originally mapped the controls with an SFC30 (now rebranded SF30) which doesn't have a dedicated menu button. Confirming I was in x-input I had some limited success in the 10 minutes I was playing around yesterday but was still finding odd behaviour. Especially when plugging in two USB adapters (menu scrolls by itself quickly).

I'm travelling for work a lot at the moment but will try to put a video together.

ericgus
Atari Super Hero
Atari Super Hero
Posts: 500
Joined: Fri Apr 08, 2016 4:53 am
Location: Boston MA - USA

Re: Joystick mapping revamp?

Postby ericgus » Wed Nov 13, 2019 7:08 pm

I just want to say with this fix, the issue I had is gone and everything is working again..

THANK YOU ALL !

User avatar
Paradroyd
Captain Atari
Captain Atari
Posts: 293
Joined: Tue Sep 10, 2013 10:50 pm
Contact:

Re: Joystick mapping revamp?

Postby Paradroyd » Thu Nov 14, 2019 4:53 am

ericgus wrote:I just want to say with this fix, the issue I had is gone and everything is working again..

THANK YOU ALL !


Same here. Thanks!
- Paradroyd
@paradroyd on Twitter, @paradroyd@mastodon.sdf.org on Mastodon

User avatar
witchmaster
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 136
Joined: Wed Jun 15, 2011 10:50 am

Re: Joystick mapping revamp?

Postby witchmaster » Wed Dec 25, 2019 9:15 pm

When mapping using the new system, I map a SNES style gamepad according to the button position on the GUI layout. This makes button A the 'enter' button in the GUI and B the 'cancel' button, but I want button B to be ENTER, can I change this behavior without mapping A->B and B->A (messes up cores).

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

Re: Joystick mapping revamp?

Postby Sorgelig » Wed Dec 25, 2019 9:41 pm

witchmaster wrote:When mapping using the new system, I map a SNES style gamepad according to the button position on the GUI layout. This makes button A the 'enter' button in the GUI and B the 'cancel' button, but I want button B to be ENTER, can I change this behavior without mapping A->B and B->A (messes up cores).

I'm thinking about it.

mosquis
Atarian
Atarian
Posts: 3
Joined: Thu Dec 26, 2019 7:31 am

Re: Joystick mapping revamp?

Postby mosquis » Thu Dec 26, 2019 10:55 am

It is possible to map the controls of 2 or 4 players with a single USB controller? I want to build an arcade stick with 2 players with one xinmo controller but I don't find how to do the mapping. If cannot be possible, please consider to add this function in a future code update.

Thanks in advance, and thank you for the impressive work done. :cheers:

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

Re: Joystick mapping revamp?

Postby Sorgelig » Thu Dec 26, 2019 7:31 pm

mosquis wrote:It is possible to map the controls of 2 or 4 players with a single USB controller? I want to build an arcade stick with 2 players with one xinmo controller but I don't find how to do the mapping. If cannot be possible, please consider to add this function in a future code update.

It's impossible. Use 2 boards for 2 players - should work.
There are several open source USB adapter for GPIO joysticks.

jayp76
Atari freak
Atari freak
Posts: 63
Joined: Wed Oct 17, 2018 10:09 am

Re: Joystick mapping revamp?

Postby jayp76 » Fri Jan 17, 2020 3:59 pm

Are there any plans to add a control change feature? What i mean is a menu option to change what control to use on the fly. From D-Pad to Analogue Stick and vice versa? Or use both simultaniously. You wouldn't need to remap. This would be very handy. Something like the Mode button from the PS2 Controller.

softtest1
Atari User
Atari User
Posts: 32
Joined: Tue Apr 30, 2019 6:37 pm

Re: Joystick mapping revamp?

Postby softtest1 » Fri Jan 17, 2020 5:00 pm

Is there any particular reason to explicitly switch between analog and digital? You can already map the emulated d-pad to both your real d-pad and the left analog stick, and use them at the same time.

The Analog button on the DualAnalog/DualShock is only there for backward-compatibility since earlier PS1 games won't recognize any input at all unless the analog sticks are disabled.


Return to “MiSTer”

Who is online

Users browsing this forum: SegaMan and 8 guests