benilla-re systems structs docs

s_coverageShifts

global · charactermodel

Address
0x838ae8 · 16 bytes, up to 0x838af7
Type
const uint32_t[4]
Meaning
Holds the coverage shifts 0, 2, 4 and 6
Confidence
verified, proof one
Finding
charactermodel/composite#blend-kernel

Finding: Blend kernel in charactermodel: composite

0x477f20 reads the same plane, shifts the masked bits down by {0, 2, 4, 6}[i & 3] to a level v of 0 to 3 and writes per pixel by level: 0 keeps the target, 3 copies the source, and 1 or 2 blend per channel. The blend of a channel is (source · SW + target · DW) >> 16, masked to the channel, with SW = {0, 0x5555, 0xaaaa, 0x10000}[v] and DW = SW[3 - v], on the green (0x7e0), blue (0x1f) and red (0xf800) fields of the 16-bit pixel.

The derivation is in the doc.