Big update today!
@argonlefou,
Big thanks to you for your suggestions and help. As you mentioned, my biggest mistake was the use of the GetScreenPos and PointerToScreen functions. This caused a lot of issues. Can you explain quickly the purpose of those?
What I do now, is use the normalize function provided in Mame that is also used in 0171, like this:
// update the X/Y positions
lightgun.lX = normalize_absolute_axis(rawinput.data.mouse.lLastX, 0, INPUT_ABSOLUTE_MAX);
lightgun.lY = normalize_absolute_axis(rawinput.data.mouse.lLastY, 0, INPUT_ABSOLUTE_MAX);
I didn't have to separate the devices in the different tables. The "process_event" procedure validates if it's a relative or absolute device.
@Sorn,
Can you test this one?
**Very important**, you have to set back the "lightgunprovider" to "auto" in mame.ini (which is best since it's the default)
http://www.filedropper.com/mamearcade64_11
I'm very happy with the result. You'll probably tell me that the pointer in tab menu doesn't follow the crosshair, but I can guarantee you that I'm processing using the real absolute values for the lightgun and relative for mouse. Maybe the UI is using something different, I can't tell. But, for me, the crosshair tracks perfectly the gun.
I also test, 2 mice, 2 lightguns, 1 mouse and 1 lightgun, etc, and it works fine.
Hope you'll get same result.
Thanks for all the testing.
Note this is still based on Mame0175.
Thanks very much all!
Pitou!
CONGRATULATIONS!!!!
....You've done it!
" You'll probably tell me that the pointer in tab menu doesn't follow the crosshair" .....
Same thing occurs in 0171. It does not seem to have any effect on the accuracy once in game so who cares ?
Testing between v11 and 0171, I can notice NO difference whatsoever. I think any variances at this point are variances that exist within the aimtrak calibration itself, and not from any of your input code!
Really excited that you got it working with the win32 drivers, everything is deadly accurate now. Gun 1/2 shows up as it should, everything is 100% in order.
Would really like to try to compile your source (once you've done 0176) now and get mkchamps no-nag/hiscore working so I can slap this in my setup
And lets keep our fingers crossed that your patch will make its way to 0177, that maintainers will keep the input code and that you wont have to do anymore updating! I also responded on the mametesters bug report to confirm that all is well. I think it would probably be best to port it to 0176 to make sure there are no regressions in any code, and they will likely get it merged for 0177!
Out of interest has anyone tried the new mame with dual guns to see if its fixed?
Ime still running .170 for this reason.
I just tested 0176 now, same issue persists. However im sure if you give Pitou a day or so he will port the changes to 0176 and it will be posted here. He can also finally submit his patch through the mametesters bug report I created so we can get his patch added to the official repository!