MiST - new joystick/gamepad mapping

Area for discussing ST(E) clones

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

User avatar
Newsdee
Atari Super Hero
Atari Super Hero
Posts: 866
Joined: Fri Sep 19, 2014 8:40 am

MiST - new joystick/gamepad mapping

Postby Newsdee » Mon Jun 22, 2015 2:16 am

I've extended the firmware to make the MiST recognize more USB buttons, and have the ability to remap them as you want via mist.ini.

It's very flexible and allows (for example) to map "Up" to any extra button, or to redefine where 'Start' and 'Select' are located on the controller.
Please see here for a detailed explanation on how to use it: http://code.google.com/p/mist-board/wik ... ickMapping

Thanks goes to Till for code examples and guidance (both of mapping USB and of parsing the ini file)

User avatar
MasterOfGizmo
Atari God
Atari God
Posts: 1026
Joined: Fri Feb 08, 2013 12:15 pm
Contact:

Postby MasterOfGizmo » Mon Jun 22, 2015 11:04 am

Sounds like an excellent idea.

User avatar
Newsdee
Atari Super Hero
Atari Super Hero
Posts: 866
Joined: Fri Sep 19, 2014 8:40 am

Re: MiST - new joystick/gamepad mapping

Postby Newsdee » Mon Jun 22, 2015 1:53 pm

Following a very good suggestion from chaos, I've also added mouse emulation (keep select pushed + directions / L / R ) and a couple of new keyboard commands, ESC (START + L) and F1 (START + R). Not designed to fully replace a mouse (it isn't "sticky") but should be good enough to get past menues, intros, etc. to get to games.

chaos
Atari User
Atari User
Posts: 42
Joined: Thu Dec 18, 2014 10:09 am
Contact:

Re: MiST - new joystick/gamepad mapping

Postby chaos » Wed Jun 24, 2015 11:35 am

Excellent! This is certainly a nice addition, thanks!

Finally, I'll be able to have a lazy afternoon in front of the TV with the MiST board and a wireless gamepad, without getting up ;)
** my minimig builds: http://somuch.guru/ **

javidoom
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 117
Joined: Thu Dec 15, 2011 3:16 pm

Re: Re: MiST - new joystick/gamepad mapping

Postby javidoom » Fri Jun 26, 2015 3:36 pm

Newsdee wrote:I've extended the firmware to make the MiST recognize more USB buttons, and have the ability to remap them as you want via mist.ini.

It's very flexible and allows (for example) to map "Up" to any extra button, or to redefine where 'Start' and 'Select' are located on the controller.
Please see here for a detailed explanation on how to use it: http://code.google.com/p/mist-board/wik ... ickMapping

Thanks goes to Till for code examples and guidance (both of mapping USB and of parsing the ini file)


Cool!

I've been short on time... But as soon as I can, I'll give it a good test :)

Thanks! It's a very cool feature!

User avatar
farvardin
Captain Atari
Captain Atari
Posts: 274
Joined: Fri Jan 01, 2010 5:50 pm
Location: France
Contact:

Re: MiST - new joystick/gamepad mapping

Postby farvardin » Fri Jun 26, 2015 7:51 pm

it works well, I prefer it this way, thank you.

I noticed since the latest firmware revision, now I can no longer use the keyboard arrows for navigating into the MiST menu for the Atari ST core, only the joypad is working. For other cores, the arrows seems to work like before.

User avatar
Newsdee
Atari Super Hero
Atari Super Hero
Posts: 866
Joined: Fri Sep 19, 2014 8:40 am

Re: MiST - new joystick/gamepad mapping

Postby Newsdee » Sat Jun 27, 2015 3:29 am

That's odd, I just tried and it works fine on mine. If you want I can add an config option to prevent using the gamepad to control the OSD?
Which core are you booting with, and do you have the latest versions? (I have the ST one as core.rbf)

mahen
Captain Atari
Captain Atari
Posts: 189
Joined: Mon Aug 26, 2013 3:11 pm
Location: France

Re: MiST - new joystick/gamepad mapping

Postby mahen » Sat Jun 27, 2015 10:32 am

Out of curiosity... Would it be possible to map some keyboard keys to gamepad buttons ? Could be useful for pinball games, or games that require to use "space", "enter" etc. to trigger important actions.

I'm well aware that would significantly raise the complexity :)
Amiga user since 1993 ;-)

User avatar
MasterOfGizmo
Atari God
Atari God
Posts: 1026
Joined: Fri Feb 08, 2013 12:15 pm
Contact:

Postby MasterOfGizmo » Sat Jun 27, 2015 10:41 am

That's exactly what i also just thought. Playing slamtilt with the shoulder buttons of my snes gamepad would be nice.

It's probably not difficult to implement that. But any such mapping would be global (for all games and even for all cores).

User avatar
Newsdee
Atari Super Hero
Atari Super Hero
Posts: 866
Joined: Fri Sep 19, 2014 8:40 am

Re: MiST - new joystick/gamepad mapping

Postby Newsdee » Sat Jun 27, 2015 11:00 am

mahen wrote:Would it be possible to map some keyboard keys to gamepad buttons ?

I've already done it :) it's not configurable right now, but should already be good to get through most menus/intros.
Have a look at this page: https://code.google.com/p/mist-board/wi ... kShortcuts

Which keys are used in SlamTilt? Left/Right shift?

User avatar
farvardin
Captain Atari
Captain Atari
Posts: 274
Joined: Fri Jan 01, 2010 5:50 pm
Location: France
Contact:

Re: MiST - new joystick/gamepad mapping

Postby farvardin » Sun Jun 28, 2015 6:46 am

Newsdee wrote:That's odd, I just tried and it works fine on mine. /.../
Which core are you booting with, and do you have the latest versions? (I have the ST one as core.rbf)


I'm booting with the ST core (renamed to core.rbf), the latest one called core_150503_r1045.rbf

I've made further investigations: if I unplug the gamepad, the keyboard control of the OSD is working again. If I plug the gamepad again, the keyboard is stuck. This behavior is for the first boot. If I load another core, then the ST core again, the keyboard is working BUT not so good: I can control the OSD, if will work for a few key stroke, then one or two strokes won't work, then it will work again. If I unplug the gamepad, it's working as expected.

The behavior is only for the ST core, for other cores (Amstrad, Amiga, C64, both keyboard and gamepad are working as expected.

Newsdee wrote:If you want I can add an config option to prevent using the gamepad to control the OSD?


ok, why not, if it's not bothering you and if it's not a too huge work. The gamepad OSD control is a nice addition, but the keyboard control is "more important" I think.

I'll also make more tests, for example with another usb cable. Mine has a kind of filter on it. Maybe it's a combination of several factors, and just the gamepad itself (battlefield ps3 controller, I'm not a fan of battlefield but it was super cheap (15 €) when I bought it on amazon).

Otherwise it's working fine.

SlamTilt? Left/Right shift?


I think so, if not it might be left/right control, but I think it's shift if I remember well.

now I'm thinking about it, there is also something else on the atari core, it seems the mouse click is too fast, for example in the MusicMon tracker, when I click on play or on mute channel, one time it will click correctly, the other time it will click twiceg halting the operation.

User avatar
Newsdee
Atari Super Hero
Atari Super Hero
Posts: 866
Joined: Fri Sep 19, 2014 8:40 am

Re: MiST - new joystick/gamepad mapping

Postby Newsdee » Mon Jun 29, 2015 3:24 am

I've added a feature to map any keyboard key to "virtual joypad" buttons/directions. I didn't manage to get Alt keys recognized (maybe modifier keys work differently than the rest) but you can at least reconfigure SlamTilt to use e.g. "A" and "B" for flippers and it works.

After upgrading to the latest firmware you can add this to the .ini file:

Code: Select all

joystick_ignore_osd=0          ; set to 1 to prevent gamepad from controlling OSD
joystick_remap=0583,2060,1,2,4,8,10,20,20,8,1400,2800,40,80
joy_key_map=1000,4
joy_key_map=2000,5
joy_key_map=4,51
joy_key_map=8,52


The first line is to prevent the joystick from controlling the OSD.
Second line is joypad config for my iBuffalo SNES pad, I've mapped the physical L button of the pad to the "virtual L" and "virtual L2" buttons of the MiST, and same for the physical R button.

Then the next part is where I map the virtual buttons to keyboard keys. Here I map L2 to "key A", R2 to "key B", and up/down of the pad to the up and down arrow keys.
The numbers for keys are the HID USB scancodes which you can find e.g. here (note: MiST expects hex values so you need to convert them): http://www.freebsddiary.org/APC/usb_hid_usages.php

Again, I couldn't get shift, alt, or ctrl to work with this method; I think I need to do something different with the AGA core but haven't worked it out yet. But at least it should be very playable as it is :)

User avatar
MasterOfGizmo
Atari God
Atari God
Posts: 1026
Joined: Fri Feb 08, 2013 12:15 pm
Contact:

Re: MiST - new joystick/gamepad mapping

Postby MasterOfGizmo » Mon Jun 29, 2015 2:14 pm

Newsdee wrote:I didn't manage to get Alt keys recognized (maybe modifier keys work differently than the rest)


Yes, they do. The eight modifiers in a USB hid report are just a single byte containing one bit per key. These eight keys can always be reported regardless of the state of the other keys. The modifier bits are:

Code: Select all

    0     1      2    3    4     5      6    7
   LCTRL LSHIFT LALT LGUI RCTRL RSHIFT RALT RGUI


To e.g. claim the the left shift key is being pressed you'd send 0x02 as the modifier byte.
MIST board, FPGA based Atari STE and more: https://github.com/mist-devel/mist-board/wiki

User avatar
Newsdee
Atari Super Hero
Atari Super Hero
Posts: 866
Joined: Fri Sep 19, 2014 8:40 am

Re: MiST - new joystick/gamepad mapping

Postby Newsdee » Mon Jun 29, 2015 4:36 pm

Thanks! I've updated with this info and I can now map to Alt. :D

Released a new version of the firmware as a result;
set this in the .ini to activate the mapping to left/right Alt:

Code: Select all

joy_key_map=1000,E2
joy_key_map=2000,E6

User avatar
Newsdee
Atari Super Hero
Atari Super Hero
Posts: 866
Joined: Fri Sep 19, 2014 8:40 am

Re: MiST - new joystick/gamepad mapping

Postby Newsdee » Sun May 22, 2016 6:11 am

I've done a revamp of this functionality:
  • Fixed bug whereby OSD wasn't controllable by keyboard if a USB gamepad was connected
  • Fixed bug with sticky keys when using joystick keyboard mappings
  • Increased the number of accepted keyboard mappings from MIST.INI to 8
  • Added default USB mapping for the NEOGEO-dapter.
  • Code refactoring and cleanup; the handlers for this now live in their own file (joymapping.c/.h).

mahen
Captain Atari
Captain Atari
Posts: 189
Joined: Mon Aug 26, 2013 3:11 pm
Location: France

Re: MiST - new joystick/gamepad mapping

Postby mahen » Sun May 22, 2016 8:09 am

Thanks a lot, your work is much appreciated !
Amiga user since 1993 ;-)

lips2k15
Atari freak
Atari freak
Posts: 58
Joined: Tue Mar 29, 2016 10:19 am

Re: MiST - new joystick/gamepad mapping

Postby lips2k15 » Sun May 22, 2016 10:37 am

Hi there, this is awesome but is there any chance you could add support for the 8bitdo gamepad - its bluetooth but can be used as a usb device when connectected via a usb cable.

mahen
Captain Atari
Captain Atari
Posts: 189
Joined: Mon Aug 26, 2013 3:11 pm
Location: France

Re: MiST - new joystick/gamepad mapping

Postby mahen » Sun May 22, 2016 10:53 am

Hi ! The 8bitdo gamepads should work in wired mode. There was a problem before (had to before disconnected / reconnected in order to work) but this problem was apparently due to the gamepad firmware, which can be upgraded. Try to upgrade your gamepad firmware and hopefully it'll work (in wired mode) out of the box.
Amiga user since 1993 ;-)

User avatar
Newsdee
Atari Super Hero
Atari Super Hero
Posts: 866
Joined: Fri Sep 19, 2014 8:40 am

Re: MiST - new joystick/gamepad mapping

Postby Newsdee » Sun May 22, 2016 12:44 pm

I have the SFC30 but I can't get it to work on Win10... it must be that wired mode bug. Has anybody successfully upgraded the firmware for it under Win10?

lips2k15
Atari freak
Atari freak
Posts: 58
Joined: Tue Mar 29, 2016 10:19 am

Re: MiST - new joystick/gamepad mapping

Postby lips2k15 » Sun May 22, 2016 6:53 pm

I have just updated my 8bitdo firware using windows 7 and now it works fine with the MIST - awesome!!!

NML32
Captain Atari
Captain Atari
Posts: 224
Joined: Tue Mar 11, 2014 1:54 am

Re: MiST - new joystick/gamepad mapping

Postby NML32 » Sun May 22, 2016 11:52 pm


User avatar
Newsdee
Atari Super Hero
Atari Super Hero
Posts: 866
Joined: Fri Sep 19, 2014 8:40 am

Re: MiST - new joystick/gamepad mapping

Postby Newsdee » Fri Jun 17, 2016 1:35 am

NML32 wrote:will this one work with the Mist?
http://www.amazon.com/Wireless-Bluetoot ... rds=8bitdo


It should if it supports direct wired connection via USB. I've got my SFC30 working after realizing the cable was bad.

mahen
Captain Atari
Captain Atari
Posts: 189
Joined: Mon Aug 26, 2013 3:11 pm
Location: France

Re: MiST - new joystick/gamepad mapping

Postby mahen » Sun Jun 19, 2016 11:01 am

Hi ! Would the MiST work with this arcade -> USB encoder ? http://www.smallcab.net/encoder-usb-arc ... p-224.html

The issue is that it supports 2 players and is theorically detected as 2 gamepads on the computer (?) while there is only 1 usb plug ? What do you think ?
Amiga user since 1993 ;-)

mahen
Captain Atari
Captain Atari
Posts: 189
Joined: Mon Aug 26, 2013 3:11 pm
Location: France

Re: MiST - new joystick/gamepad mapping

Postby mahen » Sun Jun 19, 2016 11:06 am

OK, my question is moot as there is a 1 player version anyway :)

Edit : this adpater perfectly works on the MiST.
Last edited by mahen on Mon Jun 27, 2016 10:53 am, edited 1 time in total.
Amiga user since 1993 ;-)

User avatar
farvardin
Captain Atari
Captain Atari
Posts: 274
Joined: Fri Jan 01, 2010 5:50 pm
Location: France
Contact:

Re: MiST - new joystick/gamepad mapping

Postby farvardin » Sun Jun 19, 2016 12:14 pm

I've seen the FC30 pro 8bitdo, which is recognised as xbox controller, can be flashed to be considered as ps3 instead. With this new firmware, it's working well on MiST.


Social Media

     

Return to “ST(E) Clones (Suska / MiST)”

Who is online

Users browsing this forum: No registered users and 4 guests