News: 11 March 2016 - Forum Rules

Author Topic: Duck Hunt Hacking  (Read 914 times)

tygerbug

  • Full Member
  • ***
  • Posts: 112
    • View Profile
Duck Hunt Hacking
« on: May 19, 2022, 12:39:59 pm »
I might as well start with linking to Alexey's experimental LCD mods for NES Zapper games.

http://neslcdmod.com/roms/#DuckHunt



Awhile back I drew some pixel art for a version of Duck Hunt starring Scrooge McDuck, in place of the dog. You would be shooting moneybags.

My first attempt is at top left and right. I had him walking very low to the ground, to match the dog, and it looked pretty strange.

I then redrew him to be standing upright, figuring I could hack the game's construction to achieve that. My first effort was too large, and I shrunk him down to use up about 33 tiles like the original.

I'm now experimenting with putting the graphics into the ROM.

Unfortunately it hasn't been straightforward in the least.

The sprite tiles (and their palettes) and their locations onscreen are stored in two separate tables.

I started with the dog holding one duck, which is at 1F4F and 1CD0 respectively. Some of this construction is reused for holding two ducks.

The list of tiles looks something like this. (This is my altered version in progress.) I've bolded the actual tiles used.

00 FD 03 00 D8 E8 FF
FD 03 D7 E7 FF 00
FD 02 E0 D3
FD 03 D6 E4 FF 01
FD 43 E4
FD 02 E3 FF 01
FD 42 E0
FD 02 D0
FD 01 E5
FD 43 E2
FD 42 D0
FE D3 E3
FD 43 D2 D1
FD 01 E1
FE FD 43 D6
FD 41 D5 D4 FF 00
FD 42 D0 FF

Each line seems to start with an FD or sometimes FE. One line has both. I'm not sure what the difference is, but it breaks the construction to switch them. There are also some FFs, 00s and 01s. Not sure about those either.

After the FD is the palette choice, which also notes whether the sprite is flipped horizontally. (01/02/03 or 41/42/43 here.)

Things start to get weird in the specifics, which are inconsistent here. About half the tiles are grouped together as two, for some reason. This generally means they are stacked vertically, but in one case (D2 D1 here) it's horizontal. One line doesn't call the palette at all. Some lines end (or begin?) with an FF and maybe an 00/01, some don't.

The first line has three sprites in it, in this version - originally there was a space there.

Tiles being grouped together as two causes some problems for me. Some tiles need to be flipped horizontally, and some tiles need a different palette, and in some cases tiles were grouped together making that impossible. So I started to move them around for that reason, hoping I could fix it in the construction.

Unfortunately, the construction makes this problem worse.

Here's the rest of the construction as hex. Part of his dangling right arm is elsewhere, and so is the construction for holding two ducks.

Code: [Select]
00 00 08 00
10 00 18 00
00 08 08 08
10 08 18 08

00 00 00 08
00 10 00 18
08 00 08 08
08 10 08 18
10 00 10 08
10 10 10 18
18 00 18 08
18 10

Pretty straightforward at a glance. Each pair of numbers sets Y and H position onscreen. They keep increasing by eight in hex - 00, 08, 10, 18.

It seems to repeat halfway through, albeit with bytes reversed if I've got this right.

I'd put tiles in the "wrong places" so that they would be appropriately grouped (so I could change the palette or mirroring).

So now I needed to move these tiles around. And things immediately got weird.

When I'd move one tile, another tile would move with it. I expected that from tiles grouped together, but these were tiles two groups apart, and pretty far apart onscreen. It was an exercise in frustration where I just couldn't get the results I needed. This wasn't true of every tile but was true of a few of them ... perhaps the ones that don't have FF 00 inbetween the lines.



This also seemed to, somehow, ruin the construction for the flying ducks. I don't think I did anything else that would have caused that.

At the time I stopped today, my code looked like this:

Code: [Select]
00 00 08 00
18 00 18 00
00 08 08 08
10 08 18 08
18 00 F8 F8
00 10 10 08
F8 00 08 08
08 00 10 00
08 08 08 10
10 10 00 18
18 00 18 08 18 10

https://drive.google.com/file/d/1-jNCi1awtxaZbcZN_wl6mSK3Uyo01OHZ/view?usp=sharing


It was seemingly impossible to get acceptable results for a metasprite which is very close to what's in the original game.

So this bodes very badly for the walking sprite which would have to have a very different construction.

I'd hoped I could just paste in the construction from NES Screen Tool, and that's not happening.

So I'm not sure what's going on here, and I'm wondering if anyone has disassembled or looked at this game in more detail ....
« Last Edit: May 19, 2022, 01:50:49 pm by tygerbug »

Cyneprepou4uk

  • Hero Member
  • *****
  • Posts: 894
  • I am the baldest romhacker
    • View Profile
Re: Duck Hunt Hacking
« Reply #1 on: May 19, 2022, 08:15:08 pm »
I've made a quick disassembly of the original game, hope it helps a bit.
https://gofile.io/d/P36lZp

tygerbug

  • Full Member
  • ***
  • Posts: 112
    • View Profile
Re: Duck Hunt Hacking
« Reply #2 on: May 20, 2022, 01:12:57 am »
  Cheers. Maybe that will help somehow.