src/mess/osd/winui/messui.c
| r7153 | r7154 | |
| 873 | 873 | |
| 874 | 874 | /* Get the path to the currently mounted image */ |
| 875 | 875 | zippath_parent(&as, GetSelectedSoftware(drvindex, config, dev)); |
| 876 | | s = (TCHAR*)astring_c(&as); |
| 876 | s = tstring_from_utf8(astring_c(&as)); |
| 877 | 877 | |
| 878 | 878 | /* See if an image was loaded, and that the path still exists */ |
| 879 | 879 | if ((!osd_opendir(astring_c(&as))) || (astring_chr(&as, 0, ':') == -1)) |
| r7153 | r7154 | |
| 884 | 884 | /* We only want the first path; throw out the rest */ |
| 885 | 885 | i = astring_chr(&as, 0, ';'); |
| 886 | 886 | if (i > 0) astring_substr(&as, 0, i); |
| 887 | | s = (TCHAR*)astring_c(&as); |
| 887 | s = tstring_from_utf8(astring_c(&as)); |
| 888 | 888 | |
| 889 | 889 | /* Make sure a folder was specified in the tab, and that it exists */ |
| 890 | 890 | if ((!osd_opendir(astring_c(&as))) || (astring_chr(&as, 0, ':') == -1)) |
| r7153 | r7154 | |
| 895 | 895 | /* We only want the first path; throw out the rest */ |
| 896 | 896 | i = astring_chr(&as, 0, ';'); |
| 897 | 897 | if (i > 0) astring_substr(&as, 0, i); |
| 898 | | s = (TCHAR*)astring_c(&as); |
| 898 | s = tstring_from_utf8(astring_c(&as)); |
| 899 | 899 | |
| 900 | 900 | /* Make sure a folder was specified in the tab, and that it exists */ |
| 901 | 901 | if ((!osd_opendir(astring_c(&as))) || (astring_chr(&as, 0, ':') == -1)) |
| r7153 | r7154 | |
| 903 | 903 | /* Default to emu directory */ |
| 904 | 904 | char mess_directory[1024]; |
| 905 | 905 | osd_get_emulator_directory(mess_directory, ARRAY_LENGTH(mess_directory)); |
| 906 | | s = (TCHAR*)mess_directory; |
| 906 | s = tstring_from_utf8(mess_directory); |
| 907 | 907 | |
| 908 | 908 | /* If software folder exists, use it instead */ |
| 909 | 909 | zippath_combine(&as, mess_directory, "software"); |
| 910 | | if (osd_opendir(astring_c(&as))) s = (TCHAR*)astring_c(&as); |
| 910 | if (osd_opendir(astring_c(&as))) s = tstring_from_utf8(astring_c(&as)); |
| 911 | 911 | } |
| 912 | 912 | } |
| 913 | 913 | } |
| r7153 | r7154 | |
| 944 | 944 | /* We only want the first path; throw out the rest */ |
| 945 | 945 | i = astring_chr(&as, 0, ';'); |
| 946 | 946 | if (i > 0) astring_substr(&as, 0, i); |
| 947 | | s = (TCHAR*)astring_c(&as); |
| 947 | s = tstring_from_utf8(astring_c(&as)); |
| 948 | 948 | |
| 949 | 949 | /* Make sure a folder was specified in the tab, and that it exists */ |
| 950 | 950 | if ((!osd_opendir(astring_c(&as))) || (astring_chr(&as, 0, ':') == -1)) |
| r7153 | r7154 | |
| 955 | 955 | /* We only want the first path; throw out the rest */ |
| 956 | 956 | i = astring_chr(&as, 0, ';'); |
| 957 | 957 | if (i > 0) astring_substr(&as, 0, i); |
| 958 | | s = (TCHAR*)astring_c(&as); |
| 958 | s = tstring_from_utf8(astring_c(&as)); |
| 959 | 959 | |
| 960 | 960 | /* Make sure a folder was specified in the tab, and that it exists */ |
| 961 | 961 | if ((!osd_opendir(astring_c(&as))) || (astring_chr(&as, 0, ':') == -1)) |
| r7153 | r7154 | |
| 963 | 963 | /* Default to emu directory */ |
| 964 | 964 | char mess_directory[1024]; |
| 965 | 965 | osd_get_emulator_directory(mess_directory, ARRAY_LENGTH(mess_directory)); |
| 966 | | s = (TCHAR*) mess_directory; |
| 966 | s = tstring_from_utf8(mess_directory); |
| 967 | 967 | |
| 968 | 968 | /* If software folder exists, use it instead */ |
| 969 | 969 | zippath_combine(&as, mess_directory, "software"); |
| 970 | | if (osd_opendir(astring_c(&as))) s = (TCHAR*)astring_c(&as); |
| 970 | if (osd_opendir(astring_c(&as))) s = tstring_from_utf8(astring_c(&as)); |
| 971 | 971 | } |
| 972 | 972 | } |
| 973 | 973 | |