VPC operation

BG_A: 0 for backdrop, 2 for VDC1 BG, 3 for VDC1 OBJ (1 is invalid)
BG_B: 0 for backdrop, 2 for VDC2 BG, 3 for VDC2 OBJ (1 is invalid)
Select: 0 for VDC1 pixel, 1 for VDC2 pixel

Priority mode 00 and 11

SP2 > BG2 > SP2' > SP1 > BG1 > SP1'

VDC1 is shown in front of VDC2

BG_A BG_B  Select
 00   00     1
 00   10     1
 00   11     1
 10   00     0
 10   10     0
 10   11     0
 11   00     0
 11   10     0
 11   11     0

Select = ~BG_A.1


Priority mode 01

VDC2 sprites are in front of VDC1 BG, but behind VDC1 sprites

BG_A BG_B  Select
 00   00     1
 00   10     1
 00   11     1
 10   00     0
 10   10     0
 10   11     1
 11   00     0
 11   10     0
 11   11     0

Select = ~BG_A.1 | BG_B.0 & ~BG_A.0


Priority mode 10

VDC2 BG is in front of VDC1 sprites, but behind VDC1 BG

BG_A BG_B  Select
 00   00     1
 00   10     1
 00   11     1
 10   00     0
 10   10     0
 10   11     0
 11   00     0
 11   10     1
 11   11     0

Select = ~BG_A.1 | BG_B.0

Priority mode 11 = mode 00, pre-adjusted


Generally:

Select = ~BG_A.1 | ((BG_B.1 ^ BG_B.0) & PRIO.0) | ((BG_B.1 & BG_B.0) & PRIO.1)
BG_OBJ = (BG_A.0 & ~Select) | (BG_B.0 & Select)