MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / read_toc

Function read_toc

src/cdtv.cpp:462–488  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

460}
461
462static int read_toc (int track, int msflsn, uae_u8 *out)
463{
464 int j;
465
466 if (ismedia () <= 0)
467 return -1;
468 if (!out)
469 return 0;
470 cd_motor = 1;
471 for (j = 0; j < toc.points; j++) {
472 if (track == toc.toc[j].point) {
473 int lsn = toc.toc[j].paddress;
474 int msf = lsn2msf (lsn);
475 out[0] = 0;
476 out[1] = (toc.toc[j].adr << 4) | (toc.toc[j].control << 0);
477 out[2] = toc.toc[j].point;
478 out[3] = toc.tracks;
479 out[4] = 0;
480 out[5] = (msflsn ? msf : lsn) >> 16;
481 out[6] = (msflsn ? msf : lsn) >> 8;
482 out[7] = (msflsn ? msf : lsn) >> 0;
483 cd_finished = 1;
484 return 8;
485 }
486 }
487 return -1;
488}
489
490static int cdrom_modeset (uae_u8 *cmd)
491{

Callers 1

cdrom_command_threadFunction · 0.85

Calls 2

lsn2msfFunction · 0.85
ismediaFunction · 0.70

Tested by

no test coverage detected