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

Function sys_command_cd_play

src/blkdev.cpp:831–856  ·  view source on GitHub ↗

play CD audio */

Source from the content-addressed store, hash-verified

829
830/* play CD audio */
831int sys_command_cd_play (int unitnum, int startlsn, int endlsn, int scan)
832{
833 int v;
834 if (failunit (unitnum))
835 return 0;
836 if (!getsem (unitnum))
837 return 0;
838 state[unitnum].play_end_pos = endlsn;
839 if (state[unitnum].device_func->play == NULL) {
840 uae_u8 cmd[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
841 int startmsf = lsn2msf (startlsn);
842 int endmsf = lsn2msf (endlsn);
843 cmd[0] = 0x47;
844 cmd[3] = (uae_u8)(startmsf >> 16);
845 cmd[4] = (uae_u8)(startmsf >> 8);
846 cmd[5] = (uae_u8)(startmsf >> 0);
847 cmd[6] = (uae_u8)(endmsf >> 16);
848 cmd[7] = (uae_u8)(endmsf >> 8);
849 cmd[8] = (uae_u8)(endmsf >> 0);
850 v = do_scsi (unitnum, cmd, sizeof cmd) ? 0 : 1;
851 } else {
852 v = state[unitnum].device_func->play (unitnum, startlsn, endlsn, scan, NULL, NULL);
853 }
854 freesem (unitnum);
855 return v;
856}
857
858/* play CD audio with subchannels */
859int sys_command_cd_play (int unitnum, int startlsn, int endlsn, int scan, play_status_callback statusfunc, play_subchannel_callback subfunc)

Callers 5

cdaudioplay_doFunction · 0.85
dev_do_io_cdFunction · 0.85
scsi_cd_emulateFunction · 0.85
do_playFunction · 0.85
cdtvcr_playFunction · 0.85

Calls 5

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

Tested by

no test coverage detected