Command line to run Famicom driver with Zapper already plugged:
mame famicom duckhunt -exp zapper
Script:
In this video we will configure MAME to use Famicom's Zapper
Let's start the Famicom driver with a Zapper capable game
Hit [Tab] key to display menu
With arrow keys, select "Slot Devices"
Then go to "exp" and select "zapper"
Select "Reset System"
Reset take a few seconds then...
Hit [Tab] again
Select "Input Settings"
Select "Input Assignments (this system)"
Go to "Lightgun X 3 Analog" and press [Enter] key
Move your mouse right or left
Go to "Lightgun Y 3 Analog" and press [Enter] key
Move your mouse up or down
Go to "Lightgun Trigger" and press [Enter] key
Push left mouse button
Hit [Tab] to quit menu
You should now be able to play Duck Hunt with your mouse