While working on my USB/PSX joystick controller project I noticed that a) Windows isn’t very tolerant of some things and doesn’t care about other stuff, and b) MAME was giving some weird results.
In the end, the Windows thing came down to needed to pad out the reports the microprocessor was sending back to a multiple of 8 bits. It seems that Windows can’t cope with not being told what to do with unused bits in a byte, so you specifically have to mark them as usage type “undefined” to keep it happy. E.g. if you have 12 buttons, one bit each resulting in sending a two byte report you have to mark the unused 4 bits in the second byte as undefined. Linux and MacOS seem to be more tolerant. Maybe it’s just the existential quandary Windows is trapped in, forced to ask “why?” and so unable to cope with not knowing what those extra bits to.
Or, it’s just slack programming.
I’m thinking the latter. Windows copes quite well with other problems in the HID descriptor, like forgetting to change collection or usage page which was causing MAME to give the fire buttons funny names. It still insists on number buttons from zero, but that seems to be normal behaviour as it happens with all USB devices. In that sense USB is a minefield of off-by-one errors, because you count bits from 0 yet need to number your buttons starting at 1, and indeed Windows shows them in the control panel applet starting at 1. Unfortunately the official HID descriptor tool validates these kinds of errors so it’s easy not to notice them.
PS. I will update the site soon with new schematics (true 3.6V signalling instead of the old 5V stuff) and firmware.