NES zapper + LCD

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems. See the NESdev wiki for more information.

Moderator: Moderators

nocash
Posts: 1405
Joined: Fri Feb 24, 2012 12:09 pm
Contact:

Re: NES zapper + LCD

Post by nocash »

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 (!)
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: NES zapper + LCD

Post by rainwarrior »

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.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: NES zapper + LCD

Post by lidnariq »

The schematic of this clone seems to be:

Code: Select all

  +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
Last edited by lidnariq on Thu Sep 20, 2018 1:31 pm, edited 1 time in total.
nocash
Posts: 1405
Joined: Fri Feb 24, 2012 12:09 pm
Contact:

Re: NES zapper + LCD

Post by nocash »

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.
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: NES zapper + LCD

Post by rainwarrior »

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.
User avatar
morskoyzmey
Posts: 13
Joined: Sat Sep 15, 2018 2:59 pm

Re: NES zapper + LCD

Post by morskoyzmey »

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
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: NES zapper + LCD

Post by tokumaru »

There was a project recently that took care of the 2 mods, the game and the Zapper: https://www.kickstarter.com/projects/me ... rn-mallard

The 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...
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: NES zapper + LCD

Post by tepples »

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.
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: NES zapper + LCD

Post by tokumaru »

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.
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: NES zapper + LCD

Post by rainwarrior »

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/
grynold
Posts: 9
Joined: Fri Jan 01, 2016 9:11 am

Re: NES zapper + LCD

Post by grynold »

Seems like it can work with an unmodified zapper?
http://retrorgb.com/neslcdmod-beta.html
User avatar
koitsu
Posts: 4201
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: NES zapper + LCD

Post by koitsu »

grynold wrote:Seems like it can work with an unmodified zapper?
http://retrorgb.com/neslcdmod-beta.html
If 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... :/
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: NES zapper + LCD

Post by rainwarrior »

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.html
It 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.
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: NES zapper + LCD

Post by rainwarrior »

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.
Last edited by rainwarrior on Fri Sep 21, 2018 3:26 pm, edited 2 times in total.
User avatar
krzysiobal
Posts: 1037
Joined: Sun Jun 12, 2011 12:06 pm
Location: Poland
Contact:

Re: NES zapper + LCD

Post by krzysiobal »

Maybe instead of modyfing games, just apply code-injection that triggers after reading $4017?
Post Reply