No0ne / ps2x2pico

USB keyboard/mouse to PS/2 interface converter using a Raspberry Pi Pico
MIT License
196 stars 35 forks source link

Inverted Y-Axis #3

Closed anderssonbilly closed 1 week ago

anderssonbilly commented 1 year ago

Hi.

Just finished building the adapter and it all works great except I got some issues with the mouse. My test system is a Pentium III WinME computer and a Razor DeathAdder USB mouse. The keyboard works fine, but the mouse Y-Axis is inverted.

No0ne commented 1 year ago

Only the Y-Axis is inverted and everything else is correct? Will address the "Mouse Issues #1" first and afterwards add DIP-switches or jumpers for inverting axis.

anderssonbilly commented 1 year ago

With the mouse, yes, only the Y-Axis is inverted other than that it works great. A DIP-switch to invert the axis could be really useful in some DOS games. Curious thou why my mouse is inverted.

If there is anything I could do to help troubleshoot just tell me.

serisman commented 1 year ago

Just turn the mouse upside down! j/k

I assume you have tested a different mouse already? It not, might be wise to do that test to ensure it is only this mouse that is inverted and not some other issue with your setup.

For additional troubleshooting, you could hook up a USB-to-TTL serial adapter to GP0/GP1 and attach some of the debug logs that it produces. That way we could try and confirm if the mouse is actually sending standards compliant data reports or not. Its possible the mouse is doing something non-standard that could be taken into account. (I think I saw some other users mention similar inverted mouse issues with the same Razor mouse elsewhere on the internet) Or, its possible that the USB-to-PS2 code still has some bugs in it. For example, I was eyeing some of the translation logic that uses addition and wondering if it would be safer to use bit manipulation instead.

anderssonbilly commented 1 year ago
HID Interface Protocol = Mouse
00 00 00 00
00 00 00 00
00 01 01 00
00 00 01 00
00 00 01 00
00 00 01 00
00 00 01 00
00 00 01 00
00 00 02 00
00 00 01 00
00 00 01 00
00 fd 02 00
00 00 01 00
00 00 01 00
00 ff 02 00
00 00 01 00
00 ff 02 00
00 00 01 00
00 00 01 00
00 00 02 00
00 00 01 00
00 00 01 00
00 00 01 00
00 ff 02 00
00 fe 01 00
00 00 01 00
00 00 01 00
00 ff 02 00
00 00 01 00
00 00 01 00
00 00 02 00
00 00 02 00
00 00 01 00
00 ff 01 00
00 00 02 00
00 00 02 00
00 ff 02 00
00 00 01 00
00 00 04 00
00 00 01 00
00 00 02 00
00 00 02 00
00 ff 02 00
00 00 02 00
00 00 02 00
00 02 02 00
00 01 01 00
00 00 03 00
00 00 02 00
00 00 02 00
00 00 02 00
00 00 02 00
00 00 02 00
00 00 03 00
00 00 02 00
00 00 02 00
00 00 02 00
00 00 02 00
00 00 02 00
00 00 02 00
00 00 02 00
00 00 01 00
00 00 02 00
00 00 02 00
00 00 02 00
00 00 01 00
00 00 01 00
00 00 02 00
00 fd 01 00
00 00 01 00
00 00 01 00
00 00 01 00
00 ff 00 00
00 00 fd 00
00 00 ff 00
00 00 ff 00
00 00 ff 00
00 00 ff 00
00 00 ff 00
00 00 ff 00
00 00 fe 00
00 00 fe 00
00 00 ff 00
00 00 ff 00
00 00 fe 00
00 00 ff 00
00 02 fe 00
00 00 fe 00
00 01 ff 00
00 00 ff 00
00 00 fe 00
00 01 ff 00
00 00 ff 00
00 00 ff 00
00 00 fe 00
00 00 ff 00
00 00 ff 00
00 00 ff 00
00 00 ff 00
00 01 fe 00
00 00 ff 00
00 00 ff 00
00 00 ff 00
00 01 ff 00
00 00 fe 00
00 00 ff 00
00 00 ff 00
00 01 00 00
00 00 fe 00
00 00 ff 00
00 00 ff 00
00 01 fe 00
00 00 ff 00
00 00 ff 00
00 00 ff 00
00 00 ff 00
00 00 ff 00
00 00 ff 00
00 00 ff 00
00 00 ff 00
00 00 ff 00
00 00 ff 00
00 00 ff 00
00 00 ff 00
00 01 ff 00
00 00 fe 00
00 00 ff 00
00 01 fe 00
00 00 ff 00
00 00 ff 00
00 01 fe 00
00 00 fe 00
00 00 ff 00
00 01 fe 00
00 00 fe 00
00 00 fe 00
00 00 fe 00
00 00 ff 00
00 01 fe 00
00 00 fe 00
00 01 fe 00
00 00 fe 00
00 00 fe 00
00 01 ff 00
00 00 fe 00
00 00 ff 00
00 02 fe 00
00 00 ff 00
00 00 ff 00
00 00 fe 00
00 00 ff 00
00 00 ff 00
00 00 fe 00
00 00 ff 00
00 00 fe 00
00 00 ff 00
00 00 ff 00
00 00 fe 00
00 00 ff 00
00 01 fe 00
00 00 fe 00
00 00 ff 00
00 01 fe 00
00 00 ff 00
00 00 fe 00
00 01 ff 00
00 00 fe 00
00 00 ff 00
00 01 fe 00
00 00 ff 00
00 00 ff 00
00 00 fe 00
00 00 fe 00
00 00 ff 00
00 01 ff 00
00 00 ff 00
00 00 fe 00
00 00 ff 00
00 00 ff 00
00 00 ff 00
00 00 ff 00
00 fd 00 00
00 ff 00 00
00 ff 00 00
00 ff 00 00
00 ff 00 00
00 ff 00 00
00 ff 00 00
00 ff 00 00
00 ff 00 00
00 ff 00 00
00 ff 00 00
00 ff 00 00
00 02 00 00
00 01 00 00
00 01 00 00
00 02 00 00
00 01 00 00
00 01 00 00
00 01 00 00
00 04 00 00
00 00 02 00
00 01 00 00
00 01 00 00
00 01 01 00
00 01 00 00
00 02 00 00
00 01 00 00
00 00 01 00
00 01 00 00
00 01 00 00
00 00 01 00
00 02 00 00
00 01 01 00
00 01 00 00
00 01 01 00
00 02 01 00
00 01 00 00
00 01 00 00
00 01 01 00
00 01 01 00
00 01 01 00
00 02 00 00
00 01 01 00
00 01 00 00
00 02 01 00
00 02 00 00
00 00 01 00
00 02 00 00
00 01 01 00
00 02 01 00
00 01 01 00
00 03 01 00
00 00 01 00
00 02 01 00
00 02 01 00
00 01 01 00
00 02 00 00
00 02 01 00
00 00 01 00
00 03 01 00
00 02 01 00
00 02 00 00
00 02 01 00
00 02 01 00
00 02 01 00
00 01 01 00
00 02 00 00
00 02 01 00
00 02 01 00
00 02 01 00
00 01 00 00
00 00 01 00
00 02 01 00
00 02 00 00
00 01 01 00
00 02 00 00
00 02 01 00
00 00 01 00
00 03 00 00
00 01 00 00
00 01 01 00
00 02 01 00
00 01 00 00
00 01 00 00
00 00 01 00
00 02 00 00
00 01 01 00
00 02 00 00
00 01 00 00
00 02 01 00
00 01 00 00
00 01 00 00
00 02 01 00
00 01 00 00
00 00 01 00
00 01 00 00
00 00 01 00
00 02 00 00
00 01 01 00
00 01 00 00
00 01 00 00
00 01 00 00
00 01 01 00
00 01 01 00
00 01 00 00
00 01 00 00
00 00 01 00
00 01 00 00
00 01 00 00
00 01 00 00
00 00 01 00
00 00 01 00
00 01 00 00
00 01 00 00
00 01 01 00
00 01 00 00
00 01 00 00
00 00 01 00
00 00 01 00
00 02 00 00
00 01 01 00
00 01 00 00
00 00 01 00
00 01 00 00
00 01 00 00
00 01 01 00
00 01 00 00
00 01 00 00
00 00 01 00
00 01 01 00
00 01 00 00
00 01 01 00
00 01 00 00
00 00 01 00
00 01 00 00
00 01 00 00
00 01 00 00
00 01 00 00
00 00 01 00
00 01 00 00    

Here I got some data from my Razor mouse. I moved up then down, left and right.

Sorry for no newline, how do I markdown that in github? Thought it was four spaces.

serisman commented 1 year ago

Sorry for no newline, how do I markdown that in github? Thought it was four spaces.

Triple backticks

https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks

Also, that block looks like it is missing some of the debug info. Which branch are you on?

anderssonbilly commented 1 year ago

I used the latest release but I'll try to compile latest my self and report the result as soon as I got some time over. Having issues compiling on this machine. If you can upload a compiled file that puts out more debugging info I could try again and post the logs.

No0ne commented 1 year ago

@serisman The additional info is missing because the mouse port was not in streaming mode.

No0ne commented 1 year ago

hm @anderssonbilly your mouse is indeed reporting the y-axis inverted 🤔 here is mine:

UP
00 00 ff 00
00 00 ff 00
00 00 fe 00
00 01 ff 00
00 00 ff 00
00 00 ff 00
00 00 fe 00
00 00 ff 00
00 00 ff 00
00 00 ff 00
00 00 ff 00
00 01 ff 00
00 00 ff 00
DOWN
00 00 01 00
00 00 01 00
00 00 02 00
00 00 02 00
00 00 02 00
00 01 03 00
00 01 03 00
00 01 03 00
00 00 03 00
00 01 04 00
00 00 04 00
00 01 04 00
00 00 04 00
00 01 04 00
00 01 03 00
00 00 02 00
LEFT
00 fd 00 00
00 fd 00 00
00 fd 00 00
00 fd 00 00
00 fe 00 00
00 fe 00 00
00 fe 00 00
00 fe 00 00
00 fe 00 00
00 fe 00 00
00 ff 00 00
00 ff 00 00
RIGHT
00 01 00 00
00 01 00 00
00 01 00 00
00 02 01 00
00 02 00 00
00 02 00 00
00 02 01 00
00 02 00 00
00 02 00 00
00 03 01 00
00 03 00 00
00 03 01 00
00 03 00 00
00 04 01 00
00 03 00 00
00 03 01 00
00 03 00 00
00 04 01 00
00 03 00 00
No0ne commented 1 year ago

@anderssonbilly sorry for the delay (have no permissions to send PMs on vogons) I'm currently out of time, may be I'll continue work in spring or summer. You could also look into https://github.com/rasteri/HIDman which made good progress I think.

No0ne commented 9 months ago

Please try the fork by anteo which runs the mouse in report mode. I will likely do report mode in my repo too.

No0ne commented 8 months ago

Recently I came across a Razor which also had inverted Y-Axis in the BIOS. So I will be testing with that soon.

anderssonbilly commented 7 months ago

@No0ne sorry for the late reply, have had way to little time for hobby projects latley. Did you get anywhere with the Razor mouse?

No0ne commented 7 months ago

Sorry no, didn't have time atm. Could you test with the fork by anteo?

anderssonbilly commented 7 months ago

Link seems to be dead. Do you have a backup?

No0ne commented 7 months ago

Fork seems to be gone 🤨

No0ne commented 1 week ago

Also got a Razer DeathAdder Model RZ01-03850 but I can't reproduce the problem with the recent version 0.9-1.1! Maybe the TinyUSB library upgrade fixed the problem.