+ else if(type==MFX_FEEDBACK && rlength==2)
+ {
+ if(command[0]==MFX_SEARCH)
+ {
+ bool finished = true;
+ if(reply[1])
+ {
+ if(mfx_search_size==32)
+ {
+ if(control.debug>=1)
+ IO::print("Assigning MFX address %d to decoder %08X\n", control.next_mfx_address, mfx_search_bits);
+
+ QueuedCommand qcmd;
+ qcmd.command[0] = MFX_ASSIGN_ADDRESS;
+ qcmd.command[1] = control.next_mfx_address>>8;
+ qcmd.command[2] = control.next_mfx_address;
+ for(unsigned i=0; i<4; ++i)
+ qcmd.command[3+i] = mfx_search_bits>>(24-i*8);
+ qcmd.length = 7;
+ control.push_command(qcmd);
+ ++control.next_mfx_address;
+ }
+ else
+ {
+ ++mfx_search_size;
+ finished = false;
+ }
+ }
+ else if(mfx_search_size>0)
+ {
+ unsigned mask = 1<<(32-mfx_search_size);
+ if(!(mfx_search_bits&mask))
+ {
+ mfx_search_bits |= mask;
+ finished = false;
+ }
+ }
+
+ if(finished)
+ {
+ next_mfx_search = t+2*Time::sec;
+ mfx_search_bits = 0;
+ mfx_search_size = 0;
+ }
+ }
+ }