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

Function dev_thread

src/cdtv.cpp:751–818  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

749}
750
751static int dev_thread (void *p)
752{
753 write_log (_T("CDTV: CD thread started\n"));
754 thread_alive = 1;
755 for (;;) {
756
757 uae_u32 b = read_comm_pipe_u32_blocking (&requests);
758 if (b == 0xffff) {
759 thread_alive = -1;
760 return 0;
761 }
762 if (unitnum < 0)
763 continue;
764
765 switch (b)
766 {
767 case 0x0100:
768 dma_do_thread ();
769 break;
770 case 0x0101:
771 {
772 int m = ismedia ();
773 if (m < 0) {
774 write_log (_T("CDTV: device %d lost\n"), unitnum);
775 activate_stch = 1;
776 cd_media = 0;
777 } else if (m != cd_media) {
778 cd_media = m;
779 get_toc ();
780 activate_stch = 1;
781 if (cd_playing)
782 cd_error = 1;
783 }
784 if (cd_media)
785 get_qcode ();
786 }
787 break;
788 case 0x0102: // pause
789 sys_command_cd_pause (unitnum, 1);
790 break;
791 case 0x0103: // unpause
792 sys_command_cd_pause (unitnum, 0);
793 break;
794 case 0x0104: // stop
795 cdaudiostop_do ();
796 break;
797 case 0x0105: // pause
798 pause_audio (1);
799 break;
800 case 0x0106: // unpause
801 pause_audio (0);
802 break;
803 case 0x0107: // frontpanel stop
804 cdaudiostopfp ();
805 break;
806 case 0x0110: // do_play!
807 do_play(false);
808 break;

Callers

nothing calls this directly

Calls 12

dma_do_threadFunction · 0.85
sys_command_cd_pauseFunction · 0.85
pause_audioFunction · 0.85
cdaudiostopfpFunction · 0.85
do_playFunction · 0.85
cdrom_command_threadFunction · 0.85
write_logFunction · 0.70
ismediaFunction · 0.70
get_tocFunction · 0.70
get_qcodeFunction · 0.70
cdaudiostop_doFunction · 0.70

Tested by

no test coverage detected