graydon
2025-07-24 96cfbbcc47a845cad3f3248c284703eca519650f
src/scene.cpp
@@ -108,7 +108,7 @@
         }
      }
      m->mDsp = 0;
      m->mDsp = p->dsp_index;
      m->mID = p->proc_id;
      m->mType = p->proc_type;
      m->mTag = p->tag;
@@ -120,23 +120,35 @@
      memcpy(bin + size , rxBufID, m->mRxNum*sizeof(u16)); size += m->mRxNum*sizeof(u16);
      m->mTxNum = noutports;
      memcpy(bin + size , txBufID, m->mTxNum*sizeof(u16)); size += m->mTxNum*sizeof(u16);
      if(p->physic_type == ModuleInterfaceType::PHY_INPUT) {
         PhyPort* phy_id = (PhyPort*)(bin + size);
         for(j = 0 ; j< ninports ;j ++, phy_id++) {
            phy_id->mIntType = 0;
            phy_id->mPhyID = hw_adapter->get_physical_channel(1, j);
         }
         size += ninports*sizeof(PhyPort);
      }
      else if(p->physic_type == ModuleInterfaceType::PHY_OUTPUT){
         PhyPort* phy_id = (PhyPort*)(bin + size);
         for(j = 0 ; j< noutports ;j ++, phy_id++) {
            phy_id->mIntType = 0;
            phy_id->mPhyID = hw_adapter->get_physical_channel(0, j);
         }
         size += noutports*sizeof(PhyPort);
      }
   }
   ninports = dsp_input_num[0]>dsp_output_num[0]?dsp_input_num[0]:dsp_output_num[0];
   noutports = dsp_input_num[1]>dsp_output_num[1]?dsp_input_num[1]:dsp_output_num[1];
   if(0) {
      flowchart->dsp_buffer_num[0] = ninports;
      flowchart->dsp_buffer_num[1] = noutports;
   }
   else {
      flowchart->dsp_buffer_num[0] = ninports>noutports?ninports:noutports;
   //dual_dsp for 2 DSP,else 1 DSP.
   for (i =0 ;i < hw_adapter->get_system_is_dual_dsp() + 1 ;i ++) {
      flowchart->dsp_buffer_num[i] = std::max(dsp_input_num[i], dsp_output_num[i]);
   }
   flowchart->module_num = proc_list.size();
   flowchart->crcLsb = 0;
   flowchart->crcMsb = 0;
   flowchart->compress = 0;
   flowchart->version = 1;
   crc = CRC::crc32((const u8*)bin, size);