...My mame.ini is set to mouse 1; multimouse 1; lightgun 0; lightgun = mouse....
You want either "
lightgun 1" or "
lightgun lightgun". If you do the latter, make sure you are playing a game that had a lightgun; games like term2 did not, so mame emulates with the adstick type, so your lightgun will not be enabled. If that doesn't work, set "
mouse 0" (but leave "
multimouse 1").
Do not try to map the lightgun to the INC or DEC ports, just the analog one.
If you still have problems, you can try hand editing the cfg file. Remap the stuff you want the lightgun to do to to a mouse (it's easiest if you map the mouse left button to what you want the trigger to do, the mouse X axis what you want the lightgun x axis to do, etc), and exit mame. Open the cfg file in any text editor, and look for the stuff remapped to the mouse. Change the mouse 1 to lightgun 3 or 4, as needed (USE the all caps just like the mouse in the file).
Again, do not map the lightgun to the INC or DEC ports, just the analog one.