本文整理汇总了C++中CDAccess::HintReadSector方法的典型用法代码示例。如果您正苦于以下问题:C++ CDAccess::HintReadSector方法的具体用法?C++ CDAccess::HintReadSector怎么用?C++ CDAccess::HintReadSector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDAccess
的用法示例。
在下文中一共展示了CDAccess::HintReadSector方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadRawSector
bool CDIF_ST::ReadRawSector(uint8 *buf, uint32 lba)
{
if(UnrecoverableError)
{
memset(buf, 0, 2352 + 96);
return(false);
}
//try
{
if(!disc_cdaccess->Read_Raw_Sector(buf, lba))
{
MDFN_PrintError(_("Sector %u read error"), lba);
memset(buf, 0, 2352 + 96);
return(false);
}
}
/*catch(std::exception &e)
{
MDFN_PrintError(_("Sector %u read error: %s"), lba, e.what());
memset(buf, 0, 2352 + 96);
return(false);
}*/
static const int max_ra = 16;
static const int initial_ra = 1;
static const int speedmult_ra = 2;
int ra_count = 0;
if(last_read_lba != ~0U && lba == (last_read_lba + 1))
{
int how_far_ahead = ra_lba - lba;
if(how_far_ahead <= max_ra)
ra_count = std::min(speedmult_ra, 1 + max_ra - how_far_ahead);
else
ra_count++;
}
else if(lba != last_read_lba)
{
ra_lba = lba;
ra_count = initial_ra;
}
last_read_lba = lba;
if(ra_count)
{
disc_cdaccess->HintReadSector(ra_lba, ra_count);
ra_lba += ra_count;
}
return(true);
}
示例2: HintReadSector
void CDIF_ST::HintReadSector(uint32 lba)
{
// TODO: disc_cdaccess seek hint? (probably not, would require asynchronousitycamel)
disc_cdaccess->HintReadSector(lba, 1);
}