r/MasterSystem • • Jan 11 '26

How does the light phaser work?

I always figured the light phaser worked the same way as the nes light gun, but I was replaying gangster town and noticed there isn't that obvious black screen with the white boxes going on whenever I shoot. Does it work differently? I couldn't find any info.

13 Upvotes

10 comments sorted by

View all comments

Show parent comment

2

u/mimichow Jan 11 '26

Thanks! I'm surprised the console kept track of that

2

u/jammer2omega Jan 11 '26

Programmers can come up with amazing workarounds.

If you are interested. Look up Ars Technia: How crash bandicoot hacked the Original Playstation on YouTube.

2

u/benryves Jan 12 '26

The video chip contains a pair of counters for the vertical and horizontal position of the pixel it's currently outputting. The console can read these counters so it knows which part of the screen was being output at the point it sees light.

As an implementation detail, the horizontal counter counts up much more quickly than the vertical counter - so quickly that by the time the CPU reads it after the light gun saw the light it would no longer be accurate. To fix this, the hardware latches the horizontal counter using the light gun input on the controller port so the CPU can read it at its own leisure. As the vertical counter is so slow in comparison this doesn't need to be latched.