MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / sys_command_cd_qcode

Function sys_command_cd_qcode

src/blkdev.cpp:892–911  ·  view source on GitHub ↗

read qcode */

Source from the content-addressed store, hash-verified

890
891/* read qcode */
892int 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 */
914int sys_command_cd_toc (int unitnum, struct cd_toc_head *th)

Callers 7

cdrom_run_readFunction · 0.85
akiko_threadFunction · 0.85
dev_do_io_cdFunction · 0.85
scsi_cd_emulateFunction · 0.85
save_cdFunction · 0.85
get_qcodeFunction · 0.85
get_qcodeFunction · 0.85

Calls 4

failunitFunction · 0.85
getsemFunction · 0.85
do_scsiFunction · 0.85
freesemFunction · 0.85

Tested by

no test coverage detected