Posted by TaskMaster on 7, 2001 at 11:40 AM:
In Reply to: Howard Casto and Johnny the MAME'r read this! posted by Reg on 6, 2001 at 7:25 AM:
: Hi,
: your inputs are appreciated...
: I have found the Patent of the Act Labs Light Gun and the Nintendo Zapper...They quite well explain how each gun works...
: Both of these guns need a blank frame and a white target...
: The Act Labs works only on a monitor and they use the synchronization signal of the monitor to increase the precision of the gun...
: Please do not forgot Mame emulate hardware...
: I mean by this we can know at which resolution a game is running, the beginning of a frame the end of a frame, we can even synchronize the frames, ...
: Look in Mame32 the advanced options "Synch to monitor refresh", "Wait for Vertical synch", "Draw every frames"
: I have checked the game Clay Pigeon Version 2.0 "claypign"
: you can see a black frame with the white target when you use the Ctrl button to shoot the clay...
: so I think the implementation can be done with a fair precision.
: We can solder the gun trigger swith on the Ctrl key of a keyboard controller and send the Gun output (Zapper is the blue wire ) in the Game port.
: We just need to figure out in Mame how to make this gun work ...
: I think we are half way...
: Reg
The Act Labs gun does not do this...
The nintendo gun does.
The ACt Labs gun actually turns the screen white, then does a complete black screen. They wait for the white to black transition to be seen by the gun, then knowing what the frame rate is, they know exactly where the gun was pointed by the single horizontal screen line drawing across and being seen by the gun.
I know this as a fact, because I have written a VB ap that allows you to shoot at the screen and it draws a little red dot where you shot. I am not telling the driver where to draw a white box or anything. You do not even need a target on the screen.
When the user pulls the fire button on the light gun, the gun does the white/black screen thing, then sets the X-Axis and Y-Axis point of the joystick and sets Button 1 as being pushed. That is all it does. It is the same info returned by a two button analog joystick. All a program has to do is see if the button has been pressed, if it has, poll the two Axis's and you know where the gun was pointed.