Index: cfgmgr/ReadMe.txt |
— | — | @@ -547,12 +547,35 @@ |
548 | 548 | REG_DWORD HKCU\DXGL\Profiles\<app>\HackCrop640480to640400
|
549 | 549 | Crops 640x480 display mode to 640x400.
|
550 | 550 |
|
551 | | -Member HackAutoScale512448to640480
|
552 | | -INI Entry HackAutoScale512448to640480
|
| 551 | +Member HackAutoExpandViewport
|
| 552 | +INI Entry HackAutoExpandViewport
|
553 | 553 | INI Group hacks
|
554 | | -REG_DWORD HKCU\DXGL\Profiles\<app>\HackAutoScale512448to640480
|
555 | | -Expands a 512x448 image to 640x480 if the bordering pixels are black.
|
| 554 | +REG_DWORD HKCU\DXGL\Profiles\<app>\HackAutoExpandViewport
|
| 555 | +Applies a hack to expand the viewport if a bodering pixel matches a set value.
|
| 556 | +Valid settings:
|
| 557 | +0 - Hack is disabled.
|
| 558 | +1 - Expands 512x448 to 640x480, or 256x224 to 320x240
|
| 559 | +2 - Expands 512x480 to 640x480, or 256x240 to 320x240
|
556 | 560 |
|
| 561 | +Member HackAutoExpandViewportCompare
|
| 562 | +INI Entry HackAutoExpandViewportCompare
|
| 563 | +INI Group hacks
|
| 564 | +REG_DWORD HKCU\DXGL\Profiles\<app>\HackAutoExpandViewportCompare
|
| 565 | +Comparison method to detect blank pixels when HackAutoExpandViewport is active.
|
| 566 | +Valid settings:
|
| 567 | +0 - Activate when the pixel matches a set color
|
| 568 | +1 - Activate when the pixel color is less than or equal to a set color
|
| 569 | +2 - Activate when the pixel color is greater than or equal to a set color
|
| 570 | +3 - Activate when the pixel value matches a set value (i.e. palette index)
|
| 571 | +4 - Activate when the pixel value is less than or equal to a set value
|
| 572 | +5 - Activate when the pixel value is greater than or equal to a set value
|
| 573 | +
|
| 574 | +Member HackAutoExpandViewportValue
|
| 575 | +INI Entry HackAutoExpandViewportValue
|
| 576 | +INI Group hacks
|
| 577 | +REG_DWORD HKCU\DXGL\Profiles\<app>\HackAutoExpandViewportValue
|
| 578 | +Value to use for detecting blank pixels when HackAutoExpandViewport is active.
|
| 579 | +
|
557 | 580 | Member HackNoTVRefresh
|
558 | 581 | INI Entry HackNoTVRefresh
|
559 | 582 | INI Group hacks
|
Index: cfgmgr/cfgmgr.c |
— | — | @@ -683,7 +683,10 @@ |
684 | 684 | cfg->DebugMaxGLVersionMajor = ReadDWORD(hKey, cfg->DebugMaxGLVersionMajor, &cfgmask->DebugMaxGLVersionMajor, _T("DebugMaxGLVersionMajor"));
|
685 | 685 | cfg->DebugMaxGLVersionMinor = ReadDWORD(hKey, cfg->DebugMaxGLVersionMinor, &cfgmask->DebugMaxGLVersionMinor, _T("DebugMaxGLVersionMinor"));
|
686 | 686 | cfg->HackCrop640480to640400 = ReadBool(hKey, cfg->HackCrop640480to640400, &cfgmask->HackCrop640480to640400, _T("HackCrop640480to640400"));
|
687 | | - cfg->HackAutoScale512448to640480 = ReadDWORD(hKey, cfg->HackAutoScale512448to640480, &cfgmask->HackAutoScale512448to640480, _T("HackAutoScale512448to640480"));
|
| 687 | + cfg->HackAutoExpandViewport = ReadDWORDWithObsolete(hKey, cfg->HackAutoExpandViewport, &cfgmask->HackAutoExpandViewport, _T("HackAutoExpandViewport"),
|
| 688 | + 1, _T("HackAutoScale512448to640480"));
|
| 689 | + cfg->HackAutoExpandViewportCompare = ReadDWORD(hKey, cfg->HackAutoExpandViewportCompare, &cfgmask->HackAutoExpandViewportCompare, _T("HackAutoExpandViewportCompare"));
|
| 690 | + cfg->HackAutoExpandViewportValue = ReadDWORD(hKey, cfg->HackAutoExpandViewportValue, &cfgmask->HackAutoExpandViewportValue, _T("HackAutoExpandViewportValue"));
|
688 | 691 | cfg->HackNoTVRefresh = ReadBool(hKey, cfg->HackNoTVRefresh, &cfgmask->HackNoTVRefresh, _T("HackNoTVRefresh"));
|
689 | 692 | cfg->HackSetCursor = ReadBool(hKey, cfg->HackSetCursor, &cfgmask->HackSetCursor, _T("HackSetCursor"));
|
690 | 693 | if(!global && dll)
|
— | — | @@ -846,7 +849,10 @@ |
847 | 850 | WriteDWORD(hKey, cfg->DebugMaxGLVersionMajor, cfgmask->DebugMaxGLVersionMajor, _T("DebugMaxGLVersionMajor"));
|
848 | 851 | WriteDWORD(hKey, cfg->DebugMaxGLVersionMinor, cfgmask->DebugMaxGLVersionMinor, _T("DebugMaxGLVersionMinor"));
|
849 | 852 | WriteBool(hKey, cfg->HackCrop640480to640400, cfgmask->HackCrop640480to640400, _T("HackCrop640480to640400"));
|
850 | | - WriteDWORD(hKey, cfg->HackAutoScale512448to640480, cfgmask->HackAutoScale512448to640480, _T("HackAutoScale512448to640480"));
|
| 853 | + WriteDWORDDeleteObsolete(hKey, cfg->HackAutoExpandViewport, cfgmask->HackAutoExpandViewport, _T("HackAutoExpandViewport"),
|
| 854 | + 1, _T("HackAutoScale512448to640480"));
|
| 855 | + WriteDWORD(hKey, cfg->HackAutoExpandViewportCompare, cfgmask->HackAutoExpandViewportCompare, _T("HackAutoExpandViewportCompare"));
|
| 856 | + WriteDWORD(hKey, cfg->HackAutoExpandViewportValue, cfgmask->HackAutoExpandViewportValue, _T("HackAutoExpandViewportValue"));
|
851 | 857 | WriteBool(hKey, cfg->HackNoTVRefresh, cfgmask->HackNoTVRefresh, _T("HackNoTVRefresh"));
|
852 | 858 | WriteBool(hKey, cfg->HackSetCursor, cfgmask->HackSetCursor, _T("HackSetCursor"));
|
853 | 859 | }
|
— | — | @@ -1141,10 +1147,13 @@ |
1142 | 1148 | }
|
1143 | 1149 | if (!_stricmp(section, "hacks"))
|
1144 | 1150 | {
|
1145 | | - if (!_stricmp(section, "HackCrop640480to640400")) cfg->HackCrop640480to640400 = INIBoolValue(value);
|
1146 | | - if (!_stricmp(section, "HackAutoScale512448to640480")) cfg->HackAutoScale512448to640480 = INIIntBoolValue(value);
|
1147 | | - if (!_stricmp(section, "HackNoTVRefresh")) cfg->HackNoTVRefresh = INIBoolValue(value);
|
1148 | | - if (!_stricmp(section, "HackSetCursor")) cfg->HackSetCursor = INIBoolValue(value);
|
| 1151 | + if (!_stricmp(name, "HackCrop640480to640400")) cfg->HackCrop640480to640400 = INIBoolValue(value);
|
| 1152 | + if (!_stricmp(name, "HackAutoExpandViewport")) cfg->HackAutoExpandViewport = INIIntBoolValue(value);
|
| 1153 | + if (!_stricmp(name, "HackAutoScale512448to640480")) cfg->HackAutoExpandViewport = INIIntBoolValue(value);
|
| 1154 | + if (!_stricmp(name, "HackAutoExpandViewportCompare")) cfg->HackAutoExpandViewportCompare = INIIntValue(value);
|
| 1155 | + if (!_stricmp(name, "HackAutoExpandViewportValue")) cfg->HackAutoExpandViewportValue = INIHexValue(value);
|
| 1156 | + if (!_stricmp(name, "HackNoTVRefresh")) cfg->HackNoTVRefresh = INIBoolValue(value);
|
| 1157 | + if (!_stricmp(name, "HackSetCursor")) cfg->HackSetCursor = INIBoolValue(value);
|
1149 | 1158 | }
|
1150 | 1159 | return 1;
|
1151 | 1160 | }
|
— | — | @@ -1548,7 +1557,9 @@ |
1549 | 1558 | INIWriteBool(file, "DebugMaxGLVersionMinor", cfg->DebugMaxGLVersionMinor, mask->DebugMaxGLVersionMinor, INISECTION_DEBUG);
|
1550 | 1559 | // [hacks]
|
1551 | 1560 | INIWriteBool(file, "HackCrop640480to640400", cfg->HackCrop640480to640400, mask->HackCrop640480to640400, INISECTION_HACKS);
|
1552 | | - INIWriteInt(file, "HackAutoScale512448to640480", cfg->HackAutoScale512448to640480, mask->HackAutoScale512448to640480, INISECTION_HACKS);
|
| 1561 | + INIWriteInt(file, "HackAutoExpandViewport", cfg->HackAutoExpandViewport, mask->HackAutoExpandViewport, INISECTION_HACKS);
|
| 1562 | + INIWriteInt(file, "HackAutoExpandViewportCompare", cfg->HackAutoExpandViewportCompare, mask->HackAutoExpandViewportCompare, INISECTION_HACKS);
|
| 1563 | + INIWriteHex(file, "HackAutoExpandViewportValue", cfg->HackAutoExpandViewportValue, mask->HackAutoExpandViewportValue, INISECTION_HACKS);
|
1553 | 1564 | INIWriteBool(file, "HackNoTVRefresh", cfg->HackNoTVRefresh, mask->HackNoTVRefresh, INISECTION_HACKS);
|
1554 | 1565 | INIWriteBool(file, "HackSetCursor", cfg->HackSetCursor, mask->HackSetCursor, INISECTION_HACKS);
|
1555 | 1566 | CloseHandle(file);
|
Index: cfgmgr/cfgmgr.h |
— | — | @@ -98,7 +98,9 @@ |
99 | 99 | DWORD DebugMaxGLVersionMinor;
|
100 | 100 | // [hacks]
|
101 | 101 | BOOL HackCrop640480to640400;
|
102 | | - BOOL HackAutoScale512448to640480;
|
| 102 | + DWORD HackAutoExpandViewport;
|
| 103 | + DWORD HackAutoExpandViewportCompare;
|
| 104 | + DWORD HackAutoExpandViewportValue;
|
103 | 105 | BOOL HackNoTVRefresh;
|
104 | 106 | BOOL HackSetCursor;
|
105 | 107 | // internal
|
Index: ddraw/glRenderer.cpp |
— | — | @@ -3677,7 +3677,7 @@ |
3678 | 3678 | DWORD *ptr32;
|
3679 | 3679 | WORD *ptr16;
|
3680 | 3680 | BYTE *ptr8;
|
3681 | | - if (dxglcfg.HackAutoScale512448to640480)
|
| 3681 | + if (dxglcfg.HackAutoExpandViewport)
|
3682 | 3682 | {
|
3683 | 3683 | if ((primary->levels[0].ddsd.dwWidth == 640) && (primary->levels[0].ddsd.dwHeight == 480))
|
3684 | 3684 | {
|
— | — | @@ -3853,7 +3853,7 @@ |
3854 | 3854 | }
|
3855 | 3855 | if (scale512448)
|
3856 | 3856 | {
|
3857 | | - if (dxglcfg.HackAutoScale512448to640480 == 1)
|
| 3857 | + if (dxglcfg.HackAutoExpandViewport == 1)
|
3858 | 3858 | {
|
3859 | 3859 | This->bltvertices[0].s = This->bltvertices[2].s = 0.9f;
|
3860 | 3860 | This->bltvertices[0].t = This->bltvertices[1].t = 0.966666667f;
|
— | — | @@ -3860,7 +3860,7 @@ |
3861 | 3861 | This->bltvertices[1].s = This->bltvertices[3].s = 0.1f;
|
3862 | 3862 | This->bltvertices[2].t = This->bltvertices[3].t = 0.0333333333f;
|
3863 | 3863 | }
|
3864 | | - else if (dxglcfg.HackAutoScale512448to640480 == 2)
|
| 3864 | + else if (dxglcfg.HackAutoExpandViewport == 2)
|
3865 | 3865 | {
|
3866 | 3866 | This->bltvertices[0].s = This->bltvertices[2].s = 0.9f;
|
3867 | 3867 | This->bltvertices[1].s = This->bltvertices[3].s = 0.1f;
|
Index: dxgl-example.ini |
— | — | @@ -601,7 +601,7 @@ |
602 | 602 | ; Default is false
|
603 | 603 | HackCrop640480to640400=false
|
604 | 604 |
|
605 | | -; HackAutoScale512448to640480 - Boolean
|
| 605 | +; HackAutoExpandViewport - Boolean or integer
|
606 | 606 | ; Detects when the application is rendering a 512x448 image in 640x480 mode.
|
607 | 607 | ; This can take effect in 640x480 DR mode in ZSNES, or 640x480 mode in Zelda
|
608 | 608 | ; Classic. If it is detected that the game is drawing outside the 512x448
|
— | — | @@ -610,11 +610,36 @@ |
611 | 611 | ; when when it is detected the out-of-bounds area is clear, like going back
|
612 | 612 | ; in-game. This hack should only be enabled on games that render 512x448 with
|
613 | 613 | ; black bars in 640x480 mode.
|
614 | | -; If set to 1, this will scale in both X and Y directions. If set to 1, this
|
615 | | -; will scale only in the X direction.
|
| 614 | +; This was previously known as HackAutoScale512448to640480.
|
| 615 | +; The following values are valid:
|
| 616 | +; 0 - Do not expand viewport
|
| 617 | +; 1 - Expand 512x448 to 640x480 or 256x224 to 320x240
|
| 618 | +; 2 - Expand 512x480 to 640x480 or 256x240 to 320x240
|
616 | 619 | ; Default is 0
|
617 | | -HackAutoScale512448to640480=0
|
| 620 | +HackAutoExpandViewport=0
|
618 | 621 |
|
| 622 | +; HackAutoExpandViewportCompare - Integer
|
| 623 | +; Selects the comparison methd to detect blank pixels outside the boundary
|
| 624 | +; defined by HackAutoExpandViewport.
|
| 625 | +; The following values are valid:
|
| 626 | +; 0 - Activate when the pixel matches a set color
|
| 627 | +; 1 - Activate when the pixel color is less than or equal to a set color
|
| 628 | +; 2 - Activate when the pixel color is greater than or equal to a set color
|
| 629 | +; 3 - Activate when the pixel value matches a set value (i.e. palette index)
|
| 630 | +; 4 - Activate when the pixel value is less than or equal to a set value
|
| 631 | +; 5 - Activate when the pixel value is greater than or equal to a set value
|
| 632 | +; Default is 0
|
| 633 | +HackAutoExpandViewportCompare=0
|
| 634 | +
|
| 635 | +; HackAutoExpandViewportValue - Hexadecimal integer
|
| 636 | +; Value to use for comparison when detecting blank border pixels.
|
| 637 | +; This value is dependent on the color depth of the primary surface, and
|
| 638 | +; if using color comparison under 8-bit color uses the the 32-bit color of
|
| 639 | +; the pixel's palette lookup, or in value comparison uses the palette index
|
| 640 | +; of the pixel.
|
| 641 | +; Default is 0x0
|
| 642 | +HackAutoExpandViewportValue=0x0
|
| 643 | +
|
619 | 644 | ; HackNoTVRefresh - Boolean
|
620 | 645 | ; Removes TV-compatible refresh rates that may be added by Windows 7 and
|
621 | 646 | ; above. If a rounded refresh rate is not available it will be added.
|
Index: dxglcfg/dxglcfg.cpp |
— | — | @@ -70,6 +70,7 @@ |
71 | 71 | static BOOL ColorDepth_Dropdown = FALSE;
|
72 | 72 | HWND hDialog = NULL;
|
73 | 73 | static BOOL EditInterlock = FALSE;
|
| 74 | +static DWORD hackstabitem = 0xFFFFFFFF;
|
74 | 75 |
|
75 | 76 |
|
76 | 77 | typedef struct
|
— | — | @@ -2237,7 +2238,7 @@ |
2238 | 2239 | cfg->DebugBlendDestColorKey = value;
|
2239 | 2240 | cfgmask->DebugBlendDestColorKey = mask;
|
2240 | 2241 | break;
|
2241 | | - /*case 10:
|
| 2242 | + /*case 11:
|
2242 | 2243 | cfg->DebugDisableErrors = value;
|
2243 | 2244 | cfgmask->DebugDisableErrors = mask;
|
2244 | 2245 | break;*/
|
— | — | @@ -2361,77 +2362,97 @@ |
2362 | 2363 | return TRUE;
|
2363 | 2364 | }
|
2364 | 2365 |
|
2365 | | -void ReadHacksItem(int item, BOOL *value, BOOL *mask)
|
| 2366 | +void UpdateHacksControl(HWND hWnd, int DlgItem, int item)
|
2366 | 2367 | {
|
| 2368 | + TCHAR buffer[64];
|
2367 | 2369 | switch (item)
|
2368 | 2370 | {
|
2369 | 2371 | case 0:
|
2370 | | - *value = cfg->HackCrop640480to640400;
|
2371 | | - *mask = cfgmask->HackCrop640480to640400;
|
| 2372 | + SendDlgItemMessage(hWnd, DlgItem, CB_RESETCONTENT, 0, 0);
|
| 2373 | + _tcscpy(buffer, _T("Disabled"));
|
| 2374 | + SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2375 | + _tcscpy(buffer, _T("Enabled"));
|
| 2376 | + SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2377 | + if (tristate) SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)strdefault);
|
| 2378 | + SetCombo(hWnd, DlgItem, cfg->HackCrop640480to640400, cfgmask->HackCrop640480to640400, tristate);
|
2372 | 2379 | break;
|
2373 | 2380 | case 1:
|
2374 | | - *value = cfg->HackAutoScale512448to640480;
|
2375 | | - *mask = cfgmask->HackAutoScale512448to640480;
|
| 2381 | + SendDlgItemMessage(hWnd, DlgItem, CB_RESETCONTENT, 0, 0);
|
| 2382 | + _tcscpy(buffer, _T("Disabled"));
|
| 2383 | + SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2384 | + _tcscpy(buffer, _T("512x448 to 640x480"));
|
| 2385 | + SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2386 | + _tcscpy(buffer, _T("512x480 to 640x480"));
|
| 2387 | + SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2388 | + if (tristate) SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)strdefault);
|
| 2389 | + SetCombo(hWnd, DlgItem, cfg->HackAutoExpandViewport, cfgmask->HackAutoExpandViewport, tristate);
|
2376 | 2390 | break;
|
2377 | 2391 | case 2:
|
2378 | | - *value = cfg->HackNoTVRefresh;
|
2379 | | - *mask = cfgmask->HackNoTVRefresh;
|
| 2392 | + SendDlgItemMessage(hWnd, DlgItem, CB_RESETCONTENT, 0, 0);
|
| 2393 | + _tcscpy(buffer, _T("Match color"));
|
| 2394 | + SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2395 | + _tcscpy(buffer, _T("Color less than or equal"));
|
| 2396 | + SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2397 | + _tcscpy(buffer, _T("Color greater than or equal"));
|
| 2398 | + SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2399 | + _tcscpy(buffer, _T("Match palette entry"));
|
| 2400 | + SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2401 | + _tcscpy(buffer, _T("Palette less than or equal"));
|
| 2402 | + SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2403 | + _tcscpy(buffer, _T("Palette greater than or equal"));
|
| 2404 | + SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2405 | + if (tristate) SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)strdefault);
|
| 2406 | + SetCombo(hWnd, DlgItem, cfg->HackAutoExpandViewportCompare, cfgmask->HackAutoExpandViewportCompare, tristate);
|
2380 | 2407 | break;
|
2381 | 2408 | case 3:
|
2382 | | - *value = cfg->HackSetCursor;
|
2383 | | - *mask = cfgmask->HackSetCursor;
|
2384 | 2409 | break;
|
2385 | | - default:
|
2386 | | - *value = FALSE;
|
2387 | | - *mask = FALSE;
|
| 2410 | + case 4:
|
| 2411 | + SendDlgItemMessage(hWnd, DlgItem, CB_RESETCONTENT, 0, 0);
|
| 2412 | + _tcscpy(buffer, _T("Disabled"));
|
| 2413 | + SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2414 | + _tcscpy(buffer, _T("Enabled"));
|
| 2415 | + SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2416 | + if (tristate) SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)strdefault);
|
| 2417 | + SetCombo(hWnd, DlgItem, cfg->HackNoTVRefresh, cfgmask->HackNoTVRefresh, tristate);
|
2388 | 2418 | break;
|
2389 | | - }
|
2390 | | -}
|
2391 | | -
|
2392 | | -void WriteHacksItem(int item, BOOL value, BOOL mask)
|
2393 | | -{
|
2394 | | - switch (item)
|
2395 | | - {
|
2396 | | - case 0:
|
2397 | | - cfg->HackCrop640480to640400 = value;
|
2398 | | - cfgmask->HackCrop640480to640400 = mask;
|
| 2419 | + case 5:
|
| 2420 | + SendDlgItemMessage(hWnd, DlgItem, CB_RESETCONTENT, 0, 0);
|
| 2421 | + _tcscpy(buffer, _T("Disabled"));
|
| 2422 | + SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2423 | + _tcscpy(buffer, _T("Enabled"));
|
| 2424 | + SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2425 | + if (tristate) SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)strdefault);
|
| 2426 | + SetCombo(hWnd, DlgItem, cfg->HackSetCursor, cfgmask->HackSetCursor, tristate);
|
2399 | 2427 | break;
|
2400 | | - case 1:
|
2401 | | - cfg->HackAutoScale512448to640480 = value;
|
2402 | | - cfgmask->HackAutoScale512448to640480 = mask;
|
2403 | | - break;
|
2404 | | - case 2:
|
2405 | | - cfg->HackNoTVRefresh = value;
|
2406 | | - cfgmask->HackNoTVRefresh = mask;
|
2407 | | - break;
|
2408 | | - case 3:
|
2409 | | - cfg->HackSetCursor = value;
|
2410 | | - cfgmask->HackSetCursor = mask;
|
2411 | | - break;
|
2412 | 2428 | default:
|
2413 | 2429 | break;
|
2414 | 2430 | }
|
2415 | 2431 | }
|
2416 | | -
|
2417 | 2432 | LRESULT CALLBACK HacksTabCallback(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
2418 | 2433 | {
|
2419 | 2434 | TCHAR str[64];
|
2420 | | - RECT r;
|
| 2435 | + RECT r, r2;
|
| 2436 | + DWORD x;
|
2421 | 2437 | DRAWITEMSTRUCT* drawitem;
|
2422 | 2438 | COLORREF OldTextColor, OldBackColor;
|
2423 | | - BOOL hackvalue, hackmask;
|
2424 | | - DWORD item;
|
2425 | 2439 | switch (Msg)
|
2426 | 2440 | {
|
2427 | 2441 | case WM_INITDIALOG:
|
2428 | 2442 | if (_EnableThemeDialogTexture) _EnableThemeDialogTexture(hWnd, ETDT_ENABLETAB);
|
| 2443 | + SetParent(GetDlgItem(hWnd,IDC_HACKSDROPDOWN), GetDlgItem(hWnd,IDC_HACKSLIST));
|
| 2444 | + SetParent(GetDlgItem(hWnd, IDC_HACKSEDIT), GetDlgItem(hWnd, IDC_HACKSLIST));
|
| 2445 | + ShowWindow(GetDlgItem(GetDlgItem(hWnd, IDC_HACKSLIST), IDC_HACKSDROPDOWN), SW_HIDE);
|
| 2446 | + ShowWindow(GetDlgItem(GetDlgItem(hWnd, IDC_HACKSLIST), IDC_HACKSEDIT), SW_HIDE);
|
2429 | 2447 | return TRUE;
|
2430 | 2448 | case WM_MEASUREITEM:
|
2431 | 2449 | switch (wParam)
|
2432 | 2450 | {
|
2433 | 2451 | case IDC_HACKSLIST:
|
2434 | | - ((LPMEASUREITEMSTRUCT)lParam)->itemHeight = GetSystemMetrics(SM_CYMENUCHECK);
|
2435 | | - ((LPMEASUREITEMSTRUCT)lParam)->itemWidth = GetSystemMetrics(SM_CXMENUCHECK);
|
| 2452 | + if(((LPMEASUREITEMSTRUCT)lParam)->itemID == 3)
|
| 2453 | + GetWindowRect(GetDlgItem(GetDlgItem(hWnd, IDC_HACKSLIST), IDC_HACKSEDIT), &r);
|
| 2454 | + else GetWindowRect(GetDlgItem(GetDlgItem(hWnd, IDC_HACKSLIST), IDC_HACKSDROPDOWN), &r);
|
| 2455 | + ((LPMEASUREITEMSTRUCT)lParam)->itemHeight = r.bottom - r.top;
|
| 2456 | + ((LPMEASUREITEMSTRUCT)lParam)->itemWidth = r.right - r.left;
|
2436 | 2457 | break;
|
2437 | 2458 | default:
|
2438 | 2459 | break;
|
— | — | @@ -2440,40 +2461,70 @@ |
2441 | 2462 | case WM_COMMAND:
|
2442 | 2463 | switch (LOWORD(wParam))
|
2443 | 2464 | {
|
| 2465 | + case IDC_HACKSDROPDOWN:
|
| 2466 | + switch (hackstabitem)
|
| 2467 | + {
|
| 2468 | + case 0:
|
| 2469 | + cfg->HackCrop640480to640400 = GetCombo(GetDlgItem(hWnd, IDC_HACKSLIST), IDC_HACKSDROPDOWN,
|
| 2470 | + (DWORD*)&cfgmask->HackCrop640480to640400);
|
| 2471 | + EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
|
| 2472 | + *dirty = TRUE;
|
| 2473 | + break;
|
| 2474 | + case 1:
|
| 2475 | + cfg->HackAutoExpandViewport = GetCombo(GetDlgItem(hWnd, IDC_HACKSLIST), IDC_HACKSDROPDOWN,
|
| 2476 | + &cfgmask->HackAutoExpandViewport);
|
| 2477 | + EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
|
| 2478 | + *dirty = TRUE;
|
| 2479 | + break;
|
| 2480 | + case 2:
|
| 2481 | + cfg->HackAutoExpandViewportCompare = GetCombo(GetDlgItem(hWnd, IDC_HACKSLIST), IDC_HACKSDROPDOWN,
|
| 2482 | + &cfgmask->HackAutoExpandViewportCompare);
|
| 2483 | + EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
|
| 2484 | + *dirty = TRUE;
|
| 2485 | + break;
|
| 2486 | + case 4:
|
| 2487 | + cfg->HackNoTVRefresh = GetCombo(GetDlgItem(hWnd, IDC_HACKSLIST), IDC_HACKSDROPDOWN,
|
| 2488 | + (DWORD*)&cfgmask->HackNoTVRefresh);
|
| 2489 | + EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
|
| 2490 | + *dirty = TRUE;
|
| 2491 | + modelistdirty = TRUE;
|
| 2492 | + break;
|
| 2493 | + case 5:
|
| 2494 | + cfg->HackSetCursor = GetCombo(GetDlgItem(hWnd, IDC_HACKSLIST), IDC_HACKSDROPDOWN,
|
| 2495 | + (DWORD*)&cfgmask->HackSetCursor);
|
| 2496 | + EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
|
| 2497 | + *dirty = TRUE;
|
| 2498 | + break;
|
| 2499 | + default:
|
| 2500 | + break;
|
| 2501 | + }
|
| 2502 | + break;
|
2444 | 2503 | case IDC_HACKSLIST:
|
2445 | 2504 | if ((HIWORD(wParam) == LBN_SELCHANGE) || (HIWORD(wParam) == LBN_DBLCLK))
|
2446 | 2505 | {
|
2447 | | - item = SendDlgItemMessage(hWnd, IDC_HACKSLIST, LB_GETCURSEL, 0, 0);
|
2448 | | - ReadHacksItem(item, &hackvalue, &hackmask);
|
2449 | | - if (tristate)
|
| 2506 | + hackstabitem = SendDlgItemMessage(hWnd, IDC_HACKSLIST, LB_GETCURSEL, 0, 0);
|
| 2507 | + SendDlgItemMessage(hWnd, IDC_HACKSLIST, LB_GETITEMRECT, hackstabitem, (LPARAM)&r2);
|
| 2508 | + if (hackstabitem == 3)
|
2450 | 2509 | {
|
2451 | | - if (hackvalue && hackmask)
|
2452 | | - {
|
2453 | | - hackvalue = FALSE;
|
2454 | | - hackmask = FALSE;
|
2455 | | - }
|
2456 | | - else if (!hackmask)
|
2457 | | - {
|
2458 | | - hackvalue = FALSE;
|
2459 | | - hackmask = TRUE;
|
2460 | | - }
|
2461 | | - else
|
2462 | | - {
|
2463 | | - hackvalue = TRUE;
|
2464 | | - hackmask = TRUE;
|
2465 | | - }
|
| 2510 | + GetWindowRect(GetDlgItem(GetDlgItem(hWnd, IDC_HACKSLIST), IDC_HACKSEDIT), &r);
|
| 2511 | + x = r.right - r.left;
|
| 2512 | + r2.left = r2.right - x;
|
| 2513 | + SetWindowPos(GetDlgItem(GetDlgItem(hWnd, IDC_HACKSLIST), IDC_HACKSEDIT),
|
| 2514 | + HWND_TOP, r2.left, r2.top, x, r2.bottom - r2.top, SWP_SHOWWINDOW);
|
| 2515 | + ShowWindow(GetDlgItem(GetDlgItem(hWnd, IDC_HACKSLIST), IDC_HACKSDROPDOWN), SW_HIDE);
|
| 2516 | + UpdateHacksControl(GetDlgItem(hWnd, IDC_HACKSLIST), IDC_HACKSEDIT, hackstabitem);
|
2466 | 2517 | }
|
2467 | 2518 | else
|
2468 | 2519 | {
|
2469 | | - if (hackvalue)
|
2470 | | - hackvalue = FALSE;
|
2471 | | - else hackvalue = TRUE;
|
| 2520 | + GetWindowRect(GetDlgItem(GetDlgItem(hWnd, IDC_HACKSLIST), IDC_HACKSDROPDOWN), &r);
|
| 2521 | + x = r.right - r.left;
|
| 2522 | + r2.left = r2.right - x;
|
| 2523 | + SetWindowPos(GetDlgItem(GetDlgItem(hWnd, IDC_HACKSLIST), IDC_HACKSDROPDOWN),
|
| 2524 | + HWND_TOP, r2.left, r2.top, x, r2.bottom - r2.top, SWP_SHOWWINDOW);
|
| 2525 | + ShowWindow(GetDlgItem(GetDlgItem(hWnd, IDC_HACKSLIST), IDC_HACKSEDIT), SW_HIDE);
|
| 2526 | + UpdateHacksControl(GetDlgItem(hWnd, IDC_HACKSLIST), IDC_HACKSDROPDOWN, hackstabitem);
|
2472 | 2527 | }
|
2473 | | - WriteHacksItem(item, hackvalue, hackmask);
|
2474 | 2528 | RedrawWindow(GetDlgItem(hWnd, IDC_HACKSLIST), NULL, NULL, RDW_INVALIDATE);
|
2475 | | - EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
|
2476 | | - *dirty = TRUE;
|
2477 | | - if(item == 2) modelistdirty = TRUE;
|
2478 | 2529 | }
|
2479 | 2530 | break;
|
2480 | 2531 | default:
|
— | — | @@ -2501,13 +2552,11 @@ |
2502 | 2553 | memcpy(&r, &drawitem->rcItem, sizeof(RECT));
|
2503 | 2554 | r.left = r.left + 2;
|
2504 | 2555 | r.right = r.left + GetSystemMetrics(SM_CXMENUCHECK);
|
2505 | | - ReadHacksItem(drawitem->itemID, &hackvalue, &hackmask);
|
2506 | | - DrawCheck(drawitem->hDC, drawitem->itemState & ODS_SELECTED, hackvalue, FALSE, !hackmask, &r);
|
2507 | | - drawitem->rcItem.left += GetSystemMetrics(SM_CXSMICON) + 5;
|
| 2556 | + drawitem->rcItem.left += 1;
|
2508 | 2557 | SendDlgItemMessage(hWnd, IDC_HACKSLIST, LB_GETTEXT, drawitem->itemID, (LPARAM)str);
|
2509 | 2558 | DrawText(drawitem->hDC, str, _tcslen(str), &drawitem->rcItem,
|
2510 | 2559 | DT_LEFT | DT_SINGLELINE | DT_VCENTER);
|
2511 | | - drawitem->rcItem.left -= GetSystemMetrics(SM_CXSMICON) + 5;
|
| 2560 | + drawitem->rcItem.left -= 1;
|
2512 | 2561 | if (drawitem->itemState & ODS_FOCUS) DrawFocusRect(drawitem->hDC, &drawitem->rcItem);
|
2513 | 2562 | SetTextColor(drawitem->hDC, OldTextColor);
|
2514 | 2563 | SetBkColor(drawitem->hDC, OldBackColor);
|
— | — | @@ -3288,8 +3337,12 @@ |
3289 | 3338 | // Hacks
|
3290 | 3339 | _tcscpy(buffer, _T("Crop 640x480 to 640x400"));
|
3291 | 3340 | SendDlgItemMessage(hTabs[5], IDC_HACKSLIST, LB_ADDSTRING, 0, (LPARAM)buffer);
|
3292 | | - _tcscpy(buffer, _T("Expand 512x448 to 640x480 when border is blank"));
|
| 3341 | + _tcscpy(buffer, _T("Automatically expand viewport"));
|
3293 | 3342 | SendDlgItemMessage(hTabs[5], IDC_HACKSLIST, LB_ADDSTRING, 0, (LPARAM)buffer);
|
| 3343 | + _tcscpy(buffer, _T("Automatic expand comparison method"));
|
| 3344 | + SendDlgItemMessage(hTabs[5], IDC_HACKSLIST, LB_ADDSTRING, 0, (LPARAM)buffer);
|
| 3345 | + _tcscpy(buffer, _T("Automatic expand comparison value"));
|
| 3346 | + SendDlgItemMessage(hTabs[5], IDC_HACKSLIST, LB_ADDSTRING, 0, (LPARAM)buffer);
|
3294 | 3347 | _tcscpy(buffer, _T("Remove TV-compatible refresh rates"));
|
3295 | 3348 | SendDlgItemMessage(hTabs[5], IDC_HACKSLIST, LB_ADDSTRING, 0, (LPARAM)buffer);
|
3296 | 3349 | _tcscpy(buffer, _T("SetCursor hide visibility"));
|
— | — | @@ -3795,6 +3848,7 @@ |
3796 | 3849 | SetGLCombo(hTabs[4], IDC_GLVERSION, &cfg->DebugMaxGLVersionMajor, &cfg->DebugMaxGLVersionMinor,
|
3797 | 3850 | &cfgmask->DebugMaxGLVersionMajor, &cfgmask->DebugMaxGLVersionMinor, tristate, hWnd);
|
3798 | 3851 | // Hacks tab
|
| 3852 | + UpdateHacksControl(GetDlgItem(hTabs[5], IDC_HACKSLIST), IDC_HACKSDROPDOWN, hackstabitem);
|
3799 | 3853 | RedrawWindow(GetDlgItem(hTabs[5], IDC_HACKSLIST), NULL, NULL, RDW_INVALIDATE);
|
3800 | 3854 | }
|
3801 | 3855 | break;
|
Index: dxglcfg/dxglcfg.rc |
— | — | @@ -144,7 +144,7 @@ |
145 | 145 | FONT 8, "Ms Shell Dlg"
|
146 | 146 | {
|
147 | 147 | LTEXT "Changing these options may affect the functionality of DXGL and should only be done if necessary.", IDC_STATIC, 7, 5, 320, 9, SS_LEFT, WS_EX_LEFT
|
148 | | - LISTBOX IDC_DEBUGLIST, 7, 16, 269, 130, WS_TABSTOP | WS_VSCROLL | LBS_NOINTEGRALHEIGHT |
|
| 148 | + LISTBOX IDC_DEBUGLIST, 7, 16, 326, 130, WS_TABSTOP | WS_VSCROLL | LBS_NOINTEGRALHEIGHT |
|
149 | 149 | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOTIFY, WS_EX_LEFT
|
150 | 150 | LTEXT "Maximum OpenGL Version", IDC_STATIC, 8, 153, 86, 9, SS_LEFT, WS_EX_LEFT
|
151 | 151 | COMBOBOX IDC_GLVERSION, 96, 151, 101, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
|
— | — | @@ -158,8 +158,10 @@ |
159 | 159 | FONT 8, "Ms Shell Dlg"
|
160 | 160 | {
|
161 | 161 | LTEXT "These options should be set only for specific programs; use with other programs may cause malfuncion.", IDC_STATIC, 7, 5, 332, 9, SS_LEFT, WS_EX_LEFT
|
162 | | - LISTBOX IDC_HACKSLIST, 7, 16, 269, 148, WS_TABSTOP | WS_VSCROLL | LBS_NOINTEGRALHEIGHT |
|
163 | | - LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOTIFY, WS_EX_LEFT
|
| 162 | + COMBOBOX IDC_HACKSDROPDOWN, 186, 17, 146, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
|
| 163 | + EDITTEXT IDC_HACKSEDIT, 186, 32, 146, 14, ES_AUTOHSCROLL, WS_EX_LEFT
|
| 164 | + LISTBOX IDC_HACKSLIST, 7, 16, 326, 148, WS_TABSTOP | WS_VSCROLL | LBS_NOINTEGRALHEIGHT |
|
| 165 | + LBS_OWNERDRAWVARIABLE | LBS_HASSTRINGS | LBS_NOTIFY, WS_EX_LEFT
|
164 | 166 | }
|
165 | 167 |
|
166 | 168 |
|
Index: dxglcfg/resource.h |
— | — | @@ -127,6 +127,8 @@ |
128 | 128 |
|
129 | 129 | // Controls - Hacks Tab
|
130 | 130 | #define IDC_HACKSLIST 2501
|
| 131 | +#define IDC_HACKSDROPDOWN 2502
|
| 132 | +#define IDC_HACKSEDIT 2503
|
131 | 133 |
|
132 | 134 | // Controls - Graphics Tests Tab
|
133 | 135 | #define IDC_TESTLIST 2601
|