benilla-re systems structs docs

s_convertMatrix

global · image

Address
0xc0f560 · 1296 bytes, up to 0xc0fa6f
Type
void *[324]
Meaning
Holds the converter of each source class, destination class and submode
Confidence
verified, proof one
Finding
image/convert#conversion-matrix

Finding: Conversion matrix in image: pixel format conversion

The dispatcher 0x5a4f60 picks a converter from a matrix of function pointers at 0xc0f560 and calls it. The matrix is indexed by source class, destination class and a submode; 17 cells hold a converter and every other cell is 0, which makes the call do nothing. The class numbers are the ones blp takes from 0x5a80d0: 1 BGRA8888, 2 ARGB4444, 3 ARGB1555, 4 RGB565, 5 DXT1, 6 DXT3, 7 DXT5, 8 any other 16-bit.

source, destination, submodeconverter
1, 1, 0 / 1 / 20x5a5480 copy / 0x5a5510 alpha key / 0x5a5590 blend
1, 2 / 3 / 4, 00x5a5070 / 0x5a51d0 / 0x5a5330 pack to 4444 / 1555 / 565
2, 2 / 3, 3 / 4, 4 / 8, 80x5a56b0 16-bit copy
5, 50x5a5740 DXT1 block copy
6, 6 and 7, 70x5a5780 DXT3 or DXT5 block copy
5, 4 / 3 / 10x5a57c0 / 0x5a5a20 / 0x5a5c80 DXT1 to 565 / 1555 / 8888
6, 2 / 10x5a5ef0 / 0x5a60c0 DXT3 to 4444 / 8888

DXT5 has no software decoder: a DXT5 source to any other class is an empty cell.

The derivation is in the doc.