News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Duke

USB game controllers and mice

Started by Duke, 00:30, 02 February 19

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Duke

Quote from: Maniac on 22:54, 05 April 19
Have PM'd you for one of the devices at the mo. A while ago I asked about a second device on the Plus given its 2 joystick ports but given the power requirements you mention in this post would this even be possible?
Yes it will be possible. Only problem right now is I don't have Y splitter cable that fits into the CPC plus DC power socket, which afair. has 2.5 mm inside diameter instead of  the 2.1mm used on regular CPC.
So I would either need to get some Y splitter cable with right dimension DC plugs (not found), use some DC to DC converters or make it myself (yuck).

Anyway, when using two adapters on a CPC plus, one would have to use 2x  2-1 y-splitter cables or get a 3-1 y-splitter for the power. Then two or one (depending on powersupply used) DC-2-DC plug converters.
A smoother option for CPC plus would be to take the power from the Analog joystick port.



Maniac

Quote from: Duke on 01:50, 06 April 19
Yes it will be possible. Only problem right now is I don't have Y splitter cable that fits into the CPC plus DC power socket, which afair. has 2.5 mm inside diameter instead of  the 2.1mm used on regular CPC.
So I would either need to get some Y splitter cable with right dimension DC plugs (not found), use some DC to DC converters or make it myself (yuck).

Anyway, when using two adapters on a CPC plus, one would have to use 2x  2-1 y-splitter cables or get a 3-1 y-splitter for the power. Then two or one (depending on powersupply used) DC-2-DC plug converters.
A smoother option for CPC plus would be to take the power from the Analog joystick port.
I had had a similar idea re the analog port but I guess that would also need a custom cable to be made. Given how often I might play 2 player games this isn't a scenario I'd use very often. Where have you sourced your DC-2-DC plug converter please?

Duke

#52
Quote from: Maniac on 07:56, 06 April 19
Where have you sourced your DC-2-DC plug converter please?
Ebay has lots of them, but you need one for the monitor plug and the one that goes into the CPC plus.
Ie.
https://www.ebay.com/itm/2-1x5-5mm-Female-to-2-5x5-5mm-Male-DC-Power-Adapter-Converter-for-CCTV-Camera/132690461014
https://www.ebay.com/itm/DC-Power-Connector-5-5mm-x-2-1mm-Male-to-Female-Coupler-Adapter-Converter-5Pcs/323738120293

I guess one of each should do the trick (maybe).

Duke


Today I added support for XBOX One controller, it seems like a nice controller - Yeah I should've focused on finishing stuff, oh well...

Thanks at @Phantomz for the 3 button version of 1943 used in this video. Unfortunately I don't really get to pick up any smartbombs, though it seems I blew one at some point using FIRE 3.


https://youtu.be/4uqGCEa9UUw

TotO

Instead of a "5v hack" cable, should it be powered through the USB, using the X-Box controller battery?
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Duke

#55
Quote from: TotO on 15:59, 06 April 19
Instead of a "5v hack" cable, should it be powered through the USB, using the X-Box controller battery?
Unfortunately not. It wont supply power on the USB (it is device, not host). And my design requires the PCB has same ground as the Amstrad (and not only the COMMON pulse).


Edit: found almost perfect cable for CPC plus  -> https://www.aliexpress.com/item/1pcs-CCTV-DC-Power-5-5x-2-5mm-Female-to-5-5-x-2-5mm-5/32866117718.html
Unfortunately it's quite pricey (and a tad long). If someone with better search skills can find a cheaper one, much appreciated ;)

TotO

#56
OK! (or a little lithium battery to power your MCU)

Is your design can fit into a DB9 shell?

"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Duke


As it is, I don't think it would fit, due to the USB port being right angle, so it sticks up and not centered over the PCB as the DB9.
I have been going over the various DB9 shells and not really found one that was ideal.
Shrink tube feels good though ;)

Quote from: TotO on 12:37, 07 April 19
Is your design can fit into a DB9 shell?

Duke

Attached a picture of suggested button mapping.

This would apply to:
DualShock 3
DualShock 4
Xbox One controller

And ie. SNES usb controllers I have.

For other USB controllers, that I don't own, I cannot make such specific mapping.

Let me know if anyone think mapping should be different, I am not much of a gamer, so this is just what occurred to me.

TotO

#59
Most used buttons are "cross" (cancel) and "round" (valid) on Playstation controllers.
On XBOX controllers, it match with "A" and "B" respectively.

As already spoke, the SPARE (fire3) will be nice to allow to extend extra button usages.

A / "cross" = CPC FIRE 2
B / "circle" = CPC FIRE 1
X / "square" = CPC FIRE 1 + FIRE 2
Y / "triangle" = CPC FIRE 3

RT1 = CPC AUTOFIRE 1
LT1 = CPC AUTOFIRE 2

RT2 = CPC FIRE 3 + FIRE 1
LT2 = CPC FIRE 3 + FIRE 2

"START" (or other function) = CPC UP+DOWN
"SELECT" (or other function) = CPC LEFT+RIGHT


Quote from: DukeShrink tube feels good though ;)
Sure, but using a standard DB9 shell allow to have enough space to add a little removable "CR lithium battery" to directly power your MCU and avoid to add an extra power cable and electronic. ;D
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

XeNoMoRPH

#60

https://youtu.be/Ur3wE34Ghug


What about ms input lag ?
your amstrad news source in spanish language : https://auamstrad.es

Duke

#61
Thanks @XeNoMoRPH

Was going to post it here too :)

Quote from: XeNoMoRPH on 13:48, 13 April 19

https://youtu.be/Ur3wE34Ghug


What about ms input lag ?

There should be no lag (well maybe 4 ms!).

Anyway in short I am happy with the bootloader and initial firmware now.
So I will start finishing and shipping out the preordered units.

Also need to write some documentation on it soon ;)

But for short info look at http://www.spinpoint.org/2019/04/13/imperium-solo/  and watch the video above.

EDIT:
Button mapping is as suggested by @TotO for the known gamepads.
For mouses, 3 buttons are supported. Left Button is Fire 2, Right is Fire 1 and Wheel / middle button is Fire 3. The mouse works best in AMX "mode", so in ie. Adv. Art Studio, go to input devices and select AMX mouse.

Picture of some ready to ship units...

shifters74

Hi Duke,
does it work with symbos as a mouse with a microsoft intellimouse for example?
Another day, another duke post and me going "oooh oooh i want one, or two!"  ;D ;D
cheers
Shifters

XeNoMoRPH

#63
Quote from: shifters74 on 09:31, 14 April 19
Hi Duke,
does it work with symbos as a mouse with a microsoft intellimouse for example?
Another day, another duke post and me going "oooh oooh i want one, or two!"  ;D ;D
cheers
Shifters
Same question ,
I want to use this mouse in symbos .. will it work?

And .. another question ...
Is it possible to use the CPC floppy disk at the same time as the USB Adapter ?
your amstrad news source in spanish language : https://auamstrad.es

Duke

Quote from: shifters74 on 09:31, 14 April 19
does it work with symbos as a mouse with a microsoft intellimouse for example?

It works in SymbOS yes, similar as if it was a joystick or a AMX mouse.

Quote from: XeNoMoRPH on 10:42, 14 April 19
I want to use this mouse in symbos .. will it work?

As for specific mouse, I cannot say if they will work or not. I tested logitech unified (M525 best mouse on the market! really ;) ) and 4 different "China" mice.

Ideally any REAL USB mouse will work, but I guess there may be some that dont work because of my HID descriptor parser.
I will try to write up a procedure so users can send me info on a specific mouse or gamepad so that it can be added to the firmware, if it fails to work by default.

Quote
Is it possible to use the CPC floppy disk at the same time as the USB Adapter ?
Yes.


shifters74

Does the cool device have a name???   8)
The J4??  :P
cheers
shifters


XeNoMoRPH

Quote from: shifters74 on 13:32, 14 April 19
Does the cool device have a name???   8)
The J4??  :P
cheers
shifters
your amstrad news source in spanish language : https://auamstrad.es

zhulien

This is a cool project.  Will it work with PS2 Dual Shock also?  I am curious... if the CPC usually uses Atari compatible joysticks, why would this require a firmware update to work on other computers that work with Atari compatible joysticks?  like an Atari 2600?

Duke

#68
Quote from: zhulien on 19:05, 14 April 19
This is a cool project.  Will it work with PS2 Dual Shock also?
Thanks.
PS2 Dualshock doesn't use USB so no go.
Quote
I am curious... if the CPC usually uses Atari compatible joysticks, why would this require a firmware update to work on other computers that work with Atari compatible joysticks?  like an Atari 2600?
Apart from the missing VCC on the joystick port, there is another major difference.
It's "invisible" when you just use a wired switch.
Joystick signals are invoked by pulling signals (left/right/up/down/fire etc) low (to ground).
However on CPC the "ground" pin 8 is only grounded when the PPI is scanning the keyboard matrix for which the joystick signals are connected. If signals were constantly grounded the keyboard scanning would give all kinds of wrong characters.
This means to simplify my circuit, I watch for pin 8 to go low, before I can invoke the signals for left/right/up/down etc...

Obviously its not a big deal to change this (in fact much easier not having to watch for the pin to go low/high) to make it compatible with ie. C64.
ZX spectrum +2/+3 beside having an obscure layout on the joystick port, seems to use similar approach as the CPC, so will need a relayout in the firmware.
Amiga and Atari ST have specific signals for mouses that need to be "emulated".
Fire 1 / 3 are also different among various systems.

Beside software changes, I need to connect pin 8 to ground on the PCB (done via 0 ohm SMD resistor) and connect pin 7 (also 0 ohm SMD resistor) to VCC of the PCB (now powered via joystick port) for ST/AMIGA/C64 etc.

Duke


Now also working with C64 (probably nobody gives a... in here). Do not expect to share the hardware between the C64 (or similar) and the Amstrad, as it needs to have SMD jumpers moved, beside the firmware changed.


https://youtu.be/qFVo_Y_V64U

Fwiw. I should have done my homework better on the ZX Spectrum +2/+3, it does work in another way, and likely no firmware will make my board work with the built-in joystick interface.

shifters74

Hi all,
While it may be seen as heresy here   :P   - this commodore 64 fan loves the video Duke just posted on his spinpoint website.  8) 8)
Love the idea of PS3 and Ps4 controller on C64!!!  Uridium with mouse - hmmmm nice!!  ;D ;D
Another day and another reason to buy more stuff from Duke lol!
cheers
Shifters

ps ah Duke got post in while i was typing!!  Please post on Lemon64 Duke!!

VincentGR

I need one for my C64, just for the mouse option.

Shining

- Will it work with 8Bitdo USB to wireless adapter ?- Are you planning a version for two joysticks ?

TGS is back

Download my productions at:
cpc.scifinet.org

Duke

#73
Quote from: Shining on 15:19, 17 April 19
- Will it work with 8Bitdo USB to wireless adapter ?- Are you planning a version for two joysticks ?
Most likely. I have ordered this :
https://www.ebay.com/itm/Wireless-USB-SNES-Retro-Controller-Gamepad-for-PC-MAC-Raspberry-Pi-US-SHIP/153413332769

And I expect to add support for it. Don't have the 8bitdo one, but I think its quite similar (if not the same).

And maybe ;) - for the CPC, if I added USB hub support it could in theory deal with 2 joysticks already.. Lets see...

zhulien

#74
Hi Duke, just a thought. Would it be viable for you to make a PLUS variant with the board oriented sideways to fit both joystick ports at once (and not stick out so much), but with 2 USB plugs? The Imperium Skywalker?

Powered by SMFPacks Menu Editor Mod