What's up with VS Duck Hunt?

Discuss hardware-related topics, such as development cartridges, CopyNES, PowerPak, EPROMs, or whatever.

Moderators: B00daW, Moderators

User avatar
oRBIT2002
Posts: 643
Joined: Sun Mar 19, 2006 3:06 am
Location: Gothenburg/Sweden

What's up with VS Duck Hunt?

Post by oRBIT2002 »

I'm scratching my head a little in my attempt of making VS Duck Hunt usable on a standard NES. As soon as I change mapper number, the introscreen music freezes. The "aim and fire to start game" (efter coin inserted) gets a white background aswell.
I'm pretty sure this has something to do with the VS-"features" of $4016/$4017 but has a difficult time finding out what's causing this behaviour
Anyone got any ideas/experiences with this title?
WhoaMan
Posts: 167
Joined: Sat Oct 02, 2004 12:07 pm

Re: What's up with VS Duck Hunt?

Post by WhoaMan »

what mapper are you changing it to? and what are you specifying for the PRG and CHR sizes?

this might have to do with some bankswitching, since VS Duckhunt has 16kb of CHR (changed on the VS by writing to $4016)

Also, keep in mind that $4016 is player 2 on the VS, and $4017 is player one. You may also have to invert the hit detection bit.
i dont have much to say
User avatar
Quietust
Posts: 1786
Joined: Sun Sep 19, 2004 10:59 pm
Contact:

Re: What's up with VS Duck Hunt?

Post by Quietust »

The Vs. System uses a special type of zapper which does not follow the normal protocol - rather than reading $4016/$4017 once and getting "sense" on D3 and "trigger" on D4, it strobes the light gun and reads 8 bits back, where the 7th bit is "sense" and the 8th bit is "trigger".
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.
User avatar
oRBIT2002
Posts: 643
Joined: Sun Mar 19, 2006 3:06 am
Location: Gothenburg/Sweden

Re: What's up with VS Duck Hunt?

Post by oRBIT2002 »

I'm changing it to mapper 1. I've patched the CHR-swapping so that's not the problem..
I'm pretty confident there's something about the $4016 that's causing the issues. I've debugged a bit of $4016-related code with FCEUX and detected that codepaths are not always
the same running the game as mapper 99 or mapper 1.

I've located some odd-looking code at $84D5 (see below). Check that "LDA $4016,Y" code. I can't see it's doing anything with the result at all. However if I instead patches this to a LDA #0 in the original mapper 99 ROM, I get the same freezing-issues as my mapper 1 version.

EDIT: Btw, thanks for the info about this special-Zapper, didn't knew that. I haven't seen this documented anywhere...(?)

Code: Select all

0:84D5:A2 00  LDX #$00
 00:84D7:AD 62 06  LDA $0662 = #$04
 00:84DA:09 01     ORA #$01
 00:84DC:8D 16 40  STA $4016 = #$FF
 00:84DF:29 FE     AND #$FE
 00:84E1:8D 16 40  STA $4016 = #$FF
 00:84E4:8D 62 06  STA $0662 = #$04
 00:84E7:20 EB 84  JSR $84EB
 00:84EA:E8        INX
 00:84EB:A0 08     LDY #$08
 00:84ED:48        PHA
>00:84EE:BD 16 40  LDA $4016,X @ $4016 = #$FF
 00:84F1:4A        LSR
 00:84F2:68        PLA
 00:84F3:2A        ROL
 00:84F4:88        DEY
 00:84F5:D0 F6     BNE $84ED
 00:84F7:DD 40 04  CMP $0440,X @ $0440 = #$00
 00:84FA:D0 0F     BNE $850B
 00:84FC:FE 42 04  INC $0442,X @ $0442 = #$02
 00:84FF:BC 42 04  LDY $0442,X @ $0442 = #$02
 00:8502:C0 05     CPY #$05
 00:8504:90 0D     BCC $8513
 00:8506:95 16     STA $16,X @ $0016 = #$00
 00:8508:4C 0E 85  JMP $850E
 00:850B:9D 40 04  STA $0440,X @ $0440 = #$00
 00:850E:A9 00     LDA #$00
 00:8510:9D 42 04  STA $0442,X @ $0442 = #$02
 00:8513:60        RTS
User avatar
oRBIT2002
Posts: 643
Joined: Sun Mar 19, 2006 3:06 am
Location: Gothenburg/Sweden

Re: What's up with VS Duck Hunt?

Post by oRBIT2002 »

I've patched pretty much everything now that relates to the VS Zapper and the game actually detects the trigger now (in FCEUX anyway..). However it doesn't registers any hit, not sure why's that so.. The player select screen comes with a constant white background, I am not sure why..
User avatar
Quietust
Posts: 1786
Joined: Sun Sep 19, 2004 10:59 pm
Contact:

Re: What's up with VS Duck Hunt?

Post by Quietust »

The "light sense" bit in the standard Zapper is inverted (0 = sensing light, 1 = not sensing light), while the equivalent bit in the Vs. Zapper is not inverted (1 = sensing light, 0 = not sensing light).
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: What's up with VS Duck Hunt?

Post by tepples »

I'd like to write some tests for the Vs. Zapper, such as a modified zapkernel for Zap Ruder. But I don't own a Vs. Duck Hunt cabinet myself. Is there anyone willing to run some test ROMs for me?
User avatar
oRBIT2002
Posts: 643
Joined: Sun Mar 19, 2006 3:06 am
Location: Gothenburg/Sweden

Re: What's up with VS Duck Hunt?

Post by oRBIT2002 »

I suspect the 5th bit, that's "1" in the $4016-stream, is somekind of "is connected" flag...
User avatar
nintendo2600
Posts: 367
Joined: Mon Mar 30, 2009 4:40 pm

Re: What's up with VS Duck Hunt?

Post by nintendo2600 »

Oh I really hope you get this working and are willing to share. I got a 20 year
old itch to shoot that damn dog that needs to be scratched! :)
User avatar
oRBIT2002
Posts: 643
Joined: Sun Mar 19, 2006 3:06 am
Location: Gothenburg/Sweden

Re: What's up with VS Duck Hunt?

Post by oRBIT2002 »

If I ever get it running, of course I'll share an .ips.
User avatar
oRBIT2002
Posts: 643
Joined: Sun Mar 19, 2006 3:06 am
Location: Gothenburg/Sweden

Re: What's up with VS Duck Hunt?

Post by oRBIT2002 »

I think I've hacked this game into pieces now, can't still get pass the player select screen. :( I've tried "hijacked" all $4016/$4017 reads on the original ROM to see if I can reproduce the behaviour, without any luck.
I get the feeling there's some weird stuff about the sense-bit since the player-select screen looks like I've pressed the trigger, all the time (light background).
Is the sense-bit updating itself "all the time" or only when trigger is pressed?
3gengames
Formerly 65024U
Posts: 2281
Joined: Sat Mar 27, 2010 12:57 pm

Re: What's up with VS Duck Hunt?

Post by 3gengames »

Why not put it on VS type, but dump 16 or so 4016/17 reads to RAM and see what causes them to go 1 to see from there? Or you can look at the emus source?
User avatar
Memblers
Site Admin
Posts: 3901
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Re: What's up with VS Duck Hunt?

Post by Memblers »

oRBIT2002 wrote:I suspect the 5th bit, that's "1" in the $4016-stream, is somekind of "is connected" flag...
Yeah, it's used for an audible alarm in case someone tries to steal the gun (or otherwise disconnect it).
User avatar
oRBIT2002
Posts: 643
Joined: Sun Mar 19, 2006 3:06 am
Location: Gothenburg/Sweden

Re: What's up with VS Duck Hunt?

Post by oRBIT2002 »

Anyone with some good 6502-asm skills/NES-hardware skills and interested in some DuckHunt(VS)-hacking? I'm beginning to give up here now and would really like to get some help. Interested? Send me a pm.
User avatar
oRBIT2002
Posts: 643
Joined: Sun Mar 19, 2006 3:06 am
Location: Gothenburg/Sweden

Re: What's up with VS Duck Hunt?

Post by oRBIT2002 »

I finally did it! :)


EDIT: Here it is:
http://nes.goondocks.se

My most complex patch yet, phew! Here are the features of this one:
* Patched to use mapper 1 instead of odd mapper 99.
* VS-Zapper emulation
* VS-Zapper theft-detection-alarm cracked. :)
* Coin-insert emulation by pressing "Start" on gamepad in port 1.
Last edited by oRBIT2002 on Thu Apr 11, 2013 10:49 pm, edited 1 time in total.
Post Reply