VS. Duck Hunt zapper not responding properly [SOLVED]

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: VS. Duck Hunt zapper not responding properly

Post by lidnariq »

zeroone wrote:It looks like it positions sprite0 in the middle of the first scanline.
That's not what I'm seeing in Nintendulator (There sprite 0 is at Y=$EE on both black and white frames)
User avatar
zeroone
Posts: 939
Joined: Mon Dec 29, 2014 1:46 pm
Location: New York, NY
Contact:

Re: VS. Duck Hunt zapper not responding properly

Post by zeroone »

tepples wrote:How well does your emulator handle Zap Ruder (which uses a normal D4/D3 Zapper, not the Vs. Zapper)? It also uses sprite 0 at the top and counts scanlines to determine. If I had a Zapper modified to also speak Vs. protocol, I might be able to help you by making a test ROM.
Zap Ruder appears to work perfectly. It's unfortunate there is no VS Zapper version of it.
User avatar
zeroone
Posts: 939
Joined: Mon Dec 29, 2014 1:46 pm
Location: New York, NY
Contact:

Re: VS. Duck Hunt zapper not responding properly

Post by zeroone »

lidnariq wrote:
zeroone wrote:It looks like it positions sprite0 in the middle of the first scanline.
That's not what I'm seeing in Nintendulator (There sprite 0 is at Y=$EE on both black and white frames)
I think you just revealed the issue. Apparently there is a flaw in my PPU implementation. It is reporting a sprite0 hit on the pre-render scanline (scanline -1). I put in a check to prevent that and now it detects it on scanline 239 ($EF). More importantly, the game works now!

It's really amazing that this flaw was not revealed in any other games. That's nuts. I'll study my code further to understand how this happened. Thanks so much everyone.

Edit: That solves the issue with VS Hogan's Alley also. And, it didn't break Battletoads or the Simpsons HUD, etc. Interesting.

Edit 2: The unlicensed game Lethal Weapon (Ch) [!].unf still does not work. But, it doesn't work correctly in Nestopia either. So, I can live with that.

Edit 3: Thanks again everyone. This change did not affect the test ROM results either. I'm still amazed that this issue wasn't detected until now.
Post Reply