Author Topic: USB game controllers and mice  (Read 6987 times)

0 Members and 1 Guest are viewing this topic.

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.118
  • Country: dk
    • spinpoint.org
  • Liked: 1198
  • Likes Given: 874
Re: USB game controllers and mice
« Reply #50 on: 03:50, 06 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.



Offline Maniac

  • CPC6128
  • ****
  • Posts: 184
  • Country: gb
  • Liked: 67
  • Likes Given: 89
Re: USB game controllers and mice
« Reply #51 on: 09:56, 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?

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.118
  • Country: dk
    • spinpoint.org
  • Liked: 1198
  • Likes Given: 874
Re: USB game controllers and mice
« Reply #52 on: 12:34, 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).
« Last Edit: 12:44, 06 April 19 by Duke »

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.118
  • Country: dk
    • spinpoint.org
  • Liked: 1198
  • Likes Given: 874
Re: USB game controllers and mice
« Reply #53 on: 16:43, 06 April 19 »

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

Online TotO

  • 6128 Plus
  • ******
  • Posts: 3.406
  • Country: fr
    • ?area=showdonations;u=4
  • Liked: 2591
  • Likes Given: 1525
Re: USB game controllers and mice
« Reply #54 on: 17:59, 06 April 19 »
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)

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.118
  • Country: dk
    • spinpoint.org
  • Liked: 1198
  • Likes Given: 874
Re: USB game controllers and mice
« Reply #55 on: 08:36, 07 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 ;)
« Last Edit: 09:46, 07 April 19 by Duke »

Online TotO

  • 6128 Plus
  • ******
  • Posts: 3.406
  • Country: fr
    • ?area=showdonations;u=4
  • Liked: 2591
  • Likes Given: 1525
Re: USB game controllers and mice
« Reply #56 on: 14:37, 07 April 19 »
OK! (or a little lithium battery to power your MCU)

Is your design can fit into a DB9 shell?

« Last Edit: 14:40, 07 April 19 by TotO »
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.118
  • Country: dk
    • spinpoint.org
  • Liked: 1198
  • Likes Given: 874
Re: USB game controllers and mice
« Reply #57 on: 04:29, 08 April 19 »

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 ;)

Is your design can fit into a DB9 shell?

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.118
  • Country: dk
    • spinpoint.org
  • Liked: 1198
  • Likes Given: 874
Re: USB game controllers and mice
« Reply #58 on: 11:16, 08 April 19 »
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.

Online TotO

  • 6128 Plus
  • ******
  • Posts: 3.406
  • Country: fr
    • ?area=showdonations;u=4
  • Liked: 2591
  • Likes Given: 1525
Re: USB game controllers and mice
« Reply #59 on: 13:03, 08 April 19 »
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: Duke
Shrink 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
« Last Edit: 13:56, 08 April 19 by TotO »
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Offline XeNoMoRPH

  • 464 Plus
  • *****
  • Posts: 485
  • Country: es
  • " ... in space no one , can hear you scream ... "
  • Liked: 980
  • Likes Given: 866
Re: USB game controllers and mice
« Reply #60 on: 15:48, 13 April 19 »

https://youtu.be/Ur3wE34Ghug


What about ms input lag ?
« Last Edit: 16:06, 13 April 19 by XeNoMoRPH »

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.118
  • Country: dk
    • spinpoint.org
  • Liked: 1198
  • Likes Given: 874
Re: USB game controllers and mice
« Reply #61 on: 16:07, 13 April 19 »
Thanks @XeNoMoRPH

Was going to post it here too :)


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...
« Last Edit: 07:20, 14 April 19 by Duke »

Offline shifters74

  • CPC464
  • **
  • Posts: 17
  • Country: gb
  • Liked: 10
  • Likes Given: 9
Re: USB game controllers and mice
« Reply #62 on: 11: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

Offline XeNoMoRPH

  • 464 Plus
  • *****
  • Posts: 485
  • Country: es
  • " ... in space no one , can hear you scream ... "
  • Liked: 980
  • Likes Given: 866
Re: USB game controllers and mice
« Reply #63 on: 12:42, 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 ?
« Last Edit: 12:51, 14 April 19 by XeNoMoRPH »

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.118
  • Country: dk
    • spinpoint.org
  • Liked: 1198
  • Likes Given: 874
Re: USB game controllers and mice
« Reply #64 on: 14:37, 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.

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.


Offline shifters74

  • CPC464
  • **
  • Posts: 17
  • Country: gb
  • Liked: 10
  • Likes Given: 9
Re: USB game controllers and mice
« Reply #65 on: 15:32, 14 April 19 »
Does the cool device have a name???   8)
The J4??  :P
cheers
shifters


Offline XeNoMoRPH

  • 464 Plus
  • *****
  • Posts: 485
  • Country: es
  • " ... in space no one , can hear you scream ... "
  • Liked: 980
  • Likes Given: 866
Re: USB game controllers and mice
« Reply #66 on: 16:24, 14 April 19 »
Does the cool device have a name???   8)
The J4??  :P
cheers
shifters

Offline zhulien

  • 464 Plus
  • *****
  • Posts: 419
  • Country: au
    • 8bitology
  • Liked: 192
  • Likes Given: 113
Re: USB game controllers and mice
« Reply #67 on: 21:05, 14 April 19 »
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?

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.118
  • Country: dk
    • spinpoint.org
  • Liked: 1198
  • Likes Given: 874
Re: USB game controllers and mice
« Reply #68 on: 22:06, 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.
« Last Edit: 22:15, 14 April 19 by Duke »

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.118
  • Country: dk
    • spinpoint.org
  • Liked: 1198
  • Likes Given: 874
Re: USB game controllers and mice
« Reply #69 on: 21:42, 16 April 19 »

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.

Offline shifters74

  • CPC464
  • **
  • Posts: 17
  • Country: gb
  • Liked: 10
  • Likes Given: 9
Re: USB game controllers and mice
« Reply #70 on: 21:44, 16 April 19 »
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!!

Offline VincentGR

  • 6128 Plus
  • ******
  • Posts: 1.096
  • Country: gr
    • Parts from the past.
  • Liked: 573
  • Likes Given: 1538
Re: USB game controllers and mice
« Reply #71 on: 22:00, 16 April 19 »
I need one for my C64, just for the mouse option.

Offline Shining

  • Supporter
  • CPC6128
  • *
  • Posts: 266
  • Country: de
    • Shinings little CPC page
  • Liked: 369
  • Likes Given: 173
Re: USB game controllers and mice
« Reply #72 on: 17:19, 17 April 19 »
- 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

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.118
  • Country: dk
    • spinpoint.org
  • Liked: 1198
  • Likes Given: 874
Re: USB game controllers and mice
« Reply #73 on: 18:40, 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...
« Last Edit: 21:47, 17 April 19 by Duke »

Offline zhulien

  • 464 Plus
  • *****
  • Posts: 419
  • Country: au
    • 8bitology
  • Liked: 192
  • Likes Given: 113
Re: USB game controllers and mice
« Reply #74 on: 12:41, 18 April 19 »
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?
« Last Edit: 12:45, 18 April 19 by zhulien »