5 #include "fcs_trg_base.h"
11 void fcs_trg_base::stage_3_202207(
link_t link[], u_short *dsm_out)
15 if( (link[1].d[0] & 0x01) || (link[3].d[0] & 0x01) ) *dsm_out |= 0x1;
16 if( (link[1].d[0] & 0x02) || (link[3].d[0] & 0x02) ) *dsm_out |= 0x2;
17 if( (link[1].d[0] & 0x04) || (link[3].d[0] & 0x04) ) *dsm_out |= 0x4;
19 if( (link[0].d[0] & 0x01) || (link[2].d[0] & 0x01) ) *dsm_out |= 0x8;
20 if( (link[0].d[0] & 0x02) || (link[2].d[0] & 0x02) ) *dsm_out |= 0x10;
21 if( (link[0].d[0] & 0x04) || (link[2].d[0] & 0x04) ) *dsm_out |= 0x20;
23 if( (link[0].d[1] & 0x1F) || (link[2].d[1] & 0x1F) ) *dsm_out |= 0x40;
25 if( (link[1].d[1] & 0x01) || (link[3].d[1] & 0x01) ) *dsm_out |= 0x80;
26 if( (link[1].d[1] & 0x06) || (link[3].d[1] & 0x06) ) *dsm_out |= 0x100;
27 if( (link[1].d[1] & 0x18) || (link[3].d[1] & 0x18) ) *dsm_out |= 0x200;
29 if( (link[0].d[2] & 0x01) || (link[2].d[2] & 0x01) ) *dsm_out |= 0x400;
30 if( (link[0].d[2] & 0x06) || (link[2].d[2] & 0x06) ) *dsm_out |= 0x800;
31 if( (link[0].d[2] & 0x18) || (link[2].d[2] & 0x18) ) *dsm_out |= 0x1000;
33 if( (link[1].d[2] & 0x02) && (link[3].d[2] & 0x1C) ) *dsm_out |= 0x2000;
34 if( (link[1].d[2] & 0x04) && (link[3].d[2] & 0x1A) ) *dsm_out |= 0x2000;
35 if( (link[1].d[2] & 0x18) && (link[3].d[2] & 0x1E) ) *dsm_out |= 0x2000;
37 if( (link[1].d[2] & 0x02) && (link[2].d[2] & 0x1C) ) *dsm_out |= 0x4000;
38 if( (link[1].d[2] & 0x04) && (link[2].d[2] & 0x1A) ) *dsm_out |= 0x4000;
39 if( (link[1].d[2] & 0x18) && (link[2].d[2] & 0x1E) ) *dsm_out |= 0x4000;
40 if( (link[0].d[2] & 0x02) && (link[3].d[2] & 0x1C) ) *dsm_out |= 0x4000;
41 if( (link[0].d[2] & 0x04) && (link[3].d[2] & 0x1A) ) *dsm_out |= 0x4000;
42 if( (link[0].d[2] & 0x18) && (link[3].d[2] & 0x1E) ) *dsm_out |= 0x4000;
44 if( (link[0].d[0] & 0x40) && (link[2].d[0] & 0x20) ) *dsm_out |= 0x8000;
45 if( (link[0].d[0] & 0x20) && (link[2].d[0] & 0x40) ) *dsm_out |= 0x8000;
50 printf(
"FCS STG3 input 0 = %02x %02x %02x %02x %02x %02x %02x %02x\n",
51 link[0].d[0],link[0].d[1],link[0].d[2],link[0].d[3],
52 link[0].d[4],link[0].d[5],link[0].d[6],link[0].d[7]);
53 printf(
"FCS STG3 input 1 = %02x %02x %02x %02x %02x %02x %02x %02x\n",
54 link[2].d[0],link[2].d[1],link[2].d[2],link[2].d[3],
55 link[2].d[4],link[2].d[5],link[2].d[6],link[2].d[7]);
56 printf(
"FCS STG3 output = %04x = ", *dsm_out);
57 for(
int i=7; i>=0; i--){printf(
"%1d", (dsmout>>i)&0x1);}