if (mask01 > 8) {
- /* high bit set, but not 0b1000: invert the relevant half of P0 */
- vpr ^= 0xff;
+ if (eci == ECI_NONE) {
+ /* high bit set, but not 0b1000: invert the relevant half of P0 */
+ vpr ^= 0xff;
+ } else if (eci == ECI_A0) {
+ /* Invert only the beat 1 P0 bits, as we didn't execute beat 0 */
+ vpr ^= 0xf0;
+ } /* otherwise we didn't execute either beat 0 or beat 1 */
}
if (mask23 > 8) {
- /* high bit set, but not 0b1000: invert the relevant half of P0 */
- vpr ^= 0xff00;
+ if (eci != ECI_A0A1A2 && eci != ECI_A0A1A2B0) {
+ /* high bit set, but not 0b1000: invert the relevant half of P0 */
+ vpr ^= 0xff00;
+ } else {
+ /* We didn't execute beat 2, only invert the beat 3 P0 bits */
+ vpr ^= 0xf000;
+ }
}