I have a technical question about the NES zapper gun.
I've been told that zapper games don't work with flatscreen TVs. I would assume that would be related to lag in display (?). Presumably, the game would be polling the zapper before the correct frame was displayed.
If you sent the 'black screen with white squares' to the PPU to display... then waited 3-4 frames before polling the zapper...would you be able to make flatscreens work with the zapper ?
No.
The zapper is only sensitive to the ~15kHz flicker of CRT TVs. Flatscreen TVs usually don't flicker close enough to that frequency to trigger the zapper.
Perhaps if a TV flickered its LED backlight with 15.7 kHz PWM, a specially designed game might be able to work. But it wouldn't necessarily be able to do the more subtle tricks that games like Operation Wolf use. It measures the time between the start of the picture and start of receiving light to narrow down targets. And Zapper users are a far smaller market than Wii Remote users, probably not near big enough for economies of scale.
Just to play devil's advocate here...
I've been able to get a false positive by pointing a zapper at a fluorescent bulb and shooting. Are you sure the flicker is necessary?
Your compact fluorescent lamp's electronic ballast might be operating at a frequency close enough to 16 kHz for the Zapper to pick it up.
It depends entirely on how bright the light source is.
I have been able to get the zapper to fire with a single LED driven with 10mA, turned on once (no repetition at all). But I also can't get it to fire pointing at the CCFLs in my monitors or the CFLs in my house, even though I know the former is flickering at ≈1kHz and the latter at ≈8kHz.
The receiver inside the LCD is basically equivalent to the GL3274, but retuned for 16kHz operation instead of 40kHz operation. You can look at the rejection plot in its datasheet.
If you want to test your TV I made some test ROMs a while back, and there's also tepples' zapruder suite.
viewtopic.php?f=9&t=13021The issue isn't just lag, though, like others have pointed out.
I guess the market for zapper games is too small for me to work on this issue. It's a bit disappointing.
A while back I started disassembling Duck Hunt, figuring I could add latency to make it work, but then I learned the zapper just can't see my TV anyway, so I gave up.
I was happy about the idea of a software solution to the problem, but when I realized people would have to mod their zappers too to make it work, I wasn't so interested anymore. You'd need both, though, to get it going; software to adapt for latency, and hardware to detect the light.
Wouldn't four black/white frames look absolutely awful? Epilepsy trigger?
Maybe the
lawsuits related to "epilepsy trigger" are why there wasn't a light gun for the Nintendo 64 or GameCube, despite GunCon for the PlayStation and PlayStation 2.
In my opinion, going forward, the Anoto watermark and the Wii Remote appear to be the most promising technologies for pointing at an LCD once their patents run out.
rainwarrior wrote:
I was happy about the idea of a software solution to the problem, but when I realized people would have to mod their zappers too to make it work, I wasn't so interested anymore. You'd need both, though, to get it going; software to adapt for latency, and hardware to detect the light.
It's not a bad idea. On the software side, it would be best to make the delay adjustable (to account for various TV sets); but then the lingering problem of hardware modification crops up. I think there's a definite interest, as I've seen tons of YouTube videos of people talking about why Zappers don't work (usually with varying degrees of accuracy), but never underestimate how many people would go through the pain just to shoot those beautiful Nintendo ducks.
Good news everyone!
I'm working on light gun games modification (I call it lcdmod), which brings back our childhood (for those who lost their CRTs years ago). Duck Hunt is at release candidate state. Wild Gunman is underway.
Cheers!
http://neslcdmod.com/
morskoyzmey wrote:
Good news everyone!
I'm working on light gun games modification (I call it lcdmod), which brings back our childhood (for those who lost their CRTs years ago). Duck Hunt is at release candidate state. Wild Gunman is underway.
Cheers!
http://neslcdmod.com/Really cool!
morskoyzmey wrote:
Good news everyone!
I'm working on light gun games modification (I call it lcdmod), which brings back our childhood (for those who lost their CRTs years ago). Duck Hunt is at release candidate state. Wild Gunman is underway.
Cheers!
http://neslcdmod.com/How did you make this work without requiring hardware modification?
My wild guess is that the Dendy version of the light gun doesn't filter out LCD light like the NES Zapper does?
There was
this solution to mod the zapper a while ago, but I don't think it took off because of the high cost (was also tied to a patch board solution for the games; I would have gladly bought the zapper mod alone).
samophlange wrote:
How did you make this work without requiring hardware modification?
Hi, didn't notice, that there is a discussion on a second page.
The algorithm of current version looks like this:
On menu screen you're shooting with max delay (to cover almost all devices).
It means, that black screen, which is appearing after you pushed the trigger, staying on the screen not for one frame, but for Delay+1 frame.
So it gives to your TV enough time to show that black screen, while the game logic is still in dark screen loop.
After that, it is time for the white screen. In game logic there is counter, that (obviously) counts how much frames the white screen is on, but light is not registered yet. And this count
is our Delay! Which is necessary to make the game work.
The in-game algorithm is on the image. Hope it is self explainable. Although I know it is not. But sorry, it is hard for me to write about complex things in English.
morskoyzmey: I think the question is not about the software delay, but how the zapper works without hardware modification.
The Nintendo NES zapper cannot detect light from most LCD TVs. It requires the light source to turn on and off at 15kHz like a CRT's scanlines.
In your videos it looks like some different kind of light gun, not made by Nintendo?
Or does the LED backlight PWM run at close enough to 15.7 kHz?
tepples wrote:
Or does the LED backlight PWM run at close enough to 15.7 kHz?
I think they're usually an order of magnitude or two lower than that? Not entirely certain though.
Quote:
The Nintendo NES zapper cannot detect light from most LCD TVs.
Is it confirmed info? Did someone tests with custom testing ROM?
Never thought that light gun is something more than just a photodiode. Why it needs some specific frequencies from light source?
My light gun is a sort of chinese thing from the box with famiclone. Am I just lucky?
Anyway I have majority of positive reports (not sure for now that there are some for NES). I hope Zapper can be used also.
morskoyzmey wrote:
Never thought that light gun is something more than just a photodiode. Why it needs some specific frequencies from light source?
The authentic Zapper's photodiode feeds into a demodulator chip that rejects light from a light bulb while detecting light at the horizontal scan frequency of SDTV. Clones may lack this.
There is also a datasheet for "Sharp IR3T24/IR3T24N/IR3T26/IR3T26N", that might resemble the IR3T07A a bit closer than the GL3274 datasheet mentioned earlier. But they are somewhat similar, and both filtering 40kHz, and the zapper might filter 16kHz instead...
On the other hand, several people have confirmed that it does also work with a single light "off-on" transition, and doesn't strictly require "off-on-off-on-off-on" signal pulsed at 16kHz. Though I guess the single transistion might work only if it's bright enough, and repeated pulses might work even if they aren't that bright?
Having light transistions is important as the hardware should try to filter out constant ambient light. Ie. sunlight should be ignored because it doesn't flicker. A 60Hz light bulb would flimmer at 120Hz (glow on +/- voltage), but that does't have sharp transitions like a square wave, so the zapper might ignore it for that reason. Backlight PWM might work in theory, but might vary from display to display (depending on if there's PWM at all, on it's frequency, and on whether it's producing sharp or smoothened transitions).
And a flicker-free TFT screen won't be visible to the zapper if it outputs a series of white frames (I guess some people might not be aware of that when testing zappers).
Though Duck Hunt does output a black frame, and then a frame with white rectangle, so the zapper should see one transition in that case (though it might fail if the brightness isn't enough, or if the TFT is resampling/delaying the picture output).
If the zapper really needs multiple pulses, and if should also accept something like 8kHz or 64kHz, one idea would be to use black/white striped sprites instead of the white rectangle. And it might be best to combine that with gray background (and a fully gray picture in previous frame).
* If it's horizontally striped (each second scanline white, each other scanline black) then zapper should see 8kHz.
* If it's vertically striped (left half white, right half black, and the light sensor aimed at the middle), then the composite signal should carry nice 16kHz spikes - but most TFT's are having higher vertical resolution, so it would become 64kHz if each composite line occupies four TFT lines.
The idea with gray background is that the zapper would see, say, a 12x12 pixel window (including gray pixels from previous frame). So brightness goes up when drawing new white pixels, and goes back down when drawing black pixels (on the formerly gray background). Doing the same on black background would cause the brightness to go up-and-up-and-up on white pixels (but stay unchanged when drawing black pixels on black background).
If that ideas don't work out...
Anybody ever thought of placing a camera in front of the TFT screen, and then forwarding the camera output to a CRT screen? No, I know that that won't work well, forget about it, please!
morskoyzmey wrote:
Did someone tests with custom testing ROM?
Yes, I linked some test ROMs on the first page of this thread that just put a light square on the screen and constantly check for light:
http://forums.nesdev.com/viewtopic.php?f=9&t=13021Nintendo put the filter there with the hope it would ignore most things except a CRT.
nocash wrote:
several people have confirmed that it does also work with a single light "off-on" transition, and doesn't strictly require "off-on-off-on-off-on" signal pulsed at 16kHz. Though I guess the single transistion might work only if it's bright enough, and repeated pulses might work even if they aren't that bright?
I could get it to ring with an LED flashlight being switched on. I think at one point I had a CFL lightbulb it could pick up.
So yes, I believe a sharp enough transition is good enough but only if you're detecting at the time it switches on. A CRT is giving you continual and very bright pulses, though.
My TV definitely can't make a sharp enough transition, though. A black to white frame is not enough here, it has to go from one to the other
fast.
rainwarrior wrote:
So yes, I believe a sharp enough transition is good enough but only if you're detecting at the time it switches on. A CRT is giving you continual and very bright pulses, though.
Hmmm, yeah, CRT pixels might be very bright for a short moment, and human eyes might just don't realize that because it happening too fast.
Does somebody have scope pictures showing the voltage at the photodiode, and using CRTs and TFTs as light source?
In your tests, did you try to provoke extrme transistions, and still got no signal at all? Like blinking black/screen screens. Or gray screen, then black/write scanlines in next frame?
nocash wrote:
In your tests, did you try to provoke extrme transistions, and still got no signal at all? Like blinking black/screen screens. Or gray screen, then black/write scanlines in next frame?
I was sure I had tested it, but there wasn't a specific test for this in the ROM set I linked above, so I added one just now and retested it to be sure. (see
zapper_flip.nes)
Results were the same as what I said before, though. Can't get anything out of my LCD TV. Also can't get anything out of my LCD computer monitor. Can get a signal from a CFL lightbulb (contact range). Can get a blip from turning on an LED flashlight (contact range).
To be honest though I wish I had been wrong. Would have been nice if it worked.
yeah that is not "right" a real zapper looks like this
https://asreimer.files.wordpress.com/20 ... 863_sm.jpg
morskoyzmey wrote:
My circuitry.
Okay, that's simplier than the official zapper. At least it does confirm that the TFT does emit enough light to trigger photo diodes (though it may have troubles to pass through the IR3T07A chip on official zappers). But I guess there might be a bunch of "zapper-compatible" NES guns with similar simple circuitry, so your software patch might still work for a lot of people.
Might be also worth to share your patch with somebody having an official zapper, maybe it does work fine after all. Is there anybody here having a zapper + flashcart + one or more TFT screens?
rainwarrior wrote:
I was sure I had tested it, but there wasn't a specific test for this in the ROM set I linked above, so I added one just now and retested it to be sure. (see
zapper_flip.nes)
Just checked what the code is doing... it flips black/white when pulling the trigger... and the light reading seems to continue regardless of the screen color (which is good)... but the light reading itself does take place only during vblank?!
I think that can't work, neither on CRT nor TFT. There's no light during vblank on CRTs (except some afterglow). A TFT might have light during vblank (as far as I know all pixels will "afterglow" until they get changed in next frame). In both cases, the afterglow doesn't include light transitions, so the zapper won't see anything.
For CRTs, one should read the zapper signal at least every handful of scanlines during rendering.
For TFTs, to be sure that you don't miss distorted signals or delayed frames: Best read the zapper every 3-6 opcodes, and be sure to keep reading during vblank (!) and keep reading during next couple of frames (!)
The light reading happens constantly during the frame (a few times per scanline). Why do you think it reads only during vblank? It's doing the opposite. It is interrupted very briefly by NMI during vblank, though it will resume reading before vblank is finished too.
The schematic of this clone seems to be:
Code:
+5V +5V
| | +--- to console
100k 1M |
| | | /
+----C---+---|<
| | ↘
photo |
diode |
| |
gnd gnd
+5V---100k---gnd
+5V---trigger--+--- to console
gnd----3.9k----+
edit: I keep on being wishy-washy about the polarity of things. But assuming there's still a pull-up in the console inputs, the transistor has to pull voltage down, not up
rainwarrior wrote:
The light reading happens constantly during the frame (a few times per scanline). Why do you think it reads only during vblank?
Oops, sorry, I've misread the code. There is a wait-for-next-frame loop without zapper reading... but that part of code executes only once when (if) it has sensed light.
Yes, after detecting any light signal it'll wait until the next frame before resuming. This was partly to keep the audio indicator at 60Hz, but it's also more or less how Duck Hunt and other zapper games work, running a detection loop until there's a positive result and then stopping.
Sorry, that without a modification Zapper won't work.
But maybe someone will go for it.
BTW I just tested a new game mod!
https://www.youtube.com/watch?v=gbiPH2dXYZ4
There was a project recently that took care of the 2 mods, the game and the Zapper:
https://www.kickstarter.com/projects/me ... rn-mallardThe campaign failed though, since the need for different mod boards for each game made things prohibitively expensive. A Zapper mod to be used in conjunction with Flash carts would probably be much more successful, but you can't propose ROM distribution on Kickstarter...
Besides, Wii have already seen perhaps the
most robust way to adapt the Zapper to modern TV. It's a single-board computer that receives coordinates from a Bluetooth pointing device and relays them to an MCU, which crops the composite signal around the desired location and feeds it back to the Control Deck. This requires zero modification to the Control Deck or Game Paks.
I agree. It's a little convoluted, but if someone could find a way to pack that in the form of a Zapper that connects to the controller port and to the composite output, that might just work as a product.
tokumaru wrote:
I agree. It's a little convoluted, but if someone could find a way to pack that in the form of a Zapper that connects to the controller port and to the composite output, that might just work as a product.
There is a website to buy it, but it's currently sold out. (Sounds like it may take a few months to resupply.)
https://www.lightgunverter.com/
Seems like it can work with an unmodified zapper?
http://retrorgb.com/neslcdmod-beta.html
grynold wrote:
Seems like it can work with an unmodified zapper?
http://retrorgb.com/neslcdmod-beta.htmlIf these guys (specifically the "NESLCDMOD" folks) are in the United States, then they're going to get DMCA notices, sued, or both. I simply can't tell where they reside, country-wise. While the name "Alexey" implies eastern Europe or Russia, it's not a valid assumption.
http://retrorgb.com/neslcdmod-beta.html explains that the way this works is by patching/modifying the actual 6502 code in each game individually, and that the ROMs are available at
http://neslcdmod.com/roms/ . If you visit that site, and use the Download links, you'll get
complete (but modified) ROMs of copyright Nintendo games (specifically Duck Hunt; Wild Gunman requires you to ask for it via Email). What they
should be providing is binary patches for ROMs (ex. IPS patches), and a list of MD5s + filenames of the ROMs each IPS patch can apply to (because there are tons of dumps of carts that have Duck Hunt on it -- all vary/are different).
Dunno what it's going to take for people to learn this... :/
Didn't realize I could just download the beta, so I did give it a try. (Doesn't do anything unexpected for me. All zapper shots register as "offscreen".)
I like the auto delay option, when I had experimented with this myself I had added a hard coded delay, but never got around to UI concerns because I discovered quickly after that my zapper just can't see the TV. ;P
Interestingly, while playing with the backlight settings (wondering if I could get some PWM effect) I discovered the signals from the IR remote control get picked up by the zapper quite well. Ha ha.
One more thing on my list of devices that the zapper can't see: Wii U screen.
grynold wrote:
Seems like it can work with an unmodified zapper?
http://retrorgb.com/neslcdmod-beta.htmlIt might work with some TVs, though it didn't look like it was reliable enough for him to be playable... probably can't solve that issue with software though, unfortunately.
Edit: this post appears to have been orphaned by a deleted post immediately above that suggested alternatives to IPS.
Moving data around is not a problem that this particular patch has.
Maybe instead of modyfing games, just apply code-injection that triggers after reading $4017?
This is big, why is this thread so low key? Imagine the homebrews... If this really works then lightgun games can finally get out of the "I own a heavy obsolete display" domain.
Because it doesn't?
This only works because his lightgun works entirely differently than the OEM Zapper.
Well, it was news to me that some clone light guns don't have the filter. That puts a new lease on the idea, I think.
lidnariq wrote:
Because it doesn't?
This only works because his lightgun works entirely differently than the OEM Zapper.
?????
So what? A cheap circuit like that is miles better than wiring a duct taped wiimote/zapper combo to a raspberry pi. Can you seriously not see how viable this is if a cheapo clone can simply work with LCDs just by adjusting for lag?
I for one have been waiting for a viable LCD solution for a long time for homebrew games...
Because now you're in the business of manufacturing, or finding someone who is still manufacturing, new famiclone zappers with a compatible connector?
And you have to explicitly say "your existing Zapper won't work, you'll have to buy a new one" ?
I mean, I agree that it's not nothing. But it's also a lot of caveats, which is why I'm so "low key" about it.
You're seeing this in comparison to a camera and a computer or to a CRT. I'm seeing this more like trying to sell an entirely brand new peripheral, even though it seems like one that's already been sold.
lidnariq wrote:
Because now you're in the business of manufacturing, or finding someone who is still manufacturing, new famiclone zappers with a compatible connector?
Hyperkin is selling
this one for NES. Couldn't find a currently made clone for Famicom though (but I might not know how to search for it).
I will get one to try, if it has the CRT filter I'll try modding it, and if I'm very lucky it won't.
I wasn't really willing to mod my original zapper but I'd at least be willing to do it to a cheap clone like this.
rainwarrior wrote:
lidnariq wrote:
Because now you're in the business of manufacturing, or finding someone who is still manufacturing, new famiclone zappers with a compatible connector?
Hyperkin is selling
this one for NES. Couldn't find a currently made clone for Famicom though (but I might not know how to search for it).
I will get one to try, if it has the CRT filter I'll try modding it, and if I'm very lucky it won't.
I wasn't really willing to mod my original zapper but I'd at least be willing to do it to a cheap clone like this.
Moreover I have positive report about this gun:
https://twitter.com/rookytooky/status/1 ... 3367101440
Original zapper may not be possible to get working with LCDs, but how about specially designed one that's basically a simple digital camera detecting patterns made by zapper-controlled games (black frame white frame black frame) and sending appropriate signals back to console (hit/not hit, etc.). Output of the CCD would need to be put through some hi/lowpass filter so values over certain luminosity are considered white. Anyone with appropriate electronics knowledge that could do it?
Even if it's changed to respond to all light (not just SDTV scanline frequency), and even if games are reengineered to accommodate scaler lag, it still wouldn't work for games that read up or down by timing from the top of the screen to when light is first seen, such as Operation Wolf. Nor would it work for Super Scope games on Super NES, which read not only up and down but also left and right at a 2.7 MHz (2 horizontal pixel) resolution. The Wii Remote hack would work for both cases.
darkhog wrote:
a simple digital camera detecting patterns made by zapper-controlled games (black frame white frame black frame) and sending appropriate signals back to console (hit/not hit, etc.).
Once you have a camera, you need a computer. Once you have a camera and a computer, the Wiimote or "
computer vision finds the screen and calculates coordinates from that" designs are simpler, more robust, and don't require patching the game.
The Tomee Zapp Gun I ordered from Hyperkin just arrived... and it does detect my LCD screen!
It seems to work reasonably well with morskoyzmey's Duck Hunt beta. In 2-duck mode, sometimes it gets the wrong duck, but I think that's something that could probably be fixed with better delay calibration.
1. Detects light for about 1/2 a second before the signal stops. (i.e. if you point it at an unchanging white spot on the screen, it will give signal for 1/2 a second.) I'm guessing it tries to automatically adapt to the brightness of the room with a slow filter. (Doesn't seem to be a problem for quickly changing light condition like in duck hunt.)
2. Trigger (D4) seems to always report 1 when open, and 0 when pulled. (The normal NES zapper is 0, then pulling it is 1 for 6 frames or so before it returns to 0.) This is good enough for the way it's used in most games, I think, but it is a pretty notable difference in behaviour.
As a quick guess I'd assume they did this because the reverse (unfiltered always 0, 1 when pulled) was a problem for some common games, but I'd have to do some checking to verify.
So... that's pretty cool. A cheap and readily available zapper clone is capable of reading an LCD screen.
Attached a picture of the disassembled gun, and the tiny circuit on the back of the sensor.
Appears to be the same schematic as I
RE'd earlier, just with resistors of twice the size as last time. (1M -> 2M; 100k -> 220k)
The only things I can't tell by visual inspection (for both boards) are
1- how big is the capacitor, and
2- photodiode or phototransistor
There is a D on the side of the board next to the light sensing component. Would that imply diode?
Edit: I checked it in-circuit with a multimeter diode tester. With ambient light conditions, was giving 1 in either direction. With a flashlight next to it, I got .3 in one direction (positive/red to the right side on the circuit on the back, negative/black to the left i.e. touching that J3Y part.)
Sounds like a good guess to me.
Edit: hm, I think those results more nearly imply a phototransistor? photodiodes should look like a diode even when receiving light.
Apparently the marking "J3Y" reliably means the S8050 NPN BJT ? Seems like a pretty typical one, with a current gain of about 200 in the range it's operating in here.
I must share this
https://twitter.com/eNuffGs/status/1046244128365805570One guy just swapped Zapps LED (phototransistor or whatever) with one in original gray Zapper and it worked for him.
... I guess I did observe that a sufficiently bright single flash of light would cause the original zapper to trigger, despite not containing any repetition at all. So I guess it could make sense that a sufficiently higher-gain sensor would make the original 16kHz demodulator circuit rail and trigger with just a single dark-to-light transition.
Just chiming in, but a few friends and I tried the Tomee Zapp Gun and had bad results. Despite a wide range of TV's, we couldn't get the hacks to work. Spoke to the creator several times, but we could not determine the reason. We surmise the build quality was of such poor quality in these guns that it's possible huge batches of them will not work as is. We're currently waiting on another friend to install a pontentiometer that would control the voltage which the light diode gets. This was done by someone on YouTube already, and we hope it works.
You might try the zapper test roms I linked earlier in this thread. They could tell you whether or not your zapper is seeing the light from your TV, and can check function of the trigger.
Hyperkin just announced at CES a new HDTV Light Gun Zapper, which many believe is going to utilize the same technology in the Modern Mallard......
https://www.facebook.com/10698879600289 ... 066715279/http://www.nintendolife.com/news/2019/0 ... with_hdtvs
So they're trying to push that thing work the game-specific adapters again? That's just not cost-effective.
Depending on the details of what is announced at CES, the "Hyper Blaster HD Adapter" in the article could be either bad news or good news.
Bad news: It's a game-specific enhancer that sits between the Game Pak and the Control Deck, as in
Modern Mallard.
Good news: It's a box that receives the composite video from the Control Deck and whatever position cue the gun is putting out and uses the position cue to gate returning the composite signal on the photodiode pin, as in the previous
Wii Remote-driven prototype. The positioning tech could be licensed from one of the companies that sued Nintendo over the Wii Remote.
The picture in the Facebook link shows an adapter. That's not good news.
Yeah, I was hoping for a commercial scale
lightgunverter.
Though I'd be happy even if just more lightgunverters were made.
tepples wrote:
Depending on the details of what is announced at CES, the "Hyper Blaster HD Adapter" in the article could be either bad news or good news.
Bad news: It's a game-specific enhancer that sits between the Game Pak and the Control Deck, as in
Modern Mallard.
Good news: It's a box that receives the composite video from the Control Deck and whatever position cue the gun is putting out and uses the position cue to gate returning the composite signal on the photodiode pin, as in the previous
Wii Remote-driven prototype. The positioning tech could be licensed from one of the companies that sued Nintendo over the Wii Remote.
It's almost certainly the Modern Mallard design. However, if the new light gun has "modern" components, it should hopefully be good enough to work on most if not all HDTV's, for which you could use the LCD NES modded roms with an Everdrive, and play the other Zapper games.