http://bugs.winehq.org/show_bug.cgi?id=18424
--- Comment #73 from david.dljunk@gmail.com 2013-01-30 05:13:25 CST --- (In reply to comment #64)
I have also done next to no high level Mac OS X (or other OS) programming. My regular programming consists of working on linkers, dynamic instrumentation tools and compiler components.
But it's really not that hard. For the Mac OS X HID stuff, look at the HID Calibrator stuff I mentioned in comment 39, the HID headers (/System/Library/Frameworks/IOKit.framework/Headers/hid and .../hidsystem) and the existing code in joystick_osx.c. I also found the USB HID documentation useful for background information: http://www.usb.org/developers/devclass_docs/Hut1_11.pdf
The Linux DirectInput code is in joystick_linuxinpuc.c, the winmm code in joystick_linux.c. The code in both files seemed fairly similar at first sight. In fact, at first I had no idea why both were present and while searching for their purpose I found a thread on wine-devel where someone proposed merging them (but that was deemed to be not that easy because of the differences in models between winmm and dinput).
In any case, by putting linux_joystick.c and linux_joystickinput.c side by side, and joystick_osx.c next to that, I don't think it should be that hard to create a Mac OS X version for winmm. I don't have any games that require that though, and even if I had I currently don't really have time for it either.
...I've also checked a few other (dinput) titles with wine-1.3.23 and whereas they didn't have joystick input before, now they do .. so that's a good win...
Good!
I'm probably totally off-base since I have even less experience. :) But from my limited understanding of the code, it would seem to be that joystick_osx and joystick_linux are the corollaries of each other and that they are both for dinput. I cannot see why one would be for dinput and the other winmm - however, joystick_linuxinput seems to talk with effect_linuxinput and implements force-feedback joysticks for linux.
Is it possible that the winmm code in the winmm dll itself is working for linux but not mac for some reason? Or that the mac side is always trying to use dinput while the linux side can "fall back" on winmm?
Another interesting test case that I noticed has been Freespace 1 from GOG. If you start it up, the game launcher recognizes that a joystick is plugged in, but does not accept commands from that joystick once one is actually playing the game.