Reverse engineering "Stack Light Rifle"

Whether it's Mire Mare or a BASIC tape you found in the attic, it needs to be preserved digitally. Post here and experts can help to do so.

Moderator: pavero

Post Reply
Boojakascha
Drutt
Posts: 7
Joined: Thu May 17, 2018 3:44 pm

Reverse engineering "Stack Light Rifle"

Post by Boojakascha »

Hello

I would like to reverse engineer the electronics inside the connector in the "Stack Light Rifle" to build adapters which can be used with more common guns such as Magnum Light Phasers, Sega Light Phasers, and Cheetah Defenders.

Has anyone that gun? Could a picture be posted of the contents inside the connector? If that would be too big of the hassle I would buy one if somebody is willing to sell. I even take a defect unit, I don't mind about its condition, as long as the connector is on it.
User avatar
RMartins
Manic Miner
Posts: 776
Joined: Thu Nov 16, 2017 3:26 pm

Re: Reverse engineering "Stack Light Rifle"

Post by RMartins »

According to Wikipedia the principle is the same of any other gun or light pen from the 80 s.
https://en.m.wikipedia.org/wiki/Stack_Light_Rifle
The electronics inside the pistol consist of a light detector or photo-diode and a small amplifier and buffer.
I'm convinced the circuit will be very similar to the one on the Magnum Light Phaser.

The most important thing is to make sure that the lens is centered and doing the correct job.
The rest like documented in wikipedia is just a light sensor, a transistor as an amplifier, and a logic buffer to convert to typical TTL levels.

I have several Magnum Light Phaser, in my storage room, but never opened one, because if I remember correctly they are glued and have no screws to open.

Note: keep in mind that these devices only work with a CRT TV, due to how they work, since they are triggered by the CRT beam.
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: Reverse engineering "Stack Light Rifle"

Post by Nomad »

RMartins wrote: Fri May 18, 2018 12:53 am Note: keep in mind that these devices only work with a CRT TV, due to how they work, since they are triggered by the CRT beam.
I figure a lot of these devices are going to fall into obscurity for this very reason. People are not going to be able to actually use them when the final crt tubes go to the junk yard in the sky. :lol:

Makes you wonder about the future value of these widgets - if nobody can actually use them, beyond the nostalgia/completion factor why own it?
Boojakascha
Drutt
Posts: 7
Joined: Thu May 17, 2018 3:44 pm

Re: Reverse engineering "Stack Light Rifle"

Post by Boojakascha »

RMartins wrote: Fri May 18, 2018 12:53 am
I'm convinced the circuit will be very similar to the one on the Magnum Light Phaser.
They are. The interior of the gun is well documented. I just need the interior/pinout of the connector.

Yes, I am aware they just work with CRTs. You guys would be surprised to know how many of us still have one of these...
dfzx
Manic Miner
Posts: 673
Joined: Mon Nov 13, 2017 6:55 pm
Location: New Forest, UK
Contact:

Re: Reverse engineering "Stack Light Rifle"

Post by dfzx »

Boojakascha wrote: Fri May 18, 2018 6:20 am You guys would be surprised to know how many of us still have one of these...
Are they just collectables? Or have you found a way to use and play with them with modern technologies?
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
Boojakascha
Drutt
Posts: 7
Joined: Thu May 17, 2018 3:44 pm

Re: Reverse engineering "Stack Light Rifle"

Post by Boojakascha »

dfzx wrote: Fri May 18, 2018 7:55 am Are they just collectables? Or have you found a way to use and play with them with modern technologies?
First: Rarely stuff doesn't have analogue output anymore.

Second: Even it the output is digital only, you can buy converters for less than 10 USD.

Third: People of course mainly use them in conjunction with old tech.
User avatar
RMartins
Manic Miner
Posts: 776
Joined: Thu Nov 16, 2017 3:26 pm

Re: Reverse engineering "Stack Light Rifle"

Post by RMartins »

Boojakascha wrote: Fri May 18, 2018 6:20 am
RMartins wrote: Fri May 18, 2018 12:53 am
I'm convinced the circuit will be very similar to the one on the Magnum Light Phaser.
They are. The interior of the gun is well documented. I just need the interior/pinout of the connector.

Yes, I am aware they just work with CRTs. You guys would be surprised to know how many of us still have one of these...
I also have a light pen, and it has a specific interface to connect to the expansion port.
The Magnum, if I remember correctly, connected to a keyboard or serial socket.
The "Stack Light Rifle" I have no idea.

Anyway, if you know where it used to connect, you can open that device and check the connector connections to the PCB trace, and follow them along, if they are not identified.
User avatar
Joefish
Rick Dangerous
Posts: 2042
Joined: Tue Nov 14, 2017 10:26 am

Re: Reverse engineering "Stack Light Rifle"

Post by Joefish »

I think the stack came with its own interface, as it needed power.

It's very old technology - it's not doing raster counting to work out where the gun is pointing. It's simply detecting whether the gun is pointed at a light or dark spot on the picture. Games would have a single bright (white or yellow) target on a dark (black or blue) background. When you pull the trigger, the computer checks if you have a bright spot in your sights. Not sure if it can detect the trigger and the brightness independently, or if it only returns the brightness (high/low) signal when the trigger is pulled.

It's a clone of one that shipped with earlier TV games like the Grandstand. They'd just have a bouncing dot on the screen. It was up to you to set the brightness of your TV so that the gun could tell the dot from the background. Too high and it would register a hit off the plain green background. Oddly enough you could set the game to 'Tennis' and if you shot the ball it would temporarily vanish!
Image

Don't see why it wouldn't still work on an LCD TV, so long as it could display good enough contrast. A Plasma, OLED or LED TV (colour LCD with individual LED lights behind it instead of a single light source) should be fine.

It might benefit from a trim pot built into the gun. We used to build a light-sensor amplifying project in GCSE technology, with an LDR and a couple of transistors, and a potentiometer to tweak the sensitivity. You could drive a circuit like that off any joystick port that supplies +5V. You could build it into any of the various light gun models. So you might be able to make something that works with LCD TVs, if only for a single fast-moving target. Might be worth a try replacing the circuit in a Sinclair light gun. If you really want to be clever, you could try building a circuit that can detect two or three levels of brightness and report them on the joystick directions. Or flicker the screen between targets so you can test one at a time (that might not work if the LCD lag is bad though).

Later guns that could sense the onset of the TV raster beam needed a much faster light sensor - the sort that would respond in microseconds, like the receiver of an IR remote control. Those would only work with a CRT TV, but were frankly a bit beyond the ability of the Spectrum to detect where they were pointing with any accuracy. Even on 16-bit machines with per-line counters like the ST and Amiga their accuracy was questionable. You have to look to something like the G-Con 45 and Time Crisis on the first Playstation for any accurate tracking.
Boojakascha
Drutt
Posts: 7
Joined: Thu May 17, 2018 3:44 pm

Re: Reverse engineering "Stack Light Rifle"

Post by Boojakascha »

Joefish, I think the SLR just shares the shell with those pong console guns. The C64 and VIC20 ones work like proper raster light guns for sure, their internals are well documented.

Building the earlier kind you mentioned is indeed easy. I did a "Pistoltronix" for the Magnavox Odyssey:
[media]https://youtu.be/OFJGMqS9hTI[/media]

RMartins wrote: Fri May 18, 2018 4:02 pm I also have a light pen, and it has a specific interface to connect to the expansion port.
That's an excellent lead, thank you very much. I am going to buy & slaughter one to find out its pinout. They usually work similar. And stack did some themselves.
User avatar
Joefish
Rick Dangerous
Posts: 2042
Joined: Tue Nov 14, 2017 10:26 am

Re: Reverse engineering "Stack Light Rifle"

Post by Joefish »

OK, looking at this, I see it's arranged so that there's only one target on each row of the screen.
That would suggest it's accurate enough to at least work out which row of the raster-scan it's pointing at, then use the brightness of the target to determine whether you've hit the target on that row (rather than calculate the horizontal position accurately).

https://www.youtube.com/watch?v=APAXRSRQ-Ew

Even so, the only chance you have of making a lightgun work with an LCD display is using the single bright target scheme of those old TV games. If you can make a Sinclair light gun (or any of that era) actually have a slower and broader target response and work like that then you can at least do a crude Duck Hunt.

Can you point me to where the internals of the C64 one are documented? I can't find anything.
Never mind:
http://home.kpn.nl/bderogee1980/project ... Rifle.html
Last edited by Joefish on Fri May 18, 2018 6:22 pm, edited 2 times in total.
Boojakascha
Drutt
Posts: 7
Joined: Thu May 17, 2018 3:44 pm

Re: Reverse engineering "Stack Light Rifle"

Post by Boojakascha »

Joefish wrote: Fri May 18, 2018 6:10 pm Can you point me to where the internals of the C64 one are documented? I can't find anything.
Never mind:
http://home.kpn.nl/bderogee1980/project ... Rifle.html
Exactly^^ you were faster, I was already writing this post.

I found PCB photos of the light pen of a competitor. This will be a good starting point for me =)
User avatar
Joefish
Rick Dangerous
Posts: 2042
Joined: Tue Nov 14, 2017 10:26 am

Re: Reverse engineering "Stack Light Rifle"

Post by Joefish »

Didn't realise the VIC20 / C64 hardware supports lightpen raster tracking as standard. I guess that did leave the Spectrum quite a way behind in lightgun technology, even given the same gun.
Boojakascha
Drutt
Posts: 7
Joined: Thu May 17, 2018 3:44 pm

Re: Reverse engineering "Stack Light Rifle"

Post by Boojakascha »

Joefish wrote: Fri May 18, 2018 6:22 pm Didn't realise the VIC20 / C64 hardware supports lightpen raster tracking as standard. I guess that did leave the Spectrum quite a way behind in lightgun technology, even given the same gun.
I have read a book about ZX Spectrum pixel art. It seems the light pen was actually quite ok. Most people used a joystick or grid paper to draw nevertheless.
User avatar
Joefish
Rick Dangerous
Posts: 2042
Joined: Tue Nov 14, 2017 10:26 am

Re: Reverse engineering "Stack Light Rifle"

Post by Joefish »

When I have seen someone using a lightpen on a Commodore ( I think it was a Plus4) I remember some white vertical and horizontal bands sweeping the screen to locate the pen, then all the time it was drawing it threw up a large white square around the pen tip - presumably to track small movements, assuming the pen didn't jump outside that square from one frame to the next. But of course the white square obscured the immediate thing you were trying to draw.

It was also only good for drawing lines. If you jumped from one place to another (I can't remember if you had to tap a key or if the tip was a touch switch) it had to do the white bands to relocate you. I guess if the screen was mostly white it wouldn't have to, but if you were drawing on a mostly black screen it needed to flash up something bright.

Time Crisis on the PS1 would flash the screen white for one frame to track the gun; that's all it needed. On the calibration screen it left the screen pale yellow and could give you a live tracked cursor - though if you went over any of the darker markings on the calibration screen the cursor got stuck. I'm guessing the Commodore had a lot of jitter in its live tracking, and the software did a lot of averaging, so one bright flash frame of tracking data might not have been accurate enough.
Boojakascha
Drutt
Posts: 7
Joined: Thu May 17, 2018 3:44 pm

Re: Reverse engineering "Stack Light Rifle"

Post by Boojakascha »

You are right, that's why commodore people used Koala touch pads instead to draw. A pity the pen wasn't good.

The NES Zapper is similar: It is just accurate enough to measure Y axis, but can't accurately measure x axis.

Some games flash blue instead of white, which makes it a bit less disturbing ;-) If designed well, a game wouldn't have to flash... but I see why they are doing it.
Post Reply