Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

[PS2] How does EA’s "type 3" 4-bit swizzle actually work?

Featured Replies

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:

  1. Width = Height = 512
  2. Start Offset: 152
  3. Pixel Format: PAL4
  4. Swizzling Type: PS2(EA 4 BIT)
  5. Palette Format: RGBX8888
  6. Pal. Offset: 56

 

[10,br1,ps2]SEC_2_GRAVEYARD_LX_12.zip

Edited by PavelSharp

Solved by piken

  • Solution

Does this look right?

PikenSwizzleTool.png.2278884a604a117a850fa9fb853552c6.png

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 by piken

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.