PavelSharp Posted April 25 Posted April 25 (edited) Hi there! Excited to be here and finally join the community I'm working on a texture tool for BloodRayne, with support for all platforms the game was released on. With the help of ImageHeat and ReverseBox, I got the basics of swizzle/unswizzle. Some of which can be described as bijective mappings, which I actually enjoy working with. Bloodrayne 1 was released on 5 platforms and uses 10 formats to represent textures, and almost all of them involve swizzling (except the PC version, of course). The ReverseBox helped me understand most of them, except for one. In ImageHeat, it's called as "PS2(EA 4 BIT)". Unfortunately, the source code of _convert_ps2_ea_4bit is not available and is implemented as in a closed library. In created issue, the author mentioned there are no plans to release the source code yet. So does anyone here know how this "type 3" swizzle works? Any clues where to look, or other tools/projects/technical docs that might help figure it out? And my favorite question - is a bijective mapping or not? Thanks in advance. Any help or pointers would be hugely appreciated. An example file is attached. It's a lightmap. Here’s how to view it in ImageHeat: Width = Height = 512 Start Offset: 152 Pixel Format: PAL4 Swizzling Type: PS2(EA 4 BIT) Palette Format: RGBX8888 Pal. Offset: 56 [10,br1,ps2]SEC_2_GRAVEYARD_LX_12.zip Edited April 25 by PavelSharp
Solution piken Posted April 26 Solution Posted April 26 (edited) Does this look right? I'm sure Ikskoks will update ImageHeat eventually, but meanwhile, I used the code from here: http://ps2linux.no-ip.info/playstation2-linux.com/docs/howto/display_docef7c.html?docid=75 Yes, all known element address swizzling is bijective, meaning you can trivially invert either operation if you have the other operation implemented by just swapping the input/output textures. This old thread may also help (but I think that case may have been the other kind of 4bpp swizzle 🤔). Edited April 26 by piken
Moderators ikskoks Posted May 1 Moderators Posted May 1 I was able to rewrite PS2 4-bit swizzle code to Python and add it to ReverseBox v0.30.0. Enjoy: https://github.com/bartlomiejduda/ReverseBox/blob/main/reversebox/image/swizzling/swizzle_ps2_4bit.py 2
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now