Joystick testing thread

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

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

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

Joystick testing thread

Post by Newsdee »

I've made some minor tweaks to the firmware to improve joystick support on MiSTer. Notably it now supports the 8BitDo retro receivers (NES and SNES) and Retrode (for native SNES / Genesis gamepads - although loading carts doesn't work).

What I've found is some devices might not work well but can be fixed with a small tweak in the firmware. So if you can test your gamepads/joysticks lying around and post results we can improve compatibility.

I've tested these successfully:

Adapters
These allow connecting original controllers
  • 2600-Daptor II
  • AliExpress USB OTG two-player controller adapter (there are 3 types, Genesis, NES, and SNES)
  • Colecovisio-Daptor (only tested joystick handling, not the number pad)
  • Hyperkin PS1/PS2 adapter
  • MayFlash Gamecube USB adapter
  • MayFlash Universal USB adapter for PS1/PS2/PS3/Xbox
  • Neogeo-Daptor
  • Retrode (only SNES/Genesis adapter part works, not carts)
  • Retro Freak controller adapter (this is a nice one because it supports NES,SNES, Genesis, and PC Engine)
Wireless Dongles
These usually support a variety of wirless gamepads
  • 8BitDo NES Retro Receiver
  • 8BitDo SNES Retro Receiver
Gamepads
Wired, or wireless with dedicated dongle
  • 8BitDo SFC30 gamepad
  • Retro Freak controler
  • iBuffalo SNES
  • iBuffalo Famicom (BGCFC801)
  • Logitech F710
  • Retrolink NES2 (dogbone)
Arcade Sticks
Burn to Fight(tm)
  • Hori RAP Pro VLX Hayabusa
  • Mayflash F300 Arcade Fighting Stick for Xbox360 / PS3 / PC
PCBs / Encoders
For DYI people
  • AliExpress USB encoder board
Last edited by Newsdee on Mon Feb 26, 2018 1:19 am, edited 12 times in total.
User avatar
Newsdee
Atari God
Atari God
Posts: 1574
Joined: Fri Sep 19, 2014 8:40 am

Re: Joystick testing thread

Post by Newsdee »

If your joystick doesn't work or is missing directions (e.g. up works but not left):
1) Connect MiSTer to the UART serial console (e.g. via Putty): https://github.com/MiSTer-devel/Main_Mi ... connection
2) Open the menu core
3) When any USB device is connected and you move directions, you should see messages like these:

Code: Select all

Input event: type=EV_ABS, Axis=1, Offset:=255
Input event: type=EV_ABS, Axis=1, Offset:=127
Input event: type=EV_ABS, Axis=1, Offset:=0
Input event: type=EV_ABS, Axis=1, Offset:=127
4) Post here the messages (just need 3 values per axis) together with the VID/PID of your device (from Joystick ID panel in define buttons, looks like "034D:03EA") .

With this information it should be possible to get more devices working.
NegSol
Captain Atari
Captain Atari
Posts: 404
Joined: Sat Dec 05, 2015 9:22 pm

Re: Joystick testing thread

Post by NegSol »

Arcade Fighting Stick:
Mayflash Arcade Fighting Stick for Xbox360 / PS3 / PC - works!
NML32
Atari Super Hero
Atari Super Hero
Posts: 692
Joined: Tue Mar 11, 2014 1:54 am
Location: USA/Florida

Re: Joystick testing thread

Post by NML32 »

@Newsdee, thanks for updating the firmware to detect more joysticks/adapters. :cheers:

Note, about the Colecovision-daptor AKA Vision-daptor:
Most of the buttons weren't detected until I updated the Vision-daptor Firmware to the latest.

Testing Colecovision Joystick button Mappings:
https://youtu.be/C-3Z0c6i5Uo

Options for Mapping the Joystick in the Colecovision core:
Up
Down
Left
Right
Fire1
Fire2
*
#
0
1
2
3
Purple Tr
Blue Tr
Button OSD

Buttons 4,5,6,7,8,9 aren't mapped, at least for me, they aren't. Hopefully, the core is updated to accept the missing keypad buttons. Not a big deal as they can be selected from the keyboard.

Once again thanks for updating the MiSTer firmware. Maybe a note can be made to make sure the Daptors are running the latest firmware to avoid mapping issues.

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

Re: Joystick testing thread

Post by Sorgelig »

Only up to 12 keys (16 if count the directions) can be mapped.
I didn't expect some systems had joysticks with so many keys.

I think only few games requires the whole pad. And those games can be played on keyboard.
So, it's not relative to joystick detection. It's more a design limitation.
User avatar
Newsdee
Atari God
Atari God
Posts: 1574
Joined: Fri Sep 19, 2014 8:40 am

Re: Joystick testing thread

Post by Newsdee »

As it turns out, I have the Colecovision-Dapter but no actual controllers so I could only test it with a Genesis gamepad. :lol:

There are all kinds of USB devices out there so it will take a while to get them all wired nicely. I agree with Sorgelig that we don't necessarily need to extend the firmware, though. 12 buttons max is pretty standard in USB encoder boards, and it's enough for a PSX style controller: 4 front buttons, start/select, L1, L2, R1, R2, and left and right click on the analog sticks [L3,R3]. :D
Slade
Atari freak
Atari freak
Posts: 60
Joined: Tue Dec 27, 2016 11:02 pm

Re: Joystick testing thread

Post by Slade »

Have you tested that first controller adaptor with a standard atari / C64 joystick ?

I built my own joystick for the MiST which works beautifully, and would like to use it as well on the MiSTer if possible. It's just that much smaller than the large USB joystick I have and easier to use.
User avatar
Newsdee
Atari God
Atari God
Posts: 1574
Joined: Fri Sep 19, 2014 8:40 am

Re: Joystick testing thread

Post by Newsdee »

Yes, it works fine with an Atari (one button) joystick. I have a small stick wired to Amiga 2 button format and it works fine with button 1 (as expected with a Genesis-compatible port).
Slade
Atari freak
Atari freak
Posts: 60
Joined: Tue Dec 27, 2016 11:02 pm

Re: Joystick testing thread

Post by Slade »

Newsdee wrote:Yes, it works fine with an Atari (one button) joystick. I have a small stick wired to Amiga 2 button format and it works fine with button 1 (as expected with a Genesis-compatible port).
Thanks, I might have to pick one up. Even if only to use it on my Windows box. Although with 2 buttons, it limits MAME a fair bit.
JimDrew
Atari Super Hero
Atari Super Hero
Posts: 865
Joined: Mon Nov 04, 2013 5:23 pm

Re: Joystick testing thread

Post by JimDrew »

These controllers work great EXCEPT you can not map the UP position on the left joypad. These work fine with Rpi3.

https://www.amazon.com/gp/product/B071H ... UTF8&psc=1
I am the flux ninja
Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 6348
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Joystick testing thread

Post by Sorgelig »

JimDrew wrote:These controllers work great EXCEPT you can not map the UP position on the left joypad. These work fine with Rpi3.

https://www.amazon.com/gp/product/B071H ... UTF8&psc=1
well.. How to make it work without having it?
Give it to me, and i will add support :)
Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 6348
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Joystick testing thread

Post by Sorgelig »

Actually, for this price you can buy PS3-like chinese pad with dual analogue sticks.
20171126_103312.jpg
costs less than $10 IIRC.
You do not have the required permissions to view the files attached to this post.
User avatar
Newsdee
Atari God
Atari God
Posts: 1574
Joined: Fri Sep 19, 2014 8:40 am

Re: Joystick testing thread

Post by Newsdee »

JimDrew wrote:These controllers work great EXCEPT you can not map the UP position on the left joypad. These work fine with Rpi3.
https://www.amazon.com/gp/product/B071H ... UTF8&psc=1
Try the instructions on my second post above, the logs might have some clue as to what is missing.
(Edit: it's likely that the dpad is reporting values that are off center so not recognized; we can tweak the firmware slightly to adapt)
JimDrew
Atari Super Hero
Atari Super Hero
Posts: 865
Joined: Mon Nov 04, 2013 5:23 pm

Re: Joystick testing thread

Post by JimDrew »

I will do that. One thing I did notice in Pooyan is that the dpad has to be "released" (thumb lifted with a delay) before pressing another direction. Typically on a dpad you just slide your thumb left and right (and up and down) arround, tilting the plastic plate - as opposed to lifting and pressing each direction individually.
I am the flux ninja
User avatar
Newsdee
Atari God
Atari God
Posts: 1574
Joined: Fri Sep 19, 2014 8:40 am

Re: Joystick testing thread

Post by Newsdee »

That looks like a quirk of that specific pad...
JimDrew
Atari Super Hero
Atari Super Hero
Posts: 865
Joined: Mon Nov 04, 2013 5:23 pm

Re: Joystick testing thread

Post by JimDrew »

OK, did testing on that INEXT Pad. Here are the results:

PRESSING LEFT = EV_ABS, Axis=0, Offset:=0
RELEASING LEFT= EV_ABS, Axis=0, Offset:=127
PRESSING RIGHT = EV_ABS, Axis=0, Offset:=255
RELEASING RIGHT = EV_ABS, Axis=0, Offset:=127
PRESSING DOWN = EV_ABS, Axis=1, Offset:=255
RELEASING DOWN = EV_ABS, Axis=1, Offset:=127
PRESSING UP = EV_ABS, Axis=1, Offset:=0
RELEASING UP = EV_ABS, Axis=1, Offset:=127

What I did notice is that releasing the dpad generates either Axis=0 or Axis=1 and offset=127, depending on what the last position was.
I am the flux ninja
User avatar
Newsdee
Atari God
Atari God
Posts: 1574
Joined: Fri Sep 19, 2014 8:40 am

Re: Joystick testing thread

Post by Newsdee »

JimDrew wrote:OK, did testing on that INEXT Pad. Here are the results:
The DPAD is mapped to two analog axis, with Axis 0 being left/right and Axis 1 being up/down. 127 is the middle point going from 0 to 255. All this looks bog standard so I'm surprised that your gamepad doesn't work.

From your earlier description it would look like 127 is never hit (say it goes from 0 to 255). Can you try if that is the case?
JimDrew
Atari Super Hero
Atari Super Hero
Posts: 865
Joined: Mon Nov 04, 2013 5:23 pm

Re: Joystick testing thread

Post by JimDrew »

I *always* get 127 when the DPAD is released after pressing it any direction. However, the axis will be either 0 or 1 along with 127, depending on what last axis was. It can go from 255 to 0 without the middle (127) appearing. However, none of the cores recognize 127 to 0 (for up), but always recognize 127 to 255 (for down). Everything works perfectly except for up.. and the fact that you can't just go from left to right without first releasing the DPAD.
I am the flux ninja
Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 6348
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Joystick testing thread

Post by Sorgelig »

I guess where is the problem.
I will check it.
Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 6348
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Joystick testing thread

Post by Sorgelig »

Hmm. nope.. i didn't find anything wrong in my code. I've simulated direct left/light and up/down transitions without middle value and it still works.
Some cores/games cannot recognize diagonal directions. For example i've tried the Pacman arcade - it doesn't move up or down until left and right released. This is pure game behavior. Probably original joystick of this arcade had special guiders preventing horizontal and vertical direction button presses at the same time.

I have idea to add menu option preventing simultaneous button presses to improve game experience.

But it doesn't answer the question why your "UP" button doesn't work. Try other kind of joystick to see if it's joystick behavior or your way to use the joystick.
User avatar
Newsdee
Atari God
Atari God
Posts: 1574
Joined: Fri Sep 19, 2014 8:40 am

Re: Joystick testing thread

Post by Newsdee »

Many older arcade games used a 4-way or 2-way joystick. Most arcade sticks can be fitted with a "restrictor gate" for this purpose, so that you can't physically hit diagonals. Of course for normal controllers this hardware trick won't work.
Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 6348
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Joystick testing thread

Post by Sorgelig »

I've posted couple arcades with my experimental joystick tweak:
http://www.atari-forum.com/viewtopic.ph ... 00#p333400
JimDrew
Atari Super Hero
Atari Super Hero
Posts: 865
Joined: Mon Nov 04, 2013 5:23 pm

Re: Joystick testing thread

Post by JimDrew »

OK, I have found the issue with the INEXT controller not working... it's the Pacman core!

I didn't realize that the main menu had an option to setup the joystick. THAT setup works pefectly... every position and every button is seen. If I go run the Pacman core after setting up the joystick in the menu, the core crashes (no response from F12). If I unplug the power (reboot the DE-10) and then run the Pacman core it works fine, but when I go into the joystick setup within Pacman, it doesn't see the UP position (but will see any other button in place of UP).

I will try some other cores to see if this is a common theme. At least the menu's joystick setup works perfectly.
I am the flux ninja
JimDrew
Atari Super Hero
Atari Super Hero
Posts: 865
Joined: Mon Nov 04, 2013 5:23 pm

Re: Joystick testing thread

Post by JimDrew »

After further review, EVERY arcade core has this same problem. The menu sees the INEXT controller and config works fine (UP button is detected, and it moves up the list when selecting a core, so it really does work). However, the UP button is not recognized in any of the arcade cores. If you do the joystick setup in any arcade core (Scramble, Pacman, Galaxian, etc. etc.) the UP button is not detected.
I am the flux ninja
Locked

Return to “MiSTer”