Mapper 036 and the Zapper

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
User avatar
zeroone
Posts: 932
Joined: Mon Dec 29, 2014 1:46 pm
Location: New York, NY
Contact:

Mapper 036 and the Zapper

Post by zeroone » Sun May 05, 2019 7:33 am

I ported the NintendulatorNRS implementation of Mapper 036 to my emulator. All the games seems to function except for Strike Wolf. Visually it looks fine; however, it does not properly respond to the Zapper trigger. It looks like the white rectangle masks are not scanning the entire screen. I suspect it demonstrates some flaw with my Zapper implementation. Any suggestions?

NewRisingSun
Posts: 1199
Joined: Thu May 19, 2005 11:30 am

Re: Mapper 036 and the Zapper

Post by NewRisingSun » Sun May 05, 2019 10:13 am

When the Zapper is fired, the game for some inscrutable reason sets the grayscale flag ($2001 D0), so instead of having white rectangles against a black background, you have white rectangles against a gray background. I do not know how responsive this game is on real hardware, with a real Zapper. It may be very unresponsive if the gray background reduces the contrast too much, or it might not matter if the light sensor somehow takes the average brightness into account, which I find a bit hard to believe.
Strike Wolf 1.PNG
Strike Wolf 1.PNG (1.96 KiB) Viewed 6655 times
Strike Wolf 2.PNG
Strike Wolf 2.PNG (209 Bytes) Viewed 6655 times
Strike Wolf 3.PNG
Strike Wolf 3.PNG (111 Bytes) Viewed 6655 times
Strike Wolf 4.PNG
Strike Wolf 4.PNG (111 Bytes) Viewed 6655 times
One means of getting this game to detect hits better in one's emulator therefore is to treat color $00 as black for Zapper detection purposes. If one wanted to patch the game, changing the byte at offset $0177 of the headered NES ROM file from $09 to $08 prevents setting the grayscale flag, so hit detection will be performed on white against black instead of white against gray.

User avatar
zeroone
Posts: 932
Joined: Mon Dec 29, 2014 1:46 pm
Location: New York, NY
Contact:

Re: Mapper 036 and the Zapper

Post by zeroone » Sun May 05, 2019 11:27 am

Thanks for the detailed explanation.

Is it possible that the grayscale flag affects color $00 in a way that it renders it much darker on real hardware compared to what we currently do in emulation?

NewRisingSun
Posts: 1199
Joined: Thu May 19, 2005 11:30 am

Re: Mapper 036 and the Zapper

Post by NewRisingSun » Sun May 05, 2019 11:37 am

No, all the grayscale flag does is AND the final color number, that provides the input to the color generator, with $30.

User avatar
Quietust
Posts: 1567
Joined: Sun Sep 19, 2004 10:59 pm
Contact:

Re: Mapper 036 and the Zapper

Post by Quietust » Mon May 06, 2019 4:55 am

The good news is that you can probably get that specific game to work by just using a custom palette - Nintendulator's zapper logic works by looking at the RGB values in a 16x16 pixel square beneath the cursor with an overall brightness threshold of 25%, so all you should need to do is ensure that color 00 is #3F3F3F or darker.
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.

Post Reply