07-13-2021, 08:54 AM
(01-16-2021, 03:42 PM)rufaswan Wrote: Got it solved! 4-bpp texture is multi-level swizzling. It also didn't help most of these images are in grayscale.
Instead of using a math formula to do everything, I decided to waste some memory and CPU power to unswizzle them by logic. Now, not only I can get 4-bpp at any size to unswizzle correctly, I also figured out how to handle landscape and portrait textures as well!
In short, for landscape texture 512x256 , you pad it to become a square 512x512 , and then unswizzle normally:
For portrait texture 256x512 , you split them into two square 256x256 and unswizzle them independently. You join them back after that.
I have everything on both GrimGrimoire and Odin Sphere on PS2 now. I can work on those too.
Until next update, take care!
- Rufas
I don't understand "In short"
"pad it" mean add 0x10000 bytes(0x200 * 0x100)? Or adding 8 null bytes to each 8 bytes?