read qcode */
| 890 | |
| 891 | /* read qcode */ |
| 892 | int sys_command_cd_qcode (int unitnum, uae_u8 *buf, int sector, bool all) |
| 893 | { |
| 894 | int v; |
| 895 | if (failunit (unitnum)) |
| 896 | return 0; |
| 897 | if (!getsem (unitnum)) |
| 898 | return 0; |
| 899 | if (state[unitnum].device_func->qcode == NULL) { |
| 900 | if (all) { |
| 901 | v = 0; |
| 902 | } else { |
| 903 | uae_u8 cmd[10] = {0x42,2,0x40,1,0,0,0,(uae_u8)(SUBQ_SIZE>>8),(uae_u8)(SUBQ_SIZE&0xff),0}; |
| 904 | v = do_scsi (unitnum, cmd, sizeof cmd, buf, SUBQ_SIZE); |
| 905 | } |
| 906 | } else { |
| 907 | v = state[unitnum].device_func->qcode (unitnum, buf, sector, all); |
| 908 | } |
| 909 | freesem (unitnum); |
| 910 | return v; |
| 911 | }; |
| 912 | |
| 913 | /* read table of contents */ |
| 914 | int sys_command_cd_toc (int unitnum, struct cd_toc_head *th) |
no test coverage detected