8 #include "fms_fm101_2011_a.hh"
10 void fms_fm101_2011_a(
Board& fm101,
int t)
12 int* channels = (
int*)fm101.channels[t];
15 const int R0 = fm101.registers[0];
16 const int R1 = fm101.registers[1];
17 const int R2 = fm101.registers[2];
31 for (
int i = 0; i < 4; ++i) {
32 int fm001out = channels[i];
36 HT0 |= btest(fm001out,30);
37 HT1 |= btest(fm001out,31);
42 int SumD = getbits(fm001out,0 ,5);
43 int SumC = getbits(fm001out,5 ,5);
44 int SumBC = getbits(fm001out,10,5);
45 int SumB = getbits(fm001out,15,5);
46 int SumAB = getbits(fm001out,20,5);
47 int SumA = getbits(fm001out,25,5);
49 BS0 |= SumA > R0 || SumAB > R0 || SumB > R0 || SumBC > R0 || SumC > R0 || SumD > R0;
50 BS1 |= SumA > R1 || SumAB > R1 || SumB > R1 || SumBC > R1 || SumC > R1 || SumD > R1;
51 BS2 |= SumA > R2 || SumAB > R2 || SumB > R2 || SumBC > R2 || SumC > R2 || SumD > R2;
54 Sum[i] = SumA+SumB+SumC+SumD;
58 if (Sum[i] > 63) Sum[i] = 63;
62 fm101.output[t] = Sum[0] | Sum[1] << 6 | Sum[2] << 12 | Sum[3] << 18 | BS0 << 24 | BS1 << 25 | BS2 << 26 | HT0 << 27 | HT1 << 28;