static void flash_reset() { ASSERT(flashutl_cmd != NULL); if (flashutl_cmd->clear_csr) scmd(flashutl_cmd->clear_csr, 0); if (flashutl_cmd->read_array) scmd(flashutl_cmd->read_array, 0); }
static void sleep_ms(struct asill_s *A, int ms) { struct cmd_s *c; c = scmd(A); c->cmd = CMD_SLEEP_MS; c->p1 = ms; }
static void send_ctrl_val(struct asill_s *A, int v, int v1) { struct cmd_s *c; pr_debug("%s 0x%04x 0x%04d\n", __FUNCTION__, v, v1); c = scmd(A); c->cmd = CMD_SEND; c->p1 = v; c->p2 = v1; }
static void send_ctrl(struct asill_s *A, int v) { struct cmd_s *c; pr_debug("%s 0x%04x\n", __FUNCTION__, v); c = scmd(A); c->cmd = CMD_SEND; c->p1 = v; c->p2 = 0; }
static int flash_eraseblk(unsigned long addr) { unsigned long a; uint16 st; a = (unsigned long)addr; if (a >= flashutl_desc->size) return 1; a = block(a, BLOCK_BASE); /* Ensure blocks are unlocked (for intel chips) */ if (flashutl_cmd->type == BSC) { scmd((unsigned char)INTEL_UNLOCK1, a); scmd((unsigned char)INTEL_UNLOCK2, a); } if (flashutl_cmd->pre_erase) cmd(flashutl_cmd->pre_erase, CMD_ADDR); if (flashutl_cmd->erase_block) cmd(flashutl_cmd->erase_block, a); if (flashutl_cmd->confirm) scmd(flashutl_cmd->confirm, a); if (flashutl_wsz == sizeof(uint8)) st = flash_poll(a, 0xff); else st = flash_poll(a, 0xffff); flash_reset(); if (st) { DPRINT(("Erase of block 0x%08lx-0x%08lx failed\n", a, block((unsigned long)addr, BLOCK_LIM))); return st; } DPRINT(("Erase of block 0x%08lx-0x%08lx done\n", a, block((unsigned long)addr, BLOCK_LIM))); return 0; }
static void set_reg(struct asill_s *A, int r, int v) { struct cmd_s *c; pr_debug("%s 0x%04x=0x%04x\n", __FUNCTION__, r, v); c = scmd(A); c->cmd = CMD_SET_REG; c->p1 = r; c->p2 = v; if (r >= 0x3000 && r < 0x4000) A->shadow[r - 0x3000] = v; }
/*! * */ void CameraParameters::readFromFile(const std::string &path)throw(cv::Exception) { std::ifstream file(path.c_str()); if (!file) throw cv::Exception(9005,"could not open file:"+path,"CameraParameters::readFromFile", __FILE__,__LINE__); //Create the matrices _distor=cv::Mat::zeros(4,1,CV_32FC1); _k=cv::Mat::eye(3,3,CV_32FC1); char line[1024]; while (!file.eof()) { file.getline(line,1024); char cmd[20]; float fval; if ( sscanf(line,"%s = %f",cmd,&fval)==2) { std::string scmd(cmd); if (scmd=="fx") _k.at<float>(0,0)=fval; else if (scmd=="cx") _k.at<float>(0,2)=fval; else if (scmd=="fy") _k.at<float>(1,1)=fval; else if (scmd=="cy") _k.at<float>(1,2)=fval; else if (scmd=="k1") _distor.at<float>(0,0)=fval; else if (scmd=="k2") _distor.at<float>(1,0)=fval; else if (scmd=="p1") _distor.at<float>(2,0)=fval; else if (scmd=="p2") _distor.at<float>(3,0)=fval; else if (scmd=="width") _size.width=fval; else if (scmd=="height") _size.height=fval; } } }
static int srd(void) { static char l[BufSz], *p=l; char *s, *usr, *cmd, *par, *data; int rd; if (p-l>=BufSz) p=l; /* Input buffer overflow, there should something better to do. */ rd=read(sfd, p, BufSz-(p-l)); if (rd<0) { if (errno==EINTR) return 1; panic("IO error while reading."); } if (rd==0) return 0; p+=rd; for (;;) { /* Cycle on all received lines. */ if (!(s=memchr(l, '\n', p-l))) return 1; if (s>l && s[-1]=='\r') s[-1]=0; *s++ = 0; if (*l==':') { if (!(cmd=strchr(l, ' '))) goto lskip; *cmd++ = 0; usr = l+1; } else { usr = 0; cmd = l; } if (!(par=strchr(cmd, ' '))) goto lskip; *par++ = 0; if ((data=strchr(par, ':'))) *data++ = 0; scmd(usr, cmd, par, data); lskip: memmove(l, s, p-s); p-=s-l; } }
/* * Call may take up to 210ms. */ unsigned int sht11_humidity(void) { return scmd(MEASURE_HUMI); }
/* * Call may take up to 210ms. */ unsigned int sht11_temp(void) { return scmd(MEASURE_TEMP); }
void GCHD::configureHDMI() { mailWrite( 0x33, VC{0x94, 0x41, 0x37} ); mailWrite( 0x33, VC{0x94, 0x4a, 0xaf} ); mailWrite( 0x33, VC{0x94, 0x4b, 0xaf} ); readDevice0x9DCD(0x3f); //EXPECTED 0xb0 mailWrite( 0x4e, VC{0x00, 0xcc} ); readDevice0x9DCD(0x94); //EXPECTED 0xb2 mailWrite( 0x4e, VC{0xab, 0x4c} ); readDevice0x9DCD(0x3f); //EXPECTED 0xb2 mailWrite( 0x4e, VC{0x00, 0xce} ); mailWrite( 0x4e, VC{0x1b, 0x33} ); readDevice0x9DCD(0x3f); //EXPECTED 0xb0 mailWrite( 0x4e, VC{0x00, 0xcc} ); readDevice0x9DCD(0x88); //EXPECTED 0xb0 mailWrite( 0x4e, VC{0xb7, 0xce} ); mailWrite( 0x4e, VC{0xb8, 0xdc} ); mailWrite( 0x4e, VC{0xb8, 0xcc} ); readDevice0x9DCD(0x3f); //EXPECTED 0xb2 mailWrite( 0x4e, VC{0x00, 0xce} ); mailWrite( 0x4e, VC{0x07, 0x38} ); mailWrite( 0x4e, VC{0x07, 0xc8} ); readDevice0x9DCD(0x3f); //EXPECTED 0xb0 mailWrite( 0x4e, VC{0x00, 0xcc} ); mailWrite( 0x4e, VC{0x51, 0x45} ); readDevice0x9DCD(0x88); //EXPECTED 0xb0 mailWrite( 0x4e, VC{0xb7, 0xcc} ); //Do nothing enable. No idea what it really checks doEnable( 0x0000, 0x0000); //state 031e->031e, enable 000a->000a readDevice0x9DCD(0x3f); //EXPECTED 0xb2 mailWrite( 0x4e, VC{0x00, 0xce} ); readDevice0x9DCD(0x3e); //EXPECTED 0xd3 mailWrite( 0x4e, VC{0x01, 0xad} ); readDevice0x9DCD(0x3b); //EXPECTED 0xb3 mailWrite( 0x4e, VC{0x04, 0xcd} ); mailWrite( 0x4e, VC{0x06, 0xc4} ); readDevice0x9DCD(0x36); //EXPECTED 0xba mailWrite( 0x4e, VC{0x09, 0xe4} ); readDevice0x9DCD(0x3f); //EXPECTED 0xb0 mailWrite( 0x4e, VC{0x00, 0xcc} ); readDevice0x9DCD(0x6b); //EXPECTED 0x82 mailWrite( 0x4e, VC{0x54, 0xec} ); readDevice0x9DCD(0x93); //EXPECTED 0xb2 mailWrite( 0x4e, VC{0xac, 0x4c} ); readDevice0x9DCD(0x3f); //EXPECTED 0xb2 mailWrite( 0x4e, VC{0x00, 0x4c} ); readDevice0x9DCD(0x3f); //EXPECTED 0x32 mailWrite( 0x4e, VC{0x00, 0xcc} ); readDevice0x9DCD(0xf1); //EXPECTED 0xb2 mailWrite( 0x4e, VC{0xce, 0x4c} ); readDevice0x9DCD(0xf0); //EXPECTED 0xb2 mailWrite( 0x4e, VC{0xcf, 0xce} ); readDevice0x9DCD(0x3f); //EXPECTED 0xb2 unsigned sum6665=0; unsigned sum6463=0; unsigned countSum6665=0; unsigned countSum6463=0; double value6665; bool rgbBit; unsigned iterationCount=0; do { if(iterationCount >= 10) { //Roughly 2 seconds given usleep below, after firmware load. throw runtime_error( "No HDMI signal found."); } sum6665=0; sum6463=0; countSum6665=0; countSum6463=0; //When first read information is bad, and it seems to kick off lock. for( unsigned j = 0; j<10; ++j ) { //Read 10 times for average. Probably not at all necessary. readHdmiSignalInformation(sum6463, countSum6463, sum6665, countSum6665, rgbBit); } value6665=((double)sum6665) / countSum6665; usleep( 1000000 / 5 ); //1/5th of a second, long enough time for more than 4 frames at low frame rate. //Should be enough to lock on. iterationCount+=1; } while( (iterationCount < 3) || (std::abs( value6665 - 0xad4d )<10.0) ); //^^^^^ Need to go through loop at least twice, to stabilize read, and value read must not be value //gotten when no signal Resolution resolution = Resolution::Unknown; ScanMode scanMode = ScanMode::Progressive; double refreshRate = 0.0; if (currentInputSettings_.getResolution() == Resolution::Unknown) { double value6463=((double)sum6463) / countSum6463; //0xb690 if(fabs( value6463 - 0xb6d7 )<10.0) { //Allow for error. //1080p resolution = Resolution::HD1080; refreshRate = 60.0; } else if(fabs( value6463 - 0xb081 )<10.0) { //0xb123 //1080i resolution = Resolution::HD1080; refreshRate = 60.0; scanMode = ScanMode::Interlaced;; } else if(std::abs( value6463 - 0xb05c )<10.0) { //Allow for error. //720p resolution = Resolution::HD720; refreshRate = 60.0; } else if(std::abs( value6463 - 0xb0c1 )<12.0) { //480p is 0xb0bf, //576p is 0xb0c3 //midpoint is 0xb0c1 //0xba95 is NTSC, bb75 is PAL. Code here has a slight NTSC //region bias. ;) resolution = Resolution::NTSC; refreshRate = 60.0; if( std::abs( value6665 - 0xbb75 ) < 10 ) { resolution = Resolution::PAL; refreshRate = 60.0; } } else { if( passedInputSettings_.getResolution() == Resolution::Unknown ) { throw runtime_error( "Mode detection failed, does not appear to be a suported mode for HDMI."); } } } if( refreshRate == 0.0 ) { switch( passedInputSettings_.getResolution() ) { case Resolution::PAL: refreshRate=50.0; break; default: refreshRate=60.0; break; } } //Merge passed arguments and autodetect information. currentInputSettings_.mergeAutodetect( passedInputSettings_, resolution, scanMode, refreshRate ); //Color space isn't set yet, but that shouldn't be a problem. currentTranscoderSettings_.mergeAutodetect( passedTranscoderSettings_, currentInputSettings_ ); mailWrite( 0x4e, VC{0x00, 0xcc} ); //Mystery setup difference. May be more appropriate to switch on reading back 0x95 instead of 0x97 //Based on input resolution. switch( currentInputSettings_.getResolution() ) { case Resolution::HD1080: mailWrite( 0x4e, VC{0xb2, 0xc4} ); mailWrite( 0x4e, VC{0xb5, 0xd0} ); break; case Resolution::HD720: mailWrite( 0x4e, VC{0xb2, 0xcc} ); mailWrite( 0x4e, VC{0xb5, 0xcc} ); break; case Resolution::NTSC: case Resolution::PAL: mailWrite( 0x4e, VC{0xb2, 0xcf} ); mailWrite( 0x4e, VC{0xb5, 0xcc} ); break; case Resolution::Unknown: throw std::logic_error( "Error in configuring resolution for HDMI." ); break; } mailWrite( 0x4e, VC{0x00, 0xce} ); mailWrite( 0x4e, VC{0x1b, 0x30} ); mailWrite( 0x4e, VC{0x1f, 0xdc} ); readDevice0x9DCD(0x29); //EXPECTED 0xba mailWrite( 0x4e, VC{0x1f, 0xcc} ); readDevice0x9DCD(0x3b); //EXPECTED 0xb3 mailWrite( 0x4e, VC{0x04, 0xcf} ); mailWrite( 0x4e, VC{0x04, 0xcd} ); readDevice0x9DCD(0x3f); //EXPECTED 0xb0 mailWrite( 0x4e, VC{0x00, 0xcc} ); mailWrite( 0x4e, VC{0x40, 0xcc} ); readDevice0x9DCD(0x3f); //EXPECTED 0xb2 mailWrite( 0x4e, VC{0x00, 0xcd} ); mailWrite( 0x4e, VC{0x00, 0xcc} ); mailWrite( 0x4e, VC{0xb0, 0xe8} ); mailWrite( 0x4e, VC{0xb1, 0x0c} ); mailWrite( 0x4e, VC{0xad, 0xc9} ); readDevice0x9DCD(0x8f); //EXPECTED 0x96 mailWrite( 0x4e, VC{0xb0, 0xe9} ); readDevice0x9DCD(0x3f); //EXPECTED 0xb2 mailWrite( 0x4e, VC{0x00, 0xcc} ); mailWrite( 0x4e, VC{0xab, 0xcc} ); mailWrite( 0x33, VC{0x99, 0x89, 0xf5} ); mailRead( 0x33, 1 ); //EXPECTED {0x82} mailWrite( 0x33, VC{0x99, 0x89, 0xfd} ); mailRead( 0x33, 1 ); //EXPECTED {0x6f} mailWrite( 0x33, VC{0x99, 0x89, 0xf5} ); mailRead( 0x33, 1 ); //EXPECTED {0x82} mailWrite( 0x33, VC{0x99, 0x89, 0xfc} ); mailRead( 0x33, 1 ); //EXPECTED {0x6e} mailWrite( 0x33, VC{0x99, 0x89, 0xf3} ); mailRead( 0x33, 1 ); //EXPECTED {0x6e} mailWrite( 0x4c, VC{0x0c, 0x89} ); mailWrite( 0x33, VC{0x99, 0x89, 0xf5} ); mailRead( 0x33, 1 ); //EXPECTED {0x82} mailWrite( 0x4c, VC{0x0e, 0x65} ); mailWrite( 0x4c, VC{0x0e, 0x64} ); configureCommonBlockA(); configureSetupSubblock(); mailWrite( 0x33, VC{0x99, 0x89, 0x6b} ); mailRead( 0x33, 1 ); //EXPECTED {0x6e} mailWrite( 0x4c, VC{0xc0, 0x80} ); mailWrite( 0x4c, VC{0xa2, 0x77} ); mailWrite( 0x33, VC{0x99, 0x89, 0x58} ); mailRead( 0x33, 1 ); //EXPECTED {0x91} mailWrite( 0x4c, VC{0xc0, 0x77} ); bool mysteryParameter=false; if (currentInputSettings_.getResolution() != Resolution::HD1080) { if( currentInputSettings_.getScanMode() == ScanMode::Progressive ) { mysteryParameter=true; } } configureCommonBlockB1(mysteryParameter); configureCommonBlockB2(); configureCommonBlockB3(); configureCommonBlockC(); readHdmiSignalInformation( sum6463, countSum6463, sum6665, countSum6665, rgbBit); if( passedInputSettings_.getColorSpace()==ColorSpace::Unknown ) { if( rgbBit ) { currentInputSettings_.setColorSpace(ColorSpace::RGB); } else { currentInputSettings_.setColorSpace(ColorSpace::YUV); } } else { currentInputSettings_.setColorSpace( passedInputSettings_.getColorSpace() ); } mailWrite( 0x4e, VC{0x00, 0xcc} ); //Make sure on right bank for color space configure. configureColorSpace(); transcoderFinalConfigure( currentInputSettings_, currentTranscoderSettings_ ); transcoderSetup( currentInputSettings_, currentTranscoderSettings_ ); scmd(SCMD_INIT, 0xa0, 0x0000); uint16_t state=read_config<uint16_t>(SCMD_STATE_READBACK_REGISTER); //EXPECTED=0x0001 scmd(SCMD_STATE_CHANGE, 0x00, SCMD_STATE_START); completeStateChange(state, SCMD_STATE_START); //EXPECTED 0x0001 currentInputSettings_.dumpMode(); }
void uninit_device() { // state change - output null scmd(SCMD_STATE_CHANGE, 0x00, 0x0004); // usually, this is done by a seperate thread, which runs in parallel. // I'm just quickly hacking a way around it, to test some stuff. Taking // a big, random number, which is slightly based on the USB traffic logs // I'm working with. Receive empty data, after setting state change to // null transfer. for (int i = 0; i < 5000; i++) { receive_data(); } // we probably need some sleeps here and receive null output, to give // the device enough time to gracefully reset. Else, the next scmd() // command seems to be ignored and we're leaving the device in an // undefined state. read_config(0xbc, 0x0800, 0x2008, 2); for (int i = 0; i < 50; i++) { receive_data(); } read_config(0xbc, 0x0900, 0x0074, 2); for (int i = 0; i < 50; i++) { receive_data(); } read_config(0xbc, 0x0900, 0x01b0, 2); for (int i = 0; i < 50; i++) { receive_data(); } read_config(0xbc, 0x0800, 0x2008, 2); for (int i = 0; i < 50; i++) { receive_data(); } read_config(0xbc, 0x0800, 0x2008, 2); for (int i = 0; i < 50; i++) { receive_data(); } write_config2(0xbc, 0x0900, 0x0074, 0x00, 0x04); for (int i = 0; i < 50; i++) { receive_data(); } write_config2(0xbc, 0x0900, 0x01b0, 0x00, 0x00); for (int i = 0; i < 50; i++) { receive_data(); } // state change - stop encoding scmd(SCMD_STATE_CHANGE, 0x00, 0x0001); for (int i = 0; i < 5; i++) { receive_data(); } read_config(0xbc, 0x0800, 0x2008, 2); read_config(0xbc, 0x0900, 0x0074, 2); read_config(0xbc, 0x0900, 0x01b0, 2); read_config(0xbc, 0x0800, 0x2008, 2); read_config(0xbc, 0x0800, 0x2008, 2); write_config2(0xbc, 0x0900, 0x0074, 0x00, 0x04); write_config2(0xbc, 0x0900, 0x01b0, 0x00, 0x00); write_config2(0xbd, 0x0000, 0x4400, 0x06, 0x86); write_config2(0xbc, 0x0900, 0x0014, 0x03, 0x1e); read_config(0xbc, 0x0900, 0x001c, 2); write_config3(0xbd, 0x0000, 0x3300, 0x89, 0x89, 0xf8); write_config2(0xbc, 0x0900, 0x0014, 0x03, 0x1e); read_config(0xbc, 0x0900, 0x001c, 2); write_config2(0xbc, 0x0900, 0x0014, 0x03, 0x1e); read_config(0xbc, 0x0900, 0x001c, 2); read_config(0xbd, 0x0000, 0x3300, 1); write_config2(0xbd, 0x0000, 0x4400, 0x03, 0x2f); write_config2(0xbc, 0x0900, 0x0014, 0x03, 0x1e); read_config(0xbc, 0x0900, 0x001c, 2); write_config2(0xbc, 0x0900, 0x0000, 0x00, 0x00); read_config(0xbc, 0x0900, 0x0014, 2); read_config(0xbc, 0x0800, 0x2008, 2); write_config8(0xbc, 0x0001, 0x1a08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00); write_config6(0xb8, 0x0000, 0x0000, 0x00, 0x00, 0x04, 0xa0, 0x00, 0x00); write_config2(0xbc, 0x0900, 0x0014, 0x03, 0x16); read_config(0xbc, 0x0900, 0x001c, 2); write_config2(0xbc, 0x0900, 0x0014, 0x03, 0x06); read_config(0xbc, 0x0900, 0x001c, 2); write_config2(0xbc, 0x0900, 0x0014, 0x02, 0x06); read_config(0xbc, 0x0900, 0x001c, 2); write_config2(0xbc, 0x0900, 0x0014, 0x00, 0x06); read_config(0xbc, 0x0900, 0x001c, 2); write_config5(0xbd, 0x0000, 0x3300, 0xab, 0xa9, 0x0f, 0xa4, 0x55); write_config2(0xbc, 0x0900, 0x0014, 0x00, 0x06); read_config(0xbc, 0x0900, 0x001c, 2); read_config(0xbd, 0x0000, 0x3300, 3); write_config2(0xbc, 0x0900, 0x0014, 0x00, 0x06); write_config2(0xbc, 0x0900, 0x0018, 0x00, 0x08); read_config(0xbc, 0x0900, 0x0014, 2); read_config(0xbc, 0x0900, 0x0018, 2); write_config5(0xbd, 0x0000, 0x3300, 0xab, 0xa9, 0x0f, 0xa4, 0x55); write_config2(0xbc, 0x0900, 0x0014, 0x00, 0x06); read_config(0xbc, 0x0900, 0x001c, 2); read_config(0xbd, 0x0000, 0x3300, 3); write_config2(0xbc, 0x0900, 0x0014, 0x00, 0x06); write_config2(0xbc, 0x0900, 0x0018, 0x00, 0x08); read_config(0xbc, 0x0900, 0x0014, 2); read_config(0xbc, 0x0900, 0x0018, 2); read_config(0xbc, 0x0800, 0x2008, 2); write_config6(0xb8, 0x0000, 0x0000, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00); read_config(0xbc, 0x0800, 0x2008, 2); read_config(0xbc, 0x0900, 0x0074, 2); read_config(0xbc, 0x0900, 0x01b0, 2); read_config(0xbc, 0x0800, 0x2008, 2); read_config(0xbc, 0x0800, 0x2008, 2); write_config2(0xbc, 0x0900, 0x0074, 0x00, 0x04); write_config2(0xbc, 0x0900, 0x01b0, 0x00, 0x00); read_config(0xbc, 0x0800, 0x2008, 2); write_config6(0xb8, 0x0000, 0x0000, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00); read_config(0xbc, 0x0800, 0x2008, 2); read_config(0xbc, 0x0900, 0x0074, 2); read_config(0xbc, 0x0900, 0x01b0, 2); read_config(0xbc, 0x0800, 0x2008, 2); read_config(0xbc, 0x0800, 0x2008, 2); write_config2(0xbc, 0x0900, 0x0074, 0x00, 0x04); write_config2(0xbc, 0x0900, 0x01b0, 0x00, 0x00); }
void GCHD::configureComposite() { mailWrite( 0x33, VC{0x94, 0x41, 0x37} ); mailWrite( 0x33, VC{0x94, 0x4a, 0xaf} ); mailWrite( 0x33, VC{0x94, 0x4b, 0xaf} ); //MODE AUTODETECT IS HERE mailWrite( 0x33, VC{0x89, 0x89, 0xfa} ); uint8_t value=mailRead( 0x33, 1 )[0]; value = value & 0xf; ScanMode autodetectScanMode=ScanMode::Interlaced; double autodetectRefreshRate=0.0; Resolution autodetectResolution; try { if( value == 6 ) { autodetectResolution = Resolution::NTSC; autodetectRefreshRate = 60.0; } else if ( value == 7 ) { autodetectResolution = Resolution::PAL; autodetectRefreshRate = 50.0; } else { if( passedInputSettings_.getResolution() == Resolution::Unknown ) { throw std::runtime_error( "Mode detection failed, does not appear to be a supported mode for Composite."); } } if (autodetectRefreshRate == 0.0) { switch(currentInputSettings_.getResolution()) { case Resolution::NTSC: autodetectRefreshRate=60.0; break; case Resolution::PAL: autodetectRefreshRate=50.0; break; default: throw setting_error( "Mode is not a supported mode for Composite."); break; } } //Merge passed arguments and autodetect information. currentInputSettings_.mergeAutodetect( passedInputSettings_, autodetectResolution, autodetectScanMode, autodetectRefreshRate ); if( passedInputSettings_.getColorSpace()==ColorSpace::Unknown ) { currentInputSettings_.setColorSpace( ColorSpace::YUV ); //Composite=YUV unless overridden. } else { currentInputSettings_.setColorSpace( passedInputSettings_.getColorSpace() ); } currentTranscoderSettings_.mergeAutodetect( passedTranscoderSettings_, currentInputSettings_ ); } catch( usb_error &error ) { throw; } catch( std::runtime_error &error ) { //This snippet prevents lockup. //No idea how, seems all of it needs to be there. readDevice0x9DCD(0x3f); //EXPECTED 0xb0 mailWrite( 0x4e, VC{0x00, 0xcc} ); readDevice0x9DCD(0x94); //EXPECTED 0xb2 mailWrite( 0x4e, VC{0xab, 0x4c} ); readDevice0x9DCD(0x3f); //EXPECTED 0xb2 mailWrite( 0x4e, VC{0x00, 0xce} ); mailWrite( 0x4e, VC{0x1b, 0x33} ); readDevice0x9DCD(0x3f); //EXPECTED 0xb0 mailWrite( 0x4e, VC{0x00, 0xcc} ); readDevice0x9DCD(0x88); //EXPECTED 0xb0 mailWrite( 0x4e, VC{0xb7, 0xce} ); mailWrite( 0x4e, VC{0xb8, 0xdc} ); mailWrite( 0x4e, VC{0xb8, 0xcc} ); readDevice0x9DCD(0x3f); //EXPECTED 0xb2 throw; //Do not "throw error", that causes exception slicing. } if (currentInputSettings_.getResolution()==Resolution::NTSC) { mailWrite( 0x44, VC{0x07, 0x8a} ); mailWrite( 0x44, VC{0x08, 0x9b} ); mailWrite( 0x44, VC{0x09, 0x7a} ); mailWrite( 0x44, VC{0x28, 0x88} ); mailWrite( 0x33, VC{0x89, 0x89, 0xfd} ); mailRead( 0x33, 1 ); //EXPECTED {0x6e} mailWrite( 0x44, VC{0x06, 0x08} ); } mailWrite( 0x33, VC{0x89, 0x89, 0xe7} ); mailRead( 0x33, 1 ); //EXPECTED {0xe9} if (currentInputSettings_.getResolution()==Resolution::PAL) { mailWrite( 0x33, VC{0x89, 0x89, 0xf1} ); mailRead( 0x33, 1 ); //EXPECTED {0x63} mailWrite( 0x4c, VC{0x04, 0x95} ); } //Really probably are fine just being repeated //below, some captures have this here, //some skip it, probably based on thread readiness. configureSetupSubblock(); configureCommonBlockB1( false ); //Should subroutineize this! mailWrite( 0x33, VC{0x99, 0x89, 0xf5} ); mailRead( 0x33, 1 ); //EXPECTED {0x82} mailWrite( 0x33, VC{0x99, 0x89, 0xfd} ); mailRead( 0x33, 1 ); //EXPECTED {0x6f} mailWrite( 0x33, VC{0x99, 0x89, 0xf5} ); mailRead( 0x33, 1 ); //EXPECTED {0x82} mailWrite( 0x33, VC{0x99, 0x89, 0xfc} ); mailRead( 0x33, 1 ); //EXPECTED {0x6e} mailWrite( 0x33, VC{0x99, 0x89, 0xf3} ); mailRead( 0x33, 1 ); //EXPECTED {0x6e} mailWrite( 0x4c, VC{0x0c, 0x89} ); mailWrite( 0x4c, VC{0x0d, 0xc8} ); //This isn't in all captures at this point, but usually appears soon later //Putting it here probably won't hurt, and will help it from being omitted. //It may also be a bank switch that is checked before being written. mailWrite( 0x33, VC{0x99, 0x89, 0xf5} ); uint8_t status=mailRead( 0x33, 1 )[0]; uint8_t mask = status & 0x10; mailWrite( 0x4c, VC{0x0e, (uint8_t) (mask | 0x65)} ); mailWrite( 0x4c, VC{0x0e, (uint8_t) (mask | 0x64)} ); //VERY LITTLE BEFORE THIS configureCommonBlockA(); configureSetupSubblock(); configureCommonBlockB1(false); configureCommonBlockB2(); configureCommonBlockB3(); configureCommonBlockC(); configureCommonBlockB3(); //Pretty sure not necessary to repeat. transcoderFinalConfigure( currentInputSettings_ , currentTranscoderSettings_ ); transcoderSetup( currentInputSettings_, currentTranscoderSettings_ ); scmd(SCMD_INIT, 0xa0, 0x0000); uint16_t state=read_config<uint16_t>(SCMD_STATE_READBACK_REGISTER); //EXPECTED=0x0001 scmd(SCMD_STATE_CHANGE, 0x00, SCMD_STATE_START); completeStateChange(state, SCMD_STATE_START); //EXPECTED 0x0001 currentInputSettings_.dumpMode(); }