Zapruder calibration

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Zapruder calibration
by on (#127776)
I recently added zapper emulation to Bizhawk. A few games that I've tried seem to be working, but I want response to be as similar as possible to how it was on real hardware. I tried zapruder, but the docs for it don't seem to give any indication of how hardware should respond.
Re: Zapruder calibration
by on (#127778)
Just as with overscan amounts, different TVs at different settings produce different results in Zap Ruder. If you have an NES, a Zapper, and a CRT SDTV, contribute your results for different hue/bright levels and different line patterns here. I may give numbers from my Magnavox TV later tonight.
Re: Zapruder calibration
by on (#127780)
Y COORD 1 GUN

Tests with hue 0
B 5+: HT= 26
B 4: HT= 25
B 3: HT= 24
B 2: HT= 23
B 1: HT= 17
B 0: HT= 0

Tests with hue 2 (blue)
B 6+: HT= 26
B 5: HT= 25
B 4: HT= 24
B 3: HT= 22
B 2: HT= 20
B 1: HT= ~10 (heavy fluctuation)
B 0: HT= 0

Tests with hue 6 (red)
B 8: HT= 26
B 7: HT= 25
B 6: HT= 24
B 5: HT= 23
B 4: HT= 20
B 3: HT= ~13 (heavy fluctuation)
B 2-: HT= 0

Tests with hue 8 (yellow)
B 8: HT= 26
B 7: HT= 25
B 6: HT= 25
B 5: HT= 24
B 4: HT= 22
B 3: HT= ~15 (heavy fluctuation)
B 2-: HT= 0

Tests with hue 10 (green)
B 7+: HT= 26
B 6: HT= 25
B 5: HT= 24
B 4: HT= 22
B 3: HT= 18
B 2-: HT= 0

In Y COORD 1 GUN, Y went up (decreased in value) slightly when I held the gun still while increasing the brightness. And in BALL TARGET, with a radius of 4 and bright 5 hue 0, HT ranged from 0 to 21 depending on how well the barrel was centered over the ball in the middle. This indicates that it's integrating light over a circle. I could acquire targets with HT=15 down to radius 1.

X coordinates in X AND Y COORDS seem to vary randomly, frame to frame, in a range 6 units wide (each unit is 18 pixels) with less probability at the sides. This variability is why I ended up rejecting the XY zapkernel from production use.

Vertical lines, bright 5, hue 0:
0-9 20-23 22-24 23-24
24-25 26-27 26-27 26-27
18-19 23-24 25-26 22-23

Horiz. lines, bright 5, hue 0:
16-23 19-25 20-26 20-26
24-26 25-27 26-27 25-26
20-23 24-26 25-26 24-25
For this test pattern, the Y coordinate appears to jump over areas that are black.

Trigger time
Pulling the trigger produces a "click" as the switch turns on and then a "clank" as it turns back off. Held time counts from the "click" to the "clank". It's usually 5 for a normal pull, can't get it lower than 4, may be some capacitor extending the pulse from click to clank. Games may interpret a long press (hold at "click" for more than 15 frames) differently from a short press (click through to clank). For example, Music Toy: Axe treats a short press as a long-term timbre change and a long press as a single note accent.
Re: Zapruder calibration
by on (#127782)
natt wrote:
I recently added zapper emulation to Bizhawk. A few games that I've tried seem to be working, but I want response to be as similar as possible to how it was on real hardware. I tried zapruder, but the docs for it don't seem to give any indication of how hardware should respond.
Here's some numbers I pulled out from manually playing with a white LED, microcontroller, disassembled zapper, and oscilloscope:
- The notional period of a scanline inside the zapper is determined by an RC time constant, so can vary by up to 20% as a function of the parts used. Mine, however, does seem to be tuned to 16kHz to the precision that I can measure.
- The frequency selectiveness of the zapper is really lousy, barely providing 3dB of rejection within the adjacent decade of frequencies
- After the output has fired and no light is falling on the photodiode, the output will go false again after approximately 600-800µs.
- A single sufficiently bright light pulse (measured in terms of total amount of photocurrent, i.e. charge) will cause the light detect output to go true exactly three scanlines later.
- A single dimmer light pulse will still cause the output to go true, but it will randomly vary anywhere between four to sixteen scanlines later
- I was unable to usefully determine what the lower threshold for light detection was
- Periodic input will decrease the delay of the latter case: one of the pins of the IR3T07A rises in a tilted triangle wave (slow rise, fast fall, rising more than falling) after it's been triggered. Light input while the pin is rising causes it to rise faster; light input while the pin is falling has no effect.
- The final output (as seen by the NES) is a hysteretic buffer from the analog signal mentioned in the previous point, which is then inverted twice more before it is seen by the CPU.

The minimum trigger time is exactly determined by the 10kΩ pullup inside the NES and the 10µF capacitor inside the zapper.