CPCWiki forum

General Category => Amstrad CPC hardware => Topic started by: Duke on 01:30, 02 February 19

Title: USB game controllers and mice
Post by: Duke on 01:30, 02 February 19

Had a bit of encouragement to work on my dust collecting USB to joyport board project, in bad need of a proper mouse for my Atari ST and Amiga (oups).
CPC is first of course, here is a quick video of the first testing with a USB gamepad:

https://youtu.be/CpNEHrwhOzg (https://youtu.be/CpNEHrwhOzg)

Will add HID mouse driver next and hope to do a fairly generic hid parser for game controllers, otherwise atleast add the most common like PS4 & PS3 pads.



EDIT:
The device is now being sold.

Ordering procedure:
Send me a PM (with your email address) or an email and let me know what you need and for which computer, then I  will confirm and add you to my list.
And when it is ready, I will email you with Paypal details and ask for your shipping address.

Current pricing is:
Imperium Solo with DC Y splitter cable for regular CPC, 15 euro
Imperium Solo with DC Y splitter cable and adapter for CPC plus, 16 euro
Shipping worldwide (unregistered) up to 100 grams, 4 euro
+ Paypal fee which is 1 euro or pay as friend (but you loose the ability to make a claim to Paypal afaik. if you are not happy with the product etc, so up to you!)

Short instructions/information here (click on a specific game controller in the database to learn button mappings):
https://www.spinpoint.org/imperium (https://www.spinpoint.org/imperium)
Title: Re: USB game controllers and mice
Post by: mr_lou on 09:28, 02 February 19
Nice! So this allows us to use USB gamepads for the CPC?

Like PlayStation 3/4 controllers too? And Logitech F310 / F510 / F710? Does it require firmware flashing depending on controller then?

Funnily enough, I'm involved in a minor project to do the opposite these days: Make it possible to use an Amstrad CPC joystick / gamepad for Blu-ray games.  :)
The creator of this adapter (https://www.retronicdesign.com/en/) is currently writing the firmware for it that should make this possible. Then you need to flash the adapter with this firmware. If successful you should be able to play any Blu-ray game, such as Bolt's Be-Awesome Mission (https://www.youtube.com/watch?v=hQ4QUlbM6_c) on your standard Blu-ray player using your Amstrad joystick.   :)
Very niche of course.
My interest in this spawned from my interest in Blu-ray homebrew games (http://www.blu-play.com) - code games in Java, and run them on PS3 + PS4 + XB1 from the very same disc.
Title: Re: USB game controllers and mice
Post by: Duke on 10:20, 02 February 19
Nice! So this allows us to use USB gamepads for the CPC?
Yes, and mice too.
Quote
Like PlayStation 3/4 controllers too? And Logitech F310 / F510 / F710? Does it require firmware flashing depending on controller then?
It's the plan to add as many as I can get my hands on, PS3 & 4 for sure.
It will be possible to update the firmware, when more are added to it (thumb drive required).

Quote
Funnily enough, I'm involved in a minor project to do the opposite these days: Make it possible to use an Amstrad CPC joystick / gamepad for Blu-ray games.  :)
The creator of this adapter (https://www.retronicdesign.com/en/) is currently writing the firmware for it that should make this possible. Then you need to flash the adapter with this firmware. If successful you should be able to play any Blu-ray game, such as Bolt's Be-Awesome Mission (https://www.youtube.com/watch?v=hQ4QUlbM6_c) on your standard Blu-ray player using your Amstrad joystick.   :)
Sounds cool :) - yeah quite the opposite. I am finding good joysticks hard to find these days. I only have 1 left, rest are garbage (non microswitches, yuck!).
Quote
Very niche of course.
My interest in this spawned from my interest in Blu-ray homebrew games (http://www.blu-play.com) - code games in Java, and run them on PS3 + PS4 + XB1 from the very same disc.
I am sure many will find it cool! - Good luck with it.
Title: Re: USB game controllers and mice
Post by: VincentGR on 14:13, 02 February 19
Hey Duke, will the mouse work normally or will need a kick to scroll like a joystick?
Seen this to another adapter I have.
Title: Re: USB game controllers and mice
Post by: HAL 6128 on 17:23, 02 February 19
Yeah... same question. It would be good to test it on OCP Art Studio to get a smooth and proper movement.
Title: Re: USB game controllers and mice
Post by: Duke on 12:52, 03 February 19
Hey Duke, will the mouse work normally or will need a kick to scroll like a joystick?
Seen this to another adapter I have.
Yeah... same question. It would be good to test it on OCP Art Studio to get a smooth and proper movement.

Still working on the mouse driver. I cannot remember how good ie. AMX mouse was.
Was it able to be used smoothly in ie. OCP Art Studio? or was it a chunky affair?
And @VincentGR (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1053) what do you mean with needing a kick?  Like set the mouse of in one direction and pull it again to stop going?
Title: Re: USB game controllers and mice
Post by: GUNHED on 16:20, 03 February 19
Just an idea... There are Adaptors for f.e. Atari ST mice for the CPC. They transfer proportional data instead of joystick-compatible data.

Here an example:
http://www.cpcwiki.eu/index.php/Atari-ST_mouse_adapter (http://www.cpcwiki.eu/index.php/Atari-ST_mouse_adapter)

Would it be possible to have a small switch, for joy-mode / proportional mode? So we can get proportional data from such an USB mouse? There is already some well software for it (including G-Paint!). That would be awesome!  :) :) :)   
Title: Re: USB game controllers and mice
Post by: Duke on 19:06, 03 February 19
Just an idea... There are Adaptors for f.e. Atari ST mice for the CPC. They transfer proportional data instead of joystick-compatible data.

Here an example:
http://www.cpcwiki.eu/index.php/Atari-ST_mouse_adapter (http://www.cpcwiki.eu/index.php/Atari-ST_mouse_adapter)

Would it be possible to have a small switch, for joy-mode / proportional mode? So we can get proportional data from such an USB mouse? There is already some well software for it (including G-Paint!). That would be awesome!  :) :) :)
It may be :)
How would I test it in FutureOS - I mean quick guide to enable ST / Amiga Mouse mode in FutureOS (don't have one for my ST :) but I think it is just to swap x,y iirc).. Thanks.
Title: Re: USB game controllers and mice
Post by: VincentGR on 20:34, 03 February 19
My adapter works like a joystick scroll at the beginning and later moves like a mouse until I stop it.
I can't draw like this.
Title: Re: USB game controllers and mice
Post by: Duke on 22:05, 03 February 19
Current progress of mouse implementation:
https://www.youtube.com/watch?v=5fA4fb1rmYQ

It's hard to get it good in regular "joystick" mode. I wonder how it compares to AMX mouse atm.
Title: Re: USB game controllers and mice
Post by: HAL 6128 on 00:00, 04 February 19
Yes. It would be good to have some kind of adjustments (speed, acceleration) from software side.
Title: Re: USB game controllers and mice
Post by: Duke on 00:33, 04 February 19
Yes. It would be good to have some kind of adjustments (speed, acceleration) from software side.
Yes, finetuning it now. I can do some averaging & keep  moving for repeated frames until new direction or the mouse move (steps) count out.
But at the end of the day, software like Art Studio reads the joystick port only 50 times per second, so technically that is 50 pixels per second in either direction, but of course it also does its own acceleration when a direction is continuously pressed, so this is where I can adjust the mouse driver a bit to simulate the move like a joystick.
Ideally I add a secondary mode, ie. something like @GUNHED (http://www.cpcwiki.eu/forum/index.php?action=profile;u=2029) suggested for proper accelleration.
Title: Re: USB game controllers and mice
Post by: TotO on 11:34, 04 February 19
Yes. It would be good to have some kind of adjustments (speed, acceleration) from software side.
The adapter should embed some counters to handle the mouse ballistic to produce usable values, to not have extra computing into the softwares.
Title: Re: USB game controllers and mice
Post by: Duke on 12:39, 04 February 19
The adapter should embed some counters to handle the mouse ballistic to produce usable values, to not have extra computing into the softwares.
As for a custom defined mode, yes.
USB mouses use delta offset from last position, so if you send this value to CPC you already have ballistics as CPC then has the movement over time.
One way to do it would be to have two consecutive reads of the joyport (key scan row) per frame, where first value read is delta X (say 5 bits) and 2nd value is delta Y . Remaining bits for ID (ΔX or ΔY) & buttons (3).
Using 5 bits you will acheive a max. speed of 31 pixels per frame or 50 * 31 = 1550 pixels per second, so you can like on PC move quickly from one side of the screen to the other.

Edit: actually it would need a sign bit for the direction changes, but still sufficiently fast at approx 800 pixels per second.
Title: Re: USB game controllers and mice
Post by: Bryce on 13:15, 04 February 19
The problem with custom methods is that it then makes the device non-compatible with all software with mouse support from back then.

Bryce.
Title: Re: USB game controllers and mice
Post by: Duke on 13:23, 04 February 19
The problem with custom methods is that it then makes the device non-compatible with all software with mouse support from back then.
Yes, agreed. It would need to support the old "AMX" method too. But if someone wants to implement a better way in their software the "new" method could be used.
Title: Re: USB game controllers and mice
Post by: GUNHED on 13:47, 04 February 19
It may be :)
How would I test it in FutureOS - I mean quick guide to enable ST / Amiga Mouse mode in FutureOS (don't have one for my ST :) but I think it is just to swap x,y iirc).. Thanks.

Just plug it in and it will work. The mouse-adapter will set the spare pin on the joystick port to indicate the proportional mouse.  :) :) :)

Oh, this does not work for 6128 Plus, because it lacks the spare signal.
 
Title: Re: USB game controllers and mice
Post by: TotO on 14:23, 04 February 19
AMX is a poor joystick on a ball... A pure shit to use for few old softwares that have better to be patched to be able to properly use them instead of the keyboard or that.
Title: Re: USB game controllers and mice
Post by: TotO on 14:58, 04 February 19
One way to do it would be to have two consecutive reads of the joyport (key scan row) per frame, where first value read is delta X (say 5 bits) and 2nd value is delta Y. Remaining bits for ID (ΔX or ΔY) & buttons (3). Using 5 bits you will acheive a max. speed of 31 pixels per frame or 50 * 31 = 1550 pixels per second, so you can like on PC move quickly from one side of the screen to the other. Edit: actually it would need a sign bit for the direction changes, but still sufficiently fast at approx 800 pixels per second.
Should be 4bit with up to 300Hz interrup. But sure, 5/6bit is great. Unused bits to set the actions.
Title: Re: USB game controllers and mice
Post by: Duke on 20:33, 05 February 19

Tried to experiment with a custom mode, for those interested below is a video of the result.
It's sending 5 bits of delta X and Y + sign bit, so 6 bits total for each delta coordinate and 1 bit to indicate if its X or Y.
The program I wrote quickly to test, is in mode 2 and only reads  the mouse once per frame.

https://youtu.be/4Rm1psdePbg (https://youtu.be/4Rm1psdePbg)

The result is much better than my AMX mode test, also beware I am no artist ;)

Here is the code to read the DX/DY values:
Code: [Select]
    ld a,0x49
    call key_scan

    bit 5,a        ; 0 = delta X, 1 = delta Y
    jr    nz,isDeltaY
   
    ld hl,(xpos)
    bit 6,a        ; check sign bit
    jr nz, dx_not_signed
    and 0x1F        ; keep lower 5 bits
    ld e,a
    ld d,0
    or a
    sbc hl,de
    ld (xpos),hl
    jr    delta_done
dx_not_signed:       
    and 0x1F        ; keep lower 5 bits
    ld e,a
    ld d,0
    add hl,de
    ld (xpos),hl
    jr    delta_done
isDeltaY:
    ld a,0x49
    call key_scan
    ...
    ; same stuff as for DX
delta_done:   
    ...
   
xpos: dw 0
ypos: dw 0


I will have to up the format to two more packet, as I don't have room for buttons in this mode when compatible with CPC plus (no fire3), the ID bit to be 2 bits (00, 01, 10)
So like this:
ID DATA
00 XXXX
01 XXBB
10 YYYY
11 YYBB

Also Basic wont like my packet sending when its scanning the keyboard, so need to figure out how to "enable" enhanced mode.. Maybe just a button on the PCB (yeah sucks) or press both mouse buttons when inserting (otherwise AMX mode).

Let me know what the you think.
Title: Re: USB game controllers and mice
Post by: GUNHED on 21:26, 05 February 19
Of course it would be nice to have something super fancy, but somebody needs to patch soft then.
IMHO it's great to have something compatible which does run with already existing software. I like this project.  :) :) :)
Title: Re: USB game controllers and mice
Post by: TotO on 22:08, 05 February 19
How many softwares will require to be patcked? 1, 2, 5 ?  ;D
Probably less work that doing a special adapter... And they will be better after that.
Title: Re: USB game controllers and mice
Post by: GUNHED on 22:08, 05 February 19
How many softwares will require to be patcked? 1, 2, 5 ?  ;D


For something new? 99%  ;)
Title: Re: USB game controllers and mice
Post by: HAL 6128 on 20:13, 10 February 19
How about the idea to integrate an AD-converter on the stick which reads out a analog signal (AD571 > 10 Bits in 0,000015 sec.)?
Title: Re: USB game controllers and mice
Post by: Duke on 22:01, 10 February 19
How about the idea to integrate an AD-converter on the stick which reads out a analog signal (AD571 > 10 Bits in 0,000015 sec.)?
Not sure for what advantage?
 The USB readings are all digital, although they can contain analog readings.
Fwiw. I have pretty good success with a 5 bit resolution for mouse movement, I did try to patch Art Studio to read my 4 packet format and all goes swell until I pick up some paint tool, where the screen updating starts to lag for some reason I have not found why yet.
Otherwise the mouse can accelerate very nicely across the screen with effortless movement. Which imo. is impossible with AMX mouse, regardless of sensitivity level, as it will take several seconds moving from one side of screen to the other (even with a constant direction for every reading).
Spent a bit too much time on patching Adv. Art Studio :/ - Rather than writing the device firmware.
Anyway, I will try to finish it up, in the next weekend or two.

Main usage will be USB gamepads as plain joysticks and USB mouse as AMX mouse  (sucky as it is, but compatible with whatever there is).
Enhanced 5 bit resolution mode for USB mouse and enhanced gamepad mode, will be available too, but not as default setting.
The board will be upgradable via USB thumb-drive.
Title: Re: USB game controllers and mice
Post by: HAL 6128 on 23:40, 10 February 19
Not sure myself. Just a quick thought about reading old hardware (like a ST Trackball plugged onto the joystick port). But that's totally different to your project.
Title: Re: USB game controllers and mice
Post by: GUNHED on 21:00, 12 February 19
Still dreaming of ST-Mouse Adapter compatibility...  :-X :-X :-X :)
Title: Re: USB game controllers and mice
Post by: Duke on 14:17, 07 March 19

A little progress, now support for Dualshock 3 & 4 controllers.

https://youtu.be/KO3-AH6rpYk

(Nice game @PuzCPC (http://www.cpcwiki.eu/forum/index.php?action=profile;u=2821))

Unfortunately I made another mistake or two on the revision 2 PCB, so I will have to order another batch before I can produce any.
Upgrading via USB stick is now also possible. Need to still add some stuff before I am happy with the code.
Title: Re: USB game controllers and mice
Post by: Maniac on 21:59, 07 March 19
Would love one of these please! Will it support both joystick ports on the Plus? If so would it be possible to use one in each port for 2 player games? If that’s the case I might want 2 please.
Title: Re: USB game controllers and mice
Post by: Phantomz on 22:35, 07 March 19

@Duke (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1624)


How many fire buttons do these support, 2 or 3?
Title: Re: USB game controllers and mice
Post by: Duke on 09:10, 08 March 19
Will it support both joystick ports on the Plus? If so would it be possible to use one in each port for 2 player games? If that’s the case I might want 2 please.
Yes it should be possible to use one in each of the CPC plus ports. Will test when I have two working modules :)

How many fire buttons do these support, 2 or 3?
3 for regular Amstrads
2 for Amstrad CPC plus
Title: Re: USB game controllers and mice
Post by: Phantomz on 16:32, 08 March 19
3 for regular Amstrads
2 for Amstrad CPC plus


Nice, it's a shame that the plus hardware doesn't support 3 buttons.  :doh:


At least the original CPC range support 3 buttons, I'll have to remap controls in Renegade & 1943.  ;D
Title: Re: USB game controllers and mice
Post by: TotO on 16:45, 08 March 19
Because pin5 is not Fire3 but spare on CPC. Not kept on PLUS, while mostly 1 button was used on computers controllers (2 are on the analog port too).
Title: Re: USB game controllers and mice
Post by: PuzCPC on 17:03, 08 March 19
A little progress, now support for Dualshock 3 & 4 controllers.

https://youtu.be/KO3-AH6rpYk (https://youtu.be/KO3-AH6rpYk)

(Nice game @PuzCPC (http://www.cpcwiki.eu/forum/index.php?action=profile;u=2821))

Unfortunately I made another mistake or two on the revision 2 PCB, so I will have to order another batch before I can produce any.
Upgrading via USB stick is now also possible. Need to still add some stuff before I am happy with the code.



Hi,
I see it for the first time on the real CPC. :D
What's really so smooth scrolling?  :o
PuzCPC
Title: Re: USB game controllers and mice
Post by: Phantomz on 18:36, 08 March 19
@Duke


I've remapped the controls in " Renegade ".


I've made it Joystick only, I've mapped the attacks to the 3 joystick buttons, I've made button 1 and 3 attack, with button 2 jump.


It's here if you want to give it a test.  ;D
Title: Re: USB game controllers and mice
Post by: Syncmaster319 on 01:24, 09 March 19
Duke,

Great stuff as always.

The support for multiple fire buttons is a killer feature.  I love my monster joystick but its a shame to only have 1 fire button.

Will be an instant purchase from me.

Mark
Title: Re: USB game controllers and mice
Post by: Duke on 09:27, 09 March 19
@Duke


I've remapped the controls in " Renegade ".


I've made it Joystick only, I've mapped the attacks to the 3 joystick buttons, I've made button 1 and 3 attack, with button 2 jump.


It's here if you want to give it a test.  ;D

The archieve is damaged, can you re-attach it? - It's nice to have a game with 3 buttons to test, thanks.
Title: Re: USB game controllers and mice
Post by: Phantomz on 19:47, 10 March 19
The archieve is damaged, can you re-attach it? - It's nice to have a game with 3 buttons to test, thanks.


Odd, it works for me, I used the latest version of winrar (trial version) as on a new laptop.


I'll have to look for another program to use to compress the disc.
Title: Re: USB game controllers and mice
Post by: Audronic on 00:16, 11 March 19
The archieve is damaged, can you re-attach it? - It's nice to have a game with 3 buttons to test, thanks.


I was able to open the Renegade (3 Button Joy).rar file with  " iZip Unarchiver " On my MAC


Ray



Title: Re: USB game controllers and mice
Post by: Duke on 08:27, 11 March 19
Yes, got it working using the latest winrar, thanks (Appearently something changed from the old one I was using).
I guess it's better to use .zip as that atleast is freely available.
Title: Re: USB game controllers and mice
Post by: Phantomz on 15:23, 11 March 19
Yes, got it working using the latest winrar, thanks (Appearently something changed from the old one I was using).
I guess it's better to use .zip as that atleast is freely available.

@Duke (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1624)

I'm glad you managed to get it working, I'll download winzip later.

I've remapped the controls in " 1943 " to make it use 3 buttons by default for both players, you might like this also.  ;)

Button 1 = Fire, Button 2 = Rolling, Button 3 = Smart Bomb
Title: Re: USB game controllers and mice
Post by: Duke on 15:43, 05 April 19
Final PCB arrived, tested and OK  8)

Hope to wrap up the bootloader and initial firmware over the weekend.
Still missing some female DC connectors before I can ship any.
Title: Re: USB game controllers and mice
Post by: GUNHED on 15:51, 05 April 19
Like usually excellent and professional work!  :) :) :)
Since we discussed some idea, Duke, can can please in brief explain how they work?
Are they compatible to digital joysticks or can they provide proportional data?

They definitely win the price for the smallest adapter in CPC world ever.  :laugh:
Title: Re: USB game controllers and mice
Post by: Duke on 16:05, 05 April 19
Like usually excellent and professional work!  :) :) :)
Since we discussed some idea, Duke, can can please in brief explain how they work?
Are they compatible to digital joysticks or can they provide proportional data?

Thanks.
As for initial firmware release I think I will just provide plain digital joystick conversion.
However I already have my custom 5 bit proportional data mode working fine for USB mouses, but of course no real use for special modes yet.
The beauty is that it can be easily upgraded, if one has a USB stick laying around (just plug it into the USB port of the adapter and powercycle it).
So I can implement whatever I want, if there is a demand for it.

With other firmwares I will try to support ZX, C64, Amiga and Atari ST too (although the last 3 require different "jumper" setting via smd resistors). As I am in lack of proper mouses for the 16 bits and joysticks for the others.

Quote
They definitely win the price for the smallest adapter in CPC world ever.  :laugh:
Thanks for noticing, I did my best to make it as small as possible, I could probably still squeeze another couple of mm off, maybe for another revision.
Title: Re: USB game controllers and mice
Post by: GUNHED on 16:19, 05 April 19
No, no, please don't make it smaller. One just felt between two keys and disappeared.  :laugh:

Fun at side. I still do have the Atari ST mouse here, so if some day maybe the proportional firmware for the following adapter will be available, I volunteer for testing intensively. That's the one I mean:
http://www.cpcwiki.eu/index.php/Atari-ST_mouse_adapter (http://www.cpcwiki.eu/index.php/Atari-ST_mouse_adapter)

Do you already support three buttons? Like for the AMX mouse? If not, this could be a first firmware update.  :)

Cool project, please add me to the "I want to buy" list.  :)
Title: Re: USB game controllers and mice
Post by: Duke on 16:34, 05 April 19
@GUNHED (http://www.cpcwiki.eu/forum/index.php?action=profile;u=2029)
Thanks, will consider it all later. It much more fun to make features if they are not just for myself (I am quite simple!).


Forgot to include a picture of the transparent enclosure... yea, it's heatshrink tube, but it will protect well against accidental shorts. I will need to practice it a bit more.
Also not sure if it will accumulate too much heat, to be tested!

Pricing for the initial run is 14 euro + shipping (4 euro) and this time PLUS paypal cost (but I consider you my friends). It will include a Y splitter cable for routing the powersupply to the adapter.
Price may change later if more is built etc.

EDIT: Initial batch sold out. Price going forward is now 15 euro with Y splitter cable.
Title: Re: USB game controllers and mice
Post by: GUNHED on 16:42, 05 April 19
This short cut protection is awesome, more often cables fall around a computer... oh well, we sometimes payed our price for this before. Shouldn't get hot IMHO.
Title: Re: USB game controllers and mice
Post by: XeNoMoRPH on 20:45, 05 April 19
Hi Duke !!!

Do you already accept orders from the usb adapter?  :o
Title: Re: USB game controllers and mice
Post by: Duke on 21:09, 05 April 19
Do you already accept orders from the usb adapter?  :o

Yes, I take orders for the first batch. Which will be 10-15 pcs, and should be ship able within the next 1-3 weeks (todo finish bootloader and initial firmware over the weekend and await female DC sockets).


So in short if you want one, send me a PM. Currently I only have Y-split power cables suitable for regular CPC, so if you have a CPC plus, you will need some sort of DC plug adapter.
It's important for the CPC that the USB adapter is powered together with the CPC (sharing same ground, which is not available on the joystick port). For other computers (except ZX +2/+3) it can be port powered or powered by seperate psu.

Picture of Y split cable I currently have, they will fit regular CPC (5.5x2.1mm plugs)
Title: Re: USB game controllers and mice
Post by: Maniac on 00:54, 06 April 19
Yes, I take orders for the first batch. Which will be 10-15 pcs, and should be ship able within the next 1-3 weeks (todo finish bootloader and initial firmware over the weekend and await female DC sockets).


So in short if you want one, send me a PM. Currently I only have Y-split power cables suitable for regular CPC, so if you have a CPC plus, you will need some sort of DC plug adapter.
It's important for the CPC that the USB adapter is powered together with the CPC (sharing same ground, which is not available on the joystick port). For other computers (except ZX +2/+3) it can be port powered or powered by seperate psu.

Picture of Y split cable I currently have, they will fit regular CPC (5.5x2.1mm plugs)
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?
Title: Re: USB game controllers and mice
Post by: Duke 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.


Title: Re: USB game controllers and mice
Post by: Maniac 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?
Title: Re: USB game controllers and mice
Post by: Duke 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/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 (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).
Title: Re: USB game controllers and mice
Post by: Duke 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 (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1308) 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
Title: Re: USB game controllers and mice
Post by: TotO 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?
Title: Re: USB game controllers and mice
Post by: Duke 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 (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 ;)
Title: Re: USB game controllers and mice
Post by: TotO 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?

(https://showmecables-static.scdn3.secure.raxcdn.com/media/catalog/product/cache/e4d64343b1bc593f1c5348fe05efa4a6/d/b/db9-hood-grey-plastic-374-9-1.jpg)
Title: Re: USB game controllers and mice
Post by: Duke 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?
Title: Re: USB game controllers and mice
Post by: Duke 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.
Title: Re: USB game controllers and mice
Post by: TotO 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
Title: Re: USB game controllers and mice
Post by: XeNoMoRPH on 15:48, 13 April 19
https://youtu.be/Ur3wE34Ghug (https://youtu.be/Ur3wE34Ghug)


What about ms input lag ?
Title: Re: USB game controllers and mice
Post by: Duke on 16:07, 13 April 19
Thanks @XeNoMoRPH (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1952)

Was going to post it here too :)

https://youtu.be/Ur3wE34Ghug (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/ (http://www.spinpoint.org/2019/04/13/imperium-solo/)  and watch the video above.

EDIT:
Button mapping is as suggested by @TotO (http://www.cpcwiki.eu/forum/index.php?action=profile;u=290) 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...
Title: Re: USB game controllers and mice
Post by: shifters74 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
Title: Re: USB game controllers and mice
Post by: XeNoMoRPH 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?

(https://i.ibb.co/fQK75yJ/photo-2019-04-14-11-41-03.png)
And .. another question ...
Is it possible to use the CPC floppy disk at the same time as the USB Adapter ?
Title: Re: USB game controllers and mice
Post by: Duke 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.

Title: Re: USB game controllers and mice
Post by: shifters74 on 15:32, 14 April 19
Does the cool device have a name???   8)
The J4??  :P
cheers
shifters

Title: Re: USB game controllers and mice
Post by: XeNoMoRPH on 16:24, 14 April 19
Does the cool device have a name???   8)
The J4??  :P
cheers
shifters
(https://i.ibb.co/ph7zqz4/cooltext321308184284857.png)
Title: Re: USB game controllers and mice
Post by: zhulien 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?
Title: Re: USB game controllers and mice
Post by: Duke 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.
Title: Re: USB game controllers and mice
Post by: Duke 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 (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.
Title: Re: USB game controllers and mice
Post by: shifters74 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!!
Title: Re: USB game controllers and mice
Post by: VincentGR on 22:00, 16 April 19
I need one for my C64, just for the mouse option.
Title: Re: USB game controllers and mice
Post by: Shining on 17:19, 17 April 19
- Will it work with 8Bitdo USB to wireless adapter ?- Are you planning a version for two joysticks ?

Title: Re: USB game controllers and mice
Post by: Duke 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 (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...
Title: Re: USB game controllers and mice
Post by: zhulien 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?
Title: Re: USB game controllers and mice
Post by: Maniac on 15:06, 18 April 19
Hi Duke,

Received my Imperium Solo this morning. Have to say I’m so impressed with this. Plugged it in to my Plus with a DualShock 3 and fired up Burnin Rubber using the triggers for accelerator and brake. Actually managed a lap and a half and felt so responsive.

Excellent stuff and highly recommended as always!

Also thank you so much for sourcing the y cable/adapter specifically for the Plus!

Kind regards
Maniac
Title: Re: USB game controllers and mice
Post by: GUNHED on 16:29, 18 April 19
WoW! This is retroactive! Means shipping goes backwards in time. Tomorrow I will order and it already arrived. The main thing is: It works really well! I just used an USB mouse for testing:


https://youtu.be/emGJvcisVsI
Title: Re: USB game controllers and mice
Post by: slugman on 02:06, 19 April 19
Received it also today  :D
Tested with a Xbox One controller, and that works great! using modern controller really improve the gameplay.  Also enjoyed playing Shufflepuck Café with a mouse  :) . Thanks Duke for this new great device!
Title: Re: USB game controllers and mice
Post by: George Schizas on 14:16, 19 April 19
Damn it, I was so close to making something similar by using a Raspberry Pi (obviously when the adapter has more processing power than the computer, I was doing something wrong  :)  - but I intended to do this as a prototype)


I'll be PM'ing for the next batch.
Title: Re: USB game controllers and mice
Post by: Bruce101 on 14:56, 19 April 19
Hi Duke!
First of all congratulations for the good work!!!
Im a CPC enthusiats from 1986, with a CPC464 still working... I bought your WIFI / SD M4 board some time ago (maybe 2 or 3 years... I don´t remember) its a cool stuff!!!
Im interested on two usb adapters for regular CPC, is it still possible to buy them?
Thanks in advance!!!
Title: Re: USB game controllers and mice
Post by: Maniac on 15:23, 19 April 19
Having stayed up late playing with this last night I’ve just had thought of an idea.

If at all possible it would be really cool if the planned button mapping feature could support button sequences. For example a jump, followed by a direction then maybe something else. Would be v useful in Navy Seals for example where some of the moves are tricky to do every time!
Title: Re: USB game controllers and mice
Post by: Duke on 15:24, 19 April 19

Hi Duke!
First of all congratulations for the good work!!!
Im a CPC enthusiats from 1986, with a CPC464 still working... I bought your WIFI / SD M4 board some time ago (maybe 2 or 3 years... I don´t remember) its a cool stuff!!!
Im interested on two usb adapters for regular CPC, is it still possible to buy them?
Thanks in advance!!!

Thanks. Yes it's possible to buy them. Currently there is a lead time of some weeks.

Ordering procedure:
Send me a PM (with your email address) or an email and let me know what you need and for which computer, then I  will confirm and add you to my list.
And when it is ready, I will email you with Paypal details and ask for your shipping address.

Current pricing is:
Imperium Solo with DC Y splitter cable for regular CPC, 15 euro
Imperium Solo with DC Y splitter cable and adapter for CPC plus, 16 euro
Shipping worldwide (unregistered) up to 100 grams, 4 euro
+ Paypal fee which is 1 euro or pay as friend (but you loose the ability to make a claim to Paypal afaik. if you are not happy with the product etc, so up to you!)
Title: Re: USB game controllers and mice
Post by: Duke on 15:25, 19 April 19
Having stayed up late playing with this last night I’ve just had thought of an idea.

If at all possible it would be really cool if the planned button mapping feature could support button sequences. For example a jump, followed by a direction then maybe something else. Would be v useful in Navy Seals for example where some of the moves are tricky to do every time!
Not impossible...Record sequence, Playback.
Title: Re: USB game controllers and mice
Post by: Bruce101 on 15:52, 19 April 19
Hi Duke!
You have an MP (and an email by mistake, are the same, sorry).
Title: Re: USB game controllers and mice
Post by: zhulien on 08:29, 21 April 19
Hi Duke, I am interested in this more from the mouse support point of view, how is the mouse support currently? is it there or coming soon?
Title: Re: USB game controllers and mice
Post by: Duke on 11:26, 21 April 19
Hi Duke, I am interested in this more from the mouse support point of view, how is the mouse support currently? is it there or coming soon?
Mouses are supported, but only as AMX mouse. I guess it's just as good or crap as existing interfaces, maybe someone who has both can tell. As I don't have AMX or  Bryce PS/2 interface.
My custom proportional  mode is not added to the release firmware, as there is no point since no software supports it.
Title: Re: USB game controllers and mice
Post by: VincentGR on 18:33, 21 April 19
As I think the mouse is working like that because the lacks of analog input, right?
What about the plus machines?
I think it has an analog port  :-X
Title: Re: USB game controllers and mice
Post by: Duke on 22:56, 21 April 19
As I think the mouse is working like that because the lacks of analog input, right?
It only works like that because its how software is reading AMX mouse (as a joystick).
Proportional mouse support is easily possible through the digital port, just not with the current software support (patches needed).
Title: Re: USB game controllers and mice
Post by: LambdaMikel on 03:40, 22 April 19
It only works like that because its how software is reading AMX mouse (as a joystick).
Proportional mouse support is easily possible through the digital port, just not with the current software support (patches needed).
I'd be interested in getting one when the next software version is out  :)
Title: Re: USB game controllers and mice
Post by: XeNoMoRPH on 16:42, 22 April 19
adapter received:

This Chinese mouse is not detected:

(https://i.ibb.co/JqScKzB/photo-2019-04-14-11-41-03.png)

On my Logitech G5 mouse , symbos detects the movement of the mouse but not the buttons:

and this other wireless works fine with symbos but with lag

(https://i.ibb.co/8YhhMKY/photo-2019-04-22-15-29-25.png)

and this other snes usb chinese works fine too

(https://images-na.ssl-images-amazon.com/images/I/41XIbCHirYL._SX342_.jpg)

Title: Re: USB game controllers and mice
Post by: Duke on 19:45, 22 April 19

This Chinese mouse is not detected:

On my Logitech G5 mouse , symbos detects the movement of the mouse but not the buttons
and this other wireless works fine with symbos but with lag
Thanks for the feedback.

If you have a linux PC, could you please try to use usbhid-dump and send me the reports, then I can add/fix your mice.
It's done like this:
sudo usbhid-dump | grep -v : | xxd -r -p | hidrd-convert -o spec >report_for_duke.txt

If you only have windows, you can use trial version of USBLyzer. But I cannot remember the steps needed and my trial has expired. Will try to install it on another windows PC soon and note the needed steps to dump the USB HID report descriptor, which is what I need.
Title: Re: USB game controllers and mice
Post by: XeNoMoRPH on 20:47, 22 April 19
Thanks for the feedback.

If you have a linux PC, could you please try to use usbhid-dump and send me the reports, then I can add/fix your mice.
It's done like this:
sudo usbhid-dump | grep -v : | xxd -r -p | hidrd-convert -o spec >report_for_duke.txt

If you only have windows, you can use trial version of USBLyzer. But I cannot remember the steps needed and my trial has expired. Will try to install it on another windows PC soon and note the needed steps to dump the USB HID report descriptor, which is what I need.
ok , i will try  :D thx
Title: Re: USB game controllers and mice
Post by: Maniac on 22:13, 22 April 19
Just had a chance to try out a Microsoft IntelliMouse Optical and although it lights up the Imperial Solo doesn’t seem to provide any output.

(https://uploads.tapatalk-cdn.com/20190422/7db98926a6583576e51079cd8e9fa51e.jpg)


The mouse is PS/2 compatible and has the following USB HID information:



Device Descriptor
 USB version: 1.10
 Device class: 0x0 - (Defined at Interface level)
 Device subclass: 0x0 - Unknown
 Device protocol: 0x0 - Unknown
 Control pipe max size: 8 bytes
 Vendor ID: 0x45e (Microsoft Corp.)
 Product ID: 0x39 (IntelliMouse Optical)
 Product version: 1.21
 Manufacturer: Microsoft
 Product: Microsoft IntelliMouse® Optical
 Serial Number: Not specified
 Configurations: 1


descriptors[0] = "Configuration Descriptor"
bLength = 9
bDescriptorType = USB_CONFIGURATION_DESCRIPTOR_TYPE (2)
wTotalLength = 34
bNumInterfaces = 1
bConfigurationValue = 1
iConfiguration = 0
Reserved = 0
SupportsRemoteWakeup = 1
SelfPowered = 0
PoweredByBus = 1
MaxPower = 0x32 -> 100 mA
descriptors[1] = "Interface Descriptor"
bLength = 9
bDescriptorType = USB_INTERFACE_DESCRIPTOR_TYPE (4)
bInterfaceNumber = 0
bAlternateSetting = 0
bNumEndpoints = 1
bInterfaceClass = UsbHID (3)
bInterfaceSubClass = 1
bInterfaceProtocol = 2
iInterface = 0
descriptors[2] = "HID Descriptor"
bLength = 9
bDescriptorType = HID_HID_DESCRIPTOR_TYPE (33)
bcdHID = 1.00
bCountry = NotDefined (0)
bNumDescriptors = 1
reports = 
 reports[0] = 
  bReportType = 34
  wReportLength = 72
  raw =  7, 5, 129, 3, 4… 

HID Descriptor
Usage Page: 1 (Generic Desktop Controls)
Usage: 2 (Mouse)
Collection
Usage: 1 (Pointer)
Collection
Usage Page: 9 (Buttons)
Usages (1-5): Button 1 (Primary), Button 2 (Secondary), Button 3 (Tertiary), Button 4, Button 5
Logical Minimum: 0
Logical Maximum: 1
Report Size: 1
Report Count: 5
Input: 2 (Data,Variable,Absolute,No Wrap,Linear,Preferred State,No Null Position)
Report Size: 3
Report Count: 1
Input: 1 (Constant,Array,Absolute,No Wrap,Linear,Preferred State,No Null Position)
Usage Page: 1 (Generic Desktop Controls)
Usage: 48 (Direction-X)
Usage: 49 (Direction-Y)
Usage: 56 (Wheel)
Logical Minimum: -127
Logical Maximum: 127
Report Size: 8
Report Count: 3
Input: 6 (Data,Variable,Relative,No Wrap,Linear,Preferred State,No Null Position)
End Collection
Usage Page: 255 (Vendor Specific)
Usage: 2 (Unknown)
Logical Minimum: 0
Logical Maximum: 1
Report Size: 1
Report Count: 1
Feature: 34 (Data,Variable,Absolute,No Wrap,Linear,No Preferred State,No Null Position)
Report Size: 7
Report Count: 1
Feature: 1 (Constant,Array,Absolute,No Wrap,Linear,Preferred State,No Null Position)
End Collection
Title: Re: USB game controllers and mice
Post by: XeNoMoRPH on 23:09, 22 April 19
Hi again Duke !!! , here are these two files with the information you ask me ,  these are the 2 usb mouse that I can not work properly
with USBlyzer

https://1fichier.com/?nxqylz7of98wsixoo9nr (https://1fichier.com/?nxqylz7of98wsixoo9nr)
https://1fichier.com/?jtgayabpz73jw841rnw2 (https://1fichier.com/?jtgayabpz73jw841rnw2)
Title: Re: USB game controllers and mice
Post by: Maniac on 02:23, 23 April 19
Thanks for the feedback.

If you have a linux PC, could you please try to use usbhid-dump and send me the reports, then I can add/fix your mice.
It's done like this:
sudo usbhid-dump | grep -v : | xxd -r -p | hidrd-convert -o spec >report_for_duke.txt

If you only have windows, you can use trial version of USBLyzer. But I cannot remember the steps needed and my trial has expired. Will try to install it on another windows PC soon and note the needed steps to dump the USB HID report descriptor, which is what I need.



I've managed to find an alternative to USBLyzer which I believe pulls out this information in Windows and remains free Free USB Analyzer Overview (https://freeusbanalyzer.com/)
Title: Re: USB game controllers and mice
Post by: Duke on 10:27, 23 April 19
Just had a chance to try out a Microsoft IntelliMouse Optical and although it lights up the Imperial Solo doesn’t seem to provide any output.
Thanks for the report.
Checking it with my HID parser, it seems without issue.
Please notice the LED on the Imperium Solo.
When no USB device detected, it flashes: 
1 second on, 1 second off ...
When a USB device is detected it flashes:
half a second on, half a second off ...

Hi again Duke !!! , here are these two files with the information you ask me ,  these are the 2 usb mouse that I can not work properly
with USBlyzer

https://1fichier.com/?nxqylz7of98wsixoo9nr (https://1fichier.com/?nxqylz7of98wsixoo9nr)
https://1fichier.com/?jtgayabpz73jw841rnw2 (https://1fichier.com/?jtgayabpz73jw841rnw2)
Thanks for the reports. However it seems they are identical and also passes my HID parser just fine. I wonder if this is the "main" mouse you have connected to your PC and not the report descriptor of the two troublesome mice?
Also please notice LED behaviour aswell.

I've managed to find an alternative to USBLyzer which I believe pulls out this information in Windows and remains free Free USB Analyzer Overview (https://freeusbanalyzer.com/ (https://freeusbanalyzer.com/))
Good find, thanks !
Title: USB game controllers and mice
Post by: Maniac on 11:13, 23 April 19
Thanks for the report.
Checking it with my HID parser, it seems without issue.
Please notice the LED on the Imperium Solo.
When no USB device detected, it flashes: 
1 second on, 1 second off ...
When a USB device is detected it flashes:
half a second on, half a second off ...
I’ve just checked and can confirm that both the DualShock 3 and MS IntelliMouse cause USB device detection with half a second on/half off. However only the DualShock generates any output on screen. The mouse doesn’t generate anything even from the buttons I’m afraid.

Power cycled the Imperium Solo and no difference. Although one time when I plugged the mouse in after the DualShock it didn’t detect it. Power cycling sorted that though.

P.S. DualShock on Art Studio is very responsive but probably wouldn’t want to use it for drawing!!
Title: Re: USB game controllers and mice
Post by: Duke on 20:20, 23 April 19
Imperium Solo firmware update v1.0.1
Changes:
Download:
https://www.spinpoint.org/files/ImperiumSolo_Amstrad_v101.zip (https://www.spinpoint.org/files/ImperiumSolo_Amstrad_v101.zip)

Instructions:
Unpack the file IMPERSOL.BIN to root directory of a USB stick (FAT32).
Insert it to Imperium Solo USB port and power it on. LED will be on shortly and once it starts flashing (few seconds later) firmware is updated.
Remove USB stick and insert mouse/gamepad.
File will be deleted from USB stick if succesful.
Title: Re: USB game controllers and mice
Post by: slugman on 22:32, 23 April 19
Hi Duke!
I flashed my imperium Solo with the update and it works now perfectly with MS branded mouses.  I tested successfully following Microsoft models:
.Intellimouse Explorer 3.0
.Notebook Optical Mouse
.Optical Mouse by Starck.
.Wheel Mouse Optical
.Optical Mouse blue
.Arc Touch Mouse
Probably all Microsoft models are now supported
(https://i.ibb.co/z4wWsWs/IMG-20190423-205141.jpg) (https://ibb.co/DRnP4P4)
Title: Re: USB game controllers and mice
Post by: XeNoMoRPH on 22:43, 23 April 19
Thanks for the reports. However it seems they are identical and also passes my HID parser just fine. I wonder if this is the "main" mouse you have connected to your PC and not the report descriptor of the two troublesome mice?
Also please notice LED behaviour aswell.
Good find, thanks !
Hi Again !!! duke , this two report are about my main mouse yes ... and the other mouse that I would like to work with symbos

Title: Re: USB game controllers and mice
Post by: Maniac on 01:07, 24 April 19

Imperium Solo firmware update v1.0.1
Changes:
Fix issue with MS mice (@Maniac)
Download:
https://www.spinpoint.org/files/ImperiumSolo_Amstrad_v101.zip (https://www.spinpoint.org/files/ImperiumSolo_Amstrad_v101.zip)
Instructions:
Unpack the file IMPERSOL.BIN to root directory of a USB stick (FAT32).
Insert it to Imperium Solo USB port and power it on. LED will be on shortly and once it starts flashing (few seconds later) firmware is updated.
Remove USB stick and insert mouse/gamepad.
File will be deleted from USB stick if succesful.
Worked a treat and the mouse now provides output. Thank you so much as always. Mouse however doesn't seem to work very well which is not down to the Imperium Solo as you will see below.
Mouses are supported, but only as AMX mouse. I guess it's just as good or crap as existing interfaces, maybe someone who has both can tell. As I don't have AMX or  Bryce PS/2 interface.
My custom proportional  mode is not added to the release firmware, as there is no point since no software supports it.
Now that the mouse support is working I've managed to put a quick and dirty comparison video together using Advanced Art Studio as the test bed. I have an AMX mouse for my Plus which I hooked up and then did the same with the Imperium Solo and a number of USB devices. The Microsoft IntelliMouse is the worst of the lot! Hope this is useful to someone as a guide!
https://youtu.be/XLJWFB7dCBQ (https://youtu.be/XLJWFB7dCBQ)
Title: Re: USB game controllers and mice
Post by: Duke on 01:57, 24 April 19

I flashed my imperium Solo with the update and it works now perfectly with MS branded mouses.  I tested successfully following Microsoft models:

Cool! Thanks for checking all those. Will see to add some "database" over tested mice & joypads.
this two report are about my main mouse yes ... and the other mouse that I would like to work with symbos
Ok, but both reports are the same, so some mistake must have happened:
File from https://1fichier.com/?nxqylz7of98wsixoo9nr (https://1fichier.com/?nxqylz7of98wsixoo9nr) is the same as https://1fichier.com/?jtgayabpz73jw841rnw2 (https://1fichier.com/?jtgayabpz73jw841rnw2).
Can you try to email me the correct reports (the 1fichier is very annoying as you have to wait 1 hour to download the next one). Thanks.

Now that the mouse support is working I've managed to put a quick and dirty comparison video together using Advanced Art Studio as the test bed. I have an AMX mouse for my Plus which I hooked up and then did the same with the Imperium Solo and a number of USB devices. The Microsoft IntelliMouse is the worst of the lot! Hope this is useful to someone as a guide!
Thanks for the video, very nice to have a comparison with the original AMX mouse.
Title: Re: USB game controllers and mice
Post by: GUNHED on 03:10, 25 April 19
Mouses are supported, but only as AMX mouse. I guess it's just as good or crap as existing interfaces, maybe someone who has both can tell. As I don't have AMX or  Bryce PS/2 interface.
My custom proportional  mode is not added to the release firmware, as there is no point since no software supports it.


You could use a proportional mode, being compatible to the AtariST mouse adapter for the CPC (see Wiki). There is some software for it, including G-Paint, IMHO even better than OCP Art Studio.  :)
Title: Re: USB game controllers and mice
Post by: Duke on 23:32, 25 April 19

I put together a small info site for Imperium Solo here:
https://www.spinpoint.org/imperium/ (https://www.spinpoint.org/imperium/)

And made the database I mentioned earlier, directly accessible here:
https://www.spinpoint.org/imperium/database.php (https://www.spinpoint.org/imperium/database.php)

Thanks to @Maniac (http://www.cpcwiki.eu/forum/index.php?action=profile;u=930), @slugman (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1808) and @XeNoMoRPH (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1952) for providing feedback. I used some of your info (and pictures) to fill into the database.
Any feedback on USB devices tested will be much appreciated, so I can enter into the database and also make fixes if not working or the button mapping is not as desired etc.
Of course the idea is that the database will help other users find what is a good mouse / controller.

Please provide "make and model" + vendor id (vid) and product id (pid) and any useful notes.
THANKS!

If your USB device is not working at all, as mentioned earlier in this thread, USB HID reports are needed.


You could use a proportional mode, being compatible to the AtariST mouse adapter for the CPC (see Wiki). There is some software for it, including G-Paint, IMHO even better than OCP Art Studio.  :)
Yes I know I know... It's just my mode is better :)
Title: Re: USB game controllers and mice
Post by: Maniac on 23:44, 25 April 19
Thanks to @Maniac (http://www.cpcwiki.eu/forum/index.php?action=profile;u=930), @slugman (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1808) and @XeNoMoRPH (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1952) for providing feedback. I used some of your info (and pictures) to fill into the database.
Any feedback on USB devices tested will be much appreciated, so I can enter into the database and also make fixes if not working or the button mapping is not as desired etc.
Please provide "make and model" + vendor id (vid) and product id (pid) and any useful notes.
THANKS!
You’re most welcome. Least I could do after your contribution to the community!

One suggestion I’d like to make if I may; would it be possible to configure the speed of input per device? For instance the MS IntelliMouse is not quick in Windows until you adjust the settings so if something similar were configurable on the Imperium Solo that would great.
Title: Re: USB game controllers and mice
Post by: MiguelSky on 02:03, 26 April 19
Hi, Duke! I received my adapter, it works great with my PS4 controller. I have an old Trust Predator gamepad for PS2 that I usually use with my PC, but it doesn't work. I join the report.
Title: Re: USB game controllers and mice
Post by: Duke on 11:26, 26 April 19
One suggestion I’d like to make if I may; would it be possible to configure the speed of input per device? For instance the MS IntelliMouse is not quick in Windows until you adjust the settings so if something similar were configurable on the Imperium Solo that would great.
Unfortunately, the general problem is that mouses are too slow using the generic mouse as joystick method.
In software it is easy to change sensitivity, but I cannot do much from the hardware side without using variable data (ie. my 5 bit mode, where you could add a multiplier in the hardware to increase sensitivity/speed).
 Right now I can only set signals UP/DOWN/LEFT/RIGHT and let the software interpret it.
I can do some smoothing and keep the signal a little longer than it actually is, but nothing that will speed it up significantly in current software.

Hi, Duke! I received my adapter, it works great with my PS4 controller. I have an old Trust Predator gamepad for PS2 that I usually use with my PC, but it doesn't work. I join the report.
Thanks. But I think the HID reports are for your mouse and not the Predator gamepad. Please select correct device and dump it again.
Title: Re: USB game controllers and mice
Post by: MiguelSky on 12:50, 26 April 19
Thanks. But I think the HID reports are for your mouse and not the Predator gamepad. Please select correct device and dump it again.
You're right! Sorry, I chose the wrong device. I join the proper one now.
Title: Re: USB game controllers and mice
Post by: GUNHED on 16:15, 27 April 19
Yes I know I know... It's just my mode is better :)
Well, I'm pretty positive that PDT and me will support it in our projects.  :)


Of course it would be somehow a good thing to be able to "sense" if the device at the joystick port works as joystick or as proportional device.
Title: Re: USB game controllers and mice
Post by: Duke on 07:07, 28 April 19

Imperium Solo - Amstrad firmware v1.0.3 (https://www.spinpoint.org/files/ImperiumSolo_Amstrad_v103.zip)
Title: Re: USB game controllers and mice
Post by: Duke on 12:23, 28 April 19
Well, I'm pretty positive that PDT and me will support it in our projects.  :)


Of course it would be somehow a good thing to be able to "sense" if the device at the joystick port works as joystick or as proportional device.

Sounds good :)

Was just having a play with entering and leaving enhanced mode (+/- 5 bit delta mode) and this seems to work well.

1. send 2xkeyscans for joystick x row, after each other to clear a comparator counter in Imperium Solo.
2. wait 3-4 ms, send keyscan for joystick x row.
3. wait 3-4 ms, send keyscan for joystick x row.
4. wait 6-7 ms, send keyscan for joystick x row.
5. wait 6-7 ms, send keyscan for joystick x row.
Return value of the read is now "JOY_UP | JOY_DOWN | JOY_LEFT | JOY_RIGHT" meaning it entered enhanced mode. (0xF0)

Repeating the sequence will return it to regular "AMX/Joystick"-mode, only the return value is different (no keys pressed, 0xFF).

Any wrong doing in the sequence, will reset an internal counter and it has to be started from 1. So accidental sequence should be very unlikely.

So that should work pretty well for enabling and detection ?
Title: Re: USB game controllers and mice
Post by: GUNHED on 20:02, 28 April 19
That's a good way to do it! Just to be sure, you're talking about milli seconds, (not micro seconds), right?
Title: Re: USB game controllers and mice
Post by: Duke on 19:53, 05 May 19
Imperium Solo firmware update v1.0.4
Changes:
Big thanks to Roxe for testing and reporting.

Download:

https://www.spinpoint.org/files/ImperiumSolo_Amstrad_v104.zip (https://www.spinpoint.org/files/ImperiumSolo_Amstrad_v104.zip)

Instructions:
Unpack the file IMPERSOL.BIN to root directory of a USB stick (FAT32).
Insert it to Imperium Solo USB port and power it on. LED will be on shortly and once it starts flashing (few seconds later) firmware is updated.
Remove USB stick and insert mouse/gamepad.
File will be deleted from USB stick if succesful.

--------------------------------------------
As mentioned earlier the wireless iNNEXT USB controller, I bought from ebay here: https://www.ebay.com/itm/Wireless-USB-SNES-Retro-Controller-Gamepad-for-PC-MAC-Raspberry-Pi-US-SHIP/153413332769 (https://www.ebay.com/itm/Wireless-USB-SNES-Retro-Controller-Gamepad-for-PC-MAC-Raspberry-Pi-US-SHIP/153413332769)
- It's a very slick solution for CPC I think, if you want to get rid of the wires, has a nice long reach too and I did not notice any lag playing Fruity Frank (fast mode) :)

That's a good way to do it! Just to be sure, you're talking about milli seconds, (not micro seconds), right?
Yes milli-seconds - just use halts. Will add it soon.