frac32 in1
frac32 out
frac32 D
frac32 S
if (inlet_AD < (32 << 21)) {
// AR mode
// A long -> A short
outlet_A = 0x07FFFFFF - (inlet_AD << 1);
outlet_D = 0x07FFFFFF;
outlet_S = 0x07FFFFFF;
} else {
// DR mode
outlet_A = 0;
// D long -> D short
outlet_D = 0x0FFFFFFF - (inlet_AD << 1);
outlet_S = 0;
}