cdvdgigaherz: Simplify Q subchannel relative offset calculation

That way there's no need to calculate the track length for each track.
This commit is contained in:
Jonathan Li 2016-10-17 02:00:44 +01:00
parent 5d90afe648
commit f314c2a4d9
1 changed files with 3 additions and 8 deletions

View File

@ -352,15 +352,10 @@ s32 CALLBACK CDVDreadSubQ(u32 lsn, cdvdSubQ *subq)
lsn_to_msf(&subq->discM, &subq->discS, &subq->discF, lsn + 150); lsn_to_msf(&subq->discM, &subq->discS, &subq->discF, lsn + 150);
u8 i = strack; u8 i = strack;
while (i <= etrack) { while (i < etrack && lsn < tracks[i + 1].start_lba)
if (lsn <= tracks[i].length) ++i;
break;
lsn -= tracks[i].length;
i++;
}
if (i > etrack) lsn -= tracks[i].start_lba;
i = etrack;
lsn_to_msf(&subq->trackM, &subq->trackS, &subq->trackF, lsn); lsn_to_msf(&subq->trackM, &subq->trackS, &subq->trackF, lsn);