anchor.diff:  	    dataGearbox.deq;
   	    syncGearbox.deq;
               active_video_reg <= pack(hstate == Active && vstate == Active);
  -	    //jca framestart <= syncGearbox.first[0];
  -            debugind_value <= { 16'habcd, hsync_count[7:0], vsync_count[7:0] } ;
  +            framestart_new <= syncGearbox.first[0];
  +            let dval = diff;
  +            dval = {diff[28:0], framestart_wire, xsvi_framestart_old_wire, framestart_new};
  +            if (diff[8] == 1)
  +                begin
  +                debugind_value <= diff;
  +                dval = 0;
  +                end
  +            diff <= dval;
   	    return XsviData {
  -		fsync: xsvi_framestart_old_wire, //syncGearbox.first[0],
  +		fsync: xsvi_framestart_old_wire, //framestart_new,
   		vsync: pack(vstate == Sync),
   		hsync: pack(hstate == Sync),
   		active_video: active_video_reg,
  
positive.code:             xsvi_video_data_wire <= v;
  	endmethod
  	method Action framestart(Bit#(1) v);
  	    Vector#(4, Bit#(1)) in = replicate(0);
  	    // zero'th element shifted out first
  	    in[0] = v;
  	    syncGearbox.enq(in);
  	endmethod
  	method Action video_data(Bit#(40) v);
  
negative.code: 
      interface ImageonSensorData in;
          method Action fsync(Bit#(1) v);
              xsvi_framestart_old_wire <= v;
          endmethod
          method Bit#(1) active_video();
              return active_video_reg;
          endmethod
  