| 344 | } |
| 345 | |
| 346 | static int getunitinfo (int unitnum, int drive, cd_standard_unit csu, int *isaudio) |
| 347 | { |
| 348 | struct device_info di; |
| 349 | if (sys_command_info (unitnum, &di, 0)) { |
| 350 | write_log (_T("Scanning drive %s: "), di.label); |
| 351 | if (di.media_inserted) { |
| 352 | if (isaudiotrack (&di.toc, 0)) { |
| 353 | if (*isaudio == 0) |
| 354 | *isaudio = drive; |
| 355 | write_log (_T("CDA")); |
| 356 | } |
| 357 | uae_u8 buffer[2048]; |
| 358 | if (sys_command_cd_read (unitnum, buffer, 16, 1)) { |
| 359 | if (!memcmp (buffer + 8, "CDTV", 4) || !memcmp (buffer + 8, "CD32", 4) || !memcmp (buffer + 8, "COMM", 4)) { |
| 360 | uae_u32 crc; |
| 361 | write_log (_T("CD32 or CDTV")); |
| 362 | if (sys_command_cd_read (unitnum, buffer, 21, 1)) { |
| 363 | crc = get_crc32 (buffer, sizeof buffer); |
| 364 | if (crc == 0xe56c340f) { |
| 365 | write_log (_T(" [CD32.TM]")); |
| 366 | if (csu == CD_STANDARD_UNIT_CD32) { |
| 367 | write_log (_T("\n")); |
| 368 | return 1; |
| 369 | } |
| 370 | } |
| 371 | } |
| 372 | if (csu == CD_STANDARD_UNIT_CDTV || csu == CD_STANDARD_UNIT_CD32) { |
| 373 | write_log (_T("\n")); |
| 374 | return 1; |
| 375 | } |
| 376 | } |
| 377 | } |
| 378 | } else { |
| 379 | write_log (_T("no media")); |
| 380 | } |
| 381 | } |
| 382 | write_log (_T("\n")); |
| 383 | return 0; |
| 384 | } |
| 385 | |
| 386 | static int get_standard_cd_unit2 (struct uae_prefs *p, cd_standard_unit csu) |
| 387 | { |
no test coverage detected