src/osd/winui/properties.c
| r8255 | r8256 | |
| 10 | 10 | that you have read the license and understand and accept it fully. |
| 11 | 11 | |
| 12 | 12 | ***************************************************************************/ |
| 13 | | |
| 13 | |
| 14 | 14 | /*************************************************************************** |
| 15 | 15 | |
| 16 | 16 | Properties.c |
| 17 | 17 | |
| 18 | 18 | Properties Popup and Misc UI support routines. |
| 19 | | |
| 19 | |
| 20 | 20 | Created 8/29/98 by Mike Haaland (mhaaland@hypertech.com) |
| 21 | 21 | |
| 22 | 22 | ***************************************************************************/ |
| r8255 | r8256 | |
| 25 | 25 | |
| 26 | 26 | MSH - 20070809 |
| 27 | 27 | -- |
| 28 | | Notes on properties and ini files, reset and reset to default. |
| 28 | Notes on properties and ini files, reset and reset to default. |
| 29 | 29 | ---------------------------------------------------------------------------- |
| 30 | 30 | Each ini contains a complete option set. |
| 31 | 31 | |
| r8255 | r8256 | |
| 255 | 255 | { |
| 256 | 256 | const TCHAR* m_pText; |
| 257 | 257 | const char* m_pData; |
| 258 | | } g_ComboBoxVideo[] = |
| 258 | } g_ComboBoxVideo[] = |
| 259 | 259 | { |
| 260 | 260 | { TEXT("None"), "none" }, |
| 261 | 261 | { TEXT("GDI"), "gdi" }, |
| r8255 | r8256 | |
| 268 | 268 | { |
| 269 | 269 | const TCHAR* m_pText; |
| 270 | 270 | const int m_pData; |
| 271 | | } g_ComboBoxD3DVersion[] = |
| 271 | } g_ComboBoxD3DVersion[] = |
| 272 | 272 | { |
| 273 | 273 | { TEXT("Version 9"), 9 }, |
| 274 | 274 | { TEXT("Version 8"), 8 }, |
| r8255 | r8256 | |
| 280 | 280 | { |
| 281 | 281 | const TCHAR* m_pText; |
| 282 | 282 | const int m_pData; |
| 283 | | } g_ComboBoxSelectScreen[] = |
| 283 | } g_ComboBoxSelectScreen[] = |
| 284 | 284 | { |
| 285 | 285 | { TEXT("Screen 0"), 0 }, |
| 286 | 286 | { TEXT("Screen 1"), 1 }, |
| r8255 | r8256 | |
| 293 | 293 | { |
| 294 | 294 | const TCHAR* m_pText; |
| 295 | 295 | const char* m_pData; |
| 296 | | } g_ComboBoxView[] = |
| 296 | } g_ComboBoxView[] = |
| 297 | 297 | { |
| 298 | 298 | { TEXT("Auto"), "auto" }, |
| 299 | | { TEXT("Standard"), "standard" }, |
| 300 | | { TEXT("Pixel Aspect"), "pixel" }, |
| 299 | { TEXT("Standard"), "standard" }, |
| 300 | { TEXT("Pixel Aspect"), "pixel" }, |
| 301 | 301 | { TEXT("Cocktail"), "cocktail" }, |
| 302 | 302 | }; |
| 303 | 303 | #define NUMVIEW (sizeof(g_ComboBoxView) / sizeof(g_ComboBoxView[0])) |
| r8255 | r8256 | |
| 308 | 308 | { |
| 309 | 309 | const TCHAR* m_pText; |
| 310 | 310 | const char* m_pData; |
| 311 | | } g_ComboBoxDevice[] = |
| 311 | } g_ComboBoxDevice[] = |
| 312 | 312 | { |
| 313 | 313 | { TEXT("None"), "none" }, |
| 314 | 314 | { TEXT("Keyboard"), "keyboard" }, |
| r8255 | r8256 | |
| 323 | 323 | { |
| 324 | 324 | const TCHAR* m_pText; |
| 325 | 325 | const char* m_pData; |
| 326 | | } g_ComboBoxSnapView[] = |
| 326 | } g_ComboBoxSnapView[] = |
| 327 | 327 | { |
| 328 | 328 | { TEXT("Internal"), "internal" }, |
| 329 | 329 | { TEXT("Auto"), "auto" }, |
| 330 | | { TEXT("Standard"), "standard" }, |
| 331 | | { TEXT("Pixel Aspect"), "pixel" }, |
| 330 | { TEXT("Standard"), "standard" }, |
| 331 | { TEXT("Pixel Aspect"), "pixel" }, |
| 332 | 332 | { TEXT("Cocktail"), "cocktail" }, |
| 333 | 333 | }; |
| 334 | 334 | #define NUMSNAPVIEW (sizeof(g_ComboBoxSnapView) / sizeof(g_ComboBoxSnapView[0])) |
| r8255 | r8256 | |
| 385 | 385 | memset(pspages, 0, sizeof(PROPSHEETPAGE) * possiblePropSheets); |
| 386 | 386 | |
| 387 | 387 | maxPropSheets = 0; |
| 388 | | |
| 388 | |
| 389 | 389 | i = ( isGame ) ? 0 : 2; |
| 390 | 390 | |
| 391 | 391 | for (; g_propSheets[i].pfnDlgProc; i++) |
| r8255 | r8256 | |
| 417 | 417 | } |
| 418 | 418 | } |
| 419 | 419 | } |
| 420 | | |
| 420 | |
| 421 | 421 | if (pnMaxPropSheets) |
| 422 | 422 | *pnMaxPropSheets = maxPropSheets; |
| 423 | 423 | |
| r8255 | r8256 | |
| 486 | 486 | PROPSHEETPAGE *pspage; |
| 487 | 487 | TCHAR* t_description = NULL; |
| 488 | 488 | OPTIONS_TYPE default_type = opt_type; |
| 489 | | |
| 489 | |
| 490 | 490 | if (highlight_brush == NULL) |
| 491 | 491 | highlight_brush = CreateSolidBrush(HIGHLIGHT_COLOR); |
| 492 | 492 | |
| r8255 | r8256 | |
| 532 | 532 | |
| 533 | 533 | ZeroMemory(&pshead, sizeof(PROPSHEETHEADER)); |
| 534 | 534 | |
| 535 | | // Set the game to audio to this game |
| 535 | // Set the game to audio to this game |
| 536 | 536 | InitGameAudit(game_num); |
| 537 | 537 | |
| 538 | 538 | // Create the propery sheets |
| r8255 | r8256 | |
| 562 | 562 | case OPTIONS_GLOBAL: |
| 563 | 563 | t_description = tstring_from_utf8("Default Settings"); |
| 564 | 564 | break; |
| 565 | case OPTIONS_PARENT: |
| 566 | case OPTIONS_MAX: |
| 567 | break; |
| 565 | 568 | } |
| 566 | 569 | // If we have no descrption, return. |
| 567 | 570 | if( !t_description ) { |
| r8255 | r8256 | |
| 643 | 646 | const device_config *sound; |
| 644 | 647 | |
| 645 | 648 | buf[0] = 0; |
| 646 | | |
| 649 | |
| 647 | 650 | /* iterate over sound chips */ |
| 648 | 651 | sound = config->devicelist.first(DEVICE_CLASS_SOUND_CHIP); |
| 649 | 652 | while(sound != NULL) |
| r8255 | r8256 | |
| 708 | 711 | |
| 709 | 712 | if (isDriverVector(config)) |
| 710 | 713 | { |
| 711 | | strcpy(buf, "Vector Game"); |
| 714 | strcpy(buf, "Vector Game"); |
| 712 | 715 | } |
| 713 | 716 | else |
| 714 | 717 | { |
| 715 | 718 | const device_config *screen = video_screen_first(config); |
| 716 | 719 | if (screen == NULL) { |
| 717 | | strcpy(buf, "Screenless Game"); |
| 720 | strcpy(buf, "Screenless Game"); |
| 718 | 721 | } |
| 719 | 722 | else { |
| 720 | 723 | for (; screen != NULL; screen = video_screen_next(screen)) { |
| r8255 | r8256 | |
| 773 | 776 | if (DriverIsBroken(driver_index)) |
| 774 | 777 | { |
| 775 | 778 | strcpy(buffer, "Not working"); |
| 776 | | |
| 779 | |
| 777 | 780 | if (drivers[driver_index]->flags & GAME_UNEMULATED_PROTECTION) |
| 778 | 781 | { |
| 779 | 782 | if (*buffer != '\0') |
| r8255 | r8256 | |
| 821 | 824 | if (*buffer != '\0') |
| 822 | 825 | strcat(buffer, "\r\n"); |
| 823 | 826 | strcat(buffer, "Game requires artwork"); |
| 824 | | } |
| 827 | } |
| 825 | 828 | } |
| 826 | 829 | else |
| 827 | 830 | { |
| 828 | 831 | strcpy(buffer, "Working"); |
| 829 | | |
| 832 | |
| 830 | 833 | if (drivers[driver_index]->flags & GAME_UNEMULATED_PROTECTION) |
| 831 | 834 | { |
| 832 | 835 | if (*buffer != '\0') |
| r8255 | r8256 | |
| 874 | 877 | if (*buffer != '\0') |
| 875 | 878 | strcat(buffer, "\r\n"); |
| 876 | 879 | strcat(buffer, "Game requires artwork"); |
| 877 | | } |
| 880 | } |
| 878 | 881 | } |
| 879 | 882 | } |
| 880 | 883 | else |
| r8255 | r8256 | |
| 897 | 900 | else |
| 898 | 901 | { |
| 899 | 902 | strcpy(buffer, "Working"); |
| 900 | | } |
| 903 | } |
| 901 | 904 | if (drivers[driver_index]->flags & GAME_UNEMULATED_PROTECTION) |
| 902 | 905 | { |
| 903 | 906 | if (*buffer != '\0') |
| r8255 | r8256 | |
| 945 | 948 | if (*buffer != '\0') |
| 946 | 949 | strcat(buffer, "\r\n"); |
| 947 | 950 | strcat(buffer, "Game requires artwork"); |
| 948 | | } |
| 951 | } |
| 949 | 952 | } |
| 950 | 953 | return buffer; |
| 951 | 954 | } |
| r8255 | r8256 | |
| 955 | 958 | { |
| 956 | 959 | static char buffer[1024]; |
| 957 | 960 | |
| 958 | | snprintf(buffer,sizeof(buffer),"%s %s",drivers[nIndex]->year,drivers[nIndex]->manufacturer); |
| 961 | snprintf(buffer,sizeof(buffer),"%s %s",drivers[nIndex]->year,drivers[nIndex]->manufacturer); |
| 959 | 962 | return buffer; |
| 960 | 963 | } |
| 961 | 964 | |
| r8255 | r8256 | |
| 970 | 973 | OPTIONS_VERTICAL == opt_type || OPTIONS_HORIZONTAL == opt_type) |
| 971 | 974 | strcpy(buf, "Global folder options\nDefault options used by all games in the folder"); |
| 972 | 975 | else |
| 973 | | sprintf(buf, "%s\n\"%s\"", ModifyThe(drivers[nIndex]->description), drivers[nIndex]->name); |
| 976 | sprintf(buf, "%s\n\"%s\"", ModifyThe(drivers[nIndex]->description), drivers[nIndex]->name); |
| 974 | 977 | return buf; |
| 975 | 978 | } |
| 976 | 979 | |
| r8255 | r8256 | |
| 987 | 990 | nParentIndex = GetParentIndex(drivers[nIndex]); |
| 988 | 991 | sprintf(buf, "%s - \"%s\"", |
| 989 | 992 | ConvertAmpersandString(ModifyThe(drivers[nParentIndex]->description)), |
| 990 | | drivers[nParentIndex]->name); |
| 993 | drivers[nParentIndex]->name); |
| 991 | 994 | } |
| 992 | 995 | |
| 993 | 996 | return buf; |
| r8255 | r8256 | |
| 1024 | 1027 | win_set_window_text_utf8(GetDlgItem(hDlg, IDC_PROP_COLORS), GameInfoColors(g_nGame)); |
| 1025 | 1028 | win_set_window_text_utf8(GetDlgItem(hDlg, IDC_PROP_CLONEOF), GameInfoCloneOf(g_nGame)); |
| 1026 | 1029 | win_set_window_text_utf8(GetDlgItem(hDlg, IDC_PROP_SOURCE), GameInfoSource(g_nGame)); |
| 1027 | | |
| 1030 | |
| 1028 | 1031 | if (DriverIsClone(g_nGame)) |
| 1029 | 1032 | { |
| 1030 | 1033 | ShowWindow(GetDlgItem(hDlg, IDC_PROP_CLONEOF_TEXT), SW_SHOW); |
| r8255 | r8256 | |
| 1066 | 1069 | EnableWindow(GetDlgItem(hDlg, IDC_USE_DEFAULT), (g_bUseDefaults) ? FALSE : TRUE); |
| 1067 | 1070 | EnableWindow(GetDlgItem(hDlg, IDC_PROP_RESET), g_bReset); |
| 1068 | 1071 | ShowWindow(hDlg, SW_SHOW); |
| 1069 | | |
| 1072 | |
| 1070 | 1073 | return 1; |
| 1071 | 1074 | |
| 1072 | 1075 | case WM_HSCROLL: |
| r8255 | r8256 | |
| 1167 | 1170 | options_copy(pCurrentOpts, pDefaultOpts); |
| 1168 | 1171 | // repopulate the controls with the new data |
| 1169 | 1172 | UpdateProperties(hDlg, properties_datamap, pCurrentOpts); |
| 1170 | | |
| 1173 | |
| 1171 | 1174 | g_bUseDefaults = options_equal(pCurrentOpts, pDefaultOpts); |
| 1172 | 1175 | // This evaluates properly |
| 1173 | 1176 | g_bReset = options_equal(pCurrentOpts, pOrigOpts) ? FALSE : TRUE; |
| r8255 | r8256 | |
| 1269 | 1272 | case WM_NOTIFY: |
| 1270 | 1273 | { |
| 1271 | 1274 | // Set to true if we are exiting the properites dialog |
| 1272 | | BOOL bClosing = ((LPPSHNOTIFY) lParam)->lParam; |
| 1275 | BOOL bClosing = ((LPPSHNOTIFY) lParam)->lParam; |
| 1273 | 1276 | |
| 1274 | 1277 | switch (((NMHDR *) lParam)->code) |
| 1275 | 1278 | { |
| 1276 | | //We'll need to use a CheckState Table |
| 1279 | //We'll need to use a CheckState Table |
| 1277 | 1280 | //Because this one gets called for all kinds of other things too, and not only if a check is set |
| 1278 | 1281 | case PSN_SETACTIVE: |
| 1279 | 1282 | /* Initialize the controls. */ |
| r8255 | r8256 | |
| 1300 | 1303 | |
| 1301 | 1304 | // Copy current options to orignal options. |
| 1302 | 1305 | options_copy(pOrigOpts, pCurrentOpts); |
| 1303 | | |
| 1306 | |
| 1304 | 1307 | // Repopulate the controls? WTF? We just read them, they should be fine. |
| 1305 | 1308 | UpdateProperties(hDlg, properties_datamap, pCurrentOpts); |
| 1306 | 1309 | |
| r8255 | r8256 | |
| 1339 | 1342 | |
| 1340 | 1343 | ResetDataMap(hDlg); |
| 1341 | 1344 | SetWindowLongPtr(hDlg, DWLP_MSGRESULT, FALSE); |
| 1342 | | return 1; |
| 1345 | return 1; |
| 1343 | 1346 | |
| 1344 | 1347 | case PSN_RESET: |
| 1345 | 1348 | // Reset to the original values. Disregard changes |
| r8255 | r8256 | |
| 1355 | 1358 | break; |
| 1356 | 1359 | |
| 1357 | 1360 | #if 0 |
| 1358 | | /* FIXME |
| 1361 | /* FIXME |
| 1359 | 1362 | * We need to figure out in which ini of our hierarchy the current value is set, then apply the corresponding colouring. |
| 1360 | 1363 | * Is there an easy way to figure this out? |
| 1361 | 1364 | * The actual colour coding should still work |
| r8255 | r8256 | |
| 1469 | 1472 | HelpFunction((HWND)((LPHELPINFO)lParam)->hItemHandle, MAMEUICONTEXTHELP, HH_TP_HELP_WM_HELP, GetHelpIDs()); |
| 1470 | 1473 | break; |
| 1471 | 1474 | |
| 1472 | | case WM_CONTEXTMENU: |
| 1475 | case WM_CONTEXTMENU: |
| 1473 | 1476 | HelpFunction((HWND)wParam, MAMEUICONTEXTHELP, HH_TP_HELP_CONTEXTMENU, GetHelpIDs()); |
| 1474 | | break; |
| 1477 | break; |
| 1475 | 1478 | |
| 1476 | 1479 | } |
| 1477 | 1480 | EnableWindow(GetDlgItem(hDlg, IDC_PROP_RESET), g_bReset); |
| r8255 | r8256 | |
| 1744 | 1747 | int in_window = 0; |
| 1745 | 1748 | |
| 1746 | 1749 | nIndex = g_nGame; |
| 1747 | | |
| 1750 | |
| 1748 | 1751 | d3d = !mame_stricmp(options_get_string(pCurrentOpts, WINOPTION_VIDEO), "d3d"); |
| 1749 | 1752 | ddraw = !mame_stricmp(options_get_string(pCurrentOpts, WINOPTION_VIDEO), "ddraw"); |
| 1750 | 1753 | gdi = !d3d && !ddraw; |
| r8255 | r8256 | |
| 1782 | 1785 | |
| 1783 | 1786 | EnableWindow(GetDlgItem(hWnd,IDC_D3D_FILTER),d3d); |
| 1784 | 1787 | EnableWindow(GetDlgItem(hWnd,IDC_D3D_VERSION),d3d); |
| 1785 | | |
| 1788 | |
| 1786 | 1789 | //Switchres and D3D or ddraw enable the per screen parameters |
| 1787 | 1790 | |
| 1788 | 1791 | EnableWindow(GetDlgItem(hWnd, IDC_NUMSCREENS), (ddraw || d3d)); |
| r8255 | r8256 | |
| 1841 | 1844 | else |
| 1842 | 1845 | { |
| 1843 | 1846 | BOOL use_lightgun; |
| 1844 | | // Older than XP |
| 1847 | // Older than XP |
| 1845 | 1848 | Button_Enable(GetDlgItem(hWnd,IDC_LIGHTGUN),TRUE); |
| 1846 | 1849 | use_lightgun = Button_GetCheck(GetDlgItem(hWnd,IDC_LIGHTGUN)); |
| 1847 | 1850 | Button_Enable(GetDlgItem(hWnd,IDC_DUAL_LIGHTGUN),use_lightgun); |
| r8255 | r8256 | |
| 1872 | 1875 | EnableWindow(GetDlgItem(hWnd,IDC_AUDIO_LATENCY_TEXT),sound); |
| 1873 | 1876 | SetSamplesEnabled(hWnd, nIndex, sound); |
| 1874 | 1877 | } |
| 1875 | | |
| 1878 | |
| 1876 | 1879 | if (Button_GetCheck(GetDlgItem(hWnd, IDC_AUTOFRAMESKIP))) |
| 1877 | 1880 | EnableWindow(GetDlgItem(hWnd, IDC_FRAMESKIP), FALSE); |
| 1878 | 1881 | else |
| r8255 | r8256 | |
| 2059 | 2062 | |
| 2060 | 2063 | static BOOL DefaultInputReadControl(datamap *map, HWND dialog, HWND control, core_options *opts, const char *option_name) |
| 2061 | 2064 | { |
| 2062 | | TCHAR *input_option_value; |
| 2065 | TCHAR *input_option_value; |
| 2063 | 2066 | int input_option_index; |
| 2064 | 2067 | char *op_val; |
| 2065 | 2068 | |
| 2066 | 2069 | input_option_index = ComboBox_GetCurSel(control); |
| 2067 | | input_option_value = (TCHAR*) ComboBox_GetItemData(control, input_option_index); |
| 2070 | input_option_value = (TCHAR*) ComboBox_GetItemData(control, input_option_index); |
| 2068 | 2071 | op_val = utf8_from_tstring(input_option_value); |
| 2069 | 2072 | options_set_string(opts, OPTION_CTRLR, op_val, OPTION_PRIORITY_CMDLINE); |
| 2070 | 2073 | osd_free(op_val); |
| r8255 | r8256 | |
| 2104 | 2107 | (void)ComboBox_InsertString(control, index, TEXT("Standard")); |
| 2105 | 2108 | (void)ComboBox_SetItemData(control, index, ""); |
| 2106 | 2109 | index++; |
| 2107 | | |
| 2110 | |
| 2108 | 2111 | t_ctrldir = tstring_from_utf8(GetCtrlrDir()); |
| 2109 | 2112 | if( !t_ctrldir ) |
| 2110 | 2113 | { |
| r8255 | r8256 | |
| 2114 | 2117 | } |
| 2115 | 2118 | |
| 2116 | 2119 | _stprintf (path, TEXT("%s\\*.*"), t_ctrldir); |
| 2117 | | |
| 2120 | |
| 2118 | 2121 | osd_free(t_ctrldir); |
| 2119 | 2122 | |
| 2120 | 2123 | hFind = FindFirstFile(path, &FindFileData); |
| 2121 | 2124 | |
| 2122 | 2125 | if (hFind != INVALID_HANDLE_VALUE) |
| 2123 | 2126 | { |
| 2124 | | do |
| 2127 | do |
| 2125 | 2128 | { |
| 2126 | 2129 | // copy the filename |
| 2127 | 2130 | _tcscpy (root,FindFileData.cFileName); |
| r8255 | r8256 | |
| 2148 | 2151 | } |
| 2149 | 2152 | } |
| 2150 | 2153 | while (FindNextFile (hFind, &FindFileData) != 0); |
| 2151 | | |
| 2154 | |
| 2152 | 2155 | FindClose (hFind); |
| 2153 | 2156 | } |
| 2154 | 2157 | |
| 2155 | 2158 | (void)ComboBox_SetCurSel(control, selected); |
| 2156 | | |
| 2159 | |
| 2157 | 2160 | if( t_buf ) |
| 2158 | 2161 | osd_free(t_buf); |
| 2159 | 2162 | |
| r8255 | r8256 | |
| 2261 | 2264 | |
| 2262 | 2265 | } |
| 2263 | 2266 | } |
| 2264 | | if (devmode.dmDisplayFrequency >= 10 ) |
| 2267 | if (devmode.dmDisplayFrequency >= 10 ) |
| 2265 | 2268 | { |
| 2266 | 2269 | // I have some devmode "vga" which specifes 1 Hz, which is probably bogus, so we filter it out |
| 2267 | 2270 | |
| r8255 | r8256 | |
| 2302 | 2305 | |
| 2303 | 2306 | snprintf(screen_option, ARRAY_LENGTH(screen_option), "screen%d", GetSelectedScreen(hWnd)); |
| 2304 | 2307 | |
| 2305 | | if (options_get_string(pCurrentOpts, screen_option) == NULL |
| 2308 | if (options_get_string(pCurrentOpts, screen_option) == NULL |
| 2306 | 2309 | || (mame_stricmp(options_get_string(pCurrentOpts, screen_option), "") == 0 ) |
| 2307 | 2310 | || (mame_stricmp(options_get_string(pCurrentOpts, screen_option), "auto") == 0 ) ) |
| 2308 | 2311 | { |
| r8255 | r8256 | |
| 2369 | 2372 | datamap_add(properties_datamap, IDC_VOLUME, DM_INT, OPTION_VOLUME); |
| 2370 | 2373 | datamap_add(properties_datamap, IDC_VOLUMEDISP, DM_INT, OPTION_VOLUME); |
| 2371 | 2374 | |
| 2372 | | // core input options |
| 2375 | // core input options |
| 2373 | 2376 | datamap_add(properties_datamap, IDC_COINLOCKOUT, DM_BOOL, OPTION_COIN_LOCKOUT); |
| 2374 | 2377 | datamap_add(properties_datamap, IDC_DEFAULT_INPUT, DM_STRING, OPTION_CTRLR); |
| 2375 | 2378 | datamap_add(properties_datamap, IDC_USE_MOUSE, DM_BOOL, OPTION_MOUSE); |
| r8255 | r8256 | |
| 2472 | 2475 | datamap_set_callback(properties_datamap, IDC_REFRESH, DCT_POPULATE_CONTROL, ResolutionPopulateControl); |
| 2473 | 2476 | datamap_set_callback(properties_datamap, IDC_SIZES, DCT_READ_CONTROL, ResolutionReadControl); |
| 2474 | 2477 | datamap_set_callback(properties_datamap, IDC_SIZES, DCT_POPULATE_CONTROL, ResolutionPopulateControl); |
| 2475 | | datamap_set_callback(properties_datamap, IDC_DEFAULT_INPUT, DCT_READ_CONTROL, DefaultInputReadControl); |
| 2478 | datamap_set_callback(properties_datamap, IDC_DEFAULT_INPUT, DCT_READ_CONTROL, DefaultInputReadControl); |
| 2476 | 2479 | datamap_set_callback(properties_datamap, IDC_DEFAULT_INPUT, DCT_POPULATE_CONTROL, DefaultInputPopulateControl); |
| 2477 | 2480 | datamap_set_callback(properties_datamap, IDC_SNAPVIEW, DCT_POPULATE_CONTROL, SnapViewPopulateControl); |
| 2478 | 2481 | |
| r8255 | r8256 | |
| 2557 | 2560 | if ((strcmp(options_get_string(pCurrentOpts, resolution_option), "auto") == 0) && |
| 2558 | 2561 | (strcmp(options_get_string(opts, resolution_option), "auto") == 0)) |
| 2559 | 2562 | return TRUE; |
| 2560 | | |
| 2563 | |
| 2561 | 2564 | sscanf(options_get_string(pCurrentOpts, resolution_option),"%d x %d",&x1,&y1); |
| 2562 | 2565 | sscanf(options_get_string(opts, resolution_option),"%d x %d",&x2,&y2); |
| 2563 | 2566 | |
| 2564 | | return x1 == x2 && y1 == y2; |
| 2567 | return x1 == x2 && y1 == y2; |
| 2565 | 2568 | } |
| 2566 | 2569 | case IDC_ROTATE : |
| 2567 | 2570 | { |
| r8255 | r8256 | |
| 2593 | 2596 | if ( nIndex > -1 ) { |
| 2594 | 2597 | config = machine_config_alloc(drivers[nIndex]->machine_config); |
| 2595 | 2598 | } |
| 2596 | | |
| 2599 | |
| 2597 | 2600 | if (hCtrl) |
| 2598 | 2601 | { |
| 2599 | 2602 | const device_config *sound; |
| r8255 | r8256 | |
| 3096 | 3099 | |
| 3097 | 3100 | // Create a compatible DC |
| 3098 | 3101 | hDCMem = CreateCompatibleDC(hDC); |
| 3099 | | hBmp = CreateCompatibleBitmap(hDC, |
| 3102 | hBmp = CreateCompatibleBitmap(hDC, |
| 3100 | 3103 | rc.right - rc.left, rc.bottom - rc.top); |
| 3101 | 3104 | hBmpOld = (HBITMAP)(SelectObject(hDCMem, hBmp)); |
| 3102 | 3105 | |
| 3103 | 3106 | // Tell the tab control to paint in our DC |
| 3104 | | SendMessage(hwndTab, WM_PRINTCLIENT, (WPARAM)(hDCMem), |
| 3107 | SendMessage(hwndTab, WM_PRINTCLIENT, (WPARAM)(hDCMem), |
| 3105 | 3108 | (LPARAM)(PRF_ERASEBKGND | PRF_CLIENT | PRF_NONCLIENT)); |
| 3106 | 3109 | |
| 3107 | 3110 | // Create a pattern brush from the bitmap selected in our DC |