I've been doing a little testing (aka playing) recently to try and figure out how Sega IR guns work (I can't live with not knowing). A guy on the other forum claimed they determine coordinates by calculating the angles between the IR LEDs (and the gun). I think that would be impossible with type 2 hardware unless I missed something key? What do you guys think? And, has the gun sense IC ever been dumped so we could see the code?
I don't know anything for sure yet but you can aim at any given point on screen from a literally infinite number of angles. For example, I can aim at the center from the left or right. I can turn the gun on it's side etc without harming accuracy as shown below:
https://www.youtube.com/watch?v=Hrd90Hr9AMk
There is no tilt sensor in the standard Sega IR gun and there is nowhere to tell the gun sense board how big the screen is. The angles between each led would change if the screen was larger or even if you just stood further back. It seems like a lot to calculate on the fly with nothing but a photo diode to see with. plus, the guns seem to be designed to restrict the view to what's directly in front. The IR shield sits in an opaque tube with only the tip visible:
As I understand it, a photo diode converts light to voltage. They can measure if there is light in front of them and use the varying voltage response to judge intensity or color. Or with an additional processor (like a gun sense board) they can use that info in conjunction with timings to determine position (like on a crt light gun). I.e. The sensor tells it if I'm pointing towards an IR light source, the timing tells it which of the ten led boards it is. The intensity tells it how far I am from the closest LEDs.
Some say the mechanism to know which led board you are pointing at is done with timing by lighting each led individually in a circular sequence. I can buy that if it's modeled after crt light guns. It's no stretch that the brief could have been "here's a light gun, make me one that works on any screen". Another potential option would be varying voltage (e.g. Progressively less or more for each led) or different wavelengths to generate a different voltage response for each led etc. if you can vary the light intensity, you'd get different voltage responses from the photo diode from each led board. just a thought.
If you think of the LED boards as being five sets of two instead of one set of ten, you can start to see how it might work. e.g. If I point at led board 1, I get a 5v response. As I move my aim across to led 2, the voltage gradually reduces until I get half way between them when it starts increasing again until I'm pointing directly at led 2. Not entirely different to a pair of 5/channel IR line followers except with one moving sensor instead of one for each led.
I'm thinking I may be able to capture some of the voltage response info from the mystery pins on the gun sensor module. They have to do something and the voltage response from the photo diode has to travel through at least one of them.