MiST - new joystick/gamepad mapping

https://github.com/mist-devel/mist-board/wiki

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

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

Re: MiST - new joystick/gamepad mapping

Postby Newsdee » Mon Dec 03, 2018 12:08 pm

slingshot wrote:I didn't test myself, but don't understand a custom remap why doesn't override the built-in, applying joy_remap happens after the default mapping:
https://github.com/mist-devel/mist-firm ... ing.c#L312


I just remembered that the joypads have two kinds of mappings: the usual mapping used by mist.ini and a lower-level hardware mapping between the USB HID interface (basically hardware) and an "internal" software joypad which is then used for mapping from config. Typically, most pads use the default HID handling and then all mapping is done downstream... but sometimes gamepads have issues and need tweaks to work.

IIRC the NES Retrolink adapter had an issue that one of the buttons was always pressed which made it problematic to use. So it was necessary to apply a hardware override to reassign some of the problematic buttons: https://github.com/mist-devel/mist-firm ... hid.c#L371

It is possible to override this setting but it's a different config entry, "hid_button_remap".
It works a bit differently than the joystick mapping though, one has to know what is the bit location of buttons in the HID message, provide an offset, and then list the buttons to assign (IIRC).

I don't have my MiST nearby to test, but the internal mapping is:

Code: Select all

// fixed setup for nes gamepad
info->iface[0].conf.joystick_mouse.button[0].byte_offset = 5;
info->iface[0].conf.joystick_mouse.button[0].bitmask = 32;
info->iface[0].conf.joystick_mouse.button[1].byte_offset = 5;
info->iface[0].conf.joystick_mouse.button[1].bitmask = 64 | 16;  # this assigns two buttons to one
info->iface[0].conf.joystick_mouse.button[2].byte_offset = 6;
info->iface[0].conf.joystick_mouse.button[2].bitmask = 16;
info->iface[0].conf.joystick_mouse.button[3].byte_offset = 6;
info->iface[0].conf.joystick_mouse.button[3].bitmask = 32;


And to replicate without having two buttons, it would need something like:

Code: Select all

hid_button_remap=0079,0011,43,0  # i.e. 5(bytes)*8 + 3th bit (bitmask=32)
hid_button_remap=0079,0011,44,1  # i.e. 5(bytes)*8 + 4th bit (bitmask=64)
hid_button_remap=0079,0011,50,2  # i.e. 6(bytes)*8 + 2nd bit (bitmask=16)
hid_button_remap=0079,0011,51,3  # i.e. 6(bytes)*8 + 3rd bit (bitmask=32)


This should get rid of the two buttons mapped together. Of course commenting out the mapping and recompiling would also work.
I'm not sure I got it right though... the very reason I wrote joystick_remap is to not have to use this one :)

slingshot
Atari God
Atari God
Posts: 1058
Joined: Mon Aug 06, 2018 3:05 pm

Re: MiST - new joystick/gamepad mapping

Postby slingshot » Mon Dec 03, 2018 1:43 pm

Newsdee wrote:And to replicate without having two buttons, it would need something like:

Code: Select all

hid_button_remap=0079,0011,43,0  # i.e. 5(bytes)*8 + 3th bit (bitmask=32)
hid_button_remap=0079,0011,44,1  # i.e. 5(bytes)*8 + 4th bit (bitmask=64)
hid_button_remap=0079,0011,50,2  # i.e. 6(bytes)*8 + 2nd bit (bitmask=16)
hid_button_remap=0079,0011,51,3  # i.e. 6(bytes)*8 + 3rd bit (bitmask=32)


This should get rid of the two buttons mapped together. Of course commenting out the mapping and recompiling would also work.
I'm not sure I got it right though... the very reason I wrote joystick_remap is to not have to use this one :)


Ah, a secret setting :)
Well, I would vote for a remove this in the code, since it still can be applied via mist.ini settings. Maybe add these as an example for the default mist.ini, commented out by default. But if joystick_remap can do the job in any cases, this just creates confusion.

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

Re: MiST - new joystick/gamepad mapping

Postby Newsdee » Tue Dec 04, 2018 2:44 am

slingshot wrote:Ah, a secret setting :)
Well, I would vote for a remove this in the code, since it still can be applied via mist.ini settings. Maybe add these as an example for the default mist.ini, commented out by default. But if joystick_remap can do the job in any cases, this just creates confusion.


I agree, my build env is broken though. :(

joystick_remap won't necessarily work if the hardware is faulty. Need to try, if I can ever find again that faulty USB gamepad...

slingshot
Atari God
Atari God
Posts: 1058
Joined: Mon Aug 06, 2018 3:05 pm

Re: MiST - new joystick/gamepad mapping

Postby slingshot » Tue Dec 04, 2018 10:25 am

Newsdee wrote:
joystick_remap won't necessarily work if the hardware is faulty. Need to try, if I can ever find again that faulty USB gamepad...


I see. But then hid_button_remap can help in this case if I understand correctly.

Televicious
Atari freak
Atari freak
Posts: 67
Joined: Sun Sep 24, 2017 6:18 pm

Re: MiST - new joystick/gamepad mapping

Postby Televicious » Tue Dec 04, 2018 9:10 pm

slingshot wrote:
Newsdee wrote:
joystick_remap won't necessarily work if the hardware is faulty. Need to try, if I can ever find again that faulty USB gamepad...


I see. But then hid_button_remap can help in this case if I understand correctly.


Ahh that's how you use it. I tried HID remap with the joystick remap format before and it was just the same thing. I'll see how buggy these are without the special HID code fixes in the firmware first though.

desUBIKado
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 118
Joined: Sat Jan 06, 2018 11:49 pm

Re: MiST - new joystick/gamepad mapping

Postby desUBIKado » Wed Dec 26, 2018 8:57 pm

Newsdee wrote:When the gamepad is recognized as something (e.g. retrolink NES) it means that the VID/PID are being recognized from the list of known controllers by the firmware: https://github.com/mist-devel/mist-firm ... ymapping.c

VID is supposed to be a Vendor ID, and PID the Product ID, and in theory every controller is different. But it looks like the internals were reused in a bunch of places and we ended up with 3/4 controllers with the same VID/PID.

One solution would be to comment out / remove the mapping of the NES retrolink adapter; or to maybe try to find a configration that works for both controllers. In any case it needs a simple recompilation of the firmware. I no longer have my toolchain handy for it, but I can point out what to do if somebody gets it to compile.


When it was shown that there were several gamepad models of the type "Retrolink NES" (VID: 0079 PID: 0011), and that these Chinese clones did not work well, it was said to remove their firmware definition. Is this action going to be done? Thanks in advance.

User avatar
Higgy
Captain Atari
Captain Atari
Posts: 153
Joined: Tue Jan 24, 2017 1:38 pm

Re: MiST - new joystick/gamepad mapping

Postby Higgy » Wed Dec 26, 2018 10:33 pm

It would be great if controller support got some love.
It was fine to use 9 pin types for computers, but what with the great developments in consoles (and need for more than 2 fire buttons) it would be great to use USB controllers that can be setup for Windows and Raspberry Pi.

I've a load of controllers. 2 with the same ID (SNES/NES), Playsega Saturn style pad, Competition Pro (MiST pre-configures well), Datel Arcade Stick and Wired PS3 pad (Chinese clone). But none of these seem to be fully configurable with MiST.

On the Facebook group i was trying to get people to post their configs against pictures of their controller.

Thanks

slingshot
Atari God
Atari God
Posts: 1058
Joined: Mon Aug 06, 2018 3:05 pm

Re: MiST - new joystick/gamepad mapping

Postby slingshot » Wed Dec 26, 2018 11:10 pm

Higgy wrote:It would be great if controller support got some love.
It was fine to use 9 pin types for computers, but what with the great developments in consoles (and need for more than 2 fire buttons) it would be great to use USB controllers that can be setup for Windows and Raspberry Pi.

Thanks

I think without a developer with some exotic controllers, there will be no progress.

DanyPPC
Atari Super Hero
Atari Super Hero
Posts: 730
Joined: Tue Feb 21, 2017 7:02 am

Re: MiST - new joystick/gamepad mapping

Postby DanyPPC » Thu Dec 27, 2018 9:00 am

On my MiST I use USB Snes style pad, but I tested with success Logitech Precision pad and Dual Action One.
A Logitech F710 wireless is not recognized.

I think the best solution is to use only USB snes style gamepads. They are good for all cores, from C64 to Genesis.
Setup is simple and in case of a C64/Amiga/Atari ST you can remap the space bar or Up direction to a button of the pad, so many games are very playable.

For example, Atari ST doesn't have any 2 button controller, but games use a lot the space bar. You can remap this for use in games like Turrican, R-Type and others. It's like to use a real 2 button controller.

I'm very satisfied of my configuration, I have tryied many controllers in my life and I consider the snes style the best. And if you want to play 1 button games with C16/C64/Vic20 cores you can wire a standard DB9 joystick. I have so many of these, like Quickshot SV131, Competition Pro, Zipstick, TAC2, Suzo Arcade (the better in my opinion), slikstik, ecc...
:angel:

User avatar
Higgy
Captain Atari
Captain Atari
Posts: 153
Joined: Tue Jan 24, 2017 1:38 pm

Re: MiST - new joystick/gamepad mapping

Postby Higgy » Thu Dec 27, 2018 9:22 am

DanyPPC - can you post a link where to buy your pad please. Is it Chinese pad or Retrobit etc?

Also can you post you pad config from your MiST.ini please.

goran
Atari freak
Atari freak
Posts: 64
Joined: Sat Feb 27, 2016 4:17 pm

Re: MiST - new joystick/gamepad mapping

Postby goran » Thu Dec 27, 2018 10:05 am

I bought "2Pcs/Lot Game Controller for Super SNES USB Classic Gamepad" - https://www.dx.com/p/2pcs-lot-game-controller-for-super-snes-usb-classic-gamepad-2010903

D-pad is not so good, sometimes i press right and up get pressed also but they're okay for the money and other than that works good.

VID: 0810 PID:E501

mist.ini:
[mist]
scandoubler_disable=0
joystick_remap=0810,E501,1,2,4,8,100,10,20,200,400,800,0,0,40,80

[genesis]
joystick_remap=0810,E501,1,2,4,8,20,40,20,10,10,40,0,0,40,80

DanyPPC
Atari Super Hero
Atari Super Hero
Posts: 730
Joined: Tue Feb 21, 2017 7:02 am

Re: MiST - new joystick/gamepad mapping

Postby DanyPPC » Thu Dec 27, 2018 10:19 am

Higgy wrote:DanyPPC - can you post a link where to buy your pad please. Is it Chinese pad or Retrobit etc?

I buy them on ebay
Also can you post you pad config from your MiST.ini please.

Of course, my mist.ini. Note that I use an YPbPr cable configuration:
[mist]
keyrah_mode=0
scandoubler_disable=0
mouse_boot_mode=0
joystick_ignore_hat=0
joystick_ignore_osd=0
joystick_disable_shortcuts=0
joystick0_prefer_db9=0
key_menu_as_rgui=0
reset_combo=0
ypbpr=1
keep_video_mode=0
led_animation=0
joystick_remap=0810,E501,1,2,4,8,8,10,20,10,400,800,0,0,40,80
joy_key_map=400,2c
joy_key_map=800,2c

[c64]
joy_key_map=20,2c

[genesis]
joystick_remap=0810,E501,1,2,4,8,200,40,20,10,100,400,0,0,40,80

[tgfx16]
joystick_remap=0810,E501,1,2,4,8,400,100,10,20,200,800,0,0,40,80

[vic20]
scandoubler_disable=1

[spectrum]
scandoubler_disable=1

DanyPPC
Atari Super Hero
Atari Super Hero
Posts: 730
Joined: Tue Feb 21, 2017 7:02 am

Re: MiST - new joystick/gamepad mapping

Postby DanyPPC » Thu Dec 27, 2018 10:24 am

As you note I have remapped spacebar (2c) to the shoulder buttons on top of gamepad, useful on Amiga/AtariST.

On C64 mapped the spacebar (2c) on the second button as it is used a lot on various games.

The Up direction (8) is mapped on a button of gamepad, useful for platform and racing games.

Genesis and TGFX16 cores have a their own personal map.

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

Re: MiST - new joystick/gamepad mapping

Postby Newsdee » Thu Dec 27, 2018 10:28 am

Higgy wrote:DanyPPC - can you post a link where to buy your pad please. Is it Chinese pad or Retrobit etc?

Also can you post you pad config from your MiST.ini please.

As owner of several controllers, including those cheap Chinese ones, please do yourself a favor and get the Buffalo or the 8BitDo instead. Their quality is much better (and a little pricier but none excessive).

DanyPPC
Atari Super Hero
Atari Super Hero
Posts: 730
Joined: Tue Feb 21, 2017 7:02 am

Re: MiST - new joystick/gamepad mapping

Postby DanyPPC » Thu Dec 27, 2018 10:29 am

Also Innext ones are good !

User avatar
Higgy
Captain Atari
Captain Atari
Posts: 153
Joined: Tue Jan 24, 2017 1:38 pm

Re: MiST - new joystick/gamepad mapping

Postby Higgy » Thu Dec 27, 2018 12:44 pm

Ha! I completely missed that you could have individual settings with [Core Name] !!!

User avatar
retrofun
Atariator
Atariator
Posts: 20
Joined: Sat Jan 12, 2019 3:12 pm

Re: MiST - new joystick/gamepad mapping

Postby retrofun » Sat Jan 12, 2019 3:23 pm

I have two iNNEXT NES gamepad clones, model number Y-D002-024.

With MiST firmware below 190110 the default button mapping is weird,
e.g. some buttons are recognised as two buttons, Y maps to nothing -> dead button.

The following 4 hid_button_remap settings in mist.ini define the first 4 buttons with the correct bits from USB HID messages.
The joystick_remap setting then remaps all the buttons to the correct buttons.

Code: Select all

hid_button_remap=0079,0011,43,0 ; iNNEXT Y-D002-024 Retrolink NES
hid_button_remap=0079,0011,42,1 ; iNNEXT Y-D002-024 Retrolink NES
hid_button_remap=0079,0011,41,2 ; iNNEXT Y-D002-024 Retrolink NES
hid_button_remap=0079,0011,40,3 ; iNNEXT Y-D002-024 Retrolink NES
joystick_remap=0079,0011,1,2,4,8,100,10,20,200,400,800,0,0,40,80 ; iNNEXT Y-D002-024 Retrolink NES


With MiST firmware 190110 the four hid_button_remap settings aren't required any more.

HTH someone.

desUBIKado
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 118
Joined: Sat Jan 06, 2018 11:49 pm

Re: MiST - new joystick/gamepad mapping

Postby desUBIKado » Sun Jan 13, 2019 8:10 pm

Code: Select all

firmware_190110
===============
- Don't hardcode settings for Vid:0079, Pid:0011 controllers


This update fix my problems with my Hyperkin GN6 USB (Genesis style) gamepad VID:0079 PID:0011 "Retrolink NES"

Image

This is my setting for Hyperkin GN6 USB:

joystick_remap=0079,0011,1,2,4,8,10,20,800,100,200,400,0,0,40,80

Now I can play Lost Vikings on Genesis core with six buttons.

Thank you very much for this firmware update.

DanyPPC
Atari Super Hero
Atari Super Hero
Posts: 730
Joined: Tue Feb 21, 2017 7:02 am

Re: MiST - new joystick/gamepad mapping

Postby DanyPPC » Mon Jan 14, 2019 7:41 pm

Good !

User avatar
DrOG
Atari Super Hero
Atari Super Hero
Posts: 639
Joined: Sun Jul 31, 2016 8:23 pm
Location: Gyula, Hungary

Re: MiST - new joystick/gamepad mapping

Postby DrOG » Sat Jan 19, 2019 6:09 am

My 'The C64 Joystick' arrived just now:
https://retrogames.biz/thec64-joystick/
Tested it briefly, and seems to be 100% compatible with MiST! All four directions are OK, and the buttons are mapped correctly, the default order is A B Sel Sta X Y L R. Of course they can be remapped if necessary.
It's a good product for affordable price. Users who don't like gamepads like me will appreciate it. Pure retro feeling, and a nice option to attach more than 2 joys to your beloved FPGA.

DanyPPC
Atari Super Hero
Atari Super Hero
Posts: 730
Joined: Tue Feb 21, 2017 7:02 am

Re: MiST - new joystick/gamepad mapping

Postby DanyPPC » Sat Jan 19, 2019 9:08 am

Tested this joystick on C64mini but I think it's a poor one.

I bought the real Competition Pro USB 20 years edition on eBay. It has microswitch and 4 different buttons. I use it on PC, because MiST has just DB9 atari ports and I have a great collection of standard atari joystick to use.

User avatar
DrOG
Atari Super Hero
Atari Super Hero
Posts: 639
Joined: Sun Jul 31, 2016 8:23 pm
Location: Gyula, Hungary

Re: MiST - new joystick/gamepad mapping

Postby DrOG » Sat Jan 19, 2019 4:52 pm

It has definitely no microswitches, but seems to be robust enough not to break after a short period of using and has 8 buttons...

I'm looking for the Competition Pro Anniversary Edition you mentioned as well...

I've a lot of Atari standard joys also, but as the MiST has only two classical DB-9 ports, it's a nice option to have the opportunity to play i.e. Bomberman with 4 joysticks!

Another benefit of the USB interface is having more than 2 buttons as some cores need it (i.e. the Sega Genesis).

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

Re: MiST - new joystick/gamepad mapping

Postby Newsdee » Sun Jan 20, 2019 3:11 am

DrOG wrote:My 'The C64 Joystick' arrived just now:
https://retrogames.biz/thec64-joystick/
(...)
It's a good product for affordable price. Users who don't like gamepads like me will appreciate it. Pure retro feeling, and a nice option to attach more than 2 joys to your beloved FPGA.

Several people on the "The C64" FB group reported their shaft broke. Apparently it can be prevented if you drill a longer screw inside it to hold it in place.

Here is one video about it:
https://youtu.be/Zrv_Kc4SRxI

desUBIKado
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 118
Joined: Sat Jan 06, 2018 11:49 pm

Re: MiST - new joystick/gamepad mapping

Postby desUBIKado » Mon Jan 21, 2019 8:51 pm

Hi there.

The firmware on my MiST is 190110 version, and the content of mist.ini file is this:

Code: Select all

[mist]
scandoubler_disable=1          ; set to 1 to run supported cores in 15khz
mouse_boot_mode=0              ; set to 1 if a mouse does not work well
joystick_disable_shortcuts=0   ; set to 1 to remove joystick -> keyboard commands
joystick_ignore_hat=0          ; set to 1 if having issues on gamepads with 'POV hat'
joystick_ignore_osd=0          ; set to 1 to prevent gamepad from controlling OSD
key_menu_as_rgui=1             ; set to 1 to bind Menu USB key to RGUI (=Right Amiga in Minimig)

;VID,PID,RIGHT,LEFT,DOWN,UP,  A ,  B ,  SEL,  STA , X ,  Y ,  L ,  R ,   L2 ,  R2  ,   L3  ,   R3
;VID,PID, 1      2   4   8 , 10,  20,   40,   80 , 100, 200, 400, 800,  1000, 2000 , 4000  , 8000

joystick_remap=0079,0011,1,2,4,8,40,10,20,80,100,200,0,0,40,80 ; HYPERKIN Para usar 4 botones + SELECT + START 
joy_key_map=1000,E2
joy_key_map=2000,E6
joy_key_map=4,51
joy_key_map=8,52

[genesis]
joystick_remap=0079,0011,1,2,4,8,10,20,800,100,200,400,0,0,40,80  ; HYPERKIN Para usar 6 botones  + SELECT + START


This works fine: 6 buttons + SELECT + START on genesis core, and 4 buttons +SELECT + START for other cores.


The problem I have is my gamepad HYPERKIN (0079,0011) always works with [mist] section definition, and when I start genesis core my gamepad works with [mist] definition instead [genesis], when I add a second joystick definition like this to mist.ini file:

Code: Select all

[mist]
...
...
joystick_remap=0079,0011,1,2,4,8,40,10,20,80,100,200,0,0,40,80 ; HYPERKIN Para usar 4 botones + SELECT + START 
joystick_remap=0810,e501,1,2,4,8,40,20,10,80,400,800,0,0,40,80 ; Pongo botón "X" como "Select" y botón "Y" como "Start. Intercambio "A" y "B"
...
...
[genesis]
joystick_remap=0079,0011,1,2,4,8,10,20,800,100,200,400,0,0,40,80  ; HYPERKIN Para usar 6 botones  + SELECT + START


What am i doing wrong? Is there something bad?

goran
Atari freak
Atari freak
Posts: 64
Joined: Sat Feb 27, 2016 4:17 pm

Re: MiST - new joystick/gamepad mapping

Postby goran » Fri Feb 01, 2019 6:25 pm

I bought Playstation to USB adapter and it's working on MiST. I just have a problem with buttons mapping.

I have the following line in mist.ini:
joystick_remap=0810,0001,1,2,4,8,200,20,10,100,40,80,400,800,40,80

Last two butons (13 and 14) are select and start. They are detected on mist and on proper locations. However, despite the mapping, when I press them they are empty, as in no function. I tried also to map next two buttons (15 and 16, hats) also to 40 and 80, but they are also detected as empty. I had to remap L2 and R2 (9 and 10) as select and start so I can use the controller.

Latest firmware.

What am I doing wrong? :)

BTW Playstation controllers are good and I had couple lying around, so I decided to replace my crappy nes-like controllers. It was only 2.5Eur. If anybody else is interested:
https://www.ebay.ie/itm/Playstation-2-G ... 3298307442


Return to “MiST”

Who is online

Users browsing this forum: No registered users and 5 guests