| Index: Help/html/config/hacks/expand512448to640480.htmlbody |
| — | — | @@ -1,4 +1,5 @@ |
| 2 | 2 | <p>If the display is set to 640×480, this hack will test if there is a border around the display, and if so, expands the inner 512×448 pixels to the 640×480 screen. In addition, if the display is set to 320×240, this will expand the inner 256×224 pixels to the display.</p>
|
| 3 | 3 | <p>This hack is intended for emulators and similar applications that render at 256×224 or 512×448 resolution, while allowing menus to continue to display properly.</p>
|
| 4 | 4 | <p>For best quality, use a scaled display mode when using this hack.</p>
|
| | 5 | +<p>In DXGL 0.5.14, you can manually edit the registry and use a value of 2 to scale the image only in the horizontal direction. This can help with image quality on CRT displays.</p>
|
| 5 | 6 | <p>Currently, this hack only reads the upper-left pixel of the display.</p> |
| \ No newline at end of file |
| Index: cfgmgr/cfgmgr.c |
| — | — | @@ -667,7 +667,7 @@ |
| 668 | 668 | cfg->DebugMaxGLVersionMajor = ReadDWORD(hKey, cfg->DebugMaxGLVersionMajor, &cfgmask->DebugMaxGLVersionMajor, _T("DebugMaxGLVersionMajor"));
|
| 669 | 669 | cfg->DebugMaxGLVersionMinor = ReadDWORD(hKey, cfg->DebugMaxGLVersionMinor, &cfgmask->DebugMaxGLVersionMinor, _T("DebugMaxGLVersionMinor"));
|
| 670 | 670 | cfg->HackCrop640480to640400 = ReadBool(hKey, cfg->HackCrop640480to640400, &cfgmask->HackCrop640480to640400, _T("HackCrop640480to640400"));
|
| 671 | | - cfg->HackAutoScale512448to640480 = ReadBool(hKey, cfg->HackAutoScale512448to640480, &cfgmask->HackAutoScale512448to640480, _T("HackAutoScale512448to640480"));
|
| | 671 | + cfg->HackAutoScale512448to640480 = ReadDWORD(hKey, cfg->HackAutoScale512448to640480, &cfgmask->HackAutoScale512448to640480, _T("HackAutoScale512448to640480"));
|
| 672 | 672 | cfg->HackNoTVRefresh = ReadBool(hKey, cfg->HackNoTVRefresh, &cfgmask->HackNoTVRefresh, _T("HackNoTVRefresh"));
|
| 673 | 673 | cfg->HackSetCursor = ReadBool(hKey, cfg->HackSetCursor, &cfgmask->HackSetCursor, _T("HackSetCursor"));
|
| 674 | 674 | if(!global && dll)
|
| — | — | @@ -830,7 +830,7 @@ |
| 831 | 831 | WriteDWORD(hKey, cfg->DebugMaxGLVersionMajor, cfgmask->DebugMaxGLVersionMajor, _T("DebugMaxGLVersionMajor"));
|
| 832 | 832 | WriteDWORD(hKey, cfg->DebugMaxGLVersionMinor, cfgmask->DebugMaxGLVersionMinor, _T("DebugMaxGLVersionMinor"));
|
| 833 | 833 | WriteBool(hKey, cfg->HackCrop640480to640400, cfgmask->HackCrop640480to640400, _T("HackCrop640480to640400"));
|
| 834 | | - WriteBool(hKey, cfg->HackAutoScale512448to640480, cfgmask->HackAutoScale512448to640480, _T("HackAutoScale512448to640480"));
|
| | 834 | + WriteDWORD(hKey, cfg->HackAutoScale512448to640480, cfgmask->HackAutoScale512448to640480, _T("HackAutoScale512448to640480"));
|
| 835 | 835 | WriteBool(hKey, cfg->HackNoTVRefresh, cfgmask->HackNoTVRefresh, _T("HackNoTVRefresh"));
|
| 836 | 836 | WriteBool(hKey, cfg->HackSetCursor, cfgmask->HackSetCursor, _T("HackSetCursor"));
|
| 837 | 837 | }
|
| — | — | @@ -964,6 +964,15 @@ |
| 965 | 965 | return atoi(value);
|
| 966 | 966 | }
|
| 967 | 967 |
|
| | 968 | +DWORD INIIntBoolValue(const char *value)
|
| | 969 | +{
|
| | 970 | + if (value[0] == 'F') return 0;
|
| | 971 | + if (value[0] == 'f') return 0;
|
| | 972 | + if (value[0] == 'T') return 1;
|
| | 973 | + if (value[0] == 't') return 1;
|
| | 974 | + return atoi(value);
|
| | 975 | +}
|
| | 976 | +
|
| 968 | 977 | DWORD INIHexValue(const char *value)
|
| 969 | 978 | {
|
| 970 | 979 | return (DWORD)strtoul(value, NULL, 0);
|
| — | — | @@ -1116,7 +1125,7 @@ |
| 1117 | 1126 | if (!_stricmp(section, "hacks"))
|
| 1118 | 1127 | {
|
| 1119 | 1128 | if (!_stricmp(section, "HackCrop640480to640400")) cfg->HackCrop640480to640400 = INIBoolValue(value);
|
| 1120 | | - if (!_stricmp(section, "HackAutoScale512448to640480")) cfg->HackAutoScale512448to640480 = INIBoolValue(value);
|
| | 1129 | + if (!_stricmp(section, "HackAutoScale512448to640480")) cfg->HackAutoScale512448to640480 = INIIntBoolValue(value);
|
| 1121 | 1130 | if (!_stricmp(section, "HackNoTVRefresh")) cfg->HackNoTVRefresh = INIBoolValue(value);
|
| 1122 | 1131 | if (!_stricmp(section, "HackSetCursor")) cfg->HackSetCursor = INIBoolValue(value);
|
| 1123 | 1132 | }
|
| — | — | @@ -1138,6 +1147,12 @@ |
| 1139 | 1148 | }
|
| 1140 | 1149 | }
|
| 1141 | 1150 |
|
| | 1151 | +DWORD WriteINI(DXGLCFG *cfg, DXGLCFG *mask, LPCTSTR path)
|
| | 1152 | +{
|
| | 1153 | + //TODO: Write INI file.
|
| | 1154 | + return ERROR_CALL_NOT_IMPLEMENTED;
|
| | 1155 | +}
|
| | 1156 | +
|
| 1142 | 1157 | void GetCurrentConfig(DXGLCFG *cfg, BOOL initial)
|
| 1143 | 1158 | {
|
| 1144 | 1159 | HKEY hKey;
|
| Index: cfgmgr/cfgmgr.h |
| — | — | @@ -128,6 +128,7 @@ |
| 129 | 129 |
|
| 130 | 130 | void ReadSettings(HKEY hKey, DXGLCFG *cfg, DXGLCFG *mask, BOOL global, BOOL dll, LPTSTR dir);
|
| 131 | 131 | void WriteSettings(HKEY hKey, const DXGLCFG *cfg, const DXGLCFG *mask);
|
| | 132 | +DWORD WriteINI(DXGLCFG *cfg, DXGLCFG *mask, LPCTSTR path);
|
| 132 | 133 | void GetCurrentConfig(DXGLCFG *cfg, BOOL initial);
|
| 133 | 134 | void GetGlobalConfig(DXGLCFG *cfg, BOOL initial);
|
| 134 | 135 | void GetGlobalConfigWithMask(DXGLCFG *cfg, DXGLCFG *mask, BOOL initial);
|
| Index: ddraw/glRenderer.cpp |
| — | — | @@ -3855,10 +3855,18 @@ |
| 3856 | 3856 | }
|
| 3857 | 3857 | if (scale512448)
|
| 3858 | 3858 | {
|
| 3859 | | - This->bltvertices[0].s = This->bltvertices[2].s = 0.9f;
|
| 3860 | | - This->bltvertices[0].t = This->bltvertices[1].t = 0.966666667f;
|
| 3861 | | - This->bltvertices[1].s = This->bltvertices[3].s = 0.1f;
|
| 3862 | | - This->bltvertices[2].t = This->bltvertices[3].t = 0.0333333333f;
|
| | 3859 | + if (dxglcfg.HackAutoScale512448to640480 == 1)
|
| | 3860 | + {
|
| | 3861 | + This->bltvertices[0].s = This->bltvertices[2].s = 0.9f;
|
| | 3862 | + This->bltvertices[0].t = This->bltvertices[1].t = 0.966666667f;
|
| | 3863 | + This->bltvertices[1].s = This->bltvertices[3].s = 0.1f;
|
| | 3864 | + This->bltvertices[2].t = This->bltvertices[3].t = 0.0333333333f;
|
| | 3865 | + }
|
| | 3866 | + else if (dxglcfg.HackAutoScale512448to640480 == 2)
|
| | 3867 | + {
|
| | 3868 | + This->bltvertices[0].s = This->bltvertices[2].s = 0.9f;
|
| | 3869 | + This->bltvertices[1].s = This->bltvertices[3].s = 0.1f;
|
| | 3870 | + }
|
| 3863 | 3871 | }
|
| 3864 | 3872 | else
|
| 3865 | 3873 | {
|
| Index: dxgl-example.ini |
| — | — | @@ -608,8 +608,10 @@ |
| 609 | 609 | ; when when it is detected the out-of-bounds area is clear, like going back
|
| 610 | 610 | ; in-game. This hack should only be enabled on games that render 512x448 with
|
| 611 | 611 | ; black bars in 640x480 mode.
|
| 612 | | -; Default is false
|
| 613 | | -HackAutoScale512448to640480 = false
|
| | 612 | +; If set to 1, this will scale in both X and Y directions. If set to 1, this
|
| | 613 | +; will scale only in the X direction.
|
| | 614 | +; Default is 0
|
| | 615 | +HackAutoScale512448to640480 = 0
|
| 614 | 616 |
|
| 615 | 617 | ; HackNoTVRefresh - Boolean
|
| 616 | 618 | ; Removes TV-compatible refresh rates that may be added by Windows 7 and
|
| Index: dxglcfg/dxglcfg.cpp |
| — | — | @@ -1953,6 +1953,8 @@ |
| 1954 | 1954 |
|
| 1955 | 1955 | LRESULT CALLBACK SaveINICallback(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
| 1956 | 1956 | {
|
| | 1957 | + DWORD error;
|
| | 1958 | + TCHAR errormsg[2048];
|
| 1957 | 1959 | switch(Msg)
|
| 1958 | 1960 | {
|
| 1959 | 1961 | case WM_INITDIALOG:
|
| — | — | @@ -1966,6 +1968,18 @@ |
| 1967 | 1969 | switch (LOWORD(wParam))
|
| 1968 | 1970 | {
|
| 1969 | 1971 | case IDOK:
|
| | 1972 | + error = WriteINI(cfg, cfgmask, apps[current_app].path);
|
| | 1973 | + if (error == 5)
|
| | 1974 | + {
|
| | 1975 | + MessageBox(hWnd, _T("Access denied error writing .ini file. Please re-launch DXGL Config as Administrator and try again."),
|
| | 1976 | + _T("Error"), MB_OK | MB_ICONWARNING);
|
| | 1977 | + }
|
| | 1978 | + else if (error != 0)
|
| | 1979 | + {
|
| | 1980 | + _tcscpy(errormsg, _T("Error writing .ini file:\r\n"));
|
| | 1981 | + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, error, 0, errormsg + _tcslen(errormsg), 2048 - _tcslen(errormsg), NULL);
|
| | 1982 | + MessageBox(hWnd, errormsg, _T("Error"), MB_OK | MB_ICONERROR);
|
| | 1983 | + }
|
| 1970 | 1984 | EndDialog(hWnd, IDOK);
|
| 1971 | 1985 | return TRUE;
|
| 1972 | 1986 | case IDCANCEL:
|
| Index: dxglcfg/dxglcfg.rc |
| — | — | @@ -270,7 +270,7 @@ |
| 271 | 271 | AUTOCHECKBOX "Save SHA-256 signature of existing ddraw.dll", IDC_SAVESHA256, 11, 46, 157, 8, 0, WS_EX_LEFT
|
| 272 | 272 | AUTOCHECKBOX "Prevent DXGL Config from deleting ddraw.dll", IDC_NOUNINSTALL, 11, 56, 156, 8, 0, WS_EX_LEFT
|
| 273 | 273 | PUSHBUTTON "Cancel", IDCANCEL, 131, 76, 50, 14, 0, WS_EX_LEFT
|
| 274 | | - DEFPUSHBUTTON "&Save...", IDOK, 76, 76, 50, 14, 0, WS_EX_LEFT
|
| | 274 | + DEFPUSHBUTTON "&Save", IDOK, 76, 76, 50, 14, 0, WS_EX_LEFT
|
| 275 | 275 | }
|
| 276 | 276 |
|
| 277 | 277 |
|