kingraph Posted December 22, 2023 Report Share Posted December 22, 2023 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. 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. 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. 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. I went back into TM and went to that offset (still using Hartford home palette) 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… Assume, for arguments sake, that the puck tiles are referenced using a 16 column grid, and similar syntax to the other major tile groups. Seeing as the puck tiles are amidst the sprite tiles, let's assume that the very first sprite tile is x000. Counting from this registration point, that would mean that the code that references the puck tiles, would likely be specified as "02F5" to "02FC." 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. 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: 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! 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. 4 1 Quote Link to comment Share on other sites More sharing options...
smozoma Posted December 22, 2023 Report Share Posted December 22, 2023 Nice trick to find the tiles, by inserting an identical tile in a known location then finding duplicate hex in the file 1 1 Quote Link to comment Share on other sites More sharing options...
AdamCatalyst Posted December 23, 2023 Report Share Posted December 23, 2023 7 hours ago, kingraph said: Instead, I made a copy of the tile in a test ROM by pasting the dumped tiles. I never would have thought of doing this. Thanks for sharing your thinking on all this! 1 Quote Link to comment Share on other sites More sharing options...
von Ozbourne Posted December 23, 2023 Report Share Posted December 23, 2023 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. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.