a) L2emulL0_2009 (L0 hardware emulation)

This algorithm is intended to provide access to the 16 lastDSM output bits, and should only be needed when the old TCU is being used.

This algorithm reads in 5 ints from run control:

[0] onbits0

[1] offbits0

[2] onbits1

[3] offbits1

[4] number of  onbits+offbits pairs

The logic used is as follows:

  if((lastDSM & p->onbits[0]) != p->onbits[0]) return 0;
  if((~lastDSM & p->offbits[0]) != p->offbits[0]) return 0;
 

repeated for [1] if the number of pairs is > 1.  A byte swap occurs before this logic is reached, so that both ushorts should have the same endian-ness.  If none of the 'if's fire, the algorithm returns 1.