Thanks, I've been looking at that but still no luck.
I'm trying to Bowser's eyes now and God, I give up. The .tpl has more data than the offset for the next texture (hair).
This is the parameter data:
27 - 18Eye - 00061520 (26 lines) -48 {208 colors}
~
28 - 19Hair1 - 000626e0
The Eye tpl is about twice as long as the space between those inputs.
Bowser's eye should be a pretty small texture, even if it is indexed... However, Bowser's is a little more complicated than Mario.
There are 2 parts to an indexed texture (anything ending in _8 or _9 is an indexed texture).
The first part, is the palette data. It can range from 2 to 32 lines. If 32 lines, it starts at offset 0x20 and ends at offset 0x210 in the TPL. If 2 lines, it starts at 0x200 and ends at offset 0x210 in the TPL. If anything else, simply count the lines. I'd recommend starting at the top at 0x20, then subtracting from 32 downward. In Bowser's eye's case, his starts at 0x80 and ends at 0x210.
The second part, is the actual texture data, which starts at offset 0x260 onward in the TPL.
If you're 32 lines, or if your file ends in _8, all you do is copy the appropriate number of lines (usually located in parenthesis in the Placement/Offset TXT file), and paste them -- first the texture data, THEN the palette data directly afterward.
However... if the indexed file has anything other than 32 lines, you need to do some math for the texture data.
In your case, you need to subtract
48 from Bowser's TPL. I use Hex Workshop to subtract, but you can use whatever. Go to offset
00000260
and select all the hex from that offset downward. If you're using Hex Workshop, you go to
Tools -> Operations -> Subtract...
Treat Data As:
8 bit Unsigned Byte
Byte Ordering: Little Endian (e.g. Intel)
Value: [enter number to be subtracted here, in this case,
48]
[x]
Decimal
Apply On: [x]
Selection
Press OK, then save your file. Press OK if you want to save a copy.
After subtracting, go into your main hex program (in my case, Hex Editor Neo). Scroll down to offset
00000260 ~ end of file
(the texture data), and now copy the hex and paste it at offset 00061250 in Bowser's DAT file.
Then, directly after, copy from offset
00000080 ~ 00000210
(the palette data) and paste that directly after.
Now... if you're messing with Bowser's other eye files, the ones at the bottom of the DAT file, instead of directly pasting the palette directly after the texture, you paste the texture data back-to-back, and THEN the palettes nearly back-to-back at the end of the file, in the same order.
The texture data goes back-to-back, as if you're pasting normal data... but after you paste the last texture, you copy the palette from the 1st, paste that directly after the last texture data, skip 2 lines, then paste the next palette, skip 2 lines, paste the next palette, etc. etc. until you've pasted all the palettes in the same order as the texture data.
Dr. Mario's eyes are much easier, there's no subtraction involved, so you copy the entire palette (0x20~0x210) instead of needing to look for a different line.