Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Texture replacement issue
09-13-2016, 07:34 AM
Post: #1
Texture replacement issue
I have tried out the texture replacement feature in SD Gundam G Generation Overworld in order to use higher resolution sprites ripped from earlier games (PS2) in the series.
The issue I'm having is that most sprites in the game are 384*384 or 192*192 in size, and PPSSPP dumps them as 512*512 or 256*256 with random junk filling out the rest of the image. This is an issue, because if the random part of the sprite is different, the image will have a different hash for its data, and since the address changes every time the sprite is loaded as well, it means I can't "lock on" onto a given sprite for replacement. (since the only thing staying constant is the CLUT)
Is there any way for the emulator to detect the real size of the sprite and output it in that size (or at least clear the rest so it will always be the same)?


Attached File(s) Thumbnail(s)
       
Find all posts by this user
Quote this message in a reply
09-13-2016, 02:28 PM
Post: #2
RE: Texture replacement issue
Yes, i assume you created a text file to replace textures, you need to add a [hashranges] section, like so:
Code:
...
0000000094ec50084e45c94c = Pokke/Tree2.png

[hashranges]
0x0419c200,256,256 = 160,160
0x091bf4d0,512,512 = 480,272
0x091df700,512,512 = 480,272
0xXXXXXXXX,YYY,ZZZ = AAA, BBB
...

0x = No reason to change this.
XXXX... = The first 8 digits of dumped texture's filename (The address)
YYY = The Width of the dumped texture (With garbage data)
ZZZ = The Height of the dumped texture (Again, with garbage data)
AAA = The real width of the dumped texture (without the garbage, horizontally the textures tend to repeat rather than generate garbage)
BBB = The height of the texture (without the garbage)

After that the texture will be dumped again with the width specified in A and the height in B, and the correct hash.
Find all posts by this user
Quote this message in a reply
09-13-2016, 02:39 PM
Post: #3
RE: Texture replacement issue
Yes, I have created the text file.
The problem with this solution, is that these textures get stored at a different address every time they are loaded, so the first 8 digits of dumped texture's filename is different each time as well.
Find all posts by this user
Quote this message in a reply
09-15-2016, 03:13 AM
Post: #4
RE: Texture replacement issue
Unfortunately, this is a problem that PPSSPP itself faces when emulating this game. It cannot tell that it's the same texture.

I mean, theroetically, we could hash the top left 384x384 and the top left 192x192 of EVERY texture, etc. etc. etc. Unfortunately, this would really hurt performance. Hashing texture data isn't fast, and we have to do it often to see if it was changed by the game.

The other option might be if the game consistently uses the top left 384x384 in a very recognizable way for us. But that isn't implemented yet and it's more complicated than it sounds. It can still hurt performance but as long as we're sure the game is using a subset of the texture, we can hash a subset of it.

The PSP hardware was only capable of using textures a power of two in size on each side. So 384 wasn't an option. It has to size the texture as 512 or 256 - there are no options in between.

-[Unknown]
Find all posts by this user
Quote this message in a reply
09-17-2016, 04:15 PM
Post: #5
RE: Texture replacement issue
What's this about a text file? I just found about the texture replacement feature today and am trying to find any sort of faq explaining how to use it...
Find all posts by this user
Quote this message in a reply
09-17-2016, 06:56 PM
Post: #6
RE: Texture replacement issue
See here:

http://forums.ppsspp.org/showthread.php?tid=18963

-[Unknown]
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: