| 460 | } |
| 461 | |
| 462 | static 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 | |
| 490 | static int cdrom_modeset (uae_u8 *cmd) |
| 491 | { |
no test coverage detected