src/mess/osd/windows/menu.c
| r1825 | r1826 | |
| 1351 | 1351 | { |
| 1352 | 1352 | img = image_from_device_and_index(dev, i); |
| 1353 | 1353 | |
| 1354 | | if (!dev->not_working) |
| 1355 | | { |
| 1356 | | new_item = ID_DEVICE_0 + (image_absolute_index(img) * DEVOPTION_MAX); |
| 1357 | | flags_for_exists = MF_STRING; |
| 1354 | new_item = ID_DEVICE_0 + (image_absolute_index(img) * DEVOPTION_MAX); |
| 1355 | flags_for_exists = MF_STRING; |
| 1358 | 1356 | |
| 1359 | | if (!image_exists(img)) |
| 1360 | | flags_for_exists |= MF_GRAYED; |
| 1357 | if (!image_exists(img)) |
| 1358 | flags_for_exists |= MF_GRAYED; |
| 1361 | 1359 | |
| 1362 | | flags_for_writing = flags_for_exists; |
| 1363 | | if (!image_is_writable(img)) |
| 1364 | | flags_for_writing |= MF_GRAYED; |
| 1360 | flags_for_writing = flags_for_exists; |
| 1361 | if (!image_is_writable(img)) |
| 1362 | flags_for_writing |= MF_GRAYED; |
| 1365 | 1363 | |
| 1366 | | sub_menu = CreateMenu(); |
| 1367 | | append_menu_uistring(sub_menu, MF_STRING, new_item + DEVOPTION_OPEN, UI_mount); |
| 1364 | sub_menu = CreateMenu(); |
| 1365 | append_menu_uistring(sub_menu, MF_STRING, new_item + DEVOPTION_OPEN, UI_mount); |
| 1368 | 1366 | |
| 1369 | | if (dev->creatable) |
| 1370 | | append_menu_uistring(sub_menu, MF_STRING, new_item + DEVOPTION_CREATE, UI_create); |
| 1367 | if (dev->creatable) |
| 1368 | append_menu_uistring(sub_menu, MF_STRING, new_item + DEVOPTION_CREATE, UI_create); |
| 1371 | 1369 | |
| 1372 | | append_menu_uistring(sub_menu, flags_for_exists, new_item + DEVOPTION_CLOSE, UI_unmount); |
| 1370 | append_menu_uistring(sub_menu, flags_for_exists, new_item + DEVOPTION_CLOSE, UI_unmount); |
| 1373 | 1371 | |
| 1374 | 1372 | #if HAS_WAVE |
| 1375 | | if ((dev->type == IO_CASSETTE) && !strcmp(dev->file_extensions, "wav")) |
| 1376 | | { |
| 1377 | | cassette_state state; |
| 1378 | | state = image_exists(img) ? (cassette_get_state(img) & CASSETTE_MASK_UISTATE) : CASSETTE_STOPPED; |
| 1379 | | append_menu_uistring(sub_menu, MF_SEPARATOR, 0, -1); |
| 1380 | | append_menu_uistring(sub_menu, flags_for_exists | ((state == CASSETTE_STOPPED) ? MF_CHECKED : 0), new_item + DEVOPTION_CASSETTE_STOPPAUSE, UI_pauseorstop); |
| 1381 | | append_menu_uistring(sub_menu, flags_for_exists | ((state == CASSETTE_PLAY) ? MF_CHECKED : 0), new_item + DEVOPTION_CASSETTE_PLAY, UI_play); |
| 1382 | | append_menu_uistring(sub_menu, flags_for_writing | ((state == CASSETTE_RECORD) ? MF_CHECKED : 0), new_item + DEVOPTION_CASSETTE_RECORD, UI_record); |
| 1373 | if ((dev->type == IO_CASSETTE) && !strcmp(dev->file_extensions, "wav")) |
| 1374 | { |
| 1375 | cassette_state state; |
| 1376 | state = image_exists(img) ? (cassette_get_state(img) & CASSETTE_MASK_UISTATE) : CASSETTE_STOPPED; |
| 1377 | append_menu_uistring(sub_menu, MF_SEPARATOR, 0, -1); |
| 1378 | append_menu_uistring(sub_menu, flags_for_exists | ((state == CASSETTE_STOPPED) ? MF_CHECKED : 0), new_item + DEVOPTION_CASSETTE_STOPPAUSE, UI_pauseorstop); |
| 1379 | append_menu_uistring(sub_menu, flags_for_exists | ((state == CASSETTE_PLAY) ? MF_CHECKED : 0), new_item + DEVOPTION_CASSETTE_PLAY, UI_play); |
| 1380 | append_menu_uistring(sub_menu, flags_for_writing | ((state == CASSETTE_RECORD) ? MF_CHECKED : 0), new_item + DEVOPTION_CASSETTE_RECORD, UI_record); |
| 1383 | 1381 | #if USE_TAPEDLG |
| 1384 | | append_menu_uistring(sub_menu, flags_for_exists, new_item + DEVOPTION_CASSETTE_DIALOG, UI_tapecontrol); |
| 1382 | append_menu_uistring(sub_menu, flags_for_exists, new_item + DEVOPTION_CASSETTE_DIALOG, UI_tapecontrol); |
| 1385 | 1383 | #else |
| 1386 | | append_menu_uistring(sub_menu, flags_for_exists, new_item + DEVOPTION_CASSETTE_REWIND, UI_rewind); |
| 1387 | | append_menu_uistring(sub_menu, flags_for_exists, new_item + DEVOPTION_CASSETTE_FASTFORWARD, UI_fastforward); |
| 1384 | append_menu_uistring(sub_menu, flags_for_exists, new_item + DEVOPTION_CASSETTE_REWIND, UI_rewind); |
| 1385 | append_menu_uistring(sub_menu, flags_for_exists, new_item + DEVOPTION_CASSETTE_FASTFORWARD, UI_fastforward); |
| 1388 | 1386 | #endif |
| 1389 | | } |
| 1390 | | #endif /* HAS_WAVE */ |
| 1391 | | s = image_exists(img) ? image_filename(img) : ui_getstring(UI_emptyslot); |
| 1392 | | flags = MF_POPUP; |
| 1393 | 1387 | } |
| 1394 | | else |
| 1395 | | { |
| 1396 | | sub_menu = NULL; |
| 1397 | | s = "Not working"; |
| 1398 | | flags = MF_DISABLED | MF_GRAYED; |
| 1399 | | } |
| 1388 | #endif /* HAS_WAVE */ |
| 1389 | s = image_exists(img) ? image_filename(img) : ui_getstring(UI_emptyslot); |
| 1390 | flags = MF_POPUP; |
| 1400 | 1391 | |
| 1401 | 1392 | snprintf(buf, sizeof(buf) / sizeof(buf[0]), "%s: %s", image_typename_id(img), s); |
| 1402 | 1393 | append_menu_utf8(device_menu, flags, (UINT_PTR) sub_menu, buf); |