GioGio's Bizarre Adventure TIM2 Compression

Textures, recreate headers, conversions, algorithms and parsing of image files
penguino
Posts: 7
Joined: Thu Oct 11, 2018 4:15 pm

GioGio's Bizarre Adventure TIM2 Compression

Post by penguino »

I got a bit more info on the textures in this game
They use BGR+I encoding
The readable TIM2s in afs_data use 128 bytes of alignment
Readable versions of a few compressed textures can sometimes be found in memory while the game is running on an emulator (https://cdn.discordapp.com/attachments/ ... Ku1p4q.png)
Is there a way to figure out how the TIM2 files are compressed by comparing them with the uncompressed versions?
Attachment has the CAPCOM and title screen tm2's and their compressed version with the pzz file that contains both of them
Acewell
Posts: 706
Joined: Fri Aug 08, 2014 1:06 am

Re: GioGio's Bizarre Adventure TIM2 Compression

Post by Acewell »

the compressed samples look RLE compressed to me, but i'm no expert on that. :)
episoder
Posts: 123
Joined: Fri Oct 27, 2017 7:36 pm

Re: GioGio's Bizarre Adventure TIM2 Compression

Post by episoder »

well. it's not your average rle compression looks like mess to me. to many 9s in the capcom. the title doesn't make sense either can't pin it. pointer moves? skips? copys? sequence lengths? dword or short literals? is 0x3B the lenght of the sequence in the title? 0x38 definetely looks like the pad to 0x10 function. the rest doesn't make much sense tho. :?

Image

edit: well the 0x4x is potentially a backwards memory move in the copy alignment window. kinda adds up copying a 0x10 short sequence at 0x1b and removing the 9 over bytes. complicated tho. that's so capcom. :lol:

0x34 zero pad align to 0x10
0x20 copy
0x01 type dword
0x20 copy
0x3B zero pad align to 0x1B
0x10 sequence length (?)
0x87 relocation or code ptr move
0x49 alignment move
0x38 zero pad align to 0x30
0x08 memory fill
0x40 parameter
0xF7F7 content
0x0100 parameter
0x87 should be skipped here (?)
0x48 alignment move
...

pointer dance. and a lot of guessing. :mrgreen:
infval
Posts: 3
Joined: Sun May 24, 2020 11:18 pm

Re: GioGio's Bizarre Adventure TIM2 Compression

Post by infval »

Acewell wrote:the compressed samples look RLE compressed to me, but i'm no expert on that. :)
Yes. It's simple RLE compression.
Decompression functions: Python and C versions.