| 2438 | |
| 2439 | |
| 2440 | static int open_device (int unitnum, const TCHAR *ident, int flags) |
| 2441 | { |
| 2442 | struct cdunit *cdu = &cdunits[unitnum]; |
| 2443 | int ret = 0; |
| 2444 | |
| 2445 | if (!cdu->open) { |
| 2446 | uae_sem_init (&cdu->sub_sem, 0, 1); |
| 2447 | cdu->imgname_out[0] = 0; |
| 2448 | cdu->imgname_in[0] = 0; |
| 2449 | if (ident) { |
| 2450 | _tcscpy(cdu->imgname_in, ident); |
| 2451 | cfgfile_resolve_path_out_load(cdu->imgname_in, cdu->imgname_out, MAX_DPATH, PATH_CD); |
| 2452 | parse_image(cdu, cdu->imgname_out); |
| 2453 | } |
| 2454 | cdu->open = true; |
| 2455 | cdu->enabled = true; |
| 2456 | cdu->cdda_volume[0] = 0x7fff; |
| 2457 | cdu->cdda_volume[1] = 0x7fff; |
| 2458 | if (cdimage_unpack_thread == 0) { |
| 2459 | init_comm_pipe (&unpack_pipe, 10, 1); |
| 2460 | uae_start_thread (_T("cdimage_unpack"), cdda_unpack_func, NULL, NULL); |
| 2461 | while (cdimage_unpack_thread == 0) |
| 2462 | Sleep (10); |
| 2463 | } |
| 2464 | ret = 1; |
| 2465 | } |
| 2466 | blkdev_cd_change (unitnum, cdu->imgname_out); |
| 2467 | return ret; |
| 2468 | } |
| 2469 | |
| 2470 | static void close_device (int unitnum) |
| 2471 | { |
nothing calls this directly
no test coverage detected