Jump to content
NHL'94 Forums

Process to Change Palettes on Sprites - My Notes


kingraph

Recommended Posts

Concept you should be familiar with ahead of time:

* Hex values and a Hex Editor
* Tile Molester
* Basic Graphics (Tiles, palettes)

There is an issue in NHL Hockey (sometimes referred here as "NHL'92") where the away team's sprite in the penalty box shows the home team colors on their socks.  Essentially, there are two tiles that are using the home team palette but should be using the away team palette.  

The goal was to find out where this information was in the ROM and change it from home palette to away palette.  The following is the process I used, in case this helps out others in the future.

The first step I did was to find the actual tiles in the ROM that had the mistake.  To do this, I used the GENS Emulator that has a nice VDP Sprite tool.  Using this tool, I found the socks.  

 

 

01 confirm tiles VDP.png

The useful information here was that it was a 1x2 (08x16) tile, it was using palette ("Pal") 2 (which is really 3 since we start at 0) and that it had a horizontal flip (capital H on the flags).  I dumped the image, which gives me the tile in a bmp format.

So now I knew what the actual tile looked like, and my next step was to find it in the ROM.  I opened up Tile Molester and created a test ROM.  I loaded the Harford palette, which can be found using NOSE.  

02 NOSE Palette.png

You can browse through and try to eyeball until you find the matching tile.  Instead, I made a copy of the tile in a test ROM by pasting the dumped tiles.  NOTE:  The colors for the white/gray didn't paste exactly right, so I had to double check and manually adjust.

03 paste sprite.png

Once I had the tiles in my test ROM, I opened up the test ROM in HxD (my hex editor) and copied the first tile information.  I then searched for those hex values in the regular ROM, and found the location of the actual tile at 74BDA.

04 Find Tile.png

I went back into TM and went to that offset (still using Hartford home palette)

05 TM tile.png

This was very useful information to have, especially if I wanted to alter or redraw the sprites.  However, I still needed to find the information in the ROM that instructed the game to use the home palette for these tiles and change that to away.

I used the technique that @AdamCatalyst posted here

  

On 4/27/2023 at 1:11 PM, AdamCatalyst said:

The Journey

I couldn't stop thinking about this. I obsessed over the code for a few hours and eventually got too frustrated, so I went for a short walk. When I sat back down I looked at my notes again, and it hit me…

  1. Assume, for arguments sake, that the puck tiles are referenced using a 16 column grid, and similar syntax to the other major tile groups.
     
  2. Seeing as the puck tiles are amidst the sprite tiles, let's assume that the very first sprite tile is x000.
     
  3. Counting from this registration point, that would mean that the code that references the puck tiles, would likely be specified as "02F5" to "02FC."
     
  4. Doing a search for "02F5" yields only two results, and the first result is followed by "02F6," six-bytes later, and then "02F7" six-bytes, after that, etc.
     
  5. The next two bytes after these potential tile references are either "0000" or "0800". If you don't know what this means, read this post to understand.

 

Using this Journey idea, these tiles were 1D and 1E in the tile group that they were located in:

06 tile numbers.png

Using the information from above, I knew it was a 1x2 tile group, the starting tile is likely to be 1D, it was using the home palette (4) and it had a horizontal flip (add x8xx).  I decided to look for hex values of "481D".  Read the information in Adam's post earlier if this is unclear.

So doing a search for 481D, I found 6 instances!

07 find instances.png

Each one was preceded with a 0100, which from my some previous knowledge on block sizes, meant a 1x2 block.

Bytes	Block Size
0F00	4x4
0E00	4x3
0D00	4x2
0C00	4x1
0B00	3x4
0A00	3x3
0900	3x2
0800	3x1
0700	2x4
0600	2x3
0500	2x2
0400	2x1
0300	1x4
0200	1x3
0100	1x2
0000	1x1

After that, I changed those bytes from 481D to 681D, ultimately confirming that the first 3 were the away team sprites that had to be changed, and the other 3 were the home team (which was using the correct palette).  

This particular fix put together a few pieces of information found on the forums.  Many thanks to @wboy and @slapshot67 for all of their knowledge, and @AdamCatalyst's process that helped me tackle this particular puzzle.  

  • Thanks 4
  • Like 1
Link to comment
Share on other sites

20 hours ago, kingraph said:

You can browse through and try to eyeball until you find the matching tile. 

Hah.
*sheepishly raises hand*

Yeah this might have been my typical method until I had a location map put together. Sometimes accompanied with drawing numbers and shapes to see all the places a tile is used. Need to try out these fancier techniques some time.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Who's Online   0 Members, 0 Anonymous, 139 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...