How to Lookup Tile Data Integer (for Mesen HD Pack Building)

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

Post Reply
rowejere
Posts: 20
Joined: Fri Sep 08, 2017 7:19 am

How to Lookup Tile Data Integer (for Mesen HD Pack Building)

Post by rowejere » Fri Oct 12, 2018 8:45 am

How would one go about looking up the tile data integer value for a certain graphic? I am familiarizing myself with the conditions function of the HD Pack Builder in Mesen and the following variables are needed:

-x and y screen position (I figured out that this can be determined using the event viewer in the Mesen debugger)

**-Tile data (I haven't figured out this one yet)

-Palette data (I figured out that this can be determined easily by navigating to the debugger, then PPU viewer, then CHR viewer, then,
it's listed under "color picker").

For example, one condition which has already been created for a prior pack is shown below. While studying it, I have been unable to determine where the "138" value came from.

#Title screen
<condition>TitlePlanetSurfaceShown,tileAtPosition,0,232,138,0F281808
[TitlePlanetSurfaceShown]<background>mmtitle.png,1


Mesen HD Pack Documentation: https://www.mesen.ca/docs/hdpacks.html

Sour
Posts: 815
Joined: Sun Feb 07, 2016 6:16 pm

Re: How to Lookup Tile Data Integer (for Mesen HD Pack Build

Post by Sour » Sat Oct 13, 2018 6:30 am

In the PPU viewer, you can right click on any tile in any of the tabs to copy the HD pack tile data and palette to your clipboard.

138 in this case is the tile's index in the CHR ROM.
Note that starting 0.9.7 the tile indexes are now in hex instead of decimal (to make it easier to find the tile in the CHR viewer)

rowejere
Posts: 20
Joined: Fri Sep 08, 2017 7:19 am

Re: How to Lookup Tile Data Integer (for Mesen HD Pack Build

Post by rowejere » Sat Oct 13, 2018 8:07 pm

Worked like a charm - A lot simpler than I thought it might be. Thank you!

rowejere
Posts: 20
Joined: Fri Sep 08, 2017 7:19 am

Re: How to Lookup Tile Data Integer (for Mesen HD Pack Build

Post by rowejere » Tue Oct 16, 2018 6:23 am

Sorry, but I may have spoken too soon. This method did work to generate data that mostly matched what is located in the aforementioned example. I thought this would result in smooth sailing. However, I unfortunately ran into another issue. As you noted, this method generated a hex value (rather than a numeric value). So, when I tried replacing the "hires.txt" example value of 138 with the new hex value (in this case, C8) it seemed to result in the HD graphics no longer working.

When you mentioned that the new tile indexes are now in hex, does that mean that the "right click" functionality only generates a hex value? Additionally, does this mean the "conditions" function in a "hires.txt" file can only still read a numeric value for the tile data (rather than hex)? If so, is there still an alternate method to determine the numeric value for HD pack building?

Sour
Posts: 815
Joined: Sun Feb 07, 2016 6:16 pm

Re: How to Lookup Tile Data Integer (for Mesen HD Pack Build

Post by Sour » Tue Oct 16, 2018 3:38 pm

Hires.txt files are versioned, if you're trying to edit an existing pack that was not built with 0.9.7, you should probably use 0.9.6. 0.9.7 can read older packs, but the tools are only meant to help create packs using the latest specs.

rowejere
Posts: 20
Joined: Fri Sep 08, 2017 7:19 am

Re: How to Lookup Tile Data Integer (for Mesen HD Pack Build

Post by rowejere » Thu Oct 18, 2018 3:58 pm

That makes sense - Thanks.

I did come across what appears to be a little quirk. When using 0.9.7 to build a pack, right clicking generates a hex value (as expected). However, when adding a condition to a pack generated by version 0.9.7, the only situation in which a condition seemed to behave properly was when a numeric tile value was used rather than a hex value. In other words, the automated data entries use hex values and the conditions only work with numeric values. The hires.txt file only seems to work with a combination of both in the latest version. Is this intended behavior from the emulator? I can copy and paste some example entries if it would help explain.

Sour
Posts: 815
Joined: Sun Feb 07, 2016 6:16 pm

Re: How to Lookup Tile Data Integer (for Mesen HD Pack Build

Post by Sour » Fri Oct 19, 2018 4:17 am

That sounds like a bug to me - I completely forgot some conditions also used tile indexes. I'll have to fix it (and change the version number again) in the next release.

unregistered
Posts: 1071
Joined: Thu Apr 23, 2009 11:21 pm
Location: cypress, texas

Re: How to Lookup Tile Data Integer (for Mesen HD Pack Build

Post by unregistered » Wed Oct 24, 2018 8:54 am

rowejere wrote: -Palette data (I figured out that this can be determined easily by navigating to the debugger, then PPU viewer, then CHR viewer, then,
it's listed under "color picker").
To make this process even easier you could click Options>Preferences>the check box next to 'Enable developer mode' on the General tab. (Puts all of the debugger's helpful icons, like the PPU viewer, in the Debug menu.) :)

Post Reply