| 1096 | return di2; |
| 1097 | } |
| 1098 | struct device_info *sys_command_info (int unitnum, struct device_info *di, int quick) |
| 1099 | { |
| 1100 | struct device_info *dix; |
| 1101 | |
| 1102 | dix = sys_command_info_session (unitnum, di, quick, -1); |
| 1103 | if (dix && dix->media_inserted && !quick && !dix->audio_playing) { |
| 1104 | TCHAR *name = NULL; |
| 1105 | #ifdef AMIBERRY |
| 1106 | uae_u8 buf[4096]; |
| 1107 | #else |
| 1108 | uae_u8 buf[2048]; |
| 1109 | #endif |
| 1110 | if (sys_command_cd_read(unitnum, buf, 16, 1)) { |
| 1111 | if ((buf[0] == 1 || buf[0] == 2) && !memcmp(buf + 1, "CD001", 5)) { |
| 1112 | TCHAR *p; |
| 1113 | #ifdef AMIBERRY |
| 1114 | char vol[33]; |
| 1115 | char sysid[33]; |
| 1116 | memcpy(vol, buf + 40, 32); |
| 1117 | vol[32] = 0; |
| 1118 | memcpy(sysid, buf + 8, 32); |
| 1119 | sysid[32] = 0; |
| 1120 | au_copy(dix->volume_id, 32, vol); |
| 1121 | au_copy(dix->system_id, 32, sysid); |
| 1122 | #else |
| 1123 | au_copy(dix->volume_id, 32, (uae_char*)buf + 40); |
| 1124 | au_copy(dix->system_id, 32, (uae_char*)buf + 8); |
| 1125 | #endif |
| 1126 | p = dix->volume_id + _tcslen(dix->volume_id) - 1; |
| 1127 | while (p > dix->volume_id && *p == ' ') |
| 1128 | *p-- = 0; |
| 1129 | p = dix->system_id + _tcslen(dix->system_id) - 1; |
| 1130 | while (p > dix->system_id && *p == ' ') |
| 1131 | *p-- = 0; |
| 1132 | } |
| 1133 | } |
| 1134 | } |
| 1135 | return dix; |
| 1136 | } |
| 1137 | |
| 1138 | #define MODE_SELECT_6 0x15 |
| 1139 | #define MODE_SENSE_6 0x1a |
no test coverage detected