Joystick testing thread

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

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

Locked
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 would dig into internals to see if possible to get a raw signals from inside. It's definitely possible for buttons, analog sticks. Paddles should be just potentiometers, spinners also should be possible to connect directly.
werpu
Atariator
Atariator
Posts: 23
Joined: Fri Jan 03, 2020 4:31 pm

Re: Joystick testing thread

Post by werpu »

Sorgelig wrote:I would dig into internals to see if possible to get a raw signals from inside. It's definitely possible for buttons, analog sticks. Paddles should be just potentiometers, spinners also should be possible to connect directly.
Yes it definitely is possible since the mapping from the rotaries to the paddle usb mouse signals is done over an attached microcrontroller which easly can be unplugged. That however would mean to add another bunch of self programmed microcontrollers instead not a route i want to go unless I have to, but that would be another option.

Different idea. I assume MiSTer expects the usb paddle signals to be ABSX and ABSY, (given you can emulate them with an analog stick)

So how about this, taking the rel signals from the simulated mouse signals and converting them to absolute coordinates
aka (starting point zero and then calculating the absolute position from the mouse rel signal coming in from the paddle controller) into absolute x and y coordinates and pushing those signals as simulated analog stick signals in.
That would be the fastest option for me because the rel to absolute transformation could easily be done by my input multiplexer. Not sure however if this method does not bite itself with some existing console cores, which can handle mouse -> paddle simulation quite fine. I simply have to try this out.
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 »

werpu wrote:That however would mean to add another bunch of self programmed microcontrollers
Nope. Teensy can handle it alone. Spinners are simply 2 phase signals, it's already handled in my Arduino mr.Spinner project.
But it's up to you.
werpu wrote:I assume MiSTer expects the usb paddle signals to be ABSX and ABSY
To be a more precise MiSTer needs EV_ABS from Axis 8 (Wheel, USB USAGE PAGE 38) for paddle, and EV_REL from Axis 7 (Dial, USB USAGE PAGE 7) for spinner.
werpu
Atariator
Atariator
Posts: 23
Joined: Fri Jan 03, 2020 4:31 pm

Re: Joystick testing thread

Post by werpu »

Sorgelig wrote:
werpu wrote:That however would mean to add another bunch of self programmed microcontrollers
Nope. Teensy can handle it alone. Spinners are simply 2 phase signals, it's already handled in my Arduino mr.Spinner project.
But it's up to you.
werpu wrote:I assume MiSTer expects the usb paddle signals to be ABSX and ABSY
To be a more precise MiSTer needs EV_ABS from Axis 8 (Wheel, USB USAGE PAGE 38) for paddle, and EV_REL from Axis 7 (Dial, USB USAGE PAGE 7) for spinner.


Thanks for the clarification, I will revamp my mapping accordinghly.
So just to be sure EV_ABS axis 8 is spinner 1, ev_rel Axis 7 is spinner 2?

(Not really eager to dabble on the hardware side again, especially since my arcade controller also serves a second already set up and debugged machine - I am not a hardware guy and only have basic electronics knowledge.
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 didn't say spinner 1 and spinner 2.
I've said paddle and spinner.
Don't you know the difference between spinner and paddle?
jim150
Atariator
Atariator
Posts: 20
Joined: Sun Sep 30, 2018 5:20 am
Location: Catalonia

Re: Joystick testing thread

Post by jim150 »

Sorgelig wrote:For arcades with many buttons currently there is only single device per arduino:
https://github.com/MickGyver/DaemonBite-Arcade-Encoder
So you need 2 arduino micro boards for 2 joysticks.

Technically it's possible to implement 2 arcade joysticks in single arduino board as it's already done for paddles and spinners adapters. Since arduino micro has limited amount of pins, it will require 2 common pins for each joystick. So it's definitely doable. I'm thinking to make such adapter, but i'm not the fan of arcade cabinets so i have no such arcade controllers to wire.. May be some time in the future, or may be witchmaster will make such adapter.
Thank you Sorgelig for pointing that out. I’m waiting for my Arduino boards to arrive to build them. In the meantime I’ve built your Sega to USB adapter and it works great in MiSTer with 3 and 6 button pad. Thanks again for that!
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 »

Sega adapter is witchmaster's work :)

There is some catch in using USB adapter for non-simple retro gamepads. Some gamepads like sega, use timeouts for correct work. You cannot query it more often than for example 1 frame rate. Otherwise it won't provide all keys. It needs timeout for internal reset. It's because 6-button mode was made after release of Genesis. Thus 6-button mode should be backward compatible with 3-button mode.
So using USB adapter for such gamepads introduces an input lag of 1 frame at least. If you aren't sensitive to this lag, then it's fine. Otherwise you have to use other gamepad without requirements of timeout. For example NES/SNES/PS1/PS2/Atari - these controllers don't require timeouts. Probably some other controllers too - i just don't remember.
werpu
Atariator
Atariator
Posts: 23
Joined: Fri Jan 03, 2020 4:31 pm

Re: Joystick testing thread

Post by werpu »

Sorgelig wrote:I didn't say spinner 1 and spinner 2.
I've said paddle and spinner.
Don't you know the difference between spinner and paddle?
Uups my fault, yes I was not indeed aware that the arcade cores were seeing both device types differently.
I was aware of the electrical differences, but I thought both were simply two sides of a coin (one potentiometer
one movement signals) both in the end interpreted the same.
Thanks for pointing that out.

So my fault, I assume the cores expect either one or the other. Pong for instance a paddle because the original used a paddle,
while other games expect spinners.
Either way noob mistakes :-)
Thanks for all the work you are doing btw.
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 »

Each player supports 1 paddle and 1 spinner. So axes i've wrote is per player. Same for all players.
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 »

werpu wrote:I assume the cores expect either one or the other. Pong for instance a paddle because the original used a paddle,
while other games expect spinners.
This is why mr.Spinner adapter is convenient. You use only spinner which provides both spinner and paddle through mr.Spinner adapter, so you don't really have to care if core needs spinner or paddle.
Jeebs
Retro freak
Retro freak
Posts: 16
Joined: Sun Nov 04, 2018 1:59 pm

Re: Joystick testing thread

Post by Jeebs »

I apologize of this has been talked about already but I'm curious if the Mayflash SNES to USB Adapter works for anyone else.

I have the two player adapter and I can get Player 1 to work perfectly. But it doesn't defect the second port on the adapter as Player 2. So in a two player game with both Controllers plugged in at the same time will control Player 1.
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 »

Jeebs wrote:I apologize of this has been talked about already but I'm curious if the Mayflash SNES to USB Adapter works for anyone else.

I have the two player adapter and I can get Player 1 to work perfectly. But it doesn't defect the second port on the adapter as Player 2. So in a two player game with both Controllers plugged in at the same time will control Player 1.
did you test it on non-Arcade cores?
Jeebs
Retro freak
Retro freak
Posts: 16
Joined: Sun Nov 04, 2018 1:59 pm

Re: Joystick testing thread

Post by Jeebs »

Sorgelig wrote:
Jeebs wrote:I apologize of this has been talked about already but I'm curious if the Mayflash SNES to USB Adapter works for anyone else.

I have the two player adapter and I can get Player 1 to work perfectly. But it doesn't defect the second port on the adapter as Player 2. So in a two player game with both Controllers plugged in at the same time will control Player 1.
did you test it on non-Arcade cores?
Yes the testing I did was on SNES, Genesis, and NES. I can test any other Core if needed.
LamerDeluxe
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 104
Joined: Tue Mar 03, 2020 9:13 pm
Location: Netherlands

Re: Joystick testing thread

Post by LamerDeluxe »

I've received my DE10 this Monday and haven't received anything else yet. I'm trying to get a Competition Pro USB stick to work (on a passive USB hub,together with a keyboard).

I assign the buttons in the Main menu of MiSTer and the buttons and directions get detected. After that the joystick doesn't do anything in the menu, I'm not sure if that is normal. The keyboard still works as usual.

Then when I start any core, like an Arcade core or the VIC-20 core and try to use the joystick, I only get a warning that this controller is unknown and I need to define it from the main menu first. Which I'm thinking I already did.

I couldn't find a solution online, am I doing something very obvious wrong?
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 »

Update to new release of Main. There are fixes for joystick settings.
LamerDeluxe
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 104
Joined: Tue Mar 03, 2020 9:13 pm
Location: Netherlands

Re: Joystick testing thread

Post by LamerDeluxe »

Sorgelig wrote:Update to new release of Main. There are fixes for joystick settings.
Yes, this update fixed it, works perfectly now!
Jeebs
Retro freak
Retro freak
Posts: 16
Joined: Sun Nov 04, 2018 1:59 pm

Re: Joystick testing thread

Post by Jeebs »

Jeebs wrote:
Sorgelig wrote:
Jeebs wrote:I apologize of this has been talked about already but I'm curious if the Mayflash SNES to USB Adapter works for anyone else.

I have the two player adapter and I can get Player 1 to work perfectly. But it doesn't defect the second port on the adapter as Player 2. So in a two player game with both Controllers plugged in at the same time will control Player 1.
did you test it on non-Arcade cores?
Yes the testing I did was on SNES, Genesis, and NES. I can test any other Core if needed.
I just tested this on most Console Cores and some Arcade Cores with the same results. It seems MiSTer thinks the adapter has only one controller port or thinks both ports are the same for Player 1 only.

I want to say this used to work a while back but I'd have to test this with some older MiSTer binary versions.
jim150
Atariator
Atariator
Posts: 20
Joined: Sun Sep 30, 2018 5:20 am
Location: Catalonia

Re: Joystick testing thread

Post by jim150 »

I'm triyng to build the JogConUSB via a female psx plug from an extender cable. In the .ino file it is not clear for me where I must connect the 3.3V in the Arduino Pro Micro board (I connect the 5v in the Vcc pin).
Also, I must bridge the jumper in J1, right?
Thanks!
https://github.com/MiSTer-devel/Retro-C ... /JogConUSB
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 »

Usually Arduino Micro 5V version has no 3.3V power pin. Some sources say it's ok to use 5V for PSX controllers.
I've used ItsyBitsy from Adafruit which has 3.3V LDO on board, so you can easily source both 3.3V and 5V from the same board.
There is also BS Micro which is similar to Beetle, but includes 3.3V LDO as well.
Another way is to use Arduino Micro 3.3V version which should include LDO for main chip and thus should provide 3.3V. Such version is slower, but i think it doesn't matter for USB adapter.
jim150
Atariator
Atariator
Posts: 20
Joined: Sun Sep 30, 2018 5:20 am
Location: Catalonia

Re: Joystick testing thread

Post by jim150 »

Thank you for your response, I’ll try it with these boards.
illegalprime
Atarian
Atarian
Posts: 3
Joined: Tue Mar 03, 2020 10:07 am

Re: Joystick testing thread

Post by illegalprime »

Anyone have success with mayflash s pro?

I recently purchased one and confirmed working on windows and Nvidia shield.

However when I plug into mister via basic otg I see slow pulsating green light. I plug ps4 controller into mayflash. This should switch mayflash to correct mode and pair with controller but even when I leave the controller plugged into mayflash I cannot control anything. I did try cycling through the various modes but no success.

If I plug ps4 controller direct into otg it works but I wanted wireless connect to mayflash.

Hope this make sense. I see people mention mayflash in this thread but anyone successfully using with the s pro version ?

In case it relevant I am using an iPad power adapter. 5v 2.1A. perhaps I need more juice ? I have also just run the update script so am up-to-date as far as I can tell.

Thx
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 »

Why use weird adapters with buggy firmwares? DualShock4 can be connected through standard BT dongle.
illegalprime
Atarian
Atarian
Posts: 3
Joined: Tue Mar 03, 2020 10:07 am

Re: Joystick testing thread

Post by illegalprime »

Only because I don’t have a bt dongle but I do have the mayflash s pro (which I got primarily for nintendo switch). Am not bothered if it doesn’t work. Primarily wanted to know if others had seen it working incase I just needed a better power supply.

Ps loving mister. Setup was a breeze and looking forward to using it more.
mrbig6251
Atariator
Atariator
Posts: 18
Joined: Wed Feb 26, 2020 11:46 pm

Re: Joystick testing thread

Post by mrbig6251 »

Hi guyz, thanks for your work and stay safe, I wanna know if it's possible to get direct control from the gpio or main board for at least directions (6 action buttons, start, (select, coins)), thanks and have a great day

Mr BIG
User avatar
uXe
Atari freak
Atari freak
Posts: 56
Joined: Thu Nov 21, 2019 1:57 am
Location: Adelaide, South Australia
Contact:

Re: Joystick testing thread

Post by uXe »

So... I've got a potentiometer connected to an Arduino Micro, used the mr.Spinner sketch, I can see the messages getting through in the serial console: EV_ABS, Axis=8, and I can watch the Offset go up and down when I turn the pot... but when I go into cores supporting paddles and switch input to paddle - nothing! Feel like I must be missing something obvious?!?! :shrug:
Locked

Return to “MiSTer”