ROM Hack Help: editing Phantom Hourglass textures with Tinke

HelpTheWretched

Well-Known Member
OP
Member
Joined
Feb 4, 2010
Messages
315
Trophies
1
XP
1,560
Country
Canada
I wanted to make a very minor texture hack for Zelda: Phantom Hourglass, basically just to remove the fog effect from certain areas, for the purpose of taking clearer screenshots. I did some quick searching and found a nice DS filesystem explorer called Tinke, which I'm sure some of the regulars on this board are familiar with.

So I found the fog texture easily enough (.nsbtx format), extracted it, used a hex editor to "black out" most of the image, then reloaded it into the ROM with Tinke. No issues so far, and viewing the edited texture in Tinke shows the desired effect. Then I saved a new copy of the ROM, but when I tried it in DeSmuME, it hangs at the white screen and doesn't get anywhere.

I assumed there would be some kind of signature or checksum process that Tinke would take care of, but if anybody here is more familiar with the process and knows what went wrong, could you please help me out?

Once this is working, I'd also like to black out the glowing textures when Link holds up a new item, but I haven't been able to find them in the ROM.
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,375
Country
United Kingdom
The DS does have provisions for fog and lights as well but if it is a texture then so be it.

Is this white screen right at the start or when it first loads the texture? Also just for the sake of completeness as we are contemplating fog here I assume it is an actual hang and not somehow that you made the whole world fog?

If it is at the start then something went wrong with whatever repacking or insertion is going on (there should be no checksums like we are used to seeing on newer disc based consoles and stuff after the DS).
If it is when it would theoretically try to load the fog (I don't know if there is some kind of opening sequence with it in) then your edits caused it to crash.

For the former then find the texture you edited. Pull the ROM apart with whatever tools you have (I like ndstool based stuff myself) and insert just the edited texture (compressed again if needs be).

For the latter then you need to figure out what it is that caused it.
Not being recompressed would be my first test; most DS 3d related files I tend to find compressed, can't remember if these are though but easy enough to find out -- in a hex editor in the basic ROM does the file start with 10, 11, or 40 in some later ROMs? If so compression is most likely what you are seeing.
After this we get to figure out what goes.
Start by going back and making a single edit of a single pixel/texel. Bonus is if tinke managed to decode it to view it then you should be able to tell what format it is all in in case you have to get familiar with http://problemkaputt.de/gbatek.htm#ds3dtextureformats . This will hopefully eliminate some kind of wrong format save error (unexpected data tends to make for nice crashes as games are not typically coded to handle that sort of thing).
Errors in the formatting are next -- most DS files are more than just the data and contain things around it. If you just went all "fill it with FF or 00" then you might have knocked out some size data, format info or whatever else and caused some fun upon attempted decoding. For DS textures they often come in blocks separated by data it needs.

Possible second option. If there is a tiny texture instead maybe consider renaming it/overwriting the fog. It might trouble things if it uses a different format (though it might well pick up on the different format if the texture tells it what it is) but can be worth a try -- if a small shadow or something is hidden by a giant chest then who cares?

Hybrid of the two approaches. If there is a nice alpha value somewhere set it to transparent and while it may still load (not great if you are doing an optimisation hack, less of an issue for screenshots I imagine)
 
  • Like
Reactions: Mike_77712

HelpTheWretched

Well-Known Member
OP
Member
Joined
Feb 4, 2010
Messages
315
Trophies
1
XP
1,560
Country
Canada
Oooh, lots of info! Thanks for the help, I'll have to read it carefully. I'm kind of in a rush right now so it's hard to focus.

First of all, the "white screen" hang was immediately after booting, before the Nintendo logo. Also I'm aware of most data files having header data and sometimes footers, so I didn't overwrite those.

The fog texture was uncompressed according to Tinke, and 32KB for a 256x128, 8bpp image would confirm that. There are a couple uses of fog in the game, but as far as I can tell, the texture I edited only appears on the foreground of a couple dungeons.

Not sure if I'd have any more luck with playing it on an actual (3)DS but I've got an Acekard to try it out. ;)
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: I need shrooms to read his comments