Joystick mapping revamp?

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

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

User avatar
bootsector
Atariator
Atariator
Posts: 24
Joined: Wed Aug 21, 2019 11:51 am

Re: Joystick mapping revamp?

Postby bootsector » Thu Oct 10, 2019 8:58 pm

Sorgelig, just one minor thing about "A,B,X,Y,Start,Select,LT,RT", I would name them "A,B,X,Y,Start,Select,LB,RB". LT and RT are usually known as analog triggers and should map to something like L2 and R2 on a PS3 pad or LT and RT on a X360 controller. LB and RB are digital buttons on a X360 controller.

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

Re: Joystick mapping revamp?

Postby Newsdee » Fri Oct 11, 2019 12:50 am

Yes, the map files are secondary.

I don't want to derail the discussion with this map naming idea. The important part, for me, is the button naming and layout which is solved by having the "virtual SNES" concept

It can be done in different ways, but having a core declare which standard it needs would remove the guessing. I can suggest using the core config string but any other mechanism is.fine as long as core authors can (optionally) request it.

e.g. if a core declares "Megadrive" then a SNES layout to MD layout is applied. If it declares nothing then a default handling is done.

I hope that makes sense. It remains universal handling as far qs I can tell.
Last edited by Newsdee on Fri Oct 11, 2019 12:55 am, edited 2 times in total.

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

Re: Joystick mapping revamp?

Postby Newsdee » Fri Oct 11, 2019 12:52 am

I think SNES L, R are clear enough. I do agree that LT and RT gets confused with the analog triggers of XBox.

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

Re: Joystick mapping revamp?

Postby Newsdee » Fri Oct 11, 2019 4:04 am

An image goes a long way, and this could be a start of documentation:

"MiSTer uses a virtual game pad that assigns buttons to specific purposes.
Conceptually MiSTer has inside a controller with the following features:
- A directional pad
- Four face buttons in "compass" configuration (A B X Y = East South North West)
- Two trigger buttons (L and R)
- Start and Select buttons
- A home button (OSD)
- An analogue stick (X and Y)"

With this we can refer to buttons as e.g. "south button" without ambiguity.

mister-gamepad.jpg
You do not have the required permissions to view the files attached to this post.

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

Re: Joystick mapping revamp?

Postby Sorgelig » Fri Oct 11, 2019 1:46 pm

Newsdee wrote:It can be done in different ways, but having a core declare which standard it needs would remove the guessing. I can suggest using the core config string but any other mechanism is.fine as long as core authors can (optionally) request it.

this is called "make simple things over complicated."
This will add unneeded complexity and confusions. The problem is eliminated if make a mapping rule of "non-standard" buttons. Basically we are speaking about Genesis only. So if we agree that C=L and Z=R, then everything is solved. If you have SNES controller then assign in menu buttons according to this rule. Same if you have Genesis gamepad. And if internally MiSTer will follow the same rule, then Genesis core will properly map C and Z to correct buttons on physical Genesis gamepad.

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

Re: Joystick mapping revamp?

Postby Newsdee » Sat Oct 12, 2019 2:35 am

OK, I think we are on the same page. Looking forward to it! :D
If you change your mind about asking for code please let me know and I will have another look.

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 Oct 19, 2019 2:29 am

Newsdee wrote:OK, I think we are on the same page. Looking forward to it! :D
If you change your mind about asking for code please let me know and I will have another look.

you can implement it. But please without different virtual gamepads. We are sticking to a single SNES kind of gamepad.
I've checked the code, it will need to move around a system-wide buttons (like mouse) in structure to fit new buttons.
I think we are pretty much agree everything. I can add small corrections later.

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

Re: Joystick mapping revamp?

Postby Newsdee » Sun Oct 20, 2019 4:35 am

Sent you a PR, let me know any comments on github and I'll have another look if needed.

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 Oct 20, 2019 6:56 am

Please re-make PR based on latest code with least possible commits. This PR with 20+ commits is hard to understand.
Probably you can squash all commits locally then make PR. Or you can make a new clone and apply the changes then make PR.

The problems i've noticed so far:
1) I see you merged mouse buttons. This is not acceptable. User needs a freedom to assign the mouse buttons unrelated to SNES layout. Also when you press "Mouse Emu" the gamepad switches to mouse mode. So Start button simply won't work. That's why i've said above the structure of system map will need to be moved to fit the new buttons.
2) Remove compass from the names. It doesn't matter where ABXY buttons are located physically. Some users would like to have A on the east, some users would like it on the south. A/B and X/Y swap won't harm the functionality. Genesis gamepad has different positions unrelated to compass coordinates, btw.

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

Re: Joystick mapping revamp?

Postby Newsdee » Sun Oct 20, 2019 8:52 am

Done, it' s all in one commit now.
I added the mouse buttons separately and tweaked indices in input.cpp accordingly.

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 Oct 20, 2019 10:03 am

I see. Looks good now.
But that's just half way only. Please check my comment there.

zomgugoff
Atari maniac
Atari maniac
Posts: 80
Joined: Tue Jan 29, 2019 10:12 am

Re: Joystick mapping revamp?

Postby zomgugoff » Tue Nov 05, 2019 7:58 am

I have to say, the whole point of this revamp was to prevent having to remap a new controller on every core. But, as a result of the revamp, I'm having to do just that. This didn't make anything easier. I use several different controllers for different consoles and an arcade stick for the arcade cores. There's all kinds of different layouts between them (Genesis and PC Engine use 6-button layouts, but they're entirely different. NES and SMS action buttons are physically identical but have their order opposite, etc...)

With regards to arcade cores, if there were some uniformity with the start/coin button handling, it wouldn't be so bad. But right now, I have to check every arcade core I use because some use coin+start as a single action that automatically binds to select instead of start. Some games don't auto-bind their coin/start controls at all.

I'm not saying it was better before, but it's not better now either.
Last edited by zomgugoff on Tue Nov 05, 2019 8:30 am, edited 1 time in total.

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

Re: Joystick mapping revamp?

Postby Sorgelig » Tue Nov 05, 2019 8:15 am

Before, many cores had no map at all by default. Now most cores have.
Arcades will be re-vamped too.

zomgugoff
Atari maniac
Atari maniac
Posts: 80
Joined: Tue Jan 29, 2019 10:12 am

Re: Joystick mapping revamp?

Postby zomgugoff » Tue Nov 05, 2019 8:51 am

Sorgelig wrote:Before, many cores had no map at all by default. Now most cores have.
Arcades will be re-vamped too.


Can we get default maps for controllers with more than 4 face buttons? I didn't see anything in the main menu mapping for C/Z and 4/6 on Genesis and PC Engine controllers respectively. Also, the SMS buttons are backward. It's currently mapping A->1 and B->2, but the SMS controller was layed out with 1 on the left and 2 on the right, so it should be A->2 and B->1.

As a side note, I'm randomly getting stuck at a 'Canceling' message when trying to skip mappings with space bar.

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

Re: Joystick mapping revamp?

Postby Sorgelig » Tue Nov 05, 2019 9:11 am

zomgugoff wrote:Also, the SMS buttons are backward. It's currently mapping A->1 and B->2, but the SMS controller was layed out with 1 on the left and 2 on the right, so it should be A->2 and B->1.

Currently default auto-map is done my button names. Some cores will be updated to have an option to use positional default map.

zomgugoff wrote:Can we get default maps for controllers with more than 4 face buttons? I didn't see anything in the main menu mapping for C/Z and 4/6 on Genesis and PC Engine controllers respectively.

C is mapped to R, Z is mapped to L.

zomgugoff
Atari maniac
Atari maniac
Posts: 80
Joined: Tue Jan 29, 2019 10:12 am

Re: Joystick mapping revamp?

Postby zomgugoff » Tue Nov 05, 2019 9:40 am

Sorgelig wrote:
zomgugoff wrote:Can we get default maps for controllers with more than 4 face buttons? I didn't see anything in the main menu mapping for C/Z and 4/6 on Genesis and PC Engine controllers respectively.

C is mapped to R, Z is mapped to L.


It doesn't say anything about C/3 or Z/6 during the mapping process. Maybe that text should be added to the mapping dialog. Does the PC Engine's 3 and 6 buttons map to L and R?

Some of us are using controllers with 6 face buttons and L and R (8BitDo M30, for example). Right back to custom mapping again.

I know you can't make everyone happy or make everything automatic. You shouldn't have to. There are too many external variables. It just seems like the Sega 6-button layout (Basically, the Sega Saturn controller) should have been used instead of SNES/PSX. And yes, I am aware I don't have to use the automatic layouts, but we were forced recreate all of our mappings after some of us spent a lot of time making them already.

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

Re: Joystick mapping revamp?

Postby Sorgelig » Tue Nov 05, 2019 10:51 am

If you use Sega 6-button gamepad then assign C to R and Z to L in Menu core. Then 6button cores like Genesis will match the mapping C to C and Z to Z.

6-button gamepad cannot be a base gamepad as it's uncommon. 99% gamepads on the market have SNES-like layout. In terms of cores, there are also only 2 cores (Genesis and TGFX) need 6-button layout. So from all sides it's uncommon layout.
Manual definition is available, so it's possible to re-define as you like. It's rather convenience function than a requirement.

djmartins
Captain Atari
Captain Atari
Posts: 229
Joined: Wed Nov 21, 2018 10:26 pm

Re: Joystick mapping revamp?

Postby djmartins » Tue Nov 05, 2019 4:22 pm

I use a cheap chinese arcade stick box like this:
https://www.aliexpress.com/item/32948959370.html
Mine cost less but it is recognized by MiSTer and works well but took
a few tries to get mapped with the new joystick stuff.
I have other controllers but find this one the most useful
but I play more arcade games than consoles.

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

Re: Joystick mapping revamp?

Postby Newsdee » Wed Nov 06, 2019 2:07 am

zomgugoff wrote: It just seems like the Sega 6-button layout (Basically, the Sega Saturn controller) should have been used instead of SNES/PSX. And yes, I am aware I don't have to use the automatic layouts, but we were forced recreate all of our mappings after some of us spent a lot of time making them already.

Sega's hardware division is defunct. Eveybody else is using four face buttons. The modern standard is clear.

That said, there is a way to refine the mapping so it works more naturally with Sega style (6 or 3 button) controllers, but it would be a bit surprising to new users. Therefore I am not sure it can be a safe default. This would be a "positional" mapping whereby we translate "MiSTer YBA" into ABC and "MISTer LXR" into XYZ. 6 Button pads would have to be mapped in a specific way to match, but it works fine. But the caveat is that using that pad on SNES may feel unusual as a result.

If you have many mappimg files, would you mind sending them to me? I am experimenting in creating v3 map files out of old v2s. The idea would be to include these with a MiSTer install so we can even skip the initial gamepad config (for known controllers).

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

Re: Joystick mapping revamp?

Postby Newsdee » Wed Nov 06, 2019 4:57 am

MiSTer_mapping_sega.png


Long story short: you would need to map your 6-button pads this way to the MiSTer's "virtual pad".
I am planning to make a small change to the Genesis core to use a positional mapping that is friendly with 3 button games.

It would make these controller more natural to Sega cores, but a bit less natural to Nintendo cores.
The upside, though, is that SNES/PS style controllers should feel natural with Sega cores as a result given the YBA layout.
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 7:37 am

Having a bit of trouble getting my 2600-datper D9 (http://www.2600-daptor.com/2600-daptor%20D9.htm) working with my intellivision controller connected to it since this new "virtual snes" joystick was implemented in Mister.. anyway to "revert" to the old core behavior? Or some manual way to modify a config file an manually map the buttons?.. When I try to map it in the main mister screen, it seems to only recognizes some buttons but not all so I can't properly map anything (eg up/right but not say left or down, or CLEAR/ENTER or any of the number 0-9 buttons, etc) .. (it worked in the Mister versions before this new snes virtual joystick -- which in generally I really love, but this D9 2600-dapter issue seems hard to get around).

Any suggestions appreciated .. thanks!

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

Re: Joystick mapping revamp?

Postby Newsdee » Wed Nov 06, 2019 10:42 am

The low-level USB handling hasn't changed. Have you tested with Windows?
I had a similar issue with my 5200-Daptor, but it behaves the same on Windows so it's not my MiSTer...

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 Nov 06, 2019 12:35 pm

ericgus wrote:Having a bit of trouble getting my 2600-datper D9 (http://www.2600-daptor.com/2600-daptor%20D9.htm) working with my intellivision controller connected to it since this new "virtual snes" joystick was implemented in Mister.. anyway to "revert" to the old core behavior? Or some manual way to modify a config file an manually map the buttons?.. When I try to map it in the main mister screen, it seems to only recognizes some buttons but not all so I can't properly map anything (eg up/right but not say left or down, or CLEAR/ENTER or any of the number 0-9 buttons, etc) .. (it worked in the Mister versions before this new snes virtual joystick -- which in generally I really love, but this D9 2600-dapter issue seems hard to get around).

Any suggestions appreciated .. thanks!

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

cents
Atarian
Atarian
Posts: 1
Joined: Thu Oct 03, 2019 4:18 pm

Re: Joystick mapping revamp?

Postby cents » Wed Nov 06, 2019 1:21 pm

Sorgelig wrote:
ericgus wrote:Having a bit of trouble getting my 2600-datper D9 (http://www.2600-daptor.com/2600-daptor%20D9.htm) working with my intellivision controller connected to it since this new "virtual snes" joystick was implemented in Mister.. anyway to "revert" to the old core behavior? Or some manual way to modify a config file an manually map the buttons?.. When I try to map it in the main mister screen, it seems to only recognizes some buttons but not all so I can't properly map anything (eg up/right but not say left or down, or CLEAR/ENTER or any of the number 0-9 buttons, etc) .. (it worked in the Mister versions before this new snes virtual joystick -- which in generally I really love, but this D9 2600-dapter issue seems hard to get around).

Any suggestions appreciated .. thanks!

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


Hello, even my joystick has the same problem with the Mister Main 20191103. Right ok but left don't work and the menu say "canceling"

I'm back to 20191019 and everything works fine.
thanks anyway for the excellent work

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

Newsdee wrote:The low-level USB handling hasn't changed. Have you tested with Windows?
I had a similar issue with my 5200-Daptor, but it behaves the same on Windows so it's not my MiSTer...


Worked fine before and yea tested (on my mac -- dont have winderz, tested with the app "controllers light" and all buttons map fine, it works perfectly in OpenEMU as well on the mac) .. and it worked great on the previous version of Mister .. now .. not so much, I can't get it to recognize certain button presses which prevents me from even completing the mapping (in either the main mister menu or the core in question)


Return to “MiSTer”

Who is online

Users browsing this forum: Sorgelig and 12 guests