| 1299 | } |
| 1300 | |
| 1301 | static int addtocentry (uae_u8 **dstp, int *len, int point, int newpoint, int msf, uae_u8 *head, struct cd_toc_head *th) |
| 1302 | { |
| 1303 | uae_u8 *dst = *dstp; |
| 1304 | |
| 1305 | for (int i = 0; i < th->points; i++) { |
| 1306 | struct cd_toc *t = &th->toc[i]; |
| 1307 | if (t->point == point) { |
| 1308 | if (*len < 8) |
| 1309 | return 0; |
| 1310 | int addr = t->paddress; |
| 1311 | if (msf) |
| 1312 | addr = lsn2msf (addr); |
| 1313 | dst[0] = 0; |
| 1314 | dst[1] = (t->adr << 4) | t->control; |
| 1315 | dst[2] = newpoint >= 0 ? newpoint : point; |
| 1316 | dst[3] = 0; |
| 1317 | dst[4] = addr >> 24; |
| 1318 | dst[5] = addr >> 16; |
| 1319 | dst[6] = addr >> 8; |
| 1320 | dst[7] = addr >> 0; |
| 1321 | |
| 1322 | if (point >= 1 && point <= 99) { |
| 1323 | if (head[2] == 0) |
| 1324 | head[2] = point; |
| 1325 | head[3] = point; |
| 1326 | } |
| 1327 | |
| 1328 | *len -= 8; |
| 1329 | *dstp = dst + 8; |
| 1330 | return 1; |
| 1331 | } |
| 1332 | } |
| 1333 | return -1; |
| 1334 | } |
| 1335 | |
| 1336 | static int scsiemudrv (int unitnum, uae_u8 *cmd) |
| 1337 | { |
no test coverage detected