return standard 2048 byte sectors only
| 1246 | |
| 1247 | // return standard 2048 byte sectors only |
| 1248 | static int command_read (int unitnum, uae_u8 *data, int sector, int numsectors) |
| 1249 | { |
| 1250 | struct cdunit *cdu = unitisopen (unitnum); |
| 1251 | if (!cdu) |
| 1252 | return 0; |
| 1253 | struct cdtoc *t = findtoc (cdu, §or, true); |
| 1254 | if (!t) |
| 1255 | return 0; |
| 1256 | cdda_stop (cdu); |
| 1257 | if (t->size == 2048) { |
| 1258 | while (numsectors-- > 0) { |
| 1259 | do_read (cdu, t, data, sector, 0, 2048, false); |
| 1260 | data += 2048; |
| 1261 | sector++; |
| 1262 | } |
| 1263 | } else { |
| 1264 | while (numsectors-- > 0) { |
| 1265 | if (t->size == 2352) { |
| 1266 | uae_u8 b = 0; |
| 1267 | do_read (cdu, t, &b, sector, 15, 1, false); |
| 1268 | // 2 = MODE2 |
| 1269 | do_read (cdu, t, data, sector, b == 2 ? 24 : 16, 2048, false); |
| 1270 | } else { |
| 1271 | // 2336 |
| 1272 | do_read (cdu, t, data, sector, 8, 2048, false); |
| 1273 | } |
| 1274 | data += 2048; |
| 1275 | sector++; |
| 1276 | } |
| 1277 | } |
| 1278 | cdu->cd_last_pos = sector; |
| 1279 | return 1; |
| 1280 | } |
| 1281 | |
| 1282 | static int command_toc (int unitnum, struct cd_toc_head *th) |
| 1283 | { |
nothing calls this directly
no test coverage detected